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>
#include<math.h>
 
int n[100010];
int main()
{
  int N;
  scanf("%d",&N);
  int temp;
 
  for(int x=1;x<105;x++){
    for(int y=1;y<105;y++){
      for(int z=1;z<105;z++){
        temp = x*x + y*y + z*z + x*y + y*z + z*x;
        n[temp]++;
      }
    }
  }
  
  for(int i=1;i<=N;i++){printf("%d\n",n[i]);}
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 32
	.type	n, @object
	.size	n, 400040
n:
	.zero	400040
	.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
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -28(%rbp)
	jmp	.L2
.L7:
	movl	$1, -24(%rbp)
	jmp	.L3
.L6:
	movl	$1, -20(%rbp)
	jmp	.L4
.L5:
	movl	-28(%rbp), %eax
	imull	%eax, %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	imull	%eax, %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	imull	%eax, %eax
	addl	%eax, %edx
	movl	-28(%rbp), %eax
	imull	-24(%rbp), %eax
	addl	%eax, %edx
	movl	-24(%rbp), %eax
	imull	-20(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	imull	-28(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -20(%rbp)
.L4:
	cmpl	$104, -20(%rbp)
	jle	.L5
	addl	$1, -24(%rbp)
.L3:
	cmpl	$104, -24(%rbp)
	jle	.L6
	addl	$1, -28(%rbp)
.L2:
	cmpl	$104, -28(%rbp)
	jle	.L7
	movl	$1, -16(%rbp)
	jmp	.L8
.L9:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -16(%rbp)
.L8:
	movl	-32(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L9
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	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	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	n(%rip), %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	$1, %r9d
.L2:
	movl	%r9d, %r11d
	movl	%r9d, %r10d
	movl	$1, %edi
	imull	%r9d, %r11d
.L7:
	movl	%edi, %r8d
	movl	%r9d, %esi
	movl	%edi, %ecx
	movl	$1, %edx
	imull	%edi, %r8d
	addl	%r11d, %r8d
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%edx, %eax
	imull	%edx, %eax
	addl	$1, %edx
	addl	%r8d, %eax
	addl	%r10d, %eax
	addl	%ecx, %eax
	addl	%edi, %ecx
	addl	%esi, %eax
	addl	%r9d, %esi
	cltq
	addl	$1, (%rbx,%rax,4)
	cmpl	$105, %edx
	jne	.L3
	addl	$1, %edi
	addl	%r9d, %r10d
	cmpl	$105, %edi
	jne	.L7
	addl	$1, %r9d
	cmpl	$105, %r9d
	jne	.L2
	movl	4(%rsp), %eax
	movl	$1, %ebp
	leaq	.LC1(%rip), %r12
	testl	%eax, %eax
	jle	.L6
.L5:
	movl	(%rbx,%rbp,4), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__printf_chk@PLT
	cmpl	%ebp, 4(%rsp)
	jge	.L5
.L6:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L16:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	n
	.bss
	.align 32
	.type	n, @object
	.size	n, 400040
n:
	.zero	400040
	.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	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	n(%rip), %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	$1, %r9d
.L2:
	movl	%r9d, %r11d
	movl	%r9d, %r10d
	movl	$1, %edi
	imull	%r9d, %r11d
.L7:
	movl	%edi, %r8d
	movl	%r9d, %esi
	movl	%edi, %ecx
	movl	$1, %edx
	imull	%edi, %r8d
	addl	%r11d, %r8d
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%edx, %eax
	imull	%edx, %eax
	addl	$1, %edx
	addl	%r8d, %eax
	addl	%r10d, %eax
	addl	%ecx, %eax
	addl	%edi, %ecx
	addl	%esi, %eax
	addl	%r9d, %esi
	cltq
	addl	$1, (%rbx,%rax,4)
	cmpl	$105, %edx
	jne	.L3
	addl	$1, %edi
	addl	%r9d, %r10d
	cmpl	$105, %edi
	jne	.L7
	addl	$1, %r9d
	cmpl	$105, %r9d
	jne	.L2
	movl	4(%rsp), %eax
	movl	$1, %ebp
	leaq	.LC1(%rip), %r12
	testl	%eax, %eax
	jle	.L6
.L5:
	movl	(%rbx,%rbp,4), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__printf_chk@PLT
	cmpl	%ebp, 4(%rsp)
	jge	.L5
.L6:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L16:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	n
	.bss
	.align 32
	.type	n, @object
	.size	n, 400040
n:
	.zero	400040
	.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>
#include<math.h>
 
int n[100010];
int main()
{
  int N;
  scanf("%d",&N);
  int temp;
 
  for(int x=1;x<105;x++){
    for(int y=1;y<105;y++){
      for(int z=1;z<105;z++){
        temp = x*x + y*y + z*z + x*y + y*z + z*x;
        n[temp]++;
      }
    }
  }
  
  for(int i=1;i<=N;i++){printf("%d\n",n[i]);}
}
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>
#include<math.h>
 
int n[100010];
int main()
{
  int N;
  scanf("%d",&N);
  int temp;
 
  for(int x=1;x<105;x++){
    for(int y=1;y<105;y++){
      for(int z=1;z<105;z++){
        temp = x*x + y*y + z*z + x*y + y*z + z*x;
        n[temp]++;
      }
    }
  }
  
  for(int i=1;i<=N;i++){printf("%d\n",n[i]);}
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 32
	.type	n, @object
	.size	n, 400040
n:
	.zero	400040
	.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
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -28(%rbp)
	jmp	.L2
.L7:
	movl	$1, -24(%rbp)
	jmp	.L3
.L6:
	movl	$1, -20(%rbp)
	jmp	.L4
.L5:
	movl	-28(%rbp), %eax
	imull	%eax, %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	imull	%eax, %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	imull	%eax, %eax
	addl	%eax, %edx
	movl	-28(%rbp), %eax
	imull	-24(%rbp), %eax
	addl	%eax, %edx
	movl	-24(%rbp), %eax
	imull	-20(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	imull	-28(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -20(%rbp)
.L4:
	cmpl	$104, -20(%rbp)
	jle	.L5
	addl	$1, -24(%rbp)
.L3:
	cmpl	$104, -24(%rbp)
	jle	.L6
	addl	$1, -28(%rbp)
.L2:
	cmpl	$104, -28(%rbp)
	jle	.L7
	movl	$1, -16(%rbp)
	jmp	.L8
.L9:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -16(%rbp)
.L8:
	movl	-32(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L9
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	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	n
	.bss
	.align 32
	.type	n, @object
	.size	n, 400040
n:
	.zero	400040
	.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
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -28(%rbp)
	jmp	.L2
.L7:
	movl	$1, -24(%rbp)
	jmp	.L3
.L6:
	movl	$1, -20(%rbp)
	jmp	.L4
.L5:
	movl	-28(%rbp), %eax
	imull	%eax, %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	imull	%eax, %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	imull	%eax, %eax
	addl	%eax, %edx
	movl	-28(%rbp), %eax
	imull	-24(%rbp), %eax
	addl	%eax, %edx
	movl	-24(%rbp), %eax
	imull	-20(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	imull	-28(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -20(%rbp)
.L4:
	cmpl	$104, -20(%rbp)
	jle	.L5
	addl	$1, -24(%rbp)
.L3:
	cmpl	$104, -24(%rbp)
	jle	.L6
	addl	$1, -28(%rbp)
.L2:
	cmpl	$104, -28(%rbp)
	jle	.L7
	movl	$1, -16(%rbp)
	jmp	.L8
.L9:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -16(%rbp)
.L8:
	movl	-32(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L9
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	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:
