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

```c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h> // uint64_t

#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) > (b) ? (b) : (a))

int get_int(void) {
  int num;
  scanf("%d", &num);
  return num;
}

// <arr[0]> <arr[1]> .. <arr[size-1]>
int fget_array(int *arr, int size) {
    int i;
    for(i = 0; i < size; i++) {
        scanf("%d", &arr[i]);
    }
    return 0;
}

#define HASH_SIZE 65536

struct list {
    int val;
    int cnt;
    struct list *next;
};

struct list *create_htable(void) {
    static struct list htable[HASH_SIZE];
    int i;
    for(i = 0; i < HASH_SIZE; i++) {
        htable[i].next = &htable[i];
    }
    return htable;
}

int get_key(int val) {
    return val & (HASH_SIZE-1);
}

struct list* find(struct list *htable, int val) {
    struct list *head = &htable[get_key(val)];
    struct list *elem;
    for(elem = head->next; elem != head; elem = elem->next) {
        if(elem->val == val) {
            return elem;
        }
    }
    return NULL;
}

void add_elem(struct list *htable, int val) {
    struct list *elem = find(htable, val);
    struct list *head = &htable[get_key(val)];
    if(!elem) {
        // newly created
        elem = malloc(sizeof(struct list));
        elem->next = head->next;
        elem->val = val;
        elem->cnt = 0;
        head->next = elem;
    }
    elem->cnt++;
}

void put_elem(struct list *htable, int val) {
    struct list *elem = find(htable, val);
    // no way!!
    if(!elem) return;
    elem->cnt--;
}

#define NUM_MAX 200000

int main(void) {
    int num = get_int();
    static int arr[NUM_MAX];
    static int diff[NUM_MAX];

    fget_array(arr, num);
    int i;
    struct list *htable = create_htable();
    // a2 - h2 = h1 + a1 s.t. a1 < a2
    for(i = 0; i < num; i++) {
        // order - height
        diff[i] = (i+1) - arr[i];
        add_elem(htable, diff[i]);
    }

    int64_t ans = 0;
    for(i = 0; i < num; i++) {
        int sum = arr[i] + (i+1);
        put_elem(htable, diff[i]);
        // find within [i+1, num)
        struct list *elem = find(htable, sum);
        if(elem) ans += elem->cnt;
    }
    printf("%lld\n", ans);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	get_int
	.type	get_int, @function
get_int:
.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
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-12(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-12(%rbp), %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L3
	call	__stack_chk_fail@PLT
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	get_int, .-get_int
	.globl	fget_array
	.type	fget_array, @function
fget_array:
.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
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L5
.L6:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4(%rbp)
.L5:
	movl	-4(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L6
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	fget_array, .-fget_array
	.globl	create_htable
	.type	create_htable, @function
create_htable:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -4(%rbp)
	jmp	.L9
.L10:
	movl	-4(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	htable.2(%rip), %rax
	leaq	(%rdx,%rax), %rcx
	movl	-4(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+htable.2(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -4(%rbp)
.L9:
	cmpl	$65535, -4(%rbp)
	jle	.L10
	leaq	htable.2(%rip), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	create_htable, .-create_htable
	.globl	get_key
	.type	get_key, @function
get_key:
.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, -4(%rbp)
	movl	-4(%rbp), %eax
	movzwl	%ax, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	get_key, .-get_key
	.globl	find
	.type	find, @function
find:
.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
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, %edi
	call	get_key
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -16(%rbp)
	jmp	.L15
.L18:
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -28(%rbp)
	jne	.L16
	movq	-16(%rbp), %rax
	jmp	.L17
.L16:
	movq	-16(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -16(%rbp)
.L15:
	movq	-16(%rbp), %rax
	cmpq	-8(%rbp), %rax
	jne	.L18
	movl	$0, %eax
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	find, .-find
	.globl	add_elem
	.type	add_elem, @function
add_elem:
.LFB11:
	.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)
	movl	%esi, -28(%rbp)
	movl	-28(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	find
	movq	%rax, -16(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, %edi
	call	get_key
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, -8(%rbp)
	cmpq	$0, -16(%rbp)
	jne	.L20
	movl	$16, %edi
	call	malloc@PLT
	movq	%rax, -16(%rbp)
	movq	-8(%rbp), %rax
	movq	8(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	%rdx, 8(%rax)
	movq	-16(%rbp), %rax
	movl	-28(%rbp), %edx
	movl	%edx, (%rax)
	movq	-16(%rbp), %rax
	movl	$0, 4(%rax)
	movq	-8(%rbp), %rax
	movq	-16(%rbp), %rdx
	movq	%rdx, 8(%rax)
.L20:
	movq	-16(%rbp), %rax
	movl	4(%rax), %eax
	leal	1(%rax), %edx
	movq	-16(%rbp), %rax
	movl	%edx, 4(%rax)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	add_elem, .-add_elem
	.globl	put_elem
	.type	put_elem, @function
put_elem:
.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	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	-28(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	find
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	je	.L24
	movq	-8(%rbp), %rax
	movl	4(%rax), %eax
	leal	-1(%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, 4(%rax)
	jmp	.L21
.L24:
	nop
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	put_elem, .-put_elem
	.section	.rodata
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB13:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	call	get_int
	movl	%eax, -32(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, %esi
	leaq	arr.1(%rip), %rax
	movq	%rax, %rdi
	call	fget_array
	call	create_htable
	movq	%rax, -16(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L26
.L27:
	movl	-36(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	arr.1(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	%eax, %ecx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	diff.0(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	diff.0(%rip), %rax
	movl	(%rdx,%rax), %edx
	movq	-16(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	add_elem
	addl	$1, -36(%rbp)
.L26:
	movl	-36(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jl	.L27
	movq	$0, -24(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L28
.L30:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	arr.1(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-36(%rbp), %eax
	addl	$1, %eax
	addl	%edx, %eax
	movl	%eax, -28(%rbp)
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	diff.0(%rip), %rax
	movl	(%rdx,%rax), %edx
	movq	-16(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	put_elem
	movl	-28(%rbp), %edx
	movq	-16(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	find
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	je	.L29
	movq	-8(%rbp), %rax
	movl	4(%rax), %eax
	cltq
	addq	%rax, -24(%rbp)
.L29:
	addl	$1, -36(%rbp)
.L28:
	movl	-36(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jl	.L30
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	main, .-main
	.local	htable.2
	.comm	htable.2,1048576,32
	.local	arr.1
	.comm	arr.1,800000,32
	.local	diff.0
	.comm	diff.0,800000,32
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.text
	.p2align 4
	.globl	get_int
	.type	get_int, @function
get_int:
.LFB51:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	movq	8(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L5
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L5:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	get_int, .-get_int
	.p2align 4
	.globl	fget_array
	.type	fget_array, @function
fget_array:
.LFB52:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	jle	.L11
	leal	-1(%rsi), %eax
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	4(%rdi,%rax,4), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rdi, %rbx
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%r12, %rbx
	jne	.L8
	popq	%rbx
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE52:
	.size	fget_array, .-fget_array
	.p2align 4
	.globl	create_htable
	.type	create_htable, @function
create_htable:
.LFB53:
	.cfi_startproc
	endbr64
	movdqa	.LC3(%rip), %xmm3
	pxor	%xmm5, %xmm5
	leaq	htable.2(%rip), %r8
	movdqa	.LC1(%rip), %xmm4
	movdqa	%xmm5, %xmm6
	movq	%r8, %xmm7
	leaq	8(%r8), %rax
	movdqa	.LC2(%rip), %xmm8
	pcmpgtd	%xmm3, %xmm6
	punpcklqdq	%xmm7, %xmm7
	leaq	1048584(%r8), %rdx
	.p2align 4,,10
	.p2align 3
.L15:
	movdqa	%xmm4, %xmm0
	movdqa	%xmm5, %xmm2
	movdqa	%xmm6, %xmm9
	addq	$64, %rax
	movdqa	%xmm0, %xmm1
	paddd	%xmm8, %xmm4
	punpckldq	%xmm0, %xmm1
	punpckhdq	%xmm0, %xmm0
	pcmpgtd	%xmm1, %xmm2
	pmuludq	%xmm1, %xmm9
	pmuludq	%xmm3, %xmm1
	pmuludq	%xmm3, %xmm2
	paddq	%xmm9, %xmm2
	movdqa	%xmm6, %xmm9
	psllq	$32, %xmm2
	pmuludq	%xmm0, %xmm9
	paddq	%xmm2, %xmm1
	movdqa	%xmm5, %xmm2
	pcmpgtd	%xmm0, %xmm2
	pmuludq	%xmm3, %xmm0
	paddq	%xmm7, %xmm1
	movq	%xmm1, -64(%rax)
	movhps	%xmm1, -48(%rax)
	pmuludq	%xmm3, %xmm2
	paddq	%xmm9, %xmm2
	psllq	$32, %xmm2
	paddq	%xmm2, %xmm0
	paddq	%xmm7, %xmm0
	movq	%xmm0, -32(%rax)
	movhps	%xmm0, -16(%rax)
	cmpq	%rax, %rdx
	jne	.L15
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE53:
	.size	create_htable, .-create_htable
	.p2align 4
	.globl	get_key
	.type	get_key, @function
get_key:
.LFB54:
	.cfi_startproc
	endbr64
	movzwl	%di, %eax
	ret
	.cfi_endproc
.LFE54:
	.size	get_key, .-get_key
	.p2align 4
	.globl	find
	.type	find, @function
find:
.LFB55:
	.cfi_startproc
	endbr64
	movzwl	%si, %eax
	salq	$4, %rax
	addq	%rax, %rdi
	movq	8(%rdi), %rax
	cmpq	%rax, %rdi
	jne	.L20
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L23:
	movq	8(%rax), %rax
	cmpq	%rax, %rdi
	je	.L21
.L20:
	cmpl	%esi, (%rax)
	jne	.L23
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE55:
	.size	find, .-find
	.p2align 4
	.globl	add_elem
	.type	add_elem, @function
add_elem:
.LFB56:
	.cfi_startproc
	endbr64
	movzwl	%si, %eax
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	salq	$4, %rax
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	(%rdi,%rax), %rbx
	movq	8(%rbx), %r12
	cmpq	%r12, %rbx
	je	.L25
	movq	%r12, %rax
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L32:
	movq	8(%rax), %rax
	cmpq	%rax, %rbx
	je	.L25
.L27:
	cmpl	(%rax), %ebp
	jne	.L32
	movl	4(%rax), %ecx
	leal	1(%rcx), %edx
	movl	%edx, 4(%rax)
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L25:
	.cfi_restore_state
	movl	$16, %edi
	call	malloc@PLT
	movl	$1, %edx
	movl	$0, 4(%rax)
	movq	%rax, 8(%rbx)
	movq	%r12, 8(%rax)
	movl	%ebp, (%rax)
	movl	%edx, 4(%rax)
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE56:
	.size	add_elem, .-add_elem
	.p2align 4
	.globl	put_elem
	.type	put_elem, @function
put_elem:
.LFB57:
	.cfi_startproc
	endbr64
	movzwl	%si, %eax
	salq	$4, %rax
	addq	%rax, %rdi
	movq	8(%rdi), %rax
	cmpq	%rax, %rdi
	jne	.L36
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L39:
	movq	8(%rax), %rax
	cmpq	%rax, %rdi
	je	.L38
.L36:
	cmpl	(%rax), %esi
	jne	.L39
	subl	$1, 4(%rax)
.L33:
	ret
	.p2align 4,,10
	.p2align 3
.L38:
	ret
	.cfi_endproc
.LFE57:
	.size	put_elem, .-put_elem
	.section	.rodata.str1.1
.LC4:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB58:
	.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
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %rdi
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %r12d
	testl	%r12d, %r12d
	jle	.L44
	leaq	arr.1(%rip), %rbx
	leal	-1(%r12), %eax
	leaq	4(%rbx), %rdx
	leaq	(%rdx,%rax,4), %r13
	.p2align 4,,10
	.p2align 3
.L43:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%rbx, %r13
	jne	.L43
.L44:
	movdqa	.LC3(%rip), %xmm3
	pxor	%xmm5, %xmm5
	leaq	htable.2(%rip), %rbp
	movdqa	.LC1(%rip), %xmm4
	movdqa	%xmm5, %xmm6
	movq	%rbp, %xmm7
	leaq	8(%rbp), %rax
	movdqa	.LC2(%rip), %xmm8
	pcmpgtd	%xmm3, %xmm6
	punpcklqdq	%xmm7, %xmm7
	leaq	1048576(%rax), %rdx
	.p2align 4,,10
	.p2align 3
.L42:
	movdqa	%xmm4, %xmm0
	movdqa	%xmm5, %xmm2
	movdqa	%xmm6, %xmm9
	addq	$64, %rax
	movdqa	%xmm0, %xmm1
	paddd	%xmm8, %xmm4
	punpckldq	%xmm0, %xmm1
	punpckhdq	%xmm0, %xmm0
	pcmpgtd	%xmm1, %xmm2
	pmuludq	%xmm1, %xmm9
	pmuludq	%xmm3, %xmm1
	pmuludq	%xmm3, %xmm2
	paddq	%xmm9, %xmm2
	movdqa	%xmm6, %xmm9
	psllq	$32, %xmm2
	pmuludq	%xmm0, %xmm9
	paddq	%xmm2, %xmm1
	movdqa	%xmm5, %xmm2
	pcmpgtd	%xmm0, %xmm2
	pmuludq	%xmm3, %xmm0
	paddq	%xmm7, %xmm1
	movq	%xmm1, -64(%rax)
	movhps	%xmm1, -48(%rax)
	pmuludq	%xmm3, %xmm2
	paddq	%xmm9, %xmm2
	psllq	$32, %xmm2
	paddq	%xmm2, %xmm0
	paddq	%xmm7, %xmm0
	movq	%xmm0, -32(%rax)
	movhps	%xmm0, -16(%rax)
	cmpq	%rax, %rdx
	jne	.L42
	testl	%r12d, %r12d
	jle	.L59
	addl	$1, %r12d
	movl	$1, %edx
	leaq	-4+arr.1(%rip), %r14
	leaq	-4+diff.0(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L49:
	movl	%edx, %r15d
	subl	(%r14,%rdx,4), %r15d
	movzwl	%r15w, %ebx
	movl	%r15d, 0(%r13,%rdx,4)
	salq	$4, %rbx
	addq	%rbp, %rbx
	movq	8(%rbx), %rcx
	cmpq	%rcx, %rbx
	je	.L46
	movq	%rcx, %rax
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L69:
	movq	8(%rax), %rax
	cmpq	%rax, %rbx
	je	.L46
.L48:
	cmpl	(%rax), %r15d
	jne	.L69
	movl	4(%rax), %esi
	leal	1(%rsi), %ecx
.L57:
	addq	$1, %rdx
	movl	%ecx, 4(%rax)
	cmpq	%r12, %rdx
	jne	.L49
	movl	$1, %esi
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L56:
	movl	0(%r13,%rsi,4), %edi
	movl	(%r14,%rsi,4), %ecx
	movzwl	%di, %edx
	addl	%esi, %ecx
	salq	$4, %rdx
	addq	%rbp, %rdx
	movq	8(%rdx), %rax
	cmpq	%rax, %rdx
	jne	.L52
	jmp	.L50
	.p2align 4,,10
	.p2align 3
.L70:
	movq	8(%rax), %rax
	cmpq	%rax, %rdx
	je	.L50
.L52:
	cmpl	(%rax), %edi
	jne	.L70
	subl	$1, 4(%rax)
.L50:
	movzwl	%cx, %edx
	salq	$4, %rdx
	addq	%rbp, %rdx
	movq	8(%rdx), %rax
	cmpq	%rax, %rdx
	jne	.L55
	jmp	.L53
	.p2align 4,,10
	.p2align 3
.L71:
	movq	8(%rax), %rax
	cmpq	%rax, %rdx
	je	.L53
.L55:
	cmpl	(%rax), %ecx
	jne	.L71
	movslq	4(%rax), %rax
	addq	%rax, %r8
.L53:
	addq	$1, %rsi
	cmpq	%r12, %rsi
	jne	.L56
.L45:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC4(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L72
	addq	$40, %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
.L46:
	.cfi_restore_state
	movl	$16, %edi
	movq	%rdx, 8(%rsp)
	movq	%rcx, (%rsp)
	call	malloc@PLT
	movq	(%rsp), %rcx
	movq	8(%rsp), %rdx
	movl	%r15d, (%rax)
	movq	%rcx, 8(%rax)
	movl	$1, %ecx
	movl	$0, 4(%rax)
	movq	%rax, 8(%rbx)
	jmp	.L57
.L59:
	xorl	%r8d, %r8d
	jmp	.L45
.L72:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE58:
	.size	main, .-main
	.local	diff.0
	.comm	diff.0,800000,32
	.local	arr.1
	.comm	arr.1,800000,32
	.local	htable.2
	.comm	htable.2,1048576,32
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC2:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC3:
	.long	16
	.long	16
	.long	16
	.long	16
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.text
	.p2align 4
	.globl	get_int
	.type	get_int, @function
get_int:
.LFB51:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	movq	8(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L5
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L5:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	get_int, .-get_int
	.p2align 4
	.globl	fget_array
	.type	fget_array, @function
fget_array:
.LFB52:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	jle	.L11
	leal	-1(%rsi), %eax
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	4(%rdi,%rax,4), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rdi, %rbx
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%r12, %rbx
	jne	.L8
	popq	%rbx
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE52:
	.size	fget_array, .-fget_array
	.p2align 4
	.globl	create_htable
	.type	create_htable, @function
create_htable:
.LFB53:
	.cfi_startproc
	endbr64
	movdqa	.LC3(%rip), %xmm3
	pxor	%xmm5, %xmm5
	leaq	htable.2(%rip), %r8
	movdqa	.LC1(%rip), %xmm4
	movdqa	%xmm5, %xmm6
	movq	%r8, %xmm7
	leaq	8(%r8), %rax
	movdqa	.LC2(%rip), %xmm8
	pcmpgtd	%xmm3, %xmm6
	punpcklqdq	%xmm7, %xmm7
	leaq	1048584(%r8), %rdx
	.p2align 4,,10
	.p2align 3
.L15:
	movdqa	%xmm4, %xmm0
	movdqa	%xmm5, %xmm2
	movdqa	%xmm6, %xmm9
	addq	$64, %rax
	movdqa	%xmm0, %xmm1
	paddd	%xmm8, %xmm4
	punpckldq	%xmm0, %xmm1
	punpckhdq	%xmm0, %xmm0
	pcmpgtd	%xmm1, %xmm2
	pmuludq	%xmm1, %xmm9
	pmuludq	%xmm3, %xmm1
	pmuludq	%xmm3, %xmm2
	paddq	%xmm9, %xmm2
	movdqa	%xmm6, %xmm9
	psllq	$32, %xmm2
	pmuludq	%xmm0, %xmm9
	paddq	%xmm2, %xmm1
	movdqa	%xmm5, %xmm2
	pcmpgtd	%xmm0, %xmm2
	pmuludq	%xmm3, %xmm0
	paddq	%xmm7, %xmm1
	movq	%xmm1, -64(%rax)
	movhps	%xmm1, -48(%rax)
	pmuludq	%xmm3, %xmm2
	paddq	%xmm9, %xmm2
	psllq	$32, %xmm2
	paddq	%xmm2, %xmm0
	paddq	%xmm7, %xmm0
	movq	%xmm0, -32(%rax)
	movhps	%xmm0, -16(%rax)
	cmpq	%rax, %rdx
	jne	.L15
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE53:
	.size	create_htable, .-create_htable
	.p2align 4
	.globl	get_key
	.type	get_key, @function
get_key:
.LFB54:
	.cfi_startproc
	endbr64
	movzwl	%di, %eax
	ret
	.cfi_endproc
.LFE54:
	.size	get_key, .-get_key
	.p2align 4
	.globl	find
	.type	find, @function
find:
.LFB55:
	.cfi_startproc
	endbr64
	movzwl	%si, %eax
	salq	$4, %rax
	addq	%rax, %rdi
	movq	8(%rdi), %rax
	cmpq	%rax, %rdi
	jne	.L20
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L23:
	movq	8(%rax), %rax
	cmpq	%rax, %rdi
	je	.L21
.L20:
	cmpl	%esi, (%rax)
	jne	.L23
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE55:
	.size	find, .-find
	.p2align 4
	.globl	add_elem
	.type	add_elem, @function
add_elem:
.LFB56:
	.cfi_startproc
	endbr64
	movzwl	%si, %eax
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	salq	$4, %rax
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	(%rdi,%rax), %rbx
	movq	8(%rbx), %r12
	cmpq	%r12, %rbx
	je	.L25
	movq	%r12, %rax
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L32:
	movq	8(%rax), %rax
	cmpq	%rax, %rbx
	je	.L25
.L27:
	cmpl	(%rax), %ebp
	jne	.L32
	movl	4(%rax), %ecx
	leal	1(%rcx), %edx
	movl	%edx, 4(%rax)
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L25:
	.cfi_restore_state
	movl	$16, %edi
	call	malloc@PLT
	movl	$1, %edx
	movl	$0, 4(%rax)
	movq	%rax, 8(%rbx)
	movq	%r12, 8(%rax)
	movl	%ebp, (%rax)
	movl	%edx, 4(%rax)
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE56:
	.size	add_elem, .-add_elem
	.p2align 4
	.globl	put_elem
	.type	put_elem, @function
put_elem:
.LFB57:
	.cfi_startproc
	endbr64
	movzwl	%si, %eax
	salq	$4, %rax
	addq	%rax, %rdi
	movq	8(%rdi), %rax
	cmpq	%rax, %rdi
	jne	.L36
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L39:
	movq	8(%rax), %rax
	cmpq	%rax, %rdi
	je	.L38
.L36:
	cmpl	(%rax), %esi
	jne	.L39
	subl	$1, 4(%rax)
.L33:
	ret
	.p2align 4,,10
	.p2align 3
.L38:
	ret
	.cfi_endproc
.LFE57:
	.size	put_elem, .-put_elem
	.section	.rodata.str1.1
.LC4:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB58:
	.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
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %rdi
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %r12d
	testl	%r12d, %r12d
	jle	.L44
	leaq	arr.1(%rip), %rbx
	leal	-1(%r12), %eax
	leaq	4(%rbx), %rdx
	leaq	(%rdx,%rax,4), %r13
	.p2align 4,,10
	.p2align 3
.L43:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%rbx, %r13
	jne	.L43
.L44:
	movdqa	.LC3(%rip), %xmm3
	pxor	%xmm5, %xmm5
	leaq	htable.2(%rip), %rbp
	movdqa	.LC1(%rip), %xmm4
	movdqa	%xmm5, %xmm6
	movq	%rbp, %xmm7
	leaq	8(%rbp), %rax
	movdqa	.LC2(%rip), %xmm8
	pcmpgtd	%xmm3, %xmm6
	punpcklqdq	%xmm7, %xmm7
	leaq	1048576(%rax), %rdx
	.p2align 4,,10
	.p2align 3
.L42:
	movdqa	%xmm4, %xmm0
	movdqa	%xmm5, %xmm2
	movdqa	%xmm6, %xmm9
	addq	$64, %rax
	movdqa	%xmm0, %xmm1
	paddd	%xmm8, %xmm4
	punpckldq	%xmm0, %xmm1
	punpckhdq	%xmm0, %xmm0
	pcmpgtd	%xmm1, %xmm2
	pmuludq	%xmm1, %xmm9
	pmuludq	%xmm3, %xmm1
	pmuludq	%xmm3, %xmm2
	paddq	%xmm9, %xmm2
	movdqa	%xmm6, %xmm9
	psllq	$32, %xmm2
	pmuludq	%xmm0, %xmm9
	paddq	%xmm2, %xmm1
	movdqa	%xmm5, %xmm2
	pcmpgtd	%xmm0, %xmm2
	pmuludq	%xmm3, %xmm0
	paddq	%xmm7, %xmm1
	movq	%xmm1, -64(%rax)
	movhps	%xmm1, -48(%rax)
	pmuludq	%xmm3, %xmm2
	paddq	%xmm9, %xmm2
	psllq	$32, %xmm2
	paddq	%xmm2, %xmm0
	paddq	%xmm7, %xmm0
	movq	%xmm0, -32(%rax)
	movhps	%xmm0, -16(%rax)
	cmpq	%rax, %rdx
	jne	.L42
	testl	%r12d, %r12d
	jle	.L59
	addl	$1, %r12d
	movl	$1, %edx
	leaq	-4+arr.1(%rip), %r14
	leaq	-4+diff.0(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L49:
	movl	%edx, %r15d
	subl	(%r14,%rdx,4), %r15d
	movzwl	%r15w, %ebx
	movl	%r15d, 0(%r13,%rdx,4)
	salq	$4, %rbx
	addq	%rbp, %rbx
	movq	8(%rbx), %rcx
	cmpq	%rcx, %rbx
	je	.L46
	movq	%rcx, %rax
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L69:
	movq	8(%rax), %rax
	cmpq	%rax, %rbx
	je	.L46
.L48:
	cmpl	(%rax), %r15d
	jne	.L69
	movl	4(%rax), %esi
	leal	1(%rsi), %ecx
.L57:
	addq	$1, %rdx
	movl	%ecx, 4(%rax)
	cmpq	%r12, %rdx
	jne	.L49
	movl	$1, %esi
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L56:
	movl	0(%r13,%rsi,4), %edi
	movl	(%r14,%rsi,4), %ecx
	movzwl	%di, %edx
	addl	%esi, %ecx
	salq	$4, %rdx
	addq	%rbp, %rdx
	movq	8(%rdx), %rax
	cmpq	%rax, %rdx
	jne	.L52
	jmp	.L50
	.p2align 4,,10
	.p2align 3
.L70:
	movq	8(%rax), %rax
	cmpq	%rax, %rdx
	je	.L50
.L52:
	cmpl	(%rax), %edi
	jne	.L70
	subl	$1, 4(%rax)
.L50:
	movzwl	%cx, %edx
	salq	$4, %rdx
	addq	%rbp, %rdx
	movq	8(%rdx), %rax
	cmpq	%rax, %rdx
	jne	.L55
	jmp	.L53
	.p2align 4,,10
	.p2align 3
.L71:
	movq	8(%rax), %rax
	cmpq	%rax, %rdx
	je	.L53
.L55:
	cmpl	(%rax), %ecx
	jne	.L71
	movslq	4(%rax), %rax
	addq	%rax, %r8
.L53:
	addq	$1, %rsi
	cmpq	%r12, %rsi
	jne	.L56
.L45:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC4(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L72
	addq	$40, %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
.L46:
	.cfi_restore_state
	movl	$16, %edi
	movq	%rdx, 8(%rsp)
	movq	%rcx, (%rsp)
	call	malloc@PLT
	movq	(%rsp), %rcx
	movq	8(%rsp), %rdx
	movl	%r15d, (%rax)
	movq	%rcx, 8(%rax)
	movl	$1, %ecx
	movl	$0, 4(%rax)
	movq	%rax, 8(%rbx)
	jmp	.L57
.L59:
	xorl	%r8d, %r8d
	jmp	.L45
.L72:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE58:
	.size	main, .-main
	.local	diff.0
	.comm	diff.0,800000,32
	.local	arr.1
	.comm	arr.1,800000,32
	.local	htable.2
	.comm	htable.2,1048576,32
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC2:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC3:
	.long	16
	.long	16
	.long	16
	.long	16
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h> // uint64_t

#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) > (b) ? (b) : (a))

int get_int(void) {
  int num;
  scanf("%d", &num);
  return num;
}

// <arr[0]> <arr[1]> .. <arr[size-1]>
int fget_array(int *arr, int size) {
    int i;
    for(i = 0; i < size; i++) {
        scanf("%d", &arr[i]);
    }
    return 0;
}

#define HASH_SIZE 65536

struct list {
    int val;
    int cnt;
    struct list *next;
};

struct list *create_htable(void) {
    static struct list htable[HASH_SIZE];
    int i;
    for(i = 0; i < HASH_SIZE; i++) {
        htable[i].next = &htable[i];
    }
    return htable;
}

int get_key(int val) {
    return val & (HASH_SIZE-1);
}

struct list* find(struct list *htable, int val) {
    struct list *head = &htable[get_key(val)];
    struct list *elem;
    for(elem = head->next; elem != head; elem = elem->next) {
        if(elem->val == val) {
            return elem;
        }
    }
    return NULL;
}

void add_elem(struct list *htable, int val) {
    struct list *elem = find(htable, val);
    struct list *head = &htable[get_key(val)];
    if(!elem) {
        // newly created
        elem = malloc(sizeof(struct list));
        elem->next = head->next;
        elem->val = val;
        elem->cnt = 0;
        head->next = elem;
    }
    elem->cnt++;
}

void put_elem(struct list *htable, int val) {
    struct list *elem = find(htable, val);
    // no way!!
    if(!elem) return;
    elem->cnt--;
}

#define NUM_MAX 200000

int main(void) {
    int num = get_int();
    static int arr[NUM_MAX];
    static int diff[NUM_MAX];

    fget_array(arr, num);
    int i;
    struct list *htable = create_htable();
    // a2 - h2 = h1 + a1 s.t. a1 < a2
    for(i = 0; i < num; i++) {
        // order - height
        diff[i] = (i+1) - arr[i];
        add_elem(htable, diff[i]);
    }

    int64_t ans = 0;
    for(i = 0; i < num; i++) {
        int sum = arr[i] + (i+1);
        put_elem(htable, diff[i]);
        // find within [i+1, num)
        struct list *elem = find(htable, sum);
        if(elem) ans += elem->cnt;
    }
    printf("%lld\n", ans);
}
32
3 1 4 1 5 9 4 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 9 5
 32
3 1 4 1 5 9 4 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 2 5
 32
3 1 4 1 5 9 4 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 2 8
 32
3 1 4 1 5 9 4 12 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 2 8
 6
2 3 6 1 3 1
 32
3 1 4 1 8 9 4 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 2 8
 32
3 1 4 1 5 9 4 12 5 3 5 8 9 7 9 3 2 4 8 4 6 2 6 4 3 3 8 3 2 7 2 8
 32
2 1 4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 17 5
 32
2 1 4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 4 7 17 5
 32
3 1 4 1 8 11 8 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 3 7 2 14

23
 24
 25
 27
 3
 26
 28
 21
 19
 20

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

```c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h> // uint64_t

#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) > (b) ? (b) : (a))

int get_int(void) {
  int num;
  scanf("%d", &num);
  return num;
}

// <arr[0]> <arr[1]> .. <arr[size-1]>
int fget_array(int *arr, int size) {
    int i;
    for(i = 0; i < size; i++) {
        scanf("%d", &arr[i]);
    }
    return 0;
}

#define HASH_SIZE 65536

struct list {
    int val;
    int cnt;
    struct list *next;
};

struct list *create_htable(void) {
    static struct list htable[HASH_SIZE];
    int i;
    for(i = 0; i < HASH_SIZE; i++) {
        htable[i].next = &htable[i];
    }
    return htable;
}

int get_key(int val) {
    return val & (HASH_SIZE-1);
}

struct list* find(struct list *htable, int val) {
    struct list *head = &htable[get_key(val)];
    struct list *elem;
    for(elem = head->next; elem != head; elem = elem->next) {
        if(elem->val == val) {
            return elem;
        }
    }
    return NULL;
}

void add_elem(struct list *htable, int val) {
    struct list *elem = find(htable, val);
    struct list *head = &htable[get_key(val)];
    if(!elem) {
        // newly created
        elem = malloc(sizeof(struct list));
        elem->next = head->next;
        elem->val = val;
        elem->cnt = 0;
        head->next = elem;
    }
    elem->cnt++;
}

void put_elem(struct list *htable, int val) {
    struct list *elem = find(htable, val);
    // no way!!
    if(!elem) return;
    elem->cnt--;
}

#define NUM_MAX 200000

int main(void) {
    int num = get_int();
    static int arr[NUM_MAX];
    static int diff[NUM_MAX];

    fget_array(arr, num);
    int i;
    struct list *htable = create_htable();
    // a2 - h2 = h1 + a1 s.t. a1 < a2
    for(i = 0; i < num; i++) {
        // order - height
        diff[i] = (i+1) - arr[i];
        add_elem(htable, diff[i]);
    }

    int64_t ans = 0;
    for(i = 0; i < num; i++) {
        int sum = arr[i] + (i+1);
        put_elem(htable, diff[i]);
        // find within [i+1, num)
        struct list *elem = find(htable, sum);
        if(elem) ans += elem->cnt;
    }
    printf("%lld\n", ans);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	get_int
	.type	get_int, @function
get_int:
.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
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-12(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-12(%rbp), %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L3
	call	__stack_chk_fail@PLT
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	get_int, .-get_int
	.globl	fget_array
	.type	fget_array, @function
fget_array:
.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
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L5
.L6:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4(%rbp)
.L5:
	movl	-4(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L6
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	fget_array, .-fget_array
	.globl	create_htable
	.type	create_htable, @function
create_htable:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -4(%rbp)
	jmp	.L9
.L10:
	movl	-4(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	htable.2(%rip), %rax
	leaq	(%rdx,%rax), %rcx
	movl	-4(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+htable.2(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -4(%rbp)
.L9:
	cmpl	$65535, -4(%rbp)
	jle	.L10
	leaq	htable.2(%rip), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	create_htable, .-create_htable
	.globl	get_key
	.type	get_key, @function
get_key:
.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, -4(%rbp)
	movl	-4(%rbp), %eax
	movzwl	%ax, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	get_key, .-get_key
	.globl	find
	.type	find, @function
find:
.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
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, %edi
	call	get_key
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -16(%rbp)
	jmp	.L15
.L18:
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -28(%rbp)
	jne	.L16
	movq	-16(%rbp), %rax
	jmp	.L17
.L16:
	movq	-16(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -16(%rbp)
.L15:
	movq	-16(%rbp), %rax
	cmpq	-8(%rbp), %rax
	jne	.L18
	movl	$0, %eax
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	find, .-find
	.globl	add_elem
	.type	add_elem, @function
add_elem:
.LFB11:
	.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)
	movl	%esi, -28(%rbp)
	movl	-28(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	find
	movq	%rax, -16(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, %edi
	call	get_key
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, -8(%rbp)
	cmpq	$0, -16(%rbp)
	jne	.L20
	movl	$16, %edi
	call	malloc@PLT
	movq	%rax, -16(%rbp)
	movq	-8(%rbp), %rax
	movq	8(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	%rdx, 8(%rax)
	movq	-16(%rbp), %rax
	movl	-28(%rbp), %edx
	movl	%edx, (%rax)
	movq	-16(%rbp), %rax
	movl	$0, 4(%rax)
	movq	-8(%rbp), %rax
	movq	-16(%rbp), %rdx
	movq	%rdx, 8(%rax)
.L20:
	movq	-16(%rbp), %rax
	movl	4(%rax), %eax
	leal	1(%rax), %edx
	movq	-16(%rbp), %rax
	movl	%edx, 4(%rax)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	add_elem, .-add_elem
	.globl	put_elem
	.type	put_elem, @function
put_elem:
.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	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	-28(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	find
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	je	.L24
	movq	-8(%rbp), %rax
	movl	4(%rax), %eax
	leal	-1(%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, 4(%rax)
	jmp	.L21
.L24:
	nop
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	put_elem, .-put_elem
	.section	.rodata
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB13:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	call	get_int
	movl	%eax, -32(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, %esi
	leaq	arr.1(%rip), %rax
	movq	%rax, %rdi
	call	fget_array
	call	create_htable
	movq	%rax, -16(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L26
.L27:
	movl	-36(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	arr.1(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	%eax, %ecx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	diff.0(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	diff.0(%rip), %rax
	movl	(%rdx,%rax), %edx
	movq	-16(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	add_elem
	addl	$1, -36(%rbp)
.L26:
	movl	-36(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jl	.L27
	movq	$0, -24(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L28
.L30:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	arr.1(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-36(%rbp), %eax
	addl	$1, %eax
	addl	%edx, %eax
	movl	%eax, -28(%rbp)
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	diff.0(%rip), %rax
	movl	(%rdx,%rax), %edx
	movq	-16(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	put_elem
	movl	-28(%rbp), %edx
	movq	-16(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	find
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	je	.L29
	movq	-8(%rbp), %rax
	movl	4(%rax), %eax
	cltq
	addq	%rax, -24(%rbp)
.L29:
	addl	$1, -36(%rbp)
.L28:
	movl	-36(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jl	.L30
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	main, .-main
	.local	htable.2
	.comm	htable.2,1048576,32
	.local	arr.1
	.comm	arr.1,800000,32
	.local	diff.0
	.comm	diff.0,800000,32
	.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
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	get_int
	.type	get_int, @function
get_int:
.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
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-12(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-12(%rbp), %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L3
	call	__stack_chk_fail@PLT
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	get_int, .-get_int
	.globl	fget_array
	.type	fget_array, @function
fget_array:
.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
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L5
.L6:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4(%rbp)
.L5:
	movl	-4(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L6
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	fget_array, .-fget_array
	.globl	create_htable
	.type	create_htable, @function
create_htable:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -4(%rbp)
	jmp	.L9
.L10:
	movl	-4(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	htable.2(%rip), %rax
	leaq	(%rdx,%rax), %rcx
	movl	-4(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+htable.2(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -4(%rbp)
.L9:
	cmpl	$65535, -4(%rbp)
	jle	.L10
	leaq	htable.2(%rip), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	create_htable, .-create_htable
	.globl	get_key
	.type	get_key, @function
get_key:
.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, -4(%rbp)
	movl	-4(%rbp), %eax
	movzwl	%ax, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	get_key, .-get_key
	.globl	find
	.type	find, @function
find:
.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
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, %edi
	call	get_key
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -16(%rbp)
	jmp	.L15
.L18:
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -28(%rbp)
	jne	.L16
	movq	-16(%rbp), %rax
	jmp	.L17
.L16:
	movq	-16(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -16(%rbp)
.L15:
	movq	-16(%rbp), %rax
	cmpq	-8(%rbp), %rax
	jne	.L18
	movl	$0, %eax
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	find, .-find
	.globl	add_elem
	.type	add_elem, @function
add_elem:
.LFB11:
	.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)
	movl	%esi, -28(%rbp)
	movl	-28(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	find
	movq	%rax, -16(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, %edi
	call	get_key
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, -8(%rbp)
	cmpq	$0, -16(%rbp)
	jne	.L20
	movl	$16, %edi
	call	malloc@PLT
	movq	%rax, -16(%rbp)
	movq	-8(%rbp), %rax
	movq	8(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	%rdx, 8(%rax)
	movq	-16(%rbp), %rax
	movl	-28(%rbp), %edx
	movl	%edx, (%rax)
	movq	-16(%rbp), %rax
	movl	$0, 4(%rax)
	movq	-8(%rbp), %rax
	movq	-16(%rbp), %rdx
	movq	%rdx, 8(%rax)
.L20:
	movq	-16(%rbp), %rax
	movl	4(%rax), %eax
	leal	1(%rax), %edx
	movq	-16(%rbp), %rax
	movl	%edx, 4(%rax)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	add_elem, .-add_elem
	.globl	put_elem
	.type	put_elem, @function
put_elem:
.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	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	-28(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	find
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	je	.L24
	movq	-8(%rbp), %rax
	movl	4(%rax), %eax
	leal	-1(%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, 4(%rax)
	jmp	.L21
.L24:
	nop
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	put_elem, .-put_elem
	.section	.rodata
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB13:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	call	get_int
	movl	%eax, -32(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, %esi
	leaq	arr.1(%rip), %rax
	movq	%rax, %rdi
	call	fget_array
	call	create_htable
	movq	%rax, -16(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L26
.L27:
	movl	-36(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	arr.1(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	%eax, %ecx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	diff.0(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	diff.0(%rip), %rax
	movl	(%rdx,%rax), %edx
	movq	-16(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	add_elem
	addl	$1, -36(%rbp)
.L26:
	movl	-36(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jl	.L27
	movq	$0, -24(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L28
.L30:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	arr.1(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-36(%rbp), %eax
	addl	$1, %eax
	addl	%edx, %eax
	movl	%eax, -28(%rbp)
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	diff.0(%rip), %rax
	movl	(%rdx,%rax), %edx
	movq	-16(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	put_elem
	movl	-28(%rbp), %edx
	movq	-16(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	find
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	je	.L29
	movq	-8(%rbp), %rax
	movl	4(%rax), %eax
	cltq
	addq	%rax, -24(%rbp)
.L29:
	addl	$1, -36(%rbp)
.L28:
	movl	-36(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jl	.L30
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	main, .-main
	.local	htable.2
	.comm	htable.2,1048576,32
	.local	arr.1
	.comm	arr.1,800000,32
	.local	diff.0
	.comm	diff.0,800000,32
	.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:
