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>
#include <limits.h>

#define REP(i,n,m) for(i=n;i<m;i++)
#define rep(i,n) REP(i,0,n)

int isCorrect(int n,int m,int w,int *t){
	int i, now = 0;

	rep(i,n){
		int sum = 0;
		for(;now<m && sum+t[now]<=w;sum+=t[now],now++);
		if(now == m) return 1;
	}

	return 0;
}

int getMin(int sp,int m,int *t){
	int left=0,right=0,sum=0;
	int res = INT_MAX;

	for(;left<m;left++){
		if(left != 0) sum -= t[left-1];
		for(;right<m && sum<=sp;sum+=t[right],right++);
		if(sp < sum && sum < res) res = sum;
	}

	return res;
}

int main(void){
	int i,j,start,end;
	int n,m;
	int w,t[100];

	while(scanf("%d%d",&n,&m) && (n||m)){
		rep(i,m) scanf("%d",&t[i]);

		w = 0;
		rep(i,m) if(w < t[i]) w = t[i];
		while(1){
			if(isCorrect(n,m,w,t)) break;
			w = getMin(w,m,t);
		}
		printf("%d\n",w);
	}

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	isCorrect
	.type	isCorrect, @function
isCorrect:
.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	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movq	%rcx, -40(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L2
.L8:
	movl	$0, -4(%rbp)
	jmp	.L3
.L5:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -4(%rbp)
	addl	$1, -8(%rbp)
.L3:
	movl	-8(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jge	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	cmpl	%eax, -28(%rbp)
	jge	.L5
.L4:
	movl	-8(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jne	.L6
	movl	$1, %eax
	jmp	.L7
.L6:
	addl	$1, -12(%rbp)
.L2:
	movl	-12(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L8
	movl	$0, %eax
.L7:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	isCorrect, .-isCorrect
	.globl	getMin
	.type	getMin, @function
getMin:
.LFB1:
	.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	%esi, -24(%rbp)
	movq	%rdx, -32(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, -12(%rbp)
	movl	$0, -8(%rbp)
	movl	$2147483647, -4(%rbp)
	jmp	.L10
.L16:
	cmpl	$0, -16(%rbp)
	je	.L12
	movl	-16(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	-4(%rax), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	subl	%eax, -8(%rbp)
	jmp	.L12
.L14:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -8(%rbp)
	addl	$1, -12(%rbp)
.L12:
	movl	-12(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jge	.L13
	movl	-8(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jle	.L14
.L13:
	movl	-20(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L15
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L15
	movl	-8(%rbp), %eax
	movl	%eax, -4(%rbp)
.L15:
	addl	$1, -16(%rbp)
.L10:
	movl	-16(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jl	.L16
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	getMin, .-getMin
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$432, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L19
.L29:
	movl	$0, -424(%rbp)
	jmp	.L20
.L21:
	leaq	-416(%rbp), %rdx
	movl	-424(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -424(%rbp)
.L20:
	movl	-428(%rbp), %eax
	cmpl	%eax, -424(%rbp)
	jl	.L21
	movl	$0, -420(%rbp)
	movl	$0, -424(%rbp)
	jmp	.L22
.L24:
	movl	-424(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	%eax, -420(%rbp)
	jge	.L23
	movl	-424(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -420(%rbp)
.L23:
	addl	$1, -424(%rbp)
.L22:
	movl	-428(%rbp), %eax
	cmpl	%eax, -424(%rbp)
	jl	.L24
.L27:
	movl	-428(%rbp), %esi
	movl	-432(%rbp), %eax
	leaq	-416(%rbp), %rcx
	movl	-420(%rbp), %edx
	movl	%eax, %edi
	call	isCorrect
	testl	%eax, %eax
	jne	.L33
	movl	-428(%rbp), %ecx
	leaq	-416(%rbp), %rdx
	movl	-420(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	getMin
	movl	%eax, -420(%rbp)
	jmp	.L27
.L33:
	nop
	movl	-420(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L19:
	leaq	-428(%rbp), %rdx
	leaq	-432(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L28
	movl	-432(%rbp), %eax
	testl	%eax, %eax
	jne	.L29
	movl	-428(%rbp), %eax
	testl	%eax, %eax
	jne	.L29
.L28:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	isCorrect
	.type	isCorrect, @function
isCorrect:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%edi, %r10d
	xorl	%r9d, %r9d
	xorl	%r11d, %r11d
	testl	%edi, %edi
	jle	.L17
	.p2align 4,,10
	.p2align 3
.L2:
	cmpl	%r9d, %esi
	jle	.L13
.L21:
	movslq	%r9d, %rax
	movl	(%rcx,%rax,4), %edi
	leal	1(%r9), %eax
	cltq
	cmpl	%edi, %edx
	jge	.L5
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L20:
	addl	(%rcx,%rax,4), %edi
	addq	$1, %rax
	cmpl	%edx, %edi
	jg	.L19
.L5:
	movl	%eax, %r8d
	cmpl	%eax, %esi
	jg	.L20
	cmpl	%r8d, %esi
	je	.L10
.L22:
	addl	$1, %r11d
	cmpl	%r11d, %r10d
	je	.L17
	cmpl	%r9d, %esi
	jle	.L17
	movl	%r8d, %r9d
	cmpl	%r9d, %esi
	jg	.L21
.L13:
	movl	%r9d, %r8d
	cmpl	%r8d, %esi
	jne	.L22
.L10:
	movl	$1, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L19:
	movl	%r8d, %r9d
.L6:
	addl	$1, %r11d
	cmpl	%r11d, %r10d
	jne	.L2
.L17:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	isCorrect, .-isCorrect
	.p2align 4
	.globl	getMin
	.type	getMin, @function
getMin:
.LFB24:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	jle	.L31
	leal	-1(%rsi), %eax
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	%edi, %r9d
	movl	%esi, %r10d
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	(%rdx,%rax,4), %rbp
	movq	%rdx, %rbx
	movl	$2147483647, %r11d
	xorl	%r8d, %r8d
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L25:
	cmpl	%ecx, %r9d
	jl	.L26
	cmpl	%r10d, %r8d
	jge	.L26
	addl	$1, %r8d
	movslq	%r8d, %rax
	.p2align 4,,10
	.p2align 3
.L27:
	addl	-4(%rdx,%rax,4), %ecx
	cmpl	%eax, %r10d
	movl	%eax, %r8d
	setg	%dil
	cmpl	%ecx, %r9d
	setge	%sil
	addq	$1, %rax
	testb	%sil, %dil
	jne	.L27
.L26:
	cmpl	%ecx, %r11d
	movl	%r11d, %eax
	cmovg	%ecx, %r11d
	cmpl	%ecx, %r9d
	cmovge	%eax, %r11d
	cmpq	%rbx, %rbp
	je	.L47
	subl	(%rbx), %ecx
	addq	$4, %rbx
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L47:
	movl	%r11d, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L31:
	.cfi_restore 3
	.cfi_restore 6
	movl	$2147483647, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	getMin, .-getMin
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.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	28(%rsp), %rax
	leaq	32(%rsp), %r13
	movq	%rax, 8(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, %r15
.L49:
	movq	8(%rsp), %rdx
	xorl	%eax, %eax
	movq	%r15, %rsi
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L71
	movl	24(%rsp), %r10d
	movl	28(%rsp), %esi
	movl	%r10d, %eax
	orl	%esi, %eax
	je	.L71
	movq	%r13, %r12
	movq	%r13, %r14
	xorl	%ebp, %ebp
	testl	%esi, %esi
	jle	.L75
	.p2align 4,,10
	.p2align 3
.L50:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %esi
	addq	$4, %r14
	cmpl	%ebp, %esi
	jg	.L50
	movl	24(%rsp), %r10d
	testl	%esi, %esi
	jle	.L75
	leal	-1(%rsi), %ecx
	cmpl	$2, %ecx
	jbe	.L76
	movl	%esi, %eax
	pxor	%xmm0, %xmm0
	shrl	$2, %eax
	leal	-1(%rax), %edx
	leaq	16(%r13), %rax
	salq	$4, %rdx
	addq	%rax, %rdx
	jmp	.L53
.L109:
	addq	$16, %rax
.L53:
	movdqa	(%r12), %xmm2
	movdqa	%xmm0, %xmm1
	movq	%rax, %r12
	pcmpgtd	%xmm2, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm1, %xmm0
	cmpq	%rax, %rdx
	jne	.L109
	movdqa	%xmm0, %xmm2
	movl	%esi, %eax
	psrldq	$8, %xmm2
	andl	$-4, %eax
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	por	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	por	%xmm2, %xmm0
	movd	%xmm0, %r8d
	testb	$3, %sil
	je	.L51
.L52:
	movslq	%eax, %rdx
	movl	32(%rsp,%rdx,4), %edx
	cmpl	%edx, %r8d
	cmovl	%edx, %r8d
	leal	1(%rax), %edx
	cmpl	%edx, %esi
	jle	.L51
	movslq	%edx, %rdx
	movl	32(%rsp,%rdx,4), %edx
	cmpl	%edx, %r8d
	cmovl	%edx, %r8d
	addl	$2, %eax
	cmpl	%eax, %esi
	jle	.L51
	cltq
	movl	32(%rsp,%rax,4), %eax
	cmpl	%eax, %r8d
	cmovl	%eax, %r8d
.L51:
	leaq	0(%r13,%rcx,4), %r11
	.p2align 4,,10
	.p2align 3
.L70:
	xorl	%edi, %edi
	xorl	%r9d, %r9d
	testl	%r10d, %r10d
	jle	.L57
	.p2align 4,,10
	.p2align 3
.L56:
	cmpl	%edi, %esi
	jle	.L78
.L112:
	movslq	%edi, %rax
	movl	32(%rsp,%rax,4), %edx
	leal	1(%rdi), %eax
	cltq
	cmpl	%edx, %r8d
	jge	.L59
	jmp	.L60
	.p2align 4,,10
	.p2align 3
.L111:
	addl	0(%r13,%rax,4), %edx
	addq	$1, %rax
	cmpl	%edx, %r8d
	jl	.L110
.L59:
	movl	%eax, %ecx
	cmpl	%eax, %esi
	jg	.L111
	cmpl	%ecx, %esi
	je	.L61
.L113:
	addl	$1, %r9d
	cmpl	%r10d, %r9d
	je	.L57
	cmpl	%edi, %esi
	jle	.L57
	movl	%ecx, %edi
	cmpl	%edi, %esi
	jg	.L112
.L78:
	movl	%edi, %ecx
	cmpl	%ecx, %esi
	jne	.L113
.L61:
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L49
	.p2align 4,,10
	.p2align 3
.L110:
	movl	%ecx, %edi
.L60:
	addl	$1, %r9d
	cmpl	%r10d, %r9d
	jne	.L56
	.p2align 4,,10
	.p2align 3
.L57:
	movl	$2147483647, %ebp
	testl	%esi, %esi
	jle	.L64
	movq	%r13, %r12
	xorl	%edx, %edx
	movl	$2147483647, %ebp
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L63:
	cmpl	%ecx, %r8d
	jl	.L65
	cmpl	%esi, %edx
	jge	.L65
	leal	1(%rdx), %eax
	cltq
	.p2align 4,,10
	.p2align 3
.L66:
	addl	-4(%r13,%rax,4), %ecx
	cmpl	%eax, %esi
	movl	%eax, %edx
	setg	%r9b
	cmpl	%ecx, %r8d
	setge	%dil
	addq	$1, %rax
	testb	%dil, %r9b
	jne	.L66
.L65:
	cmpl	%ecx, %ebp
	movl	%ebp, %eax
	cmovg	%ecx, %ebp
	cmpl	%ecx, %r8d
	cmovge	%eax, %ebp
	cmpq	%r12, %r11
	je	.L64
	subl	(%r12), %ecx
	addq	$4, %r12
	jmp	.L63
	.p2align 4,,10
	.p2align 3
.L64:
	movl	%ebp, %r8d
	jmp	.L70
.L76:
	xorl	%r8d, %r8d
	xorl	%eax, %eax
	jmp	.L52
.L75:
	xorl	%r8d, %r8d
	leal	-1(%rsi), %ecx
	jmp	.L51
.L71:
	movq	440(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L114
	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
.L114:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.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
	.file	"temp.c"
	.text
	.p2align 4
	.globl	isCorrect
	.type	isCorrect, @function
isCorrect:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%edi, %r10d
	xorl	%r9d, %r9d
	xorl	%r11d, %r11d
	testl	%edi, %edi
	jle	.L17
	.p2align 4,,10
	.p2align 3
.L2:
	cmpl	%r9d, %esi
	jle	.L13
.L21:
	movslq	%r9d, %rax
	movl	(%rcx,%rax,4), %edi
	leal	1(%r9), %eax
	cltq
	cmpl	%edi, %edx
	jge	.L5
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L20:
	addl	(%rcx,%rax,4), %edi
	addq	$1, %rax
	cmpl	%edx, %edi
	jg	.L19
.L5:
	movl	%eax, %r8d
	cmpl	%eax, %esi
	jg	.L20
	cmpl	%r8d, %esi
	je	.L10
.L22:
	addl	$1, %r11d
	cmpl	%r11d, %r10d
	je	.L17
	cmpl	%r9d, %esi
	jle	.L17
	movl	%r8d, %r9d
	cmpl	%r9d, %esi
	jg	.L21
.L13:
	movl	%r9d, %r8d
	cmpl	%r8d, %esi
	jne	.L22
.L10:
	movl	$1, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L19:
	movl	%r8d, %r9d
.L6:
	addl	$1, %r11d
	cmpl	%r11d, %r10d
	jne	.L2
.L17:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	isCorrect, .-isCorrect
	.p2align 4
	.globl	getMin
	.type	getMin, @function
getMin:
.LFB24:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	jle	.L31
	leal	-1(%rsi), %eax
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	%edi, %r9d
	movl	%esi, %r10d
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	(%rdx,%rax,4), %rbp
	movq	%rdx, %rbx
	movl	$2147483647, %r11d
	xorl	%r8d, %r8d
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L25:
	cmpl	%ecx, %r9d
	jl	.L26
	cmpl	%r10d, %r8d
	jge	.L26
	addl	$1, %r8d
	movslq	%r8d, %rax
	.p2align 4,,10
	.p2align 3
.L27:
	addl	-4(%rdx,%rax,4), %ecx
	cmpl	%eax, %r10d
	movl	%eax, %r8d
	setg	%dil
	cmpl	%ecx, %r9d
	setge	%sil
	addq	$1, %rax
	testb	%sil, %dil
	jne	.L27
.L26:
	cmpl	%ecx, %r11d
	movl	%r11d, %eax
	cmovg	%ecx, %r11d
	cmpl	%ecx, %r9d
	cmovge	%eax, %r11d
	cmpq	%rbx, %rbp
	je	.L47
	subl	(%rbx), %ecx
	addq	$4, %rbx
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L47:
	movl	%r11d, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L31:
	.cfi_restore 3
	.cfi_restore 6
	movl	$2147483647, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	getMin, .-getMin
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.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	28(%rsp), %rax
	leaq	32(%rsp), %r13
	movq	%rax, 8(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, %r15
.L49:
	movq	8(%rsp), %rdx
	xorl	%eax, %eax
	movq	%r15, %rsi
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L71
	movl	24(%rsp), %r10d
	movl	28(%rsp), %esi
	movl	%r10d, %eax
	orl	%esi, %eax
	je	.L71
	movq	%r13, %r12
	movq	%r13, %r14
	xorl	%ebp, %ebp
	testl	%esi, %esi
	jle	.L75
	.p2align 4,,10
	.p2align 3
.L50:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %esi
	addq	$4, %r14
	cmpl	%ebp, %esi
	jg	.L50
	movl	24(%rsp), %r10d
	testl	%esi, %esi
	jle	.L75
	leal	-1(%rsi), %ecx
	cmpl	$2, %ecx
	jbe	.L76
	movl	%esi, %eax
	pxor	%xmm0, %xmm0
	shrl	$2, %eax
	leal	-1(%rax), %edx
	leaq	16(%r13), %rax
	salq	$4, %rdx
	addq	%rax, %rdx
	jmp	.L53
.L109:
	addq	$16, %rax
.L53:
	movdqa	(%r12), %xmm2
	movdqa	%xmm0, %xmm1
	movq	%rax, %r12
	pcmpgtd	%xmm2, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm1, %xmm0
	cmpq	%rax, %rdx
	jne	.L109
	movdqa	%xmm0, %xmm2
	movl	%esi, %eax
	psrldq	$8, %xmm2
	andl	$-4, %eax
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	por	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	por	%xmm2, %xmm0
	movd	%xmm0, %r8d
	testb	$3, %sil
	je	.L51
.L52:
	movslq	%eax, %rdx
	movl	32(%rsp,%rdx,4), %edx
	cmpl	%edx, %r8d
	cmovl	%edx, %r8d
	leal	1(%rax), %edx
	cmpl	%edx, %esi
	jle	.L51
	movslq	%edx, %rdx
	movl	32(%rsp,%rdx,4), %edx
	cmpl	%edx, %r8d
	cmovl	%edx, %r8d
	addl	$2, %eax
	cmpl	%eax, %esi
	jle	.L51
	cltq
	movl	32(%rsp,%rax,4), %eax
	cmpl	%eax, %r8d
	cmovl	%eax, %r8d
.L51:
	leaq	0(%r13,%rcx,4), %r11
	.p2align 4,,10
	.p2align 3
.L70:
	xorl	%edi, %edi
	xorl	%r9d, %r9d
	testl	%r10d, %r10d
	jle	.L57
	.p2align 4,,10
	.p2align 3
.L56:
	cmpl	%edi, %esi
	jle	.L78
.L112:
	movslq	%edi, %rax
	movl	32(%rsp,%rax,4), %edx
	leal	1(%rdi), %eax
	cltq
	cmpl	%edx, %r8d
	jge	.L59
	jmp	.L60
	.p2align 4,,10
	.p2align 3
.L111:
	addl	0(%r13,%rax,4), %edx
	addq	$1, %rax
	cmpl	%edx, %r8d
	jl	.L110
.L59:
	movl	%eax, %ecx
	cmpl	%eax, %esi
	jg	.L111
	cmpl	%ecx, %esi
	je	.L61
.L113:
	addl	$1, %r9d
	cmpl	%r10d, %r9d
	je	.L57
	cmpl	%edi, %esi
	jle	.L57
	movl	%ecx, %edi
	cmpl	%edi, %esi
	jg	.L112
.L78:
	movl	%edi, %ecx
	cmpl	%ecx, %esi
	jne	.L113
.L61:
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L49
	.p2align 4,,10
	.p2align 3
.L110:
	movl	%ecx, %edi
.L60:
	addl	$1, %r9d
	cmpl	%r10d, %r9d
	jne	.L56
	.p2align 4,,10
	.p2align 3
.L57:
	movl	$2147483647, %ebp
	testl	%esi, %esi
	jle	.L64
	movq	%r13, %r12
	xorl	%edx, %edx
	movl	$2147483647, %ebp
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L63:
	cmpl	%ecx, %r8d
	jl	.L65
	cmpl	%esi, %edx
	jge	.L65
	leal	1(%rdx), %eax
	cltq
	.p2align 4,,10
	.p2align 3
.L66:
	addl	-4(%r13,%rax,4), %ecx
	cmpl	%eax, %esi
	movl	%eax, %edx
	setg	%r9b
	cmpl	%ecx, %r8d
	setge	%dil
	addq	$1, %rax
	testb	%dil, %r9b
	jne	.L66
.L65:
	cmpl	%ecx, %ebp
	movl	%ebp, %eax
	cmovg	%ecx, %ebp
	cmpl	%ecx, %r8d
	cmovge	%eax, %ebp
	cmpq	%r12, %r11
	je	.L64
	subl	(%r12), %ecx
	addq	$4, %r12
	jmp	.L63
	.p2align 4,,10
	.p2align 3
.L64:
	movl	%ebp, %r8d
	jmp	.L70
.L76:
	xorl	%r8d, %r8d
	xorl	%eax, %eax
	jmp	.L52
.L75:
	xorl	%r8d, %r8d
	leal	-1(%rsi), %ecx
	jmp	.L51
.L71:
	movq	440(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L114
	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
.L114:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.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:

#include <stdio.h>
#include <limits.h>

#define REP(i,n,m) for(i=n;i<m;i++)
#define rep(i,n) REP(i,0,n)

int isCorrect(int n,int m,int w,int *t){
	int i, now = 0;

	rep(i,n){
		int sum = 0;
		for(;now<m && sum+t[now]<=w;sum+=t[now],now++);
		if(now == m) return 1;
	}

	return 0;
}

int getMin(int sp,int m,int *t){
	int left=0,right=0,sum=0;
	int res = INT_MAX;

	for(;left<m;left++){
		if(left != 0) sum -= t[left-1];
		for(;right<m && sum<=sp;sum+=t[right],right++);
		if(sp < sum && sum < res) res = sum;
	}

	return res;
}

int main(void){
	int i,j,start,end;
	int n,m;
	int w,t[100];

	while(scanf("%d%d",&n,&m) && (n||m)){
		rep(i,m) scanf("%d",&t[i]);

		w = 0;
		rep(i,m) if(w < t[i]) w = t[i];
		while(1){
			if(isCorrect(n,m,w,t)) break;
			w = getMin(w,m,t);
		}
		printf("%d\n",w);
	}

	return 0;
}
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>
#include <limits.h>

#define REP(i,n,m) for(i=n;i<m;i++)
#define rep(i,n) REP(i,0,n)

int isCorrect(int n,int m,int w,int *t){
	int i, now = 0;

	rep(i,n){
		int sum = 0;
		for(;now<m && sum+t[now]<=w;sum+=t[now],now++);
		if(now == m) return 1;
	}

	return 0;
}

int getMin(int sp,int m,int *t){
	int left=0,right=0,sum=0;
	int res = INT_MAX;

	for(;left<m;left++){
		if(left != 0) sum -= t[left-1];
		for(;right<m && sum<=sp;sum+=t[right],right++);
		if(sp < sum && sum < res) res = sum;
	}

	return res;
}

int main(void){
	int i,j,start,end;
	int n,m;
	int w,t[100];

	while(scanf("%d%d",&n,&m) && (n||m)){
		rep(i,m) scanf("%d",&t[i]);

		w = 0;
		rep(i,m) if(w < t[i]) w = t[i];
		while(1){
			if(isCorrect(n,m,w,t)) break;
			w = getMin(w,m,t);
		}
		printf("%d\n",w);
	}

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	isCorrect
	.type	isCorrect, @function
isCorrect:
.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	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movq	%rcx, -40(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L2
.L8:
	movl	$0, -4(%rbp)
	jmp	.L3
.L5:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -4(%rbp)
	addl	$1, -8(%rbp)
.L3:
	movl	-8(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jge	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	cmpl	%eax, -28(%rbp)
	jge	.L5
.L4:
	movl	-8(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jne	.L6
	movl	$1, %eax
	jmp	.L7
.L6:
	addl	$1, -12(%rbp)
.L2:
	movl	-12(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L8
	movl	$0, %eax
.L7:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	isCorrect, .-isCorrect
	.globl	getMin
	.type	getMin, @function
getMin:
.LFB1:
	.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	%esi, -24(%rbp)
	movq	%rdx, -32(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, -12(%rbp)
	movl	$0, -8(%rbp)
	movl	$2147483647, -4(%rbp)
	jmp	.L10
.L16:
	cmpl	$0, -16(%rbp)
	je	.L12
	movl	-16(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	-4(%rax), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	subl	%eax, -8(%rbp)
	jmp	.L12
.L14:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -8(%rbp)
	addl	$1, -12(%rbp)
.L12:
	movl	-12(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jge	.L13
	movl	-8(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jle	.L14
.L13:
	movl	-20(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L15
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L15
	movl	-8(%rbp), %eax
	movl	%eax, -4(%rbp)
.L15:
	addl	$1, -16(%rbp)
.L10:
	movl	-16(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jl	.L16
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	getMin, .-getMin
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$432, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L19
.L29:
	movl	$0, -424(%rbp)
	jmp	.L20
.L21:
	leaq	-416(%rbp), %rdx
	movl	-424(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -424(%rbp)
.L20:
	movl	-428(%rbp), %eax
	cmpl	%eax, -424(%rbp)
	jl	.L21
	movl	$0, -420(%rbp)
	movl	$0, -424(%rbp)
	jmp	.L22
.L24:
	movl	-424(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	%eax, -420(%rbp)
	jge	.L23
	movl	-424(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -420(%rbp)
.L23:
	addl	$1, -424(%rbp)
.L22:
	movl	-428(%rbp), %eax
	cmpl	%eax, -424(%rbp)
	jl	.L24
.L27:
	movl	-428(%rbp), %esi
	movl	-432(%rbp), %eax
	leaq	-416(%rbp), %rcx
	movl	-420(%rbp), %edx
	movl	%eax, %edi
	call	isCorrect
	testl	%eax, %eax
	jne	.L33
	movl	-428(%rbp), %ecx
	leaq	-416(%rbp), %rdx
	movl	-420(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	getMin
	movl	%eax, -420(%rbp)
	jmp	.L27
.L33:
	nop
	movl	-420(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L19:
	leaq	-428(%rbp), %rdx
	leaq	-432(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L28
	movl	-432(%rbp), %eax
	testl	%eax, %eax
	jne	.L29
	movl	-428(%rbp), %eax
	testl	%eax, %eax
	jne	.L29
.L28:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	isCorrect
	.type	isCorrect, @function
isCorrect:
.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	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movq	%rcx, -40(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L2
.L8:
	movl	$0, -4(%rbp)
	jmp	.L3
.L5:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -4(%rbp)
	addl	$1, -8(%rbp)
.L3:
	movl	-8(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jge	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	cmpl	%eax, -28(%rbp)
	jge	.L5
.L4:
	movl	-8(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jne	.L6
	movl	$1, %eax
	jmp	.L7
.L6:
	addl	$1, -12(%rbp)
.L2:
	movl	-12(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L8
	movl	$0, %eax
.L7:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	isCorrect, .-isCorrect
	.globl	getMin
	.type	getMin, @function
getMin:
.LFB1:
	.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	%esi, -24(%rbp)
	movq	%rdx, -32(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, -12(%rbp)
	movl	$0, -8(%rbp)
	movl	$2147483647, -4(%rbp)
	jmp	.L10
.L16:
	cmpl	$0, -16(%rbp)
	je	.L12
	movl	-16(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	-4(%rax), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	subl	%eax, -8(%rbp)
	jmp	.L12
.L14:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -8(%rbp)
	addl	$1, -12(%rbp)
.L12:
	movl	-12(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jge	.L13
	movl	-8(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jle	.L14
.L13:
	movl	-20(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L15
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L15
	movl	-8(%rbp), %eax
	movl	%eax, -4(%rbp)
.L15:
	addl	$1, -16(%rbp)
.L10:
	movl	-16(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jl	.L16
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	getMin, .-getMin
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$432, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L19
.L29:
	movl	$0, -424(%rbp)
	jmp	.L20
.L21:
	leaq	-416(%rbp), %rdx
	movl	-424(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -424(%rbp)
.L20:
	movl	-428(%rbp), %eax
	cmpl	%eax, -424(%rbp)
	jl	.L21
	movl	$0, -420(%rbp)
	movl	$0, -424(%rbp)
	jmp	.L22
.L24:
	movl	-424(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	%eax, -420(%rbp)
	jge	.L23
	movl	-424(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -420(%rbp)
.L23:
	addl	$1, -424(%rbp)
.L22:
	movl	-428(%rbp), %eax
	cmpl	%eax, -424(%rbp)
	jl	.L24
.L27:
	movl	-428(%rbp), %esi
	movl	-432(%rbp), %eax
	leaq	-416(%rbp), %rcx
	movl	-420(%rbp), %edx
	movl	%eax, %edi
	call	isCorrect
	testl	%eax, %eax
	jne	.L33
	movl	-428(%rbp), %ecx
	leaq	-416(%rbp), %rdx
	movl	-420(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	getMin
	movl	%eax, -420(%rbp)
	jmp	.L27
.L33:
	nop
	movl	-420(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L19:
	leaq	-428(%rbp), %rdx
	leaq	-432(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L28
	movl	-432(%rbp), %eax
	testl	%eax, %eax
	jne	.L29
	movl	-428(%rbp), %eax
	testl	%eax, %eax
	jne	.L29
.L28:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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:
