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;
  int data[4][3][10] = {{{0}}};
  scanf("%d", &n);
  for(int i = 0; i < n; i++) {
    int b, f, r, v;
    scanf("%d %d %d %d", &b, &f, &r, &v);
    data[b-1][f-1][r-1] += v;
  }
 for(int i=0;i<4;i++){
     for(int j=0;j<3;j++){
         for(int k=0;k<10;k++){
             printf(" %d",data[i][j][k]);
         }
         printf("\n");
     }
     if(i!=3)
     printf("####################\n");
 }
 return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d %d"
.LC2:
	.string	" %d"
.LC3:
	.string	"####################"
	.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	$544, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-496(%rbp), %rdx
	movl	$0, %eax
	movl	$60, %ecx
	movq	%rdx, %rdi
	rep stosq
	leaq	-532(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -512(%rbp)
	jmp	.L2
.L3:
	leaq	-516(%rbp), %rsi
	leaq	-520(%rbp), %rcx
	leaq	-524(%rbp), %rdx
	leaq	-528(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-528(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-524(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-520(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rax
	movslq	%edx, %rcx
	movq	%rax, %rdx
	salq	$4, %rdx
	subq	%rax, %rdx
	leaq	(%rdx,%rdx), %rax
	movq	%rax, %rdx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	movl	-496(%rbp,%rax,4), %edi
	movl	-516(%rbp), %esi
	movl	-528(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-524(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-520(%rbp), %eax
	subl	$1, %eax
	addl	%edi, %esi
	movslq	%eax, %rdi
	movslq	%ecx, %rax
	movslq	%edx, %rcx
	movq	%rax, %rdx
	salq	$4, %rdx
	subq	%rax, %rdx
	leaq	(%rdx,%rdx), %rax
	movq	%rax, %rdx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rdi, %rax
	movl	%esi, -496(%rbp,%rax,4)
	addl	$1, -512(%rbp)
.L2:
	movl	-532(%rbp), %eax
	cmpl	%eax, -512(%rbp)
	jl	.L3
	movl	$0, -508(%rbp)
	jmp	.L4
.L10:
	movl	$0, -504(%rbp)
	jmp	.L5
.L8:
	movl	$0, -500(%rbp)
	jmp	.L6
.L7:
	movl	-500(%rbp), %eax
	movslq	%eax, %rsi
	movl	-508(%rbp), %eax
	cltq
	movl	-504(%rbp), %edx
	movslq	%edx, %rcx
	movq	%rax, %rdx
	salq	$4, %rdx
	subq	%rax, %rdx
	leaq	(%rdx,%rdx), %rax
	movq	%rax, %rdx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	movl	-496(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -500(%rbp)
.L6:
	cmpl	$9, -500(%rbp)
	jle	.L7
	movl	$10, %edi
	call	putchar@PLT
	addl	$1, -504(%rbp)
.L5:
	cmpl	$2, -504(%rbp)
	jle	.L8
	cmpl	$3, -508(%rbp)
	je	.L9
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L9:
	addl	$1, -508(%rbp)
.L4:
	cmpl	$3, -508(%rbp)
	jle	.L10
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	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 %d %d %d"
.LC2:
	.string	" %d"
.LC3:
	.string	"####################"
	.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	$60, %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	$552, %rsp
	.cfi_def_cfa_offset 608
	movq	%fs:40, %rax
	movq	%rax, 536(%rsp)
	xorl	%eax, %eax
	leaq	48(%rsp), %rdi
	leaq	28(%rsp), %rsi
	movq	%rdi, 8(%rsp)
	rep stosq
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	xorl	%r15d, %r15d
	leaq	44(%rsp), %r14
	leaq	40(%rsp), %r13
	leaq	36(%rsp), %r12
	leaq	32(%rsp), %rbp
	leaq	.LC1(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rcx
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%r14, %r8
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %eax
	movl	40(%rsp), %ecx
	leal	-1(%rax), %edx
	movl	36(%rsp), %eax
	subl	$1, %ecx
	movslq	%edx, %rdx
	movslq	%ecx, %rcx
	subl	$1, %eax
	movq	%rdx, %rsi
	cltq
	salq	$4, %rsi
	leaq	(%rax,%rax,4), %rax
	subq	%rdx, %rsi
	movl	44(%rsp), %edx
	addq	%rax, %rax
	leaq	(%rax,%rsi,2), %rax
	addq	%rcx, %rax
	addl	%edx, 48(%rsp,%rax,4)
	cmpl	%r15d, 28(%rsp)
	jg	.L3
.L2:
	movq	8(%rsp), %r15
	xorl	%r13d, %r13d
	leaq	.LC2(%rip), %rbp
	leaq	.LC3(%rip), %r14
.L4:
	leaq	120(%r15), %r12
.L8:
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L5:
	movl	(%r15,%rbx,4), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpq	$10, %rbx
	jne	.L5
	movl	$10, %edi
	addq	$40, %r15
	call	putchar@PLT
	cmpq	%r12, %r15
	jne	.L8
	cmpq	$360, %r13
	je	.L7
	movq	%r14, %rdi
	addq	$120, %r13
	call	puts@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L7:
	movq	536(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$552, %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
.L14:
	.cfi_restore_state
	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 %d %d %d"
.LC2:
	.string	" %d"
.LC3:
	.string	"####################"
	.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	$60, %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	$552, %rsp
	.cfi_def_cfa_offset 608
	movq	%fs:40, %rax
	movq	%rax, 536(%rsp)
	xorl	%eax, %eax
	leaq	48(%rsp), %rdi
	leaq	28(%rsp), %rsi
	movq	%rdi, 8(%rsp)
	rep stosq
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	xorl	%r15d, %r15d
	leaq	44(%rsp), %r14
	leaq	40(%rsp), %r13
	leaq	36(%rsp), %r12
	leaq	32(%rsp), %rbp
	leaq	.LC1(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rcx
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%r14, %r8
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %eax
	movl	40(%rsp), %ecx
	leal	-1(%rax), %edx
	movl	36(%rsp), %eax
	subl	$1, %ecx
	movslq	%edx, %rdx
	movslq	%ecx, %rcx
	subl	$1, %eax
	movq	%rdx, %rsi
	cltq
	salq	$4, %rsi
	leaq	(%rax,%rax,4), %rax
	subq	%rdx, %rsi
	movl	44(%rsp), %edx
	addq	%rax, %rax
	leaq	(%rax,%rsi,2), %rax
	addq	%rcx, %rax
	addl	%edx, 48(%rsp,%rax,4)
	cmpl	%r15d, 28(%rsp)
	jg	.L3
.L2:
	movq	8(%rsp), %r15
	xorl	%r13d, %r13d
	leaq	.LC2(%rip), %rbp
	leaq	.LC3(%rip), %r14
.L4:
	leaq	120(%r15), %r12
.L8:
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L5:
	movl	(%r15,%rbx,4), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpq	$10, %rbx
	jne	.L5
	movl	$10, %edi
	addq	$40, %r15
	call	putchar@PLT
	cmpq	%r12, %r15
	jne	.L8
	cmpq	$360, %r13
	je	.L7
	movq	%r14, %rdi
	addq	$120, %r13
	call	puts@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L7:
	movq	536(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$552, %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
.L14:
	.cfi_restore_state
	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;
  int data[4][3][10] = {{{0}}};
  scanf("%d", &n);
  for(int i = 0; i < n; i++) {
    int b, f, r, v;
    scanf("%d %d %d %d", &b, &f, &r, &v);
    data[b-1][f-1][r-1] += v;
  }
 for(int i=0;i<4;i++){
     for(int j=0;j<3;j++){
         for(int k=0;k<10;k++){
             printf(" %d",data[i][j][k]);
         }
         printf("\n");
     }
     if(i!=3)
     printf("####################\n");
 }
 return 0;
}


3
1 1 3 16
3 2 2 7
4 3 8 1
 3
1 1 3 8
3 2 4 7
4 3 8 1
 3
1 1 3 12
3 2 4 7
4 3 8 1
 3
1 1 6 12
3 2 4 7
4 3 8 1
 3
1 1 10 12
3 2 4 7
4 3 8 1
 3
1 1 10 12
3 2 6 7
4 3 8 1
 3
1 1 10 12
3 3 6 7
4 3 8 1
 3
0 1 10 12
3 3 6 7
4 3 8 1
 3
2 1 3 8
3 2 2 7
4 3 8 1
 3
1 1 3 16
2 2 2 7
4 3 8 1

 0 0 16 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 7 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 1 0 0
  0 0 8 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 7 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 1 0 0
  0 0 12 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 7 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 1 0 0
  0 0 0 0 0 12 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 7 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 1 0 0
  0 0 0 0 0 0 0 0 0 12
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 7 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 1 0 0
  0 0 0 0 0 0 0 0 0 12
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 7 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 1 0 0
  0 0 0 0 0 0 0 0 0 12
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 7 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 1 0 0
  0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 7 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 1 0 0
  0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 8 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 7 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 1 0 0
  0 0 16 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 7 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 1 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;
  int data[4][3][10] = {{{0}}};
  scanf("%d", &n);
  for(int i = 0; i < n; i++) {
    int b, f, r, v;
    scanf("%d %d %d %d", &b, &f, &r, &v);
    data[b-1][f-1][r-1] += v;
  }
 for(int i=0;i<4;i++){
     for(int j=0;j<3;j++){
         for(int k=0;k<10;k++){
             printf(" %d",data[i][j][k]);
         }
         printf("\n");
     }
     if(i!=3)
     printf("####################\n");
 }
 return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d %d"
.LC2:
	.string	" %d"
.LC3:
	.string	"####################"
	.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	$544, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-496(%rbp), %rdx
	movl	$0, %eax
	movl	$60, %ecx
	movq	%rdx, %rdi
	rep stosq
	leaq	-532(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -512(%rbp)
	jmp	.L2
.L3:
	leaq	-516(%rbp), %rsi
	leaq	-520(%rbp), %rcx
	leaq	-524(%rbp), %rdx
	leaq	-528(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-528(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-524(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-520(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rax
	movslq	%edx, %rcx
	movq	%rax, %rdx
	salq	$4, %rdx
	subq	%rax, %rdx
	leaq	(%rdx,%rdx), %rax
	movq	%rax, %rdx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	movl	-496(%rbp,%rax,4), %edi
	movl	-516(%rbp), %esi
	movl	-528(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-524(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-520(%rbp), %eax
	subl	$1, %eax
	addl	%edi, %esi
	movslq	%eax, %rdi
	movslq	%ecx, %rax
	movslq	%edx, %rcx
	movq	%rax, %rdx
	salq	$4, %rdx
	subq	%rax, %rdx
	leaq	(%rdx,%rdx), %rax
	movq	%rax, %rdx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rdi, %rax
	movl	%esi, -496(%rbp,%rax,4)
	addl	$1, -512(%rbp)
.L2:
	movl	-532(%rbp), %eax
	cmpl	%eax, -512(%rbp)
	jl	.L3
	movl	$0, -508(%rbp)
	jmp	.L4
.L10:
	movl	$0, -504(%rbp)
	jmp	.L5
.L8:
	movl	$0, -500(%rbp)
	jmp	.L6
.L7:
	movl	-500(%rbp), %eax
	movslq	%eax, %rsi
	movl	-508(%rbp), %eax
	cltq
	movl	-504(%rbp), %edx
	movslq	%edx, %rcx
	movq	%rax, %rdx
	salq	$4, %rdx
	subq	%rax, %rdx
	leaq	(%rdx,%rdx), %rax
	movq	%rax, %rdx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	movl	-496(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -500(%rbp)
.L6:
	cmpl	$9, -500(%rbp)
	jle	.L7
	movl	$10, %edi
	call	putchar@PLT
	addl	$1, -504(%rbp)
.L5:
	cmpl	$2, -504(%rbp)
	jle	.L8
	cmpl	$3, -508(%rbp)
	je	.L9
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L9:
	addl	$1, -508(%rbp)
.L4:
	cmpl	$3, -508(%rbp)
	jle	.L10
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	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 %d %d %d"
.LC2:
	.string	" %d"
.LC3:
	.string	"####################"
	.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	$544, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-496(%rbp), %rdx
	movl	$0, %eax
	movl	$60, %ecx
	movq	%rdx, %rdi
	rep stosq
	leaq	-532(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -512(%rbp)
	jmp	.L2
.L3:
	leaq	-516(%rbp), %rsi
	leaq	-520(%rbp), %rcx
	leaq	-524(%rbp), %rdx
	leaq	-528(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-528(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-524(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-520(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rax
	movslq	%edx, %rcx
	movq	%rax, %rdx
	salq	$4, %rdx
	subq	%rax, %rdx
	leaq	(%rdx,%rdx), %rax
	movq	%rax, %rdx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	movl	-496(%rbp,%rax,4), %edi
	movl	-516(%rbp), %esi
	movl	-528(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-524(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-520(%rbp), %eax
	subl	$1, %eax
	addl	%edi, %esi
	movslq	%eax, %rdi
	movslq	%ecx, %rax
	movslq	%edx, %rcx
	movq	%rax, %rdx
	salq	$4, %rdx
	subq	%rax, %rdx
	leaq	(%rdx,%rdx), %rax
	movq	%rax, %rdx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rdi, %rax
	movl	%esi, -496(%rbp,%rax,4)
	addl	$1, -512(%rbp)
.L2:
	movl	-532(%rbp), %eax
	cmpl	%eax, -512(%rbp)
	jl	.L3
	movl	$0, -508(%rbp)
	jmp	.L4
.L10:
	movl	$0, -504(%rbp)
	jmp	.L5
.L8:
	movl	$0, -500(%rbp)
	jmp	.L6
.L7:
	movl	-500(%rbp), %eax
	movslq	%eax, %rsi
	movl	-508(%rbp), %eax
	cltq
	movl	-504(%rbp), %edx
	movslq	%edx, %rcx
	movq	%rax, %rdx
	salq	$4, %rdx
	subq	%rax, %rdx
	leaq	(%rdx,%rdx), %rax
	movq	%rax, %rdx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	movl	-496(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -500(%rbp)
.L6:
	cmpl	$9, -500(%rbp)
	jle	.L7
	movl	$10, %edi
	call	putchar@PLT
	addl	$1, -504(%rbp)
.L5:
	cmpl	$2, -504(%rbp)
	jle	.L8
	cmpl	$3, -508(%rbp)
	je	.L9
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L9:
	addl	$1, -508(%rbp)
.L4:
	cmpl	$3, -508(%rbp)
	jle	.L10
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	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:
