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>

typedef long long int int64;

typedef struct directedGraph{
  int *vertex;
  int *next;
  int *start;
  int v,e;
  int pointer;
} graph;

graph* newGraph(const int v,const int e){
  graph *g=(graph *)malloc(sizeof(graph));
  g->vertex=(int *)calloc(e,sizeof(int));
  g->next=(int *)calloc(e,sizeof(int));
  g->start=(int *)calloc(v,sizeof(int));
  for(int i=0;i<v;i++) g->start[i]=-1;
  g->v=v;
  g->e=e;
  g->pointer=0;
  return g;
}

void freeGraph(graph *g){
  free(g->vertex);
  free(g->next);
  free(g->start);
  free(g);
  return;
}

void addEdge(graph *g,const int from,const int to){
  const int p=g->pointer;
  g->vertex[p]=to;
  g->next[p]=g->start[from];
  g->start[from]=p;
  g->pointer++;
  return;
}

void run(void){
  int n;
  scanf("%d",&n);
  graph *g=newGraph(n,2*n);
  int i;
  for(i=0;i<n-1;i++){
    int x,y;
    scanf("%d%d",&x,&y);
    x--;y--;
    addEdge(g,x,y);
    addEdge(g,y,x);
  }
  int *parent=(int *)calloc(n,sizeof(int));
  int *q=(int *)calloc(n,sizeof(int));
  parent[0]=-1;
  int front=0,last=0;
  q[last++]=0;
  while(last<n){
    const int v=q[front++];
    for(int p=g->start[v];p!=-1;p=g->next[p]){
      const int u=g->vertex[p];
      if(u==parent[v]) continue;
      parent[u]=v;
      q[last++]=u;
    }
  }
  const int mod=1000000007;
  int *dp=(int *)calloc(2*n,sizeof(int));
  for(i=n-1;i>=0;i--){
    const int v=q[i];
    dp[2*v]=dp[2*v+1]=1;
    for(int p=g->start[v];p!=-1;p=g->next[p]){
      const int u=g->vertex[p];
      if(parent[u]==v){
	dp[2*v]=(int64)dp[2*v]*(dp[2*u]+dp[2*u+1])%mod;
	dp[2*v+1]=(int64)dp[2*v+1]*dp[2*u]%mod;
      }
    }
  }
  printf("%d\n",(dp[0]+dp[1])%mod);
}

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

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	newGraph
	.type	newGraph, @function
newGraph:
.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	%esi, -24(%rbp)
	movl	$40, %edi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movl	-24(%rbp), %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, (%rax)
	movl	-24(%rbp), %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 8(%rax)
	movl	-20(%rbp), %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 16(%rax)
	movl	$0, -12(%rbp)
	jmp	.L2
.L3:
	movq	-8(%rbp), %rax
	movq	16(%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
	movl	-20(%rbp), %edx
	movl	%edx, 24(%rax)
	movq	-8(%rbp), %rax
	movl	-24(%rbp), %edx
	movl	%edx, 28(%rax)
	movq	-8(%rbp), %rax
	movl	$0, 32(%rax)
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	newGraph, .-newGraph
	.globl	freeGraph
	.type	freeGraph, @function
freeGraph:
.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)
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, %rdi
	call	free@PLT
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, %rdi
	call	free@PLT
	movq	-8(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, %rdi
	call	free@PLT
	movq	-8(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	freeGraph, .-freeGraph
	.globl	addEdge
	.type	addEdge, @function
addEdge:
.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, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	32(%rax), %eax
	movl	%eax, -4(%rbp)
	movq	-24(%rbp), %rax
	movq	(%rax), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	movl	-32(%rbp), %eax
	movl	%eax, (%rdx)
	movq	-24(%rbp), %rax
	movq	16(%rax), %rdx
	movl	-28(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	(%rdx,%rax), %rcx
	movq	-24(%rbp), %rax
	movq	8(%rax), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	movl	(%rcx), %eax
	movl	%eax, (%rdx)
	movq	-24(%rbp), %rax
	movq	16(%rax), %rdx
	movl	-28(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
	movq	-24(%rbp), %rax
	movl	32(%rax), %eax
	leal	1(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, 32(%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	addEdge, .-addEdge
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d\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	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-92(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-92(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	-92(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	newGraph
	movq	%rax, -40(%rbp)
	movl	$0, -80(%rbp)
	jmp	.L10
.L11:
	leaq	-84(%rbp), %rdx
	leaq	-88(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-88(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -88(%rbp)
	movl	-84(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -84(%rbp)
	movl	-84(%rbp), %edx
	movl	-88(%rbp), %ecx
	movq	-40(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	addEdge
	movl	-88(%rbp), %edx
	movl	-84(%rbp), %ecx
	movq	-40(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	addEdge
	addl	$1, -80(%rbp)
.L10:
	movl	-92(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -80(%rbp)
	jl	.L11
	movl	-92(%rbp), %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -32(%rbp)
	movl	-92(%rbp), %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -24(%rbp)
	movq	-32(%rbp), %rax
	movl	$-1, (%rax)
	movl	$0, -76(%rbp)
	movl	$0, -72(%rbp)
	movl	-72(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -72(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	$0, (%rax)
	jmp	.L12
.L17:
	movl	-76(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -76(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	movq	-40(%rbp), %rax
	movq	16(%rax), %rdx
	movl	-48(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -68(%rbp)
	jmp	.L13
.L16:
	movq	-40(%rbp), %rax
	movq	(%rax), %rdx
	movl	-68(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -44(%rbp)
	je	.L24
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rax, %rdx
	movl	-48(%rbp), %eax
	movl	%eax, (%rdx)
	movl	-72(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -72(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movl	-44(%rbp), %eax
	movl	%eax, (%rdx)
	jmp	.L15
.L24:
	nop
.L15:
	movq	-40(%rbp), %rax
	movq	8(%rax), %rdx
	movl	-68(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -68(%rbp)
.L13:
	cmpl	$-1, -68(%rbp)
	jne	.L16
.L12:
	movl	-92(%rbp), %eax
	cmpl	%eax, -72(%rbp)
	jl	.L17
	movl	$1000000007, -60(%rbp)
	movl	-92(%rbp), %eax
	addl	%eax, %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -16(%rbp)
	movl	-92(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -80(%rbp)
	jmp	.L18
.L22:
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)
	movl	-56(%rbp), %eax
	addl	%eax, %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, (%rax)
	movl	-56(%rbp), %edx
	addl	%edx, %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	16(%rax), %rdx
	movl	-56(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)
	jmp	.L19
.L21:
	movq	-40(%rbp), %rax
	movq	(%rax), %rdx
	movl	-64(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)
	movl	-52(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -56(%rbp)
	jne	.L20
	movl	-56(%rbp), %eax
	addl	%eax, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movslq	%eax, %rdx
	movl	-52(%rbp), %eax
	addl	%eax, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-16(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %ecx
	movl	-52(%rbp), %eax
	addl	%eax, %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rsi
	movq	-16(%rbp), %rax
	addq	%rsi, %rax
	movl	(%rax), %eax
	addl	%ecx, %eax
	cltq
	imulq	%rdx, %rax
	movl	-60(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movl	-56(%rbp), %eax
	addl	%eax, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-16(%rbp), %rax
	addq	%rcx, %rax
	movl	%edx, (%rax)
	movl	-56(%rbp), %eax
	addl	%eax, %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movslq	%eax, %rdx
	movl	-52(%rbp), %eax
	addl	%eax, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-16(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cltq
	imulq	%rdx, %rax
	movl	-60(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movl	-56(%rbp), %eax
	addl	%eax, %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rcx
	movq	-16(%rbp), %rax
	addq	%rcx, %rax
	movl	%edx, (%rax)
.L20:
	movq	-40(%rbp), %rax
	movq	8(%rax), %rdx
	movl	-64(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)
.L19:
	cmpl	$-1, -64(%rbp)
	jne	.L21
	subl	$1, -80(%rbp)
.L18:
	cmpl	$0, -80(%rbp)
	jns	.L22
	movq	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	addq	$4, %rax
	movl	(%rax), %eax
	addl	%edx, %eax
	cltd
	idivl	-60(%rbp)
	movl	%edx, %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	.L23
	call	__stack_chk_fail@PLT
.L23:
	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	newGraph
	.type	newGraph, @function
newGraph:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movslq	%esi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movslq	%edi, %rbx
	movd	%ebp, %xmm1
	movl	$40, %edi
	movd	%ebx, %xmm0
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, %r14
	call	malloc@PLT
	movl	$4, %esi
	movq	%rbp, %rdi
	movq	%rax, %r12
	call	calloc@PLT
	movl	$4, %esi
	movq	%rbp, %rdi
	movq	%rax, (%r12)
	call	calloc@PLT
	movl	$4, %esi
	movq	%rbx, %rdi
	movq	%rax, 8(%r12)
	call	calloc@PLT
	movq	%rax, 16(%r12)
	testl	%ebx, %ebx
	jle	.L2
	movq	%rax, %rdi
	leaq	0(,%rbx,4), %rdx
	movl	$255, %esi
	call	memset@PLT
.L2:
	popq	%rbx
	.cfi_def_cfa_offset 40
	movq	%r12, %rax
	popq	%rbp
	.cfi_def_cfa_offset 32
	movq	%r14, 24(%r12)
	movl	$0, 32(%r12)
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE39:
	.size	newGraph, .-newGraph
	.p2align 4
	.globl	freeGraph
	.type	freeGraph, @function
freeGraph:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rdi, %rbp
	movq	(%rdi), %rdi
	call	free@PLT
	movq	8(%rbp), %rdi
	call	free@PLT
	movq	16(%rbp), %rdi
	call	free@PLT
	movq	%rbp, %rdi
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	free@PLT
	.cfi_endproc
.LFE40:
	.size	freeGraph, .-freeGraph
	.p2align 4
	.globl	addEdge
	.type	addEdge, @function
addEdge:
.LFB41:
	.cfi_startproc
	endbr64
	movslq	32(%rdi), %rcx
	movq	(%rdi), %rax
	movslq	%esi, %rsi
	movl	%edx, (%rax,%rcx,4)
	movq	16(%rdi), %rax
	leaq	(%rax,%rsi,4), %rax
	movq	8(%rdi), %rsi
	movl	(%rax), %r8d
	movl	%r8d, (%rsi,%rcx,4)
	movl	%ecx, (%rax)
	addl	$1, 32(%rdi)
	ret
	.cfi_endproc
.LFE41:
	.size	addEdge, .-addEdge
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d\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	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	28(%rsp), %r15
	movl	$40, %edi
	leal	(%r15,%r15), %ebp
	movd	%r15d, %xmm2
	movq	%r15, %r13
	movd	%ebp, %xmm3
	movslq	%ebp, %rbp
	punpckldq	%xmm3, %xmm2
	movq	%xmm2, 8(%rsp)
	call	malloc@PLT
	movl	$4, %esi
	movq	%rbp, %rdi
	movq	%rax, %r14
	call	calloc@PLT
	movl	$4, %esi
	movq	%rbp, %rdi
	movq	%rax, (%r14)
	movq	%rax, %rbx
	call	calloc@PLT
	movl	$4, %esi
	movq	%r15, %rdi
	movq	%rax, 8(%r14)
	movq	%rax, %r12
	call	calloc@PLT
	movq	%rax, (%rsp)
	movq	%rax, 16(%r14)
	testl	%r15d, %r15d
	jle	.L12
	movq	%rax, %rdi
	leaq	0(,%r15,4), %rdx
	movl	$255, %esi
	call	memset@PLT
.L12:
	movq	8(%rsp), %rax
	leal	-1(%r13), %r8d
	movl	$0, 32(%r14)
	movq	%rax, 24(%r14)
	testl	%r8d, %r8d
	jle	.L11
	xorl	%ebp, %ebp
	movq	%r12, 8(%rsp)
	movq	%rbx, %r12
	movq	%r14, %rbx
	movl	%ebp, %r14d
	movq	(%rsp), %rbp
	leaq	36(%rsp), %r15
	leaq	32(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%r15, %rdx
	movq	%r13, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %eax
	movslq	32(%rbx), %rdi
	addl	$1, %r14d
	movq	8(%rsp), %rcx
	leal	-1(%rax), %esi
	movl	36(%rsp), %eax
	movslq	%esi, %r8
	movl	%esi, 4(%r12,%rdi,4)
	leal	1(%rdi), %esi
	leal	-1(%rax), %edx
	movq	%rdi, %rax
	leaq	0(%rbp,%r8,4), %r8
	movl	%edx, (%r12,%rdi,4)
	movslq	%edx, %rdx
	addl	$2, %eax
	movd	(%r8), %xmm0
	leaq	0(%rbp,%rdx,4), %rdx
	movl	%edi, (%r8)
	movl	%eax, 32(%rbx)
	movd	(%rdx), %xmm1
	movl	28(%rsp), %eax
	movl	%esi, (%rdx)
	punpckldq	%xmm1, %xmm0
	leal	-1(%rax), %r8d
	movq	%xmm0, (%rcx,%rdi,4)
	cmpl	%r14d, %r8d
	jg	.L10
	movslq	%eax, %r15
	movq	%r12, %rbx
	movq	%rcx, %r12
	leal	(%r15,%r15), %ebp
	movq	%r15, %r13
	movslq	%ebp, %rbp
.L11:
	movq	%r15, %rdi
	movl	$4, %esi
	movl	%r8d, 8(%rsp)
	call	calloc@PLT
	movl	$4, %esi
	movq	%r15, %rdi
	movq	%rax, %r14
	call	calloc@PLT
	cmpl	$1, %r13d
	movl	8(%rsp), %r8d
	movl	$-1, (%r14)
	movl	$0, (%rax)
	movq	%rax, %r15
	movq	%rax, %r11
	movl	$1, %esi
	jle	.L21
	movl	%r8d, 8(%rsp)
	movq	(%rsp), %r10
	.p2align 4,,10
	.p2align 3
.L20:
	movslq	(%r11), %rax
	movq	%rax, %r9
	leaq	0(,%rax,4), %r8
	movslq	(%r10,%rax,4), %rax
	cmpl	$-1, %eax
	je	.L16
	addq	%r14, %r8
	.p2align 4,,10
	.p2align 3
.L47:
	movl	(%rbx,%rax,4), %edx
	movslq	%esi, %rcx
	cmpl	%edx, (%r8)
	je	.L17
	movslq	%edx, %rdi
	movl	%edx, (%r15,%rcx,4)
	addl	$1, %esi
	movl	%r9d, (%r14,%rdi,4)
	movslq	(%r12,%rax,4), %rax
	cmpl	$-1, %eax
	jne	.L47
.L16:
	addq	$4, %r11
	cmpl	%esi, %r13d
	jg	.L20
.L51:
	movl	8(%rsp), %r8d
.L21:
	movl	$4, %esi
	movq	%rbp, %rdi
	movl	%r8d, 8(%rsp)
	call	calloc@PLT
	movslq	8(%rsp), %r8
	movq	%rax, %r9
	testl	%r8d, %r8d
	js	.L15
	movq	.LC3(%rip), %xmm0
	leaq	(%r15,%r8,4), %rbp
	movabsq	$-8543223828751151131, %r13
	subq	$4, %r15
	.p2align 4,,10
	.p2align 3
.L23:
	movl	0(%rbp), %edi
	movq	(%rsp), %rcx
	leal	(%rdi,%rdi), %eax
	cltq
	leaq	(%r9,%rax,4), %r10
	leaq	4(%r9,%rax,4), %r11
	movslq	%edi, %rax
	movslq	(%rcx,%rax,4), %rcx
	movq	%xmm0, (%r10)
	cmpl	$-1, %ecx
	je	.L26
	.p2align 4,,10
	.p2align 3
.L22:
	movslq	(%rbx,%rcx,4), %rdx
	movq	%rdx, %rax
	cmpl	%edi, (%r14,%rdx,4)
	je	.L49
	movslq	(%r12,%rcx,4), %rcx
	cmpl	$-1, %ecx
	jne	.L22
.L26:
	subq	$4, %rbp
	cmpq	%r15, %rbp
	jne	.L23
.L15:
	movl	4(%r9), %edx
	addl	(%r9), %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	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L50
	addq	$56, %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
.L49:
	.cfi_restore_state
	addl	%eax, %eax
	cltq
	leaq	(%r9,%rax,4), %r8
	movl	(%r8), %esi
	addl	4(%r9,%rax,4), %esi
	movslq	(%r10), %rax
	movslq	%esi, %rsi
	imulq	%rax, %rsi
	movq	%rsi, %rax
	imulq	%r13
	movq	%rsi, %rax
	sarq	$63, %rax
	addq	%rsi, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %rsi
	movl	%esi, (%r10)
	movslq	(%r8), %rax
	movslq	(%r11), %rsi
	imulq	%rax, %rsi
	movq	%rsi, %rax
	imulq	%r13
	movq	%rsi, %rax
	sarq	$63, %rax
	addq	%rsi, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %rsi
	movl	%esi, (%r11)
	movslq	(%r12,%rcx,4), %rcx
	cmpl	$-1, %ecx
	jne	.L22
	subq	$4, %rbp
	cmpq	%r15, %rbp
	jne	.L23
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L17:
	movslq	(%r12,%rax,4), %rax
	cmpl	$-1, %eax
	jne	.L47
	addq	$4, %r11
	cmpl	%esi, %r13d
	jg	.L20
	jmp	.L51
.L50:
	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
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC3:
	.long	1
	.long	1
	.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	newGraph
	.type	newGraph, @function
newGraph:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movslq	%esi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movslq	%edi, %rbx
	movd	%ebp, %xmm1
	movl	$40, %edi
	movd	%ebx, %xmm0
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, %r14
	call	malloc@PLT
	movl	$4, %esi
	movq	%rbp, %rdi
	movq	%rax, %r12
	call	calloc@PLT
	movl	$4, %esi
	movq	%rbp, %rdi
	movq	%rax, (%r12)
	call	calloc@PLT
	movl	$4, %esi
	movq	%rbx, %rdi
	movq	%rax, 8(%r12)
	call	calloc@PLT
	movq	%rax, 16(%r12)
	testl	%ebx, %ebx
	jle	.L2
	movq	%rax, %rdi
	leaq	0(,%rbx,4), %rdx
	movl	$255, %esi
	call	memset@PLT
.L2:
	popq	%rbx
	.cfi_def_cfa_offset 40
	movq	%r12, %rax
	popq	%rbp
	.cfi_def_cfa_offset 32
	movq	%r14, 24(%r12)
	movl	$0, 32(%r12)
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE39:
	.size	newGraph, .-newGraph
	.p2align 4
	.globl	freeGraph
	.type	freeGraph, @function
freeGraph:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rdi, %rbp
	movq	(%rdi), %rdi
	call	free@PLT
	movq	8(%rbp), %rdi
	call	free@PLT
	movq	16(%rbp), %rdi
	call	free@PLT
	movq	%rbp, %rdi
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	free@PLT
	.cfi_endproc
.LFE40:
	.size	freeGraph, .-freeGraph
	.p2align 4
	.globl	addEdge
	.type	addEdge, @function
addEdge:
.LFB41:
	.cfi_startproc
	endbr64
	movslq	32(%rdi), %rcx
	movq	(%rdi), %rax
	movslq	%esi, %rsi
	movl	%edx, (%rax,%rcx,4)
	movq	16(%rdi), %rax
	leaq	(%rax,%rsi,4), %rax
	movq	8(%rdi), %rsi
	movl	(%rax), %r8d
	movl	%r8d, (%rsi,%rcx,4)
	movl	%ecx, (%rax)
	addl	$1, 32(%rdi)
	ret
	.cfi_endproc
.LFE41:
	.size	addEdge, .-addEdge
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d\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	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	28(%rsp), %r15
	movl	$40, %edi
	leal	(%r15,%r15), %ebp
	movd	%r15d, %xmm2
	movq	%r15, %r13
	movd	%ebp, %xmm3
	movslq	%ebp, %rbp
	punpckldq	%xmm3, %xmm2
	movq	%xmm2, 8(%rsp)
	call	malloc@PLT
	movl	$4, %esi
	movq	%rbp, %rdi
	movq	%rax, %r14
	call	calloc@PLT
	movl	$4, %esi
	movq	%rbp, %rdi
	movq	%rax, (%r14)
	movq	%rax, %rbx
	call	calloc@PLT
	movl	$4, %esi
	movq	%r15, %rdi
	movq	%rax, 8(%r14)
	movq	%rax, %r12
	call	calloc@PLT
	movq	%rax, (%rsp)
	movq	%rax, 16(%r14)
	testl	%r15d, %r15d
	jle	.L12
	movq	%rax, %rdi
	leaq	0(,%r15,4), %rdx
	movl	$255, %esi
	call	memset@PLT
.L12:
	movq	8(%rsp), %rax
	leal	-1(%r13), %r8d
	movl	$0, 32(%r14)
	movq	%rax, 24(%r14)
	testl	%r8d, %r8d
	jle	.L11
	xorl	%ebp, %ebp
	movq	%r12, 8(%rsp)
	movq	%rbx, %r12
	movq	%r14, %rbx
	movl	%ebp, %r14d
	movq	(%rsp), %rbp
	leaq	36(%rsp), %r15
	leaq	32(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%r15, %rdx
	movq	%r13, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %eax
	movslq	32(%rbx), %rdi
	addl	$1, %r14d
	movq	8(%rsp), %rcx
	leal	-1(%rax), %esi
	movl	36(%rsp), %eax
	movslq	%esi, %r8
	movl	%esi, 4(%r12,%rdi,4)
	leal	1(%rdi), %esi
	leal	-1(%rax), %edx
	movq	%rdi, %rax
	leaq	0(%rbp,%r8,4), %r8
	movl	%edx, (%r12,%rdi,4)
	movslq	%edx, %rdx
	addl	$2, %eax
	movd	(%r8), %xmm0
	leaq	0(%rbp,%rdx,4), %rdx
	movl	%edi, (%r8)
	movl	%eax, 32(%rbx)
	movd	(%rdx), %xmm1
	movl	28(%rsp), %eax
	movl	%esi, (%rdx)
	punpckldq	%xmm1, %xmm0
	leal	-1(%rax), %r8d
	movq	%xmm0, (%rcx,%rdi,4)
	cmpl	%r14d, %r8d
	jg	.L10
	movslq	%eax, %r15
	movq	%r12, %rbx
	movq	%rcx, %r12
	leal	(%r15,%r15), %ebp
	movq	%r15, %r13
	movslq	%ebp, %rbp
.L11:
	movq	%r15, %rdi
	movl	$4, %esi
	movl	%r8d, 8(%rsp)
	call	calloc@PLT
	movl	$4, %esi
	movq	%r15, %rdi
	movq	%rax, %r14
	call	calloc@PLT
	cmpl	$1, %r13d
	movl	8(%rsp), %r8d
	movl	$-1, (%r14)
	movl	$0, (%rax)
	movq	%rax, %r15
	movq	%rax, %r11
	movl	$1, %esi
	jle	.L21
	movl	%r8d, 8(%rsp)
	movq	(%rsp), %r10
	.p2align 4,,10
	.p2align 3
.L20:
	movslq	(%r11), %rax
	movq	%rax, %r9
	leaq	0(,%rax,4), %r8
	movslq	(%r10,%rax,4), %rax
	cmpl	$-1, %eax
	je	.L16
	addq	%r14, %r8
	.p2align 4,,10
	.p2align 3
.L47:
	movl	(%rbx,%rax,4), %edx
	movslq	%esi, %rcx
	cmpl	%edx, (%r8)
	je	.L17
	movslq	%edx, %rdi
	movl	%edx, (%r15,%rcx,4)
	addl	$1, %esi
	movl	%r9d, (%r14,%rdi,4)
	movslq	(%r12,%rax,4), %rax
	cmpl	$-1, %eax
	jne	.L47
.L16:
	addq	$4, %r11
	cmpl	%esi, %r13d
	jg	.L20
.L51:
	movl	8(%rsp), %r8d
.L21:
	movl	$4, %esi
	movq	%rbp, %rdi
	movl	%r8d, 8(%rsp)
	call	calloc@PLT
	movslq	8(%rsp), %r8
	movq	%rax, %r9
	testl	%r8d, %r8d
	js	.L15
	movq	.LC3(%rip), %xmm0
	leaq	(%r15,%r8,4), %rbp
	movabsq	$-8543223828751151131, %r13
	subq	$4, %r15
	.p2align 4,,10
	.p2align 3
.L23:
	movl	0(%rbp), %edi
	movq	(%rsp), %rcx
	leal	(%rdi,%rdi), %eax
	cltq
	leaq	(%r9,%rax,4), %r10
	leaq	4(%r9,%rax,4), %r11
	movslq	%edi, %rax
	movslq	(%rcx,%rax,4), %rcx
	movq	%xmm0, (%r10)
	cmpl	$-1, %ecx
	je	.L26
	.p2align 4,,10
	.p2align 3
.L22:
	movslq	(%rbx,%rcx,4), %rdx
	movq	%rdx, %rax
	cmpl	%edi, (%r14,%rdx,4)
	je	.L49
	movslq	(%r12,%rcx,4), %rcx
	cmpl	$-1, %ecx
	jne	.L22
.L26:
	subq	$4, %rbp
	cmpq	%r15, %rbp
	jne	.L23
.L15:
	movl	4(%r9), %edx
	addl	(%r9), %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	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L50
	addq	$56, %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
.L49:
	.cfi_restore_state
	addl	%eax, %eax
	cltq
	leaq	(%r9,%rax,4), %r8
	movl	(%r8), %esi
	addl	4(%r9,%rax,4), %esi
	movslq	(%r10), %rax
	movslq	%esi, %rsi
	imulq	%rax, %rsi
	movq	%rsi, %rax
	imulq	%r13
	movq	%rsi, %rax
	sarq	$63, %rax
	addq	%rsi, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %rsi
	movl	%esi, (%r10)
	movslq	(%r8), %rax
	movslq	(%r11), %rsi
	imulq	%rax, %rsi
	movq	%rsi, %rax
	imulq	%r13
	movq	%rsi, %rax
	sarq	$63, %rax
	addq	%rsi, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %rsi
	movl	%esi, (%r11)
	movslq	(%r12,%rcx,4), %rcx
	cmpl	$-1, %ecx
	jne	.L22
	subq	$4, %rbp
	cmpq	%r15, %rbp
	jne	.L23
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L17:
	movslq	(%r12,%rax,4), %rax
	cmpl	$-1, %eax
	jne	.L47
	addq	$4, %r11
	cmpl	%esi, %r13d
	jg	.L20
	jmp	.L51
.L50:
	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
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC3:
	.long	1
	.long	1
	.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>

typedef long long int int64;

typedef struct directedGraph{
  int *vertex;
  int *next;
  int *start;
  int v,e;
  int pointer;
} graph;

graph* newGraph(const int v,const int e){
  graph *g=(graph *)malloc(sizeof(graph));
  g->vertex=(int *)calloc(e,sizeof(int));
  g->next=(int *)calloc(e,sizeof(int));
  g->start=(int *)calloc(v,sizeof(int));
  for(int i=0;i<v;i++) g->start[i]=-1;
  g->v=v;
  g->e=e;
  g->pointer=0;
  return g;
}

void freeGraph(graph *g){
  free(g->vertex);
  free(g->next);
  free(g->start);
  free(g);
  return;
}

void addEdge(graph *g,const int from,const int to){
  const int p=g->pointer;
  g->vertex[p]=to;
  g->next[p]=g->start[from];
  g->start[from]=p;
  g->pointer++;
  return;
}

void run(void){
  int n;
  scanf("%d",&n);
  graph *g=newGraph(n,2*n);
  int i;
  for(i=0;i<n-1;i++){
    int x,y;
    scanf("%d%d",&x,&y);
    x--;y--;
    addEdge(g,x,y);
    addEdge(g,y,x);
  }
  int *parent=(int *)calloc(n,sizeof(int));
  int *q=(int *)calloc(n,sizeof(int));
  parent[0]=-1;
  int front=0,last=0;
  q[last++]=0;
  while(last<n){
    const int v=q[front++];
    for(int p=g->start[v];p!=-1;p=g->next[p]){
      const int u=g->vertex[p];
      if(u==parent[v]) continue;
      parent[u]=v;
      q[last++]=u;
    }
  }
  const int mod=1000000007;
  int *dp=(int *)calloc(2*n,sizeof(int));
  for(i=n-1;i>=0;i--){
    const int v=q[i];
    dp[2*v]=dp[2*v+1]=1;
    for(int p=g->start[v];p!=-1;p=g->next[p]){
      const int u=g->vertex[p];
      if(parent[u]==v){
	dp[2*v]=(int64)dp[2*v]*(dp[2*u]+dp[2*u+1])%mod;
	dp[2*v+1]=(int64)dp[2*v+1]*dp[2*u]%mod;
      }
    }
  }
  printf("%d\n",(dp[0]+dp[1])%mod);
}

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>

typedef long long int int64;

typedef struct directedGraph{
  int *vertex;
  int *next;
  int *start;
  int v,e;
  int pointer;
} graph;

graph* newGraph(const int v,const int e){
  graph *g=(graph *)malloc(sizeof(graph));
  g->vertex=(int *)calloc(e,sizeof(int));
  g->next=(int *)calloc(e,sizeof(int));
  g->start=(int *)calloc(v,sizeof(int));
  for(int i=0;i<v;i++) g->start[i]=-1;
  g->v=v;
  g->e=e;
  g->pointer=0;
  return g;
}

void freeGraph(graph *g){
  free(g->vertex);
  free(g->next);
  free(g->start);
  free(g);
  return;
}

void addEdge(graph *g,const int from,const int to){
  const int p=g->pointer;
  g->vertex[p]=to;
  g->next[p]=g->start[from];
  g->start[from]=p;
  g->pointer++;
  return;
}

void run(void){
  int n;
  scanf("%d",&n);
  graph *g=newGraph(n,2*n);
  int i;
  for(i=0;i<n-1;i++){
    int x,y;
    scanf("%d%d",&x,&y);
    x--;y--;
    addEdge(g,x,y);
    addEdge(g,y,x);
  }
  int *parent=(int *)calloc(n,sizeof(int));
  int *q=(int *)calloc(n,sizeof(int));
  parent[0]=-1;
  int front=0,last=0;
  q[last++]=0;
  while(last<n){
    const int v=q[front++];
    for(int p=g->start[v];p!=-1;p=g->next[p]){
      const int u=g->vertex[p];
      if(u==parent[v]) continue;
      parent[u]=v;
      q[last++]=u;
    }
  }
  const int mod=1000000007;
  int *dp=(int *)calloc(2*n,sizeof(int));
  for(i=n-1;i>=0;i--){
    const int v=q[i];
    dp[2*v]=dp[2*v+1]=1;
    for(int p=g->start[v];p!=-1;p=g->next[p]){
      const int u=g->vertex[p];
      if(parent[u]==v){
	dp[2*v]=(int64)dp[2*v]*(dp[2*u]+dp[2*u+1])%mod;
	dp[2*v+1]=(int64)dp[2*v+1]*dp[2*u]%mod;
      }
    }
  }
  printf("%d\n",(dp[0]+dp[1])%mod);
}

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

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	newGraph
	.type	newGraph, @function
newGraph:
.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	%esi, -24(%rbp)
	movl	$40, %edi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movl	-24(%rbp), %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, (%rax)
	movl	-24(%rbp), %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 8(%rax)
	movl	-20(%rbp), %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 16(%rax)
	movl	$0, -12(%rbp)
	jmp	.L2
.L3:
	movq	-8(%rbp), %rax
	movq	16(%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
	movl	-20(%rbp), %edx
	movl	%edx, 24(%rax)
	movq	-8(%rbp), %rax
	movl	-24(%rbp), %edx
	movl	%edx, 28(%rax)
	movq	-8(%rbp), %rax
	movl	$0, 32(%rax)
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	newGraph, .-newGraph
	.globl	freeGraph
	.type	freeGraph, @function
freeGraph:
.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)
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, %rdi
	call	free@PLT
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, %rdi
	call	free@PLT
	movq	-8(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, %rdi
	call	free@PLT
	movq	-8(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	freeGraph, .-freeGraph
	.globl	addEdge
	.type	addEdge, @function
addEdge:
.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, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	32(%rax), %eax
	movl	%eax, -4(%rbp)
	movq	-24(%rbp), %rax
	movq	(%rax), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	movl	-32(%rbp), %eax
	movl	%eax, (%rdx)
	movq	-24(%rbp), %rax
	movq	16(%rax), %rdx
	movl	-28(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	(%rdx,%rax), %rcx
	movq	-24(%rbp), %rax
	movq	8(%rax), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	movl	(%rcx), %eax
	movl	%eax, (%rdx)
	movq	-24(%rbp), %rax
	movq	16(%rax), %rdx
	movl	-28(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
	movq	-24(%rbp), %rax
	movl	32(%rax), %eax
	leal	1(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, 32(%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	addEdge, .-addEdge
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d\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	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-92(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-92(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	-92(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	newGraph
	movq	%rax, -40(%rbp)
	movl	$0, -80(%rbp)
	jmp	.L10
.L11:
	leaq	-84(%rbp), %rdx
	leaq	-88(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-88(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -88(%rbp)
	movl	-84(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -84(%rbp)
	movl	-84(%rbp), %edx
	movl	-88(%rbp), %ecx
	movq	-40(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	addEdge
	movl	-88(%rbp), %edx
	movl	-84(%rbp), %ecx
	movq	-40(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	addEdge
	addl	$1, -80(%rbp)
.L10:
	movl	-92(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -80(%rbp)
	jl	.L11
	movl	-92(%rbp), %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -32(%rbp)
	movl	-92(%rbp), %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -24(%rbp)
	movq	-32(%rbp), %rax
	movl	$-1, (%rax)
	movl	$0, -76(%rbp)
	movl	$0, -72(%rbp)
	movl	-72(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -72(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	$0, (%rax)
	jmp	.L12
.L17:
	movl	-76(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -76(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	movq	-40(%rbp), %rax
	movq	16(%rax), %rdx
	movl	-48(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -68(%rbp)
	jmp	.L13
.L16:
	movq	-40(%rbp), %rax
	movq	(%rax), %rdx
	movl	-68(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -44(%rbp)
	je	.L24
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rax, %rdx
	movl	-48(%rbp), %eax
	movl	%eax, (%rdx)
	movl	-72(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -72(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movl	-44(%rbp), %eax
	movl	%eax, (%rdx)
	jmp	.L15
.L24:
	nop
.L15:
	movq	-40(%rbp), %rax
	movq	8(%rax), %rdx
	movl	-68(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -68(%rbp)
.L13:
	cmpl	$-1, -68(%rbp)
	jne	.L16
.L12:
	movl	-92(%rbp), %eax
	cmpl	%eax, -72(%rbp)
	jl	.L17
	movl	$1000000007, -60(%rbp)
	movl	-92(%rbp), %eax
	addl	%eax, %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -16(%rbp)
	movl	-92(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -80(%rbp)
	jmp	.L18
.L22:
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)
	movl	-56(%rbp), %eax
	addl	%eax, %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, (%rax)
	movl	-56(%rbp), %edx
	addl	%edx, %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	16(%rax), %rdx
	movl	-56(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)
	jmp	.L19
.L21:
	movq	-40(%rbp), %rax
	movq	(%rax), %rdx
	movl	-64(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)
	movl	-52(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -56(%rbp)
	jne	.L20
	movl	-56(%rbp), %eax
	addl	%eax, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movslq	%eax, %rdx
	movl	-52(%rbp), %eax
	addl	%eax, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-16(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %ecx
	movl	-52(%rbp), %eax
	addl	%eax, %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rsi
	movq	-16(%rbp), %rax
	addq	%rsi, %rax
	movl	(%rax), %eax
	addl	%ecx, %eax
	cltq
	imulq	%rdx, %rax
	movl	-60(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movl	-56(%rbp), %eax
	addl	%eax, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-16(%rbp), %rax
	addq	%rcx, %rax
	movl	%edx, (%rax)
	movl	-56(%rbp), %eax
	addl	%eax, %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movslq	%eax, %rdx
	movl	-52(%rbp), %eax
	addl	%eax, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-16(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cltq
	imulq	%rdx, %rax
	movl	-60(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movl	-56(%rbp), %eax
	addl	%eax, %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rcx
	movq	-16(%rbp), %rax
	addq	%rcx, %rax
	movl	%edx, (%rax)
.L20:
	movq	-40(%rbp), %rax
	movq	8(%rax), %rdx
	movl	-64(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)
.L19:
	cmpl	$-1, -64(%rbp)
	jne	.L21
	subl	$1, -80(%rbp)
.L18:
	cmpl	$0, -80(%rbp)
	jns	.L22
	movq	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	addq	$4, %rax
	movl	(%rax), %eax
	addl	%edx, %eax
	cltd
	idivl	-60(%rbp)
	movl	%edx, %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	.L23
	call	__stack_chk_fail@PLT
.L23:
	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	newGraph
	.type	newGraph, @function
newGraph:
.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	%esi, -24(%rbp)
	movl	$40, %edi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movl	-24(%rbp), %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, (%rax)
	movl	-24(%rbp), %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 8(%rax)
	movl	-20(%rbp), %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 16(%rax)
	movl	$0, -12(%rbp)
	jmp	.L2
.L3:
	movq	-8(%rbp), %rax
	movq	16(%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
	movl	-20(%rbp), %edx
	movl	%edx, 24(%rax)
	movq	-8(%rbp), %rax
	movl	-24(%rbp), %edx
	movl	%edx, 28(%rax)
	movq	-8(%rbp), %rax
	movl	$0, 32(%rax)
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	newGraph, .-newGraph
	.globl	freeGraph
	.type	freeGraph, @function
freeGraph:
.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)
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, %rdi
	call	free@PLT
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, %rdi
	call	free@PLT
	movq	-8(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, %rdi
	call	free@PLT
	movq	-8(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	freeGraph, .-freeGraph
	.globl	addEdge
	.type	addEdge, @function
addEdge:
.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, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	32(%rax), %eax
	movl	%eax, -4(%rbp)
	movq	-24(%rbp), %rax
	movq	(%rax), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	movl	-32(%rbp), %eax
	movl	%eax, (%rdx)
	movq	-24(%rbp), %rax
	movq	16(%rax), %rdx
	movl	-28(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	(%rdx,%rax), %rcx
	movq	-24(%rbp), %rax
	movq	8(%rax), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	movl	(%rcx), %eax
	movl	%eax, (%rdx)
	movq	-24(%rbp), %rax
	movq	16(%rax), %rdx
	movl	-28(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
	movq	-24(%rbp), %rax
	movl	32(%rax), %eax
	leal	1(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, 32(%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	addEdge, .-addEdge
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d\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	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-92(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-92(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	-92(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	newGraph
	movq	%rax, -40(%rbp)
	movl	$0, -80(%rbp)
	jmp	.L10
.L11:
	leaq	-84(%rbp), %rdx
	leaq	-88(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-88(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -88(%rbp)
	movl	-84(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -84(%rbp)
	movl	-84(%rbp), %edx
	movl	-88(%rbp), %ecx
	movq	-40(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	addEdge
	movl	-88(%rbp), %edx
	movl	-84(%rbp), %ecx
	movq	-40(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	addEdge
	addl	$1, -80(%rbp)
.L10:
	movl	-92(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -80(%rbp)
	jl	.L11
	movl	-92(%rbp), %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -32(%rbp)
	movl	-92(%rbp), %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -24(%rbp)
	movq	-32(%rbp), %rax
	movl	$-1, (%rax)
	movl	$0, -76(%rbp)
	movl	$0, -72(%rbp)
	movl	-72(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -72(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	$0, (%rax)
	jmp	.L12
.L17:
	movl	-76(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -76(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	movq	-40(%rbp), %rax
	movq	16(%rax), %rdx
	movl	-48(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -68(%rbp)
	jmp	.L13
.L16:
	movq	-40(%rbp), %rax
	movq	(%rax), %rdx
	movl	-68(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -44(%rbp)
	je	.L24
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rax, %rdx
	movl	-48(%rbp), %eax
	movl	%eax, (%rdx)
	movl	-72(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -72(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movl	-44(%rbp), %eax
	movl	%eax, (%rdx)
	jmp	.L15
.L24:
	nop
.L15:
	movq	-40(%rbp), %rax
	movq	8(%rax), %rdx
	movl	-68(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -68(%rbp)
.L13:
	cmpl	$-1, -68(%rbp)
	jne	.L16
.L12:
	movl	-92(%rbp), %eax
	cmpl	%eax, -72(%rbp)
	jl	.L17
	movl	$1000000007, -60(%rbp)
	movl	-92(%rbp), %eax
	addl	%eax, %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -16(%rbp)
	movl	-92(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -80(%rbp)
	jmp	.L18
.L22:
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)
	movl	-56(%rbp), %eax
	addl	%eax, %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, (%rax)
	movl	-56(%rbp), %edx
	addl	%edx, %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	16(%rax), %rdx
	movl	-56(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)
	jmp	.L19
.L21:
	movq	-40(%rbp), %rax
	movq	(%rax), %rdx
	movl	-64(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)
	movl	-52(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -56(%rbp)
	jne	.L20
	movl	-56(%rbp), %eax
	addl	%eax, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movslq	%eax, %rdx
	movl	-52(%rbp), %eax
	addl	%eax, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-16(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %ecx
	movl	-52(%rbp), %eax
	addl	%eax, %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rsi
	movq	-16(%rbp), %rax
	addq	%rsi, %rax
	movl	(%rax), %eax
	addl	%ecx, %eax
	cltq
	imulq	%rdx, %rax
	movl	-60(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movl	-56(%rbp), %eax
	addl	%eax, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-16(%rbp), %rax
	addq	%rcx, %rax
	movl	%edx, (%rax)
	movl	-56(%rbp), %eax
	addl	%eax, %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movslq	%eax, %rdx
	movl	-52(%rbp), %eax
	addl	%eax, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-16(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cltq
	imulq	%rdx, %rax
	movl	-60(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movl	-56(%rbp), %eax
	addl	%eax, %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rcx
	movq	-16(%rbp), %rax
	addq	%rcx, %rax
	movl	%edx, (%rax)
.L20:
	movq	-40(%rbp), %rax
	movq	8(%rax), %rdx
	movl	-64(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)
.L19:
	cmpl	$-1, -64(%rbp)
	jne	.L21
	subl	$1, -80(%rbp)
.L18:
	cmpl	$0, -80(%rbp)
	jns	.L22
	movq	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	addq	$4, %rax
	movl	(%rax), %eax
	addl	%edx, %eax
	cltd
	idivl	-60(%rbp)
	movl	%edx, %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	.L23
	call	__stack_chk_fail@PLT
.L23:
	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:
