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

#define DOWN -1
#define UP 1
#define EDGE 0

int main()
{
    int n;
    int array[80];
    long long int stock_num = 0;
    long long int total = 1000;
    int current_desition = EDGE;

    scanf("%d", &n);

    for (int i = 0; i<n; i++)
    {
        scanf("%d", &array[i]);
    }

    if (array[0] < array[1])
    {
        current_desition = UP;
        stock_num = total/array[0];
        total = total%array[0];
    } else {
        current_desition = DOWN;
    }

    for (int i = 1; i<(n-1); i++)
    {
        if ((array[i] < array[i+1])&&(current_desition == DOWN))
        {
            current_desition = UP;
            stock_num = total/array[i];
            total = total%array[i];
        } else if ((array[i] > array[i+1])&&(current_desition == UP))
        {
            current_desition = DOWN;
            total += stock_num*array[i];
            stock_num = 0;
        }
    }

    if (stock_num != 0)
    {
        total += stock_num*array[n-1];
    }

    printf("%lld", total);

    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$352, %rsp
	.cfi_def_cfa_offset 384
	movq	%fs:40, %rax
	movq	%rax, 344(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L3
.L2:
	movl	16(%rsp), %edx
	movl	20(%rsp), %r8d
	leal	-1(%rax), %edi
	cmpl	%r8d, %edx
	jge	.L4
	movl	$1000, %eax
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	cmpl	$1, %edi
	jle	.L5
	movl	$1, %r9d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L5:
	testq	%rax, %rax
	je	.L9
	movslq	%edi, %rdi
	movslq	16(%rsp,%rdi,4), %rcx
	imulq	%rax, %rcx
	addq	%rcx, %rdx
.L9:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	344(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$352, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L4:
	.cfi_restore_state
	movl	$1000, %edx
	cmpl	$1, %edi
	jle	.L9
	xorl	%eax, %eax
	movl	$1000, %edx
	orl	$-1, %r9d
.L10:
	movl	$1, %ecx
	leaq	16(%rsp), %r10
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L28:
	cmpl	$-1, %r9d
	jne	.L7
	movq	%rdx, %rax
	movl	$1, %r9d
	cqto
	idivq	%rsi
	.p2align 4,,10
	.p2align 3
.L7:
	addq	$1, %rcx
	cmpl	%ecx, %edi
	jle	.L5
.L8:
	movslq	%r8d, %rsi
	movl	4(%r10,%rcx,4), %r8d
	cmpl	%esi, %r8d
	jg	.L28
	jge	.L7
	cmpl	$1, %r9d
	jne	.L7
	imulq	%rax, %rsi
	movl	$-1, %r9d
	xorl	%eax, %eax
	addq	%rsi, %rdx
	jmp	.L7
.L27:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$352, %rsp
	.cfi_def_cfa_offset 384
	movq	%fs:40, %rax
	movq	%rax, 344(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L3
.L2:
	movl	16(%rsp), %edx
	movl	20(%rsp), %r8d
	leal	-1(%rax), %edi
	cmpl	%r8d, %edx
	jge	.L4
	movl	$1000, %eax
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	cmpl	$1, %edi
	jle	.L5
	movl	$1, %r9d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L5:
	testq	%rax, %rax
	je	.L9
	movslq	%edi, %rdi
	movslq	16(%rsp,%rdi,4), %rcx
	imulq	%rax, %rcx
	addq	%rcx, %rdx
.L9:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	344(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$352, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L4:
	.cfi_restore_state
	movl	$1000, %edx
	cmpl	$1, %edi
	jle	.L9
	xorl	%eax, %eax
	movl	$1000, %edx
	orl	$-1, %r9d
.L10:
	movl	$1, %ecx
	leaq	16(%rsp), %r10
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L28:
	cmpl	$-1, %r9d
	jne	.L7
	movq	%rdx, %rax
	movl	$1, %r9d
	cqto
	idivq	%rsi
	.p2align 4,,10
	.p2align 3
.L7:
	addq	$1, %rcx
	cmpl	%ecx, %edi
	jle	.L5
.L8:
	movslq	%r8d, %rsi
	movl	4(%r10,%rcx,4), %r8d
	cmpl	%esi, %r8d
	jg	.L28
	jge	.L7
	cmpl	$1, %r9d
	jne	.L7
	imulq	%rax, %rsi
	movl	$-1, %r9d
	xorl	%eax, %eax
	addq	%rsi, %rdx
	jmp	.L7
.L27:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$352, %rsp
	.cfi_def_cfa_offset 384
	movq	%fs:40, %rax
	movq	%rax, 344(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L3
.L2:
	movl	16(%rsp), %edx
	movl	20(%rsp), %r8d
	leal	-1(%rax), %edi
	cmpl	%r8d, %edx
	jge	.L4
	movl	$1000, %eax
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	cmpl	$1, %edi
	jle	.L5
	movl	$1, %r9d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L5:
	testq	%rax, %rax
	je	.L9
	movslq	%edi, %rdi
	movslq	16(%rsp,%rdi,4), %rcx
	imulq	%rax, %rcx
	addq	%rcx, %rdx
.L9:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	344(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$352, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L4:
	.cfi_restore_state
	movl	$1000, %edx
	cmpl	$1, %edi
	jle	.L9
	xorl	%eax, %eax
	movl	$1000, %edx
	orl	$-1, %r9d
.L10:
	movl	$1, %ecx
	leaq	16(%rsp), %r10
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L28:
	cmpl	$-1, %r9d
	jne	.L7
	movq	%rdx, %rax
	movl	$1, %r9d
	cqto
	idivq	%rsi
	.p2align 4,,10
	.p2align 3
.L7:
	addq	$1, %rcx
	cmpl	%ecx, %edi
	jle	.L5
.L8:
	movslq	%r8d, %rsi
	movl	4(%r10,%rcx,4), %r8d
	cmpl	%esi, %r8d
	jg	.L28
	jge	.L7
	cmpl	$1, %r9d
	jne	.L7
	imulq	%rax, %rsi
	movl	$-1, %r9d
	xorl	%eax, %eax
	addq	%rsi, %rdx
	jmp	.L7
.L27:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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>
#include<string.h>

#define DOWN -1
#define UP 1
#define EDGE 0

int main()
{
    int n;
    int array[80];
    long long int stock_num = 0;
    long long int total = 1000;
    int current_desition = EDGE;

    scanf("%d", &n);

    for (int i = 0; i<n; i++)
    {
        scanf("%d", &array[i]);
    }

    if (array[0] < array[1])
    {
        current_desition = UP;
        stock_num = total/array[0];
        total = total%array[0];
    } else {
        current_desition = DOWN;
    }

    for (int i = 1; i<(n-1); i++)
    {
        if ((array[i] < array[i+1])&&(current_desition == DOWN))
        {
            current_desition = UP;
            stock_num = total/array[i];
            total = total%array[i];
        } else if ((array[i] > array[i+1])&&(current_desition == UP))
        {
            current_desition = DOWN;
            total += stock_num*array[i];
            stock_num = 0;
        }
    }

    if (stock_num != 0)
    {
        total += stock_num*array[n-1];
    }

    printf("%lld", total);

    return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
#include<string.h>

#define DOWN -1
#define UP 1
#define EDGE 0

int main()
{
    int n;
    int array[80];
    long long int stock_num = 0;
    long long int total = 1000;
    int current_desition = EDGE;

    scanf("%d", &n);

    for (int i = 0; i<n; i++)
    {
        scanf("%d", &array[i]);
    }

    if (array[0] < array[1])
    {
        current_desition = UP;
        stock_num = total/array[0];
        total = total%array[0];
    } else {
        current_desition = DOWN;
    }

    for (int i = 1; i<(n-1); i++)
    {
        if ((array[i] < array[i+1])&&(current_desition == DOWN))
        {
            current_desition = UP;
            stock_num = total/array[i];
            total = total%array[i];
        } else if ((array[i] > array[i+1])&&(current_desition == UP))
        {
            current_desition = DOWN;
            total += stock_num*array[i];
            stock_num = 0;
        }
    }

    if (stock_num != 0)
    {
        total += stock_num*array[n-1];
    }

    printf("%lld", total);

    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:

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

#define DOWN -1
#define UP 1
#define EDGE 0

int main()
{
    int n;
    int array[80];
    long long int stock_num = 0;
    long long int total = 1000;
    int current_desition = EDGE;

    scanf("%d", &n);

    for (int i = 0; i<n; i++)
    {
        scanf("%d", &array[i]);
    }

    if (array[0] < array[1])
    {
        current_desition = UP;
        stock_num = total/array[0];
        total = total%array[0];
    } else {
        current_desition = DOWN;
    }

    for (int i = 1; i<(n-1); i++)
    {
        if ((array[i] < array[i+1])&&(current_desition == DOWN))
        {
            current_desition = UP;
            stock_num = total/array[i];
            total = total%array[i];
        } else if ((array[i] > array[i+1])&&(current_desition == UP))
        {
            current_desition = DOWN;
            total += stock_num*array[i];
            stock_num = 0;
        }
    }

    if (stock_num != 0)
    {
        total += stock_num*array[n-1];
    }

    printf("%lld", total);

    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$352, %rsp
	.cfi_def_cfa_offset 384
	movq	%fs:40, %rax
	movq	%rax, 344(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L3
.L2:
	movl	16(%rsp), %edx
	movl	20(%rsp), %r8d
	leal	-1(%rax), %edi
	cmpl	%r8d, %edx
	jge	.L4
	movl	$1000, %eax
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	cmpl	$1, %edi
	jle	.L5
	movl	$1, %r9d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L5:
	testq	%rax, %rax
	je	.L9
	movslq	%edi, %rdi
	movslq	16(%rsp,%rdi,4), %rcx
	imulq	%rax, %rcx
	addq	%rcx, %rdx
.L9:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	344(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$352, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L4:
	.cfi_restore_state
	movl	$1000, %edx
	cmpl	$1, %edi
	jle	.L9
	xorl	%eax, %eax
	movl	$1000, %edx
	orl	$-1, %r9d
.L10:
	movl	$1, %ecx
	leaq	16(%rsp), %r10
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L28:
	cmpl	$-1, %r9d
	jne	.L7
	movq	%rdx, %rax
	movl	$1, %r9d
	cqto
	idivq	%rsi
	.p2align 4,,10
	.p2align 3
.L7:
	addq	$1, %rcx
	cmpl	%ecx, %edi
	jle	.L5
.L8:
	movslq	%r8d, %rsi
	movl	4(%r10,%rcx,4), %r8d
	cmpl	%esi, %r8d
	jg	.L28
	jge	.L7
	cmpl	$1, %r9d
	jne	.L7
	imulq	%rax, %rsi
	movl	$-1, %r9d
	xorl	%eax, %eax
	addq	%rsi, %rdx
	jmp	.L7
.L27:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$352, %rsp
	.cfi_def_cfa_offset 384
	movq	%fs:40, %rax
	movq	%rax, 344(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L3
.L2:
	movl	16(%rsp), %edx
	movl	20(%rsp), %r8d
	leal	-1(%rax), %edi
	cmpl	%r8d, %edx
	jge	.L4
	movl	$1000, %eax
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	cmpl	$1, %edi
	jle	.L5
	movl	$1, %r9d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L5:
	testq	%rax, %rax
	je	.L9
	movslq	%edi, %rdi
	movslq	16(%rsp,%rdi,4), %rcx
	imulq	%rax, %rcx
	addq	%rcx, %rdx
.L9:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	344(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$352, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L4:
	.cfi_restore_state
	movl	$1000, %edx
	cmpl	$1, %edi
	jle	.L9
	xorl	%eax, %eax
	movl	$1000, %edx
	orl	$-1, %r9d
.L10:
	movl	$1, %ecx
	leaq	16(%rsp), %r10
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L28:
	cmpl	$-1, %r9d
	jne	.L7
	movq	%rdx, %rax
	movl	$1, %r9d
	cqto
	idivq	%rsi
	.p2align 4,,10
	.p2align 3
.L7:
	addq	$1, %rcx
	cmpl	%ecx, %edi
	jle	.L5
.L8:
	movslq	%r8d, %rsi
	movl	4(%r10,%rcx,4), %r8d
	cmpl	%esi, %r8d
	jg	.L28
	jge	.L7
	cmpl	$1, %r9d
	jne	.L7
	imulq	%rax, %rsi
	movl	$-1, %r9d
	xorl	%eax, %eax
	addq	%rsi, %rdx
	jmp	.L7
.L27:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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:
```