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

```c
i,z=256,t[65536];main(j,k,l,x){for(;i<z;i++)for(j=i;j<z;j++)for(k=j;k<z;k++)for(l=k;l<z;l++){if((x=i*i+j*j+k*k+l*l)>=z*z)break;t[x]++;}while(scanf("%d",&x),x)printf("%d\n",t[x]);return 0;}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	i
	.bss
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	z
	.data
	.align 4
	.type	z, @object
	.size	z, 4
z:
	.long	256
	.globl	t
	.bss
	.align 32
	.type	t, @object
	.size	t, 262144
t:
	.zero	262144
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.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	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	movl	%ecx, -16(%rbp)
	jmp	.L2
.L11:
	movl	i(%rip), %eax
	movl	%eax, -4(%rbp)
	jmp	.L3
.L10:
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L4
.L9:
	movl	-8(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L5
.L8:
	movl	i(%rip), %edx
	movl	i(%rip), %eax
	imull	%eax, %edx
	movl	-4(%rbp), %eax
	imull	%eax, %eax
	addl	%eax, %edx
	movl	-8(%rbp), %eax
	imull	%eax, %eax
	addl	%eax, %edx
	movl	-12(%rbp), %eax
	imull	%eax, %eax
	addl	%edx, %eax
	movl	%eax, -16(%rbp)
	movl	-16(%rbp), %edx
	movl	z(%rip), %ecx
	movl	z(%rip), %eax
	imull	%ecx, %eax
	cmpl	%eax, %edx
	jge	.L15
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	t(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	t(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L5:
	movl	z(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L8
	jmp	.L7
.L15:
	nop
.L7:
	addl	$1, -8(%rbp)
.L4:
	movl	z(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L9
	addl	$1, -4(%rbp)
.L3:
	movl	z(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L10
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L2:
	movl	i(%rip), %edx
	movl	z(%rip), %eax
	cmpl	%eax, %edx
	jl	.L11
	jmp	.L12
.L13:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	t(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L12:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-16(%rbp), %eax
	testl	%eax, %eax
	jne	.L13
	movl	$0, %eax
	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\n"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movl	i(%rip), %r12d
	movl	z(%rip), %r8d
	movl	%ecx, 12(%rsp)
	cmpl	%r12d, %r8d
	jle	.L3
	movl	%r8d, %r9d
	xorl	%edx, %edx
	leaq	t(%rip), %rsi
	imull	%r8d, %r9d
.L4:
	movl	%r12d, %ebp
	movl	%r12d, %ebx
	imull	%r12d, %ebp
	cmpl	%r12d, %r8d
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%ebx, %r11d
	movl	%ebx, %r10d
	imull	%ebx, %r11d
	addl	%ebp, %r11d
	.p2align 4,,10
	.p2align 3
.L10:
	movl	%r10d, %eax
	imull	%r10d, %eax
	leal	(%rax,%r11), %edi
	addl	%edi, %eax
	cmpl	%r9d, %eax
	jge	.L5
	movl	%r10d, %edx
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%edx, %eax
	imull	%edx, %eax
	addl	%edi, %eax
	cmpl	%r9d, %eax
	jge	.L5
.L8:
	movslq	%eax, %rcx
	addl	$1, %edx
	addl	$1, (%rsi,%rcx,4)
	cmpl	%edx, %r8d
	jg	.L6
.L5:
	addl	$1, %r10d
	cmpl	%r10d, %r8d
	jne	.L10
	movl	$1, %edx
.L7:
	addl	$1, %ebx
	cmpl	%ebx, %r8d
	jg	.L20
	addl	$1, %r12d
	cmpl	%r12d, %r8d
	jne	.L4
	movl	%r8d, i(%rip)
	testb	%dl, %dl
	je	.L3
	movl	%eax, 12(%rsp)
.L3:
	leaq	12(%rsp), %r13
	leaq	.LC1(%rip), %r12
	leaq	t(%rip), %rbp
	leaq	.LC0(%rip), %rbx
	jmp	.L14
.L15:
	movl	0(%rbp,%rax,4), %esi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	printf@PLT
.L14:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	12(%rsp), %rax
	testl	%eax, %eax
	jne	.L15
	addq	$24, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	t
	.bss
	.align 32
	.type	t, @object
	.size	t, 262144
t:
	.zero	262144
	.globl	z
	.data
	.align 4
	.type	z, @object
	.size	z, 4
z:
	.long	256
	.globl	i
	.bss
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.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\n"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movl	i(%rip), %r12d
	movl	z(%rip), %r8d
	movl	%ecx, 12(%rsp)
	cmpl	%r12d, %r8d
	jle	.L3
	movl	%r8d, %r9d
	xorl	%edx, %edx
	leaq	t(%rip), %rsi
	imull	%r8d, %r9d
.L4:
	movl	%r12d, %ebp
	movl	%r12d, %ebx
	imull	%r12d, %ebp
	cmpl	%r12d, %r8d
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%ebx, %r11d
	movl	%ebx, %r10d
	imull	%ebx, %r11d
	addl	%ebp, %r11d
	.p2align 4,,10
	.p2align 3
.L10:
	movl	%r10d, %eax
	imull	%r10d, %eax
	leal	(%rax,%r11), %edi
	addl	%edi, %eax
	cmpl	%r9d, %eax
	jge	.L5
	movl	%r10d, %edx
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%edx, %eax
	imull	%edx, %eax
	addl	%edi, %eax
	cmpl	%r9d, %eax
	jge	.L5
.L8:
	movslq	%eax, %rcx
	addl	$1, %edx
	addl	$1, (%rsi,%rcx,4)
	cmpl	%edx, %r8d
	jg	.L6
.L5:
	addl	$1, %r10d
	cmpl	%r10d, %r8d
	jne	.L10
	movl	$1, %edx
.L7:
	addl	$1, %ebx
	cmpl	%ebx, %r8d
	jg	.L20
	addl	$1, %r12d
	cmpl	%r12d, %r8d
	jne	.L4
	movl	%r8d, i(%rip)
	testb	%dl, %dl
	je	.L3
	movl	%eax, 12(%rsp)
.L3:
	leaq	12(%rsp), %r13
	leaq	.LC1(%rip), %r12
	leaq	t(%rip), %rbp
	leaq	.LC0(%rip), %rbx
	jmp	.L14
.L15:
	movl	0(%rbp,%rax,4), %esi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	printf@PLT
.L14:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	12(%rsp), %rax
	testl	%eax, %eax
	jne	.L15
	addq	$24, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	t
	.bss
	.align 32
	.type	t, @object
	.size	t, 262144
t:
	.zero	262144
	.globl	z
	.data
	.align 4
	.type	z, @object
	.size	z, 4
z:
	.long	256
	.globl	i
	.bss
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.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:

i,z=256,t[65536];main(j,k,l,x){for(;i<z;i++)for(j=i;j<z;j++)for(k=j;k<z;k++)for(l=k;l<z;l++){if((x=i*i+j*j+k*k+l*l)>=z*z)break;t[x]++;}while(scanf("%d",&x),x)printf("%d\n",t[x]);return 0;}
1
8
2003
211
20007
0
 1
0
2003
211
20007
0
 1
1
762
0
34403
0
 1
25
2003
170
20007
0
 1
8
2003
211
20858
0
 1
1
1704
211
20007
0
 1
14
2003
170
20007
0
 1
8
1621
211
20858
0
 1
1
1704
312
20007
0
 1
12
1621
211
20858
0

1
1
48
7
738
 1
 1
1
41
 1
3
48
11
738
 1
1
48
7
699
 1
1
24
7
738
 1
1
48
11
738
 1
1
42
7
699
 1
1
24
4
738
 1
2
42
7
699

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

```c
i,z=256,t[65536];main(j,k,l,x){for(;i<z;i++)for(j=i;j<z;j++)for(k=j;k<z;k++)for(l=k;l<z;l++){if((x=i*i+j*j+k*k+l*l)>=z*z)break;t[x]++;}while(scanf("%d",&x),x)printf("%d\n",t[x]);return 0;}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	i
	.bss
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	z
	.data
	.align 4
	.type	z, @object
	.size	z, 4
z:
	.long	256
	.globl	t
	.bss
	.align 32
	.type	t, @object
	.size	t, 262144
t:
	.zero	262144
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.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	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	movl	%ecx, -16(%rbp)
	jmp	.L2
.L11:
	movl	i(%rip), %eax
	movl	%eax, -4(%rbp)
	jmp	.L3
.L10:
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L4
.L9:
	movl	-8(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L5
.L8:
	movl	i(%rip), %edx
	movl	i(%rip), %eax
	imull	%eax, %edx
	movl	-4(%rbp), %eax
	imull	%eax, %eax
	addl	%eax, %edx
	movl	-8(%rbp), %eax
	imull	%eax, %eax
	addl	%eax, %edx
	movl	-12(%rbp), %eax
	imull	%eax, %eax
	addl	%edx, %eax
	movl	%eax, -16(%rbp)
	movl	-16(%rbp), %edx
	movl	z(%rip), %ecx
	movl	z(%rip), %eax
	imull	%ecx, %eax
	cmpl	%eax, %edx
	jge	.L15
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	t(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	t(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L5:
	movl	z(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L8
	jmp	.L7
.L15:
	nop
.L7:
	addl	$1, -8(%rbp)
.L4:
	movl	z(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L9
	addl	$1, -4(%rbp)
.L3:
	movl	z(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L10
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L2:
	movl	i(%rip), %edx
	movl	z(%rip), %eax
	cmpl	%eax, %edx
	jl	.L11
	jmp	.L12
.L13:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	t(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L12:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-16(%rbp), %eax
	testl	%eax, %eax
	jne	.L13
	movl	$0, %eax
	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	i
	.bss
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	z
	.data
	.align 4
	.type	z, @object
	.size	z, 4
z:
	.long	256
	.globl	t
	.bss
	.align 32
	.type	t, @object
	.size	t, 262144
t:
	.zero	262144
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.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	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	movl	%ecx, -16(%rbp)
	jmp	.L2
.L11:
	movl	i(%rip), %eax
	movl	%eax, -4(%rbp)
	jmp	.L3
.L10:
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L4
.L9:
	movl	-8(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L5
.L8:
	movl	i(%rip), %edx
	movl	i(%rip), %eax
	imull	%eax, %edx
	movl	-4(%rbp), %eax
	imull	%eax, %eax
	addl	%eax, %edx
	movl	-8(%rbp), %eax
	imull	%eax, %eax
	addl	%eax, %edx
	movl	-12(%rbp), %eax
	imull	%eax, %eax
	addl	%edx, %eax
	movl	%eax, -16(%rbp)
	movl	-16(%rbp), %edx
	movl	z(%rip), %ecx
	movl	z(%rip), %eax
	imull	%ecx, %eax
	cmpl	%eax, %edx
	jge	.L15
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	t(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	t(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L5:
	movl	z(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L8
	jmp	.L7
.L15:
	nop
.L7:
	addl	$1, -8(%rbp)
.L4:
	movl	z(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L9
	addl	$1, -4(%rbp)
.L3:
	movl	z(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L10
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L2:
	movl	i(%rip), %edx
	movl	z(%rip), %eax
	cmpl	%eax, %edx
	jl	.L11
	jmp	.L12
.L13:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	t(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L12:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-16(%rbp), %eax
	testl	%eax, %eax
	jne	.L13
	movl	$0, %eax
	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:
