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

```c
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>

#define VLIST_MIN 10
typedef uint64_t vlist_element_type;

typedef struct {
    int size, asize;
    vlist_element_type *a;
} vlist;

vlist *vlist_init()
{
    vlist *vl = malloc(sizeof(vlist));
    vl->size = 0;
    vl->asize = VLIST_MIN;
    vl->a = malloc(sizeof(vlist_element_type) * vl->asize);
    return vl;
}

void vlist_add(vlist *vl, vlist_element_type x)
{
    if(vl->size == vl->asize){
        vl->asize *= 2;
        vl->a = realloc(vl->a, sizeof(vlist_element_type) * vl->asize);
    }
    vl->a[vl->size] = x;
    vl->size++;
}

void vlist_term(vlist *vl)
{
    free(vl->a);
    free(vl);
}

void update_counter_r(int p, int c, int N, vlist **vs, uint64_t *counter_query, uint64_t *counter)
{
    if(c==0){
        counter[c] = counter_query[c];
    } else {
        counter[c] = counter_query[c] + counter[p];
    }
    for(int vi=0; vi<vs[c]->size; vi++){
        if(vs[c]->a[vi] != p){
            update_counter_r(c, vs[c]->a[vi], N, vs, counter_query, counter);
        } 
    }
}

int main()
{
    int N, Q;
    scanf("%d%d\n", &N, &Q);

    vlist **vs = malloc(sizeof(vlist*) * N);
    for(int ni=0; ni<N; ni++){
        vs[ni] = vlist_init();
    }

    for(int ni=0; ni<N-1; ni++){
        int a, b;
        scanf("%d%d", &a, &b);
        vlist_add(vs[a-1], b-1);
        vlist_add(vs[b-1], a-1);
    }

    uint64_t *counter_query = malloc(sizeof(uint64_t) * N);
    for(int ni=0; ni<N; ni++){
        counter_query[ni] = 0;
    }
    for(int qi=0; qi<Q; qi++){
        int p, x;
        scanf("%d%d", &p, &x);
        counter_query[p-1] += x;
    }

    uint64_t *counter = malloc(sizeof(uint64_t) * N);
    update_counter_r(-1, 0, N, vs, counter_query, counter);

    for(int ni=0; ni<N; ni++){
        printf("%"PRIu64" ", counter[ni]);
    }
    printf("\n");

    return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	vlist_init
	.type	vlist_init, @function
vlist_init:
.LFB6:
	.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
	movl	$16, %edi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movl	$0, (%rax)
	movq	-8(%rbp), %rax
	movl	$10, 4(%rax)
	movq	-8(%rbp), %rax
	movl	4(%rax), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 8(%rax)
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	vlist_init, .-vlist_init
	.globl	vlist_add
	.type	vlist_add, @function
vlist_add:
.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	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movl	4(%rax), %eax
	cmpl	%eax, %edx
	jne	.L4
	movq	-8(%rbp), %rax
	movl	4(%rax), %eax
	leal	(%rax,%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, 4(%rax)
	movq	-8(%rbp), %rax
	movl	4(%rax), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	realloc@PLT
	movq	-8(%rbp), %rdx
	movq	%rax, 8(%rdx)
.L4:
	movq	-8(%rbp), %rax
	movq	8(%rax), %rdx
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cltq
	salq	$3, %rax
	addq	%rax, %rdx
	movq	-16(%rbp), %rax
	movq	%rax, (%rdx)
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	leal	1(%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, (%rax)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	vlist_add, .-vlist_add
	.globl	vlist_term
	.type	vlist_term, @function
vlist_term:
.LFB8:
	.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	8(%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
.LFE8:
	.size	vlist_term, .-vlist_term
	.globl	update_counter_r
	.type	update_counter_r, @function
update_counter_r:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movq	%rcx, -40(%rbp)
	movq	%r8, -48(%rbp)
	movq	%r9, -56(%rbp)
	cmpl	$0, -24(%rbp)
	jne	.L7
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-56(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	jmp	.L8
.L7:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rsi
	movq	-56(%rbp), %rax
	addq	%rsi, %rax
	addq	%rcx, %rdx
	movq	%rdx, (%rax)
.L8:
	movl	$0, -4(%rbp)
	jmp	.L9
.L11:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	8(%rax), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	cmpq	%rax, %rdx
	je	.L10
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	8(%rax), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movl	%eax, %r10d
	movq	-56(%rbp), %rdi
	movq	-48(%rbp), %rsi
	movq	-40(%rbp), %rcx
	movl	-28(%rbp), %edx
	movl	-24(%rbp), %eax
	movq	%rdi, %r9
	movq	%rsi, %r8
	movl	%r10d, %esi
	movl	%eax, %edi
	call	update_counter_r
.L10:
	addl	$1, -4(%rbp)
.L9:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movl	(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L11
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	update_counter_r, .-update_counter_r
	.section	.rodata
.LC0:
	.string	"%d%d\n"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%lu "
	.text
	.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
	pushq	%rbx
	subq	$88, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-80(%rbp), %rdx
	leaq	-84(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-84(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -48(%rbp)
	movl	$0, -68(%rbp)
	jmp	.L13
.L14:
	movl	-68(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	leaq	(%rdx,%rax), %rbx
	movl	$0, %eax
	call	vlist_init
	movq	%rax, (%rbx)
	addl	$1, -68(%rbp)
.L13:
	movl	-84(%rbp), %eax
	cmpl	%eax, -68(%rbp)
	jl	.L14
	movl	$0, -64(%rbp)
	jmp	.L15
.L16:
	leaq	-72(%rbp), %rdx
	leaq	-76(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-72(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-76(%rbp), %eax
	cltq
	salq	$3, %rax
	leaq	-8(%rax), %rcx
	movq	-48(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	vlist_add
	movl	-76(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-72(%rbp), %eax
	cltq
	salq	$3, %rax
	leaq	-8(%rax), %rcx
	movq	-48(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	vlist_add
	addl	$1, -64(%rbp)
.L15:
	movl	-84(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -64(%rbp)
	jl	.L16
	movl	-84(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -40(%rbp)
	movl	$0, -60(%rbp)
	jmp	.L17
.L18:
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	$0, (%rax)
	addl	$1, -60(%rbp)
.L17:
	movl	-84(%rbp), %eax
	cmpl	%eax, -60(%rbp)
	jl	.L18
	movl	$0, -56(%rbp)
	jmp	.L19
.L20:
	leaq	-72(%rbp), %rdx
	leaq	-76(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-76(%rbp), %eax
	cltq
	salq	$3, %rax
	leaq	-8(%rax), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movl	-76(%rbp), %eax
	cltq
	salq	$3, %rax
	leaq	-8(%rax), %rsi
	movq	-40(%rbp), %rax
	addq	%rsi, %rax
	addq	%rcx, %rdx
	movq	%rdx, (%rax)
	addl	$1, -56(%rbp)
.L19:
	movl	-80(%rbp), %eax
	cmpl	%eax, -56(%rbp)
	jl	.L20
	movl	-84(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -32(%rbp)
	movl	-84(%rbp), %eax
	movq	-32(%rbp), %rsi
	movq	-40(%rbp), %rcx
	movq	-48(%rbp), %rdx
	movq	%rsi, %r9
	movq	%rcx, %r8
	movq	%rdx, %rcx
	movl	%eax, %edx
	movl	$0, %esi
	movl	$-1, %edi
	call	update_counter_r
	movl	$0, -52(%rbp)
	jmp	.L21
.L22:
	movl	-52(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -52(%rbp)
.L21:
	movl	-84(%rbp), %eax
	cmpl	%eax, -52(%rbp)
	jl	.L22
	movl	$10, %edi
	call	putchar@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	movq	-8(%rbp), %rbx
	leave
	.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	vlist_init
	.type	vlist_init, @function
vlist_init:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	$16, %edi
	call	malloc@PLT
	movl	$80, %edi
	movq	%rax, %r12
	movq	.LC0(%rip), %rax
	movq	%rax, (%r12)
	call	malloc@PLT
	movq	%rax, 8(%r12)
	movq	%r12, %rax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE39:
	.size	vlist_init, .-vlist_init
	.p2align 4
	.globl	vlist_add
	.type	vlist_add, @function
vlist_add:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movq	%rdi, %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	movl	(%rdi), %edx
	movq	8(%rdi), %rdi
	cmpl	4(%rbx), %edx
	je	.L7
.L5:
	movslq	%edx, %rax
	addl	$1, %edx
	movq	%rbp, (%rdi,%rax,8)
	movl	%edx, (%rbx)
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	addl	%edx, %edx
	movl	%edx, 4(%rbx)
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rsi
	call	realloc@PLT
	movl	(%rbx), %edx
	movq	%rax, 8(%rbx)
	movq	%rax, %rdi
	jmp	.L5
	.cfi_endproc
.LFE40:
	.size	vlist_add, .-vlist_add
	.p2align 4
	.globl	vlist_term
	.type	vlist_term, @function
vlist_term:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rdi, %rbp
	movq	8(%rdi), %rdi
	call	free@PLT
	movq	%rbp, %rdi
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	free@PLT
	.cfi_endproc
.LFE41:
	.size	vlist_term, .-vlist_term
	.p2align 4
	.globl	update_counter_r
	.type	update_counter_r, @function
update_counter_r:
.LFB42:
	.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
	movslq	%esi, %rbx
	movq	%rbx, %rax
	subq	$280, %rsp
	.cfi_def_cfa_offset 336
	movq	%rbx, 160(%rsp)
	salq	$3, %rbx
	movl	%edx, 224(%rsp)
	movq	%rbx, 216(%rsp)
	testl	%eax, %eax
	jne	.L11
	movq	(%r8), %rax
	movq	%rax, (%r9)
.L13:
	movq	160(%rsp), %rax
	movq	(%rcx,%rax,8), %rax
	movl	(%rax), %edx
	testl	%edx, %edx
	jle	.L10
	movq	8(%rax), %rax
	subl	$1, %edx
	movslq	%edi, %rdi
	movq	%rdi, 200(%rsp)
	leaq	8(%rax), %rsi
	leaq	(%rsi,%rdx,8), %rdx
	movq	%rsi, 176(%rsp)
	movq	%rdx, 192(%rsp)
.L15:
	movq	(%rax), %rax
	cmpq	200(%rsp), %rax
	je	.L19
	movslq	%eax, %rdx
	movq	%rdx, 128(%rsp)
	salq	$3, %rdx
	movq	%rdx, 208(%rsp)
	testl	%eax, %eax
	jne	.L17
	movq	(%r8), %rax
	movq	%rax, (%r9)
.L18:
	movq	128(%rsp), %rax
	movq	(%rcx,%rax,8), %rax
	movl	(%rax), %edx
	testl	%edx, %edx
	jle	.L19
	movq	8(%rax), %rax
	subl	$1, %edx
	leaq	8(%rax), %rdi
	movq	%rdi, 144(%rsp)
	leaq	(%rdi,%rdx,8), %rdi
	movq	%rdi, 168(%rsp)
.L21:
	movq	(%rax), %rax
	cmpq	160(%rsp), %rax
	je	.L24
	movslq	%eax, %rbx
	leaq	0(,%rbx,8), %rdx
	movq	%rbx, 96(%rsp)
	movq	%rdx, 184(%rsp)
	testl	%eax, %eax
	jne	.L22
	movq	(%r8), %rax
	movq	%rax, (%r9)
	movq	%rbx, %rax
.L23:
	movq	(%rcx,%rax,8), %rax
	movl	(%rax), %edx
	testl	%edx, %edx
	jle	.L24
	movq	8(%rax), %rax
	subl	$1, %edx
	leaq	8(%rax), %rbx
	leaq	(%rbx,%rdx,8), %rdi
	movq	%rbx, 112(%rsp)
	movq	%rdi, 136(%rsp)
.L26:
	movq	(%rax), %rax
	cmpq	128(%rsp), %rax
	je	.L29
	movslq	%eax, %rdi
	leaq	0(,%rdi,8), %rsi
	movq	%rdi, 56(%rsp)
	movq	%rsi, 152(%rsp)
	testl	%eax, %eax
	jne	.L27
	movq	(%r8), %rax
	movq	%rax, (%r9)
	movq	%rdi, %rax
.L28:
	movq	(%rcx,%rax,8), %rax
	movl	(%rax), %edx
	testl	%edx, %edx
	jle	.L29
	movq	8(%rax), %rax
	subl	$1, %edx
	leaq	8(%rax), %rdi
	movq	%rdi, 80(%rsp)
	leaq	(%rdi,%rdx,8), %rdi
	movq	%rdi, 104(%rsp)
.L31:
	movq	(%rax), %rax
	cmpq	96(%rsp), %rax
	je	.L34
	movslq	%eax, %rdi
	leaq	0(,%rdi,8), %rsi
	movq	%rdi, 24(%rsp)
	movq	%rsi, 120(%rsp)
	testl	%eax, %eax
	jne	.L32
	movq	(%r8), %rax
	movq	%rax, (%r9)
	movq	%rdi, %rax
.L33:
	movq	(%rcx,%rax,8), %rax
	movl	(%rax), %edx
	testl	%edx, %edx
	jle	.L34
	movq	8(%rax), %rax
	subl	$1, %edx
	leaq	8(%rax), %rdi
	leaq	(%rdi,%rdx,8), %rsi
	movq	%rdi, 40(%rsp)
	movq	%rsi, 72(%rsp)
.L36:
	movq	(%rax), %rax
	cmpq	56(%rsp), %rax
	je	.L39
	movslq	%eax, %r11
	leaq	0(,%r11,8), %rdi
	movq	%rdi, 88(%rsp)
	testl	%eax, %eax
	jne	.L37
	movq	(%r8), %rax
	movq	%rax, (%r9)
.L38:
	movq	(%rcx,%r11,8), %rax
	movl	(%rax), %edx
	testl	%edx, %edx
	jle	.L39
	movq	8(%rax), %rax
	subl	$1, %edx
	movq	%r11, 16(%rsp)
	leaq	8(%rax), %r10
	leaq	(%r10,%rdx,8), %rsi
	movq	%r10, %r11
	movq	%rsi, 32(%rsp)
.L41:
	movq	(%rax), %rax
	cmpq	24(%rsp), %rax
	je	.L44
	movslq	%eax, %r10
	leaq	0(,%r10,8), %rdi
	movq	%rdi, 48(%rsp)
	testl	%eax, %eax
	jne	.L42
	movq	(%r8), %rax
	movq	%rax, (%r9)
.L43:
	movq	(%rcx,%r10,8), %rax
	movl	(%rax), %edx
	testl	%edx, %edx
	jle	.L44
	movq	8(%rax), %rax
	subl	$1, %edx
	movq	%r11, 64(%rsp)
	leaq	8(%rax), %r13
	leaq	0(%r13,%rdx,8), %rsi
	movq	%rsi, 8(%rsp)
.L46:
	movq	(%rax), %rax
	cmpq	16(%rsp), %rax
	je	.L49
	movslq	%eax, %r12
	leaq	0(,%r12,8), %r11
	testl	%eax, %eax
	jne	.L47
	movq	(%r8), %rax
	movq	%rax, (%r9)
.L48:
	movq	(%rcx,%r12,8), %rax
	movl	(%rax), %edx
	testl	%edx, %edx
	jle	.L49
	movq	8(%rax), %rax
	subl	$1, %edx
	movq	%r13, %r14
	leaq	8(%rax), %rbp
	leaq	0(%rbp,%rdx,8), %r15
.L51:
	movq	(%rax), %rax
	cmpq	%r10, %rax
	je	.L54
	movl	%eax, %edi
	movslq	%eax, %rdx
	testl	%eax, %eax
	jne	.L52
	movq	(%r8), %rax
	movq	%rax, (%r9)
.L53:
	movq	(%rcx,%rdx,8), %rax
	movl	(%rax), %edx
	testl	%edx, %edx
	jle	.L54
	movq	8(%rax), %rax
	subl	$1, %edx
	leaq	8(%rax), %rbx
	movq	(%rax), %rax
	leaq	(%rbx,%rdx,8), %r13
	cmpq	%r12, %rax
	je	.L55
.L76:
	movl	224(%rsp), %edx
	movl	%eax, %esi
	movq	%r10, 264(%rsp)
	movq	%r11, 256(%rsp)
	movq	%r9, 248(%rsp)
	movq	%r8, 240(%rsp)
	movq	%rcx, 232(%rsp)
	movl	%edi, 228(%rsp)
	call	update_counter_r
	movq	264(%rsp), %r10
	movq	256(%rsp), %r11
	movq	248(%rsp), %r9
	movq	240(%rsp), %r8
	movq	232(%rsp), %rcx
	movl	228(%rsp), %edi
	.p2align 4,,10
	.p2align 3
.L55:
	movq	%rbx, %rax
	cmpq	%r13, %rbx
	je	.L54
.L77:
	movq	(%rax), %rax
	addq	$8, %rbx
	cmpq	%r12, %rax
	jne	.L76
	movq	%rbx, %rax
	cmpq	%r13, %rbx
	jne	.L77
	.p2align 4,,10
	.p2align 3
.L54:
	movq	%rbp, %rax
	cmpq	%rbp, %r15
	je	.L72
	addq	$8, %rbp
	jmp	.L51
	.p2align 4,,10
	.p2align 3
.L72:
	movq	%r14, %r13
.L49:
	movq	%r13, %rax
	cmpq	%r13, 8(%rsp)
	je	.L71
	addq	$8, %r13
	jmp	.L46
	.p2align 4,,10
	.p2align 3
.L71:
	movq	64(%rsp), %r11
.L44:
	movq	%r11, %rax
	cmpq	%r11, 32(%rsp)
	je	.L39
	addq	$8, %r11
	jmp	.L41
	.p2align 4,,10
	.p2align 3
.L52:
	movq	(%r9,%r11), %rax
	addq	(%r8,%rdx,8), %rax
	movq	%rax, (%r9,%rdx,8)
	jmp	.L53
	.p2align 4,,10
	.p2align 3
.L39:
	movq	40(%rsp), %rdi
	movq	%rdi, %rax
	cmpq	%rdi, 72(%rsp)
	je	.L34
	addq	$8, %rdi
	movq	%rdi, 40(%rsp)
	jmp	.L36
	.p2align 4,,10
	.p2align 3
.L47:
	movq	48(%rsp), %rax
	movq	(%r9,%rax), %rax
	addq	(%r8,%r12,8), %rax
	movq	%rax, (%r9,%r12,8)
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L34:
	movq	80(%rsp), %rdi
	movq	%rdi, %rax
	cmpq	%rdi, 104(%rsp)
	je	.L29
	addq	$8, %rdi
	movq	%rdi, 80(%rsp)
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L42:
	movq	88(%rsp), %rax
	movq	(%r9,%rax), %rax
	addq	(%r8,%r10,8), %rax
	movq	%rax, (%r9,%r10,8)
	jmp	.L43
	.p2align 4,,10
	.p2align 3
.L29:
	movq	112(%rsp), %rsi
	movq	%rsi, %rax
	cmpq	%rsi, 136(%rsp)
	je	.L24
	leaq	8(%rsi), %rdi
	movq	%rdi, 112(%rsp)
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L37:
	movq	120(%rsp), %rax
	movq	(%r9,%rax), %rax
	addq	(%r8,%r11,8), %rax
	movq	%rax, (%r9,%r11,8)
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L24:
	movq	144(%rsp), %rsi
	movq	%rsi, %rax
	cmpq	%rsi, 168(%rsp)
	je	.L19
	addq	$8, %rsi
	movq	%rsi, 144(%rsp)
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L32:
	movq	152(%rsp), %rax
	movq	(%r9,%rax), %rax
	addq	(%r8,%rdi,8), %rax
	movq	%rax, (%r9,%rdi,8)
	movq	%rdi, %rax
	jmp	.L33
.L19:
	movq	176(%rsp), %rbx
	movq	%rbx, %rax
	cmpq	%rbx, 192(%rsp)
	je	.L10
	leaq	8(%rbx), %rdi
	movq	%rdi, 176(%rsp)
	jmp	.L15
.L27:
	movq	184(%rsp), %rax
	movq	(%r9,%rax), %rax
	addq	(%r8,%rdi,8), %rax
	movq	%rax, (%r9,%rdi,8)
	movq	%rdi, %rax
	jmp	.L28
.L22:
	movq	208(%rsp), %rax
	movq	(%r9,%rax), %rax
	addq	(%r8,%rbx,8), %rax
	movq	%rax, (%r9,%rbx,8)
	movq	%rbx, %rax
	jmp	.L23
.L10:
	addq	$280, %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
.L17:
	.cfi_restore_state
	movq	128(%rsp), %rdx
	movq	216(%rsp), %rax
	movq	(%r9,%rax), %rax
	addq	(%r8,%rdx,8), %rax
	movq	%rax, (%r9,%rdx,8)
	jmp	.L18
.L11:
	movq	160(%rsp), %rsi
	movslq	%edi, %rdx
	movq	(%r8,%rsi,8), %rax
	addq	(%r9,%rdx,8), %rax
	movq	%rax, (%r9,%rsi,8)
	jmp	.L13
	.cfi_endproc
.LFE42:
	.size	update_counter_r, .-update_counter_r
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d%d\n"
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%lu "
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB43:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC1(%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), %rdx
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	24(%rsp), %r14
	leaq	0(,%r14,8), %rdi
	movl	%r14d, 8(%rsp)
	call	malloc@PLT
	movl	8(%rsp), %ecx
	movq	%rax, %r12
	testl	%ecx, %ecx
	jle	.L88
	movq	%rax, %r15
	movq	.LC0(%rip), %rbp
	movl	%ecx, %eax
	leaq	(%r12,%rax,8), %r13
	.p2align 4,,10
	.p2align 3
.L82:
	movl	$16, %edi
	movl	%ecx, 8(%rsp)
	addq	$8, %r15
	call	malloc@PLT
	movl	$80, %edi
	movq	%rbp, (%rax)
	movq	%rax, %rbx
	call	malloc@PLT
	movq	%rbx, -8(%r15)
	cmpq	%r13, %r15
	movl	8(%rsp), %ecx
	movq	%rax, 8(%rbx)
	jne	.L82
	cmpl	$1, %ecx
	jle	.L88
	xorl	%ebx, %ebx
	leaq	36(%rsp), %r14
	leaq	32(%rsp), %r13
	leaq	.LC2(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L81:
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	32(%rsp), %rax
	movslq	36(%rsp), %rcx
	movq	-8(%r12,%rax,8), %r15
	leal	-1(%rcx), %r8d
	movq	%rax, %rsi
	movslq	%r8d, %r8
	movl	(%r15), %edx
	cmpl	4(%r15), %edx
	je	.L84
	movq	8(%r15), %rax
.L85:
	movslq	%edx, %rdi
	addl	$1, %edx
	movq	%r8, (%rax,%rdi,8)
	movl	%edx, (%r15)
	movq	-8(%r12,%rcx,8), %rdx
	leal	-1(%rsi), %r15d
	movslq	%r15d, %r15
	movl	(%rdx), %eax
	movq	8(%rdx), %rdi
	cmpl	4(%rdx), %eax
	je	.L108
	movslq	%eax, %rcx
	addl	$1, %eax
	addl	$1, %ebx
	movq	%r15, (%rdi,%rcx,8)
	movl	24(%rsp), %ecx
	movl	%eax, (%rdx)
	leal	-1(%rcx), %eax
	cmpl	%ebx, %eax
	jg	.L81
.L107:
	movslq	%ecx, %r14
.L88:
	salq	$3, %r14
	movl	%ecx, 8(%rsp)
	movq	%r14, %rdi
	call	malloc@PLT
	movl	8(%rsp), %ecx
	movq	%rax, %r15
	testl	%ecx, %ecx
	jle	.L92
	movq	%r14, %rdx
	xorl	%esi, %esi
	movq	%rax, %rdi
	call	memset@PLT
.L92:
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L91
	xorl	%ebx, %ebx
	leaq	36(%rsp), %r14
	leaq	32(%rsp), %r13
	leaq	.LC2(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L90:
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	32(%rsp), %rax
	movslq	36(%rsp), %rdx
	addl	$1, %ebx
	addq	%rdx, -8(%r15,%rax,8)
	cmpl	%ebx, 28(%rsp)
	jg	.L90
.L91:
	movslq	24(%rsp), %rdi
	xorl	%ebx, %ebx
	movq	%rdi, %r13
	salq	$3, %rdi
	call	malloc@PLT
	movq	%r12, %rcx
	movq	%r15, %r8
	movl	%r13d, %edx
	movq	%rax, %r9
	xorl	%esi, %esi
	movl	$-1, %edi
	movq	%rax, %rbp
	call	update_counter_r
	leaq	.LC3(%rip), %r12
	testl	%r13d, %r13d
	jle	.L94
	.p2align 4,,10
	.p2align 3
.L93:
	movq	0(%rbp,%rbx,8), %rdx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 24(%rsp)
	jg	.L93
.L94:
	movl	$10, %edi
	call	putchar@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L109
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L84:
	.cfi_restore_state
	addl	%edx, %edx
	movq	8(%r15), %rdi
	movq	%r8, 8(%rsp)
	movl	%edx, 4(%r15)
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rsi
	call	realloc@PLT
	movl	32(%rsp), %esi
	movslq	36(%rsp), %rcx
	movl	(%r15), %edx
	movq	8(%rsp), %r8
	movq	%rax, 8(%r15)
	jmp	.L85
	.p2align 4,,10
	.p2align 3
.L108:
	addl	%eax, %eax
	movq	%rdx, 8(%rsp)
	addl	$1, %ebx
	movl	%eax, 4(%rdx)
	cltq
	leaq	0(,%rax,8), %rsi
	call	realloc@PLT
	movq	8(%rsp), %rdx
	movslq	(%rdx), %rsi
	movq	%rax, 8(%rdx)
	movq	%rsi, %rcx
	movq	%r15, (%rax,%rsi,8)
	addl	$1, %ecx
	movl	%ecx, (%rdx)
	movl	24(%rsp), %ecx
	leal	-1(%rcx), %eax
	cmpl	%eax, %ebx
	jl	.L81
	jmp	.L107
.L109:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE43:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	0
	.long	10
	.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	vlist_init
	.type	vlist_init, @function
vlist_init:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	$16, %edi
	call	malloc@PLT
	movl	$80, %edi
	movq	%rax, %r12
	movq	.LC0(%rip), %rax
	movq	%rax, (%r12)
	call	malloc@PLT
	movq	%rax, 8(%r12)
	movq	%r12, %rax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE39:
	.size	vlist_init, .-vlist_init
	.p2align 4
	.globl	vlist_add
	.type	vlist_add, @function
vlist_add:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movq	%rdi, %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	movl	(%rdi), %edx
	movq	8(%rdi), %rdi
	cmpl	4(%rbx), %edx
	je	.L7
.L5:
	movslq	%edx, %rax
	addl	$1, %edx
	movq	%rbp, (%rdi,%rax,8)
	movl	%edx, (%rbx)
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	addl	%edx, %edx
	movl	%edx, 4(%rbx)
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rsi
	call	realloc@PLT
	movl	(%rbx), %edx
	movq	%rax, 8(%rbx)
	movq	%rax, %rdi
	jmp	.L5
	.cfi_endproc
.LFE40:
	.size	vlist_add, .-vlist_add
	.p2align 4
	.globl	vlist_term
	.type	vlist_term, @function
vlist_term:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rdi, %rbp
	movq	8(%rdi), %rdi
	call	free@PLT
	movq	%rbp, %rdi
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	free@PLT
	.cfi_endproc
.LFE41:
	.size	vlist_term, .-vlist_term
	.p2align 4
	.globl	update_counter_r
	.type	update_counter_r, @function
update_counter_r:
.LFB42:
	.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
	movslq	%esi, %rbx
	movq	%rbx, %rax
	subq	$280, %rsp
	.cfi_def_cfa_offset 336
	movq	%rbx, 160(%rsp)
	salq	$3, %rbx
	movl	%edx, 224(%rsp)
	movq	%rbx, 216(%rsp)
	testl	%eax, %eax
	jne	.L11
	movq	(%r8), %rax
	movq	%rax, (%r9)
.L13:
	movq	160(%rsp), %rax
	movq	(%rcx,%rax,8), %rax
	movl	(%rax), %edx
	testl	%edx, %edx
	jle	.L10
	movq	8(%rax), %rax
	subl	$1, %edx
	movslq	%edi, %rdi
	movq	%rdi, 200(%rsp)
	leaq	8(%rax), %rsi
	leaq	(%rsi,%rdx,8), %rdx
	movq	%rsi, 176(%rsp)
	movq	%rdx, 192(%rsp)
.L15:
	movq	(%rax), %rax
	cmpq	200(%rsp), %rax
	je	.L19
	movslq	%eax, %rdx
	movq	%rdx, 128(%rsp)
	salq	$3, %rdx
	movq	%rdx, 208(%rsp)
	testl	%eax, %eax
	jne	.L17
	movq	(%r8), %rax
	movq	%rax, (%r9)
.L18:
	movq	128(%rsp), %rax
	movq	(%rcx,%rax,8), %rax
	movl	(%rax), %edx
	testl	%edx, %edx
	jle	.L19
	movq	8(%rax), %rax
	subl	$1, %edx
	leaq	8(%rax), %rdi
	movq	%rdi, 144(%rsp)
	leaq	(%rdi,%rdx,8), %rdi
	movq	%rdi, 168(%rsp)
.L21:
	movq	(%rax), %rax
	cmpq	160(%rsp), %rax
	je	.L24
	movslq	%eax, %rbx
	leaq	0(,%rbx,8), %rdx
	movq	%rbx, 96(%rsp)
	movq	%rdx, 184(%rsp)
	testl	%eax, %eax
	jne	.L22
	movq	(%r8), %rax
	movq	%rax, (%r9)
	movq	%rbx, %rax
.L23:
	movq	(%rcx,%rax,8), %rax
	movl	(%rax), %edx
	testl	%edx, %edx
	jle	.L24
	movq	8(%rax), %rax
	subl	$1, %edx
	leaq	8(%rax), %rbx
	leaq	(%rbx,%rdx,8), %rdi
	movq	%rbx, 112(%rsp)
	movq	%rdi, 136(%rsp)
.L26:
	movq	(%rax), %rax
	cmpq	128(%rsp), %rax
	je	.L29
	movslq	%eax, %rdi
	leaq	0(,%rdi,8), %rsi
	movq	%rdi, 56(%rsp)
	movq	%rsi, 152(%rsp)
	testl	%eax, %eax
	jne	.L27
	movq	(%r8), %rax
	movq	%rax, (%r9)
	movq	%rdi, %rax
.L28:
	movq	(%rcx,%rax,8), %rax
	movl	(%rax), %edx
	testl	%edx, %edx
	jle	.L29
	movq	8(%rax), %rax
	subl	$1, %edx
	leaq	8(%rax), %rdi
	movq	%rdi, 80(%rsp)
	leaq	(%rdi,%rdx,8), %rdi
	movq	%rdi, 104(%rsp)
.L31:
	movq	(%rax), %rax
	cmpq	96(%rsp), %rax
	je	.L34
	movslq	%eax, %rdi
	leaq	0(,%rdi,8), %rsi
	movq	%rdi, 24(%rsp)
	movq	%rsi, 120(%rsp)
	testl	%eax, %eax
	jne	.L32
	movq	(%r8), %rax
	movq	%rax, (%r9)
	movq	%rdi, %rax
.L33:
	movq	(%rcx,%rax,8), %rax
	movl	(%rax), %edx
	testl	%edx, %edx
	jle	.L34
	movq	8(%rax), %rax
	subl	$1, %edx
	leaq	8(%rax), %rdi
	leaq	(%rdi,%rdx,8), %rsi
	movq	%rdi, 40(%rsp)
	movq	%rsi, 72(%rsp)
.L36:
	movq	(%rax), %rax
	cmpq	56(%rsp), %rax
	je	.L39
	movslq	%eax, %r11
	leaq	0(,%r11,8), %rdi
	movq	%rdi, 88(%rsp)
	testl	%eax, %eax
	jne	.L37
	movq	(%r8), %rax
	movq	%rax, (%r9)
.L38:
	movq	(%rcx,%r11,8), %rax
	movl	(%rax), %edx
	testl	%edx, %edx
	jle	.L39
	movq	8(%rax), %rax
	subl	$1, %edx
	movq	%r11, 16(%rsp)
	leaq	8(%rax), %r10
	leaq	(%r10,%rdx,8), %rsi
	movq	%r10, %r11
	movq	%rsi, 32(%rsp)
.L41:
	movq	(%rax), %rax
	cmpq	24(%rsp), %rax
	je	.L44
	movslq	%eax, %r10
	leaq	0(,%r10,8), %rdi
	movq	%rdi, 48(%rsp)
	testl	%eax, %eax
	jne	.L42
	movq	(%r8), %rax
	movq	%rax, (%r9)
.L43:
	movq	(%rcx,%r10,8), %rax
	movl	(%rax), %edx
	testl	%edx, %edx
	jle	.L44
	movq	8(%rax), %rax
	subl	$1, %edx
	movq	%r11, 64(%rsp)
	leaq	8(%rax), %r13
	leaq	0(%r13,%rdx,8), %rsi
	movq	%rsi, 8(%rsp)
.L46:
	movq	(%rax), %rax
	cmpq	16(%rsp), %rax
	je	.L49
	movslq	%eax, %r12
	leaq	0(,%r12,8), %r11
	testl	%eax, %eax
	jne	.L47
	movq	(%r8), %rax
	movq	%rax, (%r9)
.L48:
	movq	(%rcx,%r12,8), %rax
	movl	(%rax), %edx
	testl	%edx, %edx
	jle	.L49
	movq	8(%rax), %rax
	subl	$1, %edx
	movq	%r13, %r14
	leaq	8(%rax), %rbp
	leaq	0(%rbp,%rdx,8), %r15
.L51:
	movq	(%rax), %rax
	cmpq	%r10, %rax
	je	.L54
	movl	%eax, %edi
	movslq	%eax, %rdx
	testl	%eax, %eax
	jne	.L52
	movq	(%r8), %rax
	movq	%rax, (%r9)
.L53:
	movq	(%rcx,%rdx,8), %rax
	movl	(%rax), %edx
	testl	%edx, %edx
	jle	.L54
	movq	8(%rax), %rax
	subl	$1, %edx
	leaq	8(%rax), %rbx
	movq	(%rax), %rax
	leaq	(%rbx,%rdx,8), %r13
	cmpq	%r12, %rax
	je	.L55
.L76:
	movl	224(%rsp), %edx
	movl	%eax, %esi
	movq	%r10, 264(%rsp)
	movq	%r11, 256(%rsp)
	movq	%r9, 248(%rsp)
	movq	%r8, 240(%rsp)
	movq	%rcx, 232(%rsp)
	movl	%edi, 228(%rsp)
	call	update_counter_r
	movq	264(%rsp), %r10
	movq	256(%rsp), %r11
	movq	248(%rsp), %r9
	movq	240(%rsp), %r8
	movq	232(%rsp), %rcx
	movl	228(%rsp), %edi
	.p2align 4,,10
	.p2align 3
.L55:
	movq	%rbx, %rax
	cmpq	%r13, %rbx
	je	.L54
.L77:
	movq	(%rax), %rax
	addq	$8, %rbx
	cmpq	%r12, %rax
	jne	.L76
	movq	%rbx, %rax
	cmpq	%r13, %rbx
	jne	.L77
	.p2align 4,,10
	.p2align 3
.L54:
	movq	%rbp, %rax
	cmpq	%rbp, %r15
	je	.L72
	addq	$8, %rbp
	jmp	.L51
	.p2align 4,,10
	.p2align 3
.L72:
	movq	%r14, %r13
.L49:
	movq	%r13, %rax
	cmpq	%r13, 8(%rsp)
	je	.L71
	addq	$8, %r13
	jmp	.L46
	.p2align 4,,10
	.p2align 3
.L71:
	movq	64(%rsp), %r11
.L44:
	movq	%r11, %rax
	cmpq	%r11, 32(%rsp)
	je	.L39
	addq	$8, %r11
	jmp	.L41
	.p2align 4,,10
	.p2align 3
.L52:
	movq	(%r9,%r11), %rax
	addq	(%r8,%rdx,8), %rax
	movq	%rax, (%r9,%rdx,8)
	jmp	.L53
	.p2align 4,,10
	.p2align 3
.L39:
	movq	40(%rsp), %rdi
	movq	%rdi, %rax
	cmpq	%rdi, 72(%rsp)
	je	.L34
	addq	$8, %rdi
	movq	%rdi, 40(%rsp)
	jmp	.L36
	.p2align 4,,10
	.p2align 3
.L47:
	movq	48(%rsp), %rax
	movq	(%r9,%rax), %rax
	addq	(%r8,%r12,8), %rax
	movq	%rax, (%r9,%r12,8)
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L34:
	movq	80(%rsp), %rdi
	movq	%rdi, %rax
	cmpq	%rdi, 104(%rsp)
	je	.L29
	addq	$8, %rdi
	movq	%rdi, 80(%rsp)
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L42:
	movq	88(%rsp), %rax
	movq	(%r9,%rax), %rax
	addq	(%r8,%r10,8), %rax
	movq	%rax, (%r9,%r10,8)
	jmp	.L43
	.p2align 4,,10
	.p2align 3
.L29:
	movq	112(%rsp), %rsi
	movq	%rsi, %rax
	cmpq	%rsi, 136(%rsp)
	je	.L24
	leaq	8(%rsi), %rdi
	movq	%rdi, 112(%rsp)
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L37:
	movq	120(%rsp), %rax
	movq	(%r9,%rax), %rax
	addq	(%r8,%r11,8), %rax
	movq	%rax, (%r9,%r11,8)
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L24:
	movq	144(%rsp), %rsi
	movq	%rsi, %rax
	cmpq	%rsi, 168(%rsp)
	je	.L19
	addq	$8, %rsi
	movq	%rsi, 144(%rsp)
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L32:
	movq	152(%rsp), %rax
	movq	(%r9,%rax), %rax
	addq	(%r8,%rdi,8), %rax
	movq	%rax, (%r9,%rdi,8)
	movq	%rdi, %rax
	jmp	.L33
.L19:
	movq	176(%rsp), %rbx
	movq	%rbx, %rax
	cmpq	%rbx, 192(%rsp)
	je	.L10
	leaq	8(%rbx), %rdi
	movq	%rdi, 176(%rsp)
	jmp	.L15
.L27:
	movq	184(%rsp), %rax
	movq	(%r9,%rax), %rax
	addq	(%r8,%rdi,8), %rax
	movq	%rax, (%r9,%rdi,8)
	movq	%rdi, %rax
	jmp	.L28
.L22:
	movq	208(%rsp), %rax
	movq	(%r9,%rax), %rax
	addq	(%r8,%rbx,8), %rax
	movq	%rax, (%r9,%rbx,8)
	movq	%rbx, %rax
	jmp	.L23
.L10:
	addq	$280, %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
.L17:
	.cfi_restore_state
	movq	128(%rsp), %rdx
	movq	216(%rsp), %rax
	movq	(%r9,%rax), %rax
	addq	(%r8,%rdx,8), %rax
	movq	%rax, (%r9,%rdx,8)
	jmp	.L18
.L11:
	movq	160(%rsp), %rsi
	movslq	%edi, %rdx
	movq	(%r8,%rsi,8), %rax
	addq	(%r9,%rdx,8), %rax
	movq	%rax, (%r9,%rsi,8)
	jmp	.L13
	.cfi_endproc
.LFE42:
	.size	update_counter_r, .-update_counter_r
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d%d\n"
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%lu "
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB43:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC1(%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), %rdx
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	24(%rsp), %r14
	leaq	0(,%r14,8), %rdi
	movl	%r14d, 8(%rsp)
	call	malloc@PLT
	movl	8(%rsp), %ecx
	movq	%rax, %r12
	testl	%ecx, %ecx
	jle	.L88
	movq	%rax, %r15
	movq	.LC0(%rip), %rbp
	movl	%ecx, %eax
	leaq	(%r12,%rax,8), %r13
	.p2align 4,,10
	.p2align 3
.L82:
	movl	$16, %edi
	movl	%ecx, 8(%rsp)
	addq	$8, %r15
	call	malloc@PLT
	movl	$80, %edi
	movq	%rbp, (%rax)
	movq	%rax, %rbx
	call	malloc@PLT
	movq	%rbx, -8(%r15)
	cmpq	%r13, %r15
	movl	8(%rsp), %ecx
	movq	%rax, 8(%rbx)
	jne	.L82
	cmpl	$1, %ecx
	jle	.L88
	xorl	%ebx, %ebx
	leaq	36(%rsp), %r14
	leaq	32(%rsp), %r13
	leaq	.LC2(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L81:
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	32(%rsp), %rax
	movslq	36(%rsp), %rcx
	movq	-8(%r12,%rax,8), %r15
	leal	-1(%rcx), %r8d
	movq	%rax, %rsi
	movslq	%r8d, %r8
	movl	(%r15), %edx
	cmpl	4(%r15), %edx
	je	.L84
	movq	8(%r15), %rax
.L85:
	movslq	%edx, %rdi
	addl	$1, %edx
	movq	%r8, (%rax,%rdi,8)
	movl	%edx, (%r15)
	movq	-8(%r12,%rcx,8), %rdx
	leal	-1(%rsi), %r15d
	movslq	%r15d, %r15
	movl	(%rdx), %eax
	movq	8(%rdx), %rdi
	cmpl	4(%rdx), %eax
	je	.L108
	movslq	%eax, %rcx
	addl	$1, %eax
	addl	$1, %ebx
	movq	%r15, (%rdi,%rcx,8)
	movl	24(%rsp), %ecx
	movl	%eax, (%rdx)
	leal	-1(%rcx), %eax
	cmpl	%ebx, %eax
	jg	.L81
.L107:
	movslq	%ecx, %r14
.L88:
	salq	$3, %r14
	movl	%ecx, 8(%rsp)
	movq	%r14, %rdi
	call	malloc@PLT
	movl	8(%rsp), %ecx
	movq	%rax, %r15
	testl	%ecx, %ecx
	jle	.L92
	movq	%r14, %rdx
	xorl	%esi, %esi
	movq	%rax, %rdi
	call	memset@PLT
.L92:
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L91
	xorl	%ebx, %ebx
	leaq	36(%rsp), %r14
	leaq	32(%rsp), %r13
	leaq	.LC2(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L90:
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	32(%rsp), %rax
	movslq	36(%rsp), %rdx
	addl	$1, %ebx
	addq	%rdx, -8(%r15,%rax,8)
	cmpl	%ebx, 28(%rsp)
	jg	.L90
.L91:
	movslq	24(%rsp), %rdi
	xorl	%ebx, %ebx
	movq	%rdi, %r13
	salq	$3, %rdi
	call	malloc@PLT
	movq	%r12, %rcx
	movq	%r15, %r8
	movl	%r13d, %edx
	movq	%rax, %r9
	xorl	%esi, %esi
	movl	$-1, %edi
	movq	%rax, %rbp
	call	update_counter_r
	leaq	.LC3(%rip), %r12
	testl	%r13d, %r13d
	jle	.L94
	.p2align 4,,10
	.p2align 3
.L93:
	movq	0(%rbp,%rbx,8), %rdx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 24(%rsp)
	jg	.L93
.L94:
	movl	$10, %edi
	call	putchar@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L109
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L84:
	.cfi_restore_state
	addl	%edx, %edx
	movq	8(%r15), %rdi
	movq	%r8, 8(%rsp)
	movl	%edx, 4(%r15)
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rsi
	call	realloc@PLT
	movl	32(%rsp), %esi
	movslq	36(%rsp), %rcx
	movl	(%r15), %edx
	movq	8(%rsp), %r8
	movq	%rax, 8(%r15)
	jmp	.L85
	.p2align 4,,10
	.p2align 3
.L108:
	addl	%eax, %eax
	movq	%rdx, 8(%rsp)
	addl	$1, %ebx
	movl	%eax, 4(%rdx)
	cltq
	leaq	0(,%rax,8), %rsi
	call	realloc@PLT
	movq	8(%rsp), %rdx
	movslq	(%rdx), %rsi
	movq	%rax, 8(%rdx)
	movq	%rsi, %rcx
	movq	%r15, (%rax,%rsi,8)
	addl	$1, %ecx
	movl	%ecx, (%rdx)
	movl	24(%rsp), %ecx
	leal	-1(%rcx), %eax
	cmpl	%eax, %ebx
	jl	.L81
	jmp	.L107
.L109:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE43:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	0
	.long	10
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>

#define VLIST_MIN 10
typedef uint64_t vlist_element_type;

typedef struct {
    int size, asize;
    vlist_element_type *a;
} vlist;

vlist *vlist_init()
{
    vlist *vl = malloc(sizeof(vlist));
    vl->size = 0;
    vl->asize = VLIST_MIN;
    vl->a = malloc(sizeof(vlist_element_type) * vl->asize);
    return vl;
}

void vlist_add(vlist *vl, vlist_element_type x)
{
    if(vl->size == vl->asize){
        vl->asize *= 2;
        vl->a = realloc(vl->a, sizeof(vlist_element_type) * vl->asize);
    }
    vl->a[vl->size] = x;
    vl->size++;
}

void vlist_term(vlist *vl)
{
    free(vl->a);
    free(vl);
}

void update_counter_r(int p, int c, int N, vlist **vs, uint64_t *counter_query, uint64_t *counter)
{
    if(c==0){
        counter[c] = counter_query[c];
    } else {
        counter[c] = counter_query[c] + counter[p];
    }
    for(int vi=0; vi<vs[c]->size; vi++){
        if(vs[c]->a[vi] != p){
            update_counter_r(c, vs[c]->a[vi], N, vs, counter_query, counter);
        } 
    }
}

int main()
{
    int N, Q;
    scanf("%d%d\n", &N, &Q);

    vlist **vs = malloc(sizeof(vlist*) * N);
    for(int ni=0; ni<N; ni++){
        vs[ni] = vlist_init();
    }

    for(int ni=0; ni<N-1; ni++){
        int a, b;
        scanf("%d%d", &a, &b);
        vlist_add(vs[a-1], b-1);
        vlist_add(vs[b-1], a-1);
    }

    uint64_t *counter_query = malloc(sizeof(uint64_t) * N);
    for(int ni=0; ni<N; ni++){
        counter_query[ni] = 0;
    }
    for(int qi=0; qi<Q; qi++){
        int p, x;
        scanf("%d%d", &p, &x);
        counter_query[p-1] += x;
    }

    uint64_t *counter = malloc(sizeof(uint64_t) * N);
    update_counter_r(-1, 0, N, vs, counter_query, counter);

    for(int ni=0; ni<N; ni++){
        printf("%"PRIu64" ", counter[ni]);
    }
    printf("\n");

    return 0;
}


4 3
1 2
2 3
1 4
2 10
1 100
3 1
 4 3
1 2
2 3
1 4
2 10
1 000
3 1
 4 3
1 2
2 3
2 4
2 19
1 100
3 1
 2 3
1 2
2 3
1 4
2 10
1 100
3 1
 4 3
1 2
2 3
2 4
4 10
1 100
3 1
 4 3
1 2
2 3
2 4
2 19
1 100
2 1
 2 3
1 2
2 1
1 4
2 10
2 100
3 1
 4 3
1 2
2 3
2 4
2 10
2 100
3 1
 4 3
1 2
2 3
2 4
2 19
1 100
2 0
 2 3
1 2
2 1
1 4
2 18
2 100
3 1

100 110 111 100 
 0 10 11 0 
 100 119 120 119 
 4 17 
 100 100 101 110 
 100 120 120 120 
 4 15 
 0 110 111 110 
 100 119 119 119 
 4 23 

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

```c
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>

#define VLIST_MIN 10
typedef uint64_t vlist_element_type;

typedef struct {
    int size, asize;
    vlist_element_type *a;
} vlist;

vlist *vlist_init()
{
    vlist *vl = malloc(sizeof(vlist));
    vl->size = 0;
    vl->asize = VLIST_MIN;
    vl->a = malloc(sizeof(vlist_element_type) * vl->asize);
    return vl;
}

void vlist_add(vlist *vl, vlist_element_type x)
{
    if(vl->size == vl->asize){
        vl->asize *= 2;
        vl->a = realloc(vl->a, sizeof(vlist_element_type) * vl->asize);
    }
    vl->a[vl->size] = x;
    vl->size++;
}

void vlist_term(vlist *vl)
{
    free(vl->a);
    free(vl);
}

void update_counter_r(int p, int c, int N, vlist **vs, uint64_t *counter_query, uint64_t *counter)
{
    if(c==0){
        counter[c] = counter_query[c];
    } else {
        counter[c] = counter_query[c] + counter[p];
    }
    for(int vi=0; vi<vs[c]->size; vi++){
        if(vs[c]->a[vi] != p){
            update_counter_r(c, vs[c]->a[vi], N, vs, counter_query, counter);
        } 
    }
}

int main()
{
    int N, Q;
    scanf("%d%d\n", &N, &Q);

    vlist **vs = malloc(sizeof(vlist*) * N);
    for(int ni=0; ni<N; ni++){
        vs[ni] = vlist_init();
    }

    for(int ni=0; ni<N-1; ni++){
        int a, b;
        scanf("%d%d", &a, &b);
        vlist_add(vs[a-1], b-1);
        vlist_add(vs[b-1], a-1);
    }

    uint64_t *counter_query = malloc(sizeof(uint64_t) * N);
    for(int ni=0; ni<N; ni++){
        counter_query[ni] = 0;
    }
    for(int qi=0; qi<Q; qi++){
        int p, x;
        scanf("%d%d", &p, &x);
        counter_query[p-1] += x;
    }

    uint64_t *counter = malloc(sizeof(uint64_t) * N);
    update_counter_r(-1, 0, N, vs, counter_query, counter);

    for(int ni=0; ni<N; ni++){
        printf("%"PRIu64" ", counter[ni]);
    }
    printf("\n");

    return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	vlist_init
	.type	vlist_init, @function
vlist_init:
.LFB6:
	.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
	movl	$16, %edi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movl	$0, (%rax)
	movq	-8(%rbp), %rax
	movl	$10, 4(%rax)
	movq	-8(%rbp), %rax
	movl	4(%rax), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 8(%rax)
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	vlist_init, .-vlist_init
	.globl	vlist_add
	.type	vlist_add, @function
vlist_add:
.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	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movl	4(%rax), %eax
	cmpl	%eax, %edx
	jne	.L4
	movq	-8(%rbp), %rax
	movl	4(%rax), %eax
	leal	(%rax,%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, 4(%rax)
	movq	-8(%rbp), %rax
	movl	4(%rax), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	realloc@PLT
	movq	-8(%rbp), %rdx
	movq	%rax, 8(%rdx)
.L4:
	movq	-8(%rbp), %rax
	movq	8(%rax), %rdx
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cltq
	salq	$3, %rax
	addq	%rax, %rdx
	movq	-16(%rbp), %rax
	movq	%rax, (%rdx)
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	leal	1(%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, (%rax)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	vlist_add, .-vlist_add
	.globl	vlist_term
	.type	vlist_term, @function
vlist_term:
.LFB8:
	.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	8(%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
.LFE8:
	.size	vlist_term, .-vlist_term
	.globl	update_counter_r
	.type	update_counter_r, @function
update_counter_r:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movq	%rcx, -40(%rbp)
	movq	%r8, -48(%rbp)
	movq	%r9, -56(%rbp)
	cmpl	$0, -24(%rbp)
	jne	.L7
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-56(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	jmp	.L8
.L7:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rsi
	movq	-56(%rbp), %rax
	addq	%rsi, %rax
	addq	%rcx, %rdx
	movq	%rdx, (%rax)
.L8:
	movl	$0, -4(%rbp)
	jmp	.L9
.L11:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	8(%rax), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	cmpq	%rax, %rdx
	je	.L10
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	8(%rax), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movl	%eax, %r10d
	movq	-56(%rbp), %rdi
	movq	-48(%rbp), %rsi
	movq	-40(%rbp), %rcx
	movl	-28(%rbp), %edx
	movl	-24(%rbp), %eax
	movq	%rdi, %r9
	movq	%rsi, %r8
	movl	%r10d, %esi
	movl	%eax, %edi
	call	update_counter_r
.L10:
	addl	$1, -4(%rbp)
.L9:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movl	(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L11
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	update_counter_r, .-update_counter_r
	.section	.rodata
.LC0:
	.string	"%d%d\n"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%lu "
	.text
	.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
	pushq	%rbx
	subq	$88, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-80(%rbp), %rdx
	leaq	-84(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-84(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -48(%rbp)
	movl	$0, -68(%rbp)
	jmp	.L13
.L14:
	movl	-68(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	leaq	(%rdx,%rax), %rbx
	movl	$0, %eax
	call	vlist_init
	movq	%rax, (%rbx)
	addl	$1, -68(%rbp)
.L13:
	movl	-84(%rbp), %eax
	cmpl	%eax, -68(%rbp)
	jl	.L14
	movl	$0, -64(%rbp)
	jmp	.L15
.L16:
	leaq	-72(%rbp), %rdx
	leaq	-76(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-72(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-76(%rbp), %eax
	cltq
	salq	$3, %rax
	leaq	-8(%rax), %rcx
	movq	-48(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	vlist_add
	movl	-76(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-72(%rbp), %eax
	cltq
	salq	$3, %rax
	leaq	-8(%rax), %rcx
	movq	-48(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	vlist_add
	addl	$1, -64(%rbp)
.L15:
	movl	-84(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -64(%rbp)
	jl	.L16
	movl	-84(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -40(%rbp)
	movl	$0, -60(%rbp)
	jmp	.L17
.L18:
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	$0, (%rax)
	addl	$1, -60(%rbp)
.L17:
	movl	-84(%rbp), %eax
	cmpl	%eax, -60(%rbp)
	jl	.L18
	movl	$0, -56(%rbp)
	jmp	.L19
.L20:
	leaq	-72(%rbp), %rdx
	leaq	-76(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-76(%rbp), %eax
	cltq
	salq	$3, %rax
	leaq	-8(%rax), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movl	-76(%rbp), %eax
	cltq
	salq	$3, %rax
	leaq	-8(%rax), %rsi
	movq	-40(%rbp), %rax
	addq	%rsi, %rax
	addq	%rcx, %rdx
	movq	%rdx, (%rax)
	addl	$1, -56(%rbp)
.L19:
	movl	-80(%rbp), %eax
	cmpl	%eax, -56(%rbp)
	jl	.L20
	movl	-84(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -32(%rbp)
	movl	-84(%rbp), %eax
	movq	-32(%rbp), %rsi
	movq	-40(%rbp), %rcx
	movq	-48(%rbp), %rdx
	movq	%rsi, %r9
	movq	%rcx, %r8
	movq	%rdx, %rcx
	movl	%eax, %edx
	movl	$0, %esi
	movl	$-1, %edi
	call	update_counter_r
	movl	$0, -52(%rbp)
	jmp	.L21
.L22:
	movl	-52(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -52(%rbp)
.L21:
	movl	-84(%rbp), %eax
	cmpl	%eax, -52(%rbp)
	jl	.L22
	movl	$10, %edi
	call	putchar@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	movq	-8(%rbp), %rbx
	leave
	.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	vlist_init
	.type	vlist_init, @function
vlist_init:
.LFB6:
	.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
	movl	$16, %edi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movl	$0, (%rax)
	movq	-8(%rbp), %rax
	movl	$10, 4(%rax)
	movq	-8(%rbp), %rax
	movl	4(%rax), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 8(%rax)
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	vlist_init, .-vlist_init
	.globl	vlist_add
	.type	vlist_add, @function
vlist_add:
.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	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movl	4(%rax), %eax
	cmpl	%eax, %edx
	jne	.L4
	movq	-8(%rbp), %rax
	movl	4(%rax), %eax
	leal	(%rax,%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, 4(%rax)
	movq	-8(%rbp), %rax
	movl	4(%rax), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	realloc@PLT
	movq	-8(%rbp), %rdx
	movq	%rax, 8(%rdx)
.L4:
	movq	-8(%rbp), %rax
	movq	8(%rax), %rdx
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cltq
	salq	$3, %rax
	addq	%rax, %rdx
	movq	-16(%rbp), %rax
	movq	%rax, (%rdx)
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	leal	1(%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, (%rax)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	vlist_add, .-vlist_add
	.globl	vlist_term
	.type	vlist_term, @function
vlist_term:
.LFB8:
	.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	8(%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
.LFE8:
	.size	vlist_term, .-vlist_term
	.globl	update_counter_r
	.type	update_counter_r, @function
update_counter_r:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movq	%rcx, -40(%rbp)
	movq	%r8, -48(%rbp)
	movq	%r9, -56(%rbp)
	cmpl	$0, -24(%rbp)
	jne	.L7
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-56(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	jmp	.L8
.L7:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rsi
	movq	-56(%rbp), %rax
	addq	%rsi, %rax
	addq	%rcx, %rdx
	movq	%rdx, (%rax)
.L8:
	movl	$0, -4(%rbp)
	jmp	.L9
.L11:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	8(%rax), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	cmpq	%rax, %rdx
	je	.L10
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	8(%rax), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movl	%eax, %r10d
	movq	-56(%rbp), %rdi
	movq	-48(%rbp), %rsi
	movq	-40(%rbp), %rcx
	movl	-28(%rbp), %edx
	movl	-24(%rbp), %eax
	movq	%rdi, %r9
	movq	%rsi, %r8
	movl	%r10d, %esi
	movl	%eax, %edi
	call	update_counter_r
.L10:
	addl	$1, -4(%rbp)
.L9:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movl	(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L11
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	update_counter_r, .-update_counter_r
	.section	.rodata
.LC0:
	.string	"%d%d\n"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%lu "
	.text
	.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
	pushq	%rbx
	subq	$88, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-80(%rbp), %rdx
	leaq	-84(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-84(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -48(%rbp)
	movl	$0, -68(%rbp)
	jmp	.L13
.L14:
	movl	-68(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	leaq	(%rdx,%rax), %rbx
	movl	$0, %eax
	call	vlist_init
	movq	%rax, (%rbx)
	addl	$1, -68(%rbp)
.L13:
	movl	-84(%rbp), %eax
	cmpl	%eax, -68(%rbp)
	jl	.L14
	movl	$0, -64(%rbp)
	jmp	.L15
.L16:
	leaq	-72(%rbp), %rdx
	leaq	-76(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-72(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-76(%rbp), %eax
	cltq
	salq	$3, %rax
	leaq	-8(%rax), %rcx
	movq	-48(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	vlist_add
	movl	-76(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-72(%rbp), %eax
	cltq
	salq	$3, %rax
	leaq	-8(%rax), %rcx
	movq	-48(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	vlist_add
	addl	$1, -64(%rbp)
.L15:
	movl	-84(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -64(%rbp)
	jl	.L16
	movl	-84(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -40(%rbp)
	movl	$0, -60(%rbp)
	jmp	.L17
.L18:
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	$0, (%rax)
	addl	$1, -60(%rbp)
.L17:
	movl	-84(%rbp), %eax
	cmpl	%eax, -60(%rbp)
	jl	.L18
	movl	$0, -56(%rbp)
	jmp	.L19
.L20:
	leaq	-72(%rbp), %rdx
	leaq	-76(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-76(%rbp), %eax
	cltq
	salq	$3, %rax
	leaq	-8(%rax), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movl	-76(%rbp), %eax
	cltq
	salq	$3, %rax
	leaq	-8(%rax), %rsi
	movq	-40(%rbp), %rax
	addq	%rsi, %rax
	addq	%rcx, %rdx
	movq	%rdx, (%rax)
	addl	$1, -56(%rbp)
.L19:
	movl	-80(%rbp), %eax
	cmpl	%eax, -56(%rbp)
	jl	.L20
	movl	-84(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -32(%rbp)
	movl	-84(%rbp), %eax
	movq	-32(%rbp), %rsi
	movq	-40(%rbp), %rcx
	movq	-48(%rbp), %rdx
	movq	%rsi, %r9
	movq	%rcx, %r8
	movq	%rdx, %rcx
	movl	%eax, %edx
	movl	$0, %esi
	movl	$-1, %edi
	call	update_counter_r
	movl	$0, -52(%rbp)
	jmp	.L21
.L22:
	movl	-52(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -52(%rbp)
.L21:
	movl	-84(%rbp), %eax
	cmpl	%eax, -52(%rbp)
	jl	.L22
	movl	$10, %edi
	call	putchar@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	movq	-8(%rbp), %rbx
	leave
	.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:
