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

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

typedef struct element {
    struct element *next;
} element;

typedef struct {
    int n;
    element *head;
    element *tail;
} set;

int *l;
set **f;

element *elements;

void initialize(int n) {
    int i;

    l = calloc(n + 1, sizeof(int));
    f = calloc(n + 1, sizeof(set *));
    elements = calloc(n + 1, sizeof(element));

    for (i = 1; i <= n; i++) {
        f[i] = NULL;
    }
}

void new_pair(int x, int y) {
    set *s = malloc(sizeof(set));

    f[x] = f[y] = s;

    elements[x].next = &elements[y];
    elements[y].next = NULL;

    s->n = 2;
    s->head = &elements[x];
    s->tail = &elements[y];
}

void merge(set *s1, set *s2) {
    element *e;

    if (s1->n < s2->n) {
        merge(s2, s1);
        return;
    }

    /** s2が小さいのでs1に寄せる */
    for (e = s2->head; e; e = e->next) {
        f[e - elements] = s1;
    }

    s1->n += s2->n;
    s1->tail->next = s2->head;
    s1->tail = s2->tail;
}

void insert(int x, set *s) {
    f[x] = s;
    element *e = &elements[x];
    e->next = s->head;
    s->head = e;
    s->n++;
}

void add_pair(int x, int y) {
    set *f_x, *f_y;

    if ((f_x = f[x])) {
        if ((f_y = f[y])) {
            if (f_x != f_y) {
                merge(f_x, f_y);
            }
        } else {
            insert(y, f_x);
        }
    } else {
        if ((f_y = f[y])) {
            insert(x, f_y);
        } else {
            new_pair(x, y);
        }
    }
}

int movable(int from, int to) {
    if (from == to) {
        return !0;
    }

    return f[from] && f[to] && f[from] == f[to];
}

int main()
{
    int i;
    int n, m;
    int x, y;
    int r;

    scanf("%d %d", &n, &m);

    initialize(n);

    for (i = 1; i <= n; i++) {
        scanf("%d", &l[i]);
    }

    for (i = 1; i <= m; i++) {
        scanf("%d %d", &x, &y);
        add_pair(x, y);
    }

    r = 0;
    for (i = 1; i <= n; i++) {
        if (movable(i, l[i])) {
            r++;
        }
    }

    printf("%d\n", r);
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	l
	.bss
	.align 8
	.type	l, @object
	.size	l, 8
l:
	.zero	8
	.globl	f
	.align 8
	.type	f, @object
	.size	f, 8
f:
	.zero	8
	.globl	elements
	.align 8
	.type	elements, @object
	.size	elements, 8
elements:
	.zero	8
	.text
	.globl	initialize
	.type	initialize, @function
initialize:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	-20(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, l(%rip)
	movl	-20(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$8, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, f(%rip)
	movl	-20(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$8, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, elements(%rip)
	movl	$1, -4(%rbp)
	jmp	.L2
.L3:
	movq	f(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	$0, (%rax)
	addl	$1, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jle	.L3
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	initialize, .-initialize
	.globl	new_pair
	.type	new_pair, @function
new_pair:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	$24, %edi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movq	f(%rip), %rdx
	movl	-24(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, (%rax)
	movq	f(%rip), %rcx
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	salq	$3, %rdx
	addq	%rcx, %rdx
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	movq	elements(%rip), %rdx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rsi
	movq	elements(%rip), %rcx
	movl	-20(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rcx, %rax
	addq	%rsi, %rdx
	movq	%rdx, (%rax)
	movq	elements(%rip), %rdx
	movl	-24(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	$0, (%rax)
	movq	-8(%rbp), %rax
	movl	$2, (%rax)
	movq	elements(%rip), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 8(%rax)
	movq	elements(%rip), %rdx
	movl	-24(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 16(%rax)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	new_pair, .-new_pair
	.globl	merge
	.type	merge, @function
merge:
.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
	movl	(%rax), %edx
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jge	.L6
	movq	-24(%rbp), %rdx
	movq	-32(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	merge
	jmp	.L5
.L6:
	movq	-32(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -8(%rbp)
	jmp	.L8
.L9:
	movq	f(%rip), %rdx
	movq	elements(%rip), %rcx
	movq	-8(%rbp), %rax
	subq	%rcx, %rax
	addq	%rax, %rdx
	movq	-24(%rbp), %rax
	movq	%rax, (%rdx)
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
.L8:
	cmpq	$0, -8(%rbp)
	jne	.L9
	movq	-24(%rbp), %rax
	movl	(%rax), %edx
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	addl	%eax, %edx
	movq	-24(%rbp), %rax
	movl	%edx, (%rax)
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	-32(%rbp), %rdx
	movq	8(%rdx), %rdx
	movq	%rdx, (%rax)
	movq	-32(%rbp), %rax
	movq	16(%rax), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, 16(%rax)
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	merge, .-merge
	.globl	insert
	.type	insert, @function
insert:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movq	%rsi, -32(%rbp)
	movq	f(%rip), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rax, %rdx
	movq	-32(%rbp), %rax
	movq	%rax, (%rdx)
	movq	elements(%rip), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	%rax, -8(%rbp)
	movq	-32(%rbp), %rax
	movq	8(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, (%rax)
	movq	-32(%rbp), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, 8(%rax)
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	leal	1(%rax), %edx
	movq	-32(%rbp), %rax
	movl	%edx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	insert, .-insert
	.globl	add_pair
	.type	add_pair, @function
add_pair:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movq	f(%rip), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
	cmpq	$0, -16(%rbp)
	je	.L12
	movq	f(%rip), %rdx
	movl	-24(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	je	.L13
	movq	-16(%rbp), %rax
	cmpq	-8(%rbp), %rax
	je	.L16
	movq	-8(%rbp), %rdx
	movq	-16(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	merge
	jmp	.L16
.L13:
	movq	-16(%rbp), %rdx
	movl	-24(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	insert
	jmp	.L16
.L12:
	movq	f(%rip), %rdx
	movl	-24(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	je	.L15
	movq	-8(%rbp), %rdx
	movl	-20(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	insert
	jmp	.L16
.L15:
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	new_pair
.L16:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	add_pair, .-add_pair
	.globl	movable
	.type	movable, @function
movable:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jne	.L18
	movl	$1, %eax
	jmp	.L19
.L18:
	movq	f(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	.L20
	movq	f(%rip), %rdx
	movl	-8(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	.L20
	movq	f(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	f(%rip), %rcx
	movl	-8(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jne	.L20
	movl	$1, %eax
	jmp	.L19
.L20:
	movl	$0, %eax
.L19:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	movable, .-movable
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %eax
	movl	%eax, %edi
	call	initialize
	movl	$1, -16(%rbp)
	jmp	.L23
.L24:
	movq	l(%rip), %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -16(%rbp)
.L23:
	movl	-32(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L24
	movl	$1, -16(%rbp)
	jmp	.L25
.L26:
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	add_pair
	addl	$1, -16(%rbp)
.L25:
	movl	-28(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L26
	movl	$0, -12(%rbp)
	movl	$1, -16(%rbp)
	jmp	.L27
.L29:
	movq	l(%rip), %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-16(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	movable
	testl	%eax, %eax
	je	.L28
	addl	$1, -12(%rbp)
.L28:
	addl	$1, -16(%rbp)
.L27:
	movl	-32(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L29
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.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	initialize
	.type	initialize, @function
initialize:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leal	1(%rdi), %r12d
	movl	$4, %esi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movslq	%r12d, %r12
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movl	%edi, %ebx
	movq	%r12, %rdi
	call	calloc@PLT
	movl	$8, %esi
	movq	%r12, %rdi
	movq	%rax, l(%rip)
	call	calloc@PLT
	movl	$8, %esi
	movq	%r12, %rdi
	movq	%rax, f(%rip)
	movq	%rax, %rbp
	call	calloc@PLT
	movq	%rax, elements(%rip)
	testl	%ebx, %ebx
	jle	.L1
	movslq	%ebx, %rdx
	leaq	8(%rbp), %rdi
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%esi, %esi
	popq	%rbp
	.cfi_def_cfa_offset 16
	salq	$3, %rdx
	popq	%r12
	.cfi_def_cfa_offset 8
	jmp	memset@PLT
	.p2align 4,,10
	.p2align 3
.L1:
	.cfi_restore_state
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE39:
	.size	initialize, .-initialize
	.p2align 4
	.globl	new_pair
	.type	new_pair, @function
new_pair:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	%edi, %ebp
	movl	$24, %edi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	%esi, %ebx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	call	malloc@PLT
	movq	f(%rip), %rcx
	movslq	%ebx, %rsi
	movslq	%ebp, %rdx
	leaq	0(,%rsi,8), %rdi
	movq	%rax, (%rcx,%rsi,8)
	movq	%rax, (%rcx,%rdx,8)
	movq	elements(%rip), %rcx
	leaq	(%rcx,%rdi), %r8
	movq	%r8, (%rcx,%rdx,8)
	movq	elements(%rip), %rcx
	movq	$0, (%rcx,%rsi,8)
	movq	elements(%rip), %rcx
	movl	$2, (%rax)
	leaq	(%rcx,%rdx,8), %rbx
	addq	%rdi, %rcx
	movq	%rbx, %xmm0
	movq	%rcx, %xmm1
	punpcklqdq	%xmm1, %xmm0
	movups	%xmm0, 8(%rax)
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE40:
	.size	new_pair, .-new_pair
	.p2align 4
	.globl	merge
	.type	merge, @function
merge:
.LFB41:
	.cfi_startproc
	endbr64
	movl	(%rdi), %ecx
	movq	%rdi, %rdx
	movl	(%rsi), %edi
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%ecx, %eax
	movl	%edi, %ecx
	movl	%eax, %edi
	movq	%rdx, %rax
	movq	%rsi, %rdx
	movq	%rax, %rsi
.L8:
	cmpl	%edi, %ecx
	jl	.L12
	movq	8(%rsi), %r11
	testq	%r11, %r11
	je	.L11
	movq	f(%rip), %r10
	movq	elements(%rip), %r9
	movq	%r11, %rax
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rax, %r8
	movq	(%rax), %rax
	subq	%r9, %r8
	movq	%rdx, (%r10,%r8)
	testq	%rax, %rax
	jne	.L10
.L11:
	movq	16(%rdx), %rax
	addl	%edi, %ecx
	movl	%ecx, (%rdx)
	movq	%r11, (%rax)
	movq	16(%rsi), %rax
	movq	%rax, 16(%rdx)
	ret
	.cfi_endproc
.LFE41:
	.size	merge, .-merge
	.p2align 4
	.globl	insert
	.type	insert, @function
insert:
.LFB42:
	.cfi_startproc
	endbr64
	movq	f(%rip), %rax
	movslq	%edi, %rdi
	movq	8(%rsi), %rdx
	movq	%rsi, (%rax,%rdi,8)
	movq	elements(%rip), %rax
	leaq	(%rax,%rdi,8), %rax
	movq	%rdx, (%rax)
	addl	$1, (%rsi)
	movq	%rax, 8(%rsi)
	ret
	.cfi_endproc
.LFE42:
	.size	insert, .-insert
	.p2align 4
	.globl	add_pair
	.type	add_pair, @function
add_pair:
.LFB43:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edi, %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
	movslq	%esi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	0(,%rdi,8), %rbx
	leaq	0(,%rbp,8), %r14
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	f(%rip), %r9
	leaq	(%r9,%rbx), %r12
	leaq	(%r9,%r14), %r13
	movq	(%r12), %rax
	movq	0(%r13), %rdx
	testq	%rax, %rax
	je	.L17
	testq	%rdx, %rdx
	je	.L18
	cmpq	%rdx, %rax
	je	.L16
	movl	(%rax), %edi
	movl	(%rdx), %esi
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L25:
	movl	%edi, %ecx
	movl	%esi, %edi
	movl	%ecx, %esi
	movq	%rax, %rcx
	movq	%rdx, %rax
	movq	%rcx, %rdx
.L20:
	cmpl	%edi, %esi
	jg	.L25
	movq	8(%rdx), %r11
	movq	elements(%rip), %r10
	movq	%r11, %rcx
	testq	%r11, %r11
	je	.L23
	.p2align 4,,10
	.p2align 3
.L22:
	movq	%rcx, %r8
	movq	(%rcx), %rcx
	subq	%r10, %r8
	movq	%rax, (%r9,%r8)
	testq	%rcx, %rcx
	jne	.L22
.L23:
	movq	16(%rax), %rcx
	movq	16(%rdx), %rdx
	addl	%edi, %esi
	movl	%esi, (%rax)
	movq	%r11, (%rcx)
	movq	%rdx, 16(%rax)
.L16:
	addq	$24, %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	8(%rax), %rdx
	addq	elements(%rip), %r14
	movq	%rax, 0(%r13)
	movq	%rdx, (%r14)
	addl	$1, (%rax)
	movq	%r14, 8(%rax)
	addq	$24, %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
.L17:
	.cfi_restore_state
	movq	elements(%rip), %rcx
	leaq	(%rcx,%rbx), %r15
	testq	%rdx, %rdx
	je	.L24
	movq	8(%rdx), %rax
	movq	%rdx, (%r12)
	movq	%rax, (%r15)
	addl	$1, (%rdx)
	movq	%r15, 8(%rdx)
	addq	$24, %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
.L24:
	.cfi_restore_state
	movl	$24, %edi
	movq	%rcx, 8(%rsp)
	call	malloc@PLT
	movq	8(%rsp), %rcx
	movq	%rax, 0(%r13)
	addq	%r14, %rcx
	movq	%rax, (%r12)
	movq	%rcx, (%r15)
	movq	elements(%rip), %rdx
	movq	$0, (%rdx,%rbp,8)
	movq	elements(%rip), %rdx
	addq	elements(%rip), %rbx
	movl	$2, (%rax)
	addq	%r14, %rdx
	movq	%rbx, %xmm0
	movq	%rdx, %xmm1
	punpcklqdq	%xmm1, %xmm0
	movups	%xmm0, 8(%rax)
	jmp	.L16
	.cfi_endproc
.LFE43:
	.size	add_pair, .-add_pair
	.p2align 4
	.globl	movable
	.type	movable, @function
movable:
.LFB44:
	.cfi_startproc
	endbr64
	movl	$1, %eax
	cmpl	%esi, %edi
	je	.L29
	movq	f(%rip), %rcx
	movslq	%edi, %rdi
	xorl	%eax, %eax
	movq	(%rcx,%rdi,8), %rdx
	testq	%rdx, %rdx
	je	.L29
	movslq	%esi, %rsi
	movq	(%rcx,%rsi,8), %rax
	testq	%rax, %rax
	setne	%cl
	cmpq	%rax, %rdx
	sete	%al
	movzbl	%al, %eax
	andl	%ecx, %eax
.L29:
	ret
	.cfi_endproc
.LFE44:
	.size	movable, .-movable
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB45:
	.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
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$40, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %edi
	call	initialize
	movl	8(%rsp), %edx
	testl	%edx, %edx
	jle	.L35
	movl	$4, %ebp
	movl	$1, %ebx
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L36:
	movq	l(%rip), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	addq	%rbp, %rsi
	addq	$4, %rbp
	call	__isoc99_scanf@PLT
	cmpl	%ebx, 8(%rsp)
	jge	.L36
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L37
.L44:
	movl	$1, %ebx
	leaq	20(%rsp), %r13
	leaq	16(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L38:
	movq	%r13, %rdx
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %esi
	movl	16(%rsp), %edi
	addl	$1, %ebx
	call	add_pair
	cmpl	%ebx, 12(%rsp)
	jge	.L38
.L37:
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L39
	leal	1(%rax), %edi
	movq	l(%rip), %r8
	movl	$1, %eax
	xorl	%r9d, %r9d
	movq	f(%rip), %rsi
	jmp	.L42
	.p2align 4,,10
	.p2align 3
.L60:
	movq	(%rsi,%rax,8), %rcx
	testq	%rcx, %rcx
	je	.L41
	movq	(%rsi,%rdx,8), %rdx
	cmpq	%rdx, %rcx
	jne	.L41
	testq	%rdx, %rdx
	jne	.L40
.L41:
	addq	$1, %rax
	cmpq	%rdi, %rax
	je	.L43
.L42:
	movslq	(%r8,%rax,4), %rdx
	cmpl	%eax, %edx
	jne	.L60
.L40:
	addq	$1, %rax
	addl	$1, %r9d
	cmpq	%rdi, %rax
	jne	.L42
.L43:
	xorl	%eax, %eax
	movl	%r9d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L61
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
.L35:
	.cfi_restore_state
	cmpl	$0, 12(%rsp)
	jg	.L44
.L39:
	xorl	%r9d, %r9d
	jmp	.L43
.L61:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE45:
	.size	main, .-main
	.globl	elements
	.bss
	.align 8
	.type	elements, @object
	.size	elements, 8
elements:
	.zero	8
	.globl	f
	.align 8
	.type	f, @object
	.size	f, 8
f:
	.zero	8
	.globl	l
	.align 8
	.type	l, @object
	.size	l, 8
l:
	.zero	8
	.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	initialize
	.type	initialize, @function
initialize:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leal	1(%rdi), %r12d
	movl	$4, %esi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movslq	%r12d, %r12
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movl	%edi, %ebx
	movq	%r12, %rdi
	call	calloc@PLT
	movl	$8, %esi
	movq	%r12, %rdi
	movq	%rax, l(%rip)
	call	calloc@PLT
	movl	$8, %esi
	movq	%r12, %rdi
	movq	%rax, f(%rip)
	movq	%rax, %rbp
	call	calloc@PLT
	movq	%rax, elements(%rip)
	testl	%ebx, %ebx
	jle	.L1
	movslq	%ebx, %rdx
	leaq	8(%rbp), %rdi
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%esi, %esi
	popq	%rbp
	.cfi_def_cfa_offset 16
	salq	$3, %rdx
	popq	%r12
	.cfi_def_cfa_offset 8
	jmp	memset@PLT
	.p2align 4,,10
	.p2align 3
.L1:
	.cfi_restore_state
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE39:
	.size	initialize, .-initialize
	.p2align 4
	.globl	new_pair
	.type	new_pair, @function
new_pair:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	%edi, %ebp
	movl	$24, %edi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	%esi, %ebx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	call	malloc@PLT
	movq	f(%rip), %rcx
	movslq	%ebx, %rsi
	movslq	%ebp, %rdx
	leaq	0(,%rsi,8), %rdi
	movq	%rax, (%rcx,%rsi,8)
	movq	%rax, (%rcx,%rdx,8)
	movq	elements(%rip), %rcx
	leaq	(%rcx,%rdi), %r8
	movq	%r8, (%rcx,%rdx,8)
	movq	elements(%rip), %rcx
	movq	$0, (%rcx,%rsi,8)
	movq	elements(%rip), %rcx
	movl	$2, (%rax)
	leaq	(%rcx,%rdx,8), %rbx
	addq	%rdi, %rcx
	movq	%rbx, %xmm0
	movq	%rcx, %xmm1
	punpcklqdq	%xmm1, %xmm0
	movups	%xmm0, 8(%rax)
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE40:
	.size	new_pair, .-new_pair
	.p2align 4
	.globl	merge
	.type	merge, @function
merge:
.LFB41:
	.cfi_startproc
	endbr64
	movl	(%rdi), %ecx
	movq	%rdi, %rdx
	movl	(%rsi), %edi
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%ecx, %eax
	movl	%edi, %ecx
	movl	%eax, %edi
	movq	%rdx, %rax
	movq	%rsi, %rdx
	movq	%rax, %rsi
.L8:
	cmpl	%edi, %ecx
	jl	.L12
	movq	8(%rsi), %r11
	testq	%r11, %r11
	je	.L11
	movq	f(%rip), %r10
	movq	elements(%rip), %r9
	movq	%r11, %rax
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rax, %r8
	movq	(%rax), %rax
	subq	%r9, %r8
	movq	%rdx, (%r10,%r8)
	testq	%rax, %rax
	jne	.L10
.L11:
	movq	16(%rdx), %rax
	addl	%edi, %ecx
	movl	%ecx, (%rdx)
	movq	%r11, (%rax)
	movq	16(%rsi), %rax
	movq	%rax, 16(%rdx)
	ret
	.cfi_endproc
.LFE41:
	.size	merge, .-merge
	.p2align 4
	.globl	insert
	.type	insert, @function
insert:
.LFB42:
	.cfi_startproc
	endbr64
	movq	f(%rip), %rax
	movslq	%edi, %rdi
	movq	8(%rsi), %rdx
	movq	%rsi, (%rax,%rdi,8)
	movq	elements(%rip), %rax
	leaq	(%rax,%rdi,8), %rax
	movq	%rdx, (%rax)
	addl	$1, (%rsi)
	movq	%rax, 8(%rsi)
	ret
	.cfi_endproc
.LFE42:
	.size	insert, .-insert
	.p2align 4
	.globl	add_pair
	.type	add_pair, @function
add_pair:
.LFB43:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edi, %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
	movslq	%esi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	0(,%rdi,8), %rbx
	leaq	0(,%rbp,8), %r14
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	f(%rip), %r9
	leaq	(%r9,%rbx), %r12
	leaq	(%r9,%r14), %r13
	movq	(%r12), %rax
	movq	0(%r13), %rdx
	testq	%rax, %rax
	je	.L17
	testq	%rdx, %rdx
	je	.L18
	cmpq	%rdx, %rax
	je	.L16
	movl	(%rax), %edi
	movl	(%rdx), %esi
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L25:
	movl	%edi, %ecx
	movl	%esi, %edi
	movl	%ecx, %esi
	movq	%rax, %rcx
	movq	%rdx, %rax
	movq	%rcx, %rdx
.L20:
	cmpl	%edi, %esi
	jg	.L25
	movq	8(%rdx), %r11
	movq	elements(%rip), %r10
	movq	%r11, %rcx
	testq	%r11, %r11
	je	.L23
	.p2align 4,,10
	.p2align 3
.L22:
	movq	%rcx, %r8
	movq	(%rcx), %rcx
	subq	%r10, %r8
	movq	%rax, (%r9,%r8)
	testq	%rcx, %rcx
	jne	.L22
.L23:
	movq	16(%rax), %rcx
	movq	16(%rdx), %rdx
	addl	%edi, %esi
	movl	%esi, (%rax)
	movq	%r11, (%rcx)
	movq	%rdx, 16(%rax)
.L16:
	addq	$24, %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	8(%rax), %rdx
	addq	elements(%rip), %r14
	movq	%rax, 0(%r13)
	movq	%rdx, (%r14)
	addl	$1, (%rax)
	movq	%r14, 8(%rax)
	addq	$24, %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
.L17:
	.cfi_restore_state
	movq	elements(%rip), %rcx
	leaq	(%rcx,%rbx), %r15
	testq	%rdx, %rdx
	je	.L24
	movq	8(%rdx), %rax
	movq	%rdx, (%r12)
	movq	%rax, (%r15)
	addl	$1, (%rdx)
	movq	%r15, 8(%rdx)
	addq	$24, %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
.L24:
	.cfi_restore_state
	movl	$24, %edi
	movq	%rcx, 8(%rsp)
	call	malloc@PLT
	movq	8(%rsp), %rcx
	movq	%rax, 0(%r13)
	addq	%r14, %rcx
	movq	%rax, (%r12)
	movq	%rcx, (%r15)
	movq	elements(%rip), %rdx
	movq	$0, (%rdx,%rbp,8)
	movq	elements(%rip), %rdx
	addq	elements(%rip), %rbx
	movl	$2, (%rax)
	addq	%r14, %rdx
	movq	%rbx, %xmm0
	movq	%rdx, %xmm1
	punpcklqdq	%xmm1, %xmm0
	movups	%xmm0, 8(%rax)
	jmp	.L16
	.cfi_endproc
.LFE43:
	.size	add_pair, .-add_pair
	.p2align 4
	.globl	movable
	.type	movable, @function
movable:
.LFB44:
	.cfi_startproc
	endbr64
	movl	$1, %eax
	cmpl	%esi, %edi
	je	.L29
	movq	f(%rip), %rcx
	movslq	%edi, %rdi
	xorl	%eax, %eax
	movq	(%rcx,%rdi,8), %rdx
	testq	%rdx, %rdx
	je	.L29
	movslq	%esi, %rsi
	movq	(%rcx,%rsi,8), %rax
	testq	%rax, %rax
	setne	%cl
	cmpq	%rax, %rdx
	sete	%al
	movzbl	%al, %eax
	andl	%ecx, %eax
.L29:
	ret
	.cfi_endproc
.LFE44:
	.size	movable, .-movable
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB45:
	.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
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$40, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %edi
	call	initialize
	movl	8(%rsp), %edx
	testl	%edx, %edx
	jle	.L35
	movl	$4, %ebp
	movl	$1, %ebx
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L36:
	movq	l(%rip), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	addq	%rbp, %rsi
	addq	$4, %rbp
	call	__isoc99_scanf@PLT
	cmpl	%ebx, 8(%rsp)
	jge	.L36
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L37
.L44:
	movl	$1, %ebx
	leaq	20(%rsp), %r13
	leaq	16(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L38:
	movq	%r13, %rdx
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %esi
	movl	16(%rsp), %edi
	addl	$1, %ebx
	call	add_pair
	cmpl	%ebx, 12(%rsp)
	jge	.L38
.L37:
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L39
	leal	1(%rax), %edi
	movq	l(%rip), %r8
	movl	$1, %eax
	xorl	%r9d, %r9d
	movq	f(%rip), %rsi
	jmp	.L42
	.p2align 4,,10
	.p2align 3
.L60:
	movq	(%rsi,%rax,8), %rcx
	testq	%rcx, %rcx
	je	.L41
	movq	(%rsi,%rdx,8), %rdx
	cmpq	%rdx, %rcx
	jne	.L41
	testq	%rdx, %rdx
	jne	.L40
.L41:
	addq	$1, %rax
	cmpq	%rdi, %rax
	je	.L43
.L42:
	movslq	(%r8,%rax,4), %rdx
	cmpl	%eax, %edx
	jne	.L60
.L40:
	addq	$1, %rax
	addl	$1, %r9d
	cmpq	%rdi, %rax
	jne	.L42
.L43:
	xorl	%eax, %eax
	movl	%r9d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L61
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
.L35:
	.cfi_restore_state
	cmpl	$0, 12(%rsp)
	jg	.L44
.L39:
	xorl	%r9d, %r9d
	jmp	.L43
.L61:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE45:
	.size	main, .-main
	.globl	elements
	.bss
	.align 8
	.type	elements, @object
	.size	elements, 8
elements:
	.zero	8
	.globl	f
	.align 8
	.type	f, @object
	.size	f, 8
f:
	.zero	8
	.globl	l
	.align 8
	.type	l, @object
	.size	l, 8
l:
	.zero	8
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

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

typedef struct element {
    struct element *next;
} element;

typedef struct {
    int n;
    element *head;
    element *tail;
} set;

int *l;
set **f;

element *elements;

void initialize(int n) {
    int i;

    l = calloc(n + 1, sizeof(int));
    f = calloc(n + 1, sizeof(set *));
    elements = calloc(n + 1, sizeof(element));

    for (i = 1; i <= n; i++) {
        f[i] = NULL;
    }
}

void new_pair(int x, int y) {
    set *s = malloc(sizeof(set));

    f[x] = f[y] = s;

    elements[x].next = &elements[y];
    elements[y].next = NULL;

    s->n = 2;
    s->head = &elements[x];
    s->tail = &elements[y];
}

void merge(set *s1, set *s2) {
    element *e;

    if (s1->n < s2->n) {
        merge(s2, s1);
        return;
    }

    /** s2が小さいのでs1に寄せる */
    for (e = s2->head; e; e = e->next) {
        f[e - elements] = s1;
    }

    s1->n += s2->n;
    s1->tail->next = s2->head;
    s1->tail = s2->tail;
}

void insert(int x, set *s) {
    f[x] = s;
    element *e = &elements[x];
    e->next = s->head;
    s->head = e;
    s->n++;
}

void add_pair(int x, int y) {
    set *f_x, *f_y;

    if ((f_x = f[x])) {
        if ((f_y = f[y])) {
            if (f_x != f_y) {
                merge(f_x, f_y);
            }
        } else {
            insert(y, f_x);
        }
    } else {
        if ((f_y = f[y])) {
            insert(x, f_y);
        } else {
            new_pair(x, y);
        }
    }
}

int movable(int from, int to) {
    if (from == to) {
        return !0;
    }

    return f[from] && f[to] && f[from] == f[to];
}

int main()
{
    int i;
    int n, m;
    int x, y;
    int r;

    scanf("%d %d", &n, &m);

    initialize(n);

    for (i = 1; i <= n; i++) {
        scanf("%d", &l[i]);
    }

    for (i = 1; i <= m; i++) {
        scanf("%d %d", &x, &y);
        add_pair(x, y);
    }

    r = 0;
    for (i = 1; i <= n; i++) {
        if (movable(i, l[i])) {
            r++;
        }
    }

    printf("%d\n", r);
    return 0;
}

5 2
5 3 1 4 2
1 3
5 4

2

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

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

typedef struct element {
    struct element *next;
} element;

typedef struct {
    int n;
    element *head;
    element *tail;
} set;

int *l;
set **f;

element *elements;

void initialize(int n) {
    int i;

    l = calloc(n + 1, sizeof(int));
    f = calloc(n + 1, sizeof(set *));
    elements = calloc(n + 1, sizeof(element));

    for (i = 1; i <= n; i++) {
        f[i] = NULL;
    }
}

void new_pair(int x, int y) {
    set *s = malloc(sizeof(set));

    f[x] = f[y] = s;

    elements[x].next = &elements[y];
    elements[y].next = NULL;

    s->n = 2;
    s->head = &elements[x];
    s->tail = &elements[y];
}

void merge(set *s1, set *s2) {
    element *e;

    if (s1->n < s2->n) {
        merge(s2, s1);
        return;
    }

    /** s2が小さいのでs1に寄せる */
    for (e = s2->head; e; e = e->next) {
        f[e - elements] = s1;
    }

    s1->n += s2->n;
    s1->tail->next = s2->head;
    s1->tail = s2->tail;
}

void insert(int x, set *s) {
    f[x] = s;
    element *e = &elements[x];
    e->next = s->head;
    s->head = e;
    s->n++;
}

void add_pair(int x, int y) {
    set *f_x, *f_y;

    if ((f_x = f[x])) {
        if ((f_y = f[y])) {
            if (f_x != f_y) {
                merge(f_x, f_y);
            }
        } else {
            insert(y, f_x);
        }
    } else {
        if ((f_y = f[y])) {
            insert(x, f_y);
        } else {
            new_pair(x, y);
        }
    }
}

int movable(int from, int to) {
    if (from == to) {
        return !0;
    }

    return f[from] && f[to] && f[from] == f[to];
}

int main()
{
    int i;
    int n, m;
    int x, y;
    int r;

    scanf("%d %d", &n, &m);

    initialize(n);

    for (i = 1; i <= n; i++) {
        scanf("%d", &l[i]);
    }

    for (i = 1; i <= m; i++) {
        scanf("%d %d", &x, &y);
        add_pair(x, y);
    }

    r = 0;
    for (i = 1; i <= n; i++) {
        if (movable(i, l[i])) {
            r++;
        }
    }

    printf("%d\n", r);
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	l
	.bss
	.align 8
	.type	l, @object
	.size	l, 8
l:
	.zero	8
	.globl	f
	.align 8
	.type	f, @object
	.size	f, 8
f:
	.zero	8
	.globl	elements
	.align 8
	.type	elements, @object
	.size	elements, 8
elements:
	.zero	8
	.text
	.globl	initialize
	.type	initialize, @function
initialize:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	-20(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, l(%rip)
	movl	-20(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$8, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, f(%rip)
	movl	-20(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$8, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, elements(%rip)
	movl	$1, -4(%rbp)
	jmp	.L2
.L3:
	movq	f(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	$0, (%rax)
	addl	$1, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jle	.L3
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	initialize, .-initialize
	.globl	new_pair
	.type	new_pair, @function
new_pair:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	$24, %edi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movq	f(%rip), %rdx
	movl	-24(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, (%rax)
	movq	f(%rip), %rcx
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	salq	$3, %rdx
	addq	%rcx, %rdx
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	movq	elements(%rip), %rdx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rsi
	movq	elements(%rip), %rcx
	movl	-20(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rcx, %rax
	addq	%rsi, %rdx
	movq	%rdx, (%rax)
	movq	elements(%rip), %rdx
	movl	-24(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	$0, (%rax)
	movq	-8(%rbp), %rax
	movl	$2, (%rax)
	movq	elements(%rip), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 8(%rax)
	movq	elements(%rip), %rdx
	movl	-24(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 16(%rax)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	new_pair, .-new_pair
	.globl	merge
	.type	merge, @function
merge:
.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
	movl	(%rax), %edx
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jge	.L6
	movq	-24(%rbp), %rdx
	movq	-32(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	merge
	jmp	.L5
.L6:
	movq	-32(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -8(%rbp)
	jmp	.L8
.L9:
	movq	f(%rip), %rdx
	movq	elements(%rip), %rcx
	movq	-8(%rbp), %rax
	subq	%rcx, %rax
	addq	%rax, %rdx
	movq	-24(%rbp), %rax
	movq	%rax, (%rdx)
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
.L8:
	cmpq	$0, -8(%rbp)
	jne	.L9
	movq	-24(%rbp), %rax
	movl	(%rax), %edx
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	addl	%eax, %edx
	movq	-24(%rbp), %rax
	movl	%edx, (%rax)
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	-32(%rbp), %rdx
	movq	8(%rdx), %rdx
	movq	%rdx, (%rax)
	movq	-32(%rbp), %rax
	movq	16(%rax), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, 16(%rax)
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	merge, .-merge
	.globl	insert
	.type	insert, @function
insert:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movq	%rsi, -32(%rbp)
	movq	f(%rip), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rax, %rdx
	movq	-32(%rbp), %rax
	movq	%rax, (%rdx)
	movq	elements(%rip), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	%rax, -8(%rbp)
	movq	-32(%rbp), %rax
	movq	8(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, (%rax)
	movq	-32(%rbp), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, 8(%rax)
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	leal	1(%rax), %edx
	movq	-32(%rbp), %rax
	movl	%edx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	insert, .-insert
	.globl	add_pair
	.type	add_pair, @function
add_pair:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movq	f(%rip), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
	cmpq	$0, -16(%rbp)
	je	.L12
	movq	f(%rip), %rdx
	movl	-24(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	je	.L13
	movq	-16(%rbp), %rax
	cmpq	-8(%rbp), %rax
	je	.L16
	movq	-8(%rbp), %rdx
	movq	-16(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	merge
	jmp	.L16
.L13:
	movq	-16(%rbp), %rdx
	movl	-24(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	insert
	jmp	.L16
.L12:
	movq	f(%rip), %rdx
	movl	-24(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	je	.L15
	movq	-8(%rbp), %rdx
	movl	-20(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	insert
	jmp	.L16
.L15:
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	new_pair
.L16:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	add_pair, .-add_pair
	.globl	movable
	.type	movable, @function
movable:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jne	.L18
	movl	$1, %eax
	jmp	.L19
.L18:
	movq	f(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	.L20
	movq	f(%rip), %rdx
	movl	-8(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	.L20
	movq	f(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	f(%rip), %rcx
	movl	-8(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jne	.L20
	movl	$1, %eax
	jmp	.L19
.L20:
	movl	$0, %eax
.L19:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	movable, .-movable
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %eax
	movl	%eax, %edi
	call	initialize
	movl	$1, -16(%rbp)
	jmp	.L23
.L24:
	movq	l(%rip), %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -16(%rbp)
.L23:
	movl	-32(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L24
	movl	$1, -16(%rbp)
	jmp	.L25
.L26:
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	add_pair
	addl	$1, -16(%rbp)
.L25:
	movl	-28(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L26
	movl	$0, -12(%rbp)
	movl	$1, -16(%rbp)
	jmp	.L27
.L29:
	movq	l(%rip), %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-16(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	movable
	testl	%eax, %eax
	je	.L28
	addl	$1, -12(%rbp)
.L28:
	addl	$1, -16(%rbp)
.L27:
	movl	-32(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L29
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.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	l
	.bss
	.align 8
	.type	l, @object
	.size	l, 8
l:
	.zero	8
	.globl	f
	.align 8
	.type	f, @object
	.size	f, 8
f:
	.zero	8
	.globl	elements
	.align 8
	.type	elements, @object
	.size	elements, 8
elements:
	.zero	8
	.text
	.globl	initialize
	.type	initialize, @function
initialize:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	-20(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, l(%rip)
	movl	-20(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$8, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, f(%rip)
	movl	-20(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$8, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, elements(%rip)
	movl	$1, -4(%rbp)
	jmp	.L2
.L3:
	movq	f(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	$0, (%rax)
	addl	$1, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jle	.L3
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	initialize, .-initialize
	.globl	new_pair
	.type	new_pair, @function
new_pair:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	$24, %edi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movq	f(%rip), %rdx
	movl	-24(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, (%rax)
	movq	f(%rip), %rcx
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	salq	$3, %rdx
	addq	%rcx, %rdx
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	movq	elements(%rip), %rdx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rsi
	movq	elements(%rip), %rcx
	movl	-20(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rcx, %rax
	addq	%rsi, %rdx
	movq	%rdx, (%rax)
	movq	elements(%rip), %rdx
	movl	-24(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	$0, (%rax)
	movq	-8(%rbp), %rax
	movl	$2, (%rax)
	movq	elements(%rip), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 8(%rax)
	movq	elements(%rip), %rdx
	movl	-24(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 16(%rax)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	new_pair, .-new_pair
	.globl	merge
	.type	merge, @function
merge:
.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
	movl	(%rax), %edx
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jge	.L6
	movq	-24(%rbp), %rdx
	movq	-32(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	merge
	jmp	.L5
.L6:
	movq	-32(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -8(%rbp)
	jmp	.L8
.L9:
	movq	f(%rip), %rdx
	movq	elements(%rip), %rcx
	movq	-8(%rbp), %rax
	subq	%rcx, %rax
	addq	%rax, %rdx
	movq	-24(%rbp), %rax
	movq	%rax, (%rdx)
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
.L8:
	cmpq	$0, -8(%rbp)
	jne	.L9
	movq	-24(%rbp), %rax
	movl	(%rax), %edx
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	addl	%eax, %edx
	movq	-24(%rbp), %rax
	movl	%edx, (%rax)
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	-32(%rbp), %rdx
	movq	8(%rdx), %rdx
	movq	%rdx, (%rax)
	movq	-32(%rbp), %rax
	movq	16(%rax), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, 16(%rax)
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	merge, .-merge
	.globl	insert
	.type	insert, @function
insert:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movq	%rsi, -32(%rbp)
	movq	f(%rip), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rax, %rdx
	movq	-32(%rbp), %rax
	movq	%rax, (%rdx)
	movq	elements(%rip), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	%rax, -8(%rbp)
	movq	-32(%rbp), %rax
	movq	8(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, (%rax)
	movq	-32(%rbp), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, 8(%rax)
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	leal	1(%rax), %edx
	movq	-32(%rbp), %rax
	movl	%edx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	insert, .-insert
	.globl	add_pair
	.type	add_pair, @function
add_pair:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movq	f(%rip), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
	cmpq	$0, -16(%rbp)
	je	.L12
	movq	f(%rip), %rdx
	movl	-24(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	je	.L13
	movq	-16(%rbp), %rax
	cmpq	-8(%rbp), %rax
	je	.L16
	movq	-8(%rbp), %rdx
	movq	-16(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	merge
	jmp	.L16
.L13:
	movq	-16(%rbp), %rdx
	movl	-24(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	insert
	jmp	.L16
.L12:
	movq	f(%rip), %rdx
	movl	-24(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	je	.L15
	movq	-8(%rbp), %rdx
	movl	-20(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	insert
	jmp	.L16
.L15:
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	new_pair
.L16:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	add_pair, .-add_pair
	.globl	movable
	.type	movable, @function
movable:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jne	.L18
	movl	$1, %eax
	jmp	.L19
.L18:
	movq	f(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	.L20
	movq	f(%rip), %rdx
	movl	-8(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	.L20
	movq	f(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	f(%rip), %rcx
	movl	-8(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jne	.L20
	movl	$1, %eax
	jmp	.L19
.L20:
	movl	$0, %eax
.L19:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	movable, .-movable
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %eax
	movl	%eax, %edi
	call	initialize
	movl	$1, -16(%rbp)
	jmp	.L23
.L24:
	movq	l(%rip), %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -16(%rbp)
.L23:
	movl	-32(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L24
	movl	$1, -16(%rbp)
	jmp	.L25
.L26:
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	add_pair
	addl	$1, -16(%rbp)
.L25:
	movl	-28(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L26
	movl	$0, -12(%rbp)
	movl	$1, -16(%rbp)
	jmp	.L27
.L29:
	movq	l(%rip), %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-16(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	movable
	testl	%eax, %eax
	je	.L28
	addl	$1, -12(%rbp)
.L28:
	addl	$1, -16(%rbp)
.L27:
	movl	-32(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L29
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.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:
