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){
    long long int i, ii, k, d, mon,n,tmp, kab, a[200001];
    long long int max;
    scanf("%lld", &n);
    for (i = 0; i < n; i++)
        scanf("%lld", a + i);
    mon = 1000 % a[0];
    kab = 1000/a[0];
    max = 1000;
    for (d = 1; d < n; d++)
    {
        if (a[d] < a[d - 1])
        {
            mon = max % a[d];
            kab = max / a[d];
        }
        else if (a[d] > a[d - 1])
            max = mon + kab * a[d];
        
    }
    printf("%lld", max);
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-1597440(%rsp), %r11
	.cfi_def_cfa 11, 1597480
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2600, %rsp
	.cfi_def_cfa_offset 1600080
	leaq	.LC0(%rip), %r13
	movq	%r13, %rdi
	movq	%fs:40, %rax
	movq	%rax, 1600024(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpq	$0, 8(%rsp)
	jle	.L15
	leaq	16(%rsp), %r12
	xorl	%ebx, %ebx
	movq	%r12, %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rdi
	addq	$8, %rbp
	cmpq	%rbx, %rdi
	jg	.L3
	movl	$1000, %eax
	movq	16(%rsp), %rsi
	cqto
	idivq	%rsi
	cmpq	$1, %rdi
	jle	.L15
	cmpq	$3, %rdi
	jle	.L16
	movl	$1, %r9d
	leaq	-4(%rdi), %rcx
	movl	$1000, %r8d
	movq	(%r12,%r9,8), %r10
	andq	$-2, %rcx
	addq	$3, %rcx
	cmpq	%rsi, %r10
	jl	.L23
.L5:
	jle	.L6
	movq	%r10, %r8
	imulq	%rax, %r8
	addq	%rdx, %r8
.L6:
	movq	8(%r12,%r9,8), %rsi
	cmpq	%rsi, %r10
	jg	.L7
	jge	.L8
	movq	%rax, %r8
	imulq	%rsi, %r8
	addq	%rdx, %r8
.L8:
	addq	$2, %r9
	cmpq	%rcx, %r9
	je	.L12
	movq	(%r12,%r9,8), %r10
	cmpq	%rsi, %r10
	jge	.L5
.L23:
	movq	%r8, %rax
	cqto
	idivq	%r10
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L24:
	movq	%r8, %rax
	cqto
	idivq	%rsi
.L11:
	addq	$1, %rcx
	cmpq	%rcx, %rdi
	jle	.L2
.L12:
	movq	(%r12,%rcx,8), %rsi
	cmpq	-8(%r12,%rcx,8), %rsi
	jl	.L24
	jle	.L11
	imulq	%rax, %rsi
	addq	$1, %rcx
	leaq	(%rsi,%rdx), %r8
	cmpq	%rcx, %rdi
	jg	.L12
.L2:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movq	%r13, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	1600024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$1600040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L7:
	.cfi_restore_state
	movq	%r8, %rax
	cqto
	idivq	%rsi
	jmp	.L8
.L15:
	movl	$1000, %r8d
	jmp	.L2
.L16:
	movl	$1000, %r8d
	movl	$1, %ecx
	jmp	.L12
.L25:
	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	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-1597440(%rsp), %r11
	.cfi_def_cfa 11, 1597480
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2600, %rsp
	.cfi_def_cfa_offset 1600080
	leaq	.LC0(%rip), %r13
	movq	%r13, %rdi
	movq	%fs:40, %rax
	movq	%rax, 1600024(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpq	$0, 8(%rsp)
	jle	.L15
	leaq	16(%rsp), %r12
	xorl	%ebx, %ebx
	movq	%r12, %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rdi
	addq	$8, %rbp
	cmpq	%rbx, %rdi
	jg	.L3
	movl	$1000, %eax
	movq	16(%rsp), %rsi
	cqto
	idivq	%rsi
	cmpq	$1, %rdi
	jle	.L15
	cmpq	$3, %rdi
	jle	.L16
	movl	$1, %r9d
	leaq	-4(%rdi), %rcx
	movl	$1000, %r8d
	movq	(%r12,%r9,8), %r10
	andq	$-2, %rcx
	addq	$3, %rcx
	cmpq	%rsi, %r10
	jl	.L23
.L5:
	jle	.L6
	movq	%r10, %r8
	imulq	%rax, %r8
	addq	%rdx, %r8
.L6:
	movq	8(%r12,%r9,8), %rsi
	cmpq	%rsi, %r10
	jg	.L7
	jge	.L8
	movq	%rax, %r8
	imulq	%rsi, %r8
	addq	%rdx, %r8
.L8:
	addq	$2, %r9
	cmpq	%rcx, %r9
	je	.L12
	movq	(%r12,%r9,8), %r10
	cmpq	%rsi, %r10
	jge	.L5
.L23:
	movq	%r8, %rax
	cqto
	idivq	%r10
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L24:
	movq	%r8, %rax
	cqto
	idivq	%rsi
.L11:
	addq	$1, %rcx
	cmpq	%rcx, %rdi
	jle	.L2
.L12:
	movq	(%r12,%rcx,8), %rsi
	cmpq	-8(%r12,%rcx,8), %rsi
	jl	.L24
	jle	.L11
	imulq	%rax, %rsi
	addq	$1, %rcx
	leaq	(%rsi,%rdx), %r8
	cmpq	%rcx, %rdi
	jg	.L12
.L2:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movq	%r13, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	1600024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$1600040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L7:
	.cfi_restore_state
	movq	%r8, %rax
	cqto
	idivq	%rsi
	jmp	.L8
.L15:
	movl	$1000, %r8d
	jmp	.L2
.L16:
	movl	$1000, %r8d
	movl	$1, %ecx
	jmp	.L12
.L25:
	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	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-1597440(%rsp), %r11
	.cfi_def_cfa 11, 1597480
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2600, %rsp
	.cfi_def_cfa_offset 1600080
	leaq	.LC0(%rip), %r13
	movq	%r13, %rdi
	movq	%fs:40, %rax
	movq	%rax, 1600024(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpq	$0, 8(%rsp)
	jle	.L15
	leaq	16(%rsp), %r12
	xorl	%ebx, %ebx
	movq	%r12, %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rdi
	addq	$8, %rbp
	cmpq	%rbx, %rdi
	jg	.L3
	movl	$1000, %eax
	movq	16(%rsp), %rsi
	cqto
	idivq	%rsi
	cmpq	$1, %rdi
	jle	.L15
	cmpq	$3, %rdi
	jle	.L16
	movl	$1, %r9d
	leaq	-4(%rdi), %rcx
	movl	$1000, %r8d
	movq	(%r12,%r9,8), %r10
	andq	$-2, %rcx
	addq	$3, %rcx
	cmpq	%rsi, %r10
	jl	.L23
.L5:
	jle	.L6
	movq	%r10, %r8
	imulq	%rax, %r8
	addq	%rdx, %r8
.L6:
	movq	8(%r12,%r9,8), %rsi
	cmpq	%rsi, %r10
	jg	.L7
	jge	.L8
	movq	%rax, %r8
	imulq	%rsi, %r8
	addq	%rdx, %r8
.L8:
	addq	$2, %r9
	cmpq	%rcx, %r9
	je	.L12
	movq	(%r12,%r9,8), %r10
	cmpq	%rsi, %r10
	jge	.L5
.L23:
	movq	%r8, %rax
	cqto
	idivq	%r10
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L24:
	movq	%r8, %rax
	cqto
	idivq	%rsi
.L11:
	addq	$1, %rcx
	cmpq	%rcx, %rdi
	jle	.L2
.L12:
	movq	(%r12,%rcx,8), %rsi
	cmpq	-8(%r12,%rcx,8), %rsi
	jl	.L24
	jle	.L11
	imulq	%rax, %rsi
	addq	$1, %rcx
	leaq	(%rsi,%rdx), %r8
	cmpq	%rcx, %rdi
	jg	.L12
.L2:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movq	%r13, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	1600024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$1600040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L7:
	.cfi_restore_state
	movq	%r8, %rax
	cqto
	idivq	%rsi
	jmp	.L8
.L15:
	movl	$1000, %r8d
	jmp	.L2
.L16:
	movl	$1000, %r8d
	movl	$1, %ecx
	jmp	.L12
.L25:
	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){
    long long int i, ii, k, d, mon,n,tmp, kab, a[200001];
    long long int max;
    scanf("%lld", &n);
    for (i = 0; i < n; i++)
        scanf("%lld", a + i);
    mon = 1000 % a[0];
    kab = 1000/a[0];
    max = 1000;
    for (d = 1; d < n; d++)
    {
        if (a[d] < a[d - 1])
        {
            mon = max % a[d];
            kab = max / a[d];
        }
        else if (a[d] > a[d - 1])
            max = mon + kab * a[d];
        
    }
    printf("%lld", max);
}
```
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){
    long long int i, ii, k, d, mon,n,tmp, kab, a[200001];
    long long int max;
    scanf("%lld", &n);
    for (i = 0; i < n; i++)
        scanf("%lld", a + i);
    mon = 1000 % a[0];
    kab = 1000/a[0];
    max = 1000;
    for (d = 1; d < n; d++)
    {
        if (a[d] < a[d - 1])
        {
            mon = max % a[d];
            kab = max / a[d];
        }
        else if (a[d] > a[d - 1])
            max = mon + kab * a[d];
        
    }
    printf("%lld", max);
}
```

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:

2
157 145
 7
100 130 243 130 115 115 150
 6
200 237 160 140 120 100
 2
157 218
 7
100 130 243 130 115 115 271
 6
200 237 160 233 120 100
 2
103 218
 7
110 130 243 130 115 115 271
 7
110 130 136 130 115 115 271
 6
200 237 119 233 121 100

1000 3165 1185 1366 5706 1696 2035 5161 2794 2211
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){
    long long int i, ii, k, d, mon,n,tmp, kab, a[200001];
    long long int max;
    scanf("%lld", &n);
    for (i = 0; i < n; i++)
        scanf("%lld", a + i);
    mon = 1000 % a[0];
    kab = 1000/a[0];
    max = 1000;
    for (d = 1; d < n; d++)
    {
        if (a[d] < a[d - 1])
        {
            mon = max % a[d];
            kab = max / a[d];
        }
        else if (a[d] > a[d - 1])
            max = mon + kab * a[d];
        
    }
    printf("%lld", max);
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-1597440(%rsp), %r11
	.cfi_def_cfa 11, 1597480
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2600, %rsp
	.cfi_def_cfa_offset 1600080
	leaq	.LC0(%rip), %r13
	movq	%r13, %rdi
	movq	%fs:40, %rax
	movq	%rax, 1600024(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpq	$0, 8(%rsp)
	jle	.L15
	leaq	16(%rsp), %r12
	xorl	%ebx, %ebx
	movq	%r12, %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rdi
	addq	$8, %rbp
	cmpq	%rbx, %rdi
	jg	.L3
	movl	$1000, %eax
	movq	16(%rsp), %rsi
	cqto
	idivq	%rsi
	cmpq	$1, %rdi
	jle	.L15
	cmpq	$3, %rdi
	jle	.L16
	movl	$1, %r9d
	leaq	-4(%rdi), %rcx
	movl	$1000, %r8d
	movq	(%r12,%r9,8), %r10
	andq	$-2, %rcx
	addq	$3, %rcx
	cmpq	%rsi, %r10
	jl	.L23
.L5:
	jle	.L6
	movq	%r10, %r8
	imulq	%rax, %r8
	addq	%rdx, %r8
.L6:
	movq	8(%r12,%r9,8), %rsi
	cmpq	%rsi, %r10
	jg	.L7
	jge	.L8
	movq	%rax, %r8
	imulq	%rsi, %r8
	addq	%rdx, %r8
.L8:
	addq	$2, %r9
	cmpq	%rcx, %r9
	je	.L12
	movq	(%r12,%r9,8), %r10
	cmpq	%rsi, %r10
	jge	.L5
.L23:
	movq	%r8, %rax
	cqto
	idivq	%r10
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L24:
	movq	%r8, %rax
	cqto
	idivq	%rsi
.L11:
	addq	$1, %rcx
	cmpq	%rcx, %rdi
	jle	.L2
.L12:
	movq	(%r12,%rcx,8), %rsi
	cmpq	-8(%r12,%rcx,8), %rsi
	jl	.L24
	jle	.L11
	imulq	%rax, %rsi
	addq	$1, %rcx
	leaq	(%rsi,%rdx), %r8
	cmpq	%rcx, %rdi
	jg	.L12
.L2:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movq	%r13, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	1600024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$1600040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L7:
	.cfi_restore_state
	movq	%r8, %rax
	cqto
	idivq	%rsi
	jmp	.L8
.L15:
	movl	$1000, %r8d
	jmp	.L2
.L16:
	movl	$1000, %r8d
	movl	$1, %ecx
	jmp	.L12
.L25:
	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	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-1597440(%rsp), %r11
	.cfi_def_cfa 11, 1597480
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2600, %rsp
	.cfi_def_cfa_offset 1600080
	leaq	.LC0(%rip), %r13
	movq	%r13, %rdi
	movq	%fs:40, %rax
	movq	%rax, 1600024(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpq	$0, 8(%rsp)
	jle	.L15
	leaq	16(%rsp), %r12
	xorl	%ebx, %ebx
	movq	%r12, %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rdi
	addq	$8, %rbp
	cmpq	%rbx, %rdi
	jg	.L3
	movl	$1000, %eax
	movq	16(%rsp), %rsi
	cqto
	idivq	%rsi
	cmpq	$1, %rdi
	jle	.L15
	cmpq	$3, %rdi
	jle	.L16
	movl	$1, %r9d
	leaq	-4(%rdi), %rcx
	movl	$1000, %r8d
	movq	(%r12,%r9,8), %r10
	andq	$-2, %rcx
	addq	$3, %rcx
	cmpq	%rsi, %r10
	jl	.L23
.L5:
	jle	.L6
	movq	%r10, %r8
	imulq	%rax, %r8
	addq	%rdx, %r8
.L6:
	movq	8(%r12,%r9,8), %rsi
	cmpq	%rsi, %r10
	jg	.L7
	jge	.L8
	movq	%rax, %r8
	imulq	%rsi, %r8
	addq	%rdx, %r8
.L8:
	addq	$2, %r9
	cmpq	%rcx, %r9
	je	.L12
	movq	(%r12,%r9,8), %r10
	cmpq	%rsi, %r10
	jge	.L5
.L23:
	movq	%r8, %rax
	cqto
	idivq	%r10
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L24:
	movq	%r8, %rax
	cqto
	idivq	%rsi
.L11:
	addq	$1, %rcx
	cmpq	%rcx, %rdi
	jle	.L2
.L12:
	movq	(%r12,%rcx,8), %rsi
	cmpq	-8(%r12,%rcx,8), %rsi
	jl	.L24
	jle	.L11
	imulq	%rax, %rsi
	addq	$1, %rcx
	leaq	(%rsi,%rdx), %r8
	cmpq	%rcx, %rdi
	jg	.L12
.L2:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movq	%r13, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	1600024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$1600040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L7:
	.cfi_restore_state
	movq	%r8, %rax
	cqto
	idivq	%rsi
	jmp	.L8
.L15:
	movl	$1000, %r8d
	jmp	.L2
.L16:
	movl	$1000, %r8d
	movl	$1, %ecx
	jmp	.L12
.L25:
	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:
```