Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>

int m,n;
int thickness[100];

int ok(int x){
	int i,j=0,w;
	for(i=0;i<m;i++){
		w=x;
		while(j<n&&thickness[j]<=w)w-=thickness[j++];
		if(j==n)break;
	}
	return j==n;
}
int main(){
	int i,l,mid,r;
	while(scanf("%d%d",&m,&n)==2&&(m||n)){
		for(i=0;i<n;i++)scanf("%d",&thickness[i]);
		l=1;r=1500000;
		while(1<r-l){
			mid=(l+r)/2;
			if(ok(mid))r=mid;
			else l=mid;
		}
		printf("%d\n",r);
	}
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	m
	.bss
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	thickness
	.align 32
	.type	thickness, @object
	.size	thickness, 400
thickness:
	.zero	400
	.text
	.globl	ok
	.type	ok, @function
ok:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L2
.L8:
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L3
.L5:
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -8(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	thickness(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	%eax, -4(%rbp)
.L3:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jge	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	thickness(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	jge	.L5
.L4:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	je	.L10
	addl	$1, -12(%rbp)
.L2:
	movl	m(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L8
	jmp	.L7
.L10:
	nop
.L7:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	sete	%al
	movzbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	ok, .-ok
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	jmp	.L12
.L19:
	movl	$0, -16(%rbp)
	jmp	.L13
.L14:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	thickness(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -16(%rbp)
.L13:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L14
	movl	$1, -12(%rbp)
	movl	$1500000, -8(%rbp)
	jmp	.L15
.L17:
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	ok
	testl	%eax, %eax
	je	.L16
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L15
.L16:
	movl	-4(%rbp), %eax
	movl	%eax, -12(%rbp)
.L15:
	movl	-8(%rbp), %eax
	subl	-12(%rbp), %eax
	cmpl	$1, %eax
	jg	.L17
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L12:
	leaq	n(%rip), %rax
	movq	%rax, %rdx
	leaq	m(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	jne	.L18
	movl	m(%rip), %eax
	testl	%eax, %eax
	jne	.L19
	movl	n(%rip), %eax
	testl	%eax, %eax
	jne	.L19
.L18:
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	ok
	.type	ok, @function
ok:
.LFB23:
	.cfi_startproc
	endbr64
	movl	m(%rip), %r10d
	movl	n(%rip), %r8d
	xorl	%eax, %eax
	xorl	%r9d, %r9d
	leaq	thickness(%rip), %r11
	testl	%r10d, %r10d
	jle	.L22
	.p2align 4,,10
	.p2align 3
.L2:
	cmpl	%r8d, %eax
	jge	.L10
	movslq	%eax, %rdx
	leaq	(%r11,%rdx,4), %rcx
	movl	%edi, %edx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L5:
	addl	$1, %eax
	subl	%esi, %edx
	addq	$4, %rcx
	cmpl	%r8d, %eax
	je	.L15
.L11:
	movl	(%rcx), %esi
	cmpl	%edx, %esi
	jle	.L5
	addl	$1, %r9d
	cmpl	%r10d, %r9d
	jne	.L2
.L8:
	cmpl	%r8d, %eax
	sete	%al
	movzbl	%al, %eax
	ret
.L10:
	je	.L15
	leal	1(%r9), %edx
	cmpl	%r10d, %edx
	je	.L8
.L7:
	addl	$1, %edx
	cmpl	%edx, %r10d
	jle	.L8
	cmpl	%r8d, %eax
	jne	.L7
.L15:
	movl	$1, %eax
	ret
.L22:
	xorl	%eax, %eax
	testl	%r8d, %r8d
	sete	%al
	ret
	.cfi_endproc
.LFE23:
	.size	ok, .-ok
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	thickness(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	n(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	m(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
.L24:
	xorl	%eax, %eax
	movq	%r12, %rdx
	leaq	.LC2(%rip), %rdi
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	jne	.L44
	movl	m(%rip), %r10d
	movl	n(%rip), %edi
	movl	%r10d, %eax
	orl	%edi, %eax
	je	.L44
	leaq	thickness(%rip), %r15
	xorl	%r14d, %r14d
	testl	%edi, %edi
	jle	.L40
.L25:
	movq	%r15, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	n(%rip), %edi
	addq	$4, %r15
	cmpl	%r14d, %edi
	jg	.L25
	movl	m(%rip), %r10d
.L40:
	movl	$1, %r15d
	movl	$1500000, %r11d
	.p2align 4,,10
	.p2align 3
.L26:
	leal	(%r15,%r11), %eax
	movl	$1, %r8d
	movl	%eax, %r9d
	shrl	$31, %r9d
	addl	%eax, %r9d
	xorl	%eax, %eax
	sarl	%r9d
	movl	%r9d, %r14d
	testl	%r10d, %r10d
	jle	.L28
	cmpl	%eax, %edi
	jle	.L34
	.p2align 4,,10
	.p2align 3
.L55:
	movslq	%eax, %rdx
	leaq	0(%r13,%rdx,4), %rcx
	movl	%r9d, %edx
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L30:
	addl	$1, %eax
	subl	%esi, %edx
	addq	$4, %rcx
	cmpl	%edi, %eax
	je	.L29
.L35:
	movl	(%rcx), %esi
	cmpl	%edx, %esi
	jle	.L30
	cmpl	%r10d, %r8d
	jge	.L28
	addl	$1, %r8d
	cmpl	%eax, %edi
	jg	.L55
.L34:
	je	.L29
.L32:
	movl	%r11d, %eax
	subl	%r9d, %eax
	cmpl	$1, %eax
	jle	.L56
	movl	%r9d, %r15d
	movl	%r11d, %r14d
	.p2align 4,,10
	.p2align 3
.L36:
	movl	%r14d, %r11d
	jmp	.L26
.L28:
	cmpl	%eax, %edi
	jne	.L32
	.p2align 4,,10
	.p2align 3
.L29:
	subl	%r15d, %r9d
	cmpl	$1, %r9d
	jg	.L36
.L37:
	movl	%r14d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L24
.L44:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L56:
	.cfi_restore_state
	movl	%r11d, %r14d
	jmp	.L37
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	thickness
	.bss
	.align 32
	.type	thickness, @object
	.size	thickness, 400
thickness:
	.zero	400
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	ok
	.type	ok, @function
ok:
.LFB23:
	.cfi_startproc
	endbr64
	movl	m(%rip), %r10d
	movl	n(%rip), %r8d
	xorl	%eax, %eax
	xorl	%r9d, %r9d
	leaq	thickness(%rip), %r11
	testl	%r10d, %r10d
	jle	.L22
	.p2align 4,,10
	.p2align 3
.L2:
	cmpl	%r8d, %eax
	jge	.L10
	movslq	%eax, %rdx
	leaq	(%r11,%rdx,4), %rcx
	movl	%edi, %edx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L5:
	addl	$1, %eax
	subl	%esi, %edx
	addq	$4, %rcx
	cmpl	%r8d, %eax
	je	.L15
.L11:
	movl	(%rcx), %esi
	cmpl	%edx, %esi
	jle	.L5
	addl	$1, %r9d
	cmpl	%r10d, %r9d
	jne	.L2
.L8:
	cmpl	%r8d, %eax
	sete	%al
	movzbl	%al, %eax
	ret
.L10:
	je	.L15
	leal	1(%r9), %edx
	cmpl	%r10d, %edx
	je	.L8
.L7:
	addl	$1, %edx
	cmpl	%edx, %r10d
	jle	.L8
	cmpl	%r8d, %eax
	jne	.L7
.L15:
	movl	$1, %eax
	ret
.L22:
	xorl	%eax, %eax
	testl	%r8d, %r8d
	sete	%al
	ret
	.cfi_endproc
.LFE23:
	.size	ok, .-ok
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	thickness(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	n(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	m(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
.L24:
	xorl	%eax, %eax
	movq	%r12, %rdx
	leaq	.LC2(%rip), %rdi
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	jne	.L44
	movl	m(%rip), %r10d
	movl	n(%rip), %edi
	movl	%r10d, %eax
	orl	%edi, %eax
	je	.L44
	leaq	thickness(%rip), %r15
	xorl	%r14d, %r14d
	testl	%edi, %edi
	jle	.L40
.L25:
	movq	%r15, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	n(%rip), %edi
	addq	$4, %r15
	cmpl	%r14d, %edi
	jg	.L25
	movl	m(%rip), %r10d
.L40:
	movl	$1, %r15d
	movl	$1500000, %r11d
	.p2align 4,,10
	.p2align 3
.L26:
	leal	(%r15,%r11), %eax
	movl	$1, %r8d
	movl	%eax, %r9d
	shrl	$31, %r9d
	addl	%eax, %r9d
	xorl	%eax, %eax
	sarl	%r9d
	movl	%r9d, %r14d
	testl	%r10d, %r10d
	jle	.L28
	cmpl	%eax, %edi
	jle	.L34
	.p2align 4,,10
	.p2align 3
.L55:
	movslq	%eax, %rdx
	leaq	0(%r13,%rdx,4), %rcx
	movl	%r9d, %edx
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L30:
	addl	$1, %eax
	subl	%esi, %edx
	addq	$4, %rcx
	cmpl	%edi, %eax
	je	.L29
.L35:
	movl	(%rcx), %esi
	cmpl	%edx, %esi
	jle	.L30
	cmpl	%r10d, %r8d
	jge	.L28
	addl	$1, %r8d
	cmpl	%eax, %edi
	jg	.L55
.L34:
	je	.L29
.L32:
	movl	%r11d, %eax
	subl	%r9d, %eax
	cmpl	$1, %eax
	jle	.L56
	movl	%r9d, %r15d
	movl	%r11d, %r14d
	.p2align 4,,10
	.p2align 3
.L36:
	movl	%r14d, %r11d
	jmp	.L26
.L28:
	cmpl	%eax, %edi
	jne	.L32
	.p2align 4,,10
	.p2align 3
.L29:
	subl	%r15d, %r9d
	cmpl	$1, %r9d
	jg	.L36
.L37:
	movl	%r14d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L24
.L44:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L56:
	.cfi_restore_state
	movl	%r11d, %r14d
	jmp	.L37
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	thickness
	.bss
	.align 32
	.type	thickness, @object
	.size	thickness, 400
thickness:
	.zero	400
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include<stdio.h>

int m,n;
int thickness[100];

int ok(int x){
	int i,j=0,w;
	for(i=0;i<m;i++){
		w=x;
		while(j<n&&thickness[j]<=w)w-=thickness[j++];
		if(j==n)break;
	}
	return j==n;
}
int main(){
	int i,l,mid,r;
	while(scanf("%d%d",&m,&n)==2&&(m||n)){
		for(i=0;i<n;i++)scanf("%d",&thickness[i]);
		l=1;r=1500000;
		while(1<r-l){
			mid=(l+r)/2;
			if(ok(mid))r=mid;
			else l=mid;
		}
		printf("%d\n",r);
	}
}
3 9
500
300
800
200
100
600
900
700
400
4 3
1000
1000
1010
0 0
 3 9
500
311
800
335
100
600
900
700
400
4 3
1000
1000
1010
0 0
 3 9
559
311
800
335
100
563
900
700
400
4 3
1000
1000
1010
0 0
 3 9
500
300
800
200
100
600
900
1032
400
4 3
1000
1000
1000
0 0
 3 9
500
300
800
200
000
600
900
700
400
4 3
1000
1000
1010
0 0
 3 9
500
253
800
335
100
600
900
700
400
4 3
1000
1000
1010
0 0
 3 9
559
311
800
335
110
600
900
700
400
4 3
1000
1000
1010
0 0
 3 9
559
311
656
335
100
563
900
700
400
4 3
1000
1000
1010
0 0
 3 9
500
300
800
200
100
871
900
1032
400
4 3
1000
1000
1000
0 0
 3 9
500
300
800
200
001
600
900
700
400
4 3
1000
1000
1010
0 0

1800
1010
 1935
1010
 1898
1010
 1800
1000
 1700
1010
 1888
1010
 1945
1010
 1861
1010
 1871
1000
 1701
1010

Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>

int m,n;
int thickness[100];

int ok(int x){
	int i,j=0,w;
	for(i=0;i<m;i++){
		w=x;
		while(j<n&&thickness[j]<=w)w-=thickness[j++];
		if(j==n)break;
	}
	return j==n;
}
int main(){
	int i,l,mid,r;
	while(scanf("%d%d",&m,&n)==2&&(m||n)){
		for(i=0;i<n;i++)scanf("%d",&thickness[i]);
		l=1;r=1500000;
		while(1<r-l){
			mid=(l+r)/2;
			if(ok(mid))r=mid;
			else l=mid;
		}
		printf("%d\n",r);
	}
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	m
	.bss
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	thickness
	.align 32
	.type	thickness, @object
	.size	thickness, 400
thickness:
	.zero	400
	.text
	.globl	ok
	.type	ok, @function
ok:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L2
.L8:
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L3
.L5:
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -8(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	thickness(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	%eax, -4(%rbp)
.L3:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jge	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	thickness(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	jge	.L5
.L4:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	je	.L10
	addl	$1, -12(%rbp)
.L2:
	movl	m(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L8
	jmp	.L7
.L10:
	nop
.L7:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	sete	%al
	movzbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	ok, .-ok
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	jmp	.L12
.L19:
	movl	$0, -16(%rbp)
	jmp	.L13
.L14:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	thickness(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -16(%rbp)
.L13:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L14
	movl	$1, -12(%rbp)
	movl	$1500000, -8(%rbp)
	jmp	.L15
.L17:
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	ok
	testl	%eax, %eax
	je	.L16
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L15
.L16:
	movl	-4(%rbp), %eax
	movl	%eax, -12(%rbp)
.L15:
	movl	-8(%rbp), %eax
	subl	-12(%rbp), %eax
	cmpl	$1, %eax
	jg	.L17
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L12:
	leaq	n(%rip), %rax
	movq	%rax, %rdx
	leaq	m(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	jne	.L18
	movl	m(%rip), %eax
	testl	%eax, %eax
	jne	.L19
	movl	n(%rip), %eax
	testl	%eax, %eax
	jne	.L19
.L18:
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	m
	.bss
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	thickness
	.align 32
	.type	thickness, @object
	.size	thickness, 400
thickness:
	.zero	400
	.text
	.globl	ok
	.type	ok, @function
ok:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L2
.L8:
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L3
.L5:
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -8(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	thickness(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	%eax, -4(%rbp)
.L3:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jge	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	thickness(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	jge	.L5
.L4:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	je	.L10
	addl	$1, -12(%rbp)
.L2:
	movl	m(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L8
	jmp	.L7
.L10:
	nop
.L7:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	sete	%al
	movzbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	ok, .-ok
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	jmp	.L12
.L19:
	movl	$0, -16(%rbp)
	jmp	.L13
.L14:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	thickness(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -16(%rbp)
.L13:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L14
	movl	$1, -12(%rbp)
	movl	$1500000, -8(%rbp)
	jmp	.L15
.L17:
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	ok
	testl	%eax, %eax
	je	.L16
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L15
.L16:
	movl	-4(%rbp), %eax
	movl	%eax, -12(%rbp)
.L15:
	movl	-8(%rbp), %eax
	subl	-12(%rbp), %eax
	cmpl	$1, %eax
	jg	.L17
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L12:
	leaq	n(%rip), %rax
	movq	%rax, %rdx
	leaq	m(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	jne	.L18
	movl	m(%rip), %eax
	testl	%eax, %eax
	jne	.L19
	movl	n(%rip), %eax
	testl	%eax, %eax
	jne	.L19
.L18:
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
