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>

int main(void)
{
  int i,k,n,t[100],a,b,c,d,l,j,m,T[100];

  scanf("%d",&k);
  for(i=0;i<=k-1;i++)
    {
      t[i]=0;
    }
  for(i=0;i<(k*(k-1))/2;i++)
    {
      scanf("%d%d%d%d",&a,&b,&c,&d);
      if(c<d) t[b-1]+=3;
      else if(c>d) t[a-1]+=3;
      else
	{
	  t[a-1]++;
	  t[b-1]++;
	}
    }
  l=1;
  for(i=3*(k-1);i>=0;i--)
    {
      m=0;
      for(j=0;j<=k-1;j++)
	{
	  if(t[j]==i)
	    {
	      T[j]=l;
	      m++;
	    }
	}
      l+=m;
    }
  for(i=0;i<=k-1;i++)
    {
      printf("%d\n",T[i]);
    }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d%d%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$864, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-852(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -832(%rbp)
	jmp	.L2
.L3:
	movl	-832(%rbp), %eax
	cltq
	movl	$0, -816(%rbp,%rax,4)
	addl	$1, -832(%rbp)
.L2:
	movl	-852(%rbp), %eax
	cmpl	%eax, -832(%rbp)
	jl	.L3
	movl	$0, -832(%rbp)
	jmp	.L4
.L8:
	leaq	-836(%rbp), %rsi
	leaq	-840(%rbp), %rcx
	leaq	-844(%rbp), %rdx
	leaq	-848(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-840(%rbp), %edx
	movl	-836(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L5
	movl	-844(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	movl	-844(%rbp), %edx
	leal	-1(%rdx), %ecx
	leal	3(%rax), %edx
	movslq	%ecx, %rax
	movl	%edx, -816(%rbp,%rax,4)
	jmp	.L6
.L5:
	movl	-840(%rbp), %edx
	movl	-836(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L7
	movl	-848(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	movl	-848(%rbp), %edx
	leal	-1(%rdx), %ecx
	leal	3(%rax), %edx
	movslq	%ecx, %rax
	movl	%edx, -816(%rbp,%rax,4)
	jmp	.L6
.L7:
	movl	-848(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-816(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -816(%rbp,%rax,4)
	movl	-844(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-816(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -816(%rbp,%rax,4)
.L6:
	addl	$1, -832(%rbp)
.L4:
	movl	-852(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-852(%rbp), %eax
	imull	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -832(%rbp)
	jl	.L8
	movl	$1, -828(%rbp)
	movl	-852(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, %eax
	addl	%eax, %eax
	addl	%edx, %eax
	movl	%eax, -832(%rbp)
	jmp	.L9
.L13:
	movl	$0, -820(%rbp)
	movl	$0, -824(%rbp)
	jmp	.L10
.L12:
	movl	-824(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	cmpl	%eax, -832(%rbp)
	jne	.L11
	movl	-824(%rbp), %eax
	cltq
	movl	-828(%rbp), %edx
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -820(%rbp)
.L11:
	addl	$1, -824(%rbp)
.L10:
	movl	-852(%rbp), %eax
	cmpl	%eax, -824(%rbp)
	jl	.L12
	movl	-820(%rbp), %eax
	addl	%eax, -828(%rbp)
	subl	$1, -832(%rbp)
.L9:
	cmpl	$0, -832(%rbp)
	jns	.L13
	movl	$0, -832(%rbp)
	jmp	.L14
.L15:
	movl	-832(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -832(%rbp)
.L14:
	movl	-852(%rbp), %eax
	cmpl	%eax, -832(%rbp)
	jl	.L15
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d%d%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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
	subq	$856, %rsp
	.cfi_def_cfa_offset 912
	movq	%fs:40, %rax
	movq	%rax, 840(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %ebp
	testl	%ebp, %ebp
	jle	.L30
	leaq	32(%rsp), %rcx
	movslq	%ebp, %rbx
	xorl	%esi, %esi
	leaq	0(,%rbx,4), %rdx
	movq	%rcx, %rdi
	call	memset@PLT
	leal	-1(%rbp), %edx
	imull	%edx, %ebp
	movq	%rax, %rcx
	cmpl	$1, %ebp
	jle	.L5
.L3:
	xorl	%ebx, %ebx
	leaq	28(%rsp), %r15
	leaq	24(%rsp), %r14
	leaq	20(%rsp), %r13
	leaq	16(%rsp), %r12
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L32:
	movl	20(%rsp), %eax
	subl	$1, %eax
	cltq
	addl	$3, 32(%rsp,%rax,4)
.L7:
	movl	12(%rsp), %ebp
	addl	$1, %ebx
	leal	-1(%rbp), %ecx
	movl	%ebp, %edx
	imull	%ecx, %edx
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	cmpl	%ebx, %eax
	jle	.L31
.L9:
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%r15, %r8
	movq	%r12, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %ecx
	movl	28(%rsp), %edx
	cmpl	%edx, %ecx
	jl	.L32
	movl	16(%rsp), %eax
	subl	$1, %eax
	cltq
	movl	32(%rsp,%rax,4), %esi
	cmpl	%edx, %ecx
	jle	.L8
	addl	$3, %esi
	movl	%esi, 32(%rsp,%rax,4)
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L8:
	addl	$1, %esi
	movl	%esi, 32(%rsp,%rax,4)
	movl	20(%rsp), %eax
	subl	$1, %eax
	cltq
	addl	$1, 32(%rsp,%rax,4)
	jmp	.L7
.L30:
	leal	-1(%rbp), %eax
	movl	%eax, %edx
	imull	%ebp, %edx
	cmpl	$1, %edx
	jg	.L3
	testl	%eax, %eax
	js	.L10
	.p2align 4,,10
	.p2align 3
.L18:
	movq	840(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L33
	addq	$856, %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
.L31:
	.cfi_restore_state
	leal	(%rcx,%rcx,2), %edx
	testl	%edx, %edx
	js	.L10
	testl	%ebp, %ebp
	jle	.L18
	movslq	%ebp, %rbx
	leaq	32(%rsp), %rcx
.L11:
	movl	$1, %edi
	leaq	432(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L15:
	xorl	%eax, %eax
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L14:
	cmpl	%edx, (%rcx,%rax,4)
	jne	.L13
	movl	%edi, (%r12,%rax,4)
	addl	$1, %esi
.L13:
	addq	$1, %rax
	cmpq	%rax, %rbx
	jne	.L14
	addl	%esi, %edi
	subl	$1, %edx
	jnb	.L15
.L16:
	xorl	%ebx, %ebx
	leaq	.LC2(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L17:
	movl	(%r12,%rbx,4), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 12(%rsp)
	jg	.L17
	jmp	.L18
.L10:
	leaq	432(%rsp), %r12
	testl	%ebp, %ebp
	jg	.L16
	jmp	.L18
.L5:
	leal	(%rdx,%rdx,2), %edx
	jmp	.L11
.L33:
	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
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d%d%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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
	subq	$856, %rsp
	.cfi_def_cfa_offset 912
	movq	%fs:40, %rax
	movq	%rax, 840(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %ebp
	testl	%ebp, %ebp
	jle	.L30
	leaq	32(%rsp), %rcx
	movslq	%ebp, %rbx
	xorl	%esi, %esi
	leaq	0(,%rbx,4), %rdx
	movq	%rcx, %rdi
	call	memset@PLT
	leal	-1(%rbp), %edx
	imull	%edx, %ebp
	movq	%rax, %rcx
	cmpl	$1, %ebp
	jle	.L5
.L3:
	xorl	%ebx, %ebx
	leaq	28(%rsp), %r15
	leaq	24(%rsp), %r14
	leaq	20(%rsp), %r13
	leaq	16(%rsp), %r12
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L32:
	movl	20(%rsp), %eax
	subl	$1, %eax
	cltq
	addl	$3, 32(%rsp,%rax,4)
.L7:
	movl	12(%rsp), %ebp
	addl	$1, %ebx
	leal	-1(%rbp), %ecx
	movl	%ebp, %edx
	imull	%ecx, %edx
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	cmpl	%ebx, %eax
	jle	.L31
.L9:
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%r15, %r8
	movq	%r12, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %ecx
	movl	28(%rsp), %edx
	cmpl	%edx, %ecx
	jl	.L32
	movl	16(%rsp), %eax
	subl	$1, %eax
	cltq
	movl	32(%rsp,%rax,4), %esi
	cmpl	%edx, %ecx
	jle	.L8
	addl	$3, %esi
	movl	%esi, 32(%rsp,%rax,4)
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L8:
	addl	$1, %esi
	movl	%esi, 32(%rsp,%rax,4)
	movl	20(%rsp), %eax
	subl	$1, %eax
	cltq
	addl	$1, 32(%rsp,%rax,4)
	jmp	.L7
.L30:
	leal	-1(%rbp), %eax
	movl	%eax, %edx
	imull	%ebp, %edx
	cmpl	$1, %edx
	jg	.L3
	testl	%eax, %eax
	js	.L10
	.p2align 4,,10
	.p2align 3
.L18:
	movq	840(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L33
	addq	$856, %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
.L31:
	.cfi_restore_state
	leal	(%rcx,%rcx,2), %edx
	testl	%edx, %edx
	js	.L10
	testl	%ebp, %ebp
	jle	.L18
	movslq	%ebp, %rbx
	leaq	32(%rsp), %rcx
.L11:
	movl	$1, %edi
	leaq	432(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L15:
	xorl	%eax, %eax
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L14:
	cmpl	%edx, (%rcx,%rax,4)
	jne	.L13
	movl	%edi, (%r12,%rax,4)
	addl	$1, %esi
.L13:
	addq	$1, %rax
	cmpq	%rax, %rbx
	jne	.L14
	addl	%esi, %edi
	subl	$1, %edx
	jnb	.L15
.L16:
	xorl	%ebx, %ebx
	leaq	.LC2(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L17:
	movl	(%r12,%rbx,4), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 12(%rsp)
	jg	.L17
	jmp	.L18
.L10:
	leaq	432(%rsp), %r12
	testl	%ebp, %ebp
	jg	.L16
	jmp	.L18
.L5:
	leal	(%rdx,%rdx,2), %edx
	jmp	.L11
.L33:
	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:

#include<stdio.h>

int main(void)
{
  int i,k,n,t[100],a,b,c,d,l,j,m,T[100];

  scanf("%d",&k);
  for(i=0;i<=k-1;i++)
    {
      t[i]=0;
    }
  for(i=0;i<(k*(k-1))/2;i++)
    {
      scanf("%d%d%d%d",&a,&b,&c,&d);
      if(c<d) t[b-1]+=3;
      else if(c>d) t[a-1]+=3;
      else
	{
	  t[a-1]++;
	  t[b-1]++;
	}
    }
  l=1;
  for(i=3*(k-1);i>=0;i--)
    {
      m=0;
      for(j=0;j<=k-1;j++)
	{
	  if(t[j]==i)
	    {
	      T[j]=l;
	      m++;
	    }
	}
      l+=m;
    }
  for(i=0;i<=k-1;i++)
    {
      printf("%d\n",T[i]);
    }
  return 0;
}
4
1 2 0 1
1 3 2 1
1 4 2 2
2 3 2 1
2 4 3 0
3 4 1 3
 4
1 2 0 1
1 3 2 1
1 4 2 2
4 3 2 1
2 4 3 0
3 4 1 3
 4
1 2 1 1
1 3 2 1
1 4 2 2
4 0 3 1
2 4 3 0
0 4 1 4
 4
1 1 1 1
1 3 2 1
1 4 2 0
4 0 3 1
2 4 3 0
0 4 1 4
 4
1 2 0 1
2 3 2 1
1 4 2 2
2 3 2 1
2 4 3 0
3 4 1 3
 4
1 2 0 1
1 3 2 1
1 4 2 2
4 0 2 1
3 4 3 0
0 4 1 4
 4
1 1 1 1
1 3 2 1
1 3 2 2
4 0 3 2
2 4 3 0
0 4 1 4
 4
1 4 0 1
1 3 2 1
1 4 2 2
4 0 2 1
3 4 3 0
-1 4 1 4
 4
1 1 1 1
1 3 2 1
2 4 2 0
4 0 3 1
2 4 3 0
0 4 2 8
 4
1 2 0 1
1 3 2 1
1 4 2 2
2 3 1 0
2 4 3 0
3 4 1 0

2
1
4
2
 3
2
4
1
 2
3
4
1
 1
3
4
2
 2
0
3
1
 2
3
3
1
 1
3
4
1
 1
3
2
0
 3
1
4
1
 2
1
3
4

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>

int main(void)
{
  int i,k,n,t[100],a,b,c,d,l,j,m,T[100];

  scanf("%d",&k);
  for(i=0;i<=k-1;i++)
    {
      t[i]=0;
    }
  for(i=0;i<(k*(k-1))/2;i++)
    {
      scanf("%d%d%d%d",&a,&b,&c,&d);
      if(c<d) t[b-1]+=3;
      else if(c>d) t[a-1]+=3;
      else
	{
	  t[a-1]++;
	  t[b-1]++;
	}
    }
  l=1;
  for(i=3*(k-1);i>=0;i--)
    {
      m=0;
      for(j=0;j<=k-1;j++)
	{
	  if(t[j]==i)
	    {
	      T[j]=l;
	      m++;
	    }
	}
      l+=m;
    }
  for(i=0;i<=k-1;i++)
    {
      printf("%d\n",T[i]);
    }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d%d%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$864, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-852(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -832(%rbp)
	jmp	.L2
.L3:
	movl	-832(%rbp), %eax
	cltq
	movl	$0, -816(%rbp,%rax,4)
	addl	$1, -832(%rbp)
.L2:
	movl	-852(%rbp), %eax
	cmpl	%eax, -832(%rbp)
	jl	.L3
	movl	$0, -832(%rbp)
	jmp	.L4
.L8:
	leaq	-836(%rbp), %rsi
	leaq	-840(%rbp), %rcx
	leaq	-844(%rbp), %rdx
	leaq	-848(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-840(%rbp), %edx
	movl	-836(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L5
	movl	-844(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	movl	-844(%rbp), %edx
	leal	-1(%rdx), %ecx
	leal	3(%rax), %edx
	movslq	%ecx, %rax
	movl	%edx, -816(%rbp,%rax,4)
	jmp	.L6
.L5:
	movl	-840(%rbp), %edx
	movl	-836(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L7
	movl	-848(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	movl	-848(%rbp), %edx
	leal	-1(%rdx), %ecx
	leal	3(%rax), %edx
	movslq	%ecx, %rax
	movl	%edx, -816(%rbp,%rax,4)
	jmp	.L6
.L7:
	movl	-848(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-816(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -816(%rbp,%rax,4)
	movl	-844(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-816(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -816(%rbp,%rax,4)
.L6:
	addl	$1, -832(%rbp)
.L4:
	movl	-852(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-852(%rbp), %eax
	imull	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -832(%rbp)
	jl	.L8
	movl	$1, -828(%rbp)
	movl	-852(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, %eax
	addl	%eax, %eax
	addl	%edx, %eax
	movl	%eax, -832(%rbp)
	jmp	.L9
.L13:
	movl	$0, -820(%rbp)
	movl	$0, -824(%rbp)
	jmp	.L10
.L12:
	movl	-824(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	cmpl	%eax, -832(%rbp)
	jne	.L11
	movl	-824(%rbp), %eax
	cltq
	movl	-828(%rbp), %edx
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -820(%rbp)
.L11:
	addl	$1, -824(%rbp)
.L10:
	movl	-852(%rbp), %eax
	cmpl	%eax, -824(%rbp)
	jl	.L12
	movl	-820(%rbp), %eax
	addl	%eax, -828(%rbp)
	subl	$1, -832(%rbp)
.L9:
	cmpl	$0, -832(%rbp)
	jns	.L13
	movl	$0, -832(%rbp)
	jmp	.L14
.L15:
	movl	-832(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -832(%rbp)
.L14:
	movl	-852(%rbp), %eax
	cmpl	%eax, -832(%rbp)
	jl	.L15
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d%d%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$864, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-852(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -832(%rbp)
	jmp	.L2
.L3:
	movl	-832(%rbp), %eax
	cltq
	movl	$0, -816(%rbp,%rax,4)
	addl	$1, -832(%rbp)
.L2:
	movl	-852(%rbp), %eax
	cmpl	%eax, -832(%rbp)
	jl	.L3
	movl	$0, -832(%rbp)
	jmp	.L4
.L8:
	leaq	-836(%rbp), %rsi
	leaq	-840(%rbp), %rcx
	leaq	-844(%rbp), %rdx
	leaq	-848(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-840(%rbp), %edx
	movl	-836(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L5
	movl	-844(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	movl	-844(%rbp), %edx
	leal	-1(%rdx), %ecx
	leal	3(%rax), %edx
	movslq	%ecx, %rax
	movl	%edx, -816(%rbp,%rax,4)
	jmp	.L6
.L5:
	movl	-840(%rbp), %edx
	movl	-836(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L7
	movl	-848(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	movl	-848(%rbp), %edx
	leal	-1(%rdx), %ecx
	leal	3(%rax), %edx
	movslq	%ecx, %rax
	movl	%edx, -816(%rbp,%rax,4)
	jmp	.L6
.L7:
	movl	-848(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-816(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -816(%rbp,%rax,4)
	movl	-844(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-816(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -816(%rbp,%rax,4)
.L6:
	addl	$1, -832(%rbp)
.L4:
	movl	-852(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-852(%rbp), %eax
	imull	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -832(%rbp)
	jl	.L8
	movl	$1, -828(%rbp)
	movl	-852(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, %eax
	addl	%eax, %eax
	addl	%edx, %eax
	movl	%eax, -832(%rbp)
	jmp	.L9
.L13:
	movl	$0, -820(%rbp)
	movl	$0, -824(%rbp)
	jmp	.L10
.L12:
	movl	-824(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	cmpl	%eax, -832(%rbp)
	jne	.L11
	movl	-824(%rbp), %eax
	cltq
	movl	-828(%rbp), %edx
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -820(%rbp)
.L11:
	addl	$1, -824(%rbp)
.L10:
	movl	-852(%rbp), %eax
	cmpl	%eax, -824(%rbp)
	jl	.L12
	movl	-820(%rbp), %eax
	addl	%eax, -828(%rbp)
	subl	$1, -832(%rbp)
.L9:
	cmpl	$0, -832(%rbp)
	jns	.L13
	movl	$0, -832(%rbp)
	jmp	.L14
.L15:
	movl	-832(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -832(%rbp)
.L14:
	movl	-852(%rbp), %eax
	cmpl	%eax, -832(%rbp)
	jl	.L15
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
