Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>

int main(){
  int num, game, n, m, p1, p2, i, j;
  int team[100];
  int k,count=0,teamrank[100];

  for(i=0; i<100; i++){
    team[i]=0;
  }

  scanf("%d", &num);
  game = num*(num-1)/2;
  
  for(i=0; i<game; i++){
    scanf("%d%d%d%d", &n, &m, &p1, &p2);
    if(p1==p2){
      team[n-1]++;
      team[m-1]++;
    }else if(p1>p2){
      team[n-1]+=3;
    }else{
      team[m-1]+=3;
    }
  }

  // for(i=0;i<num;i++)printf("%d\n",team[i]);
  
  k=1;
  
  for(j=3*(num-1);j>=0;j--){
    for(i=0;i<num;i++){
      if(team[i]==j){
	teamrank[i]=k;
	count++;
      }
    }
    k+=count;
    count=0;
  }

    for(i=0;i<num;i++)printf("%d\n",teamrank[i]);

  
  
  
  return 0;
}```

Assembly Code:

```assembly
	.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
	movl	$50, %ecx
	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	$872, %rsp
	.cfi_def_cfa_offset 928
	movq	%fs:40, %rax
	movq	%rax, 856(%rsp)
	xorl	%eax, %eax
	leaq	48(%rsp), %rbx
	leaq	28(%rsp), %rsi
	movq	%rbx, %rdi
	rep stosq
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	leal	-1(%rax), %edx
	imull	%eax, %edx
	movl	%edx, %ebp
	shrl	$31, %ebp
	addl	%edx, %ebp
	sarl	%ebp
	movl	%ebp, 12(%rsp)
	cmpl	$1, %edx
	jle	.L9
	xorl	%ebp, %ebp
	leaq	44(%rsp), %r8
	leaq	40(%rsp), %r15
	leaq	36(%rsp), %r14
	leaq	32(%rsp), %r13
	leaq	.LC1(%rip), %r12
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L6:
	jle	.L8
	movl	32(%rsp), %eax
	subl	$1, %eax
	cltq
	addl	$3, 48(%rsp,%rax,4)
.L7:
	addl	$1, %ebp
	cmpl	%ebp, 12(%rsp)
	jle	.L28
.L2:
	xorl	%eax, %eax
	movq	%r15, %rcx
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%r12, %rdi
	movq	%r8, (%rsp)
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	cmpl	%eax, 40(%rsp)
	movq	(%rsp), %r8
	jne	.L6
	movl	32(%rsp), %eax
	addl	$1, %ebp
	subl	$1, %eax
	cltq
	addl	$1, 48(%rsp,%rax,4)
	movl	36(%rsp), %eax
	subl	$1, %eax
	cltq
	addl	$1, 48(%rsp,%rax,4)
	cmpl	%ebp, 12(%rsp)
	jg	.L2
.L28:
	movl	28(%rsp), %eax
.L9:
	leal	-3(%rax,%rax,2), %edx
	testl	%edx, %edx
	js	.L3
	movl	$1, %edi
	leaq	448(%rsp), %rbp
	movslq	%eax, %rcx
	testl	%eax, %eax
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%eax, %eax
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L11:
	cmpl	%edx, (%rbx,%rax,4)
	jne	.L10
	movl	%edi, 0(%rbp,%rax,4)
	addl	$1, %esi
.L10:
	addq	$1, %rax
	cmpq	%rcx, %rax
	jne	.L11
	addl	%esi, %edi
	subl	$1, %edx
	jnb	.L4
.L12:
	xorl	%ebx, %ebx
	leaq	.LC2(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L13:
	movl	0(%rbp,%rbx,4), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 28(%rsp)
	jg	.L13
.L5:
	movq	856(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	addq	$872, %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
.L8:
	.cfi_restore_state
	movl	36(%rsp), %eax
	subl	$1, %eax
	cltq
	addl	$3, 48(%rsp,%rax,4)
	jmp	.L7
.L3:
	leaq	448(%rsp), %rbp
	testl	%eax, %eax
	jg	.L12
	jmp	.L5
.L29:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%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
	movl	$50, %ecx
	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	$872, %rsp
	.cfi_def_cfa_offset 928
	movq	%fs:40, %rax
	movq	%rax, 856(%rsp)
	xorl	%eax, %eax
	leaq	48(%rsp), %rbx
	leaq	28(%rsp), %rsi
	movq	%rbx, %rdi
	rep stosq
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	leal	-1(%rax), %edx
	imull	%eax, %edx
	movl	%edx, %ebp
	shrl	$31, %ebp
	addl	%edx, %ebp
	sarl	%ebp
	movl	%ebp, 12(%rsp)
	cmpl	$1, %edx
	jle	.L9
	xorl	%ebp, %ebp
	leaq	44(%rsp), %r8
	leaq	40(%rsp), %r15
	leaq	36(%rsp), %r14
	leaq	32(%rsp), %r13
	leaq	.LC1(%rip), %r12
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L6:
	jle	.L8
	movl	32(%rsp), %eax
	subl	$1, %eax
	cltq
	addl	$3, 48(%rsp,%rax,4)
.L7:
	addl	$1, %ebp
	cmpl	%ebp, 12(%rsp)
	jle	.L28
.L2:
	xorl	%eax, %eax
	movq	%r15, %rcx
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%r12, %rdi
	movq	%r8, (%rsp)
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	cmpl	%eax, 40(%rsp)
	movq	(%rsp), %r8
	jne	.L6
	movl	32(%rsp), %eax
	addl	$1, %ebp
	subl	$1, %eax
	cltq
	addl	$1, 48(%rsp,%rax,4)
	movl	36(%rsp), %eax
	subl	$1, %eax
	cltq
	addl	$1, 48(%rsp,%rax,4)
	cmpl	%ebp, 12(%rsp)
	jg	.L2
.L28:
	movl	28(%rsp), %eax
.L9:
	leal	-3(%rax,%rax,2), %edx
	testl	%edx, %edx
	js	.L3
	movl	$1, %edi
	leaq	448(%rsp), %rbp
	movslq	%eax, %rcx
	testl	%eax, %eax
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%eax, %eax
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L11:
	cmpl	%edx, (%rbx,%rax,4)
	jne	.L10
	movl	%edi, 0(%rbp,%rax,4)
	addl	$1, %esi
.L10:
	addq	$1, %rax
	cmpq	%rcx, %rax
	jne	.L11
	addl	%esi, %edi
	subl	$1, %edx
	jnb	.L4
.L12:
	xorl	%ebx, %ebx
	leaq	.LC2(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L13:
	movl	0(%rbp,%rbx,4), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 28(%rsp)
	jg	.L13
.L5:
	movq	856(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	addq	$872, %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
.L8:
	.cfi_restore_state
	movl	36(%rsp), %eax
	subl	$1, %eax
	cltq
	addl	$3, 48(%rsp,%rax,4)
	jmp	.L7
.L3:
	leaq	448(%rsp), %rbp
	testl	%eax, %eax
	jg	.L12
	jmp	.L5
.L29:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```
rule
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%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
	movl	$50, %ecx
	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	$872, %rsp
	.cfi_def_cfa_offset 928
	movq	%fs:40, %rax
	movq	%rax, 856(%rsp)
	xorl	%eax, %eax
	leaq	48(%rsp), %rbx
	leaq	28(%rsp), %rsi
	movq	%rbx, %rdi
	rep stosq
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	leal	-1(%rax), %edx
	imull	%eax, %edx
	movl	%edx, %ebp
	shrl	$31, %ebp
	addl	%edx, %ebp
	sarl	%ebp
	movl	%ebp, 12(%rsp)
	cmpl	$1, %edx
	jle	.L9
	xorl	%ebp, %ebp
	leaq	44(%rsp), %r8
	leaq	40(%rsp), %r15
	leaq	36(%rsp), %r14
	leaq	32(%rsp), %r13
	leaq	.LC1(%rip), %r12
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L6:
	jle	.L8
	movl	32(%rsp), %eax
	subl	$1, %eax
	cltq
	addl	$3, 48(%rsp,%rax,4)
.L7:
	addl	$1, %ebp
	cmpl	%ebp, 12(%rsp)
	jle	.L28
.L2:
	xorl	%eax, %eax
	movq	%r15, %rcx
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%r12, %rdi
	movq	%r8, (%rsp)
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	cmpl	%eax, 40(%rsp)
	movq	(%rsp), %r8
	jne	.L6
	movl	32(%rsp), %eax
	addl	$1, %ebp
	subl	$1, %eax
	cltq
	addl	$1, 48(%rsp,%rax,4)
	movl	36(%rsp), %eax
	subl	$1, %eax
	cltq
	addl	$1, 48(%rsp,%rax,4)
	cmpl	%ebp, 12(%rsp)
	jg	.L2
.L28:
	movl	28(%rsp), %eax
.L9:
	leal	-3(%rax,%rax,2), %edx
	testl	%edx, %edx
	js	.L3
	movl	$1, %edi
	leaq	448(%rsp), %rbp
	movslq	%eax, %rcx
	testl	%eax, %eax
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%eax, %eax
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L11:
	cmpl	%edx, (%rbx,%rax,4)
	jne	.L10
	movl	%edi, 0(%rbp,%rax,4)
	addl	$1, %esi
.L10:
	addq	$1, %rax
	cmpq	%rcx, %rax
	jne	.L11
	addl	%esi, %edi
	subl	$1, %edx
	jnb	.L4
.L12:
	xorl	%ebx, %ebx
	leaq	.LC2(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L13:
	movl	0(%rbp,%rbx,4), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 28(%rsp)
	jg	.L13
.L5:
	movq	856(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	addq	$872, %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
.L8:
	.cfi_restore_state
	movl	36(%rsp), %eax
	subl	$1, %eax
	cltq
	addl	$3, 48(%rsp,%rax,4)
	jmp	.L7
.L3:
	leaq	448(%rsp), %rbp
	testl	%eax, %eax
	jg	.L12
	jmp	.L5
.L29:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```
```c
#include<stdio.h>

int main(){
  int num, game, n, m, p1, p2, i, j;
  int team[100];
  int k,count=0,teamrank[100];

  for(i=0; i<100; i++){
    team[i]=0;
  }

  scanf("%d", &num);
  game = num*(num-1)/2;
  
  for(i=0; i<game; i++){
    scanf("%d%d%d%d", &n, &m, &p1, &p2);
    if(p1==p2){
      team[n-1]++;
      team[m-1]++;
    }else if(p1>p2){
      team[n-1]+=3;
    }else{
      team[m-1]+=3;
    }
  }

  // for(i=0;i<num;i++)printf("%d\n",team[i]);
  
  k=1;
  
  for(j=3*(num-1);j>=0;j--){
    for(i=0;i<num;i++){
      if(team[i]==j){
	teamrank[i]=k;
	count++;
      }
    }
    k+=count;
    count=0;
  }

    for(i=0;i<num;i++)printf("%d\n",teamrank[i]);

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

```c
#include<stdio.h>

int main(){
  int num, game, n, m, p1, p2, i, j;
  int team[100];
  int k,count=0,teamrank[100];

  for(i=0; i<100; i++){
    team[i]=0;
  }

  scanf("%d", &num);
  game = num*(num-1)/2;
  
  for(i=0; i<game; i++){
    scanf("%d%d%d%d", &n, &m, &p1, &p2);
    if(p1==p2){
      team[n-1]++;
      team[m-1]++;
    }else if(p1>p2){
      team[n-1]+=3;
    }else{
      team[m-1]+=3;
    }
  }

  // for(i=0;i<num;i++)printf("%d\n",team[i]);
  
  k=1;
  
  for(j=3*(num-1);j>=0;j--){
    for(i=0;i<num;i++){
      if(team[i]==j){
	teamrank[i]=k;
	count++;
      }
    }
    k+=count;
    count=0;
  }

    for(i=0;i<num;i++)printf("%d\n",teamrank[i]);

  
  
  
  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:

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

```c
#include<stdio.h>

int main(){
  int num, game, n, m, p1, p2, i, j;
  int team[100];
  int k,count=0,teamrank[100];

  for(i=0; i<100; i++){
    team[i]=0;
  }

  scanf("%d", &num);
  game = num*(num-1)/2;
  
  for(i=0; i<game; i++){
    scanf("%d%d%d%d", &n, &m, &p1, &p2);
    if(p1==p2){
      team[n-1]++;
      team[m-1]++;
    }else if(p1>p2){
      team[n-1]+=3;
    }else{
      team[m-1]+=3;
    }
  }

  // for(i=0;i<num;i++)printf("%d\n",team[i]);
  
  k=1;
  
  for(j=3*(num-1);j>=0;j--){
    for(i=0;i<num;i++){
      if(team[i]==j){
	teamrank[i]=k;
	count++;
      }
    }
    k+=count;
    count=0;
  }

    for(i=0;i<num;i++)printf("%d\n",teamrank[i]);

  
  
  
  return 0;
}```

Assembly Code:

```assembly
	.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
	movl	$50, %ecx
	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	$872, %rsp
	.cfi_def_cfa_offset 928
	movq	%fs:40, %rax
	movq	%rax, 856(%rsp)
	xorl	%eax, %eax
	leaq	48(%rsp), %rbx
	leaq	28(%rsp), %rsi
	movq	%rbx, %rdi
	rep stosq
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	leal	-1(%rax), %edx
	imull	%eax, %edx
	movl	%edx, %ebp
	shrl	$31, %ebp
	addl	%edx, %ebp
	sarl	%ebp
	movl	%ebp, 12(%rsp)
	cmpl	$1, %edx
	jle	.L9
	xorl	%ebp, %ebp
	leaq	44(%rsp), %r8
	leaq	40(%rsp), %r15
	leaq	36(%rsp), %r14
	leaq	32(%rsp), %r13
	leaq	.LC1(%rip), %r12
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L6:
	jle	.L8
	movl	32(%rsp), %eax
	subl	$1, %eax
	cltq
	addl	$3, 48(%rsp,%rax,4)
.L7:
	addl	$1, %ebp
	cmpl	%ebp, 12(%rsp)
	jle	.L28
.L2:
	xorl	%eax, %eax
	movq	%r15, %rcx
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%r12, %rdi
	movq	%r8, (%rsp)
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	cmpl	%eax, 40(%rsp)
	movq	(%rsp), %r8
	jne	.L6
	movl	32(%rsp), %eax
	addl	$1, %ebp
	subl	$1, %eax
	cltq
	addl	$1, 48(%rsp,%rax,4)
	movl	36(%rsp), %eax
	subl	$1, %eax
	cltq
	addl	$1, 48(%rsp,%rax,4)
	cmpl	%ebp, 12(%rsp)
	jg	.L2
.L28:
	movl	28(%rsp), %eax
.L9:
	leal	-3(%rax,%rax,2), %edx
	testl	%edx, %edx
	js	.L3
	movl	$1, %edi
	leaq	448(%rsp), %rbp
	movslq	%eax, %rcx
	testl	%eax, %eax
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%eax, %eax
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L11:
	cmpl	%edx, (%rbx,%rax,4)
	jne	.L10
	movl	%edi, 0(%rbp,%rax,4)
	addl	$1, %esi
.L10:
	addq	$1, %rax
	cmpq	%rcx, %rax
	jne	.L11
	addl	%esi, %edi
	subl	$1, %edx
	jnb	.L4
.L12:
	xorl	%ebx, %ebx
	leaq	.LC2(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L13:
	movl	0(%rbp,%rbx,4), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 28(%rsp)
	jg	.L13
.L5:
	movq	856(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	addq	$872, %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
.L8:
	.cfi_restore_state
	movl	36(%rsp), %eax
	subl	$1, %eax
	cltq
	addl	$3, 48(%rsp,%rax,4)
	jmp	.L7
.L3:
	leaq	448(%rsp), %rbp
	testl	%eax, %eax
	jg	.L12
	jmp	.L5
.L29:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%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
	movl	$50, %ecx
	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	$872, %rsp
	.cfi_def_cfa_offset 928
	movq	%fs:40, %rax
	movq	%rax, 856(%rsp)
	xorl	%eax, %eax
	leaq	48(%rsp), %rbx
	leaq	28(%rsp), %rsi
	movq	%rbx, %rdi
	rep stosq
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	leal	-1(%rax), %edx
	imull	%eax, %edx
	movl	%edx, %ebp
	shrl	$31, %ebp
	addl	%edx, %ebp
	sarl	%ebp
	movl	%ebp, 12(%rsp)
	cmpl	$1, %edx
	jle	.L9
	xorl	%ebp, %ebp
	leaq	44(%rsp), %r8
	leaq	40(%rsp), %r15
	leaq	36(%rsp), %r14
	leaq	32(%rsp), %r13
	leaq	.LC1(%rip), %r12
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L6:
	jle	.L8
	movl	32(%rsp), %eax
	subl	$1, %eax
	cltq
	addl	$3, 48(%rsp,%rax,4)
.L7:
	addl	$1, %ebp
	cmpl	%ebp, 12(%rsp)
	jle	.L28
.L2:
	xorl	%eax, %eax
	movq	%r15, %rcx
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%r12, %rdi
	movq	%r8, (%rsp)
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	cmpl	%eax, 40(%rsp)
	movq	(%rsp), %r8
	jne	.L6
	movl	32(%rsp), %eax
	addl	$1, %ebp
	subl	$1, %eax
	cltq
	addl	$1, 48(%rsp,%rax,4)
	movl	36(%rsp), %eax
	subl	$1, %eax
	cltq
	addl	$1, 48(%rsp,%rax,4)
	cmpl	%ebp, 12(%rsp)
	jg	.L2
.L28:
	movl	28(%rsp), %eax
.L9:
	leal	-3(%rax,%rax,2), %edx
	testl	%edx, %edx
	js	.L3
	movl	$1, %edi
	leaq	448(%rsp), %rbp
	movslq	%eax, %rcx
	testl	%eax, %eax
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%eax, %eax
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L11:
	cmpl	%edx, (%rbx,%rax,4)
	jne	.L10
	movl	%edi, 0(%rbp,%rax,4)
	addl	$1, %esi
.L10:
	addq	$1, %rax
	cmpq	%rcx, %rax
	jne	.L11
	addl	%esi, %edi
	subl	$1, %edx
	jnb	.L4
.L12:
	xorl	%ebx, %ebx
	leaq	.LC2(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L13:
	movl	0(%rbp,%rbx,4), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 28(%rsp)
	jg	.L13
.L5:
	movq	856(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	addq	$872, %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
.L8:
	.cfi_restore_state
	movl	36(%rsp), %eax
	subl	$1, %eax
	cltq
	addl	$3, 48(%rsp,%rax,4)
	jmp	.L7
.L3:
	leaq	448(%rsp), %rbp
	testl	%eax, %eax
	jg	.L12
	jmp	.L5
.L29:
	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:
```