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>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int acs(const void *a, const void *b) { 
  return *(int*)a - *(int*)b;
} /* 1,2,3,4.. */
int des(const void *a, const void *b) {
  return *(int*)b - *(int*)a;
} /* 8,7,6,5.. */
int cmp_char(const void *a, const void *b) { 
  return *(char*)a - *(char*)b;
} /* a,b,c,d.. */
int cmp_str(const void *a, const void *b) {
  return strcmp(*(const char **)a, *(const char **)b);
} /* aaa,aab.. */
#define min(a,b) (a < b ? a : b)
#define max(a,b) (a > b ? a : b)
#define rep(i, l, r) for (int i = l; i < r; i++)
#define MAX 100005
#define MOD 1000000007
#define INF 1000000009
typedef long long int lli;

typedef struct list {
  int node;
  int dist;
  struct list *next;
} list;

list *graph[MAX];

void initGraph(void) 
{
  for (int i = 0; i < MAX; i++)
    graph[i] = NULL;
}

void addEdge(int node1, int node2, lli dist)
{
  list *new1 = (list *)malloc(sizeof(list *));
  new1->node = node2;
  new1->dist = dist;
  new1->next = graph[node1];
  graph[node1] = new1;

  list *new2 = (list *)malloc(sizeof(list *));
  new2->node = node1;
  new2->dist = dist;
  new2->next = graph[node2];
  graph[node2] = new2;
}

// 頂点k(根)からの距離
lli kyori[MAX];

void dfs(int n, int p) {
  list *c = graph[n];
  for ( ; c != NULL; c = c->next ) {
    int cn = c->node;
    if ( cn == p ) continue;
    kyori[cn] = kyori[n] + c->dist;
    dfs(cn, n);
  }
}

int main(void) {
  int n;
  scanf("%d", &n);
  initGraph();
  int a, b, c;
  rep(i, 0, n-1) {
    scanf("%d %d %d", &a, &b, &c);
    addEdge(a, b, c);
  }
  int q, k;
  scanf("%d %d", &q, &k);
  int x[MAX], y[MAX];
  rep(i, 0, q) scanf("%d %d", &x[i], &y[i]);

  // 頂点kが根
  kyori[k] = 0;
  dfs(k, 0);

  rep(i, 0, q) {
    printf("%lld\n", kyori[x[i]] + kyori[y[i]]);
  }
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	acs
	.type	acs, @function
acs:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	acs, .-acs
	.globl	des
	.type	des, @function
des:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	des, .-des
	.globl	cmp_char
	.type	cmp_char, @function
cmp_char:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %edx
	movq	-16(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	cmp_char, .-cmp_char
	.globl	cmp_str
	.type	cmp_str, @function
cmp_str:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	cmp_str, .-cmp_str
	.globl	graph
	.bss
	.align 32
	.type	graph, @object
	.size	graph, 800040
graph:
	.zero	800040
	.text
	.globl	initGraph
	.type	initGraph, @function
initGraph:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -4(%rbp)
	jmp	.L10
.L11:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	graph(%rip), %rax
	movq	$0, (%rdx,%rax)
	addl	$1, -4(%rbp)
.L10:
	cmpl	$100004, -4(%rbp)
	jle	.L11
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	initGraph, .-initGraph
	.globl	addEdge
	.type	addEdge, @function
addEdge:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movq	%rdx, -32(%rbp)
	movl	$8, %edi
	call	malloc@PLT
	movq	%rax, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	-24(%rbp), %edx
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	movl	%eax, %edx
	movq	-16(%rbp), %rax
	movl	%edx, 4(%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	graph(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-16(%rbp), %rax
	movq	%rdx, 8(%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	graph(%rip), %rdx
	movq	-16(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
	movl	$8, %edi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movl	-20(%rbp), %edx
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	movl	%eax, %edx
	movq	-8(%rbp), %rax
	movl	%edx, 4(%rax)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	graph(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 8(%rax)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	graph(%rip), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	addEdge, .-addEdge
	.globl	kyori
	.bss
	.align 32
	.type	kyori, @object
	.size	kyori, 800040
kyori:
	.zero	800040
	.text
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	graph(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -8(%rbp)
	jmp	.L14
.L17:
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	cmpl	-24(%rbp), %eax
	je	.L18
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	kyori(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-8(%rbp), %rax
	movl	4(%rax), %eax
	cltq
	leaq	(%rdx,%rax), %rcx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	kyori(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movl	-20(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dfs
	jmp	.L16
.L18:
	nop
.L16:
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -8(%rbp)
.L14:
	cmpq	$0, -8(%rbp)
	jne	.L17
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	dfs, .-dfs
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d"
.LC2:
	.string	"%d %d"
.LC3:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB13:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-798720(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1392, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-800100(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	call	initGraph
	movl	$0, -800076(%rbp)
	jmp	.L20
.L21:
	leaq	-800088(%rbp), %rcx
	leaq	-800092(%rbp), %rdx
	leaq	-800096(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-800088(%rbp), %eax
	movslq	%eax, %rdx
	movl	-800092(%rbp), %ecx
	movl	-800096(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	addEdge
	addl	$1, -800076(%rbp)
.L20:
	movl	-800100(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -800076(%rbp)
	jl	.L21
	leaq	-800080(%rbp), %rdx
	leaq	-800084(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -800072(%rbp)
	jmp	.L22
.L23:
	leaq	-400032(%rbp), %rdx
	movl	-800072(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-800064(%rbp), %rcx
	movl	-800072(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -800072(%rbp)
.L22:
	movl	-800084(%rbp), %eax
	cmpl	%eax, -800072(%rbp)
	jl	.L23
	movl	-800080(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	kyori(%rip), %rax
	movq	$0, (%rdx,%rax)
	movl	-800080(%rbp), %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	dfs
	movl	$0, -800068(%rbp)
	jmp	.L24
.L25:
	movl	-800068(%rbp), %eax
	cltq
	movl	-800064(%rbp,%rax,4), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	kyori(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-800068(%rbp), %eax
	cltq
	movl	-400032(%rbp,%rax,4), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	kyori(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -800068(%rbp)
.L24:
	movl	-800084(%rbp), %eax
	cmpl	%eax, -800068(%rbp)
	jl	.L25
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L27
	call	__stack_chk_fail@PLT
.L27:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.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
	.p2align 4
	.globl	acs
	.type	acs, @function
acs:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	acs, .-acs
	.p2align 4
	.globl	des
	.type	des, @function
des:
.LFB52:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	subl	(%rdi), %eax
	ret
	.cfi_endproc
.LFE52:
	.size	des, .-des
	.p2align 4
	.globl	cmp_char
	.type	cmp_char, @function
cmp_char:
.LFB53:
	.cfi_startproc
	endbr64
	movsbl	(%rdi), %eax
	movsbl	(%rsi), %edx
	subl	%edx, %eax
	ret
	.cfi_endproc
.LFE53:
	.size	cmp_char, .-cmp_char
	.p2align 4
	.globl	cmp_str
	.type	cmp_str, @function
cmp_str:
.LFB54:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rsi
	movq	(%rdi), %rdi
	jmp	strcmp@PLT
	.cfi_endproc
.LFE54:
	.size	cmp_str, .-cmp_str
	.p2align 4
	.globl	initGraph
	.type	initGraph, @function
initGraph:
.LFB55:
	.cfi_startproc
	endbr64
	movl	$800040, %edx
	xorl	%esi, %esi
	leaq	graph(%rip), %rdi
	jmp	memset@PLT
	.cfi_endproc
.LFE55:
	.size	initGraph, .-initGraph
	.p2align 4
	.globl	addEdge
	.type	addEdge, @function
addEdge:
.LFB56:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	graph(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rdx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movl	%edi, %ebp
	movl	$8, %edi
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movslq	%esi, %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	call	malloc@PLT
	movslq	%ebp, %rdx
	movd	%r12d, %xmm1
	movd	%ebx, %xmm0
	movq	0(%r13,%rdx,8), %rcx
	punpckldq	%xmm1, %xmm0
	movl	$8, %edi
	movq	%rax, 0(%r13,%rdx,8)
	movq	%xmm0, (%rax)
	movq	%rcx, 8(%rax)
	call	malloc@PLT
	movq	0(%r13,%rbx,8), %rdx
	movd	%ebp, %xmm0
	movd	%r12d, %xmm2
	punpckldq	%xmm2, %xmm0
	movq	%rax, 0(%r13,%rbx,8)
	movq	%rdx, 8(%rax)
	movq	%xmm0, (%rax)
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE56:
	.size	addEdge, .-addEdge
	.p2align 4
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB57:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edi, %rax
	leaq	graph(%rip), %r10
	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
	subq	$152, %rsp
	.cfi_def_cfa_offset 208
	movq	%rax, 96(%rsp)
	movq	(%r10,%rax,8), %rax
	movl	%edi, 92(%rsp)
	movl	%esi, 112(%rsp)
	movq	%rax, 72(%rsp)
	testq	%rax, %rax
	je	.L9
	leaq	kyori(%rip), %r11
.L29:
	movq	72(%rsp), %rdi
	movl	(%rdi), %eax
	movl	%eax, 88(%rsp)
	cmpl	112(%rsp), %eax
	je	.L11
	movq	96(%rsp), %rcx
	movslq	%eax, %rsi
	movslq	4(%rdi), %rax
	movq	%rsi, 104(%rsp)
	addq	(%r11,%rcx,8), %rax
	movq	%rax, (%r11,%rsi,8)
	movq	(%r10,%rsi,8), %rax
	movq	%rax, 64(%rsp)
	testq	%rax, %rax
	je	.L11
.L28:
	movq	64(%rsp), %rdi
	movl	(%rdi), %eax
	movl	%eax, 44(%rsp)
	cmpl	%eax, 92(%rsp)
	je	.L12
	movq	104(%rsp), %rsi
	movslq	%eax, %rcx
	movslq	4(%rdi), %rax
	movq	%rcx, 80(%rsp)
	addq	(%r11,%rsi,8), %rax
	movq	%rax, (%r11,%rcx,8)
	movq	(%r10,%rcx,8), %rax
	movq	%rax, 48(%rsp)
	testq	%rax, %rax
	je	.L12
.L27:
	movq	48(%rsp), %rsi
	movl	(%rsi), %eax
	movl	%eax, 28(%rsp)
	cmpl	%eax, 88(%rsp)
	je	.L13
	movq	80(%rsp), %rcx
	movslq	%eax, %rdi
	movslq	4(%rsi), %rax
	movq	%rdi, 56(%rsp)
	addq	(%r11,%rcx,8), %rax
	movq	%rax, (%r11,%rdi,8)
	movq	(%r10,%rdi,8), %rax
	movq	%rax, 16(%rsp)
	testq	%rax, %rax
	je	.L13
.L26:
	movq	16(%rsp), %rdi
	movl	(%rdi), %eax
	movl	%eax, 24(%rsp)
	cmpl	%eax, 44(%rsp)
	je	.L14
	movslq	%eax, %rcx
	movslq	4(%rdi), %rax
	movq	56(%rsp), %rdi
	movq	(%r10,%rcx,8), %r9
	movq	%rcx, 32(%rsp)
	addq	(%r11,%rdi,8), %rax
	movq	%rax, (%r11,%rcx,8)
	testq	%r9, %r9
	je	.L14
.L25:
	movl	(%r9), %eax
	movl	%eax, 40(%rsp)
	cmpl	%eax, 28(%rsp)
	je	.L15
	movslq	%eax, %rsi
	movq	32(%rsp), %rdi
	movslq	4(%r9), %rax
	movq	(%r10,%rsi,8), %r13
	movq	%rsi, 8(%rsp)
	addq	(%r11,%rdi,8), %rax
	movq	%rax, (%r11,%rsi,8)
	testq	%r13, %r13
	je	.L15
.L24:
	movl	0(%r13), %eax
	cmpl	%eax, 24(%rsp)
	je	.L16
	movq	8(%rsp), %rdi
	movslq	4(%r13), %rdx
	movslq	%eax, %r15
	addq	(%r11,%rdi,8), %rdx
	movq	%rdx, (%r11,%r15,8)
	movq	(%r10,%r15,8), %rdx
	testq	%rdx, %rdx
	je	.L16
	movl	%eax, %r8d
.L23:
	movl	(%rdx), %ecx
	cmpl	%ecx, 40(%rsp)
	je	.L17
	movslq	%ecx, %r12
	movslq	4(%rdx), %rax
	addq	(%r11,%r15,8), %rax
	movq	(%r10,%r12,8), %rbx
	movq	%rax, (%r11,%r12,8)
	testq	%rbx, %rbx
	je	.L17
.L22:
	movl	(%rbx), %eax
	cmpl	%eax, %r8d
	je	.L18
	movslq	%eax, %r14
	movslq	4(%rbx), %rsi
	addq	(%r11,%r12,8), %rsi
	movq	(%r10,%r14,8), %rbp
	movq	%rsi, (%r11,%r14,8)
	testq	%rbp, %rbp
	je	.L18
.L21:
	movl	0(%rbp), %edi
	cmpl	%edi, %ecx
	je	.L19
	movslq	4(%rbp), %rsi
	addq	(%r11,%r14,8), %rsi
	movl	%ecx, 132(%rsp)
	movslq	%edi, %rcx
	movq	%rsi, (%r11,%rcx,8)
	movl	%eax, %esi
	movq	%rdx, 136(%rsp)
	movl	%r8d, 128(%rsp)
	movq	%r9, 120(%rsp)
	movl	%eax, 116(%rsp)
	call	dfs
	movq	8(%rbp), %rbp
	movl	116(%rsp), %eax
	leaq	kyori(%rip), %r11
	movq	120(%rsp), %r9
	movl	128(%rsp), %r8d
	leaq	graph(%rip), %r10
	testq	%rbp, %rbp
	movl	132(%rsp), %ecx
	movq	136(%rsp), %rdx
	jne	.L21
	.p2align 4,,10
	.p2align 3
.L18:
	movq	8(%rbx), %rbx
	testq	%rbx, %rbx
	jne	.L22
.L17:
	movq	8(%rdx), %rdx
	testq	%rdx, %rdx
	jne	.L23
.L16:
	movq	8(%r13), %r13
	testq	%r13, %r13
	jne	.L24
.L15:
	movq	8(%r9), %r9
	testq	%r9, %r9
	jne	.L25
.L14:
	movq	16(%rsp), %rax
	movq	8(%rax), %rax
	movq	%rax, 16(%rsp)
	testq	%rax, %rax
	jne	.L26
.L13:
	movq	48(%rsp), %rax
	movq	8(%rax), %rax
	movq	%rax, 48(%rsp)
	testq	%rax, %rax
	jne	.L27
.L12:
	movq	64(%rsp), %rax
	movq	8(%rax), %rax
	movq	%rax, 64(%rsp)
	testq	%rax, %rax
	jne	.L28
.L11:
	movq	72(%rsp), %rax
	movq	8(%rax), %rax
	movq	%rax, 72(%rsp)
	testq	%rax, %rax
	jne	.L29
.L9:
	addq	$152, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L19:
	.cfi_restore_state
	movq	8(%rbp), %rbp
	testq	%rbp, %rbp
	jne	.L21
	movq	8(%rbx), %rbx
	testq	%rbx, %rbx
	jne	.L22
	jmp	.L17
	.cfi_endproc
.LFE57:
	.size	dfs, .-dfs
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d %d %d"
.LC3:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB58:
	.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	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798776
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1400, %rsp
	.cfi_def_cfa_offset 800176
	leaq	.LC0(%rip), %rdi
	leaq	graph(%rip), %r13
	movq	%fs:40, %rax
	movq	%rax, 800104(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	xorl	%esi, %esi
	movl	$800040, %edx
	movq	%r13, %rdi
	call	memset@PLT
	cmpl	$1, 24(%rsp)
	jle	.L73
	leaq	28(%rsp), %rax
	xorl	%r12d, %r12d
	leaq	36(%rsp), %r15
	movq	%rax, 8(%rsp)
	leaq	32(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L70:
	movq	8(%rsp), %rsi
	movq	%r15, %rcx
	movq	%r14, %rdx
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rdi
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %ebp
	movl	36(%rsp), %eax
	movl	$8, %edi
	movslq	32(%rsp), %rbx
	movl	%eax, 4(%rsp)
	call	malloc@PLT
	movslq	%ebp, %rdx
	movd	4(%rsp), %xmm1
	movd	%ebx, %xmm0
	movq	0(%r13,%rdx,8), %rcx
	movq	%rax, 0(%r13,%rdx,8)
	movl	$8, %edi
	punpckldq	%xmm1, %xmm0
	movq	%rcx, 8(%rax)
	movq	%xmm0, (%rax)
	call	malloc@PLT
	movd	4(%rsp), %xmm1
	movq	0(%r13,%rbx,8), %rdx
	movd	%ebp, %xmm0
	movq	%rax, 0(%r13,%rbx,8)
	punpckldq	%xmm1, %xmm0
	movq	%rdx, 8(%rax)
	movq	%xmm0, (%rax)
	movl	24(%rsp), %eax
	subl	$1, %eax
	cmpl	%r12d, %eax
	jg	.L70
.L73:
	leaq	.LC1(%rip), %r14
	leaq	44(%rsp), %rdx
	xorl	%eax, %eax
	leaq	40(%rsp), %rsi
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	movl	40(%rsp), %eax
	testl	%eax, %eax
	jle	.L86
	leaq	48(%rsp), %r12
	xorl	%ebx, %ebx
	leaq	400080(%rsp), %rbp
	movq	%r12, %r13
	.p2align 4,,10
	.p2align 3
.L74:
	leaq	0(%rbp,%rbx,4), %rdx
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	40(%rsp), %r15d
	addq	$1, %rbx
	addq	$4, %r13
	cmpl	%ebx, %r15d
	jg	.L74
	movslq	44(%rsp), %rax
	leaq	kyori(%rip), %r14
	xorl	%esi, %esi
	movq	$0, (%r14,%rax,8)
	movq	%rax, %rdi
	call	dfs
	testl	%r15d, %r15d
	jle	.L76
	xorl	%ebx, %ebx
	leaq	.LC3(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L75:
	movslq	(%r12,%rbx,4), %rax
	movslq	0(%rbp,%rbx,4), %rdx
	movq	%r13, %rsi
	movl	$1, %edi
	addq	$1, %rbx
	movq	(%r14,%rdx,8), %rdx
	addq	(%r14,%rax,8), %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	%ebx, 40(%rsp)
	jg	.L75
.L76:
	movq	800104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L87
	addq	$800120, %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
.L86:
	.cfi_restore_state
	movslq	44(%rsp), %rdx
	leaq	kyori(%rip), %rax
	xorl	%esi, %esi
	movq	$0, (%rax,%rdx,8)
	movq	%rdx, %rdi
	call	dfs
	jmp	.L76
.L87:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE58:
	.size	main, .-main
	.globl	kyori
	.bss
	.align 32
	.type	kyori, @object
	.size	kyori, 800040
kyori:
	.zero	800040
	.globl	graph
	.align 32
	.type	graph, @object
	.size	graph, 800040
graph:
	.zero	800040
	.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
	.p2align 4
	.globl	acs
	.type	acs, @function
acs:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	acs, .-acs
	.p2align 4
	.globl	des
	.type	des, @function
des:
.LFB52:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	subl	(%rdi), %eax
	ret
	.cfi_endproc
.LFE52:
	.size	des, .-des
	.p2align 4
	.globl	cmp_char
	.type	cmp_char, @function
cmp_char:
.LFB53:
	.cfi_startproc
	endbr64
	movsbl	(%rdi), %eax
	movsbl	(%rsi), %edx
	subl	%edx, %eax
	ret
	.cfi_endproc
.LFE53:
	.size	cmp_char, .-cmp_char
	.p2align 4
	.globl	cmp_str
	.type	cmp_str, @function
cmp_str:
.LFB54:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rsi
	movq	(%rdi), %rdi
	jmp	strcmp@PLT
	.cfi_endproc
.LFE54:
	.size	cmp_str, .-cmp_str
	.p2align 4
	.globl	initGraph
	.type	initGraph, @function
initGraph:
.LFB55:
	.cfi_startproc
	endbr64
	movl	$800040, %edx
	xorl	%esi, %esi
	leaq	graph(%rip), %rdi
	jmp	memset@PLT
	.cfi_endproc
.LFE55:
	.size	initGraph, .-initGraph
	.p2align 4
	.globl	addEdge
	.type	addEdge, @function
addEdge:
.LFB56:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	graph(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rdx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movl	%edi, %ebp
	movl	$8, %edi
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movslq	%esi, %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	call	malloc@PLT
	movslq	%ebp, %rdx
	movd	%r12d, %xmm1
	movd	%ebx, %xmm0
	movq	0(%r13,%rdx,8), %rcx
	punpckldq	%xmm1, %xmm0
	movl	$8, %edi
	movq	%rax, 0(%r13,%rdx,8)
	movq	%xmm0, (%rax)
	movq	%rcx, 8(%rax)
	call	malloc@PLT
	movq	0(%r13,%rbx,8), %rdx
	movd	%ebp, %xmm0
	movd	%r12d, %xmm2
	punpckldq	%xmm2, %xmm0
	movq	%rax, 0(%r13,%rbx,8)
	movq	%rdx, 8(%rax)
	movq	%xmm0, (%rax)
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE56:
	.size	addEdge, .-addEdge
	.p2align 4
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB57:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edi, %rax
	leaq	graph(%rip), %r10
	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
	subq	$152, %rsp
	.cfi_def_cfa_offset 208
	movq	%rax, 96(%rsp)
	movq	(%r10,%rax,8), %rax
	movl	%edi, 92(%rsp)
	movl	%esi, 112(%rsp)
	movq	%rax, 72(%rsp)
	testq	%rax, %rax
	je	.L9
	leaq	kyori(%rip), %r11
.L29:
	movq	72(%rsp), %rdi
	movl	(%rdi), %eax
	movl	%eax, 88(%rsp)
	cmpl	112(%rsp), %eax
	je	.L11
	movq	96(%rsp), %rcx
	movslq	%eax, %rsi
	movslq	4(%rdi), %rax
	movq	%rsi, 104(%rsp)
	addq	(%r11,%rcx,8), %rax
	movq	%rax, (%r11,%rsi,8)
	movq	(%r10,%rsi,8), %rax
	movq	%rax, 64(%rsp)
	testq	%rax, %rax
	je	.L11
.L28:
	movq	64(%rsp), %rdi
	movl	(%rdi), %eax
	movl	%eax, 44(%rsp)
	cmpl	%eax, 92(%rsp)
	je	.L12
	movq	104(%rsp), %rsi
	movslq	%eax, %rcx
	movslq	4(%rdi), %rax
	movq	%rcx, 80(%rsp)
	addq	(%r11,%rsi,8), %rax
	movq	%rax, (%r11,%rcx,8)
	movq	(%r10,%rcx,8), %rax
	movq	%rax, 48(%rsp)
	testq	%rax, %rax
	je	.L12
.L27:
	movq	48(%rsp), %rsi
	movl	(%rsi), %eax
	movl	%eax, 28(%rsp)
	cmpl	%eax, 88(%rsp)
	je	.L13
	movq	80(%rsp), %rcx
	movslq	%eax, %rdi
	movslq	4(%rsi), %rax
	movq	%rdi, 56(%rsp)
	addq	(%r11,%rcx,8), %rax
	movq	%rax, (%r11,%rdi,8)
	movq	(%r10,%rdi,8), %rax
	movq	%rax, 16(%rsp)
	testq	%rax, %rax
	je	.L13
.L26:
	movq	16(%rsp), %rdi
	movl	(%rdi), %eax
	movl	%eax, 24(%rsp)
	cmpl	%eax, 44(%rsp)
	je	.L14
	movslq	%eax, %rcx
	movslq	4(%rdi), %rax
	movq	56(%rsp), %rdi
	movq	(%r10,%rcx,8), %r9
	movq	%rcx, 32(%rsp)
	addq	(%r11,%rdi,8), %rax
	movq	%rax, (%r11,%rcx,8)
	testq	%r9, %r9
	je	.L14
.L25:
	movl	(%r9), %eax
	movl	%eax, 40(%rsp)
	cmpl	%eax, 28(%rsp)
	je	.L15
	movslq	%eax, %rsi
	movq	32(%rsp), %rdi
	movslq	4(%r9), %rax
	movq	(%r10,%rsi,8), %r13
	movq	%rsi, 8(%rsp)
	addq	(%r11,%rdi,8), %rax
	movq	%rax, (%r11,%rsi,8)
	testq	%r13, %r13
	je	.L15
.L24:
	movl	0(%r13), %eax
	cmpl	%eax, 24(%rsp)
	je	.L16
	movq	8(%rsp), %rdi
	movslq	4(%r13), %rdx
	movslq	%eax, %r15
	addq	(%r11,%rdi,8), %rdx
	movq	%rdx, (%r11,%r15,8)
	movq	(%r10,%r15,8), %rdx
	testq	%rdx, %rdx
	je	.L16
	movl	%eax, %r8d
.L23:
	movl	(%rdx), %ecx
	cmpl	%ecx, 40(%rsp)
	je	.L17
	movslq	%ecx, %r12
	movslq	4(%rdx), %rax
	addq	(%r11,%r15,8), %rax
	movq	(%r10,%r12,8), %rbx
	movq	%rax, (%r11,%r12,8)
	testq	%rbx, %rbx
	je	.L17
.L22:
	movl	(%rbx), %eax
	cmpl	%eax, %r8d
	je	.L18
	movslq	%eax, %r14
	movslq	4(%rbx), %rsi
	addq	(%r11,%r12,8), %rsi
	movq	(%r10,%r14,8), %rbp
	movq	%rsi, (%r11,%r14,8)
	testq	%rbp, %rbp
	je	.L18
.L21:
	movl	0(%rbp), %edi
	cmpl	%edi, %ecx
	je	.L19
	movslq	4(%rbp), %rsi
	addq	(%r11,%r14,8), %rsi
	movl	%ecx, 132(%rsp)
	movslq	%edi, %rcx
	movq	%rsi, (%r11,%rcx,8)
	movl	%eax, %esi
	movq	%rdx, 136(%rsp)
	movl	%r8d, 128(%rsp)
	movq	%r9, 120(%rsp)
	movl	%eax, 116(%rsp)
	call	dfs
	movq	8(%rbp), %rbp
	movl	116(%rsp), %eax
	leaq	kyori(%rip), %r11
	movq	120(%rsp), %r9
	movl	128(%rsp), %r8d
	leaq	graph(%rip), %r10
	testq	%rbp, %rbp
	movl	132(%rsp), %ecx
	movq	136(%rsp), %rdx
	jne	.L21
	.p2align 4,,10
	.p2align 3
.L18:
	movq	8(%rbx), %rbx
	testq	%rbx, %rbx
	jne	.L22
.L17:
	movq	8(%rdx), %rdx
	testq	%rdx, %rdx
	jne	.L23
.L16:
	movq	8(%r13), %r13
	testq	%r13, %r13
	jne	.L24
.L15:
	movq	8(%r9), %r9
	testq	%r9, %r9
	jne	.L25
.L14:
	movq	16(%rsp), %rax
	movq	8(%rax), %rax
	movq	%rax, 16(%rsp)
	testq	%rax, %rax
	jne	.L26
.L13:
	movq	48(%rsp), %rax
	movq	8(%rax), %rax
	movq	%rax, 48(%rsp)
	testq	%rax, %rax
	jne	.L27
.L12:
	movq	64(%rsp), %rax
	movq	8(%rax), %rax
	movq	%rax, 64(%rsp)
	testq	%rax, %rax
	jne	.L28
.L11:
	movq	72(%rsp), %rax
	movq	8(%rax), %rax
	movq	%rax, 72(%rsp)
	testq	%rax, %rax
	jne	.L29
.L9:
	addq	$152, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L19:
	.cfi_restore_state
	movq	8(%rbp), %rbp
	testq	%rbp, %rbp
	jne	.L21
	movq	8(%rbx), %rbx
	testq	%rbx, %rbx
	jne	.L22
	jmp	.L17
	.cfi_endproc
.LFE57:
	.size	dfs, .-dfs
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d %d %d"
.LC3:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB58:
	.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	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798776
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1400, %rsp
	.cfi_def_cfa_offset 800176
	leaq	.LC0(%rip), %rdi
	leaq	graph(%rip), %r13
	movq	%fs:40, %rax
	movq	%rax, 800104(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	xorl	%esi, %esi
	movl	$800040, %edx
	movq	%r13, %rdi
	call	memset@PLT
	cmpl	$1, 24(%rsp)
	jle	.L73
	leaq	28(%rsp), %rax
	xorl	%r12d, %r12d
	leaq	36(%rsp), %r15
	movq	%rax, 8(%rsp)
	leaq	32(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L70:
	movq	8(%rsp), %rsi
	movq	%r15, %rcx
	movq	%r14, %rdx
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rdi
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %ebp
	movl	36(%rsp), %eax
	movl	$8, %edi
	movslq	32(%rsp), %rbx
	movl	%eax, 4(%rsp)
	call	malloc@PLT
	movslq	%ebp, %rdx
	movd	4(%rsp), %xmm1
	movd	%ebx, %xmm0
	movq	0(%r13,%rdx,8), %rcx
	movq	%rax, 0(%r13,%rdx,8)
	movl	$8, %edi
	punpckldq	%xmm1, %xmm0
	movq	%rcx, 8(%rax)
	movq	%xmm0, (%rax)
	call	malloc@PLT
	movd	4(%rsp), %xmm1
	movq	0(%r13,%rbx,8), %rdx
	movd	%ebp, %xmm0
	movq	%rax, 0(%r13,%rbx,8)
	punpckldq	%xmm1, %xmm0
	movq	%rdx, 8(%rax)
	movq	%xmm0, (%rax)
	movl	24(%rsp), %eax
	subl	$1, %eax
	cmpl	%r12d, %eax
	jg	.L70
.L73:
	leaq	.LC1(%rip), %r14
	leaq	44(%rsp), %rdx
	xorl	%eax, %eax
	leaq	40(%rsp), %rsi
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	movl	40(%rsp), %eax
	testl	%eax, %eax
	jle	.L86
	leaq	48(%rsp), %r12
	xorl	%ebx, %ebx
	leaq	400080(%rsp), %rbp
	movq	%r12, %r13
	.p2align 4,,10
	.p2align 3
.L74:
	leaq	0(%rbp,%rbx,4), %rdx
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	40(%rsp), %r15d
	addq	$1, %rbx
	addq	$4, %r13
	cmpl	%ebx, %r15d
	jg	.L74
	movslq	44(%rsp), %rax
	leaq	kyori(%rip), %r14
	xorl	%esi, %esi
	movq	$0, (%r14,%rax,8)
	movq	%rax, %rdi
	call	dfs
	testl	%r15d, %r15d
	jle	.L76
	xorl	%ebx, %ebx
	leaq	.LC3(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L75:
	movslq	(%r12,%rbx,4), %rax
	movslq	0(%rbp,%rbx,4), %rdx
	movq	%r13, %rsi
	movl	$1, %edi
	addq	$1, %rbx
	movq	(%r14,%rdx,8), %rdx
	addq	(%r14,%rax,8), %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	%ebx, 40(%rsp)
	jg	.L75
.L76:
	movq	800104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L87
	addq	$800120, %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
.L86:
	.cfi_restore_state
	movslq	44(%rsp), %rdx
	leaq	kyori(%rip), %rax
	xorl	%esi, %esi
	movq	$0, (%rax,%rdx,8)
	movq	%rdx, %rdi
	call	dfs
	jmp	.L76
.L87:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE58:
	.size	main, .-main
	.globl	kyori
	.bss
	.align 32
	.type	kyori, @object
	.size	kyori, 800040
kyori:
	.zero	800040
	.globl	graph
	.align 32
	.type	graph, @object
	.size	graph, 800040
graph:
	.zero	800040
	.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>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int acs(const void *a, const void *b) { 
  return *(int*)a - *(int*)b;
} /* 1,2,3,4.. */
int des(const void *a, const void *b) {
  return *(int*)b - *(int*)a;
} /* 8,7,6,5.. */
int cmp_char(const void *a, const void *b) { 
  return *(char*)a - *(char*)b;
} /* a,b,c,d.. */
int cmp_str(const void *a, const void *b) {
  return strcmp(*(const char **)a, *(const char **)b);
} /* aaa,aab.. */
#define min(a,b) (a < b ? a : b)
#define max(a,b) (a > b ? a : b)
#define rep(i, l, r) for (int i = l; i < r; i++)
#define MAX 100005
#define MOD 1000000007
#define INF 1000000009
typedef long long int lli;

typedef struct list {
  int node;
  int dist;
  struct list *next;
} list;

list *graph[MAX];

void initGraph(void) 
{
  for (int i = 0; i < MAX; i++)
    graph[i] = NULL;
}

void addEdge(int node1, int node2, lli dist)
{
  list *new1 = (list *)malloc(sizeof(list *));
  new1->node = node2;
  new1->dist = dist;
  new1->next = graph[node1];
  graph[node1] = new1;

  list *new2 = (list *)malloc(sizeof(list *));
  new2->node = node1;
  new2->dist = dist;
  new2->next = graph[node2];
  graph[node2] = new2;
}

// 頂点k(根)からの距離
lli kyori[MAX];

void dfs(int n, int p) {
  list *c = graph[n];
  for ( ; c != NULL; c = c->next ) {
    int cn = c->node;
    if ( cn == p ) continue;
    kyori[cn] = kyori[n] + c->dist;
    dfs(cn, n);
  }
}

int main(void) {
  int n;
  scanf("%d", &n);
  initGraph();
  int a, b, c;
  rep(i, 0, n-1) {
    scanf("%d %d %d", &a, &b, &c);
    addEdge(a, b, c);
  }
  int q, k;
  scanf("%d %d", &q, &k);
  int x[MAX], y[MAX];
  rep(i, 0, q) scanf("%d %d", &x[i], &y[i]);

  // 頂点kが根
  kyori[k] = 0;
  dfs(k, 0);

  rep(i, 0, q) {
    printf("%lld\n", kyori[x[i]] + kyori[y[i]]);
  }
  return 0;
}

7
1 2 1
1 3 3
1 4 5
1 5 7
1 6 9
1 7 11
3 2
1 3
4 5
5 7
 7
1 2 1
1 3 3
1 4 5
1 5 7
1 6 9
1 7 11
3 2
1 4
4 5
5 7
 7
1 2 1
1 3 3
1 4 5
1 5 7
1 6 9
1 7 11
3 2
1 4
4 5
5 5
 7
1 2 1
1 3 3
1 4 5
1 5 11
1 6 9
1 7 11
3 2
1 4
4 5
5 5
 5
1 2 1
1 3 1
2 4 1
3 5 2
3 1
2 4
2 3
4 5
 7
1 2 1
1 3 3
1 4 5
1 5 7
1 6 9
1 7 11
3 2
1 3
7 5
6 7
 7
1 2 1
1 3 3
1 4 5
1 5 7
1 6 9
1 7 11
3 2
1 4
4 5
5 4
 10
1 2 1000000000
2 3 1000000000
3 4 1000000000
4 5 1000000000
5 6 1000000000
6 7 1000000000
7 9 1000000000
8 9 1000000000
9 10 1000000000
1 1
9 10
 7
1 2 1
1 3 3
1 4 10
1 5 11
1 6 9
1 7 11
3 2
1 4
4 5
5 5
 7
1 2 1
1 3 3
1 4 3
1 5 7
1 6 9
1 7 11
3 2
1 4
4 5
5 4

5
14
20
 7
14
20
 7
14
16
 7
18
24
 3
2
5
 5
20
22
 7
14
14
 15000000000
 12
23
24
 5
12
12

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>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int acs(const void *a, const void *b) { 
  return *(int*)a - *(int*)b;
} /* 1,2,3,4.. */
int des(const void *a, const void *b) {
  return *(int*)b - *(int*)a;
} /* 8,7,6,5.. */
int cmp_char(const void *a, const void *b) { 
  return *(char*)a - *(char*)b;
} /* a,b,c,d.. */
int cmp_str(const void *a, const void *b) {
  return strcmp(*(const char **)a, *(const char **)b);
} /* aaa,aab.. */
#define min(a,b) (a < b ? a : b)
#define max(a,b) (a > b ? a : b)
#define rep(i, l, r) for (int i = l; i < r; i++)
#define MAX 100005
#define MOD 1000000007
#define INF 1000000009
typedef long long int lli;

typedef struct list {
  int node;
  int dist;
  struct list *next;
} list;

list *graph[MAX];

void initGraph(void) 
{
  for (int i = 0; i < MAX; i++)
    graph[i] = NULL;
}

void addEdge(int node1, int node2, lli dist)
{
  list *new1 = (list *)malloc(sizeof(list *));
  new1->node = node2;
  new1->dist = dist;
  new1->next = graph[node1];
  graph[node1] = new1;

  list *new2 = (list *)malloc(sizeof(list *));
  new2->node = node1;
  new2->dist = dist;
  new2->next = graph[node2];
  graph[node2] = new2;
}

// 頂点k(根)からの距離
lli kyori[MAX];

void dfs(int n, int p) {
  list *c = graph[n];
  for ( ; c != NULL; c = c->next ) {
    int cn = c->node;
    if ( cn == p ) continue;
    kyori[cn] = kyori[n] + c->dist;
    dfs(cn, n);
  }
}

int main(void) {
  int n;
  scanf("%d", &n);
  initGraph();
  int a, b, c;
  rep(i, 0, n-1) {
    scanf("%d %d %d", &a, &b, &c);
    addEdge(a, b, c);
  }
  int q, k;
  scanf("%d %d", &q, &k);
  int x[MAX], y[MAX];
  rep(i, 0, q) scanf("%d %d", &x[i], &y[i]);

  // 頂点kが根
  kyori[k] = 0;
  dfs(k, 0);

  rep(i, 0, q) {
    printf("%lld\n", kyori[x[i]] + kyori[y[i]]);
  }
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	acs
	.type	acs, @function
acs:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	acs, .-acs
	.globl	des
	.type	des, @function
des:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	des, .-des
	.globl	cmp_char
	.type	cmp_char, @function
cmp_char:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %edx
	movq	-16(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	cmp_char, .-cmp_char
	.globl	cmp_str
	.type	cmp_str, @function
cmp_str:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	cmp_str, .-cmp_str
	.globl	graph
	.bss
	.align 32
	.type	graph, @object
	.size	graph, 800040
graph:
	.zero	800040
	.text
	.globl	initGraph
	.type	initGraph, @function
initGraph:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -4(%rbp)
	jmp	.L10
.L11:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	graph(%rip), %rax
	movq	$0, (%rdx,%rax)
	addl	$1, -4(%rbp)
.L10:
	cmpl	$100004, -4(%rbp)
	jle	.L11
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	initGraph, .-initGraph
	.globl	addEdge
	.type	addEdge, @function
addEdge:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movq	%rdx, -32(%rbp)
	movl	$8, %edi
	call	malloc@PLT
	movq	%rax, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	-24(%rbp), %edx
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	movl	%eax, %edx
	movq	-16(%rbp), %rax
	movl	%edx, 4(%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	graph(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-16(%rbp), %rax
	movq	%rdx, 8(%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	graph(%rip), %rdx
	movq	-16(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
	movl	$8, %edi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movl	-20(%rbp), %edx
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	movl	%eax, %edx
	movq	-8(%rbp), %rax
	movl	%edx, 4(%rax)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	graph(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 8(%rax)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	graph(%rip), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	addEdge, .-addEdge
	.globl	kyori
	.bss
	.align 32
	.type	kyori, @object
	.size	kyori, 800040
kyori:
	.zero	800040
	.text
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	graph(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -8(%rbp)
	jmp	.L14
.L17:
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	cmpl	-24(%rbp), %eax
	je	.L18
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	kyori(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-8(%rbp), %rax
	movl	4(%rax), %eax
	cltq
	leaq	(%rdx,%rax), %rcx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	kyori(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movl	-20(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dfs
	jmp	.L16
.L18:
	nop
.L16:
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -8(%rbp)
.L14:
	cmpq	$0, -8(%rbp)
	jne	.L17
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	dfs, .-dfs
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d"
.LC2:
	.string	"%d %d"
.LC3:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB13:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-798720(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1392, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-800100(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	call	initGraph
	movl	$0, -800076(%rbp)
	jmp	.L20
.L21:
	leaq	-800088(%rbp), %rcx
	leaq	-800092(%rbp), %rdx
	leaq	-800096(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-800088(%rbp), %eax
	movslq	%eax, %rdx
	movl	-800092(%rbp), %ecx
	movl	-800096(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	addEdge
	addl	$1, -800076(%rbp)
.L20:
	movl	-800100(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -800076(%rbp)
	jl	.L21
	leaq	-800080(%rbp), %rdx
	leaq	-800084(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -800072(%rbp)
	jmp	.L22
.L23:
	leaq	-400032(%rbp), %rdx
	movl	-800072(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-800064(%rbp), %rcx
	movl	-800072(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -800072(%rbp)
.L22:
	movl	-800084(%rbp), %eax
	cmpl	%eax, -800072(%rbp)
	jl	.L23
	movl	-800080(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	kyori(%rip), %rax
	movq	$0, (%rdx,%rax)
	movl	-800080(%rbp), %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	dfs
	movl	$0, -800068(%rbp)
	jmp	.L24
.L25:
	movl	-800068(%rbp), %eax
	cltq
	movl	-800064(%rbp,%rax,4), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	kyori(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-800068(%rbp), %eax
	cltq
	movl	-400032(%rbp,%rax,4), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	kyori(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -800068(%rbp)
.L24:
	movl	-800084(%rbp), %eax
	cmpl	%eax, -800068(%rbp)
	jl	.L25
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L27
	call	__stack_chk_fail@PLT
.L27:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.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
	.globl	acs
	.type	acs, @function
acs:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	acs, .-acs
	.globl	des
	.type	des, @function
des:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	des, .-des
	.globl	cmp_char
	.type	cmp_char, @function
cmp_char:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %edx
	movq	-16(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	cmp_char, .-cmp_char
	.globl	cmp_str
	.type	cmp_str, @function
cmp_str:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	cmp_str, .-cmp_str
	.globl	graph
	.bss
	.align 32
	.type	graph, @object
	.size	graph, 800040
graph:
	.zero	800040
	.text
	.globl	initGraph
	.type	initGraph, @function
initGraph:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -4(%rbp)
	jmp	.L10
.L11:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	graph(%rip), %rax
	movq	$0, (%rdx,%rax)
	addl	$1, -4(%rbp)
.L10:
	cmpl	$100004, -4(%rbp)
	jle	.L11
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	initGraph, .-initGraph
	.globl	addEdge
	.type	addEdge, @function
addEdge:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movq	%rdx, -32(%rbp)
	movl	$8, %edi
	call	malloc@PLT
	movq	%rax, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	-24(%rbp), %edx
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	movl	%eax, %edx
	movq	-16(%rbp), %rax
	movl	%edx, 4(%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	graph(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-16(%rbp), %rax
	movq	%rdx, 8(%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	graph(%rip), %rdx
	movq	-16(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
	movl	$8, %edi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movl	-20(%rbp), %edx
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	movl	%eax, %edx
	movq	-8(%rbp), %rax
	movl	%edx, 4(%rax)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	graph(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 8(%rax)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	graph(%rip), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	addEdge, .-addEdge
	.globl	kyori
	.bss
	.align 32
	.type	kyori, @object
	.size	kyori, 800040
kyori:
	.zero	800040
	.text
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	graph(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -8(%rbp)
	jmp	.L14
.L17:
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	cmpl	-24(%rbp), %eax
	je	.L18
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	kyori(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-8(%rbp), %rax
	movl	4(%rax), %eax
	cltq
	leaq	(%rdx,%rax), %rcx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	kyori(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movl	-20(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dfs
	jmp	.L16
.L18:
	nop
.L16:
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -8(%rbp)
.L14:
	cmpq	$0, -8(%rbp)
	jne	.L17
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	dfs, .-dfs
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d"
.LC2:
	.string	"%d %d"
.LC3:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB13:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-798720(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1392, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-800100(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	call	initGraph
	movl	$0, -800076(%rbp)
	jmp	.L20
.L21:
	leaq	-800088(%rbp), %rcx
	leaq	-800092(%rbp), %rdx
	leaq	-800096(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-800088(%rbp), %eax
	movslq	%eax, %rdx
	movl	-800092(%rbp), %ecx
	movl	-800096(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	addEdge
	addl	$1, -800076(%rbp)
.L20:
	movl	-800100(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -800076(%rbp)
	jl	.L21
	leaq	-800080(%rbp), %rdx
	leaq	-800084(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -800072(%rbp)
	jmp	.L22
.L23:
	leaq	-400032(%rbp), %rdx
	movl	-800072(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-800064(%rbp), %rcx
	movl	-800072(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -800072(%rbp)
.L22:
	movl	-800084(%rbp), %eax
	cmpl	%eax, -800072(%rbp)
	jl	.L23
	movl	-800080(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	kyori(%rip), %rax
	movq	$0, (%rdx,%rax)
	movl	-800080(%rbp), %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	dfs
	movl	$0, -800068(%rbp)
	jmp	.L24
.L25:
	movl	-800068(%rbp), %eax
	cltq
	movl	-800064(%rbp,%rax,4), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	kyori(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-800068(%rbp), %eax
	cltq
	movl	-400032(%rbp,%rax,4), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	kyori(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -800068(%rbp)
.L24:
	movl	-800084(%rbp), %eax
	cmpl	%eax, -800068(%rbp)
	jl	.L25
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L27
	call	__stack_chk_fail@PLT
.L27:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.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:
