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<string.h>
#include<math.h>
#include<stdlib.h>
#include<limits.h>

#define rep(i,begin,end) for(int i=begin; i<end; i++)
#define revrep(i, begin, end) for(int i=begin; i>end; i--)
#define lld long long int

typedef struct node node;
typedef struct edge{
    lld len;
    node* target;
    struct edge* next;
}edge;
typedef struct node{
    lld value;
    edge* fst;
    edge* lst;
}node;
void init(node* p){
    p->value = 0;
    p->fst = NULL;
    p->lst = NULL;
}
void add(node* p, node* target, lld len){
    if(p->fst == NULL){
        p->fst = (edge*)malloc(sizeof(edge));
        p->lst = p->fst;
    }else{
        p->lst->next = (edge*)malloc(sizeof(edge));
        p->lst = p->lst->next;
    }
    p->lst->target = target;
    p->lst->len = len;
    p->lst->next = NULL;
}

void func(node* p, node* pre){
    edge* q = p->fst;
    while(q != NULL){
        if(q->target != pre){
            q->target->value = p->value + q->len;
            func(q->target, p);
        }
        q = q->next;
    }
    return;
}

int main(){
    int n;
    scanf("%d", &n);
    node t[n+1];
    rep(i, 1, n+1){
        init(&t[i]);
    }
    rep(i, 0, n-1){
        int a, b;
        lld c;
        scanf("%d %d %lld", &a, &b, &c);
        add(&t[a], &t[b], c);
        add(&t[b], &t[a], c);
    }
    int q, k;
    scanf("%d %d", &q, &k);
    func(&t[k], &t[k]);
    lld ans[q];
    rep(i, 0, q){
        int x, y;
        scanf("%d %d", &x, &y);
        ans[i] = t[x].value + t[y].value;
    }
    rep(i, 0, q){
        printf("%lld\n", ans[i]);
    }

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	init
	.type	init, @function
init:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	$0, (%rax)
	movq	-8(%rbp), %rax
	movq	$0, 8(%rax)
	movq	-8(%rbp), %rax
	movq	$0, 16(%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	init, .-init
	.globl	add
	.type	add, @function
add:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%rdx, -40(%rbp)
	movq	-24(%rbp), %rax
	movq	8(%rax), %rax
	testq	%rax, %rax
	jne	.L3
	movl	$24, %edi
	call	malloc@PLT
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, 8(%rax)
	movq	-24(%rbp), %rax
	movq	8(%rax), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, 16(%rax)
	jmp	.L4
.L3:
	movq	-24(%rbp), %rax
	movq	16(%rax), %rbx
	movl	$24, %edi
	call	malloc@PLT
	movq	%rax, 16(%rbx)
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	16(%rax), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, 16(%rax)
.L4:
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	-32(%rbp), %rdx
	movq	%rdx, 8(%rax)
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	-40(%rbp), %rdx
	movq	%rdx, (%rax)
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	$0, 16(%rax)
	nop
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	add, .-add
	.globl	func
	.type	func, @function
func:
.LFB8:
	.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
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -8(%rbp)
	jmp	.L6
.L8:
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	cmpq	%rax, -32(%rbp)
	je	.L7
	movq	-24(%rbp), %rax
	movq	(%rax), %rcx
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	addq	%rcx, %rdx
	movq	%rdx, (%rax)
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	-24(%rbp), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	func
.L7:
	movq	-8(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -8(%rbp)
.L6:
	cmpq	$0, -8(%rbp)
	jne	.L8
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	func, .-func
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %lld"
.LC2:
	.string	"%d %d"
.LC3:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$120, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-128(%rbp), %eax
	leal	1(%rax), %ecx
	movslq	%ecx, %rax
	subq	$1, %rax
	movq	%rax, -88(%rbp)
	movslq	%ecx, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	imulq	$192, %r15, %rdx
	imulq	$0, %r14, %rax
	leaq	(%rdx,%rax), %rsi
	movl	$192, %eax
	mulq	%r14
	addq	%rdx, %rsi
	movq	%rsi, %rdx
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movslq	%ecx, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	imulq	$192, %r13, %rdx
	imulq	$0, %r12, %rax
	leaq	(%rdx,%rax), %rsi
	movl	$192, %eax
	mulq	%r12
	addq	%rdx, %rsi
	movq	%rsi, %rdx
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L11:
	cmpq	%rdx, %rsp
	je	.L12
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L11
.L12:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L13
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L13:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -80(%rbp)
	movl	$1, -112(%rbp)
	jmp	.L14
.L15:
	movl	-112(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	-80(%rbp), %rdx
	addq	%rdx, %rax
	movq	%rax, %rdi
	call	init
	addl	$1, -112(%rbp)
.L14:
	movl	-128(%rbp), %eax
	cmpl	%eax, -112(%rbp)
	jle	.L15
	movl	$0, -108(%rbp)
	jmp	.L16
.L17:
	leaq	-96(%rbp), %rcx
	leaq	-116(%rbp), %rdx
	leaq	-120(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-96(%rbp), %rdx
	movl	-116(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	-80(%rbp), %rcx
	addq	%rax, %rcx
	movl	-120(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rsi, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	salq	$3, %rax
	movq	-80(%rbp), %rsi
	addq	%rsi, %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	add
	movq	-96(%rbp), %rdx
	movl	-120(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	-80(%rbp), %rcx
	addq	%rax, %rcx
	movl	-116(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rsi, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	salq	$3, %rax
	movq	-80(%rbp), %rsi
	addq	%rsi, %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	add
	addl	$1, -108(%rbp)
.L16:
	movl	-128(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -108(%rbp)
	jl	.L17
	leaq	-120(%rbp), %rdx
	leaq	-124(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	-80(%rbp), %rdx
	addq	%rax, %rdx
	movl	-120(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	-80(%rbp), %rcx
	addq	%rcx, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	func
	movl	-124(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -144(%rbp)
	movq	$0, -136(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L18:
	cmpq	%rdx, %rsp
	je	.L19
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L18
.L19:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L20
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L20:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -104(%rbp)
	jmp	.L21
.L22:
	leaq	-96(%rbp), %rdx
	leaq	-116(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-116(%rbp), %eax
	movq	-80(%rbp), %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movq	(%rax), %rcx
	movl	-96(%rbp), %eax
	movq	-80(%rbp), %rsi
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	movq	(%rax), %rax
	addq	%rax, %rcx
	movq	-64(%rbp), %rax
	movl	-104(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rcx, (%rax,%rdx,8)
	addl	$1, -104(%rbp)
.L21:
	movl	-124(%rbp), %eax
	cmpl	%eax, -104(%rbp)
	jl	.L22
	movl	$0, -100(%rbp)
	jmp	.L23
.L24:
	movq	-64(%rbp), %rax
	movl	-100(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -100(%rbp)
.L23:
	movl	-124(%rbp), %eax
	cmpl	%eax, -100(%rbp)
	jl	.L24
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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	init
	.type	init, @function
init:
.LFB51:
	.cfi_startproc
	endbr64
	pxor	%xmm0, %xmm0
	movq	$0, (%rdi)
	movups	%xmm0, 8(%rdi)
	ret
	.cfi_endproc
.LFE51:
	.size	init, .-init
	.p2align 4
	.globl	add
	.type	add, @function
add:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rsi, %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
	cmpq	$0, 8(%rdi)
	je	.L7
	movq	16(%rdi), %r13
	movl	$24, %edi
	call	malloc@PLT
	movq	%rax, 16(%r13)
.L5:
	movq	%rax, 16(%rbx)
	movq	%r12, 8(%rax)
	movq	%rbp, (%rax)
	movq	$0, 16(%rax)
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	movl	$24, %edi
	call	malloc@PLT
	movq	%rax, 8(%rbx)
	jmp	.L5
	.cfi_endproc
.LFE52:
	.size	add, .-add
	.p2align 4
	.globl	func
	.type	func, @function
func:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$120, %rsp
	.cfi_def_cfa_offset 176
	movq	8(%rdi), %rax
	movq	%rdi, 40(%rsp)
	movq	%rsi, 48(%rsp)
	movq	%rax, 32(%rsp)
	testq	%rax, %rax
	je	.L8
.L28:
	movq	32(%rsp), %rax
	movq	8(%rax), %rdi
	movq	%rdi, 24(%rsp)
	cmpq	48(%rsp), %rdi
	je	.L10
	movq	40(%rsp), %rsi
	movq	(%rax), %rax
	addq	(%rsi), %rax
	movq	%rax, (%rdi)
	movq	8(%rdi), %rax
	movq	%rax, 16(%rsp)
	testq	%rax, %rax
	je	.L10
.L27:
	movq	16(%rsp), %rax
	movq	8(%rax), %rsi
	movq	%rsi, 8(%rsp)
	cmpq	%rsi, 40(%rsp)
	je	.L11
	movq	24(%rsp), %rdi
	movq	8(%rsi), %r11
	movq	(%rax), %rax
	addq	(%rdi), %rax
	movq	%rax, (%rsi)
	testq	%r11, %r11
	je	.L11
.L26:
	movq	8(%r11), %r10
	cmpq	%r10, 24(%rsp)
	je	.L12
	movq	8(%rsp), %rdi
	movq	8(%r10), %r9
	movq	(%r11), %rax
	addq	(%rdi), %rax
	movq	%rax, (%r10)
	testq	%r9, %r9
	je	.L12
.L25:
	movq	8(%r9), %r8
	cmpq	%r8, 8(%rsp)
	je	.L13
	movq	8(%r8), %rcx
	movq	(%r9), %rax
	addq	(%r10), %rax
	movq	%rax, (%r8)
	testq	%rcx, %rcx
	je	.L13
.L24:
	movq	8(%rcx), %rdx
	cmpq	%rdx, %r10
	je	.L14
	movq	8(%rdx), %r15
	movq	(%rcx), %rax
	addq	(%r8), %rax
	movq	%rax, (%rdx)
	testq	%r15, %r15
	je	.L14
.L23:
	movq	8(%r15), %r14
	cmpq	%r14, %r8
	je	.L15
	movq	8(%r14), %r12
	movq	(%r15), %rax
	addq	(%rdx), %rax
	movq	%rax, (%r14)
	testq	%r12, %r12
	je	.L15
.L22:
	movq	8(%r12), %r13
	cmpq	%r13, %rdx
	je	.L16
	movq	8(%r13), %rbx
	movq	(%r12), %rax
	addq	(%r14), %rax
	movq	%rax, 0(%r13)
	testq	%rbx, %rbx
	je	.L16
.L21:
	movq	8(%rbx), %rbp
	cmpq	%rbp, %r14
	je	.L17
	movq	(%rbx), %rax
	addq	0(%r13), %rax
	movq	%rax, 0(%rbp)
	movq	8(%rbp), %rax
	testq	%rax, %rax
	je	.L17
.L20:
	movq	8(%rax), %rdi
	cmpq	%rdi, %r13
	je	.L18
	movq	(%rax), %rsi
	addq	0(%rbp), %rsi
	movq	%rcx, 104(%rsp)
	movq	%rsi, (%rdi)
	movq	%rbp, %rsi
	movq	%rdx, 96(%rsp)
	movq	%r9, 88(%rsp)
	movq	%r8, 80(%rsp)
	movq	%r11, 72(%rsp)
	movq	%r10, 64(%rsp)
	movq	%rax, 56(%rsp)
	call	func
	movq	56(%rsp), %rax
	movq	64(%rsp), %r10
	movq	72(%rsp), %r11
	movq	80(%rsp), %r8
	movq	16(%rax), %rax
	movq	88(%rsp), %r9
	movq	96(%rsp), %rdx
	movq	104(%rsp), %rcx
	testq	%rax, %rax
	jne	.L20
	.p2align 4,,10
	.p2align 3
.L17:
	movq	16(%rbx), %rbx
	testq	%rbx, %rbx
	jne	.L21
.L16:
	movq	16(%r12), %r12
	testq	%r12, %r12
	jne	.L22
.L15:
	movq	16(%r15), %r15
	testq	%r15, %r15
	jne	.L23
.L14:
	movq	16(%rcx), %rcx
	testq	%rcx, %rcx
	jne	.L24
.L13:
	movq	16(%r9), %r9
	testq	%r9, %r9
	jne	.L25
.L12:
	movq	16(%r11), %r11
	testq	%r11, %r11
	jne	.L26
.L11:
	movq	16(%rsp), %rax
	movq	16(%rax), %rax
	movq	%rax, 16(%rsp)
	testq	%rax, %rax
	jne	.L27
.L10:
	movq	32(%rsp), %rax
	movq	16(%rax), %rax
	movq	%rax, 32(%rsp)
	testq	%rax, %rax
	jne	.L28
.L8:
	addq	$120, %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
.L18:
	.cfi_restore_state
	movq	16(%rax), %rax
	testq	%rax, %rax
	jne	.L20
	movq	16(%rbx), %rbx
	testq	%rbx, %rbx
	jne	.L21
	jmp	.L16
	.cfi_endproc
.LFE53:
	.size	func, .-func
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d %d %lld"
.LC3:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB54:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-80(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$88, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-80(%rbp), %ecx
	movq	%rsp, %rsi
	leal	1(%rcx), %eax
	cltq
	leaq	(%rax,%rax,2), %rax
	leaq	15(,%rax,8), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L70
.L103:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L103
.L70:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L104
.L71:
	movq	%rsp, %rbx
	testl	%ecx, %ecx
	jle	.L102
	leal	-1(%rcx), %edx
	leaq	24(%rbx), %rax
	pxor	%xmm0, %xmm0
	leaq	(%rdx,%rdx,2), %rdx
	leaq	48(%rbx,%rdx,8), %rdx
	.p2align 4,,10
	.p2align 3
.L75:
	movq	$0, (%rax)
	addq	$24, %rax
	movups	%xmm0, -16(%rax)
	cmpq	%rdx, %rax
	jne	.L75
	cmpl	$1, %ecx
	jle	.L102
	leaq	-72(%rbp), %rax
	movl	$0, -84(%rbp)
	leaq	-64(%rbp), %r15
	movq	%rax, -128(%rbp)
	leaq	-68(%rbp), %r14
	.p2align 4,,10
	.p2align 3
.L74:
	movq	-128(%rbp), %rsi
	movq	%r14, %rdx
	xorl	%eax, %eax
	movq	%r15, %rcx
	leaq	.LC2(%rip), %rdi
	call	__isoc99_scanf@PLT
	movslq	-68(%rbp), %rdx
	movslq	-72(%rbp), %rsi
	movq	-64(%rbp), %r13
	leaq	(%rdx,%rdx,2), %rax
	leaq	(%rbx,%rax,8), %r8
	leaq	(%rsi,%rsi,2), %rax
	leaq	(%rbx,%rax,8), %r12
	cmpq	$0, 8(%r12)
	je	.L105
	movq	16(%r12), %r9
	movl	$24, %edi
	movq	%rsi, -120(%rbp)
	movq	%rdx, -112(%rbp)
	movq	%r8, -104(%rbp)
	movq	%r9, -96(%rbp)
	call	malloc@PLT
	movq	-96(%rbp), %r9
	movq	-120(%rbp), %rsi
	movq	-112(%rbp), %rdx
	movq	-104(%rbp), %r8
	movq	%rax, 16(%r9)
.L83:
	leaq	(%rsi,%rsi,2), %rsi
	movq	%rax, 16(%rbx,%rsi,8)
	cmpq	$0, 8(%r8)
	movq	%r8, 8(%rax)
	movq	%r13, (%rax)
	movq	$0, 16(%rax)
	je	.L106
	leaq	(%rdx,%rdx,2), %rax
	movl	$24, %edi
	leaq	(%rbx,%rax,8), %rdx
	movq	16(%rdx), %rsi
	movq	%rdx, -104(%rbp)
	movq	%rsi, -96(%rbp)
	call	malloc@PLT
	movq	-96(%rbp), %rsi
	movq	-104(%rbp), %rdx
	addl	$1, -84(%rbp)
	movl	-84(%rbp), %ecx
	movq	%rax, 16(%rsi)
	movq	%rax, 16(%rdx)
	movq	%r12, 8(%rax)
	movq	%r13, (%rax)
	movq	$0, 16(%rax)
	movl	-80(%rbp), %eax
	subl	$1, %eax
	cmpl	%ecx, %eax
	jg	.L74
.L73:
	movq	-128(%rbp), %rdx
	leaq	-76(%rbp), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-72(%rbp), %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rbx,%rax,8), %rdi
	movq	%rdi, %rsi
	call	func
	movslq	-76(%rbp), %rax
	movq	%rsp, %rsi
	movq	%rax, %rcx
	leaq	15(,%rax,8), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L78
.L107:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L107
.L78:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L108
.L79:
	movq	%rsp, %r12
	testl	%ecx, %ecx
	jle	.L81
	xorl	%r13d, %r13d
	leaq	-64(%rbp), %r15
	leaq	-68(%rbp), %r14
	.p2align 4,,10
	.p2align 3
.L80:
	movq	%r15, %rdx
	movq	%r14, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-68(%rbp), %rax
	leaq	(%rax,%rax,2), %rdx
	movslq	-64(%rbp), %rax
	leaq	(%rax,%rax,2), %rax
	movq	(%rbx,%rax,8), %rax
	addq	(%rbx,%rdx,8), %rax
	movq	%rax, (%r12,%r13,8)
	movl	-76(%rbp), %eax
	addq	$1, %r13
	cmpl	%r13d, %eax
	jg	.L80
	testl	%eax, %eax
	jle	.L81
	xorl	%ebx, %ebx
	leaq	.LC3(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L86:
	movq	(%r12,%rbx,8), %rdx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, -76(%rbp)
	jg	.L86
.L81:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L109
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L106:
	.cfi_restore_state
	movl	$24, %edi
	movq	%rdx, -104(%rbp)
	movq	%r8, -96(%rbp)
	call	malloc@PLT
	movq	-104(%rbp), %rdx
	movq	-96(%rbp), %r8
	movq	%r12, 8(%rax)
	leaq	(%rdx,%rdx,2), %rdx
	movq	%rax, 8(%r8)
	movq	%r13, (%rax)
	movq	%rax, 16(%rbx,%rdx,8)
	movq	$0, 16(%rax)
	movl	-80(%rbp), %eax
	addl	$1, -84(%rbp)
	movl	-84(%rbp), %edi
	subl	$1, %eax
	cmpl	%eax, %edi
	jl	.L74
	jmp	.L73
	.p2align 4,,10
	.p2align 3
.L105:
	movl	$24, %edi
	movq	%rsi, -112(%rbp)
	movq	%rdx, -104(%rbp)
	movq	%r8, -96(%rbp)
	call	malloc@PLT
	movq	-96(%rbp), %r8
	movq	-104(%rbp), %rdx
	movq	%rax, 8(%r12)
	movq	-112(%rbp), %rsi
	jmp	.L83
.L108:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L79
.L104:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L71
.L102:
	leaq	-72(%rbp), %rax
	movq	%rax, -128(%rbp)
	jmp	.L73
.L109:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE54:
	.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	init
	.type	init, @function
init:
.LFB51:
	.cfi_startproc
	endbr64
	pxor	%xmm0, %xmm0
	movq	$0, (%rdi)
	movups	%xmm0, 8(%rdi)
	ret
	.cfi_endproc
.LFE51:
	.size	init, .-init
	.p2align 4
	.globl	add
	.type	add, @function
add:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rsi, %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
	cmpq	$0, 8(%rdi)
	je	.L7
	movq	16(%rdi), %r13
	movl	$24, %edi
	call	malloc@PLT
	movq	%rax, 16(%r13)
.L5:
	movq	%rax, 16(%rbx)
	movq	%r12, 8(%rax)
	movq	%rbp, (%rax)
	movq	$0, 16(%rax)
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	movl	$24, %edi
	call	malloc@PLT
	movq	%rax, 8(%rbx)
	jmp	.L5
	.cfi_endproc
.LFE52:
	.size	add, .-add
	.p2align 4
	.globl	func
	.type	func, @function
func:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$120, %rsp
	.cfi_def_cfa_offset 176
	movq	8(%rdi), %rax
	movq	%rdi, 40(%rsp)
	movq	%rsi, 48(%rsp)
	movq	%rax, 32(%rsp)
	testq	%rax, %rax
	je	.L8
.L28:
	movq	32(%rsp), %rax
	movq	8(%rax), %rdi
	movq	%rdi, 24(%rsp)
	cmpq	48(%rsp), %rdi
	je	.L10
	movq	40(%rsp), %rsi
	movq	(%rax), %rax
	addq	(%rsi), %rax
	movq	%rax, (%rdi)
	movq	8(%rdi), %rax
	movq	%rax, 16(%rsp)
	testq	%rax, %rax
	je	.L10
.L27:
	movq	16(%rsp), %rax
	movq	8(%rax), %rsi
	movq	%rsi, 8(%rsp)
	cmpq	%rsi, 40(%rsp)
	je	.L11
	movq	24(%rsp), %rdi
	movq	8(%rsi), %r11
	movq	(%rax), %rax
	addq	(%rdi), %rax
	movq	%rax, (%rsi)
	testq	%r11, %r11
	je	.L11
.L26:
	movq	8(%r11), %r10
	cmpq	%r10, 24(%rsp)
	je	.L12
	movq	8(%rsp), %rdi
	movq	8(%r10), %r9
	movq	(%r11), %rax
	addq	(%rdi), %rax
	movq	%rax, (%r10)
	testq	%r9, %r9
	je	.L12
.L25:
	movq	8(%r9), %r8
	cmpq	%r8, 8(%rsp)
	je	.L13
	movq	8(%r8), %rcx
	movq	(%r9), %rax
	addq	(%r10), %rax
	movq	%rax, (%r8)
	testq	%rcx, %rcx
	je	.L13
.L24:
	movq	8(%rcx), %rdx
	cmpq	%rdx, %r10
	je	.L14
	movq	8(%rdx), %r15
	movq	(%rcx), %rax
	addq	(%r8), %rax
	movq	%rax, (%rdx)
	testq	%r15, %r15
	je	.L14
.L23:
	movq	8(%r15), %r14
	cmpq	%r14, %r8
	je	.L15
	movq	8(%r14), %r12
	movq	(%r15), %rax
	addq	(%rdx), %rax
	movq	%rax, (%r14)
	testq	%r12, %r12
	je	.L15
.L22:
	movq	8(%r12), %r13
	cmpq	%r13, %rdx
	je	.L16
	movq	8(%r13), %rbx
	movq	(%r12), %rax
	addq	(%r14), %rax
	movq	%rax, 0(%r13)
	testq	%rbx, %rbx
	je	.L16
.L21:
	movq	8(%rbx), %rbp
	cmpq	%rbp, %r14
	je	.L17
	movq	(%rbx), %rax
	addq	0(%r13), %rax
	movq	%rax, 0(%rbp)
	movq	8(%rbp), %rax
	testq	%rax, %rax
	je	.L17
.L20:
	movq	8(%rax), %rdi
	cmpq	%rdi, %r13
	je	.L18
	movq	(%rax), %rsi
	addq	0(%rbp), %rsi
	movq	%rcx, 104(%rsp)
	movq	%rsi, (%rdi)
	movq	%rbp, %rsi
	movq	%rdx, 96(%rsp)
	movq	%r9, 88(%rsp)
	movq	%r8, 80(%rsp)
	movq	%r11, 72(%rsp)
	movq	%r10, 64(%rsp)
	movq	%rax, 56(%rsp)
	call	func
	movq	56(%rsp), %rax
	movq	64(%rsp), %r10
	movq	72(%rsp), %r11
	movq	80(%rsp), %r8
	movq	16(%rax), %rax
	movq	88(%rsp), %r9
	movq	96(%rsp), %rdx
	movq	104(%rsp), %rcx
	testq	%rax, %rax
	jne	.L20
	.p2align 4,,10
	.p2align 3
.L17:
	movq	16(%rbx), %rbx
	testq	%rbx, %rbx
	jne	.L21
.L16:
	movq	16(%r12), %r12
	testq	%r12, %r12
	jne	.L22
.L15:
	movq	16(%r15), %r15
	testq	%r15, %r15
	jne	.L23
.L14:
	movq	16(%rcx), %rcx
	testq	%rcx, %rcx
	jne	.L24
.L13:
	movq	16(%r9), %r9
	testq	%r9, %r9
	jne	.L25
.L12:
	movq	16(%r11), %r11
	testq	%r11, %r11
	jne	.L26
.L11:
	movq	16(%rsp), %rax
	movq	16(%rax), %rax
	movq	%rax, 16(%rsp)
	testq	%rax, %rax
	jne	.L27
.L10:
	movq	32(%rsp), %rax
	movq	16(%rax), %rax
	movq	%rax, 32(%rsp)
	testq	%rax, %rax
	jne	.L28
.L8:
	addq	$120, %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
.L18:
	.cfi_restore_state
	movq	16(%rax), %rax
	testq	%rax, %rax
	jne	.L20
	movq	16(%rbx), %rbx
	testq	%rbx, %rbx
	jne	.L21
	jmp	.L16
	.cfi_endproc
.LFE53:
	.size	func, .-func
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d %d %lld"
.LC3:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB54:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-80(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$88, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-80(%rbp), %ecx
	movq	%rsp, %rsi
	leal	1(%rcx), %eax
	cltq
	leaq	(%rax,%rax,2), %rax
	leaq	15(,%rax,8), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L70
.L103:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L103
.L70:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L104
.L71:
	movq	%rsp, %rbx
	testl	%ecx, %ecx
	jle	.L102
	leal	-1(%rcx), %edx
	leaq	24(%rbx), %rax
	pxor	%xmm0, %xmm0
	leaq	(%rdx,%rdx,2), %rdx
	leaq	48(%rbx,%rdx,8), %rdx
	.p2align 4,,10
	.p2align 3
.L75:
	movq	$0, (%rax)
	addq	$24, %rax
	movups	%xmm0, -16(%rax)
	cmpq	%rdx, %rax
	jne	.L75
	cmpl	$1, %ecx
	jle	.L102
	leaq	-72(%rbp), %rax
	movl	$0, -84(%rbp)
	leaq	-64(%rbp), %r15
	movq	%rax, -128(%rbp)
	leaq	-68(%rbp), %r14
	.p2align 4,,10
	.p2align 3
.L74:
	movq	-128(%rbp), %rsi
	movq	%r14, %rdx
	xorl	%eax, %eax
	movq	%r15, %rcx
	leaq	.LC2(%rip), %rdi
	call	__isoc99_scanf@PLT
	movslq	-68(%rbp), %rdx
	movslq	-72(%rbp), %rsi
	movq	-64(%rbp), %r13
	leaq	(%rdx,%rdx,2), %rax
	leaq	(%rbx,%rax,8), %r8
	leaq	(%rsi,%rsi,2), %rax
	leaq	(%rbx,%rax,8), %r12
	cmpq	$0, 8(%r12)
	je	.L105
	movq	16(%r12), %r9
	movl	$24, %edi
	movq	%rsi, -120(%rbp)
	movq	%rdx, -112(%rbp)
	movq	%r8, -104(%rbp)
	movq	%r9, -96(%rbp)
	call	malloc@PLT
	movq	-96(%rbp), %r9
	movq	-120(%rbp), %rsi
	movq	-112(%rbp), %rdx
	movq	-104(%rbp), %r8
	movq	%rax, 16(%r9)
.L83:
	leaq	(%rsi,%rsi,2), %rsi
	movq	%rax, 16(%rbx,%rsi,8)
	cmpq	$0, 8(%r8)
	movq	%r8, 8(%rax)
	movq	%r13, (%rax)
	movq	$0, 16(%rax)
	je	.L106
	leaq	(%rdx,%rdx,2), %rax
	movl	$24, %edi
	leaq	(%rbx,%rax,8), %rdx
	movq	16(%rdx), %rsi
	movq	%rdx, -104(%rbp)
	movq	%rsi, -96(%rbp)
	call	malloc@PLT
	movq	-96(%rbp), %rsi
	movq	-104(%rbp), %rdx
	addl	$1, -84(%rbp)
	movl	-84(%rbp), %ecx
	movq	%rax, 16(%rsi)
	movq	%rax, 16(%rdx)
	movq	%r12, 8(%rax)
	movq	%r13, (%rax)
	movq	$0, 16(%rax)
	movl	-80(%rbp), %eax
	subl	$1, %eax
	cmpl	%ecx, %eax
	jg	.L74
.L73:
	movq	-128(%rbp), %rdx
	leaq	-76(%rbp), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-72(%rbp), %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rbx,%rax,8), %rdi
	movq	%rdi, %rsi
	call	func
	movslq	-76(%rbp), %rax
	movq	%rsp, %rsi
	movq	%rax, %rcx
	leaq	15(,%rax,8), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L78
.L107:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L107
.L78:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L108
.L79:
	movq	%rsp, %r12
	testl	%ecx, %ecx
	jle	.L81
	xorl	%r13d, %r13d
	leaq	-64(%rbp), %r15
	leaq	-68(%rbp), %r14
	.p2align 4,,10
	.p2align 3
.L80:
	movq	%r15, %rdx
	movq	%r14, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-68(%rbp), %rax
	leaq	(%rax,%rax,2), %rdx
	movslq	-64(%rbp), %rax
	leaq	(%rax,%rax,2), %rax
	movq	(%rbx,%rax,8), %rax
	addq	(%rbx,%rdx,8), %rax
	movq	%rax, (%r12,%r13,8)
	movl	-76(%rbp), %eax
	addq	$1, %r13
	cmpl	%r13d, %eax
	jg	.L80
	testl	%eax, %eax
	jle	.L81
	xorl	%ebx, %ebx
	leaq	.LC3(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L86:
	movq	(%r12,%rbx,8), %rdx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, -76(%rbp)
	jg	.L86
.L81:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L109
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L106:
	.cfi_restore_state
	movl	$24, %edi
	movq	%rdx, -104(%rbp)
	movq	%r8, -96(%rbp)
	call	malloc@PLT
	movq	-104(%rbp), %rdx
	movq	-96(%rbp), %r8
	movq	%r12, 8(%rax)
	leaq	(%rdx,%rdx,2), %rdx
	movq	%rax, 8(%r8)
	movq	%r13, (%rax)
	movq	%rax, 16(%rbx,%rdx,8)
	movq	$0, 16(%rax)
	movl	-80(%rbp), %eax
	addl	$1, -84(%rbp)
	movl	-84(%rbp), %edi
	subl	$1, %eax
	cmpl	%eax, %edi
	jl	.L74
	jmp	.L73
	.p2align 4,,10
	.p2align 3
.L105:
	movl	$24, %edi
	movq	%rsi, -112(%rbp)
	movq	%rdx, -104(%rbp)
	movq	%r8, -96(%rbp)
	call	malloc@PLT
	movq	-96(%rbp), %r8
	movq	-104(%rbp), %rdx
	movq	%rax, 8(%r12)
	movq	-112(%rbp), %rsi
	jmp	.L83
.L108:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L79
.L104:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L71
.L102:
	leaq	-72(%rbp), %rax
	movq	%rax, -128(%rbp)
	jmp	.L73
.L109:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE54:
	.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<string.h>
#include<math.h>
#include<stdlib.h>
#include<limits.h>

#define rep(i,begin,end) for(int i=begin; i<end; i++)
#define revrep(i, begin, end) for(int i=begin; i>end; i--)
#define lld long long int

typedef struct node node;
typedef struct edge{
    lld len;
    node* target;
    struct edge* next;
}edge;
typedef struct node{
    lld value;
    edge* fst;
    edge* lst;
}node;
void init(node* p){
    p->value = 0;
    p->fst = NULL;
    p->lst = NULL;
}
void add(node* p, node* target, lld len){
    if(p->fst == NULL){
        p->fst = (edge*)malloc(sizeof(edge));
        p->lst = p->fst;
    }else{
        p->lst->next = (edge*)malloc(sizeof(edge));
        p->lst = p->lst->next;
    }
    p->lst->target = target;
    p->lst->len = len;
    p->lst->next = NULL;
}

void func(node* p, node* pre){
    edge* q = p->fst;
    while(q != NULL){
        if(q->target != pre){
            q->target->value = p->value + q->len;
            func(q->target, p);
        }
        q = q->next;
    }
    return;
}

int main(){
    int n;
    scanf("%d", &n);
    node t[n+1];
    rep(i, 1, n+1){
        init(&t[i]);
    }
    rep(i, 0, n-1){
        int a, b;
        lld c;
        scanf("%d %d %lld", &a, &b, &c);
        add(&t[a], &t[b], c);
        add(&t[b], &t[a], c);
    }
    int q, k;
    scanf("%d %d", &q, &k);
    func(&t[k], &t[k]);
    lld ans[q];
    rep(i, 0, q){
        int x, y;
        scanf("%d %d", &x, &y);
        ans[i] = t[x].value + t[y].value;
    }
    rep(i, 0, q){
        printf("%lld\n", ans[i]);
    }

    return 0;
}
7
1 2 1
1 3 3
1 4 5
1 5 7
1 6 9
1 7 11
3 2
1 3
4 5
5 7
 7
1 2 1
1 3 3
1 4 5
1 5 7
1 6 9
1 7 11
3 2
1 4
4 5
5 7
 7
1 2 1
1 3 3
1 4 5
1 5 7
1 6 9
1 7 11
3 2
1 4
4 5
5 5
 7
1 2 1
1 3 3
1 4 5
1 5 11
1 6 9
1 7 11
3 2
1 4
4 5
5 5
 5
1 2 1
1 3 1
2 4 1
3 5 2
3 1
2 4
2 3
4 5
 7
1 2 1
1 3 3
1 4 5
1 5 7
1 6 9
1 7 11
3 2
1 3
7 5
6 7
 7
1 2 1
1 3 3
1 4 5
1 5 7
1 6 9
1 7 11
3 2
1 4
4 5
5 4
 10
1 2 1000000000
2 3 1000000000
3 4 1000000000
4 5 1000000000
5 6 1000000000
6 7 1000000000
7 9 1000000000
8 9 1000000000
9 10 1000000000
1 1
9 10
 7
1 2 1
1 3 3
1 4 10
1 5 11
1 6 9
1 7 11
3 2
1 4
4 5
5 5
 7
1 2 1
1 3 3
1 4 3
1 5 7
1 6 9
1 7 11
3 2
1 4
4 5
5 4

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

Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<limits.h>

#define rep(i,begin,end) for(int i=begin; i<end; i++)
#define revrep(i, begin, end) for(int i=begin; i>end; i--)
#define lld long long int

typedef struct node node;
typedef struct edge{
    lld len;
    node* target;
    struct edge* next;
}edge;
typedef struct node{
    lld value;
    edge* fst;
    edge* lst;
}node;
void init(node* p){
    p->value = 0;
    p->fst = NULL;
    p->lst = NULL;
}
void add(node* p, node* target, lld len){
    if(p->fst == NULL){
        p->fst = (edge*)malloc(sizeof(edge));
        p->lst = p->fst;
    }else{
        p->lst->next = (edge*)malloc(sizeof(edge));
        p->lst = p->lst->next;
    }
    p->lst->target = target;
    p->lst->len = len;
    p->lst->next = NULL;
}

void func(node* p, node* pre){
    edge* q = p->fst;
    while(q != NULL){
        if(q->target != pre){
            q->target->value = p->value + q->len;
            func(q->target, p);
        }
        q = q->next;
    }
    return;
}

int main(){
    int n;
    scanf("%d", &n);
    node t[n+1];
    rep(i, 1, n+1){
        init(&t[i]);
    }
    rep(i, 0, n-1){
        int a, b;
        lld c;
        scanf("%d %d %lld", &a, &b, &c);
        add(&t[a], &t[b], c);
        add(&t[b], &t[a], c);
    }
    int q, k;
    scanf("%d %d", &q, &k);
    func(&t[k], &t[k]);
    lld ans[q];
    rep(i, 0, q){
        int x, y;
        scanf("%d %d", &x, &y);
        ans[i] = t[x].value + t[y].value;
    }
    rep(i, 0, q){
        printf("%lld\n", ans[i]);
    }

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	init
	.type	init, @function
init:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	$0, (%rax)
	movq	-8(%rbp), %rax
	movq	$0, 8(%rax)
	movq	-8(%rbp), %rax
	movq	$0, 16(%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	init, .-init
	.globl	add
	.type	add, @function
add:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%rdx, -40(%rbp)
	movq	-24(%rbp), %rax
	movq	8(%rax), %rax
	testq	%rax, %rax
	jne	.L3
	movl	$24, %edi
	call	malloc@PLT
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, 8(%rax)
	movq	-24(%rbp), %rax
	movq	8(%rax), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, 16(%rax)
	jmp	.L4
.L3:
	movq	-24(%rbp), %rax
	movq	16(%rax), %rbx
	movl	$24, %edi
	call	malloc@PLT
	movq	%rax, 16(%rbx)
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	16(%rax), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, 16(%rax)
.L4:
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	-32(%rbp), %rdx
	movq	%rdx, 8(%rax)
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	-40(%rbp), %rdx
	movq	%rdx, (%rax)
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	$0, 16(%rax)
	nop
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	add, .-add
	.globl	func
	.type	func, @function
func:
.LFB8:
	.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
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -8(%rbp)
	jmp	.L6
.L8:
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	cmpq	%rax, -32(%rbp)
	je	.L7
	movq	-24(%rbp), %rax
	movq	(%rax), %rcx
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	addq	%rcx, %rdx
	movq	%rdx, (%rax)
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	-24(%rbp), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	func
.L7:
	movq	-8(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -8(%rbp)
.L6:
	cmpq	$0, -8(%rbp)
	jne	.L8
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	func, .-func
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %lld"
.LC2:
	.string	"%d %d"
.LC3:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$120, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-128(%rbp), %eax
	leal	1(%rax), %ecx
	movslq	%ecx, %rax
	subq	$1, %rax
	movq	%rax, -88(%rbp)
	movslq	%ecx, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	imulq	$192, %r15, %rdx
	imulq	$0, %r14, %rax
	leaq	(%rdx,%rax), %rsi
	movl	$192, %eax
	mulq	%r14
	addq	%rdx, %rsi
	movq	%rsi, %rdx
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movslq	%ecx, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	imulq	$192, %r13, %rdx
	imulq	$0, %r12, %rax
	leaq	(%rdx,%rax), %rsi
	movl	$192, %eax
	mulq	%r12
	addq	%rdx, %rsi
	movq	%rsi, %rdx
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L11:
	cmpq	%rdx, %rsp
	je	.L12
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L11
.L12:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L13
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L13:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -80(%rbp)
	movl	$1, -112(%rbp)
	jmp	.L14
.L15:
	movl	-112(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	-80(%rbp), %rdx
	addq	%rdx, %rax
	movq	%rax, %rdi
	call	init
	addl	$1, -112(%rbp)
.L14:
	movl	-128(%rbp), %eax
	cmpl	%eax, -112(%rbp)
	jle	.L15
	movl	$0, -108(%rbp)
	jmp	.L16
.L17:
	leaq	-96(%rbp), %rcx
	leaq	-116(%rbp), %rdx
	leaq	-120(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-96(%rbp), %rdx
	movl	-116(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	-80(%rbp), %rcx
	addq	%rax, %rcx
	movl	-120(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rsi, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	salq	$3, %rax
	movq	-80(%rbp), %rsi
	addq	%rsi, %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	add
	movq	-96(%rbp), %rdx
	movl	-120(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	-80(%rbp), %rcx
	addq	%rax, %rcx
	movl	-116(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rsi, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	salq	$3, %rax
	movq	-80(%rbp), %rsi
	addq	%rsi, %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	add
	addl	$1, -108(%rbp)
.L16:
	movl	-128(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -108(%rbp)
	jl	.L17
	leaq	-120(%rbp), %rdx
	leaq	-124(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	-80(%rbp), %rdx
	addq	%rax, %rdx
	movl	-120(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	-80(%rbp), %rcx
	addq	%rcx, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	func
	movl	-124(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -144(%rbp)
	movq	$0, -136(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L18:
	cmpq	%rdx, %rsp
	je	.L19
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L18
.L19:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L20
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L20:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -104(%rbp)
	jmp	.L21
.L22:
	leaq	-96(%rbp), %rdx
	leaq	-116(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-116(%rbp), %eax
	movq	-80(%rbp), %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movq	(%rax), %rcx
	movl	-96(%rbp), %eax
	movq	-80(%rbp), %rsi
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	movq	(%rax), %rax
	addq	%rax, %rcx
	movq	-64(%rbp), %rax
	movl	-104(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rcx, (%rax,%rdx,8)
	addl	$1, -104(%rbp)
.L21:
	movl	-124(%rbp), %eax
	cmpl	%eax, -104(%rbp)
	jl	.L22
	movl	$0, -100(%rbp)
	jmp	.L23
.L24:
	movq	-64(%rbp), %rax
	movl	-100(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -100(%rbp)
.L23:
	movl	-124(%rbp), %eax
	cmpl	%eax, -100(%rbp)
	jl	.L24
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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	init
	.type	init, @function
init:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	$0, (%rax)
	movq	-8(%rbp), %rax
	movq	$0, 8(%rax)
	movq	-8(%rbp), %rax
	movq	$0, 16(%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	init, .-init
	.globl	add
	.type	add, @function
add:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%rdx, -40(%rbp)
	movq	-24(%rbp), %rax
	movq	8(%rax), %rax
	testq	%rax, %rax
	jne	.L3
	movl	$24, %edi
	call	malloc@PLT
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, 8(%rax)
	movq	-24(%rbp), %rax
	movq	8(%rax), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, 16(%rax)
	jmp	.L4
.L3:
	movq	-24(%rbp), %rax
	movq	16(%rax), %rbx
	movl	$24, %edi
	call	malloc@PLT
	movq	%rax, 16(%rbx)
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	16(%rax), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, 16(%rax)
.L4:
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	-32(%rbp), %rdx
	movq	%rdx, 8(%rax)
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	-40(%rbp), %rdx
	movq	%rdx, (%rax)
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	$0, 16(%rax)
	nop
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	add, .-add
	.globl	func
	.type	func, @function
func:
.LFB8:
	.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
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -8(%rbp)
	jmp	.L6
.L8:
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	cmpq	%rax, -32(%rbp)
	je	.L7
	movq	-24(%rbp), %rax
	movq	(%rax), %rcx
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	addq	%rcx, %rdx
	movq	%rdx, (%rax)
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	-24(%rbp), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	func
.L7:
	movq	-8(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -8(%rbp)
.L6:
	cmpq	$0, -8(%rbp)
	jne	.L8
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	func, .-func
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %lld"
.LC2:
	.string	"%d %d"
.LC3:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$120, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-128(%rbp), %eax
	leal	1(%rax), %ecx
	movslq	%ecx, %rax
	subq	$1, %rax
	movq	%rax, -88(%rbp)
	movslq	%ecx, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	imulq	$192, %r15, %rdx
	imulq	$0, %r14, %rax
	leaq	(%rdx,%rax), %rsi
	movl	$192, %eax
	mulq	%r14
	addq	%rdx, %rsi
	movq	%rsi, %rdx
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movslq	%ecx, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	imulq	$192, %r13, %rdx
	imulq	$0, %r12, %rax
	leaq	(%rdx,%rax), %rsi
	movl	$192, %eax
	mulq	%r12
	addq	%rdx, %rsi
	movq	%rsi, %rdx
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L11:
	cmpq	%rdx, %rsp
	je	.L12
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L11
.L12:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L13
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L13:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -80(%rbp)
	movl	$1, -112(%rbp)
	jmp	.L14
.L15:
	movl	-112(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	-80(%rbp), %rdx
	addq	%rdx, %rax
	movq	%rax, %rdi
	call	init
	addl	$1, -112(%rbp)
.L14:
	movl	-128(%rbp), %eax
	cmpl	%eax, -112(%rbp)
	jle	.L15
	movl	$0, -108(%rbp)
	jmp	.L16
.L17:
	leaq	-96(%rbp), %rcx
	leaq	-116(%rbp), %rdx
	leaq	-120(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-96(%rbp), %rdx
	movl	-116(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	-80(%rbp), %rcx
	addq	%rax, %rcx
	movl	-120(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rsi, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	salq	$3, %rax
	movq	-80(%rbp), %rsi
	addq	%rsi, %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	add
	movq	-96(%rbp), %rdx
	movl	-120(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	-80(%rbp), %rcx
	addq	%rax, %rcx
	movl	-116(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rsi, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	salq	$3, %rax
	movq	-80(%rbp), %rsi
	addq	%rsi, %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	add
	addl	$1, -108(%rbp)
.L16:
	movl	-128(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -108(%rbp)
	jl	.L17
	leaq	-120(%rbp), %rdx
	leaq	-124(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	-80(%rbp), %rdx
	addq	%rax, %rdx
	movl	-120(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	-80(%rbp), %rcx
	addq	%rcx, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	func
	movl	-124(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -144(%rbp)
	movq	$0, -136(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L18:
	cmpq	%rdx, %rsp
	je	.L19
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L18
.L19:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L20
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L20:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -104(%rbp)
	jmp	.L21
.L22:
	leaq	-96(%rbp), %rdx
	leaq	-116(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-116(%rbp), %eax
	movq	-80(%rbp), %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movq	(%rax), %rcx
	movl	-96(%rbp), %eax
	movq	-80(%rbp), %rsi
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	movq	(%rax), %rax
	addq	%rax, %rcx
	movq	-64(%rbp), %rax
	movl	-104(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rcx, (%rax,%rdx,8)
	addl	$1, -104(%rbp)
.L21:
	movl	-124(%rbp), %eax
	cmpl	%eax, -104(%rbp)
	jl	.L22
	movl	$0, -100(%rbp)
	jmp	.L23
.L24:
	movq	-64(%rbp), %rax
	movl	-100(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -100(%rbp)
.L23:
	movl	-124(%rbp), %eax
	cmpl	%eax, -100(%rbp)
	jl	.L24
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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:
