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

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

/* 全体でO((N+Q)√N) */

int main() {
	long N, L, Q, B;
	long x[100001];
	long i, j, k;
	long a, b, tmp;
	long move1day[100001];
	long moveBday[100001] = {0};
	long right;
	long ans[100001] = {0};
	
	scanf("%ld", &N);
	B = sqrt(N);
	for(i=1;i<=N;i++) scanf("%ld", &x[i]);
	scanf("%ld", &L);
	scanf("%ld", &Q);
	
	/* 各ホテルから1日でどこまでいけるか計算 O(N) */
	right = 2;
	for(i=1;i<=N;i++) {
		for(j=right;j<=N;j++) {
			if(x[j] - x[i] > L) {
				j--;
				break;
			}
		}
		move1day[i] = j;
		right = j;
	}
	
	/* 各ホテルから√N日でどこまでいけるか計算 O(N√N) */
	for(i=1;i<=N;i++) {
		k = i;
		for(j=0;j<B;j++) {
			if(k >= N) break;
			k = move1day[k];
		}
		if(j == B) moveBday[i] = k;
	}
	
	/* O(Q√N) */
	for(i=1;i<=Q;i++) {
		scanf("%ld %ld", &a, &b);
		if(a > b) { tmp = a; a = b; b = tmp; }
		
		/* まず√N日ずつ移動 */
		j = a;
		while(moveBday[j] > 0 && moveBday[j] < b) {
			j = moveBday[j];
			ans[i] += B;
		}
		
		/* 次に1日ずつ移動 */
		while(j < b) {
			j = move1day[j];
			ans[i]++;
		}
	}
	
	for(i=1;i<=Q;i++) printf("%ld\n", ans[i]);
	
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%ld"
.LC1:
	.string	"%ld %ld"
.LC2:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-3198976(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1184, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1600032(%rbp), %rax
	movl	$800008, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-800016(%rbp), %rax
	movl	$800008, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-3200152(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-3200152(%rbp), %rax
	pxor	%xmm1, %xmm1
	cvtsi2sdq	%rax, %xmm1
	movq	%xmm1, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -3200080(%rbp)
	movq	$1, -3200112(%rbp)
	jmp	.L2
.L3:
	leaq	-3200064(%rbp), %rdx
	movq	-3200112(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -3200112(%rbp)
.L2:
	movq	-3200152(%rbp), %rax
	cmpq	%rax, -3200112(%rbp)
	jle	.L3
	leaq	-3200144(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-3200136(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$2, -3200088(%rbp)
	movq	$1, -3200112(%rbp)
	jmp	.L4
.L9:
	movq	-3200088(%rbp), %rax
	movq	%rax, -3200104(%rbp)
	jmp	.L5
.L8:
	movq	-3200104(%rbp), %rax
	movq	-3200064(%rbp,%rax,8), %rdx
	movq	-3200112(%rbp), %rax
	movq	-3200064(%rbp,%rax,8), %rax
	subq	%rax, %rdx
	movq	-3200144(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L6
	subq	$1, -3200104(%rbp)
	jmp	.L7
.L6:
	addq	$1, -3200104(%rbp)
.L5:
	movq	-3200152(%rbp), %rax
	cmpq	%rax, -3200104(%rbp)
	jle	.L8
.L7:
	movq	-3200112(%rbp), %rax
	movq	-3200104(%rbp), %rdx
	movq	%rdx, -2400048(%rbp,%rax,8)
	movq	-3200104(%rbp), %rax
	movq	%rax, -3200088(%rbp)
	addq	$1, -3200112(%rbp)
.L4:
	movq	-3200152(%rbp), %rax
	cmpq	%rax, -3200112(%rbp)
	jle	.L9
	movq	$1, -3200112(%rbp)
	jmp	.L10
.L16:
	movq	-3200112(%rbp), %rax
	movq	%rax, -3200096(%rbp)
	movq	$0, -3200104(%rbp)
	jmp	.L11
.L14:
	movq	-3200152(%rbp), %rax
	cmpq	%rax, -3200096(%rbp)
	jge	.L29
	movq	-3200096(%rbp), %rax
	movq	-2400048(%rbp,%rax,8), %rax
	movq	%rax, -3200096(%rbp)
	addq	$1, -3200104(%rbp)
.L11:
	movq	-3200104(%rbp), %rax
	cmpq	-3200080(%rbp), %rax
	jl	.L14
	jmp	.L13
.L29:
	nop
.L13:
	movq	-3200104(%rbp), %rax
	cmpq	-3200080(%rbp), %rax
	jne	.L15
	movq	-3200112(%rbp), %rax
	movq	-3200096(%rbp), %rdx
	movq	%rdx, -1600032(%rbp,%rax,8)
.L15:
	addq	$1, -3200112(%rbp)
.L10:
	movq	-3200152(%rbp), %rax
	cmpq	%rax, -3200112(%rbp)
	jle	.L16
	movq	$1, -3200112(%rbp)
	jmp	.L17
.L24:
	leaq	-3200120(%rbp), %rdx
	leaq	-3200128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-3200128(%rbp), %rdx
	movq	-3200120(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L18
	movq	-3200128(%rbp), %rax
	movq	%rax, -3200072(%rbp)
	movq	-3200120(%rbp), %rax
	movq	%rax, -3200128(%rbp)
	movq	-3200072(%rbp), %rax
	movq	%rax, -3200120(%rbp)
.L18:
	movq	-3200128(%rbp), %rax
	movq	%rax, -3200104(%rbp)
	jmp	.L19
.L21:
	movq	-3200104(%rbp), %rax
	movq	-1600032(%rbp,%rax,8), %rax
	movq	%rax, -3200104(%rbp)
	movq	-3200112(%rbp), %rax
	movq	-800016(%rbp,%rax,8), %rdx
	movq	-3200080(%rbp), %rax
	addq	%rax, %rdx
	movq	-3200112(%rbp), %rax
	movq	%rdx, -800016(%rbp,%rax,8)
.L19:
	movq	-3200104(%rbp), %rax
	movq	-1600032(%rbp,%rax,8), %rax
	testq	%rax, %rax
	jle	.L22
	movq	-3200104(%rbp), %rax
	movq	-1600032(%rbp,%rax,8), %rdx
	movq	-3200120(%rbp), %rax
	cmpq	%rax, %rdx
	jl	.L21
	jmp	.L22
.L23:
	movq	-3200104(%rbp), %rax
	movq	-2400048(%rbp,%rax,8), %rax
	movq	%rax, -3200104(%rbp)
	movq	-3200112(%rbp), %rax
	movq	-800016(%rbp,%rax,8), %rax
	leaq	1(%rax), %rdx
	movq	-3200112(%rbp), %rax
	movq	%rdx, -800016(%rbp,%rax,8)
.L22:
	movq	-3200120(%rbp), %rax
	cmpq	%rax, -3200104(%rbp)
	jl	.L23
	addq	$1, -3200112(%rbp)
.L17:
	movq	-3200136(%rbp), %rax
	cmpq	%rax, -3200112(%rbp)
	jle	.L24
	movq	$1, -3200112(%rbp)
	jmp	.L25
.L26:
	movq	-3200112(%rbp), %rax
	movq	-800016(%rbp,%rax,8), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addq	$1, -3200112(%rbp)
.L25:
	movq	-3200136(%rbp), %rax
	cmpq	%rax, -3200112(%rbp)
	jle	.L26
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld"
.LC2:
	.string	"%ld %ld"
.LC3:
	.string	"%ld\n"
	.section	.text.unlikely,"ax",@progbits
.LCOLDB4:
	.section	.text.startup,"ax",@progbits
.LHOTB4:
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-3198976(%rsp), %r11
	.cfi_def_cfa 11, 3199032
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1160, %rsp
	.cfi_def_cfa_offset 3200192
	xorl	%esi, %esi
	movl	$800008, %edx
	leaq	.LC0(%rip), %r15
	leaq	1600096(%rsp), %rbp
	leaq	2400112(%rsp), %rbx
	movq	%fs:40, %rax
	movq	%rax, 3200120(%rsp)
	xorl	%eax, %eax
	movq	%rbp, %rdi
	call	memset@PLT
	xorl	%esi, %esi
	movl	$800008, %edx
	movq	%rbx, %rdi
	call	memset@PLT
	xorl	%eax, %eax
	leaq	24(%rsp), %rsi
	movq	%r15, %rdi
	call	__isoc99_scanf@PLT
	movq	24(%rsp), %rax
	pxor	%xmm0, %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdq	%rax, %xmm0
	ucomisd	%xmm0, %xmm1
	ja	.L60
	sqrtsd	%xmm0, %xmm0
.L4:
	cvttsd2siq	%xmm0, %r14
	leaq	72(%rsp), %r13
	movl	$1, %r12d
	testq	%rax, %rax
	jle	.L9
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r13, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	addq	$1, %r12
	call	__isoc99_scanf@PLT
	addq	$8, %r13
	cmpq	%r12, 24(%rsp)
	jge	.L8
.L9:
	leaq	32(%rsp), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	40(%rsp), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	24(%rsp), %rcx
	testq	%rcx, %rcx
	jle	.L7
	movl	$2, %eax
	movq	32(%rsp), %r8
	movl	$1, %r9d
	leaq	800080(%rsp), %r10
	cmpq	%rax, %rcx
	jl	.L68
	.p2align 4,,10
	.p2align 3
.L18:
	leaq	64(%rsp), %rsi
	movq	(%rsi,%r9,8), %rdi
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L10:
	addq	$1, %rax
	cmpq	%rcx, %rax
	jg	.L11
.L12:
	movq	(%rsi,%rax,8), %rdx
	subq	%rdi, %rdx
	cmpq	%r8, %rdx
	jle	.L10
	subq	$1, %rax
.L11:
	movq	%rax, (%r10,%r9,8)
	addq	$1, %r9
	cmpq	%r9, %rcx
	jl	.L42
	cmpq	%rax, %rcx
	jge	.L18
.L68:
	movq	%rax, (%r10,%r9,8)
	addq	$1, %r9
	cmpq	%r9, %rcx
	jge	.L69
.L42:
	cmpq	$1, %rcx
	je	.L70
.L16:
	movl	$1, %esi
	.p2align 4,,10
	.p2align 3
.L23:
	movq	%rsi, %rdx
	xorl	%eax, %eax
	testq	%r14, %r14
	jg	.L26
	jmp	.L71
	.p2align 4,,10
	.p2align 3
.L21:
	cmpq	%rcx, %rdx
	jge	.L20
.L26:
	addq	$1, %rax
	movq	800080(%rsp,%rdx,8), %rdx
	cmpq	%rax, %r14
	jne	.L21
.L22:
	movq	%rdx, 0(%rbp,%rsi,8)
.L20:
	addq	$1, %rsi
	cmpq	%rcx, %rsi
	jne	.L23
	.p2align 4,,10
	.p2align 3
.L25:
	testq	%r14, %r14
	je	.L72
.L24:
	addq	$1, %rsi
	cmpq	%rcx, %rsi
	jle	.L25
.L7:
	cmpq	$0, 40(%rsp)
	jle	.L39
	movl	$1, %ebp
	leaq	56(%rsp), %r13
	leaq	48(%rsp), %r12
	leaq	2400120(%rsp), %r15
	.p2align 4,,10
	.p2align 3
.L38:
	movq	%r12, %rsi
	leaq	.LC2(%rip), %rdi
	movq	%r13, %rdx
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	48(%rsp), %rdi
	movq	56(%rsp), %rsi
	cmpq	%rsi, %rdi
	jle	.L29
	movq	1600096(%rsp,%rsi,8), %rax
	movq	%rsi, 48(%rsp)
	movq	%rdi, 56(%rsp)
	testq	%rax, %rax
	jle	.L73
	movq	%rdi, %rdx
	movq	%rsi, %rdi
	movq	%rdx, %rsi
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L35:
	movq	(%r15), %rdx
	movq	1600096(%rsp,%rax,8), %rcx
	movq	%rax, %rdi
	addq	%r14, %rdx
	movq	%rdx, (%r15)
	testq	%rcx, %rcx
	jle	.L34
	movq	%rcx, %rax
.L33:
	cmpq	%rax, %rsi
	jg	.L35
.L32:
	cmpq	%rsi, %rdi
	jge	.L36
	movq	(%r15), %rdx
	movq	%rdi, %rax
.L34:
	addq	$1, %rdx
	.p2align 4,,10
	.p2align 3
.L37:
	movq	800080(%rsp,%rax,8), %rax
	movq	%rdx, %rcx
	addq	$1, %rdx
	cmpq	%rax, %rsi
	jg	.L37
	movq	%rcx, (%r15)
.L36:
	movq	40(%rsp), %rax
	addq	$1, %rbp
	addq	$8, %r15
	cmpq	%rbp, %rax
	jge	.L38
	testq	%rax, %rax
	jle	.L39
	movl	$1, %ebp
	leaq	.LC3(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L40:
	movq	(%rbx,%rbp,8), %rdx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__printf_chk@PLT
	cmpq	%rbp, 40(%rsp)
	jge	.L40
.L39:
	movq	3200120(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L74
	addq	$3200136, %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
.L29:
	.cfi_restore_state
	movq	1600096(%rsp,%rdi,8), %rax
	testq	%rax, %rax
	jg	.L33
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L72:
	movq	%rsi, 0(%rbp,%rsi,8)
	jmp	.L24
.L71:
	jne	.L20
	jmp	.L22
.L73:
	movq	%rsi, %rax
	movq	(%r15), %rdx
	movq	%rdi, %rsi
	jmp	.L34
.L69:
	jmp	.L41
.L70:
	movl	$1, %esi
	jmp	.L25
.L60:
	movq	%rax, 8(%rsp)
	call	sqrt@PLT
	movq	8(%rsp), %rax
	jmp	.L4
.L74:
	call	__stack_chk_fail@PLT
	.cfi_endproc
	.section	.text.unlikely
	.cfi_startproc
	.type	main.cold, @function
main.cold:
.LFSB51:
.L41:
	.cfi_def_cfa_offset 3200192
	.cfi_offset 3, -56
	.cfi_offset 6, -48
	.cfi_offset 12, -40
	.cfi_offset 13, -32
	.cfi_offset 14, -24
	.cfi_offset 15, -16
	leaq	1(%rcx), %rdx
	subq	%r9, %rdx
	cmpq	%r9, %rcx
	je	.L45
	movq	%rdx, %r8
	movq	%rax, %xmm0
	leaq	(%r10,%r9,8), %rdi
	xorl	%esi, %esi
	shrq	%r8
	punpcklqdq	%xmm0, %xmm0
.L14:
	movq	%rsi, %r10
	addq	$1, %rsi
	salq	$4, %r10
	movups	%xmm0, (%rdi,%r10)
	cmpq	%rsi, %r8
	jne	.L14
	movq	%rdx, %rsi
	andq	$-2, %rsi
	addq	%rsi, %r9
	cmpq	%rsi, %rdx
	je	.L75
.L13:
	movq	%rax, 800080(%rsp,%r9,8)
	jmp	.L16
.L45:
	movq	%rcx, %r9
	jmp	.L13
.L75:
	jmp	.L16
	.cfi_endproc
.LFE51:
	.section	.text.startup
	.size	main, .-main
	.section	.text.unlikely
	.size	main.cold, .-main.cold
.LCOLDE4:
	.section	.text.startup
.LHOTE4:
	.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	"%ld"
.LC2:
	.string	"%ld %ld"
.LC3:
	.string	"%ld\n"
	.section	.text.unlikely,"ax",@progbits
.LCOLDB4:
	.section	.text.startup,"ax",@progbits
.LHOTB4:
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-3198976(%rsp), %r11
	.cfi_def_cfa 11, 3199032
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1160, %rsp
	.cfi_def_cfa_offset 3200192
	xorl	%esi, %esi
	movl	$800008, %edx
	leaq	.LC0(%rip), %r15
	leaq	1600096(%rsp), %rbp
	leaq	2400112(%rsp), %rbx
	movq	%fs:40, %rax
	movq	%rax, 3200120(%rsp)
	xorl	%eax, %eax
	movq	%rbp, %rdi
	call	memset@PLT
	xorl	%esi, %esi
	movl	$800008, %edx
	movq	%rbx, %rdi
	call	memset@PLT
	xorl	%eax, %eax
	leaq	24(%rsp), %rsi
	movq	%r15, %rdi
	call	__isoc99_scanf@PLT
	movq	24(%rsp), %rax
	pxor	%xmm0, %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdq	%rax, %xmm0
	ucomisd	%xmm0, %xmm1
	ja	.L60
	sqrtsd	%xmm0, %xmm0
.L4:
	cvttsd2siq	%xmm0, %r14
	leaq	72(%rsp), %r13
	movl	$1, %r12d
	testq	%rax, %rax
	jle	.L9
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r13, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	addq	$1, %r12
	call	__isoc99_scanf@PLT
	addq	$8, %r13
	cmpq	%r12, 24(%rsp)
	jge	.L8
.L9:
	leaq	32(%rsp), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	40(%rsp), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	24(%rsp), %rcx
	testq	%rcx, %rcx
	jle	.L7
	movl	$2, %eax
	movq	32(%rsp), %r8
	movl	$1, %r9d
	leaq	800080(%rsp), %r10
	cmpq	%rax, %rcx
	jl	.L68
	.p2align 4,,10
	.p2align 3
.L18:
	leaq	64(%rsp), %rsi
	movq	(%rsi,%r9,8), %rdi
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L10:
	addq	$1, %rax
	cmpq	%rcx, %rax
	jg	.L11
.L12:
	movq	(%rsi,%rax,8), %rdx
	subq	%rdi, %rdx
	cmpq	%r8, %rdx
	jle	.L10
	subq	$1, %rax
.L11:
	movq	%rax, (%r10,%r9,8)
	addq	$1, %r9
	cmpq	%r9, %rcx
	jl	.L42
	cmpq	%rax, %rcx
	jge	.L18
.L68:
	movq	%rax, (%r10,%r9,8)
	addq	$1, %r9
	cmpq	%r9, %rcx
	jge	.L69
.L42:
	cmpq	$1, %rcx
	je	.L70
.L16:
	movl	$1, %esi
	.p2align 4,,10
	.p2align 3
.L23:
	movq	%rsi, %rdx
	xorl	%eax, %eax
	testq	%r14, %r14
	jg	.L26
	jmp	.L71
	.p2align 4,,10
	.p2align 3
.L21:
	cmpq	%rcx, %rdx
	jge	.L20
.L26:
	addq	$1, %rax
	movq	800080(%rsp,%rdx,8), %rdx
	cmpq	%rax, %r14
	jne	.L21
.L22:
	movq	%rdx, 0(%rbp,%rsi,8)
.L20:
	addq	$1, %rsi
	cmpq	%rcx, %rsi
	jne	.L23
	.p2align 4,,10
	.p2align 3
.L25:
	testq	%r14, %r14
	je	.L72
.L24:
	addq	$1, %rsi
	cmpq	%rcx, %rsi
	jle	.L25
.L7:
	cmpq	$0, 40(%rsp)
	jle	.L39
	movl	$1, %ebp
	leaq	56(%rsp), %r13
	leaq	48(%rsp), %r12
	leaq	2400120(%rsp), %r15
	.p2align 4,,10
	.p2align 3
.L38:
	movq	%r12, %rsi
	leaq	.LC2(%rip), %rdi
	movq	%r13, %rdx
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	48(%rsp), %rdi
	movq	56(%rsp), %rsi
	cmpq	%rsi, %rdi
	jle	.L29
	movq	1600096(%rsp,%rsi,8), %rax
	movq	%rsi, 48(%rsp)
	movq	%rdi, 56(%rsp)
	testq	%rax, %rax
	jle	.L73
	movq	%rdi, %rdx
	movq	%rsi, %rdi
	movq	%rdx, %rsi
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L35:
	movq	(%r15), %rdx
	movq	1600096(%rsp,%rax,8), %rcx
	movq	%rax, %rdi
	addq	%r14, %rdx
	movq	%rdx, (%r15)
	testq	%rcx, %rcx
	jle	.L34
	movq	%rcx, %rax
.L33:
	cmpq	%rax, %rsi
	jg	.L35
.L32:
	cmpq	%rsi, %rdi
	jge	.L36
	movq	(%r15), %rdx
	movq	%rdi, %rax
.L34:
	addq	$1, %rdx
	.p2align 4,,10
	.p2align 3
.L37:
	movq	800080(%rsp,%rax,8), %rax
	movq	%rdx, %rcx
	addq	$1, %rdx
	cmpq	%rax, %rsi
	jg	.L37
	movq	%rcx, (%r15)
.L36:
	movq	40(%rsp), %rax
	addq	$1, %rbp
	addq	$8, %r15
	cmpq	%rbp, %rax
	jge	.L38
	testq	%rax, %rax
	jle	.L39
	movl	$1, %ebp
	leaq	.LC3(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L40:
	movq	(%rbx,%rbp,8), %rdx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__printf_chk@PLT
	cmpq	%rbp, 40(%rsp)
	jge	.L40
.L39:
	movq	3200120(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L74
	addq	$3200136, %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
.L29:
	.cfi_restore_state
	movq	1600096(%rsp,%rdi,8), %rax
	testq	%rax, %rax
	jg	.L33
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L72:
	movq	%rsi, 0(%rbp,%rsi,8)
	jmp	.L24
.L71:
	jne	.L20
	jmp	.L22
.L73:
	movq	%rsi, %rax
	movq	(%r15), %rdx
	movq	%rdi, %rsi
	jmp	.L34
.L69:
	jmp	.L41
.L70:
	movl	$1, %esi
	jmp	.L25
.L60:
	movq	%rax, 8(%rsp)
	call	sqrt@PLT
	movq	8(%rsp), %rax
	jmp	.L4
.L74:
	call	__stack_chk_fail@PLT
	.cfi_endproc
	.section	.text.unlikely
	.cfi_startproc
	.type	main.cold, @function
main.cold:
.LFSB51:
.L41:
	.cfi_def_cfa_offset 3200192
	.cfi_offset 3, -56
	.cfi_offset 6, -48
	.cfi_offset 12, -40
	.cfi_offset 13, -32
	.cfi_offset 14, -24
	.cfi_offset 15, -16
	leaq	1(%rcx), %rdx
	subq	%r9, %rdx
	cmpq	%r9, %rcx
	je	.L45
	movq	%rdx, %r8
	movq	%rax, %xmm0
	leaq	(%r10,%r9,8), %rdi
	xorl	%esi, %esi
	shrq	%r8
	punpcklqdq	%xmm0, %xmm0
.L14:
	movq	%rsi, %r10
	addq	$1, %rsi
	salq	$4, %r10
	movups	%xmm0, (%rdi,%r10)
	cmpq	%rsi, %r8
	jne	.L14
	movq	%rdx, %rsi
	andq	$-2, %rsi
	addq	%rsi, %r9
	cmpq	%rsi, %rdx
	je	.L75
.L13:
	movq	%rax, 800080(%rsp,%r9,8)
	jmp	.L16
.L45:
	movq	%rcx, %r9
	jmp	.L13
.L75:
	jmp	.L16
	.cfi_endproc
.LFE51:
	.section	.text.startup
	.size	main, .-main
	.section	.text.unlikely
	.size	main.cold, .-main.cold
.LCOLDE4:
	.section	.text.startup
.LHOTE4:
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

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

/* 全体でO((N+Q)√N) */

int main() {
	long N, L, Q, B;
	long x[100001];
	long i, j, k;
	long a, b, tmp;
	long move1day[100001];
	long moveBday[100001] = {0};
	long right;
	long ans[100001] = {0};
	
	scanf("%ld", &N);
	B = sqrt(N);
	for(i=1;i<=N;i++) scanf("%ld", &x[i]);
	scanf("%ld", &L);
	scanf("%ld", &Q);
	
	/* 各ホテルから1日でどこまでいけるか計算 O(N) */
	right = 2;
	for(i=1;i<=N;i++) {
		for(j=right;j<=N;j++) {
			if(x[j] - x[i] > L) {
				j--;
				break;
			}
		}
		move1day[i] = j;
		right = j;
	}
	
	/* 各ホテルから√N日でどこまでいけるか計算 O(N√N) */
	for(i=1;i<=N;i++) {
		k = i;
		for(j=0;j<B;j++) {
			if(k >= N) break;
			k = move1day[k];
		}
		if(j == B) moveBday[i] = k;
	}
	
	/* O(Q√N) */
	for(i=1;i<=Q;i++) {
		scanf("%ld %ld", &a, &b);
		if(a > b) { tmp = a; a = b; b = tmp; }
		
		/* まず√N日ずつ移動 */
		j = a;
		while(moveBday[j] > 0 && moveBday[j] < b) {
			j = moveBday[j];
			ans[i] += B;
		}
		
		/* 次に1日ずつ移動 */
		while(j < b) {
			j = move1day[j];
			ans[i]++;
		}
	}
	
	for(i=1;i<=Q;i++) printf("%ld\n", ans[i]);
	
	return 0;
}
9
1 3 6 13 15 18 19 29 31
10
2
1 8
7 3
6 7
8 5
 9
1 6 6 13 23 18 19 29 31
10
3
1 8
7 3
6 7
8 10
 9
1 3 6 13 23 18 19 29 31
10
2
1 8
7 5
6 7
8 5
 9
1 3 6 13 23 18 19 29 31
10
2
1 9
7 3
6 7
8 10
 9
1 3 6 13 23 18 19 29 31
12
2
1 8
1 3
9 7
8 7
 9
1 3 6 13 23 18 19 29 31
12
2
1 8
1 5
9 7
8 7
 9
1 6 6 13 23 18 27 29 31
10
2
1 8
7 3
6 7
8 10
 9
1 3 6 13 23 18 19 29 31
10
3
1 9
7 3
6 7
8 10
 9
1 3 6 13 23 18 19 29 58
10
2
1 2
7 5
6 7
8 5
 9
1 7 6 13 23 18 19 29 31
18
3
1 8
7 3
6 7
8 10

4
2
 4
2
1
 4
1
 4
2
 3
1
 3
2
 4
3
 4
2
1
 1
1
 2
1
1

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

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

/* 全体でO((N+Q)√N) */

int main() {
	long N, L, Q, B;
	long x[100001];
	long i, j, k;
	long a, b, tmp;
	long move1day[100001];
	long moveBday[100001] = {0};
	long right;
	long ans[100001] = {0};
	
	scanf("%ld", &N);
	B = sqrt(N);
	for(i=1;i<=N;i++) scanf("%ld", &x[i]);
	scanf("%ld", &L);
	scanf("%ld", &Q);
	
	/* 各ホテルから1日でどこまでいけるか計算 O(N) */
	right = 2;
	for(i=1;i<=N;i++) {
		for(j=right;j<=N;j++) {
			if(x[j] - x[i] > L) {
				j--;
				break;
			}
		}
		move1day[i] = j;
		right = j;
	}
	
	/* 各ホテルから√N日でどこまでいけるか計算 O(N√N) */
	for(i=1;i<=N;i++) {
		k = i;
		for(j=0;j<B;j++) {
			if(k >= N) break;
			k = move1day[k];
		}
		if(j == B) moveBday[i] = k;
	}
	
	/* O(Q√N) */
	for(i=1;i<=Q;i++) {
		scanf("%ld %ld", &a, &b);
		if(a > b) { tmp = a; a = b; b = tmp; }
		
		/* まず√N日ずつ移動 */
		j = a;
		while(moveBday[j] > 0 && moveBday[j] < b) {
			j = moveBday[j];
			ans[i] += B;
		}
		
		/* 次に1日ずつ移動 */
		while(j < b) {
			j = move1day[j];
			ans[i]++;
		}
	}
	
	for(i=1;i<=Q;i++) printf("%ld\n", ans[i]);
	
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%ld"
.LC1:
	.string	"%ld %ld"
.LC2:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-3198976(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1184, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1600032(%rbp), %rax
	movl	$800008, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-800016(%rbp), %rax
	movl	$800008, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-3200152(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-3200152(%rbp), %rax
	pxor	%xmm1, %xmm1
	cvtsi2sdq	%rax, %xmm1
	movq	%xmm1, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -3200080(%rbp)
	movq	$1, -3200112(%rbp)
	jmp	.L2
.L3:
	leaq	-3200064(%rbp), %rdx
	movq	-3200112(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -3200112(%rbp)
.L2:
	movq	-3200152(%rbp), %rax
	cmpq	%rax, -3200112(%rbp)
	jle	.L3
	leaq	-3200144(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-3200136(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$2, -3200088(%rbp)
	movq	$1, -3200112(%rbp)
	jmp	.L4
.L9:
	movq	-3200088(%rbp), %rax
	movq	%rax, -3200104(%rbp)
	jmp	.L5
.L8:
	movq	-3200104(%rbp), %rax
	movq	-3200064(%rbp,%rax,8), %rdx
	movq	-3200112(%rbp), %rax
	movq	-3200064(%rbp,%rax,8), %rax
	subq	%rax, %rdx
	movq	-3200144(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L6
	subq	$1, -3200104(%rbp)
	jmp	.L7
.L6:
	addq	$1, -3200104(%rbp)
.L5:
	movq	-3200152(%rbp), %rax
	cmpq	%rax, -3200104(%rbp)
	jle	.L8
.L7:
	movq	-3200112(%rbp), %rax
	movq	-3200104(%rbp), %rdx
	movq	%rdx, -2400048(%rbp,%rax,8)
	movq	-3200104(%rbp), %rax
	movq	%rax, -3200088(%rbp)
	addq	$1, -3200112(%rbp)
.L4:
	movq	-3200152(%rbp), %rax
	cmpq	%rax, -3200112(%rbp)
	jle	.L9
	movq	$1, -3200112(%rbp)
	jmp	.L10
.L16:
	movq	-3200112(%rbp), %rax
	movq	%rax, -3200096(%rbp)
	movq	$0, -3200104(%rbp)
	jmp	.L11
.L14:
	movq	-3200152(%rbp), %rax
	cmpq	%rax, -3200096(%rbp)
	jge	.L29
	movq	-3200096(%rbp), %rax
	movq	-2400048(%rbp,%rax,8), %rax
	movq	%rax, -3200096(%rbp)
	addq	$1, -3200104(%rbp)
.L11:
	movq	-3200104(%rbp), %rax
	cmpq	-3200080(%rbp), %rax
	jl	.L14
	jmp	.L13
.L29:
	nop
.L13:
	movq	-3200104(%rbp), %rax
	cmpq	-3200080(%rbp), %rax
	jne	.L15
	movq	-3200112(%rbp), %rax
	movq	-3200096(%rbp), %rdx
	movq	%rdx, -1600032(%rbp,%rax,8)
.L15:
	addq	$1, -3200112(%rbp)
.L10:
	movq	-3200152(%rbp), %rax
	cmpq	%rax, -3200112(%rbp)
	jle	.L16
	movq	$1, -3200112(%rbp)
	jmp	.L17
.L24:
	leaq	-3200120(%rbp), %rdx
	leaq	-3200128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-3200128(%rbp), %rdx
	movq	-3200120(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L18
	movq	-3200128(%rbp), %rax
	movq	%rax, -3200072(%rbp)
	movq	-3200120(%rbp), %rax
	movq	%rax, -3200128(%rbp)
	movq	-3200072(%rbp), %rax
	movq	%rax, -3200120(%rbp)
.L18:
	movq	-3200128(%rbp), %rax
	movq	%rax, -3200104(%rbp)
	jmp	.L19
.L21:
	movq	-3200104(%rbp), %rax
	movq	-1600032(%rbp,%rax,8), %rax
	movq	%rax, -3200104(%rbp)
	movq	-3200112(%rbp), %rax
	movq	-800016(%rbp,%rax,8), %rdx
	movq	-3200080(%rbp), %rax
	addq	%rax, %rdx
	movq	-3200112(%rbp), %rax
	movq	%rdx, -800016(%rbp,%rax,8)
.L19:
	movq	-3200104(%rbp), %rax
	movq	-1600032(%rbp,%rax,8), %rax
	testq	%rax, %rax
	jle	.L22
	movq	-3200104(%rbp), %rax
	movq	-1600032(%rbp,%rax,8), %rdx
	movq	-3200120(%rbp), %rax
	cmpq	%rax, %rdx
	jl	.L21
	jmp	.L22
.L23:
	movq	-3200104(%rbp), %rax
	movq	-2400048(%rbp,%rax,8), %rax
	movq	%rax, -3200104(%rbp)
	movq	-3200112(%rbp), %rax
	movq	-800016(%rbp,%rax,8), %rax
	leaq	1(%rax), %rdx
	movq	-3200112(%rbp), %rax
	movq	%rdx, -800016(%rbp,%rax,8)
.L22:
	movq	-3200120(%rbp), %rax
	cmpq	%rax, -3200104(%rbp)
	jl	.L23
	addq	$1, -3200112(%rbp)
.L17:
	movq	-3200136(%rbp), %rax
	cmpq	%rax, -3200112(%rbp)
	jle	.L24
	movq	$1, -3200112(%rbp)
	jmp	.L25
.L26:
	movq	-3200112(%rbp), %rax
	movq	-800016(%rbp,%rax,8), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addq	$1, -3200112(%rbp)
.L25:
	movq	-3200136(%rbp), %rax
	cmpq	%rax, -3200112(%rbp)
	jle	.L26
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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
	.section	.rodata
.LC0:
	.string	"%ld"
.LC1:
	.string	"%ld %ld"
.LC2:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-3198976(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1184, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1600032(%rbp), %rax
	movl	$800008, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-800016(%rbp), %rax
	movl	$800008, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-3200152(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-3200152(%rbp), %rax
	pxor	%xmm1, %xmm1
	cvtsi2sdq	%rax, %xmm1
	movq	%xmm1, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -3200080(%rbp)
	movq	$1, -3200112(%rbp)
	jmp	.L2
.L3:
	leaq	-3200064(%rbp), %rdx
	movq	-3200112(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -3200112(%rbp)
.L2:
	movq	-3200152(%rbp), %rax
	cmpq	%rax, -3200112(%rbp)
	jle	.L3
	leaq	-3200144(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-3200136(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$2, -3200088(%rbp)
	movq	$1, -3200112(%rbp)
	jmp	.L4
.L9:
	movq	-3200088(%rbp), %rax
	movq	%rax, -3200104(%rbp)
	jmp	.L5
.L8:
	movq	-3200104(%rbp), %rax
	movq	-3200064(%rbp,%rax,8), %rdx
	movq	-3200112(%rbp), %rax
	movq	-3200064(%rbp,%rax,8), %rax
	subq	%rax, %rdx
	movq	-3200144(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L6
	subq	$1, -3200104(%rbp)
	jmp	.L7
.L6:
	addq	$1, -3200104(%rbp)
.L5:
	movq	-3200152(%rbp), %rax
	cmpq	%rax, -3200104(%rbp)
	jle	.L8
.L7:
	movq	-3200112(%rbp), %rax
	movq	-3200104(%rbp), %rdx
	movq	%rdx, -2400048(%rbp,%rax,8)
	movq	-3200104(%rbp), %rax
	movq	%rax, -3200088(%rbp)
	addq	$1, -3200112(%rbp)
.L4:
	movq	-3200152(%rbp), %rax
	cmpq	%rax, -3200112(%rbp)
	jle	.L9
	movq	$1, -3200112(%rbp)
	jmp	.L10
.L16:
	movq	-3200112(%rbp), %rax
	movq	%rax, -3200096(%rbp)
	movq	$0, -3200104(%rbp)
	jmp	.L11
.L14:
	movq	-3200152(%rbp), %rax
	cmpq	%rax, -3200096(%rbp)
	jge	.L29
	movq	-3200096(%rbp), %rax
	movq	-2400048(%rbp,%rax,8), %rax
	movq	%rax, -3200096(%rbp)
	addq	$1, -3200104(%rbp)
.L11:
	movq	-3200104(%rbp), %rax
	cmpq	-3200080(%rbp), %rax
	jl	.L14
	jmp	.L13
.L29:
	nop
.L13:
	movq	-3200104(%rbp), %rax
	cmpq	-3200080(%rbp), %rax
	jne	.L15
	movq	-3200112(%rbp), %rax
	movq	-3200096(%rbp), %rdx
	movq	%rdx, -1600032(%rbp,%rax,8)
.L15:
	addq	$1, -3200112(%rbp)
.L10:
	movq	-3200152(%rbp), %rax
	cmpq	%rax, -3200112(%rbp)
	jle	.L16
	movq	$1, -3200112(%rbp)
	jmp	.L17
.L24:
	leaq	-3200120(%rbp), %rdx
	leaq	-3200128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-3200128(%rbp), %rdx
	movq	-3200120(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L18
	movq	-3200128(%rbp), %rax
	movq	%rax, -3200072(%rbp)
	movq	-3200120(%rbp), %rax
	movq	%rax, -3200128(%rbp)
	movq	-3200072(%rbp), %rax
	movq	%rax, -3200120(%rbp)
.L18:
	movq	-3200128(%rbp), %rax
	movq	%rax, -3200104(%rbp)
	jmp	.L19
.L21:
	movq	-3200104(%rbp), %rax
	movq	-1600032(%rbp,%rax,8), %rax
	movq	%rax, -3200104(%rbp)
	movq	-3200112(%rbp), %rax
	movq	-800016(%rbp,%rax,8), %rdx
	movq	-3200080(%rbp), %rax
	addq	%rax, %rdx
	movq	-3200112(%rbp), %rax
	movq	%rdx, -800016(%rbp,%rax,8)
.L19:
	movq	-3200104(%rbp), %rax
	movq	-1600032(%rbp,%rax,8), %rax
	testq	%rax, %rax
	jle	.L22
	movq	-3200104(%rbp), %rax
	movq	-1600032(%rbp,%rax,8), %rdx
	movq	-3200120(%rbp), %rax
	cmpq	%rax, %rdx
	jl	.L21
	jmp	.L22
.L23:
	movq	-3200104(%rbp), %rax
	movq	-2400048(%rbp,%rax,8), %rax
	movq	%rax, -3200104(%rbp)
	movq	-3200112(%rbp), %rax
	movq	-800016(%rbp,%rax,8), %rax
	leaq	1(%rax), %rdx
	movq	-3200112(%rbp), %rax
	movq	%rdx, -800016(%rbp,%rax,8)
.L22:
	movq	-3200120(%rbp), %rax
	cmpq	%rax, -3200104(%rbp)
	jl	.L23
	addq	$1, -3200112(%rbp)
.L17:
	movq	-3200136(%rbp), %rax
	cmpq	%rax, -3200112(%rbp)
	jle	.L24
	movq	$1, -3200112(%rbp)
	jmp	.L25
.L26:
	movq	-3200112(%rbp), %rax
	movq	-800016(%rbp,%rax,8), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addq	$1, -3200112(%rbp)
.L25:
	movq	-3200136(%rbp), %rax
	cmpq	%rax, -3200112(%rbp)
	jle	.L26
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
