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 <ctype.h>
#include <stdlib.h>
 
int main()
{
    int b, f, r, v;;
    int house[5][4][11];
    int i, n;
 
    for (b = 1; b <= 4; b++) {
        for (f = 1; f <= 3; f++) {
            for (r = 1; r <= 10; r++) house[b][f][r] = 0;
        }
    }
    scanf("%d", &n);
    for (i = 0; i < n; i++) {
        scanf("%d%d%d%d", &b, &f, &r, &v);
        house[b][f][r] += v;
    }
 
    for (b = 1; b <= 4; b++) {
        for (f = 1; f <= 3; f++) {
            for (r = 1; r <= 10; r++) printf(" %d", house[b][f][r]);
            putchar('\n');
        }
        if (b < 4) puts("####################");
    }
    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:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$928, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1, -920(%rbp)
	jmp	.L2
.L7:
	movl	$1, -916(%rbp)
	jmp	.L3
.L6:
	movl	$1, -912(%rbp)
	jmp	.L4
.L5:
	movl	-920(%rbp), %edx
	movl	-916(%rbp), %eax
	movl	-912(%rbp), %ecx
	movslq	%ecx, %rsi
	movslq	%edx, %rdx
	movslq	%eax, %rcx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rcx, %rdx
	salq	$2, %rdx
	addq	%rcx, %rdx
	addq	%rdx, %rdx
	addq	%rcx, %rdx
	addq	%rdx, %rax
	addq	%rsi, %rax
	movl	$0, -896(%rbp,%rax,4)
	movl	-912(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -912(%rbp)
.L4:
	movl	-912(%rbp), %eax
	cmpl	$10, %eax
	jle	.L5
	movl	-916(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -916(%rbp)
.L3:
	movl	-916(%rbp), %eax
	cmpl	$3, %eax
	jle	.L6
	movl	-920(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -920(%rbp)
.L2:
	movl	-920(%rbp), %eax
	cmpl	$4, %eax
	jle	.L7
	leaq	-904(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -900(%rbp)
	jmp	.L8
.L9:
	leaq	-908(%rbp), %rsi
	leaq	-912(%rbp), %rcx
	leaq	-916(%rbp), %rdx
	leaq	-920(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-920(%rbp), %edx
	movl	-916(%rbp), %eax
	movl	-912(%rbp), %ecx
	movslq	%ecx, %rsi
	movslq	%edx, %rdx
	movslq	%eax, %rcx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rcx, %rdx
	salq	$2, %rdx
	addq	%rcx, %rdx
	addq	%rdx, %rdx
	addq	%rcx, %rdx
	addq	%rdx, %rax
	addq	%rsi, %rax
	movl	-896(%rbp,%rax,4), %edi
	movl	-908(%rbp), %esi
	movl	-920(%rbp), %edx
	movl	-916(%rbp), %eax
	movl	-912(%rbp), %ecx
	addl	%edi, %esi
	movslq	%ecx, %rdi
	movslq	%edx, %rdx
	movslq	%eax, %rcx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rcx, %rdx
	salq	$2, %rdx
	addq	%rcx, %rdx
	addq	%rdx, %rdx
	addq	%rcx, %rdx
	addq	%rdx, %rax
	addq	%rdi, %rax
	movl	%esi, -896(%rbp,%rax,4)
	addl	$1, -900(%rbp)
.L8:
	movl	-904(%rbp), %eax
	cmpl	%eax, -900(%rbp)
	jl	.L9
	movl	$1, -920(%rbp)
	jmp	.L10
.L16:
	movl	$1, -916(%rbp)
	jmp	.L11
.L14:
	movl	$1, -912(%rbp)
	jmp	.L12
.L13:
	movl	-920(%rbp), %edx
	movl	-916(%rbp), %eax
	movl	-912(%rbp), %ecx
	movslq	%ecx, %rsi
	movslq	%edx, %rdx
	movslq	%eax, %rcx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rcx, %rdx
	salq	$2, %rdx
	addq	%rcx, %rdx
	addq	%rdx, %rdx
	addq	%rcx, %rdx
	addq	%rdx, %rax
	addq	%rsi, %rax
	movl	-896(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-912(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -912(%rbp)
.L12:
	movl	-912(%rbp), %eax
	cmpl	$10, %eax
	jle	.L13
	movl	$10, %edi
	call	putchar@PLT
	movl	-916(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -916(%rbp)
.L11:
	movl	-916(%rbp), %eax
	cmpl	$3, %eax
	jle	.L14
	movl	-920(%rbp), %eax
	cmpl	$3, %eax
	jg	.L15
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L15:
	movl	-920(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -920(%rbp)
.L10:
	movl	-920(%rbp), %eax
	cmpl	$4, %eax
	jle	.L16
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$176, %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	$936, %rsp
	.cfi_def_cfa_offset 992
	movq	%fs:40, %rax
	movq	%rax, 920(%rsp)
	xorl	%eax, %eax
	leaq	388(%rsp), %rdx
	.p2align 4,,10
	.p2align 3
.L3:
	leaq	-132(%rdx), %rax
	.p2align 4,,10
	.p2align 3
.L2:
	pxor	%xmm0, %xmm0
	movq	$0, 32(%rax)
	addq	$44, %rax
	movups	%xmm0, -44(%rax)
	movups	%xmm0, -28(%rax)
	cmpq	%rax, %rdx
	jne	.L2
	addq	$176, %rcx
	addq	$176, %rdx
	cmpq	$880, %rcx
	jne	.L3
	leaq	28(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movl	$11, 20(%rsp)
	movl	$4, 16(%rsp)
	movl	$5, 12(%rsp)
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L6
	xorl	%r15d, %r15d
	leaq	24(%rsp), %r14
	leaq	20(%rsp), %r13
	leaq	16(%rsp), %r12
	leaq	12(%rsp), %rbp
	leaq	.LC1(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L4:
	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
	movslq	12(%rsp), %rdx
	movslq	16(%rsp), %rax
	movslq	20(%rsp), %rcx
	leaq	(%rdx,%rdx,4), %rsi
	leaq	(%rdx,%rsi,2), %rdx
	leaq	(%rax,%rax,4), %rsi
	leaq	(%rax,%rsi,2), %rax
	leaq	(%rax,%rdx,4), %rax
	movl	24(%rsp), %edx
	addq	%rcx, %rax
	addl	%edx, 32(%rsp,%rax,4)
	cmpl	%r15d, 28(%rsp)
	jg	.L4
.L6:
	movl	$1, 12(%rsp)
	movl	$1, %ecx
	leaq	.LC2(%rip), %rbx
	leaq	.LC3(%rip), %rbp
.L5:
	movl	$1, 16(%rsp)
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L10:
	movl	$1, 20(%rsp)
	movl	$1, %eax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L20:
	movl	12(%rsp), %ecx
	movl	16(%rsp), %edx
.L8:
	movslq	%ecx, %rcx
	movslq	%edx, %rdx
	cltq
	movl	$1, %edi
	leaq	(%rcx,%rcx,4), %rsi
	leaq	(%rcx,%rsi,2), %rcx
	leaq	(%rdx,%rdx,4), %rsi
	leaq	(%rdx,%rsi,2), %rdx
	movq	%rbx, %rsi
	leaq	(%rdx,%rcx,4), %rdx
	addq	%rdx, %rax
	movl	32(%rsp,%rax,4), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	20(%rsp), %eax
	addl	$1, %eax
	movl	%eax, 20(%rsp)
	cmpl	$10, %eax
	jle	.L20
	movq	stdout(%rip), %rsi
	movl	$10, %edi
	call	putc@PLT
	movl	16(%rsp), %eax
	leal	1(%rax), %edx
	movl	%edx, 16(%rsp)
	cmpl	$3, %edx
	jg	.L9
	movl	12(%rsp), %ecx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L9:
	cmpl	$3, 12(%rsp)
	jle	.L21
.L11:
	movq	920(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$936, %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
.L21:
	.cfi_restore_state
	movq	%rbp, %rdi
	call	puts@PLT
	movl	12(%rsp), %eax
	leal	1(%rax), %ecx
	movl	%ecx, 12(%rsp)
	cmpl	$4, %ecx
	jle	.L5
	jmp	.L11
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE41:
	.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:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$176, %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	$936, %rsp
	.cfi_def_cfa_offset 992
	movq	%fs:40, %rax
	movq	%rax, 920(%rsp)
	xorl	%eax, %eax
	leaq	388(%rsp), %rdx
	.p2align 4,,10
	.p2align 3
.L3:
	leaq	-132(%rdx), %rax
	.p2align 4,,10
	.p2align 3
.L2:
	pxor	%xmm0, %xmm0
	movq	$0, 32(%rax)
	addq	$44, %rax
	movups	%xmm0, -44(%rax)
	movups	%xmm0, -28(%rax)
	cmpq	%rax, %rdx
	jne	.L2
	addq	$176, %rcx
	addq	$176, %rdx
	cmpq	$880, %rcx
	jne	.L3
	leaq	28(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movl	$11, 20(%rsp)
	movl	$4, 16(%rsp)
	movl	$5, 12(%rsp)
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L6
	xorl	%r15d, %r15d
	leaq	24(%rsp), %r14
	leaq	20(%rsp), %r13
	leaq	16(%rsp), %r12
	leaq	12(%rsp), %rbp
	leaq	.LC1(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L4:
	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
	movslq	12(%rsp), %rdx
	movslq	16(%rsp), %rax
	movslq	20(%rsp), %rcx
	leaq	(%rdx,%rdx,4), %rsi
	leaq	(%rdx,%rsi,2), %rdx
	leaq	(%rax,%rax,4), %rsi
	leaq	(%rax,%rsi,2), %rax
	leaq	(%rax,%rdx,4), %rax
	movl	24(%rsp), %edx
	addq	%rcx, %rax
	addl	%edx, 32(%rsp,%rax,4)
	cmpl	%r15d, 28(%rsp)
	jg	.L4
.L6:
	movl	$1, 12(%rsp)
	movl	$1, %ecx
	leaq	.LC2(%rip), %rbx
	leaq	.LC3(%rip), %rbp
.L5:
	movl	$1, 16(%rsp)
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L10:
	movl	$1, 20(%rsp)
	movl	$1, %eax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L20:
	movl	12(%rsp), %ecx
	movl	16(%rsp), %edx
.L8:
	movslq	%ecx, %rcx
	movslq	%edx, %rdx
	cltq
	movl	$1, %edi
	leaq	(%rcx,%rcx,4), %rsi
	leaq	(%rcx,%rsi,2), %rcx
	leaq	(%rdx,%rdx,4), %rsi
	leaq	(%rdx,%rsi,2), %rdx
	movq	%rbx, %rsi
	leaq	(%rdx,%rcx,4), %rdx
	addq	%rdx, %rax
	movl	32(%rsp,%rax,4), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	20(%rsp), %eax
	addl	$1, %eax
	movl	%eax, 20(%rsp)
	cmpl	$10, %eax
	jle	.L20
	movq	stdout(%rip), %rsi
	movl	$10, %edi
	call	putc@PLT
	movl	16(%rsp), %eax
	leal	1(%rax), %edx
	movl	%edx, 16(%rsp)
	cmpl	$3, %edx
	jg	.L9
	movl	12(%rsp), %ecx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L9:
	cmpl	$3, 12(%rsp)
	jle	.L21
.L11:
	movq	920(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$936, %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
.L21:
	.cfi_restore_state
	movq	%rbp, %rdi
	call	puts@PLT
	movl	12(%rsp), %eax
	leal	1(%rax), %ecx
	movl	%ecx, 12(%rsp)
	cmpl	$4, %ecx
	jle	.L5
	jmp	.L11
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE41:
	.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>
#include <ctype.h>
#include <stdlib.h>
 
int main()
{
    int b, f, r, v;;
    int house[5][4][11];
    int i, n;
 
    for (b = 1; b <= 4; b++) {
        for (f = 1; f <= 3; f++) {
            for (r = 1; r <= 10; r++) house[b][f][r] = 0;
        }
    }
    scanf("%d", &n);
    for (i = 0; i < n; i++) {
        scanf("%d%d%d%d", &b, &f, &r, &v);
        house[b][f][r] += v;
    }
 
    for (b = 1; b <= 4; b++) {
        for (f = 1; f <= 3; f++) {
            for (r = 1; r <= 10; r++) printf(" %d", house[b][f][r]);
            putchar('\n');
        }
        if (b < 4) puts("####################");
    }
    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>
#include <ctype.h>
#include <stdlib.h>
 
int main()
{
    int b, f, r, v;;
    int house[5][4][11];
    int i, n;
 
    for (b = 1; b <= 4; b++) {
        for (f = 1; f <= 3; f++) {
            for (r = 1; r <= 10; r++) house[b][f][r] = 0;
        }
    }
    scanf("%d", &n);
    for (i = 0; i < n; i++) {
        scanf("%d%d%d%d", &b, &f, &r, &v);
        house[b][f][r] += v;
    }
 
    for (b = 1; b <= 4; b++) {
        for (f = 1; f <= 3; f++) {
            for (r = 1; r <= 10; r++) printf(" %d", house[b][f][r]);
            putchar('\n');
        }
        if (b < 4) puts("####################");
    }
    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:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$928, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1, -920(%rbp)
	jmp	.L2
.L7:
	movl	$1, -916(%rbp)
	jmp	.L3
.L6:
	movl	$1, -912(%rbp)
	jmp	.L4
.L5:
	movl	-920(%rbp), %edx
	movl	-916(%rbp), %eax
	movl	-912(%rbp), %ecx
	movslq	%ecx, %rsi
	movslq	%edx, %rdx
	movslq	%eax, %rcx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rcx, %rdx
	salq	$2, %rdx
	addq	%rcx, %rdx
	addq	%rdx, %rdx
	addq	%rcx, %rdx
	addq	%rdx, %rax
	addq	%rsi, %rax
	movl	$0, -896(%rbp,%rax,4)
	movl	-912(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -912(%rbp)
.L4:
	movl	-912(%rbp), %eax
	cmpl	$10, %eax
	jle	.L5
	movl	-916(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -916(%rbp)
.L3:
	movl	-916(%rbp), %eax
	cmpl	$3, %eax
	jle	.L6
	movl	-920(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -920(%rbp)
.L2:
	movl	-920(%rbp), %eax
	cmpl	$4, %eax
	jle	.L7
	leaq	-904(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -900(%rbp)
	jmp	.L8
.L9:
	leaq	-908(%rbp), %rsi
	leaq	-912(%rbp), %rcx
	leaq	-916(%rbp), %rdx
	leaq	-920(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-920(%rbp), %edx
	movl	-916(%rbp), %eax
	movl	-912(%rbp), %ecx
	movslq	%ecx, %rsi
	movslq	%edx, %rdx
	movslq	%eax, %rcx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rcx, %rdx
	salq	$2, %rdx
	addq	%rcx, %rdx
	addq	%rdx, %rdx
	addq	%rcx, %rdx
	addq	%rdx, %rax
	addq	%rsi, %rax
	movl	-896(%rbp,%rax,4), %edi
	movl	-908(%rbp), %esi
	movl	-920(%rbp), %edx
	movl	-916(%rbp), %eax
	movl	-912(%rbp), %ecx
	addl	%edi, %esi
	movslq	%ecx, %rdi
	movslq	%edx, %rdx
	movslq	%eax, %rcx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rcx, %rdx
	salq	$2, %rdx
	addq	%rcx, %rdx
	addq	%rdx, %rdx
	addq	%rcx, %rdx
	addq	%rdx, %rax
	addq	%rdi, %rax
	movl	%esi, -896(%rbp,%rax,4)
	addl	$1, -900(%rbp)
.L8:
	movl	-904(%rbp), %eax
	cmpl	%eax, -900(%rbp)
	jl	.L9
	movl	$1, -920(%rbp)
	jmp	.L10
.L16:
	movl	$1, -916(%rbp)
	jmp	.L11
.L14:
	movl	$1, -912(%rbp)
	jmp	.L12
.L13:
	movl	-920(%rbp), %edx
	movl	-916(%rbp), %eax
	movl	-912(%rbp), %ecx
	movslq	%ecx, %rsi
	movslq	%edx, %rdx
	movslq	%eax, %rcx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rcx, %rdx
	salq	$2, %rdx
	addq	%rcx, %rdx
	addq	%rdx, %rdx
	addq	%rcx, %rdx
	addq	%rdx, %rax
	addq	%rsi, %rax
	movl	-896(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-912(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -912(%rbp)
.L12:
	movl	-912(%rbp), %eax
	cmpl	$10, %eax
	jle	.L13
	movl	$10, %edi
	call	putchar@PLT
	movl	-916(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -916(%rbp)
.L11:
	movl	-916(%rbp), %eax
	cmpl	$3, %eax
	jle	.L14
	movl	-920(%rbp), %eax
	cmpl	$3, %eax
	jg	.L15
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L15:
	movl	-920(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -920(%rbp)
.L10:
	movl	-920(%rbp), %eax
	cmpl	$4, %eax
	jle	.L16
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$928, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1, -920(%rbp)
	jmp	.L2
.L7:
	movl	$1, -916(%rbp)
	jmp	.L3
.L6:
	movl	$1, -912(%rbp)
	jmp	.L4
.L5:
	movl	-920(%rbp), %edx
	movl	-916(%rbp), %eax
	movl	-912(%rbp), %ecx
	movslq	%ecx, %rsi
	movslq	%edx, %rdx
	movslq	%eax, %rcx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rcx, %rdx
	salq	$2, %rdx
	addq	%rcx, %rdx
	addq	%rdx, %rdx
	addq	%rcx, %rdx
	addq	%rdx, %rax
	addq	%rsi, %rax
	movl	$0, -896(%rbp,%rax,4)
	movl	-912(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -912(%rbp)
.L4:
	movl	-912(%rbp), %eax
	cmpl	$10, %eax
	jle	.L5
	movl	-916(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -916(%rbp)
.L3:
	movl	-916(%rbp), %eax
	cmpl	$3, %eax
	jle	.L6
	movl	-920(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -920(%rbp)
.L2:
	movl	-920(%rbp), %eax
	cmpl	$4, %eax
	jle	.L7
	leaq	-904(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -900(%rbp)
	jmp	.L8
.L9:
	leaq	-908(%rbp), %rsi
	leaq	-912(%rbp), %rcx
	leaq	-916(%rbp), %rdx
	leaq	-920(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-920(%rbp), %edx
	movl	-916(%rbp), %eax
	movl	-912(%rbp), %ecx
	movslq	%ecx, %rsi
	movslq	%edx, %rdx
	movslq	%eax, %rcx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rcx, %rdx
	salq	$2, %rdx
	addq	%rcx, %rdx
	addq	%rdx, %rdx
	addq	%rcx, %rdx
	addq	%rdx, %rax
	addq	%rsi, %rax
	movl	-896(%rbp,%rax,4), %edi
	movl	-908(%rbp), %esi
	movl	-920(%rbp), %edx
	movl	-916(%rbp), %eax
	movl	-912(%rbp), %ecx
	addl	%edi, %esi
	movslq	%ecx, %rdi
	movslq	%edx, %rdx
	movslq	%eax, %rcx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rcx, %rdx
	salq	$2, %rdx
	addq	%rcx, %rdx
	addq	%rdx, %rdx
	addq	%rcx, %rdx
	addq	%rdx, %rax
	addq	%rdi, %rax
	movl	%esi, -896(%rbp,%rax,4)
	addl	$1, -900(%rbp)
.L8:
	movl	-904(%rbp), %eax
	cmpl	%eax, -900(%rbp)
	jl	.L9
	movl	$1, -920(%rbp)
	jmp	.L10
.L16:
	movl	$1, -916(%rbp)
	jmp	.L11
.L14:
	movl	$1, -912(%rbp)
	jmp	.L12
.L13:
	movl	-920(%rbp), %edx
	movl	-916(%rbp), %eax
	movl	-912(%rbp), %ecx
	movslq	%ecx, %rsi
	movslq	%edx, %rdx
	movslq	%eax, %rcx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rcx, %rdx
	salq	$2, %rdx
	addq	%rcx, %rdx
	addq	%rdx, %rdx
	addq	%rcx, %rdx
	addq	%rdx, %rax
	addq	%rsi, %rax
	movl	-896(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-912(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -912(%rbp)
.L12:
	movl	-912(%rbp), %eax
	cmpl	$10, %eax
	jle	.L13
	movl	$10, %edi
	call	putchar@PLT
	movl	-916(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -916(%rbp)
.L11:
	movl	-916(%rbp), %eax
	cmpl	$3, %eax
	jle	.L14
	movl	-920(%rbp), %eax
	cmpl	$3, %eax
	jg	.L15
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L15:
	movl	-920(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -920(%rbp)
.L10:
	movl	-920(%rbp), %eax
	cmpl	$4, %eax
	jle	.L16
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
