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 , c;
  scanf("%d %d",&n ,&c);

  int d[c+1][c+1];
  for(int i = 1;i <= c;i ++){
    for(int j = 1;j <= c;j ++){
      scanf("%d",&d[i][j]);
    }
  }

  int k[n+1][n+1];
  int waru1[31] = {0} , waru2[31] = {0} , waru0[31] = {0};
  for(int i = 1;i <= n;i ++){
    for(int j = 1;j <= n;j ++){
      scanf("%d",&k[i][j]);
      if((i+j)%3 == 1){
        waru1[k[i][j]] ++;
      }
      else if((i+j)%3 == 2){
        waru2[k[i][j]] ++;
      }
      else{
        waru0[k[i][j]] ++;
      }
    }
  }

  /*while(flag == 1){
    flag = 0;
    for(int i = 1;i <= c;i ++){
      for(int j = 1;j <= c;j ++){
        for(int k = 1;k <= c;k ++){
          if(d[i][j] > d[i][k] + d[k][j]){
            d[i][j] = d[i][k] + d[k][j];
            flag = 1;
          }
        }
      }
    }
  }*/

  int min = 1000000000;
  for(int i = 1;i <= c;i ++){
    for(int j = 1;j <= c;j ++){
      for(int x = 1;x <= c;x ++){
        if(i != j && j != x && x != i){
          int tas = 0;
          for(int y = 1;y <= c;y ++){
            tas += waru1[y] * d[y][i];
            tas += waru2[y] * d[y][j];
            tas += waru0[y] * d[y][x];
          }
          
          if(min > tas){
            min = tas;
          }
        }
      }
    }
  }

  printf("%d\n",min);

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$648, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, -680(%rbp)
	leaq	-540(%rbp), %rdx
	leaq	-544(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-540(%rbp), %eax
	leal	1(%rax), %esi
	movl	-540(%rbp), %eax
	leal	1(%rax), %edi
	movslq	%esi, %rax
	subq	$1, %rax
	movq	%rax, -496(%rbp)
	movslq	%esi, %rax
	movq	%rax, -560(%rbp)
	movq	$0, -552(%rbp)
	movslq	%esi, %rax
	salq	$2, %rax
	movq	%rax, -560(%rbp)
	movslq	%edi, %rax
	subq	$1, %rax
	movq	%rax, -488(%rbp)
	movslq	%esi, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	movslq	%edi, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	movq	%r15, %rdx
	imulq	%r12, %rdx
	movq	%r13, %rax
	imulq	%r14, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r14, %rax
	mulq	%r12
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rax
	movq	%rax, -576(%rbp)
	movq	$0, -568(%rbp)
	movslq	%edi, %rax
	movq	%rax, -592(%rbp)
	movq	$0, -584(%rbp)
	movq	-576(%rbp), %r8
	movq	-568(%rbp), %r9
	movq	%r9, %rdx
	movq	-592(%rbp), %r10
	movq	-584(%rbp), %r11
	imulq	%r10, %rdx
	movq	%r11, %rax
	imulq	%r8, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r8, %rax
	mulq	%r10
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rdx
	movslq	%edi, %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -480(%rbp)
	movl	$1, -536(%rbp)
	jmp	.L5
.L8:
	movl	$1, -532(%rbp)
	jmp	.L6
.L7:
	movq	-560(%rbp), %rdx
	shrq	$2, %rdx
	movl	-532(%rbp), %eax
	movslq	%eax, %rcx
	movl	-536(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	movq	-480(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -532(%rbp)
.L6:
	movl	-540(%rbp), %eax
	cmpl	%eax, -532(%rbp)
	jle	.L7
	addl	$1, -536(%rbp)
.L5:
	movl	-540(%rbp), %eax
	cmpl	%eax, -536(%rbp)
	jle	.L8
	movl	-544(%rbp), %eax
	leal	1(%rax), %esi
	movl	-544(%rbp), %eax
	leal	1(%rax), %edi
	movslq	%esi, %rax
	subq	$1, %rax
	movq	%rax, -472(%rbp)
	movslq	%esi, %rax
	movq	%rax, -672(%rbp)
	movq	$0, -664(%rbp)
	movslq	%esi, %rax
	leaq	0(,%rax,4), %rbx
	movslq	%edi, %rax
	subq	$1, %rax
	movq	%rax, -464(%rbp)
	movslq	%esi, %rax
	movq	%rax, -608(%rbp)
	movq	$0, -600(%rbp)
	movslq	%edi, %rax
	movq	%rax, -624(%rbp)
	movq	$0, -616(%rbp)
	movq	-608(%rbp), %r10
	movq	-600(%rbp), %r11
	movq	%r11, %rdx
	movq	-624(%rbp), %r8
	movq	-616(%rbp), %r9
	imulq	%r8, %rdx
	movq	%r9, %rax
	imulq	%r10, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r10, %rax
	mulq	%r8
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rax
	movq	%rax, -640(%rbp)
	movq	$0, -632(%rbp)
	movslq	%edi, %rax
	movq	%rax, -656(%rbp)
	movq	$0, -648(%rbp)
	movq	-640(%rbp), %r8
	movq	-632(%rbp), %r9
	movq	%r9, %rdx
	movq	-656(%rbp), %r14
	movq	-648(%rbp), %r15
	imulq	%r14, %rdx
	movq	%r15, %rax
	imulq	%r8, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r8, %rax
	mulq	%r14
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rdx
	movslq	%edi, %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L9:
	cmpq	%rdx, %rsp
	je	.L10
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L9
.L10:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L11
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L11:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -456(%rbp)
	leaq	-448(%rbp), %rdx
	movl	$0, %eax
	movl	$15, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	leaq	-320(%rbp), %rdx
	movl	$0, %eax
	movl	$15, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	leaq	-192(%rbp), %rdx
	movl	$0, %eax
	movl	$15, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	movl	$1, -528(%rbp)
	jmp	.L12
.L18:
	movl	$1, -524(%rbp)
	jmp	.L13
.L17:
	movq	%rbx, %rdx
	shrq	$2, %rdx
	movl	-524(%rbp), %eax
	movslq	%eax, %rcx
	movl	-528(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	movq	-456(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-528(%rbp), %edx
	movl	-524(%rbp), %eax
	addl	%eax, %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	cmpl	$1, %eax
	jne	.L14
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-456(%rbp), %rax
	movl	-524(%rbp), %edx
	movslq	%edx, %rsi
	movl	-528(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rdx
	movl	-448(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -448(%rbp,%rax,4)
	jmp	.L15
.L14:
	movl	-528(%rbp), %edx
	movl	-524(%rbp), %eax
	addl	%eax, %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	cmpl	$2, %eax
	jne	.L16
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-456(%rbp), %rax
	movl	-524(%rbp), %edx
	movslq	%edx, %rsi
	movl	-528(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rdx
	movl	-320(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -320(%rbp,%rax,4)
	jmp	.L15
.L16:
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-456(%rbp), %rax
	movl	-524(%rbp), %edx
	movslq	%edx, %rsi
	movl	-528(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rdx
	movl	-192(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -192(%rbp,%rax,4)
.L15:
	addl	$1, -524(%rbp)
.L13:
	movl	-544(%rbp), %eax
	cmpl	%eax, -524(%rbp)
	jle	.L17
	addl	$1, -528(%rbp)
.L12:
	movl	-544(%rbp), %eax
	cmpl	%eax, -528(%rbp)
	jle	.L18
	movl	$1000000000, -520(%rbp)
	movl	$1, -516(%rbp)
	jmp	.L19
.L27:
	movl	$1, -512(%rbp)
	jmp	.L20
.L26:
	movl	$1, -508(%rbp)
	jmp	.L21
.L25:
	movl	-516(%rbp), %eax
	cmpl	-512(%rbp), %eax
	je	.L22
	movl	-512(%rbp), %eax
	cmpl	-508(%rbp), %eax
	je	.L22
	movl	-508(%rbp), %eax
	cmpl	-516(%rbp), %eax
	je	.L22
	movl	$0, -504(%rbp)
	movl	$1, -500(%rbp)
	jmp	.L23
.L24:
	movl	-500(%rbp), %eax
	cltq
	movl	-448(%rbp,%rax,4), %edx
	movq	-560(%rbp), %rbx
	movq	%rbx, %rsi
	shrq	$2, %rsi
	movq	-480(%rbp), %rax
	movl	-516(%rbp), %ecx
	movslq	%ecx, %rdi
	movl	-500(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rsi, %rcx
	addq	%rdi, %rcx
	movl	(%rax,%rcx,4), %eax
	imull	%edx, %eax
	addl	%eax, -504(%rbp)
	movl	-500(%rbp), %eax
	cltq
	movl	-320(%rbp,%rax,4), %edx
	movq	%rbx, %rsi
	shrq	$2, %rsi
	movq	-480(%rbp), %rax
	movl	-512(%rbp), %ecx
	movslq	%ecx, %rdi
	movl	-500(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rsi, %rcx
	addq	%rdi, %rcx
	movl	(%rax,%rcx,4), %eax
	imull	%edx, %eax
	addl	%eax, -504(%rbp)
	movl	-500(%rbp), %eax
	cltq
	movl	-192(%rbp,%rax,4), %edx
	shrq	$2, %rbx
	movq	%rbx, %rsi
	movq	-480(%rbp), %rax
	movl	-508(%rbp), %ecx
	movslq	%ecx, %rdi
	movl	-500(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rsi, %rcx
	addq	%rdi, %rcx
	movl	(%rax,%rcx,4), %eax
	imull	%edx, %eax
	addl	%eax, -504(%rbp)
	addl	$1, -500(%rbp)
.L23:
	movl	-540(%rbp), %eax
	cmpl	%eax, -500(%rbp)
	jle	.L24
	movl	-520(%rbp), %eax
	cmpl	-504(%rbp), %eax
	jle	.L22
	movl	-504(%rbp), %eax
	movl	%eax, -520(%rbp)
.L22:
	addl	$1, -508(%rbp)
.L21:
	movl	-540(%rbp), %eax
	cmpl	%eax, -508(%rbp)
	jle	.L25
	addl	$1, -512(%rbp)
.L20:
	movl	-540(%rbp), %eax
	cmpl	%eax, -512(%rbp)
	jle	.L26
	addl	$1, -516(%rbp)
.L19:
	movl	-540(%rbp), %eax
	cmpl	%eax, -516(%rbp)
	jle	.L27
	movl	-520(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-680(%rbp), %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L29
	call	__stack_chk_fail@PLT
.L29:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-452(%rbp), %rdx
	leaq	-456(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$488, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-452(%rbp), %edx
	movq	%rsp, %rsi
	leal	1(%rdx), %eax
	cltq
	leaq	0(,%rax,4), %rdi
	imulq	%rax, %rax
	movq	%rdi, -488(%rbp)
	leaq	15(,%rax,4), %rcx
	movq	%rcx, %rax
	andq	$-4096, %rcx
	subq	%rcx, %rsi
	andq	$-16, %rax
	cmpq	%rsi, %rsp
	je	.L3
.L51:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L51
.L3:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	jne	.L52
.L4:
	movq	%rsp, %rbx
	testl	%edx, %edx
	jle	.L5
	movq	-488(%rbp), %rax
	movq	%rbx, -496(%rbp)
	movl	$1, %r12d
	leaq	.LC1(%rip), %r14
	shrq	$2, %rax
	movq	%rax, -472(%rbp)
	movq	%rax, %r13
	leaq	4(%rbx), %rax
	movq	%rax, -480(%rbp)
.L26:
	movq	-480(%rbp), %rax
	movl	$1, %ebx
	leaq	(%rax,%r13,4), %r15
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r15, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	-452(%rbp), %edx
	addq	$4, %r15
	cmpl	%ebx, %edx
	jge	.L6
	addl	$1, %r12d
	cmpl	%r12d, %edx
	jl	.L53
	addq	-472(%rbp), %r13
	jmp	.L26
.L53:
	movq	-496(%rbp), %rbx
.L5:
	movl	-456(%rbp), %r9d
	movq	%rsp, %rsi
	leal	1(%r9), %eax
	cltq
	leaq	0(,%rax,4), %r10
	imulq	%rax, %rax
	leaq	15(,%rax,4), %rcx
	movq	%rcx, %rax
	andq	$-4096, %rcx
	subq	%rcx, %rsi
	andq	$-16, %rax
	cmpq	%rsi, %rsp
	je	.L9
.L54:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L54
.L9:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	jne	.L55
.L10:
	leaq	-448(%rbp), %r8
	xorl	%eax, %eax
	movl	$15, %ecx
	movq	%rsp, %rsi
	movq	%r8, %rdi
	leaq	-320(%rbp), %r12
	leaq	-192(%rbp), %r13
	rep stosq
	movl	$15, %ecx
	movl	$0, (%rdi)
	movq	%r12, %rdi
	rep stosq
	movl	$15, %ecx
	movl	$0, (%rdi)
	movq	%r13, %rdi
	rep stosq
	movl	$0, (%rdi)
	testl	%r9d, %r9d
	jle	.L11
	shrq	$2, %r10
	leaq	4(%rsi), %rax
	movq	%r12, -504(%rbp)
	movl	$1, %edi
	movq	%r10, -472(%rbp)
	movq	%r10, %r15
	leaq	.LC1(%rip), %r14
	movq	%rax, -480(%rbp)
	movq	%r13, -512(%rbp)
	movq	%r8, -520(%rbp)
	movq	%rbx, -496(%rbp)
	movl	%edi, %ebx
.L24:
	movq	-480(%rbp), %rax
	movl	$1, %r12d
	leaq	(%rax,%r15,4), %r13
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L12:
	movl	0(%r13), %edx
	cmpl	$2, %eax
	movslq	%edx, %rax
	je	.L56
	addl	$1, -192(%rbp,%rax,4)
.L13:
	movl	-456(%rbp), %eax
	addl	$1, %r12d
	addq	$4, %r13
	cmpl	%r12d, %eax
	jl	.L57
.L15:
	movq	%r14, %rdi
	movq	%r13, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leal	(%r12,%rbx), %eax
	movl	$2863311531, %edi
	movq	%rax, %rdx
	imulq	%rdi, %rax
	shrq	$33, %rax
	leal	(%rax,%rax,2), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	cmpl	$1, %eax
	jne	.L12
	movslq	0(%r13), %rax
	addl	$1, -448(%rbp,%rax,4)
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L56:
	addl	$1, -320(%rbp,%rax,4)
	jmp	.L13
.L57:
	addl	$1, %ebx
	cmpl	%ebx, %eax
	jl	.L58
	addq	-472(%rbp), %r15
	jmp	.L24
.L58:
	movq	-496(%rbp), %rbx
	movq	-504(%rbp), %r12
	movq	-512(%rbp), %r13
	movq	-520(%rbp), %r8
	movl	-452(%rbp), %edx
.L11:
	testl	%edx, %edx
	jle	.L29
	leal	1(%rdx), %r14d
	movq	-488(%rbp), %r11
	movl	$1, -480(%rbp)
	movl	%r14d, -488(%rbp)
	movl	$1000000000, -504(%rbp)
	shrq	$2, %r11
.L18:
	movl	$1, -472(%rbp)
	movslq	-480(%rbp), %r10
	.p2align 4,,10
	.p2align 3
.L23:
	movslq	-472(%rbp), %r9
	cmpl	%r9d, -480(%rbp)
	movl	$1, %esi
	setne	-496(%rbp)
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L19:
	addl	$1, %esi
	cmpl	-488(%rbp), %esi
	je	.L59
.L21:
	cmpl	%esi, -480(%rbp)
	setne	%dl
	cmpl	%esi, -472(%rbp)
	setne	%al
	testb	%al, %dl
	je	.L19
	cmpb	$0, -496(%rbp)
	je	.L19
	movl	%esi, -512(%rbp)
	movl	$1, %ecx
	xorl	%eax, %eax
	movslq	%esi, %rdi
	.p2align 4,,10
	.p2align 3
.L20:
	movslq	%ecx, %rdx
	movl	(%r8,%rcx,4), %esi
	imulq	%r11, %rdx
	leaq	(%r10,%rdx), %r15
	imull	(%rbx,%r15,4), %esi
	leaq	(%r9,%rdx), %r15
	addq	%rdi, %rdx
	addl	%esi, %eax
	movl	(%r12,%rcx,4), %esi
	imull	(%rbx,%r15,4), %esi
	movl	%esi, %r15d
	addl	%eax, %r15d
	movl	0(%r13,%rcx,4), %eax
	imull	(%rbx,%rdx,4), %eax
	addq	$1, %rcx
	addl	%r15d, %eax
	cmpq	%rcx, %r14
	jne	.L20
	movl	-504(%rbp), %edi
	movl	-512(%rbp), %esi
	cmpl	%eax, %edi
	cmovle	%edi, %eax
	addl	$1, %esi
	movl	%eax, -504(%rbp)
	cmpl	-488(%rbp), %esi
	jne	.L21
.L59:
	addl	$1, -472(%rbp)
	movl	-472(%rbp), %eax
	cmpl	-488(%rbp), %eax
	jne	.L23
	addl	$1, -480(%rbp)
	movl	-480(%rbp), %eax
	cmpl	-488(%rbp), %eax
	jne	.L18
.L17:
	movl	-504(%rbp), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L60
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L55:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rax)
	jmp	.L10
.L52:
	orq	$0, -8(%rsp,%rax)
	jmp	.L4
.L29:
	movl	$1000000000, -504(%rbp)
	jmp	.L17
.L60:
	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\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-452(%rbp), %rdx
	leaq	-456(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$488, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-452(%rbp), %edx
	movq	%rsp, %rsi
	leal	1(%rdx), %eax
	cltq
	leaq	0(,%rax,4), %rdi
	imulq	%rax, %rax
	movq	%rdi, -488(%rbp)
	leaq	15(,%rax,4), %rcx
	movq	%rcx, %rax
	andq	$-4096, %rcx
	subq	%rcx, %rsi
	andq	$-16, %rax
	cmpq	%rsi, %rsp
	je	.L3
.L51:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L51
.L3:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	jne	.L52
.L4:
	movq	%rsp, %rbx
	testl	%edx, %edx
	jle	.L5
	movq	-488(%rbp), %rax
	movq	%rbx, -496(%rbp)
	movl	$1, %r12d
	leaq	.LC1(%rip), %r14
	shrq	$2, %rax
	movq	%rax, -472(%rbp)
	movq	%rax, %r13
	leaq	4(%rbx), %rax
	movq	%rax, -480(%rbp)
.L26:
	movq	-480(%rbp), %rax
	movl	$1, %ebx
	leaq	(%rax,%r13,4), %r15
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r15, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	-452(%rbp), %edx
	addq	$4, %r15
	cmpl	%ebx, %edx
	jge	.L6
	addl	$1, %r12d
	cmpl	%r12d, %edx
	jl	.L53
	addq	-472(%rbp), %r13
	jmp	.L26
.L53:
	movq	-496(%rbp), %rbx
.L5:
	movl	-456(%rbp), %r9d
	movq	%rsp, %rsi
	leal	1(%r9), %eax
	cltq
	leaq	0(,%rax,4), %r10
	imulq	%rax, %rax
	leaq	15(,%rax,4), %rcx
	movq	%rcx, %rax
	andq	$-4096, %rcx
	subq	%rcx, %rsi
	andq	$-16, %rax
	cmpq	%rsi, %rsp
	je	.L9
.L54:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L54
.L9:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	jne	.L55
.L10:
	leaq	-448(%rbp), %r8
	xorl	%eax, %eax
	movl	$15, %ecx
	movq	%rsp, %rsi
	movq	%r8, %rdi
	leaq	-320(%rbp), %r12
	leaq	-192(%rbp), %r13
	rep stosq
	movl	$15, %ecx
	movl	$0, (%rdi)
	movq	%r12, %rdi
	rep stosq
	movl	$15, %ecx
	movl	$0, (%rdi)
	movq	%r13, %rdi
	rep stosq
	movl	$0, (%rdi)
	testl	%r9d, %r9d
	jle	.L11
	shrq	$2, %r10
	leaq	4(%rsi), %rax
	movq	%r12, -504(%rbp)
	movl	$1, %edi
	movq	%r10, -472(%rbp)
	movq	%r10, %r15
	leaq	.LC1(%rip), %r14
	movq	%rax, -480(%rbp)
	movq	%r13, -512(%rbp)
	movq	%r8, -520(%rbp)
	movq	%rbx, -496(%rbp)
	movl	%edi, %ebx
.L24:
	movq	-480(%rbp), %rax
	movl	$1, %r12d
	leaq	(%rax,%r15,4), %r13
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L12:
	movl	0(%r13), %edx
	cmpl	$2, %eax
	movslq	%edx, %rax
	je	.L56
	addl	$1, -192(%rbp,%rax,4)
.L13:
	movl	-456(%rbp), %eax
	addl	$1, %r12d
	addq	$4, %r13
	cmpl	%r12d, %eax
	jl	.L57
.L15:
	movq	%r14, %rdi
	movq	%r13, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leal	(%r12,%rbx), %eax
	movl	$2863311531, %edi
	movq	%rax, %rdx
	imulq	%rdi, %rax
	shrq	$33, %rax
	leal	(%rax,%rax,2), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	cmpl	$1, %eax
	jne	.L12
	movslq	0(%r13), %rax
	addl	$1, -448(%rbp,%rax,4)
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L56:
	addl	$1, -320(%rbp,%rax,4)
	jmp	.L13
.L57:
	addl	$1, %ebx
	cmpl	%ebx, %eax
	jl	.L58
	addq	-472(%rbp), %r15
	jmp	.L24
.L58:
	movq	-496(%rbp), %rbx
	movq	-504(%rbp), %r12
	movq	-512(%rbp), %r13
	movq	-520(%rbp), %r8
	movl	-452(%rbp), %edx
.L11:
	testl	%edx, %edx
	jle	.L29
	leal	1(%rdx), %r14d
	movq	-488(%rbp), %r11
	movl	$1, -480(%rbp)
	movl	%r14d, -488(%rbp)
	movl	$1000000000, -504(%rbp)
	shrq	$2, %r11
.L18:
	movl	$1, -472(%rbp)
	movslq	-480(%rbp), %r10
	.p2align 4,,10
	.p2align 3
.L23:
	movslq	-472(%rbp), %r9
	cmpl	%r9d, -480(%rbp)
	movl	$1, %esi
	setne	-496(%rbp)
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L19:
	addl	$1, %esi
	cmpl	-488(%rbp), %esi
	je	.L59
.L21:
	cmpl	%esi, -480(%rbp)
	setne	%dl
	cmpl	%esi, -472(%rbp)
	setne	%al
	testb	%al, %dl
	je	.L19
	cmpb	$0, -496(%rbp)
	je	.L19
	movl	%esi, -512(%rbp)
	movl	$1, %ecx
	xorl	%eax, %eax
	movslq	%esi, %rdi
	.p2align 4,,10
	.p2align 3
.L20:
	movslq	%ecx, %rdx
	movl	(%r8,%rcx,4), %esi
	imulq	%r11, %rdx
	leaq	(%r10,%rdx), %r15
	imull	(%rbx,%r15,4), %esi
	leaq	(%r9,%rdx), %r15
	addq	%rdi, %rdx
	addl	%esi, %eax
	movl	(%r12,%rcx,4), %esi
	imull	(%rbx,%r15,4), %esi
	movl	%esi, %r15d
	addl	%eax, %r15d
	movl	0(%r13,%rcx,4), %eax
	imull	(%rbx,%rdx,4), %eax
	addq	$1, %rcx
	addl	%r15d, %eax
	cmpq	%rcx, %r14
	jne	.L20
	movl	-504(%rbp), %edi
	movl	-512(%rbp), %esi
	cmpl	%eax, %edi
	cmovle	%edi, %eax
	addl	$1, %esi
	movl	%eax, -504(%rbp)
	cmpl	-488(%rbp), %esi
	jne	.L21
.L59:
	addl	$1, -472(%rbp)
	movl	-472(%rbp), %eax
	cmpl	-488(%rbp), %eax
	jne	.L23
	addl	$1, -480(%rbp)
	movl	-480(%rbp), %eax
	cmpl	-488(%rbp), %eax
	jne	.L18
.L17:
	movl	-504(%rbp), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L60
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L55:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rax)
	jmp	.L10
.L52:
	orq	$0, -8(%rsp,%rax)
	jmp	.L4
.L29:
	movl	$1000000000, -504(%rbp)
	jmp	.L17
.L60:
	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 , c;
  scanf("%d %d",&n ,&c);

  int d[c+1][c+1];
  for(int i = 1;i <= c;i ++){
    for(int j = 1;j <= c;j ++){
      scanf("%d",&d[i][j]);
    }
  }

  int k[n+1][n+1];
  int waru1[31] = {0} , waru2[31] = {0} , waru0[31] = {0};
  for(int i = 1;i <= n;i ++){
    for(int j = 1;j <= n;j ++){
      scanf("%d",&k[i][j]);
      if((i+j)%3 == 1){
        waru1[k[i][j]] ++;
      }
      else if((i+j)%3 == 2){
        waru2[k[i][j]] ++;
      }
      else{
        waru0[k[i][j]] ++;
      }
    }
  }

  /*while(flag == 1){
    flag = 0;
    for(int i = 1;i <= c;i ++){
      for(int j = 1;j <= c;j ++){
        for(int k = 1;k <= c;k ++){
          if(d[i][j] > d[i][k] + d[k][j]){
            d[i][j] = d[i][k] + d[k][j];
            flag = 1;
          }
        }
      }
    }
  }*/

  int min = 1000000000;
  for(int i = 1;i <= c;i ++){
    for(int j = 1;j <= c;j ++){
      for(int x = 1;x <= c;x ++){
        if(i != j && j != x && x != i){
          int tas = 0;
          for(int y = 1;y <= c;y ++){
            tas += waru1[y] * d[y][i];
            tas += waru2[y] * d[y][j];
            tas += waru0[y] * d[y][x];
          }
          
          if(min > tas){
            min = tas;
          }
        }
      }
    }
  }

  printf("%d\n",min);

  return 0;
}
2 3
0 1 1
1 1 1
1 4 0
1 2
3 3
 2 3
0 1 1
1 1 1
2 4 0
1 2
3 3
 2 3
0 1 1
1 0 1
1 4 0
1 2
1 3
 2 3
0 2 1
1 1 1
2 4 0
1 2
3 3
 2 3
0 1 1
1 0 1
1 4 0
1 2
2 3
 2 3
0 1 1
1 0 1
1 4 -1
1 2
2 3
 2 3
0 2 1
1 1 1
2 2 -1
1 2
3 3
 4 3
0 0 71
81 0 53
14 92 0
1 1 2 1
2 1 1 2
2 2 1 3
1 1 2 2
 2 3
1 3 1
1 1 1
2 4 0
1 2
3 3
 2 3
-2 1 1
1 0 1
1 4 0
1 2
2 3

3
 4
 1
 5
 0
 -1
 2
 392
 6
 -2

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 , c;
  scanf("%d %d",&n ,&c);

  int d[c+1][c+1];
  for(int i = 1;i <= c;i ++){
    for(int j = 1;j <= c;j ++){
      scanf("%d",&d[i][j]);
    }
  }

  int k[n+1][n+1];
  int waru1[31] = {0} , waru2[31] = {0} , waru0[31] = {0};
  for(int i = 1;i <= n;i ++){
    for(int j = 1;j <= n;j ++){
      scanf("%d",&k[i][j]);
      if((i+j)%3 == 1){
        waru1[k[i][j]] ++;
      }
      else if((i+j)%3 == 2){
        waru2[k[i][j]] ++;
      }
      else{
        waru0[k[i][j]] ++;
      }
    }
  }

  /*while(flag == 1){
    flag = 0;
    for(int i = 1;i <= c;i ++){
      for(int j = 1;j <= c;j ++){
        for(int k = 1;k <= c;k ++){
          if(d[i][j] > d[i][k] + d[k][j]){
            d[i][j] = d[i][k] + d[k][j];
            flag = 1;
          }
        }
      }
    }
  }*/

  int min = 1000000000;
  for(int i = 1;i <= c;i ++){
    for(int j = 1;j <= c;j ++){
      for(int x = 1;x <= c;x ++){
        if(i != j && j != x && x != i){
          int tas = 0;
          for(int y = 1;y <= c;y ++){
            tas += waru1[y] * d[y][i];
            tas += waru2[y] * d[y][j];
            tas += waru0[y] * d[y][x];
          }
          
          if(min > tas){
            min = tas;
          }
        }
      }
    }
  }

  printf("%d\n",min);

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$648, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, -680(%rbp)
	leaq	-540(%rbp), %rdx
	leaq	-544(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-540(%rbp), %eax
	leal	1(%rax), %esi
	movl	-540(%rbp), %eax
	leal	1(%rax), %edi
	movslq	%esi, %rax
	subq	$1, %rax
	movq	%rax, -496(%rbp)
	movslq	%esi, %rax
	movq	%rax, -560(%rbp)
	movq	$0, -552(%rbp)
	movslq	%esi, %rax
	salq	$2, %rax
	movq	%rax, -560(%rbp)
	movslq	%edi, %rax
	subq	$1, %rax
	movq	%rax, -488(%rbp)
	movslq	%esi, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	movslq	%edi, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	movq	%r15, %rdx
	imulq	%r12, %rdx
	movq	%r13, %rax
	imulq	%r14, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r14, %rax
	mulq	%r12
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rax
	movq	%rax, -576(%rbp)
	movq	$0, -568(%rbp)
	movslq	%edi, %rax
	movq	%rax, -592(%rbp)
	movq	$0, -584(%rbp)
	movq	-576(%rbp), %r8
	movq	-568(%rbp), %r9
	movq	%r9, %rdx
	movq	-592(%rbp), %r10
	movq	-584(%rbp), %r11
	imulq	%r10, %rdx
	movq	%r11, %rax
	imulq	%r8, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r8, %rax
	mulq	%r10
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rdx
	movslq	%edi, %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -480(%rbp)
	movl	$1, -536(%rbp)
	jmp	.L5
.L8:
	movl	$1, -532(%rbp)
	jmp	.L6
.L7:
	movq	-560(%rbp), %rdx
	shrq	$2, %rdx
	movl	-532(%rbp), %eax
	movslq	%eax, %rcx
	movl	-536(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	movq	-480(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -532(%rbp)
.L6:
	movl	-540(%rbp), %eax
	cmpl	%eax, -532(%rbp)
	jle	.L7
	addl	$1, -536(%rbp)
.L5:
	movl	-540(%rbp), %eax
	cmpl	%eax, -536(%rbp)
	jle	.L8
	movl	-544(%rbp), %eax
	leal	1(%rax), %esi
	movl	-544(%rbp), %eax
	leal	1(%rax), %edi
	movslq	%esi, %rax
	subq	$1, %rax
	movq	%rax, -472(%rbp)
	movslq	%esi, %rax
	movq	%rax, -672(%rbp)
	movq	$0, -664(%rbp)
	movslq	%esi, %rax
	leaq	0(,%rax,4), %rbx
	movslq	%edi, %rax
	subq	$1, %rax
	movq	%rax, -464(%rbp)
	movslq	%esi, %rax
	movq	%rax, -608(%rbp)
	movq	$0, -600(%rbp)
	movslq	%edi, %rax
	movq	%rax, -624(%rbp)
	movq	$0, -616(%rbp)
	movq	-608(%rbp), %r10
	movq	-600(%rbp), %r11
	movq	%r11, %rdx
	movq	-624(%rbp), %r8
	movq	-616(%rbp), %r9
	imulq	%r8, %rdx
	movq	%r9, %rax
	imulq	%r10, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r10, %rax
	mulq	%r8
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rax
	movq	%rax, -640(%rbp)
	movq	$0, -632(%rbp)
	movslq	%edi, %rax
	movq	%rax, -656(%rbp)
	movq	$0, -648(%rbp)
	movq	-640(%rbp), %r8
	movq	-632(%rbp), %r9
	movq	%r9, %rdx
	movq	-656(%rbp), %r14
	movq	-648(%rbp), %r15
	imulq	%r14, %rdx
	movq	%r15, %rax
	imulq	%r8, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r8, %rax
	mulq	%r14
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rdx
	movslq	%edi, %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L9:
	cmpq	%rdx, %rsp
	je	.L10
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L9
.L10:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L11
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L11:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -456(%rbp)
	leaq	-448(%rbp), %rdx
	movl	$0, %eax
	movl	$15, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	leaq	-320(%rbp), %rdx
	movl	$0, %eax
	movl	$15, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	leaq	-192(%rbp), %rdx
	movl	$0, %eax
	movl	$15, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	movl	$1, -528(%rbp)
	jmp	.L12
.L18:
	movl	$1, -524(%rbp)
	jmp	.L13
.L17:
	movq	%rbx, %rdx
	shrq	$2, %rdx
	movl	-524(%rbp), %eax
	movslq	%eax, %rcx
	movl	-528(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	movq	-456(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-528(%rbp), %edx
	movl	-524(%rbp), %eax
	addl	%eax, %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	cmpl	$1, %eax
	jne	.L14
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-456(%rbp), %rax
	movl	-524(%rbp), %edx
	movslq	%edx, %rsi
	movl	-528(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rdx
	movl	-448(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -448(%rbp,%rax,4)
	jmp	.L15
.L14:
	movl	-528(%rbp), %edx
	movl	-524(%rbp), %eax
	addl	%eax, %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	cmpl	$2, %eax
	jne	.L16
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-456(%rbp), %rax
	movl	-524(%rbp), %edx
	movslq	%edx, %rsi
	movl	-528(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rdx
	movl	-320(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -320(%rbp,%rax,4)
	jmp	.L15
.L16:
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-456(%rbp), %rax
	movl	-524(%rbp), %edx
	movslq	%edx, %rsi
	movl	-528(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rdx
	movl	-192(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -192(%rbp,%rax,4)
.L15:
	addl	$1, -524(%rbp)
.L13:
	movl	-544(%rbp), %eax
	cmpl	%eax, -524(%rbp)
	jle	.L17
	addl	$1, -528(%rbp)
.L12:
	movl	-544(%rbp), %eax
	cmpl	%eax, -528(%rbp)
	jle	.L18
	movl	$1000000000, -520(%rbp)
	movl	$1, -516(%rbp)
	jmp	.L19
.L27:
	movl	$1, -512(%rbp)
	jmp	.L20
.L26:
	movl	$1, -508(%rbp)
	jmp	.L21
.L25:
	movl	-516(%rbp), %eax
	cmpl	-512(%rbp), %eax
	je	.L22
	movl	-512(%rbp), %eax
	cmpl	-508(%rbp), %eax
	je	.L22
	movl	-508(%rbp), %eax
	cmpl	-516(%rbp), %eax
	je	.L22
	movl	$0, -504(%rbp)
	movl	$1, -500(%rbp)
	jmp	.L23
.L24:
	movl	-500(%rbp), %eax
	cltq
	movl	-448(%rbp,%rax,4), %edx
	movq	-560(%rbp), %rbx
	movq	%rbx, %rsi
	shrq	$2, %rsi
	movq	-480(%rbp), %rax
	movl	-516(%rbp), %ecx
	movslq	%ecx, %rdi
	movl	-500(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rsi, %rcx
	addq	%rdi, %rcx
	movl	(%rax,%rcx,4), %eax
	imull	%edx, %eax
	addl	%eax, -504(%rbp)
	movl	-500(%rbp), %eax
	cltq
	movl	-320(%rbp,%rax,4), %edx
	movq	%rbx, %rsi
	shrq	$2, %rsi
	movq	-480(%rbp), %rax
	movl	-512(%rbp), %ecx
	movslq	%ecx, %rdi
	movl	-500(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rsi, %rcx
	addq	%rdi, %rcx
	movl	(%rax,%rcx,4), %eax
	imull	%edx, %eax
	addl	%eax, -504(%rbp)
	movl	-500(%rbp), %eax
	cltq
	movl	-192(%rbp,%rax,4), %edx
	shrq	$2, %rbx
	movq	%rbx, %rsi
	movq	-480(%rbp), %rax
	movl	-508(%rbp), %ecx
	movslq	%ecx, %rdi
	movl	-500(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rsi, %rcx
	addq	%rdi, %rcx
	movl	(%rax,%rcx,4), %eax
	imull	%edx, %eax
	addl	%eax, -504(%rbp)
	addl	$1, -500(%rbp)
.L23:
	movl	-540(%rbp), %eax
	cmpl	%eax, -500(%rbp)
	jle	.L24
	movl	-520(%rbp), %eax
	cmpl	-504(%rbp), %eax
	jle	.L22
	movl	-504(%rbp), %eax
	movl	%eax, -520(%rbp)
.L22:
	addl	$1, -508(%rbp)
.L21:
	movl	-540(%rbp), %eax
	cmpl	%eax, -508(%rbp)
	jle	.L25
	addl	$1, -512(%rbp)
.L20:
	movl	-540(%rbp), %eax
	cmpl	%eax, -512(%rbp)
	jle	.L26
	addl	$1, -516(%rbp)
.L19:
	movl	-540(%rbp), %eax
	cmpl	%eax, -516(%rbp)
	jle	.L27
	movl	-520(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-680(%rbp), %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L29
	call	__stack_chk_fail@PLT
.L29:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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\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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$648, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, -680(%rbp)
	leaq	-540(%rbp), %rdx
	leaq	-544(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-540(%rbp), %eax
	leal	1(%rax), %esi
	movl	-540(%rbp), %eax
	leal	1(%rax), %edi
	movslq	%esi, %rax
	subq	$1, %rax
	movq	%rax, -496(%rbp)
	movslq	%esi, %rax
	movq	%rax, -560(%rbp)
	movq	$0, -552(%rbp)
	movslq	%esi, %rax
	salq	$2, %rax
	movq	%rax, -560(%rbp)
	movslq	%edi, %rax
	subq	$1, %rax
	movq	%rax, -488(%rbp)
	movslq	%esi, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	movslq	%edi, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	movq	%r15, %rdx
	imulq	%r12, %rdx
	movq	%r13, %rax
	imulq	%r14, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r14, %rax
	mulq	%r12
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rax
	movq	%rax, -576(%rbp)
	movq	$0, -568(%rbp)
	movslq	%edi, %rax
	movq	%rax, -592(%rbp)
	movq	$0, -584(%rbp)
	movq	-576(%rbp), %r8
	movq	-568(%rbp), %r9
	movq	%r9, %rdx
	movq	-592(%rbp), %r10
	movq	-584(%rbp), %r11
	imulq	%r10, %rdx
	movq	%r11, %rax
	imulq	%r8, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r8, %rax
	mulq	%r10
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rdx
	movslq	%edi, %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -480(%rbp)
	movl	$1, -536(%rbp)
	jmp	.L5
.L8:
	movl	$1, -532(%rbp)
	jmp	.L6
.L7:
	movq	-560(%rbp), %rdx
	shrq	$2, %rdx
	movl	-532(%rbp), %eax
	movslq	%eax, %rcx
	movl	-536(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	movq	-480(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -532(%rbp)
.L6:
	movl	-540(%rbp), %eax
	cmpl	%eax, -532(%rbp)
	jle	.L7
	addl	$1, -536(%rbp)
.L5:
	movl	-540(%rbp), %eax
	cmpl	%eax, -536(%rbp)
	jle	.L8
	movl	-544(%rbp), %eax
	leal	1(%rax), %esi
	movl	-544(%rbp), %eax
	leal	1(%rax), %edi
	movslq	%esi, %rax
	subq	$1, %rax
	movq	%rax, -472(%rbp)
	movslq	%esi, %rax
	movq	%rax, -672(%rbp)
	movq	$0, -664(%rbp)
	movslq	%esi, %rax
	leaq	0(,%rax,4), %rbx
	movslq	%edi, %rax
	subq	$1, %rax
	movq	%rax, -464(%rbp)
	movslq	%esi, %rax
	movq	%rax, -608(%rbp)
	movq	$0, -600(%rbp)
	movslq	%edi, %rax
	movq	%rax, -624(%rbp)
	movq	$0, -616(%rbp)
	movq	-608(%rbp), %r10
	movq	-600(%rbp), %r11
	movq	%r11, %rdx
	movq	-624(%rbp), %r8
	movq	-616(%rbp), %r9
	imulq	%r8, %rdx
	movq	%r9, %rax
	imulq	%r10, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r10, %rax
	mulq	%r8
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rax
	movq	%rax, -640(%rbp)
	movq	$0, -632(%rbp)
	movslq	%edi, %rax
	movq	%rax, -656(%rbp)
	movq	$0, -648(%rbp)
	movq	-640(%rbp), %r8
	movq	-632(%rbp), %r9
	movq	%r9, %rdx
	movq	-656(%rbp), %r14
	movq	-648(%rbp), %r15
	imulq	%r14, %rdx
	movq	%r15, %rax
	imulq	%r8, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r8, %rax
	mulq	%r14
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rdx
	movslq	%edi, %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L9:
	cmpq	%rdx, %rsp
	je	.L10
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L9
.L10:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L11
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L11:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -456(%rbp)
	leaq	-448(%rbp), %rdx
	movl	$0, %eax
	movl	$15, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	leaq	-320(%rbp), %rdx
	movl	$0, %eax
	movl	$15, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	leaq	-192(%rbp), %rdx
	movl	$0, %eax
	movl	$15, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	movl	$1, -528(%rbp)
	jmp	.L12
.L18:
	movl	$1, -524(%rbp)
	jmp	.L13
.L17:
	movq	%rbx, %rdx
	shrq	$2, %rdx
	movl	-524(%rbp), %eax
	movslq	%eax, %rcx
	movl	-528(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	movq	-456(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-528(%rbp), %edx
	movl	-524(%rbp), %eax
	addl	%eax, %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	cmpl	$1, %eax
	jne	.L14
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-456(%rbp), %rax
	movl	-524(%rbp), %edx
	movslq	%edx, %rsi
	movl	-528(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rdx
	movl	-448(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -448(%rbp,%rax,4)
	jmp	.L15
.L14:
	movl	-528(%rbp), %edx
	movl	-524(%rbp), %eax
	addl	%eax, %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	cmpl	$2, %eax
	jne	.L16
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-456(%rbp), %rax
	movl	-524(%rbp), %edx
	movslq	%edx, %rsi
	movl	-528(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rdx
	movl	-320(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -320(%rbp,%rax,4)
	jmp	.L15
.L16:
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-456(%rbp), %rax
	movl	-524(%rbp), %edx
	movslq	%edx, %rsi
	movl	-528(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rdx
	movl	-192(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -192(%rbp,%rax,4)
.L15:
	addl	$1, -524(%rbp)
.L13:
	movl	-544(%rbp), %eax
	cmpl	%eax, -524(%rbp)
	jle	.L17
	addl	$1, -528(%rbp)
.L12:
	movl	-544(%rbp), %eax
	cmpl	%eax, -528(%rbp)
	jle	.L18
	movl	$1000000000, -520(%rbp)
	movl	$1, -516(%rbp)
	jmp	.L19
.L27:
	movl	$1, -512(%rbp)
	jmp	.L20
.L26:
	movl	$1, -508(%rbp)
	jmp	.L21
.L25:
	movl	-516(%rbp), %eax
	cmpl	-512(%rbp), %eax
	je	.L22
	movl	-512(%rbp), %eax
	cmpl	-508(%rbp), %eax
	je	.L22
	movl	-508(%rbp), %eax
	cmpl	-516(%rbp), %eax
	je	.L22
	movl	$0, -504(%rbp)
	movl	$1, -500(%rbp)
	jmp	.L23
.L24:
	movl	-500(%rbp), %eax
	cltq
	movl	-448(%rbp,%rax,4), %edx
	movq	-560(%rbp), %rbx
	movq	%rbx, %rsi
	shrq	$2, %rsi
	movq	-480(%rbp), %rax
	movl	-516(%rbp), %ecx
	movslq	%ecx, %rdi
	movl	-500(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rsi, %rcx
	addq	%rdi, %rcx
	movl	(%rax,%rcx,4), %eax
	imull	%edx, %eax
	addl	%eax, -504(%rbp)
	movl	-500(%rbp), %eax
	cltq
	movl	-320(%rbp,%rax,4), %edx
	movq	%rbx, %rsi
	shrq	$2, %rsi
	movq	-480(%rbp), %rax
	movl	-512(%rbp), %ecx
	movslq	%ecx, %rdi
	movl	-500(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rsi, %rcx
	addq	%rdi, %rcx
	movl	(%rax,%rcx,4), %eax
	imull	%edx, %eax
	addl	%eax, -504(%rbp)
	movl	-500(%rbp), %eax
	cltq
	movl	-192(%rbp,%rax,4), %edx
	shrq	$2, %rbx
	movq	%rbx, %rsi
	movq	-480(%rbp), %rax
	movl	-508(%rbp), %ecx
	movslq	%ecx, %rdi
	movl	-500(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rsi, %rcx
	addq	%rdi, %rcx
	movl	(%rax,%rcx,4), %eax
	imull	%edx, %eax
	addl	%eax, -504(%rbp)
	addl	$1, -500(%rbp)
.L23:
	movl	-540(%rbp), %eax
	cmpl	%eax, -500(%rbp)
	jle	.L24
	movl	-520(%rbp), %eax
	cmpl	-504(%rbp), %eax
	jle	.L22
	movl	-504(%rbp), %eax
	movl	%eax, -520(%rbp)
.L22:
	addl	$1, -508(%rbp)
.L21:
	movl	-540(%rbp), %eax
	cmpl	%eax, -508(%rbp)
	jle	.L25
	addl	$1, -512(%rbp)
.L20:
	movl	-540(%rbp), %eax
	cmpl	%eax, -512(%rbp)
	jle	.L26
	addl	$1, -516(%rbp)
.L19:
	movl	-540(%rbp), %eax
	cmpl	%eax, -516(%rbp)
	jle	.L27
	movl	-520(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-680(%rbp), %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L29
	call	__stack_chk_fail@PLT
.L29:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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:
