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(){
    int a[101][101]={{0}};
    int b[101]={0};
    int d[101]={0};
    int i,j,r,c;
    int x;
    int e=0;

    scanf("%d %d",&r,&c);

    for(j=0;j<r;j++){
        for(i=0;i<c;i++){
            scanf("%d",&x);
        a[j][i]=x;
        }
    }

    for(j=0;j<r;j++){
        for(i=0;i<c;i++){
            b[i]+=a[j][i];
        }
    }

    for(j=0;j<r;j++){
        for(i=0;i<c;i++){
            d[j]+=a[j][i];
        }
    }

    for(j=0;j<r;j++){
        for(i=0;i<c;i++){
            printf("%d ",a[j][i]);
        }
        printf("%d\n",d[j]);
    }
    for(i=0;i<c;i++){
        printf("%d ",b[i]);
        e+=b[i];
    }
    printf("%d\n",e);

    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d "
.LC3:
	.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	-40960(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$720, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-40816(%rbp), %rax
	movl	$40804, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-41648(%rbp), %rdx
	movl	$0, %eax
	movl	$50, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	leaq	-41232(%rbp), %rdx
	movl	$0, %eax
	movl	$50, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	movl	$0, -41652(%rbp)
	leaq	-41668(%rbp), %rdx
	leaq	-41672(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -41656(%rbp)
	jmp	.L2
.L5:
	movl	$0, -41660(%rbp)
	jmp	.L3
.L4:
	leaq	-41664(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-41664(%rbp), %ecx
	movl	-41660(%rbp), %eax
	movslq	%eax, %rsi
	movl	-41656(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	movl	%ecx, -40816(%rbp,%rax,4)
	addl	$1, -41660(%rbp)
.L3:
	movl	-41668(%rbp), %eax
	cmpl	%eax, -41660(%rbp)
	jl	.L4
	addl	$1, -41656(%rbp)
.L2:
	movl	-41672(%rbp), %eax
	cmpl	%eax, -41656(%rbp)
	jl	.L5
	movl	$0, -41656(%rbp)
	jmp	.L6
.L9:
	movl	$0, -41660(%rbp)
	jmp	.L7
.L8:
	movl	-41660(%rbp), %eax
	cltq
	movl	-41648(%rbp,%rax,4), %ecx
	movl	-41660(%rbp), %eax
	movslq	%eax, %rsi
	movl	-41656(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	movl	-40816(%rbp,%rax,4), %eax
	leal	(%rcx,%rax), %edx
	movl	-41660(%rbp), %eax
	cltq
	movl	%edx, -41648(%rbp,%rax,4)
	addl	$1, -41660(%rbp)
.L7:
	movl	-41668(%rbp), %eax
	cmpl	%eax, -41660(%rbp)
	jl	.L8
	addl	$1, -41656(%rbp)
.L6:
	movl	-41672(%rbp), %eax
	cmpl	%eax, -41656(%rbp)
	jl	.L9
	movl	$0, -41656(%rbp)
	jmp	.L10
.L13:
	movl	$0, -41660(%rbp)
	jmp	.L11
.L12:
	movl	-41656(%rbp), %eax
	cltq
	movl	-41232(%rbp,%rax,4), %ecx
	movl	-41660(%rbp), %eax
	movslq	%eax, %rsi
	movl	-41656(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	movl	-40816(%rbp,%rax,4), %eax
	leal	(%rcx,%rax), %edx
	movl	-41656(%rbp), %eax
	cltq
	movl	%edx, -41232(%rbp,%rax,4)
	addl	$1, -41660(%rbp)
.L11:
	movl	-41668(%rbp), %eax
	cmpl	%eax, -41660(%rbp)
	jl	.L12
	addl	$1, -41656(%rbp)
.L10:
	movl	-41672(%rbp), %eax
	cmpl	%eax, -41656(%rbp)
	jl	.L13
	movl	$0, -41656(%rbp)
	jmp	.L14
.L17:
	movl	$0, -41660(%rbp)
	jmp	.L15
.L16:
	movl	-41660(%rbp), %eax
	movslq	%eax, %rcx
	movl	-41656(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-40816(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -41660(%rbp)
.L15:
	movl	-41668(%rbp), %eax
	cmpl	%eax, -41660(%rbp)
	jl	.L16
	movl	-41656(%rbp), %eax
	cltq
	movl	-41232(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -41656(%rbp)
.L14:
	movl	-41672(%rbp), %eax
	cmpl	%eax, -41656(%rbp)
	jl	.L17
	movl	$0, -41660(%rbp)
	jmp	.L18
.L19:
	movl	-41660(%rbp), %eax
	cltq
	movl	-41648(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-41660(%rbp), %eax
	cltq
	movl	-41648(%rbp,%rax,4), %eax
	addl	%eax, -41652(%rbp)
	addl	$1, -41660(%rbp)
.L18:
	movl	-41668(%rbp), %eax
	cmpl	%eax, -41660(%rbp)
	jl	.L19
	movl	-41652(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	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 %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d "
.LC3:
	.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	-40960(%rsp), %r11
	.cfi_def_cfa 11, 41016
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$744, %rsp
	.cfi_def_cfa_offset 41760
	movl	$40804, %edx
	xorl	%esi, %esi
	movq	%fs:40, %rax
	movq	%rax, 41688(%rsp)
	xorl	%eax, %eax
	leaq	880(%rsp), %rax
	leaq	48(%rsp), %r14
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
	call	memset@PLT
	xorl	%eax, %eax
	movl	$50, %ecx
	movq	%r14, %rdi
	rep stosq
	movl	$50, %ecx
	leaq	40(%rsp), %rdx
	leaq	36(%rsp), %rsi
	movl	$0, (%rdi)
	leaq	464(%rsp), %rdi
	movq	%rdi, 16(%rsp)
	rep stosq
	movl	$0, (%rdi)
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %r8d
	movl	40(%rsp), %ecx
	testl	%r8d, %r8d
	jle	.L2
	movq	8(%rsp), %rbx
	movl	40(%rsp), %eax
	xorl	%r15d, %r15d
	leaq	.LC1(%rip), %r12
	movq	%rbx, 24(%rsp)
	testl	%eax, %eax
	jle	.L76
	.p2align 4,,10
	.p2align 3
.L40:
	xorl	%r13d, %r13d
	leaq	44(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	movl	%eax, (%rbx,%r13,4)
	movl	40(%rsp), %eax
	addq	$1, %r13
	movl	%eax, %ecx
	cmpl	%r13d, %eax
	jg	.L4
	movl	36(%rsp), %r8d
	addl	$1, %r15d
	cmpl	%r15d, %r8d
	jle	.L77
	addq	$404, %rbx
	testl	%eax, %eax
	jg	.L40
.L76:
	addl	$1, %r15d
	movq	24(%rsp), %r13
	leal	-1(%rax), %ebp
	cmpl	%r15d, %r8d
	jle	.L8
.L23:
	movl	%eax, %edx
	movl	%eax, %ebx
	movq	16(%rsp), %rdi
	xorl	%r9d, %r9d
	shrl	$2, %edx
	andl	$-4, %ebx
	leal	-1(%rdx), %r12d
	addq	$1, %r12
	salq	$4, %r12
	.p2align 4,,10
	.p2align 3
.L22:
	testl	%eax, %eax
	jle	.L32
	movl	(%rdi), %ecx
	cmpl	$2, %ebp
	jbe	.L44
	leaq	(%r12,%r13), %rsi
	movq	%r13, %rdx
	pxor	%xmm0, %xmm0
	.p2align 4,,10
	.p2align 3
.L28:
	movdqu	(%rdx), %xmm2
	addq	$16, %rdx
	paddd	%xmm2, %xmm0
	cmpq	%rdx, %rsi
	jne	.L28
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	addl	%edx, %ecx
	movl	%ebx, %edx
	cmpl	%ebx, %eax
	je	.L29
.L27:
	movslq	%r9d, %r10
	movslq	%edx, %rsi
	leaq	(%r10,%r10,4), %r11
	leaq	(%r11,%r11,4), %r11
	leaq	(%r10,%r11,4), %r10
	addq	%r10, %rsi
	addl	880(%rsp,%rsi,4), %ecx
	leal	1(%rdx), %esi
	cmpl	%eax, %esi
	jge	.L29
	movslq	%esi, %rsi
	addl	$2, %edx
	addq	%r10, %rsi
	addl	880(%rsp,%rsi,4), %ecx
	cmpl	%eax, %edx
	jge	.L29
	movslq	%edx, %rdx
	addq	%rdx, %r10
	addl	880(%rsp,%r10,4), %ecx
.L29:
	movl	%ecx, (%rdi)
.L32:
	addl	$1, %r9d
	addq	$4, %rdi
	addq	$404, %r13
	cmpl	%r9d, %r8d
	jne	.L22
.L30:
	movq	8(%rsp), %rbx
	movq	%r14, 8(%rsp)
	xorl	%r12d, %r12d
	leaq	.LC3(%rip), %r13
	movq	16(%rsp), %r15
	leaq	.LC2(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L33:
	xorl	%r14d, %r14d
	testl	%eax, %eax
	jle	.L36
	.p2align 4,,10
	.p2align 3
.L34:
	movl	(%rbx,%r14,4), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %r14
	call	__printf_chk@PLT
	cmpl	%r14d, 40(%rsp)
	jg	.L34
.L36:
	movl	(%r15,%r12,4), %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %r12
	addq	$404, %rbx
	call	__printf_chk@PLT
	cmpl	%r12d, 36(%rsp)
	jle	.L70
	movl	40(%rsp), %eax
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L70:
	movq	8(%rsp), %r14
.L35:
	movl	40(%rsp), %eax
	testl	%eax, %eax
	jle	.L46
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	leaq	.LC2(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L38:
	movl	(%r14,%rbx,4), %r12d
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	movl	%r12d, %edx
	addl	%r12d, %r15d
	call	__printf_chk@PLT
	cmpl	%ebx, 40(%rsp)
	jg	.L38
.L37:
	xorl	%eax, %eax
	movl	%r15d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	41688(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L78
	addq	$41704, %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
.L77:
	.cfi_restore_state
	movq	24(%rsp), %r13
	testl	%r8d, %r8d
	jle	.L2
.L8:
	testl	%eax, %eax
	jle	.L79
	leal	-1(%r8), %ebx
	movl	%ebx, 24(%rsp)
	cmpl	$2, %r8d
	jle	.L42
	movl	%eax, %edx
	movl	%eax, %r15d
	movq	8(%rsp), %r10
	leal	-1(%rax), %ebp
	shrl	$2, %edx
	andl	$-4, %r15d
	xorl	%r12d, %r12d
	movl	$1, %r11d
	leal	-1(%rdx), %r9d
	xorl	%esi, %esi
	addq	$1, %r9
	salq	$4, %r9
.L15:
	leaq	404(%r10), %rdi
	movq	%r14, %rcx
	xorl	%edx, %edx
	cmpl	$2, %ebp
	jbe	.L80
	.p2align 4,,10
	.p2align 3
.L11:
	movdqu	(%r10,%rdx), %xmm0
	paddd	(%rcx), %xmm0
	addq	$16, %rcx
	movaps	%xmm0, -16(%rcx)
	movdqu	(%rdi,%rdx), %xmm3
	addq	$16, %rdx
	paddd	%xmm3, %xmm0
	movaps	%xmm0, -16(%rcx)
	cmpq	%rdx, %r9
	jne	.L11
	cmpl	%r15d, %eax
	je	.L12
	movl	%r15d, %ecx
	movl	%r15d, %edx
.L25:
	movl	%eax, %ebx
	subl	%ecx, %ebx
	cmpl	$1, %ebx
	je	.L13
	leaq	(%r14,%rcx,4), %rdi
	addq	%r12, %rcx
	salq	$2, %rcx
	movq	(%rdi), %xmm1
	movq	880(%rsp,%rcx), %xmm0
	paddd	%xmm1, %xmm0
	movq	%xmm0, (%rdi)
	movq	1284(%rsp,%rcx), %xmm1
	movl	%ebx, %ecx
	andl	$-2, %ecx
	paddd	%xmm1, %xmm0
	addl	%ecx, %edx
	movq	%xmm0, (%rdi)
	cmpl	%ecx, %ebx
	je	.L12
.L13:
	movslq	%esi, %rcx
	movslq	%edx, %rdx
	leaq	(%rcx,%rcx,4), %rdi
	leaq	(%rdi,%rdi,4), %rdi
	leaq	(%rcx,%rdi,4), %rcx
	movslq	%r11d, %rdi
	leaq	(%rdi,%rdi,4), %rbx
	addq	%rdx, %rcx
	leaq	(%rbx,%rbx,4), %rbx
	movl	880(%rsp,%rcx,4), %ecx
	addl	48(%rsp,%rdx,4), %ecx
	leaq	(%rdi,%rbx,4), %rdi
	addq	%rdx, %rdi
	addl	880(%rsp,%rdi,4), %ecx
	movl	%ecx, 48(%rsp,%rdx,4)
.L12:
	addl	$2, %esi
	addl	$2, %r11d
	addq	$808, %r10
	addq	$202, %r12
	cmpl	%r11d, 24(%rsp)
	jg	.L15
.L24:
	movl	%eax, %edx
	movslq	%esi, %r11
	movl	%eax, %r12d
	shrl	$2, %edx
	imulq	$404, %r11, %rbx
	andl	$-4, %r12d
	addq	8(%rsp), %rbx
	subl	$1, %edx
	imulq	$101, %r11, %r11
	salq	$4, %rdx
	leaq	64(%rsp,%rdx), %rdi
	cmpl	$2, %ebp
	jbe	.L41
	.p2align 4,,10
	.p2align 3
.L81:
	movq	%rbx, %rcx
	movq	%r14, %rdx
	.p2align 4,,10
	.p2align 3
.L17:
	movdqu	(%rcx), %xmm0
	paddd	(%rdx), %xmm0
	addq	$16, %rdx
	addq	$16, %rcx
	movaps	%xmm0, -16(%rdx)
	cmpq	%rdi, %rdx
	jne	.L17
	cmpl	%r12d, %eax
	je	.L18
	movl	%r12d, %ecx
	movl	%r12d, %edx
.L16:
	movl	%eax, %r9d
	subl	%ecx, %r9d
	cmpl	$1, %r9d
	je	.L19
	leaq	(%r14,%rcx,4), %r10
	addq	%r11, %rcx
	movq	880(%rsp,%rcx,4), %xmm1
	movq	(%r10), %xmm0
	movl	%r9d, %ecx
	andl	$-2, %ecx
	paddd	%xmm1, %xmm0
	addl	%ecx, %edx
	movq	%xmm0, (%r10)
	cmpl	%ecx, %r9d
	je	.L18
.L19:
	movslq	%esi, %rcx
	movslq	%edx, %rdx
	leaq	(%rcx,%rcx,4), %r9
	leaq	(%r9,%r9,4), %r9
	leaq	(%rcx,%r9,4), %rcx
	addq	%rdx, %rcx
	movl	880(%rsp,%rcx,4), %ecx
	addl	%ecx, 48(%rsp,%rdx,4)
.L18:
	addl	$1, %esi
	addq	$404, %rbx
	addq	$101, %r11
	cmpl	%r8d, %esi
	jge	.L23
	cmpl	$2, %ebp
	ja	.L81
.L41:
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	.L16
.L44:
	xorl	%edx, %edx
	jmp	.L27
.L46:
	xorl	%r15d, %r15d
	jmp	.L37
.L2:
	cmpl	$0, 36(%rsp)
	movl	%ecx, %eax
	jg	.L30
	leaq	.LC3(%rip), %r13
	jmp	.L35
.L42:
	xorl	%esi, %esi
	leal	-1(%rax), %ebp
	jmp	.L24
.L80:
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	.L25
.L78:
	call	__stack_chk_fail@PLT
.L79:
	leal	-1(%rax), %ebp
	jmp	.L23
	.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 %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d "
.LC3:
	.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	-40960(%rsp), %r11
	.cfi_def_cfa 11, 41016
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$744, %rsp
	.cfi_def_cfa_offset 41760
	movl	$40804, %edx
	xorl	%esi, %esi
	movq	%fs:40, %rax
	movq	%rax, 41688(%rsp)
	xorl	%eax, %eax
	leaq	880(%rsp), %rax
	leaq	48(%rsp), %r14
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
	call	memset@PLT
	xorl	%eax, %eax
	movl	$50, %ecx
	movq	%r14, %rdi
	rep stosq
	movl	$50, %ecx
	leaq	40(%rsp), %rdx
	leaq	36(%rsp), %rsi
	movl	$0, (%rdi)
	leaq	464(%rsp), %rdi
	movq	%rdi, 16(%rsp)
	rep stosq
	movl	$0, (%rdi)
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %r8d
	movl	40(%rsp), %ecx
	testl	%r8d, %r8d
	jle	.L2
	movq	8(%rsp), %rbx
	movl	40(%rsp), %eax
	xorl	%r15d, %r15d
	leaq	.LC1(%rip), %r12
	movq	%rbx, 24(%rsp)
	testl	%eax, %eax
	jle	.L76
	.p2align 4,,10
	.p2align 3
.L40:
	xorl	%r13d, %r13d
	leaq	44(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	movl	%eax, (%rbx,%r13,4)
	movl	40(%rsp), %eax
	addq	$1, %r13
	movl	%eax, %ecx
	cmpl	%r13d, %eax
	jg	.L4
	movl	36(%rsp), %r8d
	addl	$1, %r15d
	cmpl	%r15d, %r8d
	jle	.L77
	addq	$404, %rbx
	testl	%eax, %eax
	jg	.L40
.L76:
	addl	$1, %r15d
	movq	24(%rsp), %r13
	leal	-1(%rax), %ebp
	cmpl	%r15d, %r8d
	jle	.L8
.L23:
	movl	%eax, %edx
	movl	%eax, %ebx
	movq	16(%rsp), %rdi
	xorl	%r9d, %r9d
	shrl	$2, %edx
	andl	$-4, %ebx
	leal	-1(%rdx), %r12d
	addq	$1, %r12
	salq	$4, %r12
	.p2align 4,,10
	.p2align 3
.L22:
	testl	%eax, %eax
	jle	.L32
	movl	(%rdi), %ecx
	cmpl	$2, %ebp
	jbe	.L44
	leaq	(%r12,%r13), %rsi
	movq	%r13, %rdx
	pxor	%xmm0, %xmm0
	.p2align 4,,10
	.p2align 3
.L28:
	movdqu	(%rdx), %xmm2
	addq	$16, %rdx
	paddd	%xmm2, %xmm0
	cmpq	%rdx, %rsi
	jne	.L28
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	addl	%edx, %ecx
	movl	%ebx, %edx
	cmpl	%ebx, %eax
	je	.L29
.L27:
	movslq	%r9d, %r10
	movslq	%edx, %rsi
	leaq	(%r10,%r10,4), %r11
	leaq	(%r11,%r11,4), %r11
	leaq	(%r10,%r11,4), %r10
	addq	%r10, %rsi
	addl	880(%rsp,%rsi,4), %ecx
	leal	1(%rdx), %esi
	cmpl	%eax, %esi
	jge	.L29
	movslq	%esi, %rsi
	addl	$2, %edx
	addq	%r10, %rsi
	addl	880(%rsp,%rsi,4), %ecx
	cmpl	%eax, %edx
	jge	.L29
	movslq	%edx, %rdx
	addq	%rdx, %r10
	addl	880(%rsp,%r10,4), %ecx
.L29:
	movl	%ecx, (%rdi)
.L32:
	addl	$1, %r9d
	addq	$4, %rdi
	addq	$404, %r13
	cmpl	%r9d, %r8d
	jne	.L22
.L30:
	movq	8(%rsp), %rbx
	movq	%r14, 8(%rsp)
	xorl	%r12d, %r12d
	leaq	.LC3(%rip), %r13
	movq	16(%rsp), %r15
	leaq	.LC2(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L33:
	xorl	%r14d, %r14d
	testl	%eax, %eax
	jle	.L36
	.p2align 4,,10
	.p2align 3
.L34:
	movl	(%rbx,%r14,4), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %r14
	call	__printf_chk@PLT
	cmpl	%r14d, 40(%rsp)
	jg	.L34
.L36:
	movl	(%r15,%r12,4), %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %r12
	addq	$404, %rbx
	call	__printf_chk@PLT
	cmpl	%r12d, 36(%rsp)
	jle	.L70
	movl	40(%rsp), %eax
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L70:
	movq	8(%rsp), %r14
.L35:
	movl	40(%rsp), %eax
	testl	%eax, %eax
	jle	.L46
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	leaq	.LC2(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L38:
	movl	(%r14,%rbx,4), %r12d
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	movl	%r12d, %edx
	addl	%r12d, %r15d
	call	__printf_chk@PLT
	cmpl	%ebx, 40(%rsp)
	jg	.L38
.L37:
	xorl	%eax, %eax
	movl	%r15d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	41688(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L78
	addq	$41704, %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
.L77:
	.cfi_restore_state
	movq	24(%rsp), %r13
	testl	%r8d, %r8d
	jle	.L2
.L8:
	testl	%eax, %eax
	jle	.L79
	leal	-1(%r8), %ebx
	movl	%ebx, 24(%rsp)
	cmpl	$2, %r8d
	jle	.L42
	movl	%eax, %edx
	movl	%eax, %r15d
	movq	8(%rsp), %r10
	leal	-1(%rax), %ebp
	shrl	$2, %edx
	andl	$-4, %r15d
	xorl	%r12d, %r12d
	movl	$1, %r11d
	leal	-1(%rdx), %r9d
	xorl	%esi, %esi
	addq	$1, %r9
	salq	$4, %r9
.L15:
	leaq	404(%r10), %rdi
	movq	%r14, %rcx
	xorl	%edx, %edx
	cmpl	$2, %ebp
	jbe	.L80
	.p2align 4,,10
	.p2align 3
.L11:
	movdqu	(%r10,%rdx), %xmm0
	paddd	(%rcx), %xmm0
	addq	$16, %rcx
	movaps	%xmm0, -16(%rcx)
	movdqu	(%rdi,%rdx), %xmm3
	addq	$16, %rdx
	paddd	%xmm3, %xmm0
	movaps	%xmm0, -16(%rcx)
	cmpq	%rdx, %r9
	jne	.L11
	cmpl	%r15d, %eax
	je	.L12
	movl	%r15d, %ecx
	movl	%r15d, %edx
.L25:
	movl	%eax, %ebx
	subl	%ecx, %ebx
	cmpl	$1, %ebx
	je	.L13
	leaq	(%r14,%rcx,4), %rdi
	addq	%r12, %rcx
	salq	$2, %rcx
	movq	(%rdi), %xmm1
	movq	880(%rsp,%rcx), %xmm0
	paddd	%xmm1, %xmm0
	movq	%xmm0, (%rdi)
	movq	1284(%rsp,%rcx), %xmm1
	movl	%ebx, %ecx
	andl	$-2, %ecx
	paddd	%xmm1, %xmm0
	addl	%ecx, %edx
	movq	%xmm0, (%rdi)
	cmpl	%ecx, %ebx
	je	.L12
.L13:
	movslq	%esi, %rcx
	movslq	%edx, %rdx
	leaq	(%rcx,%rcx,4), %rdi
	leaq	(%rdi,%rdi,4), %rdi
	leaq	(%rcx,%rdi,4), %rcx
	movslq	%r11d, %rdi
	leaq	(%rdi,%rdi,4), %rbx
	addq	%rdx, %rcx
	leaq	(%rbx,%rbx,4), %rbx
	movl	880(%rsp,%rcx,4), %ecx
	addl	48(%rsp,%rdx,4), %ecx
	leaq	(%rdi,%rbx,4), %rdi
	addq	%rdx, %rdi
	addl	880(%rsp,%rdi,4), %ecx
	movl	%ecx, 48(%rsp,%rdx,4)
.L12:
	addl	$2, %esi
	addl	$2, %r11d
	addq	$808, %r10
	addq	$202, %r12
	cmpl	%r11d, 24(%rsp)
	jg	.L15
.L24:
	movl	%eax, %edx
	movslq	%esi, %r11
	movl	%eax, %r12d
	shrl	$2, %edx
	imulq	$404, %r11, %rbx
	andl	$-4, %r12d
	addq	8(%rsp), %rbx
	subl	$1, %edx
	imulq	$101, %r11, %r11
	salq	$4, %rdx
	leaq	64(%rsp,%rdx), %rdi
	cmpl	$2, %ebp
	jbe	.L41
	.p2align 4,,10
	.p2align 3
.L81:
	movq	%rbx, %rcx
	movq	%r14, %rdx
	.p2align 4,,10
	.p2align 3
.L17:
	movdqu	(%rcx), %xmm0
	paddd	(%rdx), %xmm0
	addq	$16, %rdx
	addq	$16, %rcx
	movaps	%xmm0, -16(%rdx)
	cmpq	%rdi, %rdx
	jne	.L17
	cmpl	%r12d, %eax
	je	.L18
	movl	%r12d, %ecx
	movl	%r12d, %edx
.L16:
	movl	%eax, %r9d
	subl	%ecx, %r9d
	cmpl	$1, %r9d
	je	.L19
	leaq	(%r14,%rcx,4), %r10
	addq	%r11, %rcx
	movq	880(%rsp,%rcx,4), %xmm1
	movq	(%r10), %xmm0
	movl	%r9d, %ecx
	andl	$-2, %ecx
	paddd	%xmm1, %xmm0
	addl	%ecx, %edx
	movq	%xmm0, (%r10)
	cmpl	%ecx, %r9d
	je	.L18
.L19:
	movslq	%esi, %rcx
	movslq	%edx, %rdx
	leaq	(%rcx,%rcx,4), %r9
	leaq	(%r9,%r9,4), %r9
	leaq	(%rcx,%r9,4), %rcx
	addq	%rdx, %rcx
	movl	880(%rsp,%rcx,4), %ecx
	addl	%ecx, 48(%rsp,%rdx,4)
.L18:
	addl	$1, %esi
	addq	$404, %rbx
	addq	$101, %r11
	cmpl	%r8d, %esi
	jge	.L23
	cmpl	$2, %ebp
	ja	.L81
.L41:
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	.L16
.L44:
	xorl	%edx, %edx
	jmp	.L27
.L46:
	xorl	%r15d, %r15d
	jmp	.L37
.L2:
	cmpl	$0, 36(%rsp)
	movl	%ecx, %eax
	jg	.L30
	leaq	.LC3(%rip), %r13
	jmp	.L35
.L42:
	xorl	%esi, %esi
	leal	-1(%rax), %ebp
	jmp	.L24
.L80:
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	.L25
.L78:
	call	__stack_chk_fail@PLT
.L79:
	leal	-1(%rax), %ebp
	jmp	.L23
	.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(){
    int a[101][101]={{0}};
    int b[101]={0};
    int d[101]={0};
    int i,j,r,c;
    int x;
    int e=0;

    scanf("%d %d",&r,&c);

    for(j=0;j<r;j++){
        for(i=0;i<c;i++){
            scanf("%d",&x);
        a[j][i]=x;
        }
    }

    for(j=0;j<r;j++){
        for(i=0;i<c;i++){
            b[i]+=a[j][i];
        }
    }

    for(j=0;j<r;j++){
        for(i=0;i<c;i++){
            d[j]+=a[j][i];
        }
    }

    for(j=0;j<r;j++){
        for(i=0;i<c;i++){
            printf("%d ",a[j][i]);
        }
        printf("%d\n",d[j]);
    }
    for(i=0;i<c;i++){
        printf("%d ",b[i]);
        e+=b[i];
    }
    printf("%d\n",e);

    return 0;
}

4 5
1 1 3 4 8
2 2 2 4 5
3 3 0 1 1
2 3 4 4 6
 4 5
1 1 3 4 8
2 2 2 4 5
3 3 0 1 1
2 3 4 8 6
 4 5
1 1 3 4 8
2 2 2 4 5
3 3 0 1 1
2 6 4 8 6
 4 5
1 1 3 4 8
2 2 2 4 5
3 3 0 1 2
2 6 4 8 6
 4 5
2 1 3 4 8
2 2 2 4 5
3 3 0 1 2
2 6 4 8 6
 4 5
1 1 3 1 5
2 2 2 4 5
3 3 0 1 1
2 3 4 4 6
 4 5
1 1 1 4 8
2 2 2 4 5
3 3 0 1 1
2 3 4 4 6
 4 5
1 1 3 4 8
2 2 2 4 5
3 3 0 1 0
2 3 4 8 6
 4 5
1 1 3 4 8
2 2 2 4 5
3 3 0 1 1
2 6 4 1 6
 4 5
1 1 3 8 8
2 2 2 4 5
3 3 0 1 2
2 6 4 8 6

1 1 3 4 8 17
2 2 2 4 5 15
3 3 0 1 1 8
2 3 4 4 6 19
8 9 9 13 20 59
 1 1 3 4 8 17
2 2 2 4 5 15
3 3 0 1 1 8
2 3 4 8 6 23
8 9 9 17 20 63
 1 1 3 4 8 17
2 2 2 4 5 15
3 3 0 1 1 8
2 6 4 8 6 26
8 12 9 17 20 66
 1 1 3 4 8 17
2 2 2 4 5 15
3 3 0 1 2 9
2 6 4 8 6 26
8 12 9 17 21 67
 2 1 3 4 8 18
2 2 2 4 5 15
3 3 0 1 2 9
2 6 4 8 6 26
9 12 9 17 21 68
 1 1 3 1 5 11
2 2 2 4 5 15
3 3 0 1 1 8
2 3 4 4 6 19
8 9 9 10 17 53
 1 1 1 4 8 15
2 2 2 4 5 15
3 3 0 1 1 8
2 3 4 4 6 19
8 9 7 13 20 57
 1 1 3 4 8 17
2 2 2 4 5 15
3 3 0 1 0 7
2 3 4 8 6 23
8 9 9 17 19 62
 1 1 3 4 8 17
2 2 2 4 5 15
3 3 0 1 1 8
2 6 4 1 6 19
8 12 9 10 20 59
 1 1 3 8 8 21
2 2 2 4 5 15
3 3 0 1 2 9
2 6 4 8 6 26
8 12 9 21 21 71

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(){
    int a[101][101]={{0}};
    int b[101]={0};
    int d[101]={0};
    int i,j,r,c;
    int x;
    int e=0;

    scanf("%d %d",&r,&c);

    for(j=0;j<r;j++){
        for(i=0;i<c;i++){
            scanf("%d",&x);
        a[j][i]=x;
        }
    }

    for(j=0;j<r;j++){
        for(i=0;i<c;i++){
            b[i]+=a[j][i];
        }
    }

    for(j=0;j<r;j++){
        for(i=0;i<c;i++){
            d[j]+=a[j][i];
        }
    }

    for(j=0;j<r;j++){
        for(i=0;i<c;i++){
            printf("%d ",a[j][i]);
        }
        printf("%d\n",d[j]);
    }
    for(i=0;i<c;i++){
        printf("%d ",b[i]);
        e+=b[i];
    }
    printf("%d\n",e);

    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d "
.LC3:
	.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	-40960(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$720, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-40816(%rbp), %rax
	movl	$40804, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-41648(%rbp), %rdx
	movl	$0, %eax
	movl	$50, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	leaq	-41232(%rbp), %rdx
	movl	$0, %eax
	movl	$50, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	movl	$0, -41652(%rbp)
	leaq	-41668(%rbp), %rdx
	leaq	-41672(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -41656(%rbp)
	jmp	.L2
.L5:
	movl	$0, -41660(%rbp)
	jmp	.L3
.L4:
	leaq	-41664(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-41664(%rbp), %ecx
	movl	-41660(%rbp), %eax
	movslq	%eax, %rsi
	movl	-41656(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	movl	%ecx, -40816(%rbp,%rax,4)
	addl	$1, -41660(%rbp)
.L3:
	movl	-41668(%rbp), %eax
	cmpl	%eax, -41660(%rbp)
	jl	.L4
	addl	$1, -41656(%rbp)
.L2:
	movl	-41672(%rbp), %eax
	cmpl	%eax, -41656(%rbp)
	jl	.L5
	movl	$0, -41656(%rbp)
	jmp	.L6
.L9:
	movl	$0, -41660(%rbp)
	jmp	.L7
.L8:
	movl	-41660(%rbp), %eax
	cltq
	movl	-41648(%rbp,%rax,4), %ecx
	movl	-41660(%rbp), %eax
	movslq	%eax, %rsi
	movl	-41656(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	movl	-40816(%rbp,%rax,4), %eax
	leal	(%rcx,%rax), %edx
	movl	-41660(%rbp), %eax
	cltq
	movl	%edx, -41648(%rbp,%rax,4)
	addl	$1, -41660(%rbp)
.L7:
	movl	-41668(%rbp), %eax
	cmpl	%eax, -41660(%rbp)
	jl	.L8
	addl	$1, -41656(%rbp)
.L6:
	movl	-41672(%rbp), %eax
	cmpl	%eax, -41656(%rbp)
	jl	.L9
	movl	$0, -41656(%rbp)
	jmp	.L10
.L13:
	movl	$0, -41660(%rbp)
	jmp	.L11
.L12:
	movl	-41656(%rbp), %eax
	cltq
	movl	-41232(%rbp,%rax,4), %ecx
	movl	-41660(%rbp), %eax
	movslq	%eax, %rsi
	movl	-41656(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	movl	-40816(%rbp,%rax,4), %eax
	leal	(%rcx,%rax), %edx
	movl	-41656(%rbp), %eax
	cltq
	movl	%edx, -41232(%rbp,%rax,4)
	addl	$1, -41660(%rbp)
.L11:
	movl	-41668(%rbp), %eax
	cmpl	%eax, -41660(%rbp)
	jl	.L12
	addl	$1, -41656(%rbp)
.L10:
	movl	-41672(%rbp), %eax
	cmpl	%eax, -41656(%rbp)
	jl	.L13
	movl	$0, -41656(%rbp)
	jmp	.L14
.L17:
	movl	$0, -41660(%rbp)
	jmp	.L15
.L16:
	movl	-41660(%rbp), %eax
	movslq	%eax, %rcx
	movl	-41656(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-40816(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -41660(%rbp)
.L15:
	movl	-41668(%rbp), %eax
	cmpl	%eax, -41660(%rbp)
	jl	.L16
	movl	-41656(%rbp), %eax
	cltq
	movl	-41232(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -41656(%rbp)
.L14:
	movl	-41672(%rbp), %eax
	cmpl	%eax, -41656(%rbp)
	jl	.L17
	movl	$0, -41660(%rbp)
	jmp	.L18
.L19:
	movl	-41660(%rbp), %eax
	cltq
	movl	-41648(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-41660(%rbp), %eax
	cltq
	movl	-41648(%rbp,%rax,4), %eax
	addl	%eax, -41652(%rbp)
	addl	$1, -41660(%rbp)
.L18:
	movl	-41668(%rbp), %eax
	cmpl	%eax, -41660(%rbp)
	jl	.L19
	movl	-41652(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	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 %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d "
.LC3:
	.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	-40960(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$720, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-40816(%rbp), %rax
	movl	$40804, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-41648(%rbp), %rdx
	movl	$0, %eax
	movl	$50, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	leaq	-41232(%rbp), %rdx
	movl	$0, %eax
	movl	$50, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	movl	$0, -41652(%rbp)
	leaq	-41668(%rbp), %rdx
	leaq	-41672(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -41656(%rbp)
	jmp	.L2
.L5:
	movl	$0, -41660(%rbp)
	jmp	.L3
.L4:
	leaq	-41664(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-41664(%rbp), %ecx
	movl	-41660(%rbp), %eax
	movslq	%eax, %rsi
	movl	-41656(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	movl	%ecx, -40816(%rbp,%rax,4)
	addl	$1, -41660(%rbp)
.L3:
	movl	-41668(%rbp), %eax
	cmpl	%eax, -41660(%rbp)
	jl	.L4
	addl	$1, -41656(%rbp)
.L2:
	movl	-41672(%rbp), %eax
	cmpl	%eax, -41656(%rbp)
	jl	.L5
	movl	$0, -41656(%rbp)
	jmp	.L6
.L9:
	movl	$0, -41660(%rbp)
	jmp	.L7
.L8:
	movl	-41660(%rbp), %eax
	cltq
	movl	-41648(%rbp,%rax,4), %ecx
	movl	-41660(%rbp), %eax
	movslq	%eax, %rsi
	movl	-41656(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	movl	-40816(%rbp,%rax,4), %eax
	leal	(%rcx,%rax), %edx
	movl	-41660(%rbp), %eax
	cltq
	movl	%edx, -41648(%rbp,%rax,4)
	addl	$1, -41660(%rbp)
.L7:
	movl	-41668(%rbp), %eax
	cmpl	%eax, -41660(%rbp)
	jl	.L8
	addl	$1, -41656(%rbp)
.L6:
	movl	-41672(%rbp), %eax
	cmpl	%eax, -41656(%rbp)
	jl	.L9
	movl	$0, -41656(%rbp)
	jmp	.L10
.L13:
	movl	$0, -41660(%rbp)
	jmp	.L11
.L12:
	movl	-41656(%rbp), %eax
	cltq
	movl	-41232(%rbp,%rax,4), %ecx
	movl	-41660(%rbp), %eax
	movslq	%eax, %rsi
	movl	-41656(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	movl	-40816(%rbp,%rax,4), %eax
	leal	(%rcx,%rax), %edx
	movl	-41656(%rbp), %eax
	cltq
	movl	%edx, -41232(%rbp,%rax,4)
	addl	$1, -41660(%rbp)
.L11:
	movl	-41668(%rbp), %eax
	cmpl	%eax, -41660(%rbp)
	jl	.L12
	addl	$1, -41656(%rbp)
.L10:
	movl	-41672(%rbp), %eax
	cmpl	%eax, -41656(%rbp)
	jl	.L13
	movl	$0, -41656(%rbp)
	jmp	.L14
.L17:
	movl	$0, -41660(%rbp)
	jmp	.L15
.L16:
	movl	-41660(%rbp), %eax
	movslq	%eax, %rcx
	movl	-41656(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-40816(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -41660(%rbp)
.L15:
	movl	-41668(%rbp), %eax
	cmpl	%eax, -41660(%rbp)
	jl	.L16
	movl	-41656(%rbp), %eax
	cltq
	movl	-41232(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -41656(%rbp)
.L14:
	movl	-41672(%rbp), %eax
	cmpl	%eax, -41656(%rbp)
	jl	.L17
	movl	$0, -41660(%rbp)
	jmp	.L18
.L19:
	movl	-41660(%rbp), %eax
	cltq
	movl	-41648(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-41660(%rbp), %eax
	cltq
	movl	-41648(%rbp,%rax,4), %eax
	addl	%eax, -41652(%rbp)
	addl	$1, -41660(%rbp)
.L18:
	movl	-41668(%rbp), %eax
	cmpl	%eax, -41660(%rbp)
	jl	.L19
	movl	-41652(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	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:
