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<stdint.h>
#include<inttypes.h>

typedef int32_t i32;
typedef int64_t i64;

#define ALLOC(size,type) ((type*)calloc((size),sizeof(type)))

typedef struct directed_edge {
  int32_t vertex;
  int32_t next;
} graph_edge;

typedef struct directedGraph {
  graph_edge *edge;
  int32_t *start;
  int32_t pointer;
  int32_t vertex_num;
  int32_t edge_max_size;
} graph;

graph* new_graph (const int vertex_num) {
  graph *g = (graph *) calloc (1, sizeof (graph));
  g->edge = (graph_edge *) calloc (1, sizeof (graph_edge));
  g->start = (int32_t *) calloc (vertex_num, sizeof (int32_t));
  g->pointer = 0;
  g->vertex_num = vertex_num;
  g->edge_max_size = 1;
  for (int32_t i = 0; i < vertex_num; ++i) {
    g->start[i] = -1;
  }
  return g;
}

void add_edge (graph *g, int32_t from, int32_t to) {
  if (g->pointer == g->edge_max_size) {
    g->edge_max_size *= 2;
    g->edge = (graph_edge *) realloc (g->edge, sizeof (graph_edge) * g->edge_max_size);
  }
  g->edge[g->pointer] = (graph_edge) {to, g->start[from]};
  g->start[from] = g->pointer++;
}

void BFS_graph (graph *g, int32_t src, i32 *q, i32 *parent) {
  uint8_t *used = (uint8_t *) calloc (g->vertex_num, sizeof (uint8_t));
  int32_t front = 0;
  int32_t last = 0;
  used[src] = 1;
  q[last++] = src;
  while (front < last) {
    const int32_t v = q[front++];
    for (int32_t p = g->start[v]; p != -1; p = g->edge[p].next) {
      const int32_t u = g->edge[p].vertex;
      if (!used[u]) {
        used[u] = 1;
        q[last++] = u;
        parent[u] = v;
      }
    }
  }
  free(used);
}

void run (void) {
  i32 n;
  scanf ("%" SCNi32, &n);
  graph *g = new_graph (n);
  for (i32 i = 1; i < n; ++i) {
    i32 x, y;
    scanf ("%" SCNi32 "%" SCNi32, &x, &y);
    x--;
    y--;
    add_edge (g, x, y);
    add_edge (g, y, x);
  }
  i32 *q = ALLOC (2 * n, i32);
  i32 *parent = q + n;
  BFS_graph (g, 0, q, parent);
  i32 *dp = ALLOC (2 * n, i32);
  const i32 mod = 1000000007;
  for (i32 i = n - 1; i >= 0; --i) {
    i32 v = q[i];
    dp[v] = dp[v + n] = 1;
    for (i32 p = g->start[v]; p != -1; p = g->edge[p].next) {
      i32 u = g->edge[p].vertex;
      if (u == parent[v]) continue;
      dp[v] = (i64) dp[v] * (dp[u] + dp[u + n]) % mod;
      dp[v + n] = (i64) dp[v + n] * dp[u] % mod;
    }
  }
  i32 ans = (dp[0] + dp[n]) % mod;
  printf ("%" PRIi32 "\n", ans);
}

int main (void) {
  run();
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	new_graph
	.type	new_graph, @function
new_graph:
.LFB6:
	.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	$32, %esi
	movl	$1, %edi
	call	calloc@PLT
	movq	%rax, -8(%rbp)
	movl	$8, %esi
	movl	$1, %edi
	call	calloc@PLT
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, (%rax)
	movl	-20(%rbp), %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 8(%rax)
	movq	-8(%rbp), %rax
	movl	$0, 16(%rax)
	movq	-8(%rbp), %rax
	movl	-20(%rbp), %edx
	movl	%edx, 20(%rax)
	movq	-8(%rbp), %rax
	movl	$1, 24(%rax)
	movl	$0, -12(%rbp)
	jmp	.L2
.L3:
	movq	-8(%rbp), %rax
	movq	8(%rax), %rdx
	movl	-12(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	$-1, (%rax)
	addl	$1, -12(%rbp)
.L2:
	movl	-12(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L3
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	new_graph, .-new_graph
	.globl	add_edge
	.type	add_edge, @function
add_edge:
.LFB7:
	.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)
	movl	%esi, -12(%rbp)
	movl	%edx, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	16(%rax), %edx
	movq	-8(%rbp), %rax
	movl	24(%rax), %eax
	cmpl	%eax, %edx
	jne	.L6
	movq	-8(%rbp), %rax
	movl	24(%rax), %eax
	leal	(%rax,%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, 24(%rax)
	movq	-8(%rbp), %rax
	movl	24(%rax), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	realloc@PLT
	movq	-8(%rbp), %rdx
	movq	%rax, (%rdx)
.L6:
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movl	16(%rax), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	-8(%rbp), %rdx
	movq	8(%rdx), %rcx
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	salq	$2, %rdx
	addq	%rcx, %rdx
	movl	(%rdx), %edx
	movl	-16(%rbp), %ecx
	movl	%ecx, (%rax)
	movl	%edx, 4(%rax)
	movq	-8(%rbp), %rax
	movl	16(%rax), %eax
	leal	1(%rax), %ecx
	movq	-8(%rbp), %rdx
	movl	%ecx, 16(%rdx)
	movq	-8(%rbp), %rdx
	movq	8(%rdx), %rcx
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	salq	$2, %rdx
	addq	%rcx, %rdx
	movl	%eax, (%rdx)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	add_edge, .-add_edge
	.globl	BFS_graph
	.type	BFS_graph, @function
BFS_graph:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%rdi, -40(%rbp)
	movl	%esi, -44(%rbp)
	movq	%rdx, -56(%rbp)
	movq	%rcx, -64(%rbp)
	movq	-40(%rbp), %rax
	movl	20(%rax), %eax
	cltq
	movl	$1, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -8(%rbp)
	movl	$0, -28(%rbp)
	movl	$0, -24(%rbp)
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movb	$1, (%rax)
	movl	-24(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -24(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rax, %rdx
	movl	-44(%rbp), %eax
	movl	%eax, (%rdx)
	jmp	.L8
.L12:
	movl	-28(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -28(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -16(%rbp)
	movq	-40(%rbp), %rax
	movq	8(%rax), %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -20(%rbp)
	jmp	.L9
.L11:
	movq	-40(%rbp), %rax
	movq	(%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L10
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movb	$1, (%rax)
	movl	-24(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -24(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rax, %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rdx)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-64(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	movl	%eax, (%rdx)
.L10:
	movq	-40(%rbp), %rax
	movq	(%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movl	4(%rax), %eax
	movl	%eax, -20(%rbp)
.L9:
	cmpl	$-1, -20(%rbp)
	jne	.L11
.L8:
	movl	-28(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jl	.L12
	movq	-8(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	BFS_graph, .-BFS_graph
	.section	.rodata
.LC0:
	.string	"%i"
.LC1:
	.string	"%i%i"
.LC2:
	.string	"%i\n"
	.text
	.globl	run
	.type	run, @function
run:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-80(%rbp), %eax
	movl	%eax, %edi
	call	new_graph
	movq	%rax, -40(%rbp)
	movl	$1, -68(%rbp)
	jmp	.L14
.L15:
	leaq	-72(%rbp), %rdx
	leaq	-76(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-76(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -76(%rbp)
	movl	-72(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -72(%rbp)
	movl	-72(%rbp), %edx
	movl	-76(%rbp), %ecx
	movq	-40(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	add_edge
	movl	-76(%rbp), %edx
	movl	-72(%rbp), %ecx
	movq	-40(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	add_edge
	addl	$1, -68(%rbp)
.L14:
	movl	-80(%rbp), %eax
	cmpl	%eax, -68(%rbp)
	jl	.L15
	movl	-80(%rbp), %eax
	addl	%eax, %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -32(%rbp)
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, -24(%rbp)
	movq	-24(%rbp), %rcx
	movq	-32(%rbp), %rdx
	movq	-40(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	BFS_graph
	movl	-80(%rbp), %eax
	addl	%eax, %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -16(%rbp)
	movl	$1000000007, -56(%rbp)
	movl	-80(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -64(%rbp)
	jmp	.L16
.L21:
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	movl	-80(%rbp), %edx
	movl	-48(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, (%rax)
	movl	-48(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-16(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movq	-40(%rbp), %rax
	movq	8(%rax), %rdx
	movl	-48(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -60(%rbp)
	jmp	.L17
.L20:
	movq	-40(%rbp), %rax
	movq	(%rax), %rdx
	movl	-60(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -44(%rbp)
	je	.L23
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movslq	%eax, %rdx
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-16(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %ecx
	movl	-80(%rbp), %esi
	movl	-44(%rbp), %eax
	addl	%esi, %eax
	cltq
	leaq	0(,%rax,4), %rsi
	movq	-16(%rbp), %rax
	addq	%rsi, %rax
	movl	(%rax), %eax
	addl	%ecx, %eax
	cltq
	imulq	%rdx, %rax
	movl	-56(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-16(%rbp), %rax
	addq	%rcx, %rax
	movl	%edx, (%rax)
	movl	-80(%rbp), %edx
	movl	-48(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movslq	%eax, %rdx
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-16(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cltq
	imulq	%rdx, %rax
	movl	-56(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movl	-80(%rbp), %edx
	movl	-48(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	%ecx, %edx
	movl	%edx, (%rax)
	jmp	.L19
.L23:
	nop
.L19:
	movq	-40(%rbp), %rax
	movq	(%rax), %rdx
	movl	-60(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movl	4(%rax), %eax
	movl	%eax, -60(%rbp)
.L17:
	cmpl	$-1, -60(%rbp)
	jne	.L20
	subl	$1, -64(%rbp)
.L16:
	cmpl	$0, -64(%rbp)
	jns	.L21
	movq	-16(%rbp), %rax
	movl	(%rax), %edx
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-16(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	addl	%edx, %eax
	cltd
	idivl	-56(%rbp)
	movl	%edx, -52(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	run, .-run
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	call	run
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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	new_graph
	.type	new_graph, @function
new_graph:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	$32, %esi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movslq	%edi, %rbp
	movl	$1, %edi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	calloc@PLT
	movl	$8, %esi
	movl	$1, %edi
	movq	%rax, %r12
	call	calloc@PLT
	movl	$4, %esi
	movq	%rbp, %rdi
	movq	%rax, (%r12)
	call	calloc@PLT
	movl	%ebp, 20(%r12)
	movq	%rax, 8(%r12)
	movl	$0, 16(%r12)
	movl	$1, 24(%r12)
	testl	%ebp, %ebp
	jle	.L1
	movq	%rax, %rdi
	leaq	0(,%rbp,4), %rdx
	movl	$255, %esi
	call	memset@PLT
.L1:
	movq	%r12, %rax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE39:
	.size	new_graph, .-new_graph
	.p2align 4
	.globl	add_edge
	.type	add_edge, @function
add_edge:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	%edx, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movslq	%esi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rdi, %rbx
	movl	16(%rdi), %ecx
	movq	(%rdi), %rdi
	cmpl	24(%rbx), %ecx
	je	.L8
.L6:
	movq	8(%rbx), %rax
	movd	%r12d, %xmm0
	movslq	%ecx, %rsi
	leal	1(%rcx), %edx
	leaq	(%rax,%rbp,4), %rax
	movd	(%rax), %xmm1
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, (%rdi,%rsi,8)
	movl	%edx, 16(%rbx)
	movl	%ecx, (%rax)
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_restore_state
	addl	%ecx, %ecx
	movl	%ecx, 24(%rbx)
	movslq	%ecx, %rcx
	leaq	0(,%rcx,8), %rsi
	call	realloc@PLT
	movl	16(%rbx), %ecx
	movq	%rax, (%rbx)
	movq	%rax, %rdi
	jmp	.L6
	.cfi_endproc
.LFE40:
	.size	add_edge, .-add_edge
	.p2align 4
	.globl	BFS_graph
	.type	BFS_graph, @function
BFS_graph:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	%esi, %r13d
	movl	$1, %esi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rcx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%rdx, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movq	%rdi, %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	movslq	20(%rdi), %rdi
	call	calloc@PLT
	movl	%r13d, 0(%rbp)
	xorl	%r11d, %r11d
	movl	$1, %edx
	movq	%rax, %r9
	movslq	%r13d, %rax
	movq	8(%rbx), %r13
	movb	$1, (%r9,%rax)
	.p2align 4,,10
	.p2align 3
.L14:
	movslq	0(%rbp,%r11,4), %rax
	movq	%rax, %r10
	movslq	0(%r13,%rax,4), %rax
	cmpl	$-1, %eax
	je	.L10
	movq	(%rbx), %r8
	.p2align 4,,10
	.p2align 3
.L13:
	leaq	(%r8,%rax,8), %rax
	movslq	(%rax), %rcx
	leaq	(%r9,%rcx), %rdi
	cmpb	$0, (%rdi)
	jne	.L11
	movl	%ecx, 0(%rbp,%rdx,4)
	movl	%r10d, (%r12,%rcx,4)
	movslq	4(%rax), %rax
	movb	$1, (%rdi)
	leal	1(%rdx), %edi
	movslq	%edi, %rdx
	cmpl	$-1, %eax
	jne	.L13
.L10:
	addq	$1, %r11
	cmpl	%r11d, %edx
	jg	.L14
.L24:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	movq	%r9, %rdi
	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
	jmp	free@PLT
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	movslq	4(%rax), %rax
	cmpl	$-1, %eax
	jne	.L13
	addq	$1, %r11
	cmpl	%r11d, %edx
	jg	.L14
	jmp	.L24
	.cfi_endproc
.LFE41:
	.size	BFS_graph, .-BFS_graph
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%i"
.LC1:
	.string	"%i%i"
.LC2:
	.string	"%i\n"
	.text
	.p2align 4
	.globl	run
	.type	run, @function
run:
.LFB42:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	$32, %esi
	movl	$1, %edi
	movslq	44(%rsp), %rbp
	call	calloc@PLT
	movl	$8, %esi
	movl	$1, %edi
	movq	%rax, (%rsp)
	movq	%rbp, %rbx
	call	calloc@PLT
	movq	(%rsp), %r8
	movl	$4, %esi
	movq	%rbp, %rdi
	movq	%rax, (%r8)
	movq	%r8, 8(%rsp)
	call	calloc@PLT
	movq	8(%rsp), %r8
	movq	%rax, (%rsp)
	movq	%rax, 8(%r8)
	movl	$0, 16(%r8)
	movl	%ebp, 20(%r8)
	movl	$1, 24(%r8)
	testl	%ebp, %ebp
	jle	.L27
	movq	%rax, %rdi
	leaq	0(,%rbp,4), %rdx
	movl	$255, %esi
	call	memset@PLT
	cmpl	$1, %ebp
	movq	8(%rsp), %r8
	jle	.L27
	movl	$1, %r12d
	leaq	52(%rsp), %r15
	leaq	48(%rsp), %r14
	movq	%r8, %rbp
	leaq	.LC1(%rip), %r13
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L53:
	movl	%ecx, 8(%rsp)
	movq	0(%rbp), %rdi
	movslq	%edx, %r10
.L30:
	movq	(%rsp), %rax
	movslq	%ecx, %rcx
	movd	%edx, %xmm0
	movslq	%ebx, %rsi
	leal	1(%rbx), %edx
	leaq	0(,%rsi,8), %r11
	leaq	(%rax,%rcx,4), %rax
	movl	%edx, 16(%rbp)
	movd	(%rax), %xmm1
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, (%rdi,%rsi,8)
	movl	%ebx, (%rax)
	cmpl	%r9d, %edx
	je	.L51
.L31:
	movq	(%rsp), %rax
	movd	8(%rsp), %xmm0
	addl	$2, %ebx
	addl	$1, %r12d
	movl	%ebx, 16(%rbp)
	leaq	(%rax,%r10,4), %rax
	movd	(%rax), %xmm2
	punpckldq	%xmm2, %xmm0
	movq	%xmm0, 8(%rdi,%r11)
	movl	44(%rsp), %ebx
	movl	%edx, (%rax)
	cmpl	%r12d, %ebx
	jle	.L52
.L32:
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	48(%rsp), %eax
	movl	16(%rbp), %ebx
	movl	24(%rbp), %r9d
	leal	-1(%rax), %ecx
	movl	52(%rsp), %eax
	movl	%ecx, 48(%rsp)
	leal	-1(%rax), %edx
	movl	%edx, 52(%rsp)
	cmpl	%r9d, %ebx
	jne	.L53
	leal	(%rbx,%rbx), %r9d
	movq	0(%rbp), %rdi
	movl	%edx, 28(%rsp)
	movl	%r9d, 24(%rbp)
	movslq	%r9d, %rsi
	salq	$3, %rsi
	movl	%ecx, 24(%rsp)
	movl	%r9d, 16(%rsp)
	call	realloc@PLT
	movslq	52(%rsp), %r10
	movl	28(%rsp), %edx
	movq	%rax, %rdi
	movl	24(%rsp), %ecx
	movl	16(%rsp), %r9d
	movq	%rax, 0(%rbp)
	movl	48(%rsp), %eax
	movl	%eax, 8(%rsp)
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L51:
	addl	%r9d, %r9d
	movl	%r10d, 28(%rsp)
	movl	%r9d, 24(%rbp)
	movslq	%r9d, %r9
	leaq	0(,%r9,8), %rsi
	movl	%edx, 24(%rsp)
	movq	%r11, 16(%rsp)
	call	realloc@PLT
	movslq	28(%rsp), %r10
	movl	24(%rsp), %edx
	movq	%rax, 0(%rbp)
	movq	16(%rsp), %r11
	movq	%rax, %rdi
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L52:
	movq	%rbp, %r8
	movslq	%ebx, %rbp
.L27:
	leal	(%rbx,%rbx), %edi
	movl	$4, %esi
	movq	%r8, 16(%rsp)
	movabsq	$-8543223828751151131, %rbx
	movslq	%edi, %rdi
	call	calloc@PLT
	movq	16(%rsp), %rdi
	xorl	%esi, %esi
	movq	%rax, %r15
	leaq	(%rax,%rbp,4), %rax
	movq	%rax, %rcx
	movq	%r15, %rdx
	movq	%rax, 8(%rsp)
	call	BFS_graph
	movslq	44(%rsp), %r12
	movl	$4, %esi
	leal	(%r12,%r12), %edi
	movslq	%edi, %rdi
	call	calloc@PLT
	movq	16(%rsp), %r8
	movq	%rax, %r9
	leal	-1(%r12), %eax
	testl	%eax, %eax
	movslq	%eax, %r14
	js	.L36
	.p2align 4,,10
	.p2align 3
.L35:
	movslq	(%r15,%r14,4), %rdx
	leal	(%r12,%rdx), %eax
	leaq	(%r9,%rdx,4), %r11
	cltq
	leaq	(%r9,%rax,4), %r10
	movq	(%rsp), %rax
	movl	$1, (%r10)
	movslq	(%rax,%rdx,4), %rax
	movl	$1, (%r11)
	cmpl	$-1, %eax
	je	.L39
	movq	8(%rsp), %rdi
	movq	(%r8), %r13
	movl	(%rdi,%rdx,4), %ebp
	.p2align 4,,10
	.p2align 3
.L40:
	leaq	0(%r13,%rax,8), %rsi
	movl	(%rsi), %eax
	cmpl	%eax, %ebp
	je	.L37
	movslq	%eax, %rdx
	addl	%r12d, %eax
	leaq	(%r9,%rdx,4), %rdi
	cltq
	movl	(%rdi), %ecx
	addl	(%r9,%rax,4), %ecx
	movslq	(%r11), %rax
	movslq	%ecx, %rcx
	imulq	%rax, %rcx
	movq	%rcx, %rax
	imulq	%rbx
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %rcx
	movl	%ecx, (%r11)
	movslq	(%rdi), %rax
	movslq	(%r10), %rcx
	imulq	%rax, %rcx
	movq	%rcx, %rax
	imulq	%rbx
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	movslq	4(%rsi), %rax
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %rcx
	movl	%ecx, (%r10)
	cmpl	$-1, %eax
	jne	.L40
.L39:
	subq	$1, %r14
	testl	%r14d, %r14d
	jns	.L35
.L36:
	movl	(%r9), %edx
	addl	(%r9,%r12,4), %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	movslq	%edx, %rax
	movl	%edx, %ecx
	imulq	$1152921497, %rax, %rax
	sarl	$31, %ecx
	sarq	$60, %rax
	subl	%ecx, %eax
	imull	$1000000007, %eax, %eax
	subl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L54
	addq	$72, %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
.L37:
	.cfi_restore_state
	movslq	4(%rsi), %rax
	cmpl	$-1, %eax
	jne	.L40
	subq	$1, %r14
	testl	%r14d, %r14d
	jns	.L35
	jmp	.L36
.L54:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE42:
	.size	run, .-run
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB43:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	call	run
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE43:
	.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
	.p2align 4
	.globl	new_graph
	.type	new_graph, @function
new_graph:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	$32, %esi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movslq	%edi, %rbp
	movl	$1, %edi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	calloc@PLT
	movl	$8, %esi
	movl	$1, %edi
	movq	%rax, %r12
	call	calloc@PLT
	movl	$4, %esi
	movq	%rbp, %rdi
	movq	%rax, (%r12)
	call	calloc@PLT
	movl	%ebp, 20(%r12)
	movq	%rax, 8(%r12)
	movl	$0, 16(%r12)
	movl	$1, 24(%r12)
	testl	%ebp, %ebp
	jle	.L1
	movq	%rax, %rdi
	leaq	0(,%rbp,4), %rdx
	movl	$255, %esi
	call	memset@PLT
.L1:
	movq	%r12, %rax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE39:
	.size	new_graph, .-new_graph
	.p2align 4
	.globl	add_edge
	.type	add_edge, @function
add_edge:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	%edx, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movslq	%esi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rdi, %rbx
	movl	16(%rdi), %ecx
	movq	(%rdi), %rdi
	cmpl	24(%rbx), %ecx
	je	.L8
.L6:
	movq	8(%rbx), %rax
	movd	%r12d, %xmm0
	movslq	%ecx, %rsi
	leal	1(%rcx), %edx
	leaq	(%rax,%rbp,4), %rax
	movd	(%rax), %xmm1
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, (%rdi,%rsi,8)
	movl	%edx, 16(%rbx)
	movl	%ecx, (%rax)
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_restore_state
	addl	%ecx, %ecx
	movl	%ecx, 24(%rbx)
	movslq	%ecx, %rcx
	leaq	0(,%rcx,8), %rsi
	call	realloc@PLT
	movl	16(%rbx), %ecx
	movq	%rax, (%rbx)
	movq	%rax, %rdi
	jmp	.L6
	.cfi_endproc
.LFE40:
	.size	add_edge, .-add_edge
	.p2align 4
	.globl	BFS_graph
	.type	BFS_graph, @function
BFS_graph:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	%esi, %r13d
	movl	$1, %esi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rcx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%rdx, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movq	%rdi, %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	movslq	20(%rdi), %rdi
	call	calloc@PLT
	movl	%r13d, 0(%rbp)
	xorl	%r11d, %r11d
	movl	$1, %edx
	movq	%rax, %r9
	movslq	%r13d, %rax
	movq	8(%rbx), %r13
	movb	$1, (%r9,%rax)
	.p2align 4,,10
	.p2align 3
.L14:
	movslq	0(%rbp,%r11,4), %rax
	movq	%rax, %r10
	movslq	0(%r13,%rax,4), %rax
	cmpl	$-1, %eax
	je	.L10
	movq	(%rbx), %r8
	.p2align 4,,10
	.p2align 3
.L13:
	leaq	(%r8,%rax,8), %rax
	movslq	(%rax), %rcx
	leaq	(%r9,%rcx), %rdi
	cmpb	$0, (%rdi)
	jne	.L11
	movl	%ecx, 0(%rbp,%rdx,4)
	movl	%r10d, (%r12,%rcx,4)
	movslq	4(%rax), %rax
	movb	$1, (%rdi)
	leal	1(%rdx), %edi
	movslq	%edi, %rdx
	cmpl	$-1, %eax
	jne	.L13
.L10:
	addq	$1, %r11
	cmpl	%r11d, %edx
	jg	.L14
.L24:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	movq	%r9, %rdi
	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
	jmp	free@PLT
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	movslq	4(%rax), %rax
	cmpl	$-1, %eax
	jne	.L13
	addq	$1, %r11
	cmpl	%r11d, %edx
	jg	.L14
	jmp	.L24
	.cfi_endproc
.LFE41:
	.size	BFS_graph, .-BFS_graph
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%i"
.LC1:
	.string	"%i%i"
.LC2:
	.string	"%i\n"
	.text
	.p2align 4
	.globl	run
	.type	run, @function
run:
.LFB42:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	$32, %esi
	movl	$1, %edi
	movslq	44(%rsp), %rbp
	call	calloc@PLT
	movl	$8, %esi
	movl	$1, %edi
	movq	%rax, (%rsp)
	movq	%rbp, %rbx
	call	calloc@PLT
	movq	(%rsp), %r8
	movl	$4, %esi
	movq	%rbp, %rdi
	movq	%rax, (%r8)
	movq	%r8, 8(%rsp)
	call	calloc@PLT
	movq	8(%rsp), %r8
	movq	%rax, (%rsp)
	movq	%rax, 8(%r8)
	movl	$0, 16(%r8)
	movl	%ebp, 20(%r8)
	movl	$1, 24(%r8)
	testl	%ebp, %ebp
	jle	.L27
	movq	%rax, %rdi
	leaq	0(,%rbp,4), %rdx
	movl	$255, %esi
	call	memset@PLT
	cmpl	$1, %ebp
	movq	8(%rsp), %r8
	jle	.L27
	movl	$1, %r12d
	leaq	52(%rsp), %r15
	leaq	48(%rsp), %r14
	movq	%r8, %rbp
	leaq	.LC1(%rip), %r13
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L53:
	movl	%ecx, 8(%rsp)
	movq	0(%rbp), %rdi
	movslq	%edx, %r10
.L30:
	movq	(%rsp), %rax
	movslq	%ecx, %rcx
	movd	%edx, %xmm0
	movslq	%ebx, %rsi
	leal	1(%rbx), %edx
	leaq	0(,%rsi,8), %r11
	leaq	(%rax,%rcx,4), %rax
	movl	%edx, 16(%rbp)
	movd	(%rax), %xmm1
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, (%rdi,%rsi,8)
	movl	%ebx, (%rax)
	cmpl	%r9d, %edx
	je	.L51
.L31:
	movq	(%rsp), %rax
	movd	8(%rsp), %xmm0
	addl	$2, %ebx
	addl	$1, %r12d
	movl	%ebx, 16(%rbp)
	leaq	(%rax,%r10,4), %rax
	movd	(%rax), %xmm2
	punpckldq	%xmm2, %xmm0
	movq	%xmm0, 8(%rdi,%r11)
	movl	44(%rsp), %ebx
	movl	%edx, (%rax)
	cmpl	%r12d, %ebx
	jle	.L52
.L32:
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	48(%rsp), %eax
	movl	16(%rbp), %ebx
	movl	24(%rbp), %r9d
	leal	-1(%rax), %ecx
	movl	52(%rsp), %eax
	movl	%ecx, 48(%rsp)
	leal	-1(%rax), %edx
	movl	%edx, 52(%rsp)
	cmpl	%r9d, %ebx
	jne	.L53
	leal	(%rbx,%rbx), %r9d
	movq	0(%rbp), %rdi
	movl	%edx, 28(%rsp)
	movl	%r9d, 24(%rbp)
	movslq	%r9d, %rsi
	salq	$3, %rsi
	movl	%ecx, 24(%rsp)
	movl	%r9d, 16(%rsp)
	call	realloc@PLT
	movslq	52(%rsp), %r10
	movl	28(%rsp), %edx
	movq	%rax, %rdi
	movl	24(%rsp), %ecx
	movl	16(%rsp), %r9d
	movq	%rax, 0(%rbp)
	movl	48(%rsp), %eax
	movl	%eax, 8(%rsp)
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L51:
	addl	%r9d, %r9d
	movl	%r10d, 28(%rsp)
	movl	%r9d, 24(%rbp)
	movslq	%r9d, %r9
	leaq	0(,%r9,8), %rsi
	movl	%edx, 24(%rsp)
	movq	%r11, 16(%rsp)
	call	realloc@PLT
	movslq	28(%rsp), %r10
	movl	24(%rsp), %edx
	movq	%rax, 0(%rbp)
	movq	16(%rsp), %r11
	movq	%rax, %rdi
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L52:
	movq	%rbp, %r8
	movslq	%ebx, %rbp
.L27:
	leal	(%rbx,%rbx), %edi
	movl	$4, %esi
	movq	%r8, 16(%rsp)
	movabsq	$-8543223828751151131, %rbx
	movslq	%edi, %rdi
	call	calloc@PLT
	movq	16(%rsp), %rdi
	xorl	%esi, %esi
	movq	%rax, %r15
	leaq	(%rax,%rbp,4), %rax
	movq	%rax, %rcx
	movq	%r15, %rdx
	movq	%rax, 8(%rsp)
	call	BFS_graph
	movslq	44(%rsp), %r12
	movl	$4, %esi
	leal	(%r12,%r12), %edi
	movslq	%edi, %rdi
	call	calloc@PLT
	movq	16(%rsp), %r8
	movq	%rax, %r9
	leal	-1(%r12), %eax
	testl	%eax, %eax
	movslq	%eax, %r14
	js	.L36
	.p2align 4,,10
	.p2align 3
.L35:
	movslq	(%r15,%r14,4), %rdx
	leal	(%r12,%rdx), %eax
	leaq	(%r9,%rdx,4), %r11
	cltq
	leaq	(%r9,%rax,4), %r10
	movq	(%rsp), %rax
	movl	$1, (%r10)
	movslq	(%rax,%rdx,4), %rax
	movl	$1, (%r11)
	cmpl	$-1, %eax
	je	.L39
	movq	8(%rsp), %rdi
	movq	(%r8), %r13
	movl	(%rdi,%rdx,4), %ebp
	.p2align 4,,10
	.p2align 3
.L40:
	leaq	0(%r13,%rax,8), %rsi
	movl	(%rsi), %eax
	cmpl	%eax, %ebp
	je	.L37
	movslq	%eax, %rdx
	addl	%r12d, %eax
	leaq	(%r9,%rdx,4), %rdi
	cltq
	movl	(%rdi), %ecx
	addl	(%r9,%rax,4), %ecx
	movslq	(%r11), %rax
	movslq	%ecx, %rcx
	imulq	%rax, %rcx
	movq	%rcx, %rax
	imulq	%rbx
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %rcx
	movl	%ecx, (%r11)
	movslq	(%rdi), %rax
	movslq	(%r10), %rcx
	imulq	%rax, %rcx
	movq	%rcx, %rax
	imulq	%rbx
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	movslq	4(%rsi), %rax
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %rcx
	movl	%ecx, (%r10)
	cmpl	$-1, %eax
	jne	.L40
.L39:
	subq	$1, %r14
	testl	%r14d, %r14d
	jns	.L35
.L36:
	movl	(%r9), %edx
	addl	(%r9,%r12,4), %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	movslq	%edx, %rax
	movl	%edx, %ecx
	imulq	$1152921497, %rax, %rax
	sarl	$31, %ecx
	sarq	$60, %rax
	subl	%ecx, %eax
	imull	$1000000007, %eax, %eax
	subl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L54
	addq	$72, %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
.L37:
	.cfi_restore_state
	movslq	4(%rsi), %rax
	cmpl	$-1, %eax
	jne	.L40
	subq	$1, %r14
	testl	%r14d, %r14d
	jns	.L35
	jmp	.L36
.L54:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE42:
	.size	run, .-run
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB43:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	call	run
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE43:
	.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>
#include<stdlib.h>
#include<stdint.h>
#include<inttypes.h>

typedef int32_t i32;
typedef int64_t i64;

#define ALLOC(size,type) ((type*)calloc((size),sizeof(type)))

typedef struct directed_edge {
  int32_t vertex;
  int32_t next;
} graph_edge;

typedef struct directedGraph {
  graph_edge *edge;
  int32_t *start;
  int32_t pointer;
  int32_t vertex_num;
  int32_t edge_max_size;
} graph;

graph* new_graph (const int vertex_num) {
  graph *g = (graph *) calloc (1, sizeof (graph));
  g->edge = (graph_edge *) calloc (1, sizeof (graph_edge));
  g->start = (int32_t *) calloc (vertex_num, sizeof (int32_t));
  g->pointer = 0;
  g->vertex_num = vertex_num;
  g->edge_max_size = 1;
  for (int32_t i = 0; i < vertex_num; ++i) {
    g->start[i] = -1;
  }
  return g;
}

void add_edge (graph *g, int32_t from, int32_t to) {
  if (g->pointer == g->edge_max_size) {
    g->edge_max_size *= 2;
    g->edge = (graph_edge *) realloc (g->edge, sizeof (graph_edge) * g->edge_max_size);
  }
  g->edge[g->pointer] = (graph_edge) {to, g->start[from]};
  g->start[from] = g->pointer++;
}

void BFS_graph (graph *g, int32_t src, i32 *q, i32 *parent) {
  uint8_t *used = (uint8_t *) calloc (g->vertex_num, sizeof (uint8_t));
  int32_t front = 0;
  int32_t last = 0;
  used[src] = 1;
  q[last++] = src;
  while (front < last) {
    const int32_t v = q[front++];
    for (int32_t p = g->start[v]; p != -1; p = g->edge[p].next) {
      const int32_t u = g->edge[p].vertex;
      if (!used[u]) {
        used[u] = 1;
        q[last++] = u;
        parent[u] = v;
      }
    }
  }
  free(used);
}

void run (void) {
  i32 n;
  scanf ("%" SCNi32, &n);
  graph *g = new_graph (n);
  for (i32 i = 1; i < n; ++i) {
    i32 x, y;
    scanf ("%" SCNi32 "%" SCNi32, &x, &y);
    x--;
    y--;
    add_edge (g, x, y);
    add_edge (g, y, x);
  }
  i32 *q = ALLOC (2 * n, i32);
  i32 *parent = q + n;
  BFS_graph (g, 0, q, parent);
  i32 *dp = ALLOC (2 * n, i32);
  const i32 mod = 1000000007;
  for (i32 i = n - 1; i >= 0; --i) {
    i32 v = q[i];
    dp[v] = dp[v + n] = 1;
    for (i32 p = g->start[v]; p != -1; p = g->edge[p].next) {
      i32 u = g->edge[p].vertex;
      if (u == parent[v]) continue;
      dp[v] = (i64) dp[v] * (dp[u] + dp[u + n]) % mod;
      dp[v + n] = (i64) dp[v + n] * dp[u] % mod;
    }
  }
  i32 ans = (dp[0] + dp[n]) % mod;
  printf ("%" PRIi32 "\n", ans);
}

int main (void) {
  run();
  return 0;
}

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

154
 157
 164
 160
 170
 152
 176
 150
 162
 180

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<stdint.h>
#include<inttypes.h>

typedef int32_t i32;
typedef int64_t i64;

#define ALLOC(size,type) ((type*)calloc((size),sizeof(type)))

typedef struct directed_edge {
  int32_t vertex;
  int32_t next;
} graph_edge;

typedef struct directedGraph {
  graph_edge *edge;
  int32_t *start;
  int32_t pointer;
  int32_t vertex_num;
  int32_t edge_max_size;
} graph;

graph* new_graph (const int vertex_num) {
  graph *g = (graph *) calloc (1, sizeof (graph));
  g->edge = (graph_edge *) calloc (1, sizeof (graph_edge));
  g->start = (int32_t *) calloc (vertex_num, sizeof (int32_t));
  g->pointer = 0;
  g->vertex_num = vertex_num;
  g->edge_max_size = 1;
  for (int32_t i = 0; i < vertex_num; ++i) {
    g->start[i] = -1;
  }
  return g;
}

void add_edge (graph *g, int32_t from, int32_t to) {
  if (g->pointer == g->edge_max_size) {
    g->edge_max_size *= 2;
    g->edge = (graph_edge *) realloc (g->edge, sizeof (graph_edge) * g->edge_max_size);
  }
  g->edge[g->pointer] = (graph_edge) {to, g->start[from]};
  g->start[from] = g->pointer++;
}

void BFS_graph (graph *g, int32_t src, i32 *q, i32 *parent) {
  uint8_t *used = (uint8_t *) calloc (g->vertex_num, sizeof (uint8_t));
  int32_t front = 0;
  int32_t last = 0;
  used[src] = 1;
  q[last++] = src;
  while (front < last) {
    const int32_t v = q[front++];
    for (int32_t p = g->start[v]; p != -1; p = g->edge[p].next) {
      const int32_t u = g->edge[p].vertex;
      if (!used[u]) {
        used[u] = 1;
        q[last++] = u;
        parent[u] = v;
      }
    }
  }
  free(used);
}

void run (void) {
  i32 n;
  scanf ("%" SCNi32, &n);
  graph *g = new_graph (n);
  for (i32 i = 1; i < n; ++i) {
    i32 x, y;
    scanf ("%" SCNi32 "%" SCNi32, &x, &y);
    x--;
    y--;
    add_edge (g, x, y);
    add_edge (g, y, x);
  }
  i32 *q = ALLOC (2 * n, i32);
  i32 *parent = q + n;
  BFS_graph (g, 0, q, parent);
  i32 *dp = ALLOC (2 * n, i32);
  const i32 mod = 1000000007;
  for (i32 i = n - 1; i >= 0; --i) {
    i32 v = q[i];
    dp[v] = dp[v + n] = 1;
    for (i32 p = g->start[v]; p != -1; p = g->edge[p].next) {
      i32 u = g->edge[p].vertex;
      if (u == parent[v]) continue;
      dp[v] = (i64) dp[v] * (dp[u] + dp[u + n]) % mod;
      dp[v + n] = (i64) dp[v + n] * dp[u] % mod;
    }
  }
  i32 ans = (dp[0] + dp[n]) % mod;
  printf ("%" PRIi32 "\n", ans);
}

int main (void) {
  run();
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	new_graph
	.type	new_graph, @function
new_graph:
.LFB6:
	.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	$32, %esi
	movl	$1, %edi
	call	calloc@PLT
	movq	%rax, -8(%rbp)
	movl	$8, %esi
	movl	$1, %edi
	call	calloc@PLT
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, (%rax)
	movl	-20(%rbp), %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 8(%rax)
	movq	-8(%rbp), %rax
	movl	$0, 16(%rax)
	movq	-8(%rbp), %rax
	movl	-20(%rbp), %edx
	movl	%edx, 20(%rax)
	movq	-8(%rbp), %rax
	movl	$1, 24(%rax)
	movl	$0, -12(%rbp)
	jmp	.L2
.L3:
	movq	-8(%rbp), %rax
	movq	8(%rax), %rdx
	movl	-12(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	$-1, (%rax)
	addl	$1, -12(%rbp)
.L2:
	movl	-12(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L3
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	new_graph, .-new_graph
	.globl	add_edge
	.type	add_edge, @function
add_edge:
.LFB7:
	.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)
	movl	%esi, -12(%rbp)
	movl	%edx, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	16(%rax), %edx
	movq	-8(%rbp), %rax
	movl	24(%rax), %eax
	cmpl	%eax, %edx
	jne	.L6
	movq	-8(%rbp), %rax
	movl	24(%rax), %eax
	leal	(%rax,%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, 24(%rax)
	movq	-8(%rbp), %rax
	movl	24(%rax), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	realloc@PLT
	movq	-8(%rbp), %rdx
	movq	%rax, (%rdx)
.L6:
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movl	16(%rax), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	-8(%rbp), %rdx
	movq	8(%rdx), %rcx
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	salq	$2, %rdx
	addq	%rcx, %rdx
	movl	(%rdx), %edx
	movl	-16(%rbp), %ecx
	movl	%ecx, (%rax)
	movl	%edx, 4(%rax)
	movq	-8(%rbp), %rax
	movl	16(%rax), %eax
	leal	1(%rax), %ecx
	movq	-8(%rbp), %rdx
	movl	%ecx, 16(%rdx)
	movq	-8(%rbp), %rdx
	movq	8(%rdx), %rcx
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	salq	$2, %rdx
	addq	%rcx, %rdx
	movl	%eax, (%rdx)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	add_edge, .-add_edge
	.globl	BFS_graph
	.type	BFS_graph, @function
BFS_graph:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%rdi, -40(%rbp)
	movl	%esi, -44(%rbp)
	movq	%rdx, -56(%rbp)
	movq	%rcx, -64(%rbp)
	movq	-40(%rbp), %rax
	movl	20(%rax), %eax
	cltq
	movl	$1, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -8(%rbp)
	movl	$0, -28(%rbp)
	movl	$0, -24(%rbp)
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movb	$1, (%rax)
	movl	-24(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -24(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rax, %rdx
	movl	-44(%rbp), %eax
	movl	%eax, (%rdx)
	jmp	.L8
.L12:
	movl	-28(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -28(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -16(%rbp)
	movq	-40(%rbp), %rax
	movq	8(%rax), %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -20(%rbp)
	jmp	.L9
.L11:
	movq	-40(%rbp), %rax
	movq	(%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L10
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movb	$1, (%rax)
	movl	-24(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -24(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rax, %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rdx)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-64(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	movl	%eax, (%rdx)
.L10:
	movq	-40(%rbp), %rax
	movq	(%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movl	4(%rax), %eax
	movl	%eax, -20(%rbp)
.L9:
	cmpl	$-1, -20(%rbp)
	jne	.L11
.L8:
	movl	-28(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jl	.L12
	movq	-8(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	BFS_graph, .-BFS_graph
	.section	.rodata
.LC0:
	.string	"%i"
.LC1:
	.string	"%i%i"
.LC2:
	.string	"%i\n"
	.text
	.globl	run
	.type	run, @function
run:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-80(%rbp), %eax
	movl	%eax, %edi
	call	new_graph
	movq	%rax, -40(%rbp)
	movl	$1, -68(%rbp)
	jmp	.L14
.L15:
	leaq	-72(%rbp), %rdx
	leaq	-76(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-76(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -76(%rbp)
	movl	-72(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -72(%rbp)
	movl	-72(%rbp), %edx
	movl	-76(%rbp), %ecx
	movq	-40(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	add_edge
	movl	-76(%rbp), %edx
	movl	-72(%rbp), %ecx
	movq	-40(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	add_edge
	addl	$1, -68(%rbp)
.L14:
	movl	-80(%rbp), %eax
	cmpl	%eax, -68(%rbp)
	jl	.L15
	movl	-80(%rbp), %eax
	addl	%eax, %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -32(%rbp)
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, -24(%rbp)
	movq	-24(%rbp), %rcx
	movq	-32(%rbp), %rdx
	movq	-40(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	BFS_graph
	movl	-80(%rbp), %eax
	addl	%eax, %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -16(%rbp)
	movl	$1000000007, -56(%rbp)
	movl	-80(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -64(%rbp)
	jmp	.L16
.L21:
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	movl	-80(%rbp), %edx
	movl	-48(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, (%rax)
	movl	-48(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-16(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movq	-40(%rbp), %rax
	movq	8(%rax), %rdx
	movl	-48(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -60(%rbp)
	jmp	.L17
.L20:
	movq	-40(%rbp), %rax
	movq	(%rax), %rdx
	movl	-60(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -44(%rbp)
	je	.L23
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movslq	%eax, %rdx
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-16(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %ecx
	movl	-80(%rbp), %esi
	movl	-44(%rbp), %eax
	addl	%esi, %eax
	cltq
	leaq	0(,%rax,4), %rsi
	movq	-16(%rbp), %rax
	addq	%rsi, %rax
	movl	(%rax), %eax
	addl	%ecx, %eax
	cltq
	imulq	%rdx, %rax
	movl	-56(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-16(%rbp), %rax
	addq	%rcx, %rax
	movl	%edx, (%rax)
	movl	-80(%rbp), %edx
	movl	-48(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movslq	%eax, %rdx
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-16(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cltq
	imulq	%rdx, %rax
	movl	-56(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movl	-80(%rbp), %edx
	movl	-48(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	%ecx, %edx
	movl	%edx, (%rax)
	jmp	.L19
.L23:
	nop
.L19:
	movq	-40(%rbp), %rax
	movq	(%rax), %rdx
	movl	-60(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movl	4(%rax), %eax
	movl	%eax, -60(%rbp)
.L17:
	cmpl	$-1, -60(%rbp)
	jne	.L20
	subl	$1, -64(%rbp)
.L16:
	cmpl	$0, -64(%rbp)
	jns	.L21
	movq	-16(%rbp), %rax
	movl	(%rax), %edx
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-16(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	addl	%edx, %eax
	cltd
	idivl	-56(%rbp)
	movl	%edx, -52(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	run, .-run
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	call	run
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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	new_graph
	.type	new_graph, @function
new_graph:
.LFB6:
	.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	$32, %esi
	movl	$1, %edi
	call	calloc@PLT
	movq	%rax, -8(%rbp)
	movl	$8, %esi
	movl	$1, %edi
	call	calloc@PLT
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, (%rax)
	movl	-20(%rbp), %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 8(%rax)
	movq	-8(%rbp), %rax
	movl	$0, 16(%rax)
	movq	-8(%rbp), %rax
	movl	-20(%rbp), %edx
	movl	%edx, 20(%rax)
	movq	-8(%rbp), %rax
	movl	$1, 24(%rax)
	movl	$0, -12(%rbp)
	jmp	.L2
.L3:
	movq	-8(%rbp), %rax
	movq	8(%rax), %rdx
	movl	-12(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	$-1, (%rax)
	addl	$1, -12(%rbp)
.L2:
	movl	-12(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L3
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	new_graph, .-new_graph
	.globl	add_edge
	.type	add_edge, @function
add_edge:
.LFB7:
	.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)
	movl	%esi, -12(%rbp)
	movl	%edx, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	16(%rax), %edx
	movq	-8(%rbp), %rax
	movl	24(%rax), %eax
	cmpl	%eax, %edx
	jne	.L6
	movq	-8(%rbp), %rax
	movl	24(%rax), %eax
	leal	(%rax,%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, 24(%rax)
	movq	-8(%rbp), %rax
	movl	24(%rax), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	realloc@PLT
	movq	-8(%rbp), %rdx
	movq	%rax, (%rdx)
.L6:
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movl	16(%rax), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	-8(%rbp), %rdx
	movq	8(%rdx), %rcx
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	salq	$2, %rdx
	addq	%rcx, %rdx
	movl	(%rdx), %edx
	movl	-16(%rbp), %ecx
	movl	%ecx, (%rax)
	movl	%edx, 4(%rax)
	movq	-8(%rbp), %rax
	movl	16(%rax), %eax
	leal	1(%rax), %ecx
	movq	-8(%rbp), %rdx
	movl	%ecx, 16(%rdx)
	movq	-8(%rbp), %rdx
	movq	8(%rdx), %rcx
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	salq	$2, %rdx
	addq	%rcx, %rdx
	movl	%eax, (%rdx)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	add_edge, .-add_edge
	.globl	BFS_graph
	.type	BFS_graph, @function
BFS_graph:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%rdi, -40(%rbp)
	movl	%esi, -44(%rbp)
	movq	%rdx, -56(%rbp)
	movq	%rcx, -64(%rbp)
	movq	-40(%rbp), %rax
	movl	20(%rax), %eax
	cltq
	movl	$1, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -8(%rbp)
	movl	$0, -28(%rbp)
	movl	$0, -24(%rbp)
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movb	$1, (%rax)
	movl	-24(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -24(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rax, %rdx
	movl	-44(%rbp), %eax
	movl	%eax, (%rdx)
	jmp	.L8
.L12:
	movl	-28(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -28(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -16(%rbp)
	movq	-40(%rbp), %rax
	movq	8(%rax), %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -20(%rbp)
	jmp	.L9
.L11:
	movq	-40(%rbp), %rax
	movq	(%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L10
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movb	$1, (%rax)
	movl	-24(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -24(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rax, %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rdx)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-64(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	movl	%eax, (%rdx)
.L10:
	movq	-40(%rbp), %rax
	movq	(%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movl	4(%rax), %eax
	movl	%eax, -20(%rbp)
.L9:
	cmpl	$-1, -20(%rbp)
	jne	.L11
.L8:
	movl	-28(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jl	.L12
	movq	-8(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	BFS_graph, .-BFS_graph
	.section	.rodata
.LC0:
	.string	"%i"
.LC1:
	.string	"%i%i"
.LC2:
	.string	"%i\n"
	.text
	.globl	run
	.type	run, @function
run:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-80(%rbp), %eax
	movl	%eax, %edi
	call	new_graph
	movq	%rax, -40(%rbp)
	movl	$1, -68(%rbp)
	jmp	.L14
.L15:
	leaq	-72(%rbp), %rdx
	leaq	-76(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-76(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -76(%rbp)
	movl	-72(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -72(%rbp)
	movl	-72(%rbp), %edx
	movl	-76(%rbp), %ecx
	movq	-40(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	add_edge
	movl	-76(%rbp), %edx
	movl	-72(%rbp), %ecx
	movq	-40(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	add_edge
	addl	$1, -68(%rbp)
.L14:
	movl	-80(%rbp), %eax
	cmpl	%eax, -68(%rbp)
	jl	.L15
	movl	-80(%rbp), %eax
	addl	%eax, %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -32(%rbp)
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, -24(%rbp)
	movq	-24(%rbp), %rcx
	movq	-32(%rbp), %rdx
	movq	-40(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	BFS_graph
	movl	-80(%rbp), %eax
	addl	%eax, %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -16(%rbp)
	movl	$1000000007, -56(%rbp)
	movl	-80(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -64(%rbp)
	jmp	.L16
.L21:
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	movl	-80(%rbp), %edx
	movl	-48(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, (%rax)
	movl	-48(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-16(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movq	-40(%rbp), %rax
	movq	8(%rax), %rdx
	movl	-48(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -60(%rbp)
	jmp	.L17
.L20:
	movq	-40(%rbp), %rax
	movq	(%rax), %rdx
	movl	-60(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -44(%rbp)
	je	.L23
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movslq	%eax, %rdx
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-16(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %ecx
	movl	-80(%rbp), %esi
	movl	-44(%rbp), %eax
	addl	%esi, %eax
	cltq
	leaq	0(,%rax,4), %rsi
	movq	-16(%rbp), %rax
	addq	%rsi, %rax
	movl	(%rax), %eax
	addl	%ecx, %eax
	cltq
	imulq	%rdx, %rax
	movl	-56(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-16(%rbp), %rax
	addq	%rcx, %rax
	movl	%edx, (%rax)
	movl	-80(%rbp), %edx
	movl	-48(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movslq	%eax, %rdx
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-16(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cltq
	imulq	%rdx, %rax
	movl	-56(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movl	-80(%rbp), %edx
	movl	-48(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	%ecx, %edx
	movl	%edx, (%rax)
	jmp	.L19
.L23:
	nop
.L19:
	movq	-40(%rbp), %rax
	movq	(%rax), %rdx
	movl	-60(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movl	4(%rax), %eax
	movl	%eax, -60(%rbp)
.L17:
	cmpl	$-1, -60(%rbp)
	jne	.L20
	subl	$1, -64(%rbp)
.L16:
	cmpl	$0, -64(%rbp)
	jns	.L21
	movq	-16(%rbp), %rax
	movl	(%rax), %edx
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-16(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	addl	%edx, %eax
	cltd
	idivl	-56(%rbp)
	movl	%edx, -52(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	run, .-run
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	call	run
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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:
