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 f[10001] = { 0 };
  int ret = 6;
  int x = 1, y = 1, z = 1;
  for(x = 1;x <= 100;x++) {
    for(y = x;y <= 100;y++) {
      for(z = y;z <= n;z++) {
        ret = x*x + y*y + z*z + x*y + y*z + z*x;
        if(ret > n) continue;
        if(x == y && y == z) { f[ret] += 1; }
        else if(x == y || y == z || z == x) { f[ret] += 3; }
        else f[ret] += 6;
      }
    }
  }
  for(int i = 1;i <= n;i++) {
    printf("%d\n", f[i]);
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.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
	leaq	-36864(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3184, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-40040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-40016(%rbp), %rax
	movl	$40004, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$6, -40020(%rbp)
	movl	$1, -40036(%rbp)
	movl	$1, -40032(%rbp)
	movl	$1, -40028(%rbp)
	movl	$1, -40036(%rbp)
	jmp	.L2
.L12:
	movl	-40036(%rbp), %eax
	movl	%eax, -40032(%rbp)
	jmp	.L3
.L11:
	movl	-40032(%rbp), %eax
	movl	%eax, -40028(%rbp)
	jmp	.L4
.L10:
	movl	-40036(%rbp), %eax
	imull	%eax, %eax
	movl	%eax, %edx
	movl	-40032(%rbp), %eax
	imull	%eax, %eax
	addl	%eax, %edx
	movl	-40028(%rbp), %eax
	imull	%eax, %eax
	addl	%eax, %edx
	movl	-40036(%rbp), %eax
	imull	-40032(%rbp), %eax
	addl	%eax, %edx
	movl	-40032(%rbp), %eax
	imull	-40028(%rbp), %eax
	addl	%eax, %edx
	movl	-40028(%rbp), %eax
	imull	-40036(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -40020(%rbp)
	movl	-40040(%rbp), %eax
	cmpl	%eax, -40020(%rbp)
	jg	.L17
	movl	-40036(%rbp), %eax
	cmpl	-40032(%rbp), %eax
	jne	.L7
	movl	-40032(%rbp), %eax
	cmpl	-40028(%rbp), %eax
	jne	.L7
	movl	-40020(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-40020(%rbp), %eax
	cltq
	movl	%edx, -40016(%rbp,%rax,4)
	jmp	.L6
.L7:
	movl	-40036(%rbp), %eax
	cmpl	-40032(%rbp), %eax
	je	.L8
	movl	-40032(%rbp), %eax
	cmpl	-40028(%rbp), %eax
	je	.L8
	movl	-40028(%rbp), %eax
	cmpl	-40036(%rbp), %eax
	jne	.L9
.L8:
	movl	-40020(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	leal	3(%rax), %edx
	movl	-40020(%rbp), %eax
	cltq
	movl	%edx, -40016(%rbp,%rax,4)
	jmp	.L6
.L9:
	movl	-40020(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	leal	6(%rax), %edx
	movl	-40020(%rbp), %eax
	cltq
	movl	%edx, -40016(%rbp,%rax,4)
	jmp	.L6
.L17:
	nop
.L6:
	addl	$1, -40028(%rbp)
.L4:
	movl	-40040(%rbp), %eax
	cmpl	%eax, -40028(%rbp)
	jle	.L10
	addl	$1, -40032(%rbp)
.L3:
	cmpl	$100, -40032(%rbp)
	jle	.L11
	addl	$1, -40036(%rbp)
.L2:
	cmpl	$100, -40036(%rbp)
	jle	.L12
	movl	$1, -40024(%rbp)
	jmp	.L13
.L14:
	movl	-40024(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -40024(%rbp)
.L13:
	movl	-40040(%rbp), %eax
	cmpl	%eax, -40024(%rbp)
	jle	.L14
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	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\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
	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	-36864(%rsp), %r11
	.cfi_def_cfa 11, 36920
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3192, %rsp
	.cfi_def_cfa_offset 40112
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 40040(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	leaq	32(%rsp), %rax
	movl	$40004, %edx
	xorl	%esi, %esi
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
	call	memset@PLT
	movl	28(%rsp), %ebp
	movl	$1, %r9d
	leal	1(%rbp), %r14d
	.p2align 4,,10
	.p2align 3
.L2:
	movl	%r9d, %r8d
	movl	%r9d, %esi
	imull	%r9d, %r8d
	movl	%r8d, %r11d
	.p2align 4,,10
	.p2align 3
.L12:
	cmpl	%esi, %ebp
	jl	.L10
	movl	%esi, %ecx
	movl	%r8d, %edi
	movl	%esi, %edx
	imull	%esi, %ecx
	leal	(%r11,%rcx), %r10d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L31:
	addl	$1, %ebx
	movl	%ebx, 32(%rsp,%rax,4)
.L3:
	addl	$1, %edx
	addl	%esi, %ecx
	addl	%r9d, %edi
	cmpl	%r14d, %edx
	je	.L10
.L7:
	movl	%edx, %eax
	imull	%edx, %eax
	addl	%r10d, %eax
	addl	%r8d, %eax
	addl	%ecx, %eax
	addl	%edi, %eax
	cmpl	%ebp, %eax
	jg	.L3
	cmpl	%esi, %r9d
	cltq
	sete	%r12b
	cmpl	%esi, %edx
	movl	32(%rsp,%rax,4), %ebx
	sete	%r13b
	testb	%r12b, %r12b
	je	.L4
	testb	%r13b, %r13b
	jne	.L31
.L4:
	cmpl	%r9d, %edx
	sete	%r15b
	orb	%r13b, %r15b
	jne	.L16
	testb	%r12b, %r12b
	jne	.L16
	addl	$6, %ebx
	addl	$1, %edx
	addl	%esi, %ecx
	addl	%r9d, %edi
	movl	%ebx, 32(%rsp,%rax,4)
	cmpl	%r14d, %edx
	jne	.L7
	.p2align 4,,10
	.p2align 3
.L10:
	addl	$1, %esi
	addl	%r9d, %r8d
	cmpl	$101, %esi
	jne	.L12
	addl	$1, %r9d
	cmpl	$101, %r9d
	jne	.L2
	movl	$1, %ebx
	leaq	.LC1(%rip), %r12
	testl	%ebp, %ebp
	jle	.L13
	movq	8(%rsp), %rbp
.L11:
	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)
	jge	.L11
.L13:
	movq	40040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L32
	addq	$40056, %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
.L16:
	.cfi_restore_state
	addl	$3, %ebx
	movl	%ebx, 32(%rsp,%rax,4)
	jmp	.L3
.L32:
	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\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
	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	-36864(%rsp), %r11
	.cfi_def_cfa 11, 36920
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3192, %rsp
	.cfi_def_cfa_offset 40112
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 40040(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	leaq	32(%rsp), %rax
	movl	$40004, %edx
	xorl	%esi, %esi
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
	call	memset@PLT
	movl	28(%rsp), %ebp
	movl	$1, %r9d
	leal	1(%rbp), %r14d
	.p2align 4,,10
	.p2align 3
.L2:
	movl	%r9d, %r8d
	movl	%r9d, %esi
	imull	%r9d, %r8d
	movl	%r8d, %r11d
	.p2align 4,,10
	.p2align 3
.L12:
	cmpl	%esi, %ebp
	jl	.L10
	movl	%esi, %ecx
	movl	%r8d, %edi
	movl	%esi, %edx
	imull	%esi, %ecx
	leal	(%r11,%rcx), %r10d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L31:
	addl	$1, %ebx
	movl	%ebx, 32(%rsp,%rax,4)
.L3:
	addl	$1, %edx
	addl	%esi, %ecx
	addl	%r9d, %edi
	cmpl	%r14d, %edx
	je	.L10
.L7:
	movl	%edx, %eax
	imull	%edx, %eax
	addl	%r10d, %eax
	addl	%r8d, %eax
	addl	%ecx, %eax
	addl	%edi, %eax
	cmpl	%ebp, %eax
	jg	.L3
	cmpl	%esi, %r9d
	cltq
	sete	%r12b
	cmpl	%esi, %edx
	movl	32(%rsp,%rax,4), %ebx
	sete	%r13b
	testb	%r12b, %r12b
	je	.L4
	testb	%r13b, %r13b
	jne	.L31
.L4:
	cmpl	%r9d, %edx
	sete	%r15b
	orb	%r13b, %r15b
	jne	.L16
	testb	%r12b, %r12b
	jne	.L16
	addl	$6, %ebx
	addl	$1, %edx
	addl	%esi, %ecx
	addl	%r9d, %edi
	movl	%ebx, 32(%rsp,%rax,4)
	cmpl	%r14d, %edx
	jne	.L7
	.p2align 4,,10
	.p2align 3
.L10:
	addl	$1, %esi
	addl	%r9d, %r8d
	cmpl	$101, %esi
	jne	.L12
	addl	$1, %r9d
	cmpl	$101, %r9d
	jne	.L2
	movl	$1, %ebx
	leaq	.LC1(%rip), %r12
	testl	%ebp, %ebp
	jle	.L13
	movq	8(%rsp), %rbp
.L11:
	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)
	jge	.L11
.L13:
	movq	40040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L32
	addq	$40056, %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
.L16:
	.cfi_restore_state
	addl	$3, %ebx
	movl	%ebx, 32(%rsp,%rax,4)
	jmp	.L3
.L32:
	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 n;
  scanf("%d", &n);
  int f[10001] = { 0 };
  int ret = 6;
  int x = 1, y = 1, z = 1;
  for(x = 1;x <= 100;x++) {
    for(y = x;y <= 100;y++) {
      for(z = y;z <= n;z++) {
        ret = x*x + y*y + z*z + x*y + y*z + z*x;
        if(ret > n) continue;
        if(x == y && y == z) { f[ret] += 1; }
        else if(x == y || y == z || z == x) { f[ret] += 3; }
        else f[ret] += 6;
      }
    }
  }
  for(int i = 1;i <= n;i++) {
    printf("%d\n", f[i]);
  }
  return 0;
}
27
 13
 3
 2
 4
 8
 14
 1
 31
 53

0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
 0
0
0
0
0
1
0
0
0
0
3
0
0
 0
0
0
 0
0
 0
0
0
0
 0
0
0
0
0
1
0
0
 0
0
0
0
0
1
0
0
0
0
3
0
0
0
 0
 0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
 0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0

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 f[10001] = { 0 };
  int ret = 6;
  int x = 1, y = 1, z = 1;
  for(x = 1;x <= 100;x++) {
    for(y = x;y <= 100;y++) {
      for(z = y;z <= n;z++) {
        ret = x*x + y*y + z*z + x*y + y*z + z*x;
        if(ret > n) continue;
        if(x == y && y == z) { f[ret] += 1; }
        else if(x == y || y == z || z == x) { f[ret] += 3; }
        else f[ret] += 6;
      }
    }
  }
  for(int i = 1;i <= n;i++) {
    printf("%d\n", f[i]);
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.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
	leaq	-36864(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3184, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-40040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-40016(%rbp), %rax
	movl	$40004, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$6, -40020(%rbp)
	movl	$1, -40036(%rbp)
	movl	$1, -40032(%rbp)
	movl	$1, -40028(%rbp)
	movl	$1, -40036(%rbp)
	jmp	.L2
.L12:
	movl	-40036(%rbp), %eax
	movl	%eax, -40032(%rbp)
	jmp	.L3
.L11:
	movl	-40032(%rbp), %eax
	movl	%eax, -40028(%rbp)
	jmp	.L4
.L10:
	movl	-40036(%rbp), %eax
	imull	%eax, %eax
	movl	%eax, %edx
	movl	-40032(%rbp), %eax
	imull	%eax, %eax
	addl	%eax, %edx
	movl	-40028(%rbp), %eax
	imull	%eax, %eax
	addl	%eax, %edx
	movl	-40036(%rbp), %eax
	imull	-40032(%rbp), %eax
	addl	%eax, %edx
	movl	-40032(%rbp), %eax
	imull	-40028(%rbp), %eax
	addl	%eax, %edx
	movl	-40028(%rbp), %eax
	imull	-40036(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -40020(%rbp)
	movl	-40040(%rbp), %eax
	cmpl	%eax, -40020(%rbp)
	jg	.L17
	movl	-40036(%rbp), %eax
	cmpl	-40032(%rbp), %eax
	jne	.L7
	movl	-40032(%rbp), %eax
	cmpl	-40028(%rbp), %eax
	jne	.L7
	movl	-40020(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-40020(%rbp), %eax
	cltq
	movl	%edx, -40016(%rbp,%rax,4)
	jmp	.L6
.L7:
	movl	-40036(%rbp), %eax
	cmpl	-40032(%rbp), %eax
	je	.L8
	movl	-40032(%rbp), %eax
	cmpl	-40028(%rbp), %eax
	je	.L8
	movl	-40028(%rbp), %eax
	cmpl	-40036(%rbp), %eax
	jne	.L9
.L8:
	movl	-40020(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	leal	3(%rax), %edx
	movl	-40020(%rbp), %eax
	cltq
	movl	%edx, -40016(%rbp,%rax,4)
	jmp	.L6
.L9:
	movl	-40020(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	leal	6(%rax), %edx
	movl	-40020(%rbp), %eax
	cltq
	movl	%edx, -40016(%rbp,%rax,4)
	jmp	.L6
.L17:
	nop
.L6:
	addl	$1, -40028(%rbp)
.L4:
	movl	-40040(%rbp), %eax
	cmpl	%eax, -40028(%rbp)
	jle	.L10
	addl	$1, -40032(%rbp)
.L3:
	cmpl	$100, -40032(%rbp)
	jle	.L11
	addl	$1, -40036(%rbp)
.L2:
	cmpl	$100, -40036(%rbp)
	jle	.L12
	movl	$1, -40024(%rbp)
	jmp	.L13
.L14:
	movl	-40024(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -40024(%rbp)
.L13:
	movl	-40040(%rbp), %eax
	cmpl	%eax, -40024(%rbp)
	jle	.L14
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	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\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
	leaq	-36864(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3184, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-40040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-40016(%rbp), %rax
	movl	$40004, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$6, -40020(%rbp)
	movl	$1, -40036(%rbp)
	movl	$1, -40032(%rbp)
	movl	$1, -40028(%rbp)
	movl	$1, -40036(%rbp)
	jmp	.L2
.L12:
	movl	-40036(%rbp), %eax
	movl	%eax, -40032(%rbp)
	jmp	.L3
.L11:
	movl	-40032(%rbp), %eax
	movl	%eax, -40028(%rbp)
	jmp	.L4
.L10:
	movl	-40036(%rbp), %eax
	imull	%eax, %eax
	movl	%eax, %edx
	movl	-40032(%rbp), %eax
	imull	%eax, %eax
	addl	%eax, %edx
	movl	-40028(%rbp), %eax
	imull	%eax, %eax
	addl	%eax, %edx
	movl	-40036(%rbp), %eax
	imull	-40032(%rbp), %eax
	addl	%eax, %edx
	movl	-40032(%rbp), %eax
	imull	-40028(%rbp), %eax
	addl	%eax, %edx
	movl	-40028(%rbp), %eax
	imull	-40036(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -40020(%rbp)
	movl	-40040(%rbp), %eax
	cmpl	%eax, -40020(%rbp)
	jg	.L17
	movl	-40036(%rbp), %eax
	cmpl	-40032(%rbp), %eax
	jne	.L7
	movl	-40032(%rbp), %eax
	cmpl	-40028(%rbp), %eax
	jne	.L7
	movl	-40020(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-40020(%rbp), %eax
	cltq
	movl	%edx, -40016(%rbp,%rax,4)
	jmp	.L6
.L7:
	movl	-40036(%rbp), %eax
	cmpl	-40032(%rbp), %eax
	je	.L8
	movl	-40032(%rbp), %eax
	cmpl	-40028(%rbp), %eax
	je	.L8
	movl	-40028(%rbp), %eax
	cmpl	-40036(%rbp), %eax
	jne	.L9
.L8:
	movl	-40020(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	leal	3(%rax), %edx
	movl	-40020(%rbp), %eax
	cltq
	movl	%edx, -40016(%rbp,%rax,4)
	jmp	.L6
.L9:
	movl	-40020(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	leal	6(%rax), %edx
	movl	-40020(%rbp), %eax
	cltq
	movl	%edx, -40016(%rbp,%rax,4)
	jmp	.L6
.L17:
	nop
.L6:
	addl	$1, -40028(%rbp)
.L4:
	movl	-40040(%rbp), %eax
	cmpl	%eax, -40028(%rbp)
	jle	.L10
	addl	$1, -40032(%rbp)
.L3:
	cmpl	$100, -40032(%rbp)
	jle	.L11
	addl	$1, -40036(%rbp)
.L2:
	cmpl	$100, -40036(%rbp)
	jle	.L12
	movl	$1, -40024(%rbp)
	jmp	.L13
.L14:
	movl	-40024(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -40024(%rbp)
.L13:
	movl	-40040(%rbp), %eax
	cmpl	%eax, -40024(%rbp)
	jle	.L14
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	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:
