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 r,c,i,sum1,sum2,j,t;
 int h[101][101]={0};
 scanf("%d%d",&r,&c);

 for(i=1;i<=r;i++){
                   for(j=1;j<=c;j++){
                                     scanf("%d",&h[i][j]);
                                     }
                   }
 sum2=0;
 for(i=1;i<=r;i++){
                  sum1=0;
                  for(j=1;j<=c;j++){
                                    sum1+=h[i][j];
                                    printf("%d ",h[i][j]);
                                    }
                   sum2+=sum1;
                   printf("%d\n",sum1);
                   }

  for(i=1;i<=c;i++){
                  sum1=0;
                  for(j=1;j<=r;j++){
                                    sum1+=h[j][i];
                                    }
                   printf("%d ",sum1);
                   }

  printf("%d\n",sum2);
  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	-36864(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3984, %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	-40836(%rbp), %rdx
	leaq	-40840(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -40832(%rbp)
	jmp	.L2
.L5:
	movl	$1, -40820(%rbp)
	jmp	.L3
.L4:
	leaq	-40816(%rbp), %rcx
	movl	-40820(%rbp), %eax
	movslq	%eax, %rsi
	movl	-40832(%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
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -40820(%rbp)
.L3:
	movl	-40836(%rbp), %eax
	cmpl	%eax, -40820(%rbp)
	jle	.L4
	addl	$1, -40832(%rbp)
.L2:
	movl	-40840(%rbp), %eax
	cmpl	%eax, -40832(%rbp)
	jle	.L5
	movl	$0, -40824(%rbp)
	movl	$1, -40832(%rbp)
	jmp	.L6
.L9:
	movl	$0, -40828(%rbp)
	movl	$1, -40820(%rbp)
	jmp	.L7
.L8:
	movl	-40820(%rbp), %eax
	movslq	%eax, %rcx
	movl	-40832(%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
	addl	%eax, -40828(%rbp)
	movl	-40820(%rbp), %eax
	movslq	%eax, %rcx
	movl	-40832(%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, -40820(%rbp)
.L7:
	movl	-40836(%rbp), %eax
	cmpl	%eax, -40820(%rbp)
	jle	.L8
	movl	-40828(%rbp), %eax
	addl	%eax, -40824(%rbp)
	movl	-40828(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -40832(%rbp)
.L6:
	movl	-40840(%rbp), %eax
	cmpl	%eax, -40832(%rbp)
	jle	.L9
	movl	$1, -40832(%rbp)
	jmp	.L10
.L13:
	movl	$0, -40828(%rbp)
	movl	$1, -40820(%rbp)
	jmp	.L11
.L12:
	movl	-40832(%rbp), %eax
	movslq	%eax, %rcx
	movl	-40820(%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
	addl	%eax, -40828(%rbp)
	addl	$1, -40820(%rbp)
.L11:
	movl	-40840(%rbp), %eax
	cmpl	%eax, -40820(%rbp)
	jle	.L12
	movl	-40828(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -40832(%rbp)
.L10:
	movl	-40836(%rbp), %eax
	cmpl	%eax, -40832(%rbp)
	jle	.L13
	movl	-40824(%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	.L15
	call	__stack_chk_fail@PLT
.L15:
	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	-36864(%rsp), %r11
	.cfi_def_cfa 11, 36920
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3992, %rsp
	.cfi_def_cfa_offset 40912
	movl	$40804, %edx
	xorl	%esi, %esi
	movq	%fs:40, %rax
	movq	%rax, 40840(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rax
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
	call	memset@PLT
	leaq	28(%rsp), %rdx
	leaq	24(%rsp), %rsi
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %edx
	testl	%edx, %edx
	jle	.L21
	movl	28(%rsp), %eax
	leaq	440(%rsp), %r14
	movl	$1, %r13d
	leaq	.LC1(%rip), %r12
	testl	%eax, %eax
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L20:
	movq	%r14, %rbp
	movl	$1, %ebx
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jge	.L4
	movl	24(%rsp), %edx
	addl	$1, %r13d
	cmpl	%r13d, %edx
	jl	.L33
	addq	$404, %r14
	testl	%eax, %eax
	jg	.L20
.L7:
	movl	$0, 4(%rsp)
	leaq	436(%rsp), %rbx
	movl	$1, %r12d
	leaq	.LC3(%rip), %r14
	leaq	.LC2(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L10:
	movl	$1, %r13d
	xorl	%r15d, %r15d
	testl	%eax, %eax
	jle	.L12
	.p2align 4,,10
	.p2align 3
.L11:
	movl	(%rbx,%r13,4), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %r13
	addl	%edx, %r15d
	call	__printf_chk@PLT
	cmpl	%r13d, 28(%rsp)
	jge	.L11
	addl	%r15d, 4(%rsp)
.L12:
	movl	%r15d, %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	24(%rsp), %edx
	addl	$1, %r12d
	addq	$404, %rbx
	cmpl	%r12d, %edx
	jl	.L2
	movl	28(%rsp), %eax
	jmp	.L10
.L33:
	testl	%edx, %edx
	jg	.L7
.L21:
	movl	$0, 4(%rsp)
	leaq	.LC3(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L2:
	movl	28(%rsp), %eax
	movl	$1, %ebp
	leaq	.LC2(%rip), %rbx
	testl	%eax, %eax
	jle	.L14
	testl	%edx, %edx
	jle	.L34
	.p2align 4,,10
	.p2align 3
.L16:
	subl	$1, %edx
	movq	8(%rsp), %rax
	leaq	(%rdx,%rdx,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rax,%rbp,4), %rax
	leaq	(%rdx,%rcx,4), %rdx
	addq	%rbp, %rdx
	leaq	436(%rsp,%rdx,4), %rcx
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L15:
	addl	404(%rax), %edx
	addq	$404, %rax
	cmpq	%rax, %rcx
	jne	.L15
.L17:
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__printf_chk@PLT
	cmpl	%ebp, 28(%rsp)
	jl	.L14
	movl	24(%rsp), %edx
	testl	%edx, %edx
	jg	.L16
.L34:
	xorl	%edx, %edx
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L14:
	movl	4(%rsp), %edx
	xorl	%eax, %eax
	movq	%r14, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	40840(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L35
	addq	$40856, %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
.L35:
	.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%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	-36864(%rsp), %r11
	.cfi_def_cfa 11, 36920
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3992, %rsp
	.cfi_def_cfa_offset 40912
	movl	$40804, %edx
	xorl	%esi, %esi
	movq	%fs:40, %rax
	movq	%rax, 40840(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rax
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
	call	memset@PLT
	leaq	28(%rsp), %rdx
	leaq	24(%rsp), %rsi
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %edx
	testl	%edx, %edx
	jle	.L21
	movl	28(%rsp), %eax
	leaq	440(%rsp), %r14
	movl	$1, %r13d
	leaq	.LC1(%rip), %r12
	testl	%eax, %eax
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L20:
	movq	%r14, %rbp
	movl	$1, %ebx
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jge	.L4
	movl	24(%rsp), %edx
	addl	$1, %r13d
	cmpl	%r13d, %edx
	jl	.L33
	addq	$404, %r14
	testl	%eax, %eax
	jg	.L20
.L7:
	movl	$0, 4(%rsp)
	leaq	436(%rsp), %rbx
	movl	$1, %r12d
	leaq	.LC3(%rip), %r14
	leaq	.LC2(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L10:
	movl	$1, %r13d
	xorl	%r15d, %r15d
	testl	%eax, %eax
	jle	.L12
	.p2align 4,,10
	.p2align 3
.L11:
	movl	(%rbx,%r13,4), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %r13
	addl	%edx, %r15d
	call	__printf_chk@PLT
	cmpl	%r13d, 28(%rsp)
	jge	.L11
	addl	%r15d, 4(%rsp)
.L12:
	movl	%r15d, %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	24(%rsp), %edx
	addl	$1, %r12d
	addq	$404, %rbx
	cmpl	%r12d, %edx
	jl	.L2
	movl	28(%rsp), %eax
	jmp	.L10
.L33:
	testl	%edx, %edx
	jg	.L7
.L21:
	movl	$0, 4(%rsp)
	leaq	.LC3(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L2:
	movl	28(%rsp), %eax
	movl	$1, %ebp
	leaq	.LC2(%rip), %rbx
	testl	%eax, %eax
	jle	.L14
	testl	%edx, %edx
	jle	.L34
	.p2align 4,,10
	.p2align 3
.L16:
	subl	$1, %edx
	movq	8(%rsp), %rax
	leaq	(%rdx,%rdx,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rax,%rbp,4), %rax
	leaq	(%rdx,%rcx,4), %rdx
	addq	%rbp, %rdx
	leaq	436(%rsp,%rdx,4), %rcx
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L15:
	addl	404(%rax), %edx
	addq	$404, %rax
	cmpq	%rax, %rcx
	jne	.L15
.L17:
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__printf_chk@PLT
	cmpl	%ebp, 28(%rsp)
	jl	.L14
	movl	24(%rsp), %edx
	testl	%edx, %edx
	jg	.L16
.L34:
	xorl	%edx, %edx
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L14:
	movl	4(%rsp), %edx
	xorl	%eax, %eax
	movq	%r14, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	40840(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L35
	addq	$40856, %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
.L35:
	.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()
{
 int r,c,i,sum1,sum2,j,t;
 int h[101][101]={0};
 scanf("%d%d",&r,&c);

 for(i=1;i<=r;i++){
                   for(j=1;j<=c;j++){
                                     scanf("%d",&h[i][j]);
                                     }
                   }
 sum2=0;
 for(i=1;i<=r;i++){
                  sum1=0;
                  for(j=1;j<=c;j++){
                                    sum1+=h[i][j];
                                    printf("%d ",h[i][j]);
                                    }
                   sum2+=sum1;
                   printf("%d\n",sum1);
                   }

  for(i=1;i<=c;i++){
                  sum1=0;
                  for(j=1;j<=r;j++){
                                    sum1+=h[j][i];
                                    }
                   printf("%d ",sum1);
                   }

  printf("%d\n",sum2);
  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 r,c,i,sum1,sum2,j,t;
 int h[101][101]={0};
 scanf("%d%d",&r,&c);

 for(i=1;i<=r;i++){
                   for(j=1;j<=c;j++){
                                     scanf("%d",&h[i][j]);
                                     }
                   }
 sum2=0;
 for(i=1;i<=r;i++){
                  sum1=0;
                  for(j=1;j<=c;j++){
                                    sum1+=h[i][j];
                                    printf("%d ",h[i][j]);
                                    }
                   sum2+=sum1;
                   printf("%d\n",sum1);
                   }

  for(i=1;i<=c;i++){
                  sum1=0;
                  for(j=1;j<=r;j++){
                                    sum1+=h[j][i];
                                    }
                   printf("%d ",sum1);
                   }

  printf("%d\n",sum2);
  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	-36864(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3984, %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	-40836(%rbp), %rdx
	leaq	-40840(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -40832(%rbp)
	jmp	.L2
.L5:
	movl	$1, -40820(%rbp)
	jmp	.L3
.L4:
	leaq	-40816(%rbp), %rcx
	movl	-40820(%rbp), %eax
	movslq	%eax, %rsi
	movl	-40832(%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
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -40820(%rbp)
.L3:
	movl	-40836(%rbp), %eax
	cmpl	%eax, -40820(%rbp)
	jle	.L4
	addl	$1, -40832(%rbp)
.L2:
	movl	-40840(%rbp), %eax
	cmpl	%eax, -40832(%rbp)
	jle	.L5
	movl	$0, -40824(%rbp)
	movl	$1, -40832(%rbp)
	jmp	.L6
.L9:
	movl	$0, -40828(%rbp)
	movl	$1, -40820(%rbp)
	jmp	.L7
.L8:
	movl	-40820(%rbp), %eax
	movslq	%eax, %rcx
	movl	-40832(%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
	addl	%eax, -40828(%rbp)
	movl	-40820(%rbp), %eax
	movslq	%eax, %rcx
	movl	-40832(%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, -40820(%rbp)
.L7:
	movl	-40836(%rbp), %eax
	cmpl	%eax, -40820(%rbp)
	jle	.L8
	movl	-40828(%rbp), %eax
	addl	%eax, -40824(%rbp)
	movl	-40828(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -40832(%rbp)
.L6:
	movl	-40840(%rbp), %eax
	cmpl	%eax, -40832(%rbp)
	jle	.L9
	movl	$1, -40832(%rbp)
	jmp	.L10
.L13:
	movl	$0, -40828(%rbp)
	movl	$1, -40820(%rbp)
	jmp	.L11
.L12:
	movl	-40832(%rbp), %eax
	movslq	%eax, %rcx
	movl	-40820(%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
	addl	%eax, -40828(%rbp)
	addl	$1, -40820(%rbp)
.L11:
	movl	-40840(%rbp), %eax
	cmpl	%eax, -40820(%rbp)
	jle	.L12
	movl	-40828(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -40832(%rbp)
.L10:
	movl	-40836(%rbp), %eax
	cmpl	%eax, -40832(%rbp)
	jle	.L13
	movl	-40824(%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	.L15
	call	__stack_chk_fail@PLT
.L15:
	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	-36864(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3984, %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	-40836(%rbp), %rdx
	leaq	-40840(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -40832(%rbp)
	jmp	.L2
.L5:
	movl	$1, -40820(%rbp)
	jmp	.L3
.L4:
	leaq	-40816(%rbp), %rcx
	movl	-40820(%rbp), %eax
	movslq	%eax, %rsi
	movl	-40832(%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
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -40820(%rbp)
.L3:
	movl	-40836(%rbp), %eax
	cmpl	%eax, -40820(%rbp)
	jle	.L4
	addl	$1, -40832(%rbp)
.L2:
	movl	-40840(%rbp), %eax
	cmpl	%eax, -40832(%rbp)
	jle	.L5
	movl	$0, -40824(%rbp)
	movl	$1, -40832(%rbp)
	jmp	.L6
.L9:
	movl	$0, -40828(%rbp)
	movl	$1, -40820(%rbp)
	jmp	.L7
.L8:
	movl	-40820(%rbp), %eax
	movslq	%eax, %rcx
	movl	-40832(%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
	addl	%eax, -40828(%rbp)
	movl	-40820(%rbp), %eax
	movslq	%eax, %rcx
	movl	-40832(%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, -40820(%rbp)
.L7:
	movl	-40836(%rbp), %eax
	cmpl	%eax, -40820(%rbp)
	jle	.L8
	movl	-40828(%rbp), %eax
	addl	%eax, -40824(%rbp)
	movl	-40828(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -40832(%rbp)
.L6:
	movl	-40840(%rbp), %eax
	cmpl	%eax, -40832(%rbp)
	jle	.L9
	movl	$1, -40832(%rbp)
	jmp	.L10
.L13:
	movl	$0, -40828(%rbp)
	movl	$1, -40820(%rbp)
	jmp	.L11
.L12:
	movl	-40832(%rbp), %eax
	movslq	%eax, %rcx
	movl	-40820(%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
	addl	%eax, -40828(%rbp)
	addl	$1, -40820(%rbp)
.L11:
	movl	-40840(%rbp), %eax
	cmpl	%eax, -40820(%rbp)
	jle	.L12
	movl	-40828(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -40832(%rbp)
.L10:
	movl	-40836(%rbp), %eax
	cmpl	%eax, -40832(%rbp)
	jle	.L13
	movl	-40824(%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	.L15
	call	__stack_chk_fail@PLT
.L15:
	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:
