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;
	int t[128];
	int i;

	while(1) {
		int top = 1500000, bottom = 0;
		scanf("%d %d", &m, &n);
		if(!m && !n)
			break;
		for(i = 0; i < n; i++)
			scanf("%d", &t[i]);

		while(top != bottom) {
			int med = (top + bottom) / 2;
			int tmp = 0, tmp2 = 0, tmp3 = 0;

			for(i = 0; i < n && tmp2 <= m; i++) {
				if(tmp + t[i] <= med) {
					tmp += t[i];
				}
				else {
					tmp = 0;
					tmp2++;
					i--;
				}
			}

			if(tmp2 < m)
				top = med;
			else
				bottom = med + 1;
		}

		printf("%d\n", bottom);
	}

	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.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	$552, %rsp
	.cfi_def_cfa_offset 608
	movq	%fs:40, %rax
	movq	%rax, 536(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r12
	leaq	8(%rsp), %rbp
.L13:
	xorl	%eax, %eax
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %r9d
	movl	12(%rsp), %r8d
	movl	%r9d, %eax
	orl	%r8d, %eax
	je	.L2
	testl	%r8d, %r8d
	jle	.L3
	leaq	16(%rsp), %r15
	xorl	%r13d, %r13d
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r15, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	addq	$4, %r15
	cmpl	%r13d, %r8d
	jg	.L4
	movl	8(%rsp), %r9d
.L3:
	xorl	%r11d, %r11d
	movl	$1500000, %r10d
.L11:
	cmpl	%r10d, %r11d
	je	.L22
	.p2align 4,,10
	.p2align 3
.L12:
	leal	(%r11,%r10), %eax
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	movl	%eax, %edi
	shrl	$31, %edi
	addl	%eax, %edi
	xorl	%eax, %eax
	sarl	%edi
	testl	%r8d, %r8d
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L6:
	cmpl	%ecx, %r9d
	jl	.L19
.L10:
	movslq	%edx, %rsi
	addl	16(%rsp,%rsi,4), %eax
	cmpl	%edi, %eax
	jg	.L8
	addl	$1, %edx
	cmpl	%edx, %r8d
	jg	.L6
.L7:
	cmpl	%ecx, %r9d
	jle	.L19
	movl	%edi, %r10d
	cmpl	%r10d, %r11d
	jne	.L12
.L22:
	movl	%r11d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L8:
	addl	$1, %ecx
	cmpl	%r8d, %edx
	jge	.L7
	xorl	%eax, %eax
	cmpl	%ecx, %r9d
	jge	.L10
.L19:
	leal	1(%rdi), %r11d
	jmp	.L11
.L2:
	movq	536(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$552, %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
.L23:
	.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 %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.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	$552, %rsp
	.cfi_def_cfa_offset 608
	movq	%fs:40, %rax
	movq	%rax, 536(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r12
	leaq	8(%rsp), %rbp
.L13:
	xorl	%eax, %eax
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %r9d
	movl	12(%rsp), %r8d
	movl	%r9d, %eax
	orl	%r8d, %eax
	je	.L2
	testl	%r8d, %r8d
	jle	.L3
	leaq	16(%rsp), %r15
	xorl	%r13d, %r13d
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r15, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	addq	$4, %r15
	cmpl	%r13d, %r8d
	jg	.L4
	movl	8(%rsp), %r9d
.L3:
	xorl	%r11d, %r11d
	movl	$1500000, %r10d
.L11:
	cmpl	%r10d, %r11d
	je	.L22
	.p2align 4,,10
	.p2align 3
.L12:
	leal	(%r11,%r10), %eax
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	movl	%eax, %edi
	shrl	$31, %edi
	addl	%eax, %edi
	xorl	%eax, %eax
	sarl	%edi
	testl	%r8d, %r8d
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L6:
	cmpl	%ecx, %r9d
	jl	.L19
.L10:
	movslq	%edx, %rsi
	addl	16(%rsp,%rsi,4), %eax
	cmpl	%edi, %eax
	jg	.L8
	addl	$1, %edx
	cmpl	%edx, %r8d
	jg	.L6
.L7:
	cmpl	%ecx, %r9d
	jle	.L19
	movl	%edi, %r10d
	cmpl	%r10d, %r11d
	jne	.L12
.L22:
	movl	%r11d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L8:
	addl	$1, %ecx
	cmpl	%r8d, %edx
	jge	.L7
	xorl	%eax, %eax
	cmpl	%ecx, %r9d
	jge	.L10
.L19:
	leal	1(%rdi), %r11d
	jmp	.L11
.L2:
	movq	536(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$552, %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
.L23:
	.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 %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.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	$552, %rsp
	.cfi_def_cfa_offset 608
	movq	%fs:40, %rax
	movq	%rax, 536(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r12
	leaq	8(%rsp), %rbp
.L13:
	xorl	%eax, %eax
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %r9d
	movl	12(%rsp), %r8d
	movl	%r9d, %eax
	orl	%r8d, %eax
	je	.L2
	testl	%r8d, %r8d
	jle	.L3
	leaq	16(%rsp), %r15
	xorl	%r13d, %r13d
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r15, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	addq	$4, %r15
	cmpl	%r13d, %r8d
	jg	.L4
	movl	8(%rsp), %r9d
.L3:
	xorl	%r11d, %r11d
	movl	$1500000, %r10d
.L11:
	cmpl	%r10d, %r11d
	je	.L22
	.p2align 4,,10
	.p2align 3
.L12:
	leal	(%r11,%r10), %eax
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	movl	%eax, %edi
	shrl	$31, %edi
	addl	%eax, %edi
	xorl	%eax, %eax
	sarl	%edi
	testl	%r8d, %r8d
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L6:
	cmpl	%ecx, %r9d
	jl	.L19
.L10:
	movslq	%edx, %rsi
	addl	16(%rsp,%rsi,4), %eax
	cmpl	%edi, %eax
	jg	.L8
	addl	$1, %edx
	cmpl	%edx, %r8d
	jg	.L6
.L7:
	cmpl	%ecx, %r9d
	jle	.L19
	movl	%edi, %r10d
	cmpl	%r10d, %r11d
	jne	.L12
.L22:
	movl	%r11d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L8:
	addl	$1, %ecx
	cmpl	%r8d, %edx
	jge	.L7
	xorl	%eax, %eax
	cmpl	%ecx, %r9d
	jge	.L10
.L19:
	leal	1(%rdi), %r11d
	jmp	.L11
.L2:
	movq	536(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$552, %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
.L23:
	.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;
	int t[128];
	int i;

	while(1) {
		int top = 1500000, bottom = 0;
		scanf("%d %d", &m, &n);
		if(!m && !n)
			break;
		for(i = 0; i < n; i++)
			scanf("%d", &t[i]);

		while(top != bottom) {
			int med = (top + bottom) / 2;
			int tmp = 0, tmp2 = 0, tmp3 = 0;

			for(i = 0; i < n && tmp2 <= m; i++) {
				if(tmp + t[i] <= med) {
					tmp += t[i];
				}
				else {
					tmp = 0;
					tmp2++;
					i--;
				}
			}

			if(tmp2 < m)
				top = med;
			else
				bottom = med + 1;
		}

		printf("%d\n", bottom);
	}

	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;
	int t[128];
	int i;

	while(1) {
		int top = 1500000, bottom = 0;
		scanf("%d %d", &m, &n);
		if(!m && !n)
			break;
		for(i = 0; i < n; i++)
			scanf("%d", &t[i]);

		while(top != bottom) {
			int med = (top + bottom) / 2;
			int tmp = 0, tmp2 = 0, tmp3 = 0;

			for(i = 0; i < n && tmp2 <= m; i++) {
				if(tmp + t[i] <= med) {
					tmp += t[i];
				}
				else {
					tmp = 0;
					tmp2++;
					i--;
				}
			}

			if(tmp2 < m)
				top = med;
			else
				bottom = med + 1;
		}

		printf("%d\n", bottom);
	}

	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;
	int t[128];
	int i;

	while(1) {
		int top = 1500000, bottom = 0;
		scanf("%d %d", &m, &n);
		if(!m && !n)
			break;
		for(i = 0; i < n; i++)
			scanf("%d", &t[i]);

		while(top != bottom) {
			int med = (top + bottom) / 2;
			int tmp = 0, tmp2 = 0, tmp3 = 0;

			for(i = 0; i < n && tmp2 <= m; i++) {
				if(tmp + t[i] <= med) {
					tmp += t[i];
				}
				else {
					tmp = 0;
					tmp2++;
					i--;
				}
			}

			if(tmp2 < m)
				top = med;
			else
				bottom = med + 1;
		}

		printf("%d\n", bottom);
	}

	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.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	$552, %rsp
	.cfi_def_cfa_offset 608
	movq	%fs:40, %rax
	movq	%rax, 536(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r12
	leaq	8(%rsp), %rbp
.L13:
	xorl	%eax, %eax
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %r9d
	movl	12(%rsp), %r8d
	movl	%r9d, %eax
	orl	%r8d, %eax
	je	.L2
	testl	%r8d, %r8d
	jle	.L3
	leaq	16(%rsp), %r15
	xorl	%r13d, %r13d
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r15, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	addq	$4, %r15
	cmpl	%r13d, %r8d
	jg	.L4
	movl	8(%rsp), %r9d
.L3:
	xorl	%r11d, %r11d
	movl	$1500000, %r10d
.L11:
	cmpl	%r10d, %r11d
	je	.L22
	.p2align 4,,10
	.p2align 3
.L12:
	leal	(%r11,%r10), %eax
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	movl	%eax, %edi
	shrl	$31, %edi
	addl	%eax, %edi
	xorl	%eax, %eax
	sarl	%edi
	testl	%r8d, %r8d
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L6:
	cmpl	%ecx, %r9d
	jl	.L19
.L10:
	movslq	%edx, %rsi
	addl	16(%rsp,%rsi,4), %eax
	cmpl	%edi, %eax
	jg	.L8
	addl	$1, %edx
	cmpl	%edx, %r8d
	jg	.L6
.L7:
	cmpl	%ecx, %r9d
	jle	.L19
	movl	%edi, %r10d
	cmpl	%r10d, %r11d
	jne	.L12
.L22:
	movl	%r11d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L8:
	addl	$1, %ecx
	cmpl	%r8d, %edx
	jge	.L7
	xorl	%eax, %eax
	cmpl	%ecx, %r9d
	jge	.L10
.L19:
	leal	1(%rdi), %r11d
	jmp	.L11
.L2:
	movq	536(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$552, %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
.L23:
	.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 %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.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	$552, %rsp
	.cfi_def_cfa_offset 608
	movq	%fs:40, %rax
	movq	%rax, 536(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r12
	leaq	8(%rsp), %rbp
.L13:
	xorl	%eax, %eax
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %r9d
	movl	12(%rsp), %r8d
	movl	%r9d, %eax
	orl	%r8d, %eax
	je	.L2
	testl	%r8d, %r8d
	jle	.L3
	leaq	16(%rsp), %r15
	xorl	%r13d, %r13d
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r15, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	addq	$4, %r15
	cmpl	%r13d, %r8d
	jg	.L4
	movl	8(%rsp), %r9d
.L3:
	xorl	%r11d, %r11d
	movl	$1500000, %r10d
.L11:
	cmpl	%r10d, %r11d
	je	.L22
	.p2align 4,,10
	.p2align 3
.L12:
	leal	(%r11,%r10), %eax
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	movl	%eax, %edi
	shrl	$31, %edi
	addl	%eax, %edi
	xorl	%eax, %eax
	sarl	%edi
	testl	%r8d, %r8d
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L6:
	cmpl	%ecx, %r9d
	jl	.L19
.L10:
	movslq	%edx, %rsi
	addl	16(%rsp,%rsi,4), %eax
	cmpl	%edi, %eax
	jg	.L8
	addl	$1, %edx
	cmpl	%edx, %r8d
	jg	.L6
.L7:
	cmpl	%ecx, %r9d
	jle	.L19
	movl	%edi, %r10d
	cmpl	%r10d, %r11d
	jne	.L12
.L22:
	movl	%r11d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L8:
	addl	$1, %ecx
	cmpl	%r8d, %edx
	jge	.L7
	xorl	%eax, %eax
	cmpl	%ecx, %r9d
	jge	.L10
.L19:
	leal	1(%rdi), %r11d
	jmp	.L11
.L2:
	movq	536(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$552, %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
.L23:
	.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:
```