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 <stdlib.h>

int m, n;
int w[100];

int IsStorable( int width ) {

    int row = 0, c = 0, i = 0;

    while ( i < n ) {
	if ( c + w[i] <= width ) {
	    c += w[i];
	    ++i;
	}
	else if ( ++row < m ) c = 0;
	else return 0;
    }

    return 1;
}

int main() {
    int i, minw, maxw, mid;

    while ( scanf("%d %d", &m, &n) == 2 && m && n ) {

	for ( i=0; i<n; ++i ) scanf("%d", &w[i]);

	minw = 1;
	maxw = 1500000;
	if ( !IsStorable( maxw ) ) printf("NA\n");

	while ( maxw > minw ) {
	    mid = (maxw + minw)/2;
	    if ( IsStorable(mid) ) maxw = mid;
	    else                   minw = mid + 1;
	}

	printf("%d\n", minw);
    }
    
    return 0;
}

```

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	w
	.align 32
	.type	w, @object
	.size	w, 400
w:
	.zero	400
	.text
	.globl	IsStorable
	.type	IsStorable, @function
IsStorable:
.LFB6:
	.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, -12(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L6:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	cmpl	%eax, -20(%rbp)
	jl	.L3
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -8(%rbp)
	addl	$1, -4(%rbp)
	jmp	.L2
.L3:
	addl	$1, -12(%rbp)
	movl	m(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jge	.L4
	movl	$0, -8(%rbp)
	jmp	.L2
.L4:
	movl	$0, %eax
	jmp	.L5
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L6
	movl	$1, %eax
.L5:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	IsStorable, .-IsStorable
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"NA"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d %d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.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	.L8
.L16:
	movl	$0, -16(%rbp)
	jmp	.L9
.L10:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%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)
.L9:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L10
	movl	$1, -12(%rbp)
	movl	$1500000, -8(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, %edi
	call	IsStorable
	testl	%eax, %eax
	jne	.L12
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L12
.L14:
	movl	-8(%rbp), %edx
	movl	-12(%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	IsStorable
	testl	%eax, %eax
	je	.L13
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L12
.L13:
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
.L12:
	movl	-8(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jg	.L14
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L8:
	leaq	n(%rip), %rax
	movq	%rax, %rdx
	leaq	m(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	jne	.L15
	movl	m(%rip), %eax
	testl	%eax, %eax
	je	.L15
	movl	n(%rip), %eax
	testl	%eax, %eax
	jne	.L16
.L15:
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	IsStorable
	.type	IsStorable, @function
IsStorable:
.LFB39:
	.cfi_startproc
	endbr64
	movl	n(%rip), %r8d
	testl	%r8d, %r8d
	jle	.L6
	movl	m(%rip), %r10d
	xorl	%edx, %edx
	xorl	%eax, %eax
	xorl	%esi, %esi
	leaq	w(%rip), %r9
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L10:
	addl	$1, %edx
.L4:
	cmpl	%r8d, %edx
	jge	.L6
.L5:
	movslq	%edx, %rcx
	addl	(%r9,%rcx,4), %eax
	cmpl	%edi, %eax
	jle	.L10
	addl	$1, %esi
	xorl	%eax, %eax
	cmpl	%esi, %r10d
	jg	.L4
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	movl	$1, %eax
	ret
	.cfi_endproc
.LFE39:
	.size	IsStorable, .-IsStorable
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d %d"
.LC3:
	.string	"NA"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.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	w(%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
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
.L12:
	xorl	%eax, %eax
	movq	%r12, %rdx
	leaq	.LC2(%rip), %rdi
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	jne	.L32
	movl	m(%rip), %r9d
	testl	%r9d, %r9d
	je	.L32
	movl	n(%rip), %r8d
	testl	%r8d, %r8d
	je	.L32
	movq	%r13, %rbx
	movl	$0, %r15d
	leaq	.LC0(%rip), %r14
	jle	.L14
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%rbx, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movl	n(%rip), %r8d
	addq	$4, %rbx
	cmpl	%r15d, %r8d
	jg	.L13
	movl	m(%rip), %r9d
	testl	%r8d, %r8d
	jle	.L14
	xorl	%esi, %esi
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L42:
	addl	$1, %edx
	cmpl	%edx, %r8d
	jle	.L14
.L18:
	movslq	%edx, %rcx
	addl	0(%r13,%rcx,4), %eax
	cmpl	$1500000, %eax
	jle	.L42
	addl	$1, %esi
	cmpl	%r9d, %esi
	jge	.L17
	xorl	%eax, %eax
	cmpl	%edx, %r8d
	jg	.L18
.L14:
	movl	$1, %r10d
	movl	$1500000, %r11d
	.p2align 4,,10
	.p2align 3
.L28:
	leal	(%r10,%r11), %edi
	sarl	%edi
	testl	%r8d, %r8d
	jle	.L19
	xorl	%esi, %esi
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L43:
	addl	$1, %edx
	cmpl	%edx, %r8d
	jle	.L19
.L23:
	movslq	%edx, %rcx
	addl	0(%r13,%rcx,4), %eax
	cmpl	%eax, %edi
	jge	.L43
	addl	$1, %esi
	cmpl	%r9d, %esi
	jge	.L22
	xorl	%eax, %eax
	cmpl	%edx, %r8d
	jg	.L23
.L19:
	cmpl	%r10d, %edi
	jle	.L27
.L24:
	movl	%edi, %r11d
	jmp	.L28
.L27:
	movl	%r10d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L22:
	leal	1(%rdi), %r10d
	cmpl	%r11d, %r10d
	jge	.L27
	movl	%r11d, %edi
	jmp	.L24
.L17:
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
	movl	n(%rip), %r8d
	movl	m(%rip), %r9d
	jmp	.L14
.L32:
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	w
	.bss
	.align 32
	.type	w, @object
	.size	w, 400
w:
	.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	IsStorable
	.type	IsStorable, @function
IsStorable:
.LFB39:
	.cfi_startproc
	endbr64
	movl	n(%rip), %r8d
	testl	%r8d, %r8d
	jle	.L6
	movl	m(%rip), %r10d
	xorl	%edx, %edx
	xorl	%eax, %eax
	xorl	%esi, %esi
	leaq	w(%rip), %r9
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L10:
	addl	$1, %edx
.L4:
	cmpl	%r8d, %edx
	jge	.L6
.L5:
	movslq	%edx, %rcx
	addl	(%r9,%rcx,4), %eax
	cmpl	%edi, %eax
	jle	.L10
	addl	$1, %esi
	xorl	%eax, %eax
	cmpl	%esi, %r10d
	jg	.L4
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	movl	$1, %eax
	ret
	.cfi_endproc
.LFE39:
	.size	IsStorable, .-IsStorable
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d %d"
.LC3:
	.string	"NA"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.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	w(%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
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
.L12:
	xorl	%eax, %eax
	movq	%r12, %rdx
	leaq	.LC2(%rip), %rdi
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	jne	.L32
	movl	m(%rip), %r9d
	testl	%r9d, %r9d
	je	.L32
	movl	n(%rip), %r8d
	testl	%r8d, %r8d
	je	.L32
	movq	%r13, %rbx
	movl	$0, %r15d
	leaq	.LC0(%rip), %r14
	jle	.L14
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%rbx, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movl	n(%rip), %r8d
	addq	$4, %rbx
	cmpl	%r15d, %r8d
	jg	.L13
	movl	m(%rip), %r9d
	testl	%r8d, %r8d
	jle	.L14
	xorl	%esi, %esi
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L42:
	addl	$1, %edx
	cmpl	%edx, %r8d
	jle	.L14
.L18:
	movslq	%edx, %rcx
	addl	0(%r13,%rcx,4), %eax
	cmpl	$1500000, %eax
	jle	.L42
	addl	$1, %esi
	cmpl	%r9d, %esi
	jge	.L17
	xorl	%eax, %eax
	cmpl	%edx, %r8d
	jg	.L18
.L14:
	movl	$1, %r10d
	movl	$1500000, %r11d
	.p2align 4,,10
	.p2align 3
.L28:
	leal	(%r10,%r11), %edi
	sarl	%edi
	testl	%r8d, %r8d
	jle	.L19
	xorl	%esi, %esi
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L43:
	addl	$1, %edx
	cmpl	%edx, %r8d
	jle	.L19
.L23:
	movslq	%edx, %rcx
	addl	0(%r13,%rcx,4), %eax
	cmpl	%eax, %edi
	jge	.L43
	addl	$1, %esi
	cmpl	%r9d, %esi
	jge	.L22
	xorl	%eax, %eax
	cmpl	%edx, %r8d
	jg	.L23
.L19:
	cmpl	%r10d, %edi
	jle	.L27
.L24:
	movl	%edi, %r11d
	jmp	.L28
.L27:
	movl	%r10d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L22:
	leal	1(%rdi), %r10d
	cmpl	%r11d, %r10d
	jge	.L27
	movl	%r11d, %edi
	jmp	.L24
.L17:
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
	movl	n(%rip), %r8d
	movl	m(%rip), %r9d
	jmp	.L14
.L32:
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	w
	.bss
	.align 32
	.type	w, @object
	.size	w, 400
w:
	.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>
#include <stdlib.h>

int m, n;
int w[100];

int IsStorable( int width ) {

    int row = 0, c = 0, i = 0;

    while ( i < n ) {
	if ( c + w[i] <= width ) {
	    c += w[i];
	    ++i;
	}
	else if ( ++row < m ) c = 0;
	else return 0;
    }

    return 1;
}

int main() {
    int i, minw, maxw, mid;

    while ( scanf("%d %d", &m, &n) == 2 && m && n ) {

	for ( i=0; i<n; ++i ) scanf("%d", &w[i]);

	minw = 1;
	maxw = 1500000;
	if ( !IsStorable( maxw ) ) printf("NA\n");

	while ( maxw > minw ) {
	    mid = (maxw + minw)/2;
	    if ( IsStorable(mid) ) maxw = mid;
	    else                   minw = mid + 1;
	}

	printf("%d\n", minw);
    }
    
    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 <stdlib.h>

int m, n;
int w[100];

int IsStorable( int width ) {

    int row = 0, c = 0, i = 0;

    while ( i < n ) {
	if ( c + w[i] <= width ) {
	    c += w[i];
	    ++i;
	}
	else if ( ++row < m ) c = 0;
	else return 0;
    }

    return 1;
}

int main() {
    int i, minw, maxw, mid;

    while ( scanf("%d %d", &m, &n) == 2 && m && n ) {

	for ( i=0; i<n; ++i ) scanf("%d", &w[i]);

	minw = 1;
	maxw = 1500000;
	if ( !IsStorable( maxw ) ) printf("NA\n");

	while ( maxw > minw ) {
	    mid = (maxw + minw)/2;
	    if ( IsStorable(mid) ) maxw = mid;
	    else                   minw = mid + 1;
	}

	printf("%d\n", minw);
    }
    
    return 0;
}

```

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	w
	.align 32
	.type	w, @object
	.size	w, 400
w:
	.zero	400
	.text
	.globl	IsStorable
	.type	IsStorable, @function
IsStorable:
.LFB6:
	.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, -12(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L6:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	cmpl	%eax, -20(%rbp)
	jl	.L3
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -8(%rbp)
	addl	$1, -4(%rbp)
	jmp	.L2
.L3:
	addl	$1, -12(%rbp)
	movl	m(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jge	.L4
	movl	$0, -8(%rbp)
	jmp	.L2
.L4:
	movl	$0, %eax
	jmp	.L5
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L6
	movl	$1, %eax
.L5:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	IsStorable, .-IsStorable
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"NA"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d %d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.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	.L8
.L16:
	movl	$0, -16(%rbp)
	jmp	.L9
.L10:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%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)
.L9:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L10
	movl	$1, -12(%rbp)
	movl	$1500000, -8(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, %edi
	call	IsStorable
	testl	%eax, %eax
	jne	.L12
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L12
.L14:
	movl	-8(%rbp), %edx
	movl	-12(%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	IsStorable
	testl	%eax, %eax
	je	.L13
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L12
.L13:
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
.L12:
	movl	-8(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jg	.L14
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L8:
	leaq	n(%rip), %rax
	movq	%rax, %rdx
	leaq	m(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	jne	.L15
	movl	m(%rip), %eax
	testl	%eax, %eax
	je	.L15
	movl	n(%rip), %eax
	testl	%eax, %eax
	jne	.L16
.L15:
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	w
	.align 32
	.type	w, @object
	.size	w, 400
w:
	.zero	400
	.text
	.globl	IsStorable
	.type	IsStorable, @function
IsStorable:
.LFB6:
	.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, -12(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L6:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	cmpl	%eax, -20(%rbp)
	jl	.L3
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -8(%rbp)
	addl	$1, -4(%rbp)
	jmp	.L2
.L3:
	addl	$1, -12(%rbp)
	movl	m(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jge	.L4
	movl	$0, -8(%rbp)
	jmp	.L2
.L4:
	movl	$0, %eax
	jmp	.L5
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L6
	movl	$1, %eax
.L5:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	IsStorable, .-IsStorable
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"NA"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d %d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.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	.L8
.L16:
	movl	$0, -16(%rbp)
	jmp	.L9
.L10:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%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)
.L9:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L10
	movl	$1, -12(%rbp)
	movl	$1500000, -8(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, %edi
	call	IsStorable
	testl	%eax, %eax
	jne	.L12
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L12
.L14:
	movl	-8(%rbp), %edx
	movl	-12(%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	IsStorable
	testl	%eax, %eax
	je	.L13
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L12
.L13:
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
.L12:
	movl	-8(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jg	.L14
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L8:
	leaq	n(%rip), %rax
	movq	%rax, %rdx
	leaq	m(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	jne	.L15
	movl	m(%rip), %eax
	testl	%eax, %eax
	je	.L15
	movl	n(%rip), %eax
	testl	%eax, %eax
	jne	.L16
.L15:
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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:
