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>
#include<math.h>
#include<string.h>
//if(strcmp(s[i],"AC")==0)
//if(s[l]=='#')
int W_Length(char *str){
	int length = 0;
	while(*str++ != '\0')
		length++;
	return length;
}

void swap(int *a, int *b){
  int temp;
  temp=*a;
  *a=*b;
  *b=temp;
}
//swap(&a, &b)

double deg(double theta){//deg to theta
return theta*(2*3.14159265359)/360;
}

int cmp( const void *p, const void *q ) {
    return *(int*)p - *(int*)q;
}//ちいさい順
//qsort(a,n,sizeof(int),cmp);
//char s[n][11]

int cmp_s(const void * left, const void * right)
{
	char *left_char = (char *)left;
  char *right_char = (char *)right;
  return strcmp(left_char, right_char);
}
//qsort(s,n,sizeof(s[0]),cmp_s);


int main (void)
{
	long long int a[85],b[85],c,n,i,buy[85]={0}, sell[85]={0},mon=1000,k=0,m=1,kabu=0;

scanf("%lld",&n);
  scanf("%lld",&a[1]);
  b[1]=a[1];
	for(i=2;i<=n;i++){
scanf("%lld",&a[i]);
      if(a[i-1]==a[i]){
      continue;
      }
      m++;
      b[m]=a[i];
    }
  if(m==1){
  printf("1000\n");
    return 0;
  }
if(b[1]<b[2]){
buy[1]=1;
}
      if(b[m]>b[m-1]){
      sell[m]=1;
      }
  
  for(i=2;i<m;i++){
  if(b[i-1]>b[i]&&b[i+1]>b[i]){
  buy[i]=1;
  }
    
    if(b[i-1]<b[i]&&b[i+1]<b[i]){
    sell[i]=1;
    }
  }
  
  for(i=1;i<=m;i++){
  //printf("%d\n",b[i]);
  if(sell[i]==1){
  mon+=kabu*b[i];
    kabu=0;
  }
    if(buy[i]==1){
    kabu+=mon/b[i];
      mon=mon%b[i];
    }
 // printf("mon=%d kabu=%d, sell %d, buy %d\n",mon, kabu, sell[i], buy[i]);
  }
  
	printf("%lld\n",mon);
return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	W_Length
	.type	W_Length, @function
W_Length:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L3:
	addl	$1, -4(%rbp)
.L2:
	movq	-24(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, -24(%rbp)
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L3
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	W_Length, .-W_Length
	.globl	swap
	.type	swap, @function
swap:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	movl	-4(%rbp), %edx
	movl	%edx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	swap, .-swap
	.globl	deg
	.type	deg, @function
deg:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movsd	%xmm0, -8(%rbp)
	movsd	-8(%rbp), %xmm1
	movsd	.LC0(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	movsd	.LC1(%rip), %xmm1
	divsd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	deg, .-deg
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	cmp, .-cmp
	.globl	cmp_s
	.type	cmp_s, @function
cmp_s:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rdx
	movq	-16(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	cmp_s, .-cmp_s
	.section	.rodata
.LC2:
	.string	"%lld"
.LC3:
	.string	"1000"
.LC4:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$2800, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1376(%rbp), %rdx
	movl	$0, %eax
	movl	$85, %ecx
	movq	%rdx, %rdi
	rep stosq
	leaq	-688(%rbp), %rdx
	movl	$0, %eax
	movl	$85, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	$1000, -2784(%rbp)
	movq	$0, -2760(%rbp)
	movq	$1, -2776(%rbp)
	movq	$0, -2768(%rbp)
	leaq	-2800(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-2752(%rbp), %rax
	addq	$8, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-2744(%rbp), %rax
	movq	%rax, -2056(%rbp)
	movq	$2, -2792(%rbp)
	jmp	.L13
.L16:
	leaq	-2752(%rbp), %rdx
	movq	-2792(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-2792(%rbp), %rax
	subq	$1, %rax
	movq	-2752(%rbp,%rax,8), %rdx
	movq	-2792(%rbp), %rax
	movq	-2752(%rbp,%rax,8), %rax
	cmpq	%rax, %rdx
	je	.L31
	addq	$1, -2776(%rbp)
	movq	-2792(%rbp), %rax
	movq	-2752(%rbp,%rax,8), %rdx
	movq	-2776(%rbp), %rax
	movq	%rdx, -2064(%rbp,%rax,8)
	jmp	.L15
.L31:
	nop
.L15:
	addq	$1, -2792(%rbp)
.L13:
	movq	-2800(%rbp), %rax
	cmpq	%rax, -2792(%rbp)
	jle	.L16
	cmpq	$1, -2776(%rbp)
	jne	.L17
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L29
.L17:
	movq	-2056(%rbp), %rdx
	movq	-2048(%rbp), %rax
	cmpq	%rax, %rdx
	jge	.L19
	movq	$1, -1368(%rbp)
.L19:
	movq	-2776(%rbp), %rax
	movq	-2064(%rbp,%rax,8), %rdx
	movq	-2776(%rbp), %rax
	subq	$1, %rax
	movq	-2064(%rbp,%rax,8), %rax
	cmpq	%rax, %rdx
	jle	.L20
	movq	-2776(%rbp), %rax
	movq	$1, -688(%rbp,%rax,8)
.L20:
	movq	$2, -2792(%rbp)
	jmp	.L21
.L24:
	movq	-2792(%rbp), %rax
	subq	$1, %rax
	movq	-2064(%rbp,%rax,8), %rdx
	movq	-2792(%rbp), %rax
	movq	-2064(%rbp,%rax,8), %rax
	cmpq	%rax, %rdx
	jle	.L22
	movq	-2792(%rbp), %rax
	addq	$1, %rax
	movq	-2064(%rbp,%rax,8), %rdx
	movq	-2792(%rbp), %rax
	movq	-2064(%rbp,%rax,8), %rax
	cmpq	%rax, %rdx
	jle	.L22
	movq	-2792(%rbp), %rax
	movq	$1, -1376(%rbp,%rax,8)
.L22:
	movq	-2792(%rbp), %rax
	subq	$1, %rax
	movq	-2064(%rbp,%rax,8), %rdx
	movq	-2792(%rbp), %rax
	movq	-2064(%rbp,%rax,8), %rax
	cmpq	%rax, %rdx
	jge	.L23
	movq	-2792(%rbp), %rax
	addq	$1, %rax
	movq	-2064(%rbp,%rax,8), %rdx
	movq	-2792(%rbp), %rax
	movq	-2064(%rbp,%rax,8), %rax
	cmpq	%rax, %rdx
	jge	.L23
	movq	-2792(%rbp), %rax
	movq	$1, -688(%rbp,%rax,8)
.L23:
	addq	$1, -2792(%rbp)
.L21:
	movq	-2792(%rbp), %rax
	cmpq	-2776(%rbp), %rax
	jl	.L24
	movq	$1, -2792(%rbp)
	jmp	.L25
.L28:
	movq	-2792(%rbp), %rax
	movq	-688(%rbp,%rax,8), %rax
	cmpq	$1, %rax
	jne	.L26
	movq	-2792(%rbp), %rax
	movq	-2064(%rbp,%rax,8), %rax
	imulq	-2768(%rbp), %rax
	addq	%rax, -2784(%rbp)
	movq	$0, -2768(%rbp)
.L26:
	movq	-2792(%rbp), %rax
	movq	-1376(%rbp,%rax,8), %rax
	cmpq	$1, %rax
	jne	.L27
	movq	-2792(%rbp), %rax
	movq	-2064(%rbp,%rax,8), %rsi
	movq	-2784(%rbp), %rax
	cqto
	idivq	%rsi
	addq	%rax, -2768(%rbp)
	movq	-2792(%rbp), %rax
	movq	-2064(%rbp,%rax,8), %rcx
	movq	-2784(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, -2784(%rbp)
.L27:
	addq	$1, -2792(%rbp)
.L25:
	movq	-2792(%rbp), %rax
	cmpq	-2776(%rbp), %rax
	jle	.L28
	movq	-2784(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L29:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC0:
	.long	1413754602
	.long	1075388923
	.align 8
.LC1:
	.long	0
	.long	1081507840
	.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	W_Length
	.type	W_Length, @function
W_Length:
.LFB51:
	.cfi_startproc
	endbr64
	cmpb	$0, (%rdi)
	leaq	1(%rdi), %rax
	je	.L4
	movl	$1, %edx
	subl	%eax, %edx
	.p2align 4,,10
	.p2align 3
.L3:
	leal	(%rdx,%rax), %r8d
	addq	$1, %rax
	cmpb	$0, -1(%rax)
	jne	.L3
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%r8d, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE51:
	.size	W_Length, .-W_Length
	.p2align 4
	.globl	swap
	.type	swap, @function
swap:
.LFB52:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	movl	(%rsi), %edx
	movl	%edx, (%rdi)
	movl	%eax, (%rsi)
	ret
	.cfi_endproc
.LFE52:
	.size	swap, .-swap
	.p2align 4
	.globl	deg
	.type	deg, @function
deg:
.LFB53:
	.cfi_startproc
	endbr64
	mulsd	.LC0(%rip), %xmm0
	divsd	.LC1(%rip), %xmm0
	ret
	.cfi_endproc
.LFE53:
	.size	deg, .-deg
	.p2align 4
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB54:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE54:
	.size	cmp, .-cmp
	.p2align 4
	.globl	cmp_s
	.type	cmp_s, @function
cmp_s:
.LFB55:
	.cfi_startproc
	endbr64
	jmp	strcmp@PLT
	.cfi_endproc
.LFE55:
	.size	cmp_s, .-cmp_s
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"%lld"
.LC3:
	.string	"1000"
.LC4:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB56:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$85, %ecx
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC2(%rip), %r14
	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
	movl	$1, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	$2, %ebx
	subq	$2792, %rsp
	.cfi_def_cfa_offset 2848
	movq	%fs:40, %rax
	movq	%rax, 2776(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rsi
	leaq	32(%rsp), %r15
	leaq	1408(%rsp), %r12
	leaq	2096(%rsp), %r13
	movq	%r12, %rdi
	rep stosq
	movl	$85, %ecx
	movq	%r13, %rdi
	rep stosq
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	leaq	40(%rsp), %rsi
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	movq	40(%rsp), %rax
	cmpq	$1, 24(%rsp)
	movq	%rax, 8(%rsp)
	movq	%rax, 728(%rsp)
	jle	.L18
	.p2align 4,,10
	.p2align 3
.L12:
	leaq	(%r15,%rbx,8), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	(%r15,%rbx,8), %rax
	cmpq	%rax, -8(%r15,%rbx,8)
	je	.L14
	addq	$1, %rbp
	addq	$1, %rbx
	movq	%rax, 720(%rsp,%rbp,8)
	cmpq	%rbx, 24(%rsp)
	jge	.L12
.L16:
	movq	8(%rsp), %rax
	cmpq	736(%rsp), %rax
	setl	%al
	movzbl	%al, %eax
	movq	%rax, 1416(%rsp)
	movq	712(%rsp,%rbp,8), %rax
	cmpq	%rax, 720(%rsp,%rbp,8)
	jg	.L38
.L19:
	leaq	728(%rsp), %rax
	movl	$2, %edx
	cmpq	$2, %rbp
	jne	.L24
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L39:
	cmpq	16(%rax), %rcx
	jge	.L23
	movq	$1, -8(%r12,%rdx,8)
.L23:
	addq	$8, %rax
	cmpq	%rbp, %rdx
	je	.L25
.L24:
	movq	8(%rax), %rcx
	addq	$1, %rdx
	cmpq	%rcx, (%rax)
	jg	.L39
	jge	.L23
	cmpq	16(%rax), %rcx
	jle	.L23
	movq	$1, -8(%r13,%rdx,8)
	addq	$8, %rax
	cmpq	%rbp, %rdx
	jne	.L24
.L25:
	addq	$1, %rbp
	xorl	%esi, %esi
	movl	$1000, %eax
	movl	$1, %ecx
	leaq	720(%rsp), %rdi
	.p2align 4,,10
	.p2align 3
.L21:
	cmpq	$1, 0(%r13,%rcx,8)
	jne	.L26
	imulq	(%rdi,%rcx,8), %rsi
	addq	%rsi, %rax
	xorl	%esi, %esi
.L26:
	cmpq	$1, (%r12,%rcx,8)
	jne	.L27
	cqto
	idivq	(%rdi,%rcx,8)
	addq	%rax, %rsi
	movq	%rdx, %rax
.L27:
	addq	$1, %rcx
	cmpq	%rbp, %rcx
	jne	.L21
	movq	%rax, %rdx
	leaq	.LC4(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L13:
	movq	2776(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L40
	addq	$2792, %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
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	addq	$1, %rbx
	cmpq	%rbx, 24(%rsp)
	jge	.L12
	cmpq	$1, %rbp
	jne	.L16
.L18:
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
	jmp	.L13
.L38:
	movq	$1, 2096(%rsp,%rbp,8)
	jmp	.L19
.L40:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE56:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	1413754602
	.long	1075388923
	.align 8
.LC1:
	.long	0
	.long	1081507840
	.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	W_Length
	.type	W_Length, @function
W_Length:
.LFB51:
	.cfi_startproc
	endbr64
	cmpb	$0, (%rdi)
	leaq	1(%rdi), %rax
	je	.L4
	movl	$1, %edx
	subl	%eax, %edx
	.p2align 4,,10
	.p2align 3
.L3:
	leal	(%rdx,%rax), %r8d
	addq	$1, %rax
	cmpb	$0, -1(%rax)
	jne	.L3
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%r8d, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE51:
	.size	W_Length, .-W_Length
	.p2align 4
	.globl	swap
	.type	swap, @function
swap:
.LFB52:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	movl	(%rsi), %edx
	movl	%edx, (%rdi)
	movl	%eax, (%rsi)
	ret
	.cfi_endproc
.LFE52:
	.size	swap, .-swap
	.p2align 4
	.globl	deg
	.type	deg, @function
deg:
.LFB53:
	.cfi_startproc
	endbr64
	mulsd	.LC0(%rip), %xmm0
	divsd	.LC1(%rip), %xmm0
	ret
	.cfi_endproc
.LFE53:
	.size	deg, .-deg
	.p2align 4
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB54:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE54:
	.size	cmp, .-cmp
	.p2align 4
	.globl	cmp_s
	.type	cmp_s, @function
cmp_s:
.LFB55:
	.cfi_startproc
	endbr64
	jmp	strcmp@PLT
	.cfi_endproc
.LFE55:
	.size	cmp_s, .-cmp_s
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"%lld"
.LC3:
	.string	"1000"
.LC4:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB56:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$85, %ecx
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC2(%rip), %r14
	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
	movl	$1, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	$2, %ebx
	subq	$2792, %rsp
	.cfi_def_cfa_offset 2848
	movq	%fs:40, %rax
	movq	%rax, 2776(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rsi
	leaq	32(%rsp), %r15
	leaq	1408(%rsp), %r12
	leaq	2096(%rsp), %r13
	movq	%r12, %rdi
	rep stosq
	movl	$85, %ecx
	movq	%r13, %rdi
	rep stosq
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	leaq	40(%rsp), %rsi
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	movq	40(%rsp), %rax
	cmpq	$1, 24(%rsp)
	movq	%rax, 8(%rsp)
	movq	%rax, 728(%rsp)
	jle	.L18
	.p2align 4,,10
	.p2align 3
.L12:
	leaq	(%r15,%rbx,8), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	(%r15,%rbx,8), %rax
	cmpq	%rax, -8(%r15,%rbx,8)
	je	.L14
	addq	$1, %rbp
	addq	$1, %rbx
	movq	%rax, 720(%rsp,%rbp,8)
	cmpq	%rbx, 24(%rsp)
	jge	.L12
.L16:
	movq	8(%rsp), %rax
	cmpq	736(%rsp), %rax
	setl	%al
	movzbl	%al, %eax
	movq	%rax, 1416(%rsp)
	movq	712(%rsp,%rbp,8), %rax
	cmpq	%rax, 720(%rsp,%rbp,8)
	jg	.L38
.L19:
	leaq	728(%rsp), %rax
	movl	$2, %edx
	cmpq	$2, %rbp
	jne	.L24
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L39:
	cmpq	16(%rax), %rcx
	jge	.L23
	movq	$1, -8(%r12,%rdx,8)
.L23:
	addq	$8, %rax
	cmpq	%rbp, %rdx
	je	.L25
.L24:
	movq	8(%rax), %rcx
	addq	$1, %rdx
	cmpq	%rcx, (%rax)
	jg	.L39
	jge	.L23
	cmpq	16(%rax), %rcx
	jle	.L23
	movq	$1, -8(%r13,%rdx,8)
	addq	$8, %rax
	cmpq	%rbp, %rdx
	jne	.L24
.L25:
	addq	$1, %rbp
	xorl	%esi, %esi
	movl	$1000, %eax
	movl	$1, %ecx
	leaq	720(%rsp), %rdi
	.p2align 4,,10
	.p2align 3
.L21:
	cmpq	$1, 0(%r13,%rcx,8)
	jne	.L26
	imulq	(%rdi,%rcx,8), %rsi
	addq	%rsi, %rax
	xorl	%esi, %esi
.L26:
	cmpq	$1, (%r12,%rcx,8)
	jne	.L27
	cqto
	idivq	(%rdi,%rcx,8)
	addq	%rax, %rsi
	movq	%rdx, %rax
.L27:
	addq	$1, %rcx
	cmpq	%rbp, %rcx
	jne	.L21
	movq	%rax, %rdx
	leaq	.LC4(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L13:
	movq	2776(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L40
	addq	$2792, %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
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	addq	$1, %rbx
	cmpq	%rbx, 24(%rsp)
	jge	.L12
	cmpq	$1, %rbp
	jne	.L16
.L18:
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
	jmp	.L13
.L38:
	movq	$1, 2096(%rsp,%rbp,8)
	jmp	.L19
.L40:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE56:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	1413754602
	.long	1075388923
	.align 8
.LC1:
	.long	0
	.long	1081507840
	.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>
#include<math.h>
#include<string.h>
//if(strcmp(s[i],"AC")==0)
//if(s[l]=='#')
int W_Length(char *str){
	int length = 0;
	while(*str++ != '\0')
		length++;
	return length;
}

void swap(int *a, int *b){
  int temp;
  temp=*a;
  *a=*b;
  *b=temp;
}
//swap(&a, &b)

double deg(double theta){//deg to theta
return theta*(2*3.14159265359)/360;
}

int cmp( const void *p, const void *q ) {
    return *(int*)p - *(int*)q;
}//ちいさい順
//qsort(a,n,sizeof(int),cmp);
//char s[n][11]

int cmp_s(const void * left, const void * right)
{
	char *left_char = (char *)left;
  char *right_char = (char *)right;
  return strcmp(left_char, right_char);
}
//qsort(s,n,sizeof(s[0]),cmp_s);


int main (void)
{
	long long int a[85],b[85],c,n,i,buy[85]={0}, sell[85]={0},mon=1000,k=0,m=1,kabu=0;

scanf("%lld",&n);
  scanf("%lld",&a[1]);
  b[1]=a[1];
	for(i=2;i<=n;i++){
scanf("%lld",&a[i]);
      if(a[i-1]==a[i]){
      continue;
      }
      m++;
      b[m]=a[i];
    }
  if(m==1){
  printf("1000\n");
    return 0;
  }
if(b[1]<b[2]){
buy[1]=1;
}
      if(b[m]>b[m-1]){
      sell[m]=1;
      }
  
  for(i=2;i<m;i++){
  if(b[i-1]>b[i]&&b[i+1]>b[i]){
  buy[i]=1;
  }
    
    if(b[i-1]<b[i]&&b[i+1]<b[i]){
    sell[i]=1;
    }
  }
  
  for(i=1;i<=m;i++){
  //printf("%d\n",b[i]);
  if(sell[i]==1){
  mon+=kabu*b[i];
    kabu=0;
  }
    if(buy[i]==1){
    kabu+=mon/b[i];
      mon=mon%b[i];
    }
 // printf("mon=%d kabu=%d, sell %d, buy %d\n",mon, kabu, sell[i], buy[i]);
  }
  
	printf("%lld\n",mon);
return 0;
}

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 unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
//if(strcmp(s[i],"AC")==0)
//if(s[l]=='#')
int W_Length(char *str){
	int length = 0;
	while(*str++ != '\0')
		length++;
	return length;
}

void swap(int *a, int *b){
  int temp;
  temp=*a;
  *a=*b;
  *b=temp;
}
//swap(&a, &b)

double deg(double theta){//deg to theta
return theta*(2*3.14159265359)/360;
}

int cmp( const void *p, const void *q ) {
    return *(int*)p - *(int*)q;
}//ちいさい順
//qsort(a,n,sizeof(int),cmp);
//char s[n][11]

int cmp_s(const void * left, const void * right)
{
	char *left_char = (char *)left;
  char *right_char = (char *)right;
  return strcmp(left_char, right_char);
}
//qsort(s,n,sizeof(s[0]),cmp_s);


int main (void)
{
	long long int a[85],b[85],c,n,i,buy[85]={0}, sell[85]={0},mon=1000,k=0,m=1,kabu=0;

scanf("%lld",&n);
  scanf("%lld",&a[1]);
  b[1]=a[1];
	for(i=2;i<=n;i++){
scanf("%lld",&a[i]);
      if(a[i-1]==a[i]){
      continue;
      }
      m++;
      b[m]=a[i];
    }
  if(m==1){
  printf("1000\n");
    return 0;
  }
if(b[1]<b[2]){
buy[1]=1;
}
      if(b[m]>b[m-1]){
      sell[m]=1;
      }
  
  for(i=2;i<m;i++){
  if(b[i-1]>b[i]&&b[i+1]>b[i]){
  buy[i]=1;
  }
    
    if(b[i-1]<b[i]&&b[i+1]<b[i]){
    sell[i]=1;
    }
  }
  
  for(i=1;i<=m;i++){
  //printf("%d\n",b[i]);
  if(sell[i]==1){
  mon+=kabu*b[i];
    kabu=0;
  }
    if(buy[i]==1){
    kabu+=mon/b[i];
      mon=mon%b[i];
    }
 // printf("mon=%d kabu=%d, sell %d, buy %d\n",mon, kabu, sell[i], buy[i]);
  }
  
	printf("%lld\n",mon);
return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	W_Length
	.type	W_Length, @function
W_Length:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L3:
	addl	$1, -4(%rbp)
.L2:
	movq	-24(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, -24(%rbp)
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L3
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	W_Length, .-W_Length
	.globl	swap
	.type	swap, @function
swap:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	movl	-4(%rbp), %edx
	movl	%edx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	swap, .-swap
	.globl	deg
	.type	deg, @function
deg:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movsd	%xmm0, -8(%rbp)
	movsd	-8(%rbp), %xmm1
	movsd	.LC0(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	movsd	.LC1(%rip), %xmm1
	divsd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	deg, .-deg
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	cmp, .-cmp
	.globl	cmp_s
	.type	cmp_s, @function
cmp_s:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rdx
	movq	-16(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	cmp_s, .-cmp_s
	.section	.rodata
.LC2:
	.string	"%lld"
.LC3:
	.string	"1000"
.LC4:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$2800, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1376(%rbp), %rdx
	movl	$0, %eax
	movl	$85, %ecx
	movq	%rdx, %rdi
	rep stosq
	leaq	-688(%rbp), %rdx
	movl	$0, %eax
	movl	$85, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	$1000, -2784(%rbp)
	movq	$0, -2760(%rbp)
	movq	$1, -2776(%rbp)
	movq	$0, -2768(%rbp)
	leaq	-2800(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-2752(%rbp), %rax
	addq	$8, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-2744(%rbp), %rax
	movq	%rax, -2056(%rbp)
	movq	$2, -2792(%rbp)
	jmp	.L13
.L16:
	leaq	-2752(%rbp), %rdx
	movq	-2792(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-2792(%rbp), %rax
	subq	$1, %rax
	movq	-2752(%rbp,%rax,8), %rdx
	movq	-2792(%rbp), %rax
	movq	-2752(%rbp,%rax,8), %rax
	cmpq	%rax, %rdx
	je	.L31
	addq	$1, -2776(%rbp)
	movq	-2792(%rbp), %rax
	movq	-2752(%rbp,%rax,8), %rdx
	movq	-2776(%rbp), %rax
	movq	%rdx, -2064(%rbp,%rax,8)
	jmp	.L15
.L31:
	nop
.L15:
	addq	$1, -2792(%rbp)
.L13:
	movq	-2800(%rbp), %rax
	cmpq	%rax, -2792(%rbp)
	jle	.L16
	cmpq	$1, -2776(%rbp)
	jne	.L17
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L29
.L17:
	movq	-2056(%rbp), %rdx
	movq	-2048(%rbp), %rax
	cmpq	%rax, %rdx
	jge	.L19
	movq	$1, -1368(%rbp)
.L19:
	movq	-2776(%rbp), %rax
	movq	-2064(%rbp,%rax,8), %rdx
	movq	-2776(%rbp), %rax
	subq	$1, %rax
	movq	-2064(%rbp,%rax,8), %rax
	cmpq	%rax, %rdx
	jle	.L20
	movq	-2776(%rbp), %rax
	movq	$1, -688(%rbp,%rax,8)
.L20:
	movq	$2, -2792(%rbp)
	jmp	.L21
.L24:
	movq	-2792(%rbp), %rax
	subq	$1, %rax
	movq	-2064(%rbp,%rax,8), %rdx
	movq	-2792(%rbp), %rax
	movq	-2064(%rbp,%rax,8), %rax
	cmpq	%rax, %rdx
	jle	.L22
	movq	-2792(%rbp), %rax
	addq	$1, %rax
	movq	-2064(%rbp,%rax,8), %rdx
	movq	-2792(%rbp), %rax
	movq	-2064(%rbp,%rax,8), %rax
	cmpq	%rax, %rdx
	jle	.L22
	movq	-2792(%rbp), %rax
	movq	$1, -1376(%rbp,%rax,8)
.L22:
	movq	-2792(%rbp), %rax
	subq	$1, %rax
	movq	-2064(%rbp,%rax,8), %rdx
	movq	-2792(%rbp), %rax
	movq	-2064(%rbp,%rax,8), %rax
	cmpq	%rax, %rdx
	jge	.L23
	movq	-2792(%rbp), %rax
	addq	$1, %rax
	movq	-2064(%rbp,%rax,8), %rdx
	movq	-2792(%rbp), %rax
	movq	-2064(%rbp,%rax,8), %rax
	cmpq	%rax, %rdx
	jge	.L23
	movq	-2792(%rbp), %rax
	movq	$1, -688(%rbp,%rax,8)
.L23:
	addq	$1, -2792(%rbp)
.L21:
	movq	-2792(%rbp), %rax
	cmpq	-2776(%rbp), %rax
	jl	.L24
	movq	$1, -2792(%rbp)
	jmp	.L25
.L28:
	movq	-2792(%rbp), %rax
	movq	-688(%rbp,%rax,8), %rax
	cmpq	$1, %rax
	jne	.L26
	movq	-2792(%rbp), %rax
	movq	-2064(%rbp,%rax,8), %rax
	imulq	-2768(%rbp), %rax
	addq	%rax, -2784(%rbp)
	movq	$0, -2768(%rbp)
.L26:
	movq	-2792(%rbp), %rax
	movq	-1376(%rbp,%rax,8), %rax
	cmpq	$1, %rax
	jne	.L27
	movq	-2792(%rbp), %rax
	movq	-2064(%rbp,%rax,8), %rsi
	movq	-2784(%rbp), %rax
	cqto
	idivq	%rsi
	addq	%rax, -2768(%rbp)
	movq	-2792(%rbp), %rax
	movq	-2064(%rbp,%rax,8), %rcx
	movq	-2784(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, -2784(%rbp)
.L27:
	addq	$1, -2792(%rbp)
.L25:
	movq	-2792(%rbp), %rax
	cmpq	-2776(%rbp), %rax
	jle	.L28
	movq	-2784(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L29:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC0:
	.long	1413754602
	.long	1075388923
	.align 8
.LC1:
	.long	0
	.long	1081507840
	.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	W_Length
	.type	W_Length, @function
W_Length:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L3:
	addl	$1, -4(%rbp)
.L2:
	movq	-24(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, -24(%rbp)
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L3
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	W_Length, .-W_Length
	.globl	swap
	.type	swap, @function
swap:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	movl	-4(%rbp), %edx
	movl	%edx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	swap, .-swap
	.globl	deg
	.type	deg, @function
deg:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movsd	%xmm0, -8(%rbp)
	movsd	-8(%rbp), %xmm1
	movsd	.LC0(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	movsd	.LC1(%rip), %xmm1
	divsd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	deg, .-deg
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	cmp, .-cmp
	.globl	cmp_s
	.type	cmp_s, @function
cmp_s:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rdx
	movq	-16(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	cmp_s, .-cmp_s
	.section	.rodata
.LC2:
	.string	"%lld"
.LC3:
	.string	"1000"
.LC4:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$2800, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1376(%rbp), %rdx
	movl	$0, %eax
	movl	$85, %ecx
	movq	%rdx, %rdi
	rep stosq
	leaq	-688(%rbp), %rdx
	movl	$0, %eax
	movl	$85, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	$1000, -2784(%rbp)
	movq	$0, -2760(%rbp)
	movq	$1, -2776(%rbp)
	movq	$0, -2768(%rbp)
	leaq	-2800(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-2752(%rbp), %rax
	addq	$8, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-2744(%rbp), %rax
	movq	%rax, -2056(%rbp)
	movq	$2, -2792(%rbp)
	jmp	.L13
.L16:
	leaq	-2752(%rbp), %rdx
	movq	-2792(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-2792(%rbp), %rax
	subq	$1, %rax
	movq	-2752(%rbp,%rax,8), %rdx
	movq	-2792(%rbp), %rax
	movq	-2752(%rbp,%rax,8), %rax
	cmpq	%rax, %rdx
	je	.L31
	addq	$1, -2776(%rbp)
	movq	-2792(%rbp), %rax
	movq	-2752(%rbp,%rax,8), %rdx
	movq	-2776(%rbp), %rax
	movq	%rdx, -2064(%rbp,%rax,8)
	jmp	.L15
.L31:
	nop
.L15:
	addq	$1, -2792(%rbp)
.L13:
	movq	-2800(%rbp), %rax
	cmpq	%rax, -2792(%rbp)
	jle	.L16
	cmpq	$1, -2776(%rbp)
	jne	.L17
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L29
.L17:
	movq	-2056(%rbp), %rdx
	movq	-2048(%rbp), %rax
	cmpq	%rax, %rdx
	jge	.L19
	movq	$1, -1368(%rbp)
.L19:
	movq	-2776(%rbp), %rax
	movq	-2064(%rbp,%rax,8), %rdx
	movq	-2776(%rbp), %rax
	subq	$1, %rax
	movq	-2064(%rbp,%rax,8), %rax
	cmpq	%rax, %rdx
	jle	.L20
	movq	-2776(%rbp), %rax
	movq	$1, -688(%rbp,%rax,8)
.L20:
	movq	$2, -2792(%rbp)
	jmp	.L21
.L24:
	movq	-2792(%rbp), %rax
	subq	$1, %rax
	movq	-2064(%rbp,%rax,8), %rdx
	movq	-2792(%rbp), %rax
	movq	-2064(%rbp,%rax,8), %rax
	cmpq	%rax, %rdx
	jle	.L22
	movq	-2792(%rbp), %rax
	addq	$1, %rax
	movq	-2064(%rbp,%rax,8), %rdx
	movq	-2792(%rbp), %rax
	movq	-2064(%rbp,%rax,8), %rax
	cmpq	%rax, %rdx
	jle	.L22
	movq	-2792(%rbp), %rax
	movq	$1, -1376(%rbp,%rax,8)
.L22:
	movq	-2792(%rbp), %rax
	subq	$1, %rax
	movq	-2064(%rbp,%rax,8), %rdx
	movq	-2792(%rbp), %rax
	movq	-2064(%rbp,%rax,8), %rax
	cmpq	%rax, %rdx
	jge	.L23
	movq	-2792(%rbp), %rax
	addq	$1, %rax
	movq	-2064(%rbp,%rax,8), %rdx
	movq	-2792(%rbp), %rax
	movq	-2064(%rbp,%rax,8), %rax
	cmpq	%rax, %rdx
	jge	.L23
	movq	-2792(%rbp), %rax
	movq	$1, -688(%rbp,%rax,8)
.L23:
	addq	$1, -2792(%rbp)
.L21:
	movq	-2792(%rbp), %rax
	cmpq	-2776(%rbp), %rax
	jl	.L24
	movq	$1, -2792(%rbp)
	jmp	.L25
.L28:
	movq	-2792(%rbp), %rax
	movq	-688(%rbp,%rax,8), %rax
	cmpq	$1, %rax
	jne	.L26
	movq	-2792(%rbp), %rax
	movq	-2064(%rbp,%rax,8), %rax
	imulq	-2768(%rbp), %rax
	addq	%rax, -2784(%rbp)
	movq	$0, -2768(%rbp)
.L26:
	movq	-2792(%rbp), %rax
	movq	-1376(%rbp,%rax,8), %rax
	cmpq	$1, %rax
	jne	.L27
	movq	-2792(%rbp), %rax
	movq	-2064(%rbp,%rax,8), %rsi
	movq	-2784(%rbp), %rax
	cqto
	idivq	%rsi
	addq	%rax, -2768(%rbp)
	movq	-2792(%rbp), %rax
	movq	-2064(%rbp,%rax,8), %rcx
	movq	-2784(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, -2784(%rbp)
.L27:
	addq	$1, -2792(%rbp)
.L25:
	movq	-2792(%rbp), %rax
	cmpq	-2776(%rbp), %rax
	jle	.L28
	movq	-2784(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L29:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC0:
	.long	1413754602
	.long	1075388923
	.align 8
.LC1:
	.long	0
	.long	1081507840
	.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:
