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

```c
#include <stdio.h>
int main(void){
	int m,n,q,r,a,i,j,t[100],s;
	for(;scanf("%d%d",&m,&n),m;printf("%d\n",q)){
		for(s=i=q=0;i<n;i++){
			scanf("%d",&a);
			t[i]=a;
			s+=a;
			if(q<a)q=a;
		}
		r=s>1500000?1500000:s;
		for(;q<r;){
			j=m;
			a=q+r>>1;
			s=0;
			for(i=0;i<n;i++){
				s+=t[i];
				if(s>a){
					if(!--j)break;
					s=t[i];
				}
			}
			if(i==n){	r=a;	}
			else{	q=a+1;	}
		}
	}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.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:
.LFB23:
	.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
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$456, %rsp
	.cfi_def_cfa_offset 512
	movq	%fs:40, %rax
	movq	%rax, 440(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movq	%rax, 8(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	8(%rsp), %rdx
	movq	(%rsp), %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %edx
	testl	%edx, %edx
	je	.L11
	movl	24(%rsp), %eax
	xorl	%r12d, %r12d
	testl	%eax, %eax
	jle	.L4
	xorl	%ebp, %ebp
	xorl	%r14d, %r14d
	leaq	28(%rsp), %r15
	xorl	%r12d, %r12d
	leaq	32(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L3:
	xorl	%eax, %eax
	movq	%r15, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	movl	24(%rsp), %r10d
	addl	%eax, %r14d
	cmpl	%eax, %r12d
	movl	%eax, 0(%r13,%rbp,4)
	cmovl	%eax, %r12d
	addq	$1, %rbp
	cmpl	%ebp, %r10d
	jg	.L3
	movl	$1500000, %r11d
	cmpl	%r11d, %r14d
	cmovle	%r14d, %r11d
	cmpl	%r12d, %r11d
	jle	.L4
	movl	20(%rsp), %r14d
	leal	1(%r10), %r9d
	.p2align 4,,10
	.p2align 3
.L10:
	leal	(%r11,%r12), %edi
	sarl	%edi
	testl	%r10d, %r10d
	jle	.L13
	movl	%r14d, %esi
	movl	$1, %eax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L8:
	movl	-4(%r13,%rax,4), %ecx
	addl	%ecx, %edx
	cmpl	%edx, %edi
	jge	.L6
	subl	$1, %esi
	je	.L7
	movl	%ecx, %edx
.L6:
	movl	%eax, %ecx
	addq	$1, %rax
	cmpq	%r9, %rax
	jne	.L8
.L5:
	cmpl	%ecx, %r10d
	jne	.L7
	movl	%edi, %r11d
.L9:
	cmpl	%r12d, %r11d
	jg	.L10
	movl	%edi, 28(%rsp)
.L4:
	movl	%r12d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L7:
	leal	1(%rdi), %r12d
	jmp	.L9
.L13:
	xorl	%ecx, %ecx
	jmp	.L5
.L11:
	movq	440(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$456, %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
.L25:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.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:
.LFB23:
	.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
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$456, %rsp
	.cfi_def_cfa_offset 512
	movq	%fs:40, %rax
	movq	%rax, 440(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movq	%rax, 8(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	8(%rsp), %rdx
	movq	(%rsp), %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %edx
	testl	%edx, %edx
	je	.L11
	movl	24(%rsp), %eax
	xorl	%r12d, %r12d
	testl	%eax, %eax
	jle	.L4
	xorl	%ebp, %ebp
	xorl	%r14d, %r14d
	leaq	28(%rsp), %r15
	xorl	%r12d, %r12d
	leaq	32(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L3:
	xorl	%eax, %eax
	movq	%r15, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	movl	24(%rsp), %r10d
	addl	%eax, %r14d
	cmpl	%eax, %r12d
	movl	%eax, 0(%r13,%rbp,4)
	cmovl	%eax, %r12d
	addq	$1, %rbp
	cmpl	%ebp, %r10d
	jg	.L3
	movl	$1500000, %r11d
	cmpl	%r11d, %r14d
	cmovle	%r14d, %r11d
	cmpl	%r12d, %r11d
	jle	.L4
	movl	20(%rsp), %r14d
	leal	1(%r10), %r9d
	.p2align 4,,10
	.p2align 3
.L10:
	leal	(%r11,%r12), %edi
	sarl	%edi
	testl	%r10d, %r10d
	jle	.L13
	movl	%r14d, %esi
	movl	$1, %eax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L8:
	movl	-4(%r13,%rax,4), %ecx
	addl	%ecx, %edx
	cmpl	%edx, %edi
	jge	.L6
	subl	$1, %esi
	je	.L7
	movl	%ecx, %edx
.L6:
	movl	%eax, %ecx
	addq	$1, %rax
	cmpq	%r9, %rax
	jne	.L8
.L5:
	cmpl	%ecx, %r10d
	jne	.L7
	movl	%edi, %r11d
.L9:
	cmpl	%r12d, %r11d
	jg	.L10
	movl	%edi, 28(%rsp)
.L4:
	movl	%r12d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L7:
	leal	1(%rdi), %r12d
	jmp	.L9
.L13:
	xorl	%ecx, %ecx
	jmp	.L5
.L11:
	movq	440(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$456, %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
.L25:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```
rule
```assembly
	.file	"temp.c"
	.text
	.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:
.LFB23:
	.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
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$456, %rsp
	.cfi_def_cfa_offset 512
	movq	%fs:40, %rax
	movq	%rax, 440(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movq	%rax, 8(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	8(%rsp), %rdx
	movq	(%rsp), %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %edx
	testl	%edx, %edx
	je	.L11
	movl	24(%rsp), %eax
	xorl	%r12d, %r12d
	testl	%eax, %eax
	jle	.L4
	xorl	%ebp, %ebp
	xorl	%r14d, %r14d
	leaq	28(%rsp), %r15
	xorl	%r12d, %r12d
	leaq	32(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L3:
	xorl	%eax, %eax
	movq	%r15, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	movl	24(%rsp), %r10d
	addl	%eax, %r14d
	cmpl	%eax, %r12d
	movl	%eax, 0(%r13,%rbp,4)
	cmovl	%eax, %r12d
	addq	$1, %rbp
	cmpl	%ebp, %r10d
	jg	.L3
	movl	$1500000, %r11d
	cmpl	%r11d, %r14d
	cmovle	%r14d, %r11d
	cmpl	%r12d, %r11d
	jle	.L4
	movl	20(%rsp), %r14d
	leal	1(%r10), %r9d
	.p2align 4,,10
	.p2align 3
.L10:
	leal	(%r11,%r12), %edi
	sarl	%edi
	testl	%r10d, %r10d
	jle	.L13
	movl	%r14d, %esi
	movl	$1, %eax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L8:
	movl	-4(%r13,%rax,4), %ecx
	addl	%ecx, %edx
	cmpl	%edx, %edi
	jge	.L6
	subl	$1, %esi
	je	.L7
	movl	%ecx, %edx
.L6:
	movl	%eax, %ecx
	addq	$1, %rax
	cmpq	%r9, %rax
	jne	.L8
.L5:
	cmpl	%ecx, %r10d
	jne	.L7
	movl	%edi, %r11d
.L9:
	cmpl	%r12d, %r11d
	jg	.L10
	movl	%edi, 28(%rsp)
.L4:
	movl	%r12d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L7:
	leal	1(%rdi), %r12d
	jmp	.L9
.L13:
	xorl	%ecx, %ecx
	jmp	.L5
.L11:
	movq	440(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$456, %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
.L25:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```
```c
#include <stdio.h>
int main(void){
	int m,n,q,r,a,i,j,t[100],s;
	for(;scanf("%d%d",&m,&n),m;printf("%d\n",q)){
		for(s=i=q=0;i<n;i++){
			scanf("%d",&a);
			t[i]=a;
			s+=a;
			if(q<a)q=a;
		}
		r=s>1500000?1500000:s;
		for(;q<r;){
			j=m;
			a=q+r>>1;
			s=0;
			for(i=0;i<n;i++){
				s+=t[i];
				if(s>a){
					if(!--j)break;
					s=t[i];
				}
			}
			if(i==n){	r=a;	}
			else{	q=a+1;	}
		}
	}
	return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
int main(void){
	int m,n,q,r,a,i,j,t[100],s;
	for(;scanf("%d%d",&m,&n),m;printf("%d\n",q)){
		for(s=i=q=0;i<n;i++){
			scanf("%d",&a);
			t[i]=a;
			s+=a;
			if(q<a)q=a;
		}
		r=s>1500000?1500000:s;
		for(;q<r;){
			j=m;
			a=q+r>>1;
			s=0;
			for(i=0;i<n;i++){
				s+=t[i];
				if(s>a){
					if(!--j)break;
					s=t[i];
				}
			}
			if(i==n){	r=a;	}
			else{	q=a+1;	}
		}
	}
	return 0;
}```

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.
Optimized Assembly Code:

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 assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
int main(void){
	int m,n,q,r,a,i,j,t[100],s;
	for(;scanf("%d%d",&m,&n),m;printf("%d\n",q)){
		for(s=i=q=0;i<n;i++){
			scanf("%d",&a);
			t[i]=a;
			s+=a;
			if(q<a)q=a;
		}
		r=s>1500000?1500000:s;
		for(;q<r;){
			j=m;
			a=q+r>>1;
			s=0;
			for(i=0;i<n;i++){
				s+=t[i];
				if(s>a){
					if(!--j)break;
					s=t[i];
				}
			}
			if(i==n){	r=a;	}
			else{	q=a+1;	}
		}
	}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.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:
.LFB23:
	.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
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$456, %rsp
	.cfi_def_cfa_offset 512
	movq	%fs:40, %rax
	movq	%rax, 440(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movq	%rax, 8(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	8(%rsp), %rdx
	movq	(%rsp), %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %edx
	testl	%edx, %edx
	je	.L11
	movl	24(%rsp), %eax
	xorl	%r12d, %r12d
	testl	%eax, %eax
	jle	.L4
	xorl	%ebp, %ebp
	xorl	%r14d, %r14d
	leaq	28(%rsp), %r15
	xorl	%r12d, %r12d
	leaq	32(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L3:
	xorl	%eax, %eax
	movq	%r15, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	movl	24(%rsp), %r10d
	addl	%eax, %r14d
	cmpl	%eax, %r12d
	movl	%eax, 0(%r13,%rbp,4)
	cmovl	%eax, %r12d
	addq	$1, %rbp
	cmpl	%ebp, %r10d
	jg	.L3
	movl	$1500000, %r11d
	cmpl	%r11d, %r14d
	cmovle	%r14d, %r11d
	cmpl	%r12d, %r11d
	jle	.L4
	movl	20(%rsp), %r14d
	leal	1(%r10), %r9d
	.p2align 4,,10
	.p2align 3
.L10:
	leal	(%r11,%r12), %edi
	sarl	%edi
	testl	%r10d, %r10d
	jle	.L13
	movl	%r14d, %esi
	movl	$1, %eax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L8:
	movl	-4(%r13,%rax,4), %ecx
	addl	%ecx, %edx
	cmpl	%edx, %edi
	jge	.L6
	subl	$1, %esi
	je	.L7
	movl	%ecx, %edx
.L6:
	movl	%eax, %ecx
	addq	$1, %rax
	cmpq	%r9, %rax
	jne	.L8
.L5:
	cmpl	%ecx, %r10d
	jne	.L7
	movl	%edi, %r11d
.L9:
	cmpl	%r12d, %r11d
	jg	.L10
	movl	%edi, 28(%rsp)
.L4:
	movl	%r12d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L7:
	leal	1(%rdi), %r12d
	jmp	.L9
.L13:
	xorl	%ecx, %ecx
	jmp	.L5
.L11:
	movq	440(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$456, %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
.L25:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.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:
.LFB23:
	.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
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$456, %rsp
	.cfi_def_cfa_offset 512
	movq	%fs:40, %rax
	movq	%rax, 440(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movq	%rax, 8(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	8(%rsp), %rdx
	movq	(%rsp), %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %edx
	testl	%edx, %edx
	je	.L11
	movl	24(%rsp), %eax
	xorl	%r12d, %r12d
	testl	%eax, %eax
	jle	.L4
	xorl	%ebp, %ebp
	xorl	%r14d, %r14d
	leaq	28(%rsp), %r15
	xorl	%r12d, %r12d
	leaq	32(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L3:
	xorl	%eax, %eax
	movq	%r15, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	movl	24(%rsp), %r10d
	addl	%eax, %r14d
	cmpl	%eax, %r12d
	movl	%eax, 0(%r13,%rbp,4)
	cmovl	%eax, %r12d
	addq	$1, %rbp
	cmpl	%ebp, %r10d
	jg	.L3
	movl	$1500000, %r11d
	cmpl	%r11d, %r14d
	cmovle	%r14d, %r11d
	cmpl	%r12d, %r11d
	jle	.L4
	movl	20(%rsp), %r14d
	leal	1(%r10), %r9d
	.p2align 4,,10
	.p2align 3
.L10:
	leal	(%r11,%r12), %edi
	sarl	%edi
	testl	%r10d, %r10d
	jle	.L13
	movl	%r14d, %esi
	movl	$1, %eax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L8:
	movl	-4(%r13,%rax,4), %ecx
	addl	%ecx, %edx
	cmpl	%edx, %edi
	jge	.L6
	subl	$1, %esi
	je	.L7
	movl	%ecx, %edx
.L6:
	movl	%eax, %ecx
	addq	$1, %rax
	cmpq	%r9, %rax
	jne	.L8
.L5:
	cmpl	%ecx, %r10d
	jne	.L7
	movl	%edi, %r11d
.L9:
	cmpl	%r12d, %r11d
	jg	.L10
	movl	%edi, 28(%rsp)
.L4:
	movl	%r12d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L7:
	leal	1(%rdi), %r12d
	jmp	.L9
.L13:
	xorl	%ecx, %ecx
	jmp	.L5
.L11:
	movq	440(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$456, %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
.L25:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```