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 ru_ta_num;
int map[100][100];

int main(void) {
	int i,j,k;
	int ru_ta_id;
	int ru_ta_connect_num;
	int ru_ta_connect;
	int packet_num;
	int packet_from,packet_to,packet_ttl;
	scanf("%d",&ru_ta_num);
	for(i=0;i<ru_ta_num;i++) {
		for(j=0;j<ru_ta_num;j++) {
			map[i][j]=100000;
		}
		map[i][i]=0;
	}
	for(i=0;i<ru_ta_num;i++) {
		scanf("%d%d",&ru_ta_id,&ru_ta_connect_num);
		ru_ta_id--;
		for(j=0;j<ru_ta_connect_num;j++) {
			scanf("%d",&ru_ta_connect);
			map[ru_ta_id][ru_ta_connect-1]=1;
		}
	}
	for(k=0;k<ru_ta_num;k++) {
		for(i=0;i<ru_ta_num;i++) {
			for(j=0;j<ru_ta_num;j++) {
				if(map[i][k]+map[k][j]<map[i][j]) {
					map[i][j]=map[i][k]+map[k][j];
				}
			}
		}
	}
	scanf("%d",&packet_num);
	for(i=0;i<packet_num;i++) {
		scanf("%d%d%d",&packet_from,&packet_to,&packet_ttl);
		packet_from--;packet_to--;
		if(packet_ttl<map[packet_from][packet_to]+1) {
			puts("NA");
		} else {
			printf("%d\n",map[packet_from][packet_to]+1);
		}
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	ru_ta_num
	.bss
	.align 4
	.type	ru_ta_num, @object
	.size	ru_ta_num, 4
ru_ta_num:
	.zero	4
	.globl	map
	.align 32
	.type	map, @object
	.size	map, 40000
map:
	.zero	40000
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d%d%d"
.LC3:
	.string	"NA"
.LC4:
	.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
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	ru_ta_num(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20(%rbp)
	jmp	.L2
.L5:
	movl	$0, -16(%rbp)
	jmp	.L3
.L4:
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	$100000, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L3:
	movl	ru_ta_num(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L4
	movl	-20(%rbp), %eax
	cltq
	imulq	$404, %rax, %rax
	leaq	map(%rip), %rdx
	movl	$0, (%rax,%rdx)
	addl	$1, -20(%rbp)
.L2:
	movl	ru_ta_num(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L5
	movl	$0, -20(%rbp)
	jmp	.L6
.L9:
	leaq	-44(%rbp), %rdx
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -48(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L7
.L8:
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %eax
	movl	-40(%rbp), %edx
	subl	$1, %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	$1, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L7:
	movl	-44(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L8
	addl	$1, -20(%rbp)
.L6:
	movl	ru_ta_num(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L9
	movl	$0, -12(%rbp)
	jmp	.L10
.L16:
	movl	$0, -20(%rbp)
	jmp	.L11
.L15:
	movl	$0, -16(%rbp)
	jmp	.L12
.L14:
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jge	.L13
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L13:
	addl	$1, -16(%rbp)
.L12:
	movl	ru_ta_num(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L14
	addl	$1, -20(%rbp)
.L11:
	movl	ru_ta_num(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L15
	addl	$1, -12(%rbp)
.L10:
	movl	ru_ta_num(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L16
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20(%rbp)
	jmp	.L17
.L20:
	leaq	-24(%rbp), %rcx
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -32(%rbp)
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -28(%rbp)
	movl	-32(%rbp), %eax
	movl	-28(%rbp), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L18
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L19
.L18:
	movl	-32(%rbp), %eax
	movl	-28(%rbp), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L19:
	addl	$1, -20(%rbp)
.L17:
	movl	-36(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L20
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	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"
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%d%d%d"
.LC4:
	.string	"NA"
.LC5:
	.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
	leaq	ru_ta_num(%rip), %rsi
	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
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %rdi
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	ru_ta_num(%rip), %edi
	testl	%edi, %edi
	jle	.L2
	movl	%edi, %eax
	leaq	map(%rip), %rcx
	movl	%edi, %r9d
	xorl	%esi, %esi
	shrl	$2, %eax
	leal	-1(%rdi), %r11d
	andl	$-4, %r9d
	movq	%rcx, %rbx
	leal	-1(%rax), %r10d
	movdqa	.LC1(%rip), %xmm0
	movq	%rcx, %r8
	addq	$1, %r10
	salq	$4, %r10
	.p2align 4,,10
	.p2align 3
.L6:
	cmpl	$2, %r11d
	jbe	.L20
	leaq	(%r10,%rcx), %rdx
	movq	%rcx, %rax
	.p2align 4,,10
	.p2align 3
.L4:
	movaps	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L4
	movl	%r9d, %eax
	cmpl	%edi, %r9d
	je	.L5
.L3:
	movslq	%esi, %rdx
	movslq	%eax, %r12
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rdx,%rdx,4), %rdx
	salq	$2, %rdx
	addq	%rdx, %r12
	movl	$100000, (%rbx,%r12,4)
	leal	1(%rax), %r12d
	cmpl	%r12d, %edi
	jle	.L5
	movslq	%r12d, %r12
	addl	$2, %eax
	addq	%rdx, %r12
	movl	$100000, (%rbx,%r12,4)
	cmpl	%eax, %edi
	jle	.L5
	cltq
	addq	%rax, %rdx
	movl	$100000, (%rbx,%rdx,4)
.L5:
	addl	$1, %esi
	movl	$0, (%r8)
	addq	$400, %rcx
	addq	$404, %r8
	cmpl	%edi, %esi
	jne	.L6
	leaq	28(%rsp), %rax
	xorl	%r13d, %r13d
	leaq	32(%rsp), %r15
	movq	%rax, 8(%rsp)
	leaq	36(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L9:
	movq	8(%rsp), %rsi
	movq	%r15, %rdx
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %edx
	subl	$1, 28(%rsp)
	testl	%edx, %edx
	jle	.L7
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %eax
	movslq	28(%rsp), %rcx
	subl	$1, %eax
	leaq	(%rcx,%rcx,4), %rcx
	cltq
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rax,%rcx,4), %rax
	movl	$1, (%rbx,%rax,4)
	cmpl	%r14d, 32(%rsp)
	jg	.L8
.L7:
	movl	ru_ta_num(%rip), %eax
	addl	$1, %r13d
	cmpl	%r13d, %eax
	jg	.L9
	testl	%eax, %eax
	jle	.L2
	movl	%eax, %r11d
	leal	-1(%rax), %edx
	leaq	4+map(%rip), %rax
	xorl	%r10d, %r10d
	movq	%r11, %rbx
	imulq	$-400, %r11, %r11
	leaq	(%rax,%rdx,4), %r12
	xorl	%r9d, %r9d
	negq	%rbx
	salq	$2, %rbx
	.p2align 4,,10
	.p2align 3
.L10:
	leaq	map(%rip), %rdi
	movq	%r12, %r8
	xorl	%esi, %esi
	subq	%r10, %rdi
	.p2align 4,,10
	.p2align 3
.L14:
	leaq	(%rdi,%r10), %rax
	.p2align 4,,10
	.p2align 3
.L12:
	leaq	(%rax,%rsi), %rcx
	movl	(%rdi), %edx
	addl	(%rcx,%r9), %edx
	cmpl	(%rax), %edx
	jge	.L11
	movl	%edx, (%rax)
.L11:
	addq	$4, %rax
	cmpq	%r8, %rax
	jne	.L12
	subq	$400, %rsi
	leaq	400(%rax), %r8
	addq	$400, %rdi
	cmpq	%r11, %rsi
	jne	.L14
	subq	$4, %r10
	addq	$400, %r9
	cmpq	%rbx, %r10
	jne	.L10
.L2:
	leaq	40(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	40(%rsp), %eax
	testl	%eax, %eax
	jle	.L15
	xorl	%ebp, %ebp
	leaq	52(%rsp), %r15
	leaq	48(%rsp), %r14
	leaq	map(%rip), %rbx
	leaq	44(%rsp), %r13
	leaq	.LC3(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L18:
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%r15, %rcx
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	movl	48(%rsp), %esi
	subl	$1, %eax
	leal	-1(%rsi), %edx
	movl	%eax, 44(%rsp)
	cltq
	leaq	(%rax,%rax,4), %rax
	movl	%edx, 48(%rsp)
	movslq	%edx, %rdx
	leaq	(%rax,%rax,4), %rax
	leaq	(%rdx,%rax,4), %rax
	movl	(%rbx,%rax,4), %eax
	cmpl	52(%rsp), %eax
	jl	.L16
	leaq	.LC4(%rip), %rdi
	addl	$1, %ebp
	call	puts@PLT
	cmpl	40(%rsp), %ebp
	jl	.L18
.L15:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	addq	$72, %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
.L16:
	.cfi_restore_state
	leal	1(%rax), %edx
	leaq	.LC5(%rip), %rsi
	xorl	%eax, %eax
	addl	$1, %ebp
	movl	$1, %edi
	call	__printf_chk@PLT
	cmpl	%ebp, 40(%rsp)
	jg	.L18
	jmp	.L15
.L20:
	xorl	%eax, %eax
	jmp	.L3
.L28:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	map
	.bss
	.align 32
	.type	map, @object
	.size	map, 40000
map:
	.zero	40000
	.globl	ru_ta_num
	.align 4
	.type	ru_ta_num, @object
	.size	ru_ta_num, 4
ru_ta_num:
	.zero	4
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	100000
	.long	100000
	.long	100000
	.long	100000
	.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"
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%d%d%d"
.LC4:
	.string	"NA"
.LC5:
	.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
	leaq	ru_ta_num(%rip), %rsi
	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
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %rdi
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	ru_ta_num(%rip), %edi
	testl	%edi, %edi
	jle	.L2
	movl	%edi, %eax
	leaq	map(%rip), %rcx
	movl	%edi, %r9d
	xorl	%esi, %esi
	shrl	$2, %eax
	leal	-1(%rdi), %r11d
	andl	$-4, %r9d
	movq	%rcx, %rbx
	leal	-1(%rax), %r10d
	movdqa	.LC1(%rip), %xmm0
	movq	%rcx, %r8
	addq	$1, %r10
	salq	$4, %r10
	.p2align 4,,10
	.p2align 3
.L6:
	cmpl	$2, %r11d
	jbe	.L20
	leaq	(%r10,%rcx), %rdx
	movq	%rcx, %rax
	.p2align 4,,10
	.p2align 3
.L4:
	movaps	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L4
	movl	%r9d, %eax
	cmpl	%edi, %r9d
	je	.L5
.L3:
	movslq	%esi, %rdx
	movslq	%eax, %r12
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rdx,%rdx,4), %rdx
	salq	$2, %rdx
	addq	%rdx, %r12
	movl	$100000, (%rbx,%r12,4)
	leal	1(%rax), %r12d
	cmpl	%r12d, %edi
	jle	.L5
	movslq	%r12d, %r12
	addl	$2, %eax
	addq	%rdx, %r12
	movl	$100000, (%rbx,%r12,4)
	cmpl	%eax, %edi
	jle	.L5
	cltq
	addq	%rax, %rdx
	movl	$100000, (%rbx,%rdx,4)
.L5:
	addl	$1, %esi
	movl	$0, (%r8)
	addq	$400, %rcx
	addq	$404, %r8
	cmpl	%edi, %esi
	jne	.L6
	leaq	28(%rsp), %rax
	xorl	%r13d, %r13d
	leaq	32(%rsp), %r15
	movq	%rax, 8(%rsp)
	leaq	36(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L9:
	movq	8(%rsp), %rsi
	movq	%r15, %rdx
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %edx
	subl	$1, 28(%rsp)
	testl	%edx, %edx
	jle	.L7
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %eax
	movslq	28(%rsp), %rcx
	subl	$1, %eax
	leaq	(%rcx,%rcx,4), %rcx
	cltq
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rax,%rcx,4), %rax
	movl	$1, (%rbx,%rax,4)
	cmpl	%r14d, 32(%rsp)
	jg	.L8
.L7:
	movl	ru_ta_num(%rip), %eax
	addl	$1, %r13d
	cmpl	%r13d, %eax
	jg	.L9
	testl	%eax, %eax
	jle	.L2
	movl	%eax, %r11d
	leal	-1(%rax), %edx
	leaq	4+map(%rip), %rax
	xorl	%r10d, %r10d
	movq	%r11, %rbx
	imulq	$-400, %r11, %r11
	leaq	(%rax,%rdx,4), %r12
	xorl	%r9d, %r9d
	negq	%rbx
	salq	$2, %rbx
	.p2align 4,,10
	.p2align 3
.L10:
	leaq	map(%rip), %rdi
	movq	%r12, %r8
	xorl	%esi, %esi
	subq	%r10, %rdi
	.p2align 4,,10
	.p2align 3
.L14:
	leaq	(%rdi,%r10), %rax
	.p2align 4,,10
	.p2align 3
.L12:
	leaq	(%rax,%rsi), %rcx
	movl	(%rdi), %edx
	addl	(%rcx,%r9), %edx
	cmpl	(%rax), %edx
	jge	.L11
	movl	%edx, (%rax)
.L11:
	addq	$4, %rax
	cmpq	%r8, %rax
	jne	.L12
	subq	$400, %rsi
	leaq	400(%rax), %r8
	addq	$400, %rdi
	cmpq	%r11, %rsi
	jne	.L14
	subq	$4, %r10
	addq	$400, %r9
	cmpq	%rbx, %r10
	jne	.L10
.L2:
	leaq	40(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	40(%rsp), %eax
	testl	%eax, %eax
	jle	.L15
	xorl	%ebp, %ebp
	leaq	52(%rsp), %r15
	leaq	48(%rsp), %r14
	leaq	map(%rip), %rbx
	leaq	44(%rsp), %r13
	leaq	.LC3(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L18:
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%r15, %rcx
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	movl	48(%rsp), %esi
	subl	$1, %eax
	leal	-1(%rsi), %edx
	movl	%eax, 44(%rsp)
	cltq
	leaq	(%rax,%rax,4), %rax
	movl	%edx, 48(%rsp)
	movslq	%edx, %rdx
	leaq	(%rax,%rax,4), %rax
	leaq	(%rdx,%rax,4), %rax
	movl	(%rbx,%rax,4), %eax
	cmpl	52(%rsp), %eax
	jl	.L16
	leaq	.LC4(%rip), %rdi
	addl	$1, %ebp
	call	puts@PLT
	cmpl	40(%rsp), %ebp
	jl	.L18
.L15:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	addq	$72, %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
.L16:
	.cfi_restore_state
	leal	1(%rax), %edx
	leaq	.LC5(%rip), %rsi
	xorl	%eax, %eax
	addl	$1, %ebp
	movl	$1, %edi
	call	__printf_chk@PLT
	cmpl	%ebp, 40(%rsp)
	jg	.L18
	jmp	.L15
.L20:
	xorl	%eax, %eax
	jmp	.L3
.L28:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	map
	.bss
	.align 32
	.type	map, @object
	.size	map, 40000
map:
	.zero	40000
	.globl	ru_ta_num
	.align 4
	.type	ru_ta_num, @object
	.size	ru_ta_num, 4
ru_ta_num:
	.zero	4
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	100000
	.long	100000
	.long	100000
	.long	100000
	.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 ru_ta_num;
int map[100][100];

int main(void) {
	int i,j,k;
	int ru_ta_id;
	int ru_ta_connect_num;
	int ru_ta_connect;
	int packet_num;
	int packet_from,packet_to,packet_ttl;
	scanf("%d",&ru_ta_num);
	for(i=0;i<ru_ta_num;i++) {
		for(j=0;j<ru_ta_num;j++) {
			map[i][j]=100000;
		}
		map[i][i]=0;
	}
	for(i=0;i<ru_ta_num;i++) {
		scanf("%d%d",&ru_ta_id,&ru_ta_connect_num);
		ru_ta_id--;
		for(j=0;j<ru_ta_connect_num;j++) {
			scanf("%d",&ru_ta_connect);
			map[ru_ta_id][ru_ta_connect-1]=1;
		}
	}
	for(k=0;k<ru_ta_num;k++) {
		for(i=0;i<ru_ta_num;i++) {
			for(j=0;j<ru_ta_num;j++) {
				if(map[i][k]+map[k][j]<map[i][j]) {
					map[i][j]=map[i][k]+map[k][j];
				}
			}
		}
	}
	scanf("%d",&packet_num);
	for(i=0;i<packet_num;i++) {
		scanf("%d%d%d",&packet_from,&packet_to,&packet_ttl);
		packet_from--;packet_to--;
		if(packet_ttl<map[packet_from][packet_to]+1) {
			puts("NA");
		} else {
			printf("%d\n",map[packet_from][packet_to]+1);
		}
	}
	return 0;
}
7
1 4 2 5 4 3
2 1 5
3 1 6
4 1 7
5 2 7 6
6 1 1
7 0
6
1 2 2
1 5 3
1 2 0
5 1 3
6 3 3
1 7 4
 7
1 4 2 5 4 6
2 1 5
3 1 6
4 1 7
5 2 7 6
6 1 1
7 0
6
1 2 2
1 3 3
1 2 0
5 1 3
6 3 3
1 7 4
 7
1 4 2 5 4 3
2 1 5
3 1 6
4 1 7
5 2 7 6
6 1 1
7 0
6
1 2 2
1 3 6
1 2 0
5 1 3
6 3 1
1 7 4
 7
1 4 2 7 4 6
2 1 5
3 1 6
4 1 7
5 2 7 6
6 1 1
7 0
6
1 2 2
1 3 3
1 2 0
5 1 3
6 3 3
1 7 4
 7
1 4 2 7 3 6
2 1 5
3 1 6
4 1 7
5 2 7 6
6 1 1
7 0
6
1 2 2
1 3 3
1 2 0
5 1 3
6 3 3
1 7 4
 7
1 4 3 5 4 3
2 1 5
3 1 6
4 1 7
5 2 7 6
6 1 1
7 0
6
1 2 2
1 5 3
1 2 1
5 1 3
6 3 3
1 7 4
 7
1 4 2 5 4 3
2 1 5
3 1 6
4 1 7
5 2 7 6
6 1 1
7 0
6
1 2 2
2 3 3
1 2 0
5 1 3
6 3 3
1 7 4
 7
1 4 2 5 4 6
2 1 5
3 1 6
4 1 7
5 2 7 6
6 1 2
7 0
6
1 2 2
1 3 3
1 2 0
5 1 3
6 3 3
1 7 4
 7
1 4 2 7 3 6
2 1 7
3 1 6
4 1 7
5 2 7 6
6 1 1
7 0
6
1 2 2
1 3 3
1 2 0
5 1 3
6 3 3
1 5 4
 7
1 4 4 5 4 6
2 1 5
3 1 6
4 1 7
5 2 7 6
6 1 1
7 0
6
1 2 2
1 3 2
1 2 0
5 1 3
6 3 3
1 7 4

2
2
NA
3
3
3
 2
NA
NA
3
NA
3
 2
2
NA
3
NA
3
 2
NA
NA
3
NA
2
 2
2
NA
3
3
2
 NA
2
NA
3
3
3
 2
NA
NA
3
3
3
 2
NA
NA
NA
NA
3
 2
2
NA
3
3
NA
 NA
NA
NA
3
NA
3

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 ru_ta_num;
int map[100][100];

int main(void) {
	int i,j,k;
	int ru_ta_id;
	int ru_ta_connect_num;
	int ru_ta_connect;
	int packet_num;
	int packet_from,packet_to,packet_ttl;
	scanf("%d",&ru_ta_num);
	for(i=0;i<ru_ta_num;i++) {
		for(j=0;j<ru_ta_num;j++) {
			map[i][j]=100000;
		}
		map[i][i]=0;
	}
	for(i=0;i<ru_ta_num;i++) {
		scanf("%d%d",&ru_ta_id,&ru_ta_connect_num);
		ru_ta_id--;
		for(j=0;j<ru_ta_connect_num;j++) {
			scanf("%d",&ru_ta_connect);
			map[ru_ta_id][ru_ta_connect-1]=1;
		}
	}
	for(k=0;k<ru_ta_num;k++) {
		for(i=0;i<ru_ta_num;i++) {
			for(j=0;j<ru_ta_num;j++) {
				if(map[i][k]+map[k][j]<map[i][j]) {
					map[i][j]=map[i][k]+map[k][j];
				}
			}
		}
	}
	scanf("%d",&packet_num);
	for(i=0;i<packet_num;i++) {
		scanf("%d%d%d",&packet_from,&packet_to,&packet_ttl);
		packet_from--;packet_to--;
		if(packet_ttl<map[packet_from][packet_to]+1) {
			puts("NA");
		} else {
			printf("%d\n",map[packet_from][packet_to]+1);
		}
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	ru_ta_num
	.bss
	.align 4
	.type	ru_ta_num, @object
	.size	ru_ta_num, 4
ru_ta_num:
	.zero	4
	.globl	map
	.align 32
	.type	map, @object
	.size	map, 40000
map:
	.zero	40000
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d%d%d"
.LC3:
	.string	"NA"
.LC4:
	.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
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	ru_ta_num(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20(%rbp)
	jmp	.L2
.L5:
	movl	$0, -16(%rbp)
	jmp	.L3
.L4:
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	$100000, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L3:
	movl	ru_ta_num(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L4
	movl	-20(%rbp), %eax
	cltq
	imulq	$404, %rax, %rax
	leaq	map(%rip), %rdx
	movl	$0, (%rax,%rdx)
	addl	$1, -20(%rbp)
.L2:
	movl	ru_ta_num(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L5
	movl	$0, -20(%rbp)
	jmp	.L6
.L9:
	leaq	-44(%rbp), %rdx
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -48(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L7
.L8:
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %eax
	movl	-40(%rbp), %edx
	subl	$1, %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	$1, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L7:
	movl	-44(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L8
	addl	$1, -20(%rbp)
.L6:
	movl	ru_ta_num(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L9
	movl	$0, -12(%rbp)
	jmp	.L10
.L16:
	movl	$0, -20(%rbp)
	jmp	.L11
.L15:
	movl	$0, -16(%rbp)
	jmp	.L12
.L14:
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jge	.L13
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L13:
	addl	$1, -16(%rbp)
.L12:
	movl	ru_ta_num(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L14
	addl	$1, -20(%rbp)
.L11:
	movl	ru_ta_num(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L15
	addl	$1, -12(%rbp)
.L10:
	movl	ru_ta_num(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L16
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20(%rbp)
	jmp	.L17
.L20:
	leaq	-24(%rbp), %rcx
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -32(%rbp)
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -28(%rbp)
	movl	-32(%rbp), %eax
	movl	-28(%rbp), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L18
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L19
.L18:
	movl	-32(%rbp), %eax
	movl	-28(%rbp), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L19:
	addl	$1, -20(%rbp)
.L17:
	movl	-36(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L20
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	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.
val
	.file	"temp.c"
	.text
	.globl	ru_ta_num
	.bss
	.align 4
	.type	ru_ta_num, @object
	.size	ru_ta_num, 4
ru_ta_num:
	.zero	4
	.globl	map
	.align 32
	.type	map, @object
	.size	map, 40000
map:
	.zero	40000
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d%d%d"
.LC3:
	.string	"NA"
.LC4:
	.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
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	ru_ta_num(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20(%rbp)
	jmp	.L2
.L5:
	movl	$0, -16(%rbp)
	jmp	.L3
.L4:
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	$100000, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L3:
	movl	ru_ta_num(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L4
	movl	-20(%rbp), %eax
	cltq
	imulq	$404, %rax, %rax
	leaq	map(%rip), %rdx
	movl	$0, (%rax,%rdx)
	addl	$1, -20(%rbp)
.L2:
	movl	ru_ta_num(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L5
	movl	$0, -20(%rbp)
	jmp	.L6
.L9:
	leaq	-44(%rbp), %rdx
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -48(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L7
.L8:
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %eax
	movl	-40(%rbp), %edx
	subl	$1, %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	$1, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L7:
	movl	-44(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L8
	addl	$1, -20(%rbp)
.L6:
	movl	ru_ta_num(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L9
	movl	$0, -12(%rbp)
	jmp	.L10
.L16:
	movl	$0, -20(%rbp)
	jmp	.L11
.L15:
	movl	$0, -16(%rbp)
	jmp	.L12
.L14:
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jge	.L13
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L13:
	addl	$1, -16(%rbp)
.L12:
	movl	ru_ta_num(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L14
	addl	$1, -20(%rbp)
.L11:
	movl	ru_ta_num(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L15
	addl	$1, -12(%rbp)
.L10:
	movl	ru_ta_num(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L16
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20(%rbp)
	jmp	.L17
.L20:
	leaq	-24(%rbp), %rcx
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -32(%rbp)
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -28(%rbp)
	movl	-32(%rbp), %eax
	movl	-28(%rbp), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L18
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L19
.L18:
	movl	-32(%rbp), %eax
	movl	-28(%rbp), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L19:
	addl	$1, -20(%rbp)
.L17:
	movl	-36(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L20
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	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:
