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 x[101],ans[101][101];

int main(void){

  int n,i,j,a,b,c,d,res=0;

  scanf("%d",&n);

  while(~scanf("%d %d %d %d",&a,&b,&c,&d)){
    if(c>d)x[a]+=3;
    else if(c==d){x[a]+=1;x[b]+=1;}
    else x[b]+=3;
  }

  for(i=1;i<=n;i++){
    for(j=1;j<=n;j++){
      if(res<=x[j]){a=j;res=x[j];}
    }

    for(j=1;j<=n;j++){
      if(res==x[j])ans[i][j]=1;
    }
    x[a]=-1;
    res=0;
  }

  for(i=1;i<=n;i++){
    for(j=1;j<=n;j++){
      if(ans[j][i]==1){
	printf("%d\n",j);
	break;
      }
    }
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	x
	.bss
	.align 32
	.type	x, @object
	.size	x, 404
x:
	.zero	404
	.globl	ans
	.align 32
	.type	ans, @object
	.size	ans, 40804
ans:
	.zero	40804
	.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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -12(%rbp)
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L2
.L5:
	movl	-28(%rbp), %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L3
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-36(%rbp), %eax
	leal	3(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L2
.L3:
	movl	-28(%rbp), %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L4
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-36(%rbp), %eax
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-32(%rbp), %eax
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L2
.L4:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-32(%rbp), %eax
	leal	3(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L2:
	leaq	-24(%rbp), %rsi
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	jne	.L5
	movl	$1, -20(%rbp)
	jmp	.L6
.L13:
	movl	$1, -16(%rbp)
	jmp	.L7
.L9:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -12(%rbp)
	jg	.L8
	movl	-16(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
.L8:
	addl	$1, -16(%rbp)
.L7:
	movl	-40(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L9
	movl	$1, -16(%rbp)
	jmp	.L10
.L12:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L11
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	ans(%rip), %rax
	movl	$1, (%rdx,%rax)
.L11:
	addl	$1, -16(%rbp)
.L10:
	movl	-40(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L12
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	$-1, (%rdx,%rax)
	movl	$0, -12(%rbp)
	addl	$1, -20(%rbp)
.L6:
	movl	-40(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L13
	movl	$1, -20(%rbp)
	jmp	.L14
.L19:
	movl	$1, -16(%rbp)
	jmp	.L15
.L18:
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	ans(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L16
	movl	-16(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L17
.L16:
	addl	$1, -16(%rbp)
.L15:
	movl	-40(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L18
.L17:
	addl	$1, -20(%rbp)
.L14:
	movl	-40(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L19
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	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
	leaq	x(%rip), %r15
	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
	leaq	.LC1(%rip), %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	leaq	20(%rsp), %r14
	leaq	16(%rsp), %r13
	leaq	12(%rsp), %r12
	leaq	8(%rsp), %rbp
	call	__isoc99_scanf@PLT
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r14, %r8
	movq	%r13, %rcx
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L32
	movl	20(%rsp), %eax
	cmpl	%eax, 16(%rsp)
	jle	.L3
	movslq	8(%rsp), %rax
	addl	$3, (%r15,%rax,4)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	movslq	12(%rsp), %rax
	je	.L33
	addl	$3, (%r15,%rax,4)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L33:
	movslq	8(%rsp), %rdx
	addl	$1, (%r15,%rdx,4)
	addl	$1, (%r15,%rax,4)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L32:
	movl	4(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L18
	leal	-1(%r8), %eax
	leaq	404+ans(%rip), %r9
	movl	8(%rsp), %r10d
	xorl	%r11d, %r11d
	imulq	$404, %rax, %rbx
	leaq	404(%r9), %rdx
	leaq	x(%rip), %rsi
	leaq	2(%rax), %rdi
	addq	%rdx, %rbx
	.p2align 4,,10
	.p2align 3
.L12:
	movl	$1, %eax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L9:
	movl	(%rsi,%rax,4), %ecx
	cmpl	%edx, %ecx
	jl	.L8
	movl	%eax, %r10d
	movl	%ecx, %edx
	movl	$1, %r11d
.L8:
	addq	$1, %rax
	cmpq	%rdi, %rax
	jne	.L9
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L11:
	cmpl	(%rsi,%rax,4), %edx
	jne	.L10
	movl	$1, (%r9,%rax,4)
.L10:
	addq	$1, %rax
	cmpq	%rdi, %rax
	jne	.L11
	movslq	%r10d, %rax
	addq	$404, %r9
	movl	$-1, (%rsi,%rax,4)
	cmpq	%rbx, %r9
	jne	.L12
	testb	%r11b, %r11b
	je	.L13
	movl	%r10d, 8(%rsp)
.L13:
	leaq	4+ans(%rip), %rbp
	movl	$1, %ebx
	leaq	.LC2(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L17:
	movq	%rbp, %rax
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L16:
	cmpl	$1, 404(%rax)
	je	.L34
	addl	$1, %edx
	addq	$404, %rax
	cmpl	%r8d, %edx
	jle	.L16
	addl	$1, %ebx
	addq	$4, %rbp
	cmpl	%ebx, %r8d
	jge	.L17
.L18:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L35
	addq	$40, %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
.L34:
	.cfi_restore_state
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__printf_chk@PLT
	movl	4(%rsp), %r8d
	addq	$4, %rbp
	cmpl	%ebx, %r8d
	jge	.L17
	jmp	.L18
.L35:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	ans
	.bss
	.align 32
	.type	ans, @object
	.size	ans, 40804
ans:
	.zero	40804
	.globl	x
	.align 32
	.type	x, @object
	.size	x, 404
x:
	.zero	404
	.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
	leaq	x(%rip), %r15
	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
	leaq	.LC1(%rip), %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	leaq	20(%rsp), %r14
	leaq	16(%rsp), %r13
	leaq	12(%rsp), %r12
	leaq	8(%rsp), %rbp
	call	__isoc99_scanf@PLT
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r14, %r8
	movq	%r13, %rcx
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L32
	movl	20(%rsp), %eax
	cmpl	%eax, 16(%rsp)
	jle	.L3
	movslq	8(%rsp), %rax
	addl	$3, (%r15,%rax,4)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	movslq	12(%rsp), %rax
	je	.L33
	addl	$3, (%r15,%rax,4)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L33:
	movslq	8(%rsp), %rdx
	addl	$1, (%r15,%rdx,4)
	addl	$1, (%r15,%rax,4)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L32:
	movl	4(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L18
	leal	-1(%r8), %eax
	leaq	404+ans(%rip), %r9
	movl	8(%rsp), %r10d
	xorl	%r11d, %r11d
	imulq	$404, %rax, %rbx
	leaq	404(%r9), %rdx
	leaq	x(%rip), %rsi
	leaq	2(%rax), %rdi
	addq	%rdx, %rbx
	.p2align 4,,10
	.p2align 3
.L12:
	movl	$1, %eax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L9:
	movl	(%rsi,%rax,4), %ecx
	cmpl	%edx, %ecx
	jl	.L8
	movl	%eax, %r10d
	movl	%ecx, %edx
	movl	$1, %r11d
.L8:
	addq	$1, %rax
	cmpq	%rdi, %rax
	jne	.L9
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L11:
	cmpl	(%rsi,%rax,4), %edx
	jne	.L10
	movl	$1, (%r9,%rax,4)
.L10:
	addq	$1, %rax
	cmpq	%rdi, %rax
	jne	.L11
	movslq	%r10d, %rax
	addq	$404, %r9
	movl	$-1, (%rsi,%rax,4)
	cmpq	%rbx, %r9
	jne	.L12
	testb	%r11b, %r11b
	je	.L13
	movl	%r10d, 8(%rsp)
.L13:
	leaq	4+ans(%rip), %rbp
	movl	$1, %ebx
	leaq	.LC2(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L17:
	movq	%rbp, %rax
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L16:
	cmpl	$1, 404(%rax)
	je	.L34
	addl	$1, %edx
	addq	$404, %rax
	cmpl	%r8d, %edx
	jle	.L16
	addl	$1, %ebx
	addq	$4, %rbp
	cmpl	%ebx, %r8d
	jge	.L17
.L18:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L35
	addq	$40, %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
.L34:
	.cfi_restore_state
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__printf_chk@PLT
	movl	4(%rsp), %r8d
	addq	$4, %rbp
	cmpl	%ebx, %r8d
	jge	.L17
	jmp	.L18
.L35:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	ans
	.bss
	.align 32
	.type	ans, @object
	.size	ans, 40804
ans:
	.zero	40804
	.globl	x
	.align 32
	.type	x, @object
	.size	x, 404
x:
	.zero	404
	.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 x[101],ans[101][101];

int main(void){

  int n,i,j,a,b,c,d,res=0;

  scanf("%d",&n);

  while(~scanf("%d %d %d %d",&a,&b,&c,&d)){
    if(c>d)x[a]+=3;
    else if(c==d){x[a]+=1;x[b]+=1;}
    else x[b]+=3;
  }

  for(i=1;i<=n;i++){
    for(j=1;j<=n;j++){
      if(res<=x[j]){a=j;res=x[j];}
    }

    for(j=1;j<=n;j++){
      if(res==x[j])ans[i][j]=1;
    }
    x[a]=-1;
    res=0;
  }

  for(i=1;i<=n;i++){
    for(j=1;j<=n;j++){
      if(ans[j][i]==1){
	printf("%d\n",j);
	break;
      }
    }
  }
  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
 3
1
4
2
 2
3
3
1
 1
3
4
1
 2
4
3
1
 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 x[101],ans[101][101];

int main(void){

  int n,i,j,a,b,c,d,res=0;

  scanf("%d",&n);

  while(~scanf("%d %d %d %d",&a,&b,&c,&d)){
    if(c>d)x[a]+=3;
    else if(c==d){x[a]+=1;x[b]+=1;}
    else x[b]+=3;
  }

  for(i=1;i<=n;i++){
    for(j=1;j<=n;j++){
      if(res<=x[j]){a=j;res=x[j];}
    }

    for(j=1;j<=n;j++){
      if(res==x[j])ans[i][j]=1;
    }
    x[a]=-1;
    res=0;
  }

  for(i=1;i<=n;i++){
    for(j=1;j<=n;j++){
      if(ans[j][i]==1){
	printf("%d\n",j);
	break;
      }
    }
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	x
	.bss
	.align 32
	.type	x, @object
	.size	x, 404
x:
	.zero	404
	.globl	ans
	.align 32
	.type	ans, @object
	.size	ans, 40804
ans:
	.zero	40804
	.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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -12(%rbp)
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L2
.L5:
	movl	-28(%rbp), %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L3
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-36(%rbp), %eax
	leal	3(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L2
.L3:
	movl	-28(%rbp), %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L4
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-36(%rbp), %eax
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-32(%rbp), %eax
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L2
.L4:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-32(%rbp), %eax
	leal	3(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L2:
	leaq	-24(%rbp), %rsi
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	jne	.L5
	movl	$1, -20(%rbp)
	jmp	.L6
.L13:
	movl	$1, -16(%rbp)
	jmp	.L7
.L9:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -12(%rbp)
	jg	.L8
	movl	-16(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
.L8:
	addl	$1, -16(%rbp)
.L7:
	movl	-40(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L9
	movl	$1, -16(%rbp)
	jmp	.L10
.L12:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L11
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	ans(%rip), %rax
	movl	$1, (%rdx,%rax)
.L11:
	addl	$1, -16(%rbp)
.L10:
	movl	-40(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L12
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	$-1, (%rdx,%rax)
	movl	$0, -12(%rbp)
	addl	$1, -20(%rbp)
.L6:
	movl	-40(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L13
	movl	$1, -20(%rbp)
	jmp	.L14
.L19:
	movl	$1, -16(%rbp)
	jmp	.L15
.L18:
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	ans(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L16
	movl	-16(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L17
.L16:
	addl	$1, -16(%rbp)
.L15:
	movl	-40(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L18
.L17:
	addl	$1, -20(%rbp)
.L14:
	movl	-40(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L19
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	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
	.globl	x
	.bss
	.align 32
	.type	x, @object
	.size	x, 404
x:
	.zero	404
	.globl	ans
	.align 32
	.type	ans, @object
	.size	ans, 40804
ans:
	.zero	40804
	.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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -12(%rbp)
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L2
.L5:
	movl	-28(%rbp), %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L3
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-36(%rbp), %eax
	leal	3(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L2
.L3:
	movl	-28(%rbp), %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L4
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-36(%rbp), %eax
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-32(%rbp), %eax
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L2
.L4:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-32(%rbp), %eax
	leal	3(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L2:
	leaq	-24(%rbp), %rsi
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	jne	.L5
	movl	$1, -20(%rbp)
	jmp	.L6
.L13:
	movl	$1, -16(%rbp)
	jmp	.L7
.L9:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -12(%rbp)
	jg	.L8
	movl	-16(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
.L8:
	addl	$1, -16(%rbp)
.L7:
	movl	-40(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L9
	movl	$1, -16(%rbp)
	jmp	.L10
.L12:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L11
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	ans(%rip), %rax
	movl	$1, (%rdx,%rax)
.L11:
	addl	$1, -16(%rbp)
.L10:
	movl	-40(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L12
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	$-1, (%rdx,%rax)
	movl	$0, -12(%rbp)
	addl	$1, -20(%rbp)
.L6:
	movl	-40(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L13
	movl	$1, -20(%rbp)
	jmp	.L14
.L19:
	movl	$1, -16(%rbp)
	jmp	.L15
.L18:
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	ans(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L16
	movl	-16(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L17
.L16:
	addl	$1, -16(%rbp)
.L15:
	movl	-40(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L18
.L17:
	addl	$1, -20(%rbp)
.L14:
	movl	-40(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L19
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	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:
