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 n;
  scanf("%d", &n);
  int a[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  int count[9];
  for (int i = 0; i < 9; i++) {
    count[i] = 0;
  }
  int color;
  for (int i = 0; i < n; i++) {
    color = a[i]/400;
    if (color > 8) {
      color = 8;
    }
    count[color]++;
  }
  int min = 0;
  for (int i = 0; i < 8; i++) {
    if (count[i] != 0) {
      min++;
    }
  }
  int max = min;
  if (count[8] != 0) {
    max = min+count[8];
  }
  if (min == 0) {
    min = 1;
  }
  printf("%d %d\n", min, max);

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$104, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-144(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-144(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -112(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -104(%rbp)
	movl	$0, -140(%rbp)
	jmp	.L5
.L6:
	movl	-140(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-104(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -140(%rbp)
.L5:
	movl	-144(%rbp), %eax
	cmpl	%eax, -140(%rbp)
	jl	.L6
	movl	$0, -136(%rbp)
	jmp	.L7
.L8:
	movl	-136(%rbp), %eax
	cltq
	movl	$0, -96(%rbp,%rax,4)
	addl	$1, -136(%rbp)
.L7:
	cmpl	$8, -136(%rbp)
	jle	.L8
	movl	$0, -128(%rbp)
	jmp	.L9
.L11:
	movq	-104(%rbp), %rax
	movl	-128(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$7, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -132(%rbp)
	cmpl	$8, -132(%rbp)
	jle	.L10
	movl	$8, -132(%rbp)
.L10:
	movl	-132(%rbp), %eax
	cltq
	movl	-96(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-132(%rbp), %eax
	cltq
	movl	%edx, -96(%rbp,%rax,4)
	addl	$1, -128(%rbp)
.L9:
	movl	-144(%rbp), %eax
	cmpl	%eax, -128(%rbp)
	jl	.L11
	movl	$0, -124(%rbp)
	movl	$0, -120(%rbp)
	jmp	.L12
.L14:
	movl	-120(%rbp), %eax
	cltq
	movl	-96(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L13
	addl	$1, -124(%rbp)
.L13:
	addl	$1, -120(%rbp)
.L12:
	cmpl	$7, -120(%rbp)
	jle	.L14
	movl	-124(%rbp), %eax
	movl	%eax, -116(%rbp)
	movl	-64(%rbp), %eax
	testl	%eax, %eax
	je	.L15
	movl	-64(%rbp), %edx
	movl	-124(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -116(%rbp)
.L15:
	cmpl	$0, -124(%rbp)
	jne	.L16
	movl	$1, -124(%rbp)
.L16:
	movl	-116(%rbp), %edx
	movl	-124(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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"
.LC2:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r14
	.cfi_offset 14, -24
	leaq	.LC0(%rip), %r14
	pushq	%r13
	leaq	-84(%rbp), %rsi
	movq	%r14, %rdi
	pushq	%r12
	pushq	%rbx
	subq	$64, %rsp
	.cfi_offset 13, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-84(%rbp), %rax
	movq	%rsp, %rsi
	movq	%rax, %rcx
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L3
.L20:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L20
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L21
.L4:
	movq	%rsp, %rbx
	testl	%ecx, %ecx
	jle	.L5
	movq	%rbx, %r13
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	-84(%rbp), %eax
	addq	$4, %r13
	cmpl	%r12d, %eax
	jg	.L6
	pxor	%xmm0, %xmm0
	movl	$0, -48(%rbp)
	movaps	%xmm0, -80(%rbp)
	movaps	%xmm0, -64(%rbp)
	testl	%eax, %eax
	jle	.L7
	subl	$1, %eax
	movq	%rbx, %rdx
	leaq	4(%rbx,%rax,4), %rsi
	.p2align 4,,10
	.p2align 3
.L10:
	movl	(%rdx), %ecx
	cmpl	$3599, %ecx
	jg	.L8
	movslq	%ecx, %rax
	sarl	$31, %ecx
	addq	$4, %rdx
	imulq	$1374389535, %rax, %rax
	sarq	$39, %rax
	subl	%ecx, %eax
	cltq
	addl	$1, -80(%rbp,%rax,4)
	cmpq	%rsi, %rdx
	jne	.L10
.L7:
	pxor	%xmm0, %xmm0
	movl	-48(%rbp), %ecx
	movl	$1, %eax
	leaq	.LC2(%rip), %rsi
	movdqa	%xmm0, %xmm1
	movl	$1, %edi
	pcmpeqd	-80(%rbp), %xmm1
	pcmpeqd	%xmm0, %xmm1
	pcmpeqd	-64(%rbp), %xmm0
	pandn	.LC1(%rip), %xmm0
	psubd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	addl	%edx, %ecx
	testl	%edx, %edx
	cmove	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	-40(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L22
	leaq	-32(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_restore_state
	addq	$4, %rdx
	addl	$1, -48(%rbp)
	cmpq	%rdx, %rsi
	jne	.L10
	jmp	.L7
.L21:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L5:
	leaq	-80(%rbp), %rdx
	movl	$9, %ecx
	xorl	%eax, %eax
	movq	%rdx, %rdi
	rep stosl
	jmp	.L7
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	1
	.long	1
	.long	1
	.long	1
	.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"
.LC2:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r14
	.cfi_offset 14, -24
	leaq	.LC0(%rip), %r14
	pushq	%r13
	leaq	-84(%rbp), %rsi
	movq	%r14, %rdi
	pushq	%r12
	pushq	%rbx
	subq	$64, %rsp
	.cfi_offset 13, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-84(%rbp), %rax
	movq	%rsp, %rsi
	movq	%rax, %rcx
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L3
.L20:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L20
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L21
.L4:
	movq	%rsp, %rbx
	testl	%ecx, %ecx
	jle	.L5
	movq	%rbx, %r13
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	-84(%rbp), %eax
	addq	$4, %r13
	cmpl	%r12d, %eax
	jg	.L6
	pxor	%xmm0, %xmm0
	movl	$0, -48(%rbp)
	movaps	%xmm0, -80(%rbp)
	movaps	%xmm0, -64(%rbp)
	testl	%eax, %eax
	jle	.L7
	subl	$1, %eax
	movq	%rbx, %rdx
	leaq	4(%rbx,%rax,4), %rsi
	.p2align 4,,10
	.p2align 3
.L10:
	movl	(%rdx), %ecx
	cmpl	$3599, %ecx
	jg	.L8
	movslq	%ecx, %rax
	sarl	$31, %ecx
	addq	$4, %rdx
	imulq	$1374389535, %rax, %rax
	sarq	$39, %rax
	subl	%ecx, %eax
	cltq
	addl	$1, -80(%rbp,%rax,4)
	cmpq	%rsi, %rdx
	jne	.L10
.L7:
	pxor	%xmm0, %xmm0
	movl	-48(%rbp), %ecx
	movl	$1, %eax
	leaq	.LC2(%rip), %rsi
	movdqa	%xmm0, %xmm1
	movl	$1, %edi
	pcmpeqd	-80(%rbp), %xmm1
	pcmpeqd	%xmm0, %xmm1
	pcmpeqd	-64(%rbp), %xmm0
	pandn	.LC1(%rip), %xmm0
	psubd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	addl	%edx, %ecx
	testl	%edx, %edx
	cmove	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	-40(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L22
	leaq	-32(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_restore_state
	addq	$4, %rdx
	addl	$1, -48(%rbp)
	cmpq	%rdx, %rsi
	jne	.L10
	jmp	.L7
.L21:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L5:
	leaq	-80(%rbp), %rdx
	movl	$9, %ecx
	xorl	%eax, %eax
	movq	%rdx, %rdi
	rep stosl
	jmp	.L7
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	1
	.long	1
	.long	1
	.long	1
	.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 n;
  scanf("%d", &n);
  int a[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  int count[9];
  for (int i = 0; i < 9; i++) {
    count[i] = 0;
  }
  int color;
  for (int i = 0; i < n; i++) {
    color = a[i]/400;
    if (color > 8) {
      color = 8;
    }
    count[color]++;
  }
  int min = 0;
  for (int i = 0; i < 8; i++) {
    if (count[i] != 0) {
      min++;
    }
  }
  int max = min;
  if (count[8] != 0) {
    max = min+count[8];
  }
  if (min == 0) {
    min = 1;
  }
  printf("%d %d\n", min, max);

  return 0;
}
4
2100 2500 4217 2700
 20
800 810 820 830 840 850 860 870 880 890 900 1771 920 930 940 950 960 970 980 990
 5
1100 3348 2800 3200 3200
 20
800 810 820 830 840 850 860 870 880 890 900 1771 920 930 120 950 960 970 980 990
 5
1101 3348 2955 3200 2889
 5
1101 3348 2302 3200 2889
 4
2100 4691 248 409
 20
800 1586 820 830 840 850 860 433 1213 259 900 1303 920 1028 92 950 960 970 980 990
 20
800 1586 820 830 840 850 860 433 1213 259 900 1303 920 1028 92 2243 960 970 980 990
 20
800 2108 443 830 840 1093 116 614 398 92 399 1139 1229 646 92 2243 960 970 1914 990

2 3
 2 2
 2 5
 3 3
 2 4
 3 5
 3 4
 4 4
 5 5
 6 6

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 n;
  scanf("%d", &n);
  int a[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  int count[9];
  for (int i = 0; i < 9; i++) {
    count[i] = 0;
  }
  int color;
  for (int i = 0; i < n; i++) {
    color = a[i]/400;
    if (color > 8) {
      color = 8;
    }
    count[color]++;
  }
  int min = 0;
  for (int i = 0; i < 8; i++) {
    if (count[i] != 0) {
      min++;
    }
  }
  int max = min;
  if (count[8] != 0) {
    max = min+count[8];
  }
  if (min == 0) {
    min = 1;
  }
  printf("%d %d\n", min, max);

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$104, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-144(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-144(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -112(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -104(%rbp)
	movl	$0, -140(%rbp)
	jmp	.L5
.L6:
	movl	-140(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-104(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -140(%rbp)
.L5:
	movl	-144(%rbp), %eax
	cmpl	%eax, -140(%rbp)
	jl	.L6
	movl	$0, -136(%rbp)
	jmp	.L7
.L8:
	movl	-136(%rbp), %eax
	cltq
	movl	$0, -96(%rbp,%rax,4)
	addl	$1, -136(%rbp)
.L7:
	cmpl	$8, -136(%rbp)
	jle	.L8
	movl	$0, -128(%rbp)
	jmp	.L9
.L11:
	movq	-104(%rbp), %rax
	movl	-128(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$7, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -132(%rbp)
	cmpl	$8, -132(%rbp)
	jle	.L10
	movl	$8, -132(%rbp)
.L10:
	movl	-132(%rbp), %eax
	cltq
	movl	-96(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-132(%rbp), %eax
	cltq
	movl	%edx, -96(%rbp,%rax,4)
	addl	$1, -128(%rbp)
.L9:
	movl	-144(%rbp), %eax
	cmpl	%eax, -128(%rbp)
	jl	.L11
	movl	$0, -124(%rbp)
	movl	$0, -120(%rbp)
	jmp	.L12
.L14:
	movl	-120(%rbp), %eax
	cltq
	movl	-96(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L13
	addl	$1, -124(%rbp)
.L13:
	addl	$1, -120(%rbp)
.L12:
	cmpl	$7, -120(%rbp)
	jle	.L14
	movl	-124(%rbp), %eax
	movl	%eax, -116(%rbp)
	movl	-64(%rbp), %eax
	testl	%eax, %eax
	je	.L15
	movl	-64(%rbp), %edx
	movl	-124(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -116(%rbp)
.L15:
	cmpl	$0, -124(%rbp)
	jne	.L16
	movl	$1, -124(%rbp)
.L16:
	movl	-116(%rbp), %edx
	movl	-124(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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\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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$104, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-144(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-144(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -112(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -104(%rbp)
	movl	$0, -140(%rbp)
	jmp	.L5
.L6:
	movl	-140(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-104(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -140(%rbp)
.L5:
	movl	-144(%rbp), %eax
	cmpl	%eax, -140(%rbp)
	jl	.L6
	movl	$0, -136(%rbp)
	jmp	.L7
.L8:
	movl	-136(%rbp), %eax
	cltq
	movl	$0, -96(%rbp,%rax,4)
	addl	$1, -136(%rbp)
.L7:
	cmpl	$8, -136(%rbp)
	jle	.L8
	movl	$0, -128(%rbp)
	jmp	.L9
.L11:
	movq	-104(%rbp), %rax
	movl	-128(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$7, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -132(%rbp)
	cmpl	$8, -132(%rbp)
	jle	.L10
	movl	$8, -132(%rbp)
.L10:
	movl	-132(%rbp), %eax
	cltq
	movl	-96(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-132(%rbp), %eax
	cltq
	movl	%edx, -96(%rbp,%rax,4)
	addl	$1, -128(%rbp)
.L9:
	movl	-144(%rbp), %eax
	cmpl	%eax, -128(%rbp)
	jl	.L11
	movl	$0, -124(%rbp)
	movl	$0, -120(%rbp)
	jmp	.L12
.L14:
	movl	-120(%rbp), %eax
	cltq
	movl	-96(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L13
	addl	$1, -124(%rbp)
.L13:
	addl	$1, -120(%rbp)
.L12:
	cmpl	$7, -120(%rbp)
	jle	.L14
	movl	-124(%rbp), %eax
	movl	%eax, -116(%rbp)
	movl	-64(%rbp), %eax
	testl	%eax, %eax
	je	.L15
	movl	-64(%rbp), %edx
	movl	-124(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -116(%rbp)
.L15:
	cmpl	$0, -124(%rbp)
	jne	.L16
	movl	$1, -124(%rbp)
.L16:
	movl	-116(%rbp), %edx
	movl	-124(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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:
