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 n,m,mi,min,i,j,k,a,b;
  while(scanf("%d %d",&m,&n),n||m){
    int d[110][110][2]={0};
    n++;
    while(m--){
      scanf("%d %d %d %d",&a,&b,&i,&j);
      d[a][b][0]=d[b][a][0]=i;
      d[a][b][1]=d[b][a][1]=j;
    }
    scanf("%d",&m);
    while(m--){
      scanf("%d %d %d",&mi,&b,&k);
      int c[110]={0};
      int f[110]={0};
      for(i=1;i<n;i++){
	f[mi]=1;
	for(j=1;j<n;j++){
	  if(f[j]||d[mi][j][k]==0)continue;
	  if(c[j]==0||c[j]>c[mi]+d[mi][j][k])c[j]=c[mi]+d[mi][j][k];
	}
	min=2100000000;
	for(j=1;j<n;j++){
	  if(f[j]||c[j]==0)continue;
	  if(min>c[j])min=c[mi=j];
	}
      }
      printf("%d\n",c[b]);
    }
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d %d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d %d %d"
.LC3:
	.string	"%d\n"
.LC4:
	.string	"%d %d"
	.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	-94208(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3552, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L23:
	leaq	-96816(%rbp), %rax
	movl	$96800, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	-97748(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -97748(%rbp)
	jmp	.L3
.L4:
	leaq	-97732(%rbp), %rsi
	leaq	-97736(%rbp), %rcx
	leaq	-97720(%rbp), %rdx
	leaq	-97724(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-97720(%rbp), %eax
	movl	-97724(%rbp), %edx
	movl	-97736(%rbp), %ecx
	movslq	%edx, %rdi
	movslq	%eax, %rsi
	imulq	$110, %rsi, %rsi
	addq	%rdi, %rsi
	movl	%ecx, -96816(%rbp,%rsi,8)
	movl	-97724(%rbp), %ecx
	movl	-97720(%rbp), %esi
	movslq	%edx, %rdx
	cltq
	imulq	$110, %rax, %rax
	addq	%rdx, %rax
	movl	-96816(%rbp,%rax,8), %eax
	movslq	%esi, %rsi
	movslq	%ecx, %rdx
	imulq	$110, %rdx, %rdx
	addq	%rsi, %rdx
	movl	%eax, -96816(%rbp,%rdx,8)
	movl	-97720(%rbp), %eax
	movl	-97724(%rbp), %edx
	movl	-97732(%rbp), %ecx
	movslq	%edx, %rdi
	movslq	%eax, %rsi
	imulq	$110, %rsi, %rsi
	addq	%rdi, %rsi
	movl	%ecx, -96812(%rbp,%rsi,8)
	movl	-97724(%rbp), %ecx
	movl	-97720(%rbp), %esi
	movslq	%edx, %rdx
	cltq
	imulq	$110, %rax, %rax
	addq	%rdx, %rax
	movl	-96812(%rbp,%rax,8), %eax
	movslq	%esi, %rsi
	movslq	%ecx, %rdx
	imulq	$110, %rdx, %rdx
	addq	%rsi, %rdx
	movl	%eax, -96812(%rbp,%rdx,8)
.L3:
	movl	-97744(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -97744(%rbp)
	testl	%eax, %eax
	jne	.L4
	leaq	-97744(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L5
.L19:
	leaq	-97728(%rbp), %rcx
	leaq	-97720(%rbp), %rdx
	leaq	-97740(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-97712(%rbp), %rdx
	movl	$0, %eax
	movl	$55, %ecx
	movq	%rdx, %rdi
	rep stosq
	leaq	-97264(%rbp), %rdx
	movl	$0, %eax
	movl	$55, %ecx
	movq	%rdx, %rdi
	rep stosq
	movl	$1, -97736(%rbp)
	jmp	.L6
.L18:
	movl	-97740(%rbp), %eax
	cltq
	movl	$1, -97264(%rbp,%rax,4)
	movl	$1, -97732(%rbp)
	jmp	.L7
.L12:
	movl	-97732(%rbp), %eax
	cltq
	movl	-97264(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L26
	movl	-97740(%rbp), %eax
	movl	-97732(%rbp), %edx
	movl	-97728(%rbp), %ecx
	movslq	%ecx, %rcx
	cltq
	movslq	%edx, %rdx
	imulq	$110, %rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-96816(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L26
	movl	-97732(%rbp), %eax
	cltq
	movl	-97712(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L11
	movl	-97732(%rbp), %eax
	cltq
	movl	-97712(%rbp,%rax,4), %edx
	movl	-97740(%rbp), %eax
	cltq
	movl	-97712(%rbp,%rax,4), %edi
	movl	-97740(%rbp), %eax
	movl	-97732(%rbp), %ecx
	movl	-97728(%rbp), %esi
	movslq	%esi, %rsi
	cltq
	movslq	%ecx, %rcx
	imulq	$110, %rax, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	-96816(%rbp,%rax,4), %eax
	addl	%edi, %eax
	cmpl	%eax, %edx
	jle	.L10
.L11:
	movl	-97740(%rbp), %eax
	cltq
	movl	-97712(%rbp,%rax,4), %esi
	movl	-97740(%rbp), %eax
	movl	-97732(%rbp), %edx
	movl	-97728(%rbp), %ecx
	movslq	%ecx, %rcx
	cltq
	movslq	%edx, %rdx
	imulq	$110, %rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-96816(%rbp,%rax,4), %edx
	movl	-97732(%rbp), %eax
	addl	%esi, %edx
	cltq
	movl	%edx, -97712(%rbp,%rax,4)
	jmp	.L10
.L26:
	nop
.L10:
	movl	-97732(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -97732(%rbp)
.L7:
	movl	-97732(%rbp), %edx
	movl	-97748(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L12
	movl	$2100000000, -97716(%rbp)
	movl	$1, -97732(%rbp)
	jmp	.L13
.L17:
	movl	-97732(%rbp), %eax
	cltq
	movl	-97264(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L27
	movl	-97732(%rbp), %eax
	cltq
	movl	-97712(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L27
	movl	-97732(%rbp), %eax
	cltq
	movl	-97712(%rbp,%rax,4), %eax
	cmpl	%eax, -97716(%rbp)
	jle	.L16
	movl	-97732(%rbp), %eax
	movl	%eax, -97740(%rbp)
	movl	-97740(%rbp), %eax
	cltq
	movl	-97712(%rbp,%rax,4), %eax
	movl	%eax, -97716(%rbp)
	jmp	.L16
.L27:
	nop
.L16:
	movl	-97732(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -97732(%rbp)
.L13:
	movl	-97732(%rbp), %edx
	movl	-97748(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L17
	movl	-97736(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -97736(%rbp)
.L6:
	movl	-97736(%rbp), %edx
	movl	-97748(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L18
	movl	-97720(%rbp), %eax
	cltq
	movl	-97712(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L5:
	movl	-97744(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -97744(%rbp)
	testl	%eax, %eax
	jne	.L19
.L2:
	leaq	-97748(%rbp), %rdx
	leaq	-97744(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-97748(%rbp), %eax
	testl	%eax, %eax
	jne	.L20
	movl	-97744(%rbp), %eax
	testl	%eax, %eax
	je	.L21
.L20:
	movl	$1, %eax
	jmp	.L22
.L21:
	movl	$0, %eax
.L22:
	testl	%eax, %eax
	jne	.L23
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d %d"
.LC2:
	.string	"%d %d %d"
.LC3:
	.string	"%d\n"
.LC4:
	.string	"%d %d"
	.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	-94208(%rsp), %r11
	.cfi_def_cfa 11, 94264
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3592, %rsp
	.cfi_def_cfa_offset 97856
	movq	%fs:40, %rax
	movq	%rax, 97784(%rsp)
	xorl	%eax, %eax
	leaq	52(%rsp), %rax
	movq	%rax, 32(%rsp)
	leaq	48(%rsp), %rax
	movq	%rax, 40(%rsp)
.L2:
	movq	40(%rsp), %rdx
	movq	32(%rsp), %rsi
	leaq	.LC4(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	48(%rsp), %ebx
	testl	%ebx, %ebx
	jne	.L17
	movl	52(%rsp), %ebx
	testl	%ebx, %ebx
	je	.L40
	leaq	976(%rsp), %r15
	movl	$96800, %edx
	xorl	%esi, %esi
	subl	$1, %ebx
	movq	%r15, %rdi
	call	memset@PLT
	movl	$1, 48(%rsp)
	movl	%ebx, 52(%rsp)
.L3:
	leaq	64(%rsp), %r12
	leaq	60(%rsp), %rbp
	leaq	76(%rsp), %r13
	leaq	72(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rbp, %rcx
	movq	%r13, %rdx
	movq	%rbx, %rsi
	movq	%r12, %r8
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	76(%rsp), %rsi
	movslq	72(%rsp), %rax
	movl	60(%rsp), %ecx
	imulq	$110, %rsi, %rdx
	addq	%rax, %rdx
	imulq	$110, %rax, %rax
	movl	%ecx, 976(%rsp,%rdx,8)
	addq	%rsi, %rax
	movl	%ecx, 976(%rsp,%rax,8)
	movl	64(%rsp), %ecx
	movl	%ecx, 980(%rsp,%rdx,8)
	movl	%ecx, 980(%rsp,%rax,8)
	movl	52(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 52(%rsp)
	testl	%eax, %eax
	jne	.L6
.L7:
	movq	32(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	52(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 52(%rsp)
	testl	%eax, %eax
	je	.L2
	leaq	76(%rsp), %rax
	leaq	80(%rsp), %rbp
	movq	%rax, 24(%rsp)
	leaq	68(%rsp), %rax
	leaq	528(%rsp), %rbx
	movq	%rax, 16(%rsp)
	leaq	56(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L4:
	movq	16(%rsp), %rcx
	movq	24(%rsp), %rdx
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	movq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	movl	$55, %ecx
	movq	%rbp, %rdi
	rep stosq
	movl	$55, %ecx
	movq	%rbx, %rdi
	movl	$1, 60(%rsp)
	rep stosq
	movl	48(%rsp), %eax
	movl	%eax, 4(%rsp)
	cmpl	$1, %eax
	jle	.L9
	movl	56(%rsp), %esi
	movslq	68(%rsp), %r13
	leal	-1(%rax), %r14d
	xorl	%r12d, %r12d
	xorl	%edi, %edi
	movslq	%eax, %rcx
	.p2align 4,,10
	.p2align 3
.L15:
	movslq	%esi, %r9
	imulq	$220, %r9, %rax
	movl	$1, 528(%rsp,%r9,4)
	addq	%r13, %rax
	leaq	(%r15,%rax,4), %r10
	movl	$1, %eax
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L42:
	addl	%r11d, %edx
.L11:
	movl	%edx, 0(%rbp,%rax,4)
.L10:
	addq	$1, %rax
	cmpq	%rcx, %rax
	je	.L41
.L12:
	movl	(%rbx,%rax,4), %r8d
	testl	%r8d, %r8d
	jne	.L10
	movl	(%r10,%rax,8), %edx
	testl	%edx, %edx
	je	.L10
	movl	0(%rbp,%rax,4), %r8d
	movl	80(%rsp,%r9,4), %r11d
	testl	%r8d, %r8d
	je	.L42
	addl	%r11d, %edx
	cmpl	%edx, %r8d
	jg	.L11
	addq	$1, %rax
	cmpq	%rcx, %rax
	jne	.L12
	.p2align 4,,10
	.p2align 3
.L41:
	movl	$1, %eax
	movl	$2100000000, %r9d
	.p2align 4,,10
	.p2align 3
.L14:
	movl	(%rbx,%rax,4), %edx
	testl	%edx, %edx
	jne	.L13
	movl	0(%rbp,%rax,4), %r8d
	cmpl	%r9d, %r8d
	setl	%dl
	testl	%r8d, %r8d
	setne	%r10b
	andb	%r10b, %dl
	cmovne	%edx, %edi
	cmovne	%eax, %esi
	cmovne	%r8d, %r9d
.L13:
	addq	$1, %rax
	cmpq	%rax, %rcx
	jne	.L14
	addl	$1, %r12d
	cmpl	%r12d, %r14d
	jne	.L15
	movl	4(%rsp), %eax
	movl	%eax, 64(%rsp)
	movl	%eax, 60(%rsp)
	testb	%dil, %dil
	je	.L9
	movl	%esi, 56(%rsp)
.L9:
	movslq	76(%rsp), %rax
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	movl	80(%rsp,%rax,4), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	52(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 52(%rsp)
	testl	%eax, %eax
	jne	.L4
	jmp	.L2
.L17:
	leaq	976(%rsp), %r15
	movl	$96800, %edx
	xorl	%esi, %esi
	addl	$1, %ebx
	movq	%r15, %rdi
	call	memset@PLT
	movl	52(%rsp), %eax
	movl	%ebx, 48(%rsp)
	leal	-1(%rax), %edx
	movl	%edx, 52(%rsp)
	testl	%eax, %eax
	jne	.L3
	jmp	.L7
.L40:
	movq	97784(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L43
	addq	$97800, %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
.L43:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d %d"
.LC2:
	.string	"%d %d %d"
.LC3:
	.string	"%d\n"
.LC4:
	.string	"%d %d"
	.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	-94208(%rsp), %r11
	.cfi_def_cfa 11, 94264
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3592, %rsp
	.cfi_def_cfa_offset 97856
	movq	%fs:40, %rax
	movq	%rax, 97784(%rsp)
	xorl	%eax, %eax
	leaq	52(%rsp), %rax
	movq	%rax, 32(%rsp)
	leaq	48(%rsp), %rax
	movq	%rax, 40(%rsp)
.L2:
	movq	40(%rsp), %rdx
	movq	32(%rsp), %rsi
	leaq	.LC4(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	48(%rsp), %ebx
	testl	%ebx, %ebx
	jne	.L17
	movl	52(%rsp), %ebx
	testl	%ebx, %ebx
	je	.L40
	leaq	976(%rsp), %r15
	movl	$96800, %edx
	xorl	%esi, %esi
	subl	$1, %ebx
	movq	%r15, %rdi
	call	memset@PLT
	movl	$1, 48(%rsp)
	movl	%ebx, 52(%rsp)
.L3:
	leaq	64(%rsp), %r12
	leaq	60(%rsp), %rbp
	leaq	76(%rsp), %r13
	leaq	72(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rbp, %rcx
	movq	%r13, %rdx
	movq	%rbx, %rsi
	movq	%r12, %r8
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	76(%rsp), %rsi
	movslq	72(%rsp), %rax
	movl	60(%rsp), %ecx
	imulq	$110, %rsi, %rdx
	addq	%rax, %rdx
	imulq	$110, %rax, %rax
	movl	%ecx, 976(%rsp,%rdx,8)
	addq	%rsi, %rax
	movl	%ecx, 976(%rsp,%rax,8)
	movl	64(%rsp), %ecx
	movl	%ecx, 980(%rsp,%rdx,8)
	movl	%ecx, 980(%rsp,%rax,8)
	movl	52(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 52(%rsp)
	testl	%eax, %eax
	jne	.L6
.L7:
	movq	32(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	52(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 52(%rsp)
	testl	%eax, %eax
	je	.L2
	leaq	76(%rsp), %rax
	leaq	80(%rsp), %rbp
	movq	%rax, 24(%rsp)
	leaq	68(%rsp), %rax
	leaq	528(%rsp), %rbx
	movq	%rax, 16(%rsp)
	leaq	56(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L4:
	movq	16(%rsp), %rcx
	movq	24(%rsp), %rdx
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	movq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	movl	$55, %ecx
	movq	%rbp, %rdi
	rep stosq
	movl	$55, %ecx
	movq	%rbx, %rdi
	movl	$1, 60(%rsp)
	rep stosq
	movl	48(%rsp), %eax
	movl	%eax, 4(%rsp)
	cmpl	$1, %eax
	jle	.L9
	movl	56(%rsp), %esi
	movslq	68(%rsp), %r13
	leal	-1(%rax), %r14d
	xorl	%r12d, %r12d
	xorl	%edi, %edi
	movslq	%eax, %rcx
	.p2align 4,,10
	.p2align 3
.L15:
	movslq	%esi, %r9
	imulq	$220, %r9, %rax
	movl	$1, 528(%rsp,%r9,4)
	addq	%r13, %rax
	leaq	(%r15,%rax,4), %r10
	movl	$1, %eax
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L42:
	addl	%r11d, %edx
.L11:
	movl	%edx, 0(%rbp,%rax,4)
.L10:
	addq	$1, %rax
	cmpq	%rcx, %rax
	je	.L41
.L12:
	movl	(%rbx,%rax,4), %r8d
	testl	%r8d, %r8d
	jne	.L10
	movl	(%r10,%rax,8), %edx
	testl	%edx, %edx
	je	.L10
	movl	0(%rbp,%rax,4), %r8d
	movl	80(%rsp,%r9,4), %r11d
	testl	%r8d, %r8d
	je	.L42
	addl	%r11d, %edx
	cmpl	%edx, %r8d
	jg	.L11
	addq	$1, %rax
	cmpq	%rcx, %rax
	jne	.L12
	.p2align 4,,10
	.p2align 3
.L41:
	movl	$1, %eax
	movl	$2100000000, %r9d
	.p2align 4,,10
	.p2align 3
.L14:
	movl	(%rbx,%rax,4), %edx
	testl	%edx, %edx
	jne	.L13
	movl	0(%rbp,%rax,4), %r8d
	cmpl	%r9d, %r8d
	setl	%dl
	testl	%r8d, %r8d
	setne	%r10b
	andb	%r10b, %dl
	cmovne	%edx, %edi
	cmovne	%eax, %esi
	cmovne	%r8d, %r9d
.L13:
	addq	$1, %rax
	cmpq	%rax, %rcx
	jne	.L14
	addl	$1, %r12d
	cmpl	%r12d, %r14d
	jne	.L15
	movl	4(%rsp), %eax
	movl	%eax, 64(%rsp)
	movl	%eax, 60(%rsp)
	testb	%dil, %dil
	je	.L9
	movl	%esi, 56(%rsp)
.L9:
	movslq	76(%rsp), %rax
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	movl	80(%rsp,%rax,4), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	52(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 52(%rsp)
	testl	%eax, %eax
	jne	.L4
	jmp	.L2
.L17:
	leaq	976(%rsp), %r15
	movl	$96800, %edx
	xorl	%esi, %esi
	addl	$1, %ebx
	movq	%r15, %rdi
	call	memset@PLT
	movl	52(%rsp), %eax
	movl	%ebx, 48(%rsp)
	leal	-1(%rax), %edx
	movl	%edx, 52(%rsp)
	testl	%eax, %eax
	jne	.L3
	jmp	.L7
.L40:
	movq	97784(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L43
	addq	$97800, %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
.L43:
	.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 n,m,mi,min,i,j,k,a,b;
  while(scanf("%d %d",&m,&n),n||m){
    int d[110][110][2]={0};
    n++;
    while(m--){
      scanf("%d %d %d %d",&a,&b,&i,&j);
      d[a][b][0]=d[b][a][0]=i;
      d[a][b][1]=d[b][a][1]=j;
    }
    scanf("%d",&m);
    while(m--){
      scanf("%d %d %d",&mi,&b,&k);
      int c[110]={0};
      int f[110]={0};
      for(i=1;i<n;i++){
	f[mi]=1;
	for(j=1;j<n;j++){
	  if(f[j]||d[mi][j][k]==0)continue;
	  if(c[j]==0||c[j]>c[mi]+d[mi][j][k])c[j]=c[mi]+d[mi][j][k];
	}
	min=2100000000;
	for(j=1;j<n;j++){
	  if(f[j]||c[j]==0)continue;
	  if(min>c[j])min=c[mi=j];
	}
      }
      printf("%d\n",c[b]);
    }
  }
  return 0;
}
6 5
1 2 200 10
1 4 400 15
1 3 250 25
2 4 100 10
4 5 150 20
3 5 300 30
2
1 5 0
1 5 1
0 0
 6 5
1 2 200 10
1 4 400 22
1 3 250 25
2 4 100 10
4 5 150 20
3 3 300 30
2
1 5 0
1 5 1
0 0
 6 5
1 2 200 10
1 4 158 22
1 3 250 25
2 4 100 10
4 5 150 20
3 3 300 30
2
1 5 0
1 5 1
0 0
 6 5
1 2 200 10
1 4 158 41
1 3 250 22
2 4 100 10
4 5 1 20
3 3 300 30
2
1 5 0
1 5 1
0 0
 6 5
1 2 200 10
1 4 71 22
1 3 250 25
2 4 100 10
4 5 150 20
3 3 300 30
2
1 5 0
1 5 1
0 0
 6 5
1 2 200 10
1 4 158 22
2 3 250 25
2 4 100 10
4 5 150 20
3 3 300 30
2
2 5 0
1 5 1
0 0
 6 5
1 2 200 10
1 4 158 41
1 3 250 22
2 4 100 10
4 5 150 20
3 3 335 30
2
1 5 0
1 2 1
0 0
 6 5
1 2 200 10
1 4 400 15
1 3 250 25
1 4 100 10
4 5 150 20
2 3 95 30
2
1 5 0
1 5 1
0 0
 6 5
1 2 200 10
1 4 158 41
1 3 250 22
2 4 100 10
2 5 150 20
3 3 335 30
2
1 5 0
1 2 1
0 0
 6 5
1 2 200 12
1 4 400 15
1 3 250 25
2 4 100 10
4 5 150 20
3 5 300 21
2
1 5 0
2 5 1
0 0

450
35
 450
40
 308
40
 159
40
 221
40
 250
40
 308
10
 250
30
 350
10
 450
30

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 n,m,mi,min,i,j,k,a,b;
  while(scanf("%d %d",&m,&n),n||m){
    int d[110][110][2]={0};
    n++;
    while(m--){
      scanf("%d %d %d %d",&a,&b,&i,&j);
      d[a][b][0]=d[b][a][0]=i;
      d[a][b][1]=d[b][a][1]=j;
    }
    scanf("%d",&m);
    while(m--){
      scanf("%d %d %d",&mi,&b,&k);
      int c[110]={0};
      int f[110]={0};
      for(i=1;i<n;i++){
	f[mi]=1;
	for(j=1;j<n;j++){
	  if(f[j]||d[mi][j][k]==0)continue;
	  if(c[j]==0||c[j]>c[mi]+d[mi][j][k])c[j]=c[mi]+d[mi][j][k];
	}
	min=2100000000;
	for(j=1;j<n;j++){
	  if(f[j]||c[j]==0)continue;
	  if(min>c[j])min=c[mi=j];
	}
      }
      printf("%d\n",c[b]);
    }
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d %d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d %d %d"
.LC3:
	.string	"%d\n"
.LC4:
	.string	"%d %d"
	.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	-94208(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3552, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L23:
	leaq	-96816(%rbp), %rax
	movl	$96800, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	-97748(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -97748(%rbp)
	jmp	.L3
.L4:
	leaq	-97732(%rbp), %rsi
	leaq	-97736(%rbp), %rcx
	leaq	-97720(%rbp), %rdx
	leaq	-97724(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-97720(%rbp), %eax
	movl	-97724(%rbp), %edx
	movl	-97736(%rbp), %ecx
	movslq	%edx, %rdi
	movslq	%eax, %rsi
	imulq	$110, %rsi, %rsi
	addq	%rdi, %rsi
	movl	%ecx, -96816(%rbp,%rsi,8)
	movl	-97724(%rbp), %ecx
	movl	-97720(%rbp), %esi
	movslq	%edx, %rdx
	cltq
	imulq	$110, %rax, %rax
	addq	%rdx, %rax
	movl	-96816(%rbp,%rax,8), %eax
	movslq	%esi, %rsi
	movslq	%ecx, %rdx
	imulq	$110, %rdx, %rdx
	addq	%rsi, %rdx
	movl	%eax, -96816(%rbp,%rdx,8)
	movl	-97720(%rbp), %eax
	movl	-97724(%rbp), %edx
	movl	-97732(%rbp), %ecx
	movslq	%edx, %rdi
	movslq	%eax, %rsi
	imulq	$110, %rsi, %rsi
	addq	%rdi, %rsi
	movl	%ecx, -96812(%rbp,%rsi,8)
	movl	-97724(%rbp), %ecx
	movl	-97720(%rbp), %esi
	movslq	%edx, %rdx
	cltq
	imulq	$110, %rax, %rax
	addq	%rdx, %rax
	movl	-96812(%rbp,%rax,8), %eax
	movslq	%esi, %rsi
	movslq	%ecx, %rdx
	imulq	$110, %rdx, %rdx
	addq	%rsi, %rdx
	movl	%eax, -96812(%rbp,%rdx,8)
.L3:
	movl	-97744(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -97744(%rbp)
	testl	%eax, %eax
	jne	.L4
	leaq	-97744(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L5
.L19:
	leaq	-97728(%rbp), %rcx
	leaq	-97720(%rbp), %rdx
	leaq	-97740(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-97712(%rbp), %rdx
	movl	$0, %eax
	movl	$55, %ecx
	movq	%rdx, %rdi
	rep stosq
	leaq	-97264(%rbp), %rdx
	movl	$0, %eax
	movl	$55, %ecx
	movq	%rdx, %rdi
	rep stosq
	movl	$1, -97736(%rbp)
	jmp	.L6
.L18:
	movl	-97740(%rbp), %eax
	cltq
	movl	$1, -97264(%rbp,%rax,4)
	movl	$1, -97732(%rbp)
	jmp	.L7
.L12:
	movl	-97732(%rbp), %eax
	cltq
	movl	-97264(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L26
	movl	-97740(%rbp), %eax
	movl	-97732(%rbp), %edx
	movl	-97728(%rbp), %ecx
	movslq	%ecx, %rcx
	cltq
	movslq	%edx, %rdx
	imulq	$110, %rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-96816(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L26
	movl	-97732(%rbp), %eax
	cltq
	movl	-97712(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L11
	movl	-97732(%rbp), %eax
	cltq
	movl	-97712(%rbp,%rax,4), %edx
	movl	-97740(%rbp), %eax
	cltq
	movl	-97712(%rbp,%rax,4), %edi
	movl	-97740(%rbp), %eax
	movl	-97732(%rbp), %ecx
	movl	-97728(%rbp), %esi
	movslq	%esi, %rsi
	cltq
	movslq	%ecx, %rcx
	imulq	$110, %rax, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	-96816(%rbp,%rax,4), %eax
	addl	%edi, %eax
	cmpl	%eax, %edx
	jle	.L10
.L11:
	movl	-97740(%rbp), %eax
	cltq
	movl	-97712(%rbp,%rax,4), %esi
	movl	-97740(%rbp), %eax
	movl	-97732(%rbp), %edx
	movl	-97728(%rbp), %ecx
	movslq	%ecx, %rcx
	cltq
	movslq	%edx, %rdx
	imulq	$110, %rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-96816(%rbp,%rax,4), %edx
	movl	-97732(%rbp), %eax
	addl	%esi, %edx
	cltq
	movl	%edx, -97712(%rbp,%rax,4)
	jmp	.L10
.L26:
	nop
.L10:
	movl	-97732(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -97732(%rbp)
.L7:
	movl	-97732(%rbp), %edx
	movl	-97748(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L12
	movl	$2100000000, -97716(%rbp)
	movl	$1, -97732(%rbp)
	jmp	.L13
.L17:
	movl	-97732(%rbp), %eax
	cltq
	movl	-97264(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L27
	movl	-97732(%rbp), %eax
	cltq
	movl	-97712(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L27
	movl	-97732(%rbp), %eax
	cltq
	movl	-97712(%rbp,%rax,4), %eax
	cmpl	%eax, -97716(%rbp)
	jle	.L16
	movl	-97732(%rbp), %eax
	movl	%eax, -97740(%rbp)
	movl	-97740(%rbp), %eax
	cltq
	movl	-97712(%rbp,%rax,4), %eax
	movl	%eax, -97716(%rbp)
	jmp	.L16
.L27:
	nop
.L16:
	movl	-97732(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -97732(%rbp)
.L13:
	movl	-97732(%rbp), %edx
	movl	-97748(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L17
	movl	-97736(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -97736(%rbp)
.L6:
	movl	-97736(%rbp), %edx
	movl	-97748(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L18
	movl	-97720(%rbp), %eax
	cltq
	movl	-97712(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L5:
	movl	-97744(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -97744(%rbp)
	testl	%eax, %eax
	jne	.L19
.L2:
	leaq	-97748(%rbp), %rdx
	leaq	-97744(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-97748(%rbp), %eax
	testl	%eax, %eax
	jne	.L20
	movl	-97744(%rbp), %eax
	testl	%eax, %eax
	je	.L21
.L20:
	movl	$1, %eax
	jmp	.L22
.L21:
	movl	$0, %eax
.L22:
	testl	%eax, %eax
	jne	.L23
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	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 %d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d %d %d"
.LC3:
	.string	"%d\n"
.LC4:
	.string	"%d %d"
	.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	-94208(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3552, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L23:
	leaq	-96816(%rbp), %rax
	movl	$96800, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	-97748(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -97748(%rbp)
	jmp	.L3
.L4:
	leaq	-97732(%rbp), %rsi
	leaq	-97736(%rbp), %rcx
	leaq	-97720(%rbp), %rdx
	leaq	-97724(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-97720(%rbp), %eax
	movl	-97724(%rbp), %edx
	movl	-97736(%rbp), %ecx
	movslq	%edx, %rdi
	movslq	%eax, %rsi
	imulq	$110, %rsi, %rsi
	addq	%rdi, %rsi
	movl	%ecx, -96816(%rbp,%rsi,8)
	movl	-97724(%rbp), %ecx
	movl	-97720(%rbp), %esi
	movslq	%edx, %rdx
	cltq
	imulq	$110, %rax, %rax
	addq	%rdx, %rax
	movl	-96816(%rbp,%rax,8), %eax
	movslq	%esi, %rsi
	movslq	%ecx, %rdx
	imulq	$110, %rdx, %rdx
	addq	%rsi, %rdx
	movl	%eax, -96816(%rbp,%rdx,8)
	movl	-97720(%rbp), %eax
	movl	-97724(%rbp), %edx
	movl	-97732(%rbp), %ecx
	movslq	%edx, %rdi
	movslq	%eax, %rsi
	imulq	$110, %rsi, %rsi
	addq	%rdi, %rsi
	movl	%ecx, -96812(%rbp,%rsi,8)
	movl	-97724(%rbp), %ecx
	movl	-97720(%rbp), %esi
	movslq	%edx, %rdx
	cltq
	imulq	$110, %rax, %rax
	addq	%rdx, %rax
	movl	-96812(%rbp,%rax,8), %eax
	movslq	%esi, %rsi
	movslq	%ecx, %rdx
	imulq	$110, %rdx, %rdx
	addq	%rsi, %rdx
	movl	%eax, -96812(%rbp,%rdx,8)
.L3:
	movl	-97744(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -97744(%rbp)
	testl	%eax, %eax
	jne	.L4
	leaq	-97744(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L5
.L19:
	leaq	-97728(%rbp), %rcx
	leaq	-97720(%rbp), %rdx
	leaq	-97740(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-97712(%rbp), %rdx
	movl	$0, %eax
	movl	$55, %ecx
	movq	%rdx, %rdi
	rep stosq
	leaq	-97264(%rbp), %rdx
	movl	$0, %eax
	movl	$55, %ecx
	movq	%rdx, %rdi
	rep stosq
	movl	$1, -97736(%rbp)
	jmp	.L6
.L18:
	movl	-97740(%rbp), %eax
	cltq
	movl	$1, -97264(%rbp,%rax,4)
	movl	$1, -97732(%rbp)
	jmp	.L7
.L12:
	movl	-97732(%rbp), %eax
	cltq
	movl	-97264(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L26
	movl	-97740(%rbp), %eax
	movl	-97732(%rbp), %edx
	movl	-97728(%rbp), %ecx
	movslq	%ecx, %rcx
	cltq
	movslq	%edx, %rdx
	imulq	$110, %rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-96816(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L26
	movl	-97732(%rbp), %eax
	cltq
	movl	-97712(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L11
	movl	-97732(%rbp), %eax
	cltq
	movl	-97712(%rbp,%rax,4), %edx
	movl	-97740(%rbp), %eax
	cltq
	movl	-97712(%rbp,%rax,4), %edi
	movl	-97740(%rbp), %eax
	movl	-97732(%rbp), %ecx
	movl	-97728(%rbp), %esi
	movslq	%esi, %rsi
	cltq
	movslq	%ecx, %rcx
	imulq	$110, %rax, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	-96816(%rbp,%rax,4), %eax
	addl	%edi, %eax
	cmpl	%eax, %edx
	jle	.L10
.L11:
	movl	-97740(%rbp), %eax
	cltq
	movl	-97712(%rbp,%rax,4), %esi
	movl	-97740(%rbp), %eax
	movl	-97732(%rbp), %edx
	movl	-97728(%rbp), %ecx
	movslq	%ecx, %rcx
	cltq
	movslq	%edx, %rdx
	imulq	$110, %rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-96816(%rbp,%rax,4), %edx
	movl	-97732(%rbp), %eax
	addl	%esi, %edx
	cltq
	movl	%edx, -97712(%rbp,%rax,4)
	jmp	.L10
.L26:
	nop
.L10:
	movl	-97732(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -97732(%rbp)
.L7:
	movl	-97732(%rbp), %edx
	movl	-97748(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L12
	movl	$2100000000, -97716(%rbp)
	movl	$1, -97732(%rbp)
	jmp	.L13
.L17:
	movl	-97732(%rbp), %eax
	cltq
	movl	-97264(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L27
	movl	-97732(%rbp), %eax
	cltq
	movl	-97712(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L27
	movl	-97732(%rbp), %eax
	cltq
	movl	-97712(%rbp,%rax,4), %eax
	cmpl	%eax, -97716(%rbp)
	jle	.L16
	movl	-97732(%rbp), %eax
	movl	%eax, -97740(%rbp)
	movl	-97740(%rbp), %eax
	cltq
	movl	-97712(%rbp,%rax,4), %eax
	movl	%eax, -97716(%rbp)
	jmp	.L16
.L27:
	nop
.L16:
	movl	-97732(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -97732(%rbp)
.L13:
	movl	-97732(%rbp), %edx
	movl	-97748(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L17
	movl	-97736(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -97736(%rbp)
.L6:
	movl	-97736(%rbp), %edx
	movl	-97748(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L18
	movl	-97720(%rbp), %eax
	cltq
	movl	-97712(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L5:
	movl	-97744(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -97744(%rbp)
	testl	%eax, %eax
	jne	.L19
.L2:
	leaq	-97748(%rbp), %rdx
	leaq	-97744(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-97748(%rbp), %eax
	testl	%eax, %eax
	jne	.L20
	movl	-97744(%rbp), %eax
	testl	%eax, %eax
	je	.L21
.L20:
	movl	$1, %eax
	jmp	.L22
.L21:
	movl	$0, %eax
.L22:
	testl	%eax, %eax
	jne	.L23
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	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:
