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 <inttypes.h>

#define INF 22222222

#define KI_MAX (1 << 18) /* 262144 */

int ki[KI_MAX * 2 - 1];

void ki_koutiku(void) {
	int i;
	for (i = (KI_MAX - 1) - 1; i >= 0; i--) {
		int l = ki[i * 2 + 1], r = ki[i * 2 + 2];
		ki[i] = l <= r ? l : r;
	}
}

int ki_get_i(int idx, int smin, int smax, int qmin, int qmax) {
	if (smax <= qmin || qmax <= smin) { /* クエリとセグメントが全く重ならない */
		return INF;
	} else if (qmin <= smin && smax <= qmax) { /* セグメントがクエリに完全に含まれる */
		return ki[idx];
	} else {
		int smid = smin + (smax - smin) / 2;
		int l = ki_get_i(idx * 2 + 1, smin, smid, qmin, qmax);
		int r = ki_get_i(idx * 2 + 2, smid, smax, qmin, qmax);
		return l <= r ? l : r;
	}
}

int ki_get(int qmin, int qmax) {
	return qmin < qmax ? ki_get_i(0, 0, KI_MAX, qmin, qmax) : INF;
}

int N;
int* a = ki + (KI_MAX - 1);

int basyo[222222];

int main(void) {
	int i, j;
	uint64_t kotae = 0;
	if (scanf("%d", &N) != 1) return 1;
	for (i = 1; i <= N; i++) {
		if (scanf("%d", &a[i]) != 1) return 1;
		basyo[a[i]] = i;
	}
	a[0] = 0;
	a[N + 1] = 0;
	ki_koutiku();
	for (i = 1; i <= N; i++) {
		int yes, no;
		int hidari, migi;

		no = 0; yes = basyo[i];
		while (no + 1 < yes) {
			int mid = no + (yes - no) / 2;
			if (ki_get(mid, basyo[i] + 1) >= i) yes = mid; else no = mid;
		}
		hidari = yes;

		yes = basyo[i]; no = N + 1;
		while (yes + 1 < no) {
			int mid = yes + (no - yes) / 2;
			if (ki_get(basyo[i], mid + 1) >= i) yes = mid; else no = mid;
		}
		migi = yes;

		kotae += (uint64_t)i * (uint64_t)(basyo[i] - hidari + 1) * (uint64_t)(migi - basyo[i] + 1);
	}
	printf("%" PRIu64 "\n", kotae);
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	ki
	.bss
	.align 32
	.type	ki, @object
	.size	ki, 2097148
ki:
	.zero	2097148
	.text
	.globl	ki_koutiku
	.type	ki_koutiku, @function
ki_koutiku:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$262142, -12(%rbp)
	jmp	.L2
.L3:
	movl	-12(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ki(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-12(%rbp), %eax
	addl	$1, %eax
	addl	%eax, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ki(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	ki(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	subl	$1, -12(%rbp)
.L2:
	cmpl	$0, -12(%rbp)
	jns	.L3
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	ki_koutiku, .-ki_koutiku
	.globl	ki_get_i
	.type	ki_get_i, @function
ki_get_i:
.LFB1:
	.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
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	%ecx, -32(%rbp)
	movl	%r8d, -36(%rbp)
	movl	-28(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L5
	movl	-36(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jg	.L6
.L5:
	movl	$22222222, %eax
	jmp	.L7
.L6:
	movl	-32(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jg	.L8
	movl	-28(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jg	.L8
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ki(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L7
.L8:
	movl	-28(%rbp), %eax
	subl	-24(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %edi
	movl	-36(%rbp), %esi
	movl	-32(%rbp), %ecx
	movl	-12(%rbp), %edx
	movl	-24(%rbp), %eax
	movl	%esi, %r8d
	movl	%eax, %esi
	call	ki_get_i
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %eax
	addl	$1, %eax
	leal	(%rax,%rax), %edi
	movl	-36(%rbp), %esi
	movl	-32(%rbp), %ecx
	movl	-28(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%esi, %r8d
	movl	%eax, %esi
	call	ki_get_i
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	ki_get_i, .-ki_get_i
	.globl	ki_get
	.type	ki_get, @function
ki_get:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L10
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %r8d
	movl	%eax, %ecx
	movl	$262144, %edx
	movl	$0, %esi
	movl	$0, %edi
	call	ki_get_i
	jmp	.L12
.L10:
	movl	$22222222, %eax
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	ki_get, .-ki_get
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	a
	.section	.data.rel.local,"aw"
	.align 8
	.type	a, @object
	.size	a, 8
a:
	.quad	ki+1048572
	.globl	basyo
	.bss
	.align 32
	.type	basyo, @object
	.size	basyo, 888888
basyo:
	.zero	888888
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lu\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.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
	movq	$0, -8(%rbp)
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L14
	movl	$1, %eax
	jmp	.L15
.L14:
	movl	$1, -36(%rbp)
	jmp	.L16
.L18:
	movq	a(%rip), %rdx
	movl	-36(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L17
	movl	$1, %eax
	jmp	.L15
.L17:
	movq	a(%rip), %rdx
	movl	-36(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	basyo(%rip), %rdx
	movl	-36(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	addl	$1, -36(%rbp)
.L16:
	movl	N(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L18
	movq	a(%rip), %rax
	movl	$0, (%rax)
	movq	a(%rip), %rdx
	movl	N(%rip), %eax
	cltq
	addq	$1, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	movl	$0, (%rax)
	call	ki_koutiku
	movl	$1, -36(%rbp)
	jmp	.L19
.L26:
	movl	$0, -28(%rbp)
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	basyo(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -32(%rbp)
	jmp	.L20
.L22:
	movl	-32(%rbp), %eax
	subl	-28(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	basyo(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	-12(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	ki_get
	cmpl	%eax, -36(%rbp)
	jg	.L21
	movl	-12(%rbp), %eax
	movl	%eax, -32(%rbp)
	jmp	.L20
.L21:
	movl	-12(%rbp), %eax
	movl	%eax, -28(%rbp)
.L20:
	movl	-28(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -32(%rbp)
	jg	.L22
	movl	-32(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	basyo(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -32(%rbp)
	movl	N(%rip), %eax
	addl	$1, %eax
	movl	%eax, -28(%rbp)
	jmp	.L23
.L25:
	movl	-28(%rbp), %eax
	subl	-32(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -16(%rbp)
	movl	-16(%rbp), %eax
	leal	1(%rax), %edx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	basyo(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	ki_get
	cmpl	%eax, -36(%rbp)
	jg	.L24
	movl	-16(%rbp), %eax
	movl	%eax, -32(%rbp)
	jmp	.L23
.L24:
	movl	-16(%rbp), %eax
	movl	%eax, -28(%rbp)
.L23:
	movl	-32(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -28(%rbp)
	jg	.L25
	movl	-32(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	basyo(%rip), %rax
	movl	(%rcx,%rax), %eax
	subl	-24(%rbp), %eax
	addl	$1, %eax
	cltq
	imulq	%rax, %rdx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	basyo(%rip), %rax
	movl	(%rcx,%rax), %ecx
	movl	-20(%rbp), %eax
	subl	%ecx, %eax
	addl	$1, %eax
	cltq
	imulq	%rdx, %rax
	addq	%rax, -8(%rbp)
	addl	$1, -36(%rbp)
.L19:
	movl	N(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L26
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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
	.type	ki_get_i.part.0, @function
ki_get_i.part.0:
.LFB27:
	.cfi_startproc
	movl	%edx, %eax
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leal	(%rdi,%rdi), %r9d
	subl	%esi, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	%edx, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%edi, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%ecx, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%eax, %ebp
	shrl	$31, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%r8d, %ebx
	addl	%eax, %ebp
	sarl	%ebp
	addl	%esi, %ebp
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	cmpl	%ecx, %ebp
	jle	.L10
	cmpl	%r8d, %esi
	jge	.L10
	leal	1(%r9), %edi
	cmpl	%ecx, %esi
	jl	.L3
	cmpl	%r8d, %ebp
	jg	.L3
	movslq	%edi, %rdi
	leaq	ki(%rip), %rax
	movl	(%rax,%rdi,4), %r15d
.L2:
	leal	1(%r13), %eax
	leal	2(%r9), %edx
	cmpl	%r12d, %r14d
	jle	.L11
.L41:
	cmpl	%ebx, %ebp
	jge	.L11
	cmpl	%r12d, %ebp
	setge	%cl
	cmpl	%ebx, %r14d
	setle	%r10b
	testb	%cl, %cl
	je	.L5
	testb	%r10b, %r10b
	je	.L5
	movslq	%edx, %rdx
	leaq	ki(%rip), %rax
	movl	(%rax,%rdx,4), %eax
.L4:
	cmpl	%r15d, %eax
	cmovg	%r15d, %eax
	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
.L3:
	.cfi_restore_state
	movl	%ebp, %edx
	movl	%ebx, %r8d
	movl	%r12d, %ecx
	movl	%r9d, 8(%rsp)
	call	ki_get_i.part.0
	movl	8(%rsp), %r9d
	movl	%eax, %r15d
	leal	1(%r13), %eax
	leal	2(%r9), %edx
	cmpl	%r12d, %r14d
	jg	.L41
	.p2align 4,,10
	.p2align 3
.L11:
	movl	$22222222, %eax
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%r14d, %edx
	leal	1(,%rax,4), %edi
	leal	6(%r9,%r9), %r9d
	subl	%ebp, %edx
	movl	%edx, %r13d
	shrl	$31, %r13d
	addl	%edx, %r13d
	sarl	%r13d
	addl	%ebp, %r13d
	cmpl	%r13d, %r12d
	jge	.L12
	cmpl	%r13d, %ebx
	jl	.L7
	testb	%cl, %cl
	je	.L7
	leaq	ki(%rip), %rax
	movslq	%edi, %rdi
	movl	(%rax,%rdi,4), %ebp
	movl	$22222222, %eax
	cmpl	%r13d, %ebx
	je	.L8
.L9:
	movl	%ebx, %r8d
	movl	%r12d, %ecx
	movl	%r14d, %edx
	movl	%r13d, %esi
	movl	%r9d, %edi
	call	ki_get_i.part.0
.L8:
	cmpl	%ebp, %eax
	cmovg	%ebp, %eax
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L10:
	movl	$22222222, %r15d
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%ebp, %esi
	movl	%ebx, %r8d
	movl	%r12d, %ecx
	movl	%r13d, %edx
	movb	%r10b, 15(%rsp)
	movl	%r9d, 8(%rsp)
	call	ki_get_i.part.0
	movl	8(%rsp), %r9d
	movzbl	15(%rsp), %r10d
	movl	%eax, %ebp
.L6:
	cmpl	%r13d, %ebx
	jle	.L14
	cmpl	%r13d, %r12d
	jg	.L9
	testb	%r10b, %r10b
	je	.L9
	movslq	%r9d, %r9
	leaq	ki(%rip), %rax
	movl	(%rax,%r9,4), %eax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L12:
	movl	$22222222, %ebp
	jmp	.L6
.L14:
	movl	$22222222, %eax
	jmp	.L8
	.cfi_endproc
.LFE27:
	.size	ki_get_i.part.0, .-ki_get_i.part.0
	.p2align 4
	.globl	ki_koutiku
	.type	ki_koutiku, @function
ki_koutiku:
.LFB23:
	.cfi_startproc
	endbr64
	leaq	1048568+ki(%rip), %rcx
	leaq	1048576(%rcx), %rdx
	leaq	-1048568(%rcx), %rdi
	.p2align 4,,10
	.p2align 3
.L43:
	movl	-4(%rdx), %eax
	movl	(%rdx), %esi
	cmpl	%esi, %eax
	cmovg	%esi, %eax
	subq	$8, %rdx
	movl	%eax, (%rcx)
	movq	%rcx, %rax
	subq	$4, %rcx
	cmpq	%rdi, %rax
	jne	.L43
	ret
	.cfi_endproc
.LFE23:
	.size	ki_koutiku, .-ki_koutiku
	.p2align 4
	.globl	ki_get_i
	.type	ki_get_i, @function
ki_get_i:
.LFB24:
	.cfi_startproc
	endbr64
	cmpl	%ecx, %edx
	jle	.L56
	cmpl	%esi, %r8d
	jle	.L56
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edi, %rax
	movl	%ecx, %r11d
	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
	movl	%edx, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	cmpl	%esi, %ecx
	setle	%dl
	cmpl	%r8d, %r12d
	setle	%r14b
	testb	%dl, %dl
	je	.L47
	testb	%r14b, %r14b
	je	.L47
	leaq	ki(%rip), %rdx
	movl	(%rdx,%rax,4), %eax
	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
.L47:
	.cfi_restore_state
	movl	%r12d, %ecx
	leal	(%rax,%rax), %r15d
	leal	1(%rax), %ebp
	subl	%esi, %ecx
	leal	1(%r15), %edi
	leal	2(%r15), %ebx
	movl	%ecx, %r13d
	shrl	$31, %r13d
	addl	%ecx, %r13d
	sarl	%r13d
	addl	%esi, %r13d
	cmpl	%r13d, %r11d
	jge	.L57
	cmpl	%r13d, %r8d
	setge	%al
	andb	%al, %dl
	je	.L49
	leaq	ki(%rip), %rax
	movslq	%edi, %rdi
	movl	(%rax,%rdi,4), %r10d
	movl	$22222222, %eax
	cmpl	%r13d, %r8d
	je	.L50
.L51:
	movl	%r12d, %eax
	leal	1(,%rbp,4), %edi
	leal	6(%r15,%r15), %r15d
	subl	%r13d, %eax
	movl	%eax, %r9d
	shrl	$31, %r9d
	addl	%eax, %r9d
	sarl	%r9d
	addl	%r13d, %r9d
	cmpl	%r9d, %r11d
	jge	.L60
	cmpl	%r9d, %r8d
	jl	.L53
	testb	%dl, %dl
	je	.L53
	leaq	ki(%rip), %rax
	movslq	%edi, %rdi
	movl	(%rax,%rdi,4), %ebp
	movl	$22222222, %eax
	cmpl	%r9d, %r8d
	je	.L54
.L55:
	movl	%r11d, %ecx
	movl	%r12d, %edx
	movl	%r9d, %esi
	movl	%r15d, %edi
	movl	%r10d, 4(%rsp)
	call	ki_get_i.part.0
	movl	4(%rsp), %r10d
.L54:
	cmpl	%eax, %ebp
	cmovle	%ebp, %eax
	jmp	.L50
	.p2align 4,,10
	.p2align 3
.L56:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	.cfi_restore 15
	movl	$22222222, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L49:
	.cfi_def_cfa_offset 80
	.cfi_offset 3, -56
	.cfi_offset 6, -48
	.cfi_offset 12, -40
	.cfi_offset 13, -32
	.cfi_offset 14, -24
	.cfi_offset 15, -16
	movl	%r11d, %ecx
	movl	%r13d, %edx
	movl	%r8d, 4(%rsp)
	call	ki_get_i.part.0
	movl	4(%rsp), %r8d
	movl	%eax, %r10d
.L48:
	cmpl	%r13d, %r8d
	jle	.L59
	cmpl	%r13d, %r11d
	setle	%al
	movl	%eax, %edx
	testb	%r14b, %r14b
	je	.L51
	testb	%al, %al
	je	.L51
	movslq	%ebx, %r9
	leaq	ki(%rip), %rax
	movl	(%rax,%r9,4), %eax
.L50:
	cmpl	%r10d, %eax
	cmovg	%r10d, %eax
	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
.L57:
	.cfi_restore_state
	movl	$22222222, %r10d
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L53:
	movl	%r9d, %edx
	movl	%r11d, %ecx
	movl	%r13d, %esi
	movl	%r10d, 12(%rsp)
	movl	%r8d, 8(%rsp)
	movl	%r9d, 4(%rsp)
	call	ki_get_i.part.0
	movl	4(%rsp), %r9d
	movl	8(%rsp), %r8d
	movl	12(%rsp), %r10d
	movl	%eax, %ebp
.L52:
	cmpl	%r9d, %r8d
	jle	.L62
	cmpl	%r9d, %r11d
	jg	.L55
	testb	%r14b, %r14b
	je	.L55
	movslq	%r15d, %r15
	leaq	ki(%rip), %rax
	movl	(%rax,%r15,4), %eax
	jmp	.L54
	.p2align 4,,10
	.p2align 3
.L60:
	movl	$22222222, %ebp
	jmp	.L52
.L59:
	movl	$22222222, %eax
	jmp	.L50
.L62:
	movl	$22222222, %eax
	jmp	.L54
	.cfi_endproc
.LFE24:
	.size	ki_get_i, .-ki_get_i
	.p2align 4
	.globl	ki_get
	.type	ki_get, @function
ki_get:
.LFB25:
	.cfi_startproc
	endbr64
	movl	$22222222, %eax
	cmpl	%esi, %edi
	jl	.L127
	ret
	.p2align 4,,10
	.p2align 3
.L127:
	movl	%edi, %r11d
	cmpl	$262143, %edi
	jg	.L124
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movl	%esi, %ebx
	testl	%esi, %esi
	jle	.L99
	testl	%edi, %edi
	setle	%al
	cmpl	$262143, %esi
	setg	%bpl
	testb	%al, %al
	je	.L93
	testb	%bpl, %bpl
	je	.L93
	movl	ki(%rip), %eax
.L91:
	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
.L93:
	.cfi_restore_state
	cmpl	$131071, %r11d
	jg	.L100
	cmpl	$131071, %ebx
	jle	.L95
	testb	%al, %al
	je	.L95
	movl	4+ki(%rip), %r12d
	movl	$22222222, %eax
	cmpl	$131072, %ebx
	jne	.L97
.L96:
	cmpl	%r12d, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	cmovg	%r12d, %eax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L99:
	.cfi_restore_state
	movl	$22222222, %eax
	jmp	.L91
	.p2align 4,,10
	.p2align 3
.L97:
	movl	%ebx, %r8d
	movl	%r11d, %ecx
	movl	$262144, %edx
	movl	$131072, %esi
	movl	$2, %edi
	call	ki_get_i.part.0
	jmp	.L96
	.p2align 4,,10
	.p2align 3
.L95:
	movl	%ebx, %r8d
	movl	%r11d, %ecx
	movl	$131072, %edx
	xorl	%esi, %esi
	movl	$1, %edi
	call	ki_get_i.part.0
	movl	%eax, %r12d
.L94:
	cmpl	$131072, %ebx
	jle	.L102
	cmpl	$131072, %r11d
	jg	.L97
	testb	%bpl, %bpl
	je	.L97
	movl	8+ki(%rip), %eax
	jmp	.L96
	.p2align 4,,10
	.p2align 3
.L100:
	movl	$22222222, %r12d
	jmp	.L94
	.p2align 4,,10
	.p2align 3
.L124:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	movl	$22222222, %eax
	ret
.L102:
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	.cfi_offset 6, -24
	.cfi_offset 12, -16
	movl	$22222222, %eax
	jmp	.L96
	.cfi_endproc
.LFE25:
	.size	ki_get, .-ki_get
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lu\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%eax, %eax
	leaq	N(%rip), %rsi
	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
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L133
	cmpl	$0, N(%rip)
	movl	%eax, %ebx
	movl	$4, %ebp
	movq	a(%rip), %rax
	leaq	basyo(%rip), %r13
	jg	.L131
.L134:
	movl	$0, (%rax)
	movslq	N(%rip), %rdx
	leaq	1048568+ki(%rip), %rcx
	movl	$0, 4(%rax,%rdx,4)
	leaq	1048576(%rcx), %rdx
	leaq	-2097144(%rdx), %rdi
	.p2align 4,,10
	.p2align 3
.L132:
	movl	-4(%rdx), %eax
	movl	(%rdx), %esi
	cmpl	%esi, %eax
	cmovg	%esi, %eax
	subq	$8, %rdx
	movl	%eax, (%rcx)
	movq	%rcx, %rax
	subq	$4, %rcx
	cmpq	%rax, %rdi
	jne	.L132
	movl	N(%rip), %eax
	movl	%eax, 28(%rsp)
	testl	%eax, %eax
	jle	.L180
	movl	12+ki(%rip), %edi
	addl	$1, %eax
	movl	$1, %r14d
	movq	$0, 16(%rsp)
	movl	%eax, 24(%rsp)
	movl	%edi, 36(%rsp)
	movl	16+ki(%rip), %edi
	movl	%edi, 32(%rsp)
	movl	4+ki(%rip), %edi
	movl	%edi, 8(%rsp)
	movl	20+ki(%rip), %edi
	movl	%edi, 44(%rsp)
	movl	24+ki(%rip), %edi
	movl	%edi, 40(%rsp)
	movl	8+ki(%rip), %edi
	movl	%edi, 4(%rsp)
	movl	ki(%rip), %edi
	movl	%edi, 12(%rsp)
	.p2align 4,,10
	.p2align 3
.L178:
	leaq	basyo(%rip), %rax
	xorl	%r12d, %r12d
	movl	(%rax,%r14,4), %ebp
	leal	1(%r12), %eax
	movl	%ebp, %ecx
	leal	1(%rbp), %r8d
	movl	%ebp, %r10d
	movl	12(%rsp), %ebp
	cmpl	%eax, %ecx
	jg	.L155
	jmp	.L270
	.p2align 4,,10
	.p2align 3
.L273:
	movl	%ebp, %ebx
	testb	%r13b, %r13b
	je	.L207
	cmpl	%r14d, %ebx
	jl	.L272
.L137:
	cmpl	$3, %r11d
	jle	.L270
.L155:
	movl	%ecx, %r11d
	movl	%ecx, %r15d
	subl	%r12d, %r11d
	movl	%r11d, %ecx
	shrl	$31, %ecx
	addl	%r11d, %ecx
	sarl	%ecx
	addl	%r12d, %ecx
	cmpl	%ecx, %r8d
	jle	.L137
	cmpl	$262143, %ecx
	jg	.L137
	testl	%r8d, %r8d
	jle	.L137
	testl	%ecx, %ecx
	setle	%al
	cmpl	$262143, %r8d
	setg	%r13b
	testb	%al, %al
	jne	.L273
.L207:
	cmpl	$131071, %ecx
	jg	.L182
	cmpl	$131071, %r8d
	movl	%eax, %edx
	setg	%bl
	andb	%bl, %dl
	je	.L141
	movl	8(%rsp), %r9d
	cmpl	$131072, %r8d
	jne	.L143
.L188:
	movl	$22222222, %ebx
.L142:
	cmpl	%r9d, %ebx
	cmovg	%r9d, %ebx
	cmpl	%r14d, %ebx
	jge	.L137
.L272:
	movl	%ecx, %r12d
	movl	%r15d, %ecx
	leal	1(%r12), %eax
	cmpl	%eax, %ecx
	jg	.L155
	.p2align 4,,10
	.p2align 3
.L270:
	movl	%r10d, %ebx
	movl	24(%rsp), %r12d
	movl	%ecx, %r11d
	movl	12(%rsp), %ebp
	leal	1(%rbx), %eax
	movl	%r10d, %ecx
	movl	%r11d, %r10d
	cmpl	%eax, %r12d
	jg	.L176
	jmp	.L271
	.p2align 4,,10
	.p2align 3
.L275:
	movl	%ebp, %r11d
	testb	%r13b, %r13b
	je	.L208
	cmpl	%r14d, %r11d
	jl	.L274
.L158:
	cmpl	%r12d, %r8d
	jge	.L271
.L176:
	movl	%r12d, %edx
	movl	%ebx, %r15d
	subl	%ebx, %edx
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	addl	%eax, %ebx
	leal	1(%rbx), %r8d
	cmpl	%ecx, %r8d
	jle	.L158
	cmpl	$262143, %ecx
	jg	.L158
	testl	%r8d, %r8d
	jle	.L158
	testl	%ecx, %ecx
	setle	%al
	cmpl	$262143, %r8d
	setg	%r13b
	testb	%al, %al
	jne	.L275
.L208:
	cmpl	$131071, %ecx
	jg	.L195
	cmpl	$131071, %r8d
	movl	%eax, %edx
	setg	%r11b
	andb	%r11b, %dl
	je	.L162
	movl	8(%rsp), %r11d
	cmpl	$131072, %r8d
	je	.L201
.L164:
	cmpl	$196607, %r8d
	jle	.L172
	testb	%dl, %dl
	je	.L172
	movl	44(%rsp), %r9d
	cmpl	$196608, %r8d
	jne	.L174
.L205:
	movl	$22222222, %eax
.L173:
	cmpl	%eax, %r9d
	cmovg	%eax, %r9d
.L163:
	cmpl	%r9d, %r11d
	cmovg	%r9d, %r11d
	cmpl	%r14d, %r11d
	jge	.L158
.L274:
	movl	%ebx, %r12d
	movl	%r15d, %ebx
	leal	1(%rbx), %eax
	cmpl	%eax, %r12d
	jg	.L176
	.p2align 4,,10
	.p2align 3
.L271:
	movl	%ecx, %eax
	subl	%ecx, %ebx
	subl	%r10d, %eax
	addl	$1, %eax
	cltq
	imulq	%r14, %rax
	addq	$1, %r14
	movq	%rax, %rdx
	leal	1(%rbx), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rax, 16(%rsp)
	cmpl	%r14d, 28(%rsp)
	jge	.L178
.L135:
	movq	16(%rsp), %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	jmp	.L128
	.p2align 4,,10
	.p2align 3
.L276:
	movq	a(%rip), %rax
	movslq	(%rax,%rbp), %rdx
	addq	$4, %rbp
	movl	%ebx, 0(%r13,%rdx,4)
	addl	$1, %ebx
	cmpl	%ebx, N(%rip)
	jl	.L134
.L131:
	leaq	(%rax,%rbp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L276
.L133:
	movl	$1, %eax
.L128:
	addq	$72, %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
.L201:
	.cfi_restore_state
	movl	$22222222, %r9d
	jmp	.L163
	.p2align 4,,10
	.p2align 3
.L162:
	cmpl	$65535, %ecx
	jg	.L197
	cmpl	$65535, %r8d
	jle	.L166
	testb	%al, %al
	je	.L166
	movl	36(%rsp), %r9d
	cmpl	$65536, %r8d
	jne	.L168
.L199:
	movl	$22222222, %eax
.L167:
	cmpl	%eax, %r9d
	cmovle	%r9d, %eax
	movl	%eax, %r11d
.L161:
	cmpl	$131072, %r8d
	jle	.L201
	cmpl	$131072, %ecx
	setle	%al
	movl	%eax, %edx
	testb	%r13b, %r13b
	je	.L209
	testb	%al, %al
	je	.L209
	movl	4(%rsp), %r9d
	jmp	.L163
	.p2align 4,,10
	.p2align 3
.L143:
	cmpl	$196607, %ecx
	jg	.L190
	cmpl	$196607, %r8d
	jle	.L151
	testb	%dl, %dl
	je	.L151
	movl	44(%rsp), %ebx
	cmpl	$196608, %r8d
	jne	.L153
.L192:
	movl	$22222222, %eax
.L152:
	cmpl	%eax, %ebx
	cmovg	%eax, %ebx
	jmp	.L142
	.p2align 4,,10
	.p2align 3
.L141:
	cmpl	$65535, %ecx
	jg	.L184
	cmpl	$65535, %r8d
	jle	.L145
	testb	%al, %al
	je	.L145
	movl	36(%rsp), %r9d
	cmpl	$65536, %r8d
	jne	.L147
.L186:
	movl	$22222222, %eax
.L146:
	cmpl	%eax, %r9d
	cmovg	%eax, %r9d
.L140:
	cmpl	$131072, %r8d
	jle	.L188
	cmpl	$131072, %ecx
	setle	%al
	movl	%eax, %edx
	testb	%r13b, %r13b
	je	.L143
	testb	%al, %al
	je	.L143
	movl	4(%rsp), %ebx
	jmp	.L142
	.p2align 4,,10
	.p2align 3
.L195:
	movl	$22222222, %r11d
	jmp	.L161
	.p2align 4,,10
	.p2align 3
.L182:
	movl	$22222222, %r9d
	jmp	.L140
.L172:
	movl	$196608, %edx
	movl	$131072, %esi
	movl	$5, %edi
	movl	%r10d, 56(%rsp)
	movl	%r8d, 52(%rsp)
	movl	%ecx, 48(%rsp)
	call	ki_get_i.part.0
	movl	56(%rsp), %r10d
	movl	52(%rsp), %r8d
	movl	48(%rsp), %ecx
	movl	%eax, %r9d
.L171:
	cmpl	$196608, %r8d
	jle	.L205
	cmpl	$196608, %ecx
	jg	.L174
	movl	40(%rsp), %eax
	testb	%r13b, %r13b
	jne	.L173
.L174:
	movl	$262144, %edx
	movl	$196608, %esi
	movl	$6, %edi
	movl	%r10d, 60(%rsp)
	movl	%r9d, 56(%rsp)
	movl	%r8d, 52(%rsp)
	movl	%ecx, 48(%rsp)
	call	ki_get_i.part.0
	movl	48(%rsp), %ecx
	movl	52(%rsp), %r8d
	movl	56(%rsp), %r9d
	movl	60(%rsp), %r10d
	jmp	.L173
.L145:
	movl	$65536, %edx
	xorl	%esi, %esi
	movl	$3, %edi
	movl	%ecx, 48(%rsp)
	movl	%r10d, 56(%rsp)
	movl	%r8d, 52(%rsp)
	call	ki_get_i.part.0
	movl	48(%rsp), %ecx
	movl	52(%rsp), %r8d
	movl	56(%rsp), %r10d
	movl	%eax, %r9d
.L144:
	cmpl	$65536, %r8d
	jle	.L186
	cmpl	$65536, %ecx
	jg	.L147
	movl	32(%rsp), %eax
	testb	%bl, %bl
	jne	.L146
.L147:
	movl	$131072, %edx
	movl	$65536, %esi
	movl	$4, %edi
	movl	%r10d, 60(%rsp)
	movl	%r9d, 56(%rsp)
	movl	%r8d, 52(%rsp)
	movl	%ecx, 48(%rsp)
	call	ki_get_i.part.0
	movl	48(%rsp), %ecx
	movl	52(%rsp), %r8d
	movl	56(%rsp), %r9d
	movl	60(%rsp), %r10d
	jmp	.L146
.L151:
	movl	$196608, %edx
	movl	$131072, %esi
	movl	$5, %edi
	movl	%r10d, 60(%rsp)
	movl	%r9d, 56(%rsp)
	movl	%r8d, 52(%rsp)
	movl	%ecx, 48(%rsp)
	call	ki_get_i.part.0
	movl	48(%rsp), %ecx
	movl	52(%rsp), %r8d
	movl	56(%rsp), %r9d
	movl	60(%rsp), %r10d
	movl	%eax, %ebx
.L150:
	cmpl	$196608, %r8d
	jle	.L192
	cmpl	$196608, %ecx
	jg	.L153
	movl	40(%rsp), %eax
	testb	%r13b, %r13b
	jne	.L152
.L153:
	movl	$262144, %edx
	movl	$196608, %esi
	movl	$6, %edi
	movl	%r10d, 60(%rsp)
	movl	%r9d, 56(%rsp)
	movl	%r8d, 52(%rsp)
	movl	%ecx, 48(%rsp)
	call	ki_get_i.part.0
	movl	48(%rsp), %ecx
	movl	52(%rsp), %r8d
	movl	56(%rsp), %r9d
	movl	60(%rsp), %r10d
	jmp	.L152
.L166:
	movl	$65536, %edx
	xorl	%esi, %esi
	movl	$3, %edi
	movl	%ecx, 48(%rsp)
	movl	%r10d, 56(%rsp)
	movl	%r8d, 52(%rsp)
	call	ki_get_i.part.0
	movl	48(%rsp), %ecx
	movl	52(%rsp), %r8d
	movl	56(%rsp), %r10d
	movl	%eax, %r9d
.L165:
	cmpl	$65536, %r8d
	jle	.L199
	cmpl	$65536, %ecx
	jg	.L168
	movl	32(%rsp), %eax
	testb	%r11b, %r11b
	jne	.L167
.L168:
	movl	$131072, %edx
	movl	$65536, %esi
	movl	$4, %edi
	movl	%r10d, 60(%rsp)
	movl	%r9d, 56(%rsp)
	movl	%r8d, 52(%rsp)
	movl	%ecx, 48(%rsp)
	call	ki_get_i.part.0
	movl	48(%rsp), %ecx
	movl	52(%rsp), %r8d
	movl	56(%rsp), %r9d
	movl	60(%rsp), %r10d
	jmp	.L167
.L209:
	movl	$22222222, %r9d
	cmpl	$196607, %ecx
	jg	.L171
	jmp	.L164
.L197:
	movl	$22222222, %r9d
	jmp	.L165
.L184:
	movl	$22222222, %r9d
	jmp	.L144
.L190:
	movl	$22222222, %ebx
	jmp	.L150
.L180:
	movq	$0, 16(%rsp)
	jmp	.L135
	.cfi_endproc
.LFE26:
	.size	main, .-main
	.globl	basyo
	.bss
	.align 32
	.type	basyo, @object
	.size	basyo, 888888
basyo:
	.zero	888888
	.globl	a
	.section	.data.rel.local,"aw"
	.align 8
	.type	a, @object
	.size	a, 8
a:
	.quad	ki+1048572
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	ki
	.align 32
	.type	ki, @object
	.size	ki, 2097148
ki:
	.zero	2097148
	.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
	.type	ki_get_i.part.0, @function
ki_get_i.part.0:
.LFB27:
	.cfi_startproc
	movl	%edx, %eax
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leal	(%rdi,%rdi), %r9d
	subl	%esi, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	%edx, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%edi, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%ecx, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%eax, %ebp
	shrl	$31, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%r8d, %ebx
	addl	%eax, %ebp
	sarl	%ebp
	addl	%esi, %ebp
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	cmpl	%ecx, %ebp
	jle	.L10
	cmpl	%r8d, %esi
	jge	.L10
	leal	1(%r9), %edi
	cmpl	%ecx, %esi
	jl	.L3
	cmpl	%r8d, %ebp
	jg	.L3
	movslq	%edi, %rdi
	leaq	ki(%rip), %rax
	movl	(%rax,%rdi,4), %r15d
.L2:
	leal	1(%r13), %eax
	leal	2(%r9), %edx
	cmpl	%r12d, %r14d
	jle	.L11
.L41:
	cmpl	%ebx, %ebp
	jge	.L11
	cmpl	%r12d, %ebp
	setge	%cl
	cmpl	%ebx, %r14d
	setle	%r10b
	testb	%cl, %cl
	je	.L5
	testb	%r10b, %r10b
	je	.L5
	movslq	%edx, %rdx
	leaq	ki(%rip), %rax
	movl	(%rax,%rdx,4), %eax
.L4:
	cmpl	%r15d, %eax
	cmovg	%r15d, %eax
	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
.L3:
	.cfi_restore_state
	movl	%ebp, %edx
	movl	%ebx, %r8d
	movl	%r12d, %ecx
	movl	%r9d, 8(%rsp)
	call	ki_get_i.part.0
	movl	8(%rsp), %r9d
	movl	%eax, %r15d
	leal	1(%r13), %eax
	leal	2(%r9), %edx
	cmpl	%r12d, %r14d
	jg	.L41
	.p2align 4,,10
	.p2align 3
.L11:
	movl	$22222222, %eax
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%r14d, %edx
	leal	1(,%rax,4), %edi
	leal	6(%r9,%r9), %r9d
	subl	%ebp, %edx
	movl	%edx, %r13d
	shrl	$31, %r13d
	addl	%edx, %r13d
	sarl	%r13d
	addl	%ebp, %r13d
	cmpl	%r13d, %r12d
	jge	.L12
	cmpl	%r13d, %ebx
	jl	.L7
	testb	%cl, %cl
	je	.L7
	leaq	ki(%rip), %rax
	movslq	%edi, %rdi
	movl	(%rax,%rdi,4), %ebp
	movl	$22222222, %eax
	cmpl	%r13d, %ebx
	je	.L8
.L9:
	movl	%ebx, %r8d
	movl	%r12d, %ecx
	movl	%r14d, %edx
	movl	%r13d, %esi
	movl	%r9d, %edi
	call	ki_get_i.part.0
.L8:
	cmpl	%ebp, %eax
	cmovg	%ebp, %eax
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L10:
	movl	$22222222, %r15d
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%ebp, %esi
	movl	%ebx, %r8d
	movl	%r12d, %ecx
	movl	%r13d, %edx
	movb	%r10b, 15(%rsp)
	movl	%r9d, 8(%rsp)
	call	ki_get_i.part.0
	movl	8(%rsp), %r9d
	movzbl	15(%rsp), %r10d
	movl	%eax, %ebp
.L6:
	cmpl	%r13d, %ebx
	jle	.L14
	cmpl	%r13d, %r12d
	jg	.L9
	testb	%r10b, %r10b
	je	.L9
	movslq	%r9d, %r9
	leaq	ki(%rip), %rax
	movl	(%rax,%r9,4), %eax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L12:
	movl	$22222222, %ebp
	jmp	.L6
.L14:
	movl	$22222222, %eax
	jmp	.L8
	.cfi_endproc
.LFE27:
	.size	ki_get_i.part.0, .-ki_get_i.part.0
	.p2align 4
	.globl	ki_koutiku
	.type	ki_koutiku, @function
ki_koutiku:
.LFB23:
	.cfi_startproc
	endbr64
	leaq	1048568+ki(%rip), %rcx
	leaq	1048576(%rcx), %rdx
	leaq	-1048568(%rcx), %rdi
	.p2align 4,,10
	.p2align 3
.L43:
	movl	-4(%rdx), %eax
	movl	(%rdx), %esi
	cmpl	%esi, %eax
	cmovg	%esi, %eax
	subq	$8, %rdx
	movl	%eax, (%rcx)
	movq	%rcx, %rax
	subq	$4, %rcx
	cmpq	%rdi, %rax
	jne	.L43
	ret
	.cfi_endproc
.LFE23:
	.size	ki_koutiku, .-ki_koutiku
	.p2align 4
	.globl	ki_get_i
	.type	ki_get_i, @function
ki_get_i:
.LFB24:
	.cfi_startproc
	endbr64
	cmpl	%ecx, %edx
	jle	.L56
	cmpl	%esi, %r8d
	jle	.L56
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edi, %rax
	movl	%ecx, %r11d
	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
	movl	%edx, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	cmpl	%esi, %ecx
	setle	%dl
	cmpl	%r8d, %r12d
	setle	%r14b
	testb	%dl, %dl
	je	.L47
	testb	%r14b, %r14b
	je	.L47
	leaq	ki(%rip), %rdx
	movl	(%rdx,%rax,4), %eax
	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
.L47:
	.cfi_restore_state
	movl	%r12d, %ecx
	leal	(%rax,%rax), %r15d
	leal	1(%rax), %ebp
	subl	%esi, %ecx
	leal	1(%r15), %edi
	leal	2(%r15), %ebx
	movl	%ecx, %r13d
	shrl	$31, %r13d
	addl	%ecx, %r13d
	sarl	%r13d
	addl	%esi, %r13d
	cmpl	%r13d, %r11d
	jge	.L57
	cmpl	%r13d, %r8d
	setge	%al
	andb	%al, %dl
	je	.L49
	leaq	ki(%rip), %rax
	movslq	%edi, %rdi
	movl	(%rax,%rdi,4), %r10d
	movl	$22222222, %eax
	cmpl	%r13d, %r8d
	je	.L50
.L51:
	movl	%r12d, %eax
	leal	1(,%rbp,4), %edi
	leal	6(%r15,%r15), %r15d
	subl	%r13d, %eax
	movl	%eax, %r9d
	shrl	$31, %r9d
	addl	%eax, %r9d
	sarl	%r9d
	addl	%r13d, %r9d
	cmpl	%r9d, %r11d
	jge	.L60
	cmpl	%r9d, %r8d
	jl	.L53
	testb	%dl, %dl
	je	.L53
	leaq	ki(%rip), %rax
	movslq	%edi, %rdi
	movl	(%rax,%rdi,4), %ebp
	movl	$22222222, %eax
	cmpl	%r9d, %r8d
	je	.L54
.L55:
	movl	%r11d, %ecx
	movl	%r12d, %edx
	movl	%r9d, %esi
	movl	%r15d, %edi
	movl	%r10d, 4(%rsp)
	call	ki_get_i.part.0
	movl	4(%rsp), %r10d
.L54:
	cmpl	%eax, %ebp
	cmovle	%ebp, %eax
	jmp	.L50
	.p2align 4,,10
	.p2align 3
.L56:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	.cfi_restore 15
	movl	$22222222, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L49:
	.cfi_def_cfa_offset 80
	.cfi_offset 3, -56
	.cfi_offset 6, -48
	.cfi_offset 12, -40
	.cfi_offset 13, -32
	.cfi_offset 14, -24
	.cfi_offset 15, -16
	movl	%r11d, %ecx
	movl	%r13d, %edx
	movl	%r8d, 4(%rsp)
	call	ki_get_i.part.0
	movl	4(%rsp), %r8d
	movl	%eax, %r10d
.L48:
	cmpl	%r13d, %r8d
	jle	.L59
	cmpl	%r13d, %r11d
	setle	%al
	movl	%eax, %edx
	testb	%r14b, %r14b
	je	.L51
	testb	%al, %al
	je	.L51
	movslq	%ebx, %r9
	leaq	ki(%rip), %rax
	movl	(%rax,%r9,4), %eax
.L50:
	cmpl	%r10d, %eax
	cmovg	%r10d, %eax
	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
.L57:
	.cfi_restore_state
	movl	$22222222, %r10d
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L53:
	movl	%r9d, %edx
	movl	%r11d, %ecx
	movl	%r13d, %esi
	movl	%r10d, 12(%rsp)
	movl	%r8d, 8(%rsp)
	movl	%r9d, 4(%rsp)
	call	ki_get_i.part.0
	movl	4(%rsp), %r9d
	movl	8(%rsp), %r8d
	movl	12(%rsp), %r10d
	movl	%eax, %ebp
.L52:
	cmpl	%r9d, %r8d
	jle	.L62
	cmpl	%r9d, %r11d
	jg	.L55
	testb	%r14b, %r14b
	je	.L55
	movslq	%r15d, %r15
	leaq	ki(%rip), %rax
	movl	(%rax,%r15,4), %eax
	jmp	.L54
	.p2align 4,,10
	.p2align 3
.L60:
	movl	$22222222, %ebp
	jmp	.L52
.L59:
	movl	$22222222, %eax
	jmp	.L50
.L62:
	movl	$22222222, %eax
	jmp	.L54
	.cfi_endproc
.LFE24:
	.size	ki_get_i, .-ki_get_i
	.p2align 4
	.globl	ki_get
	.type	ki_get, @function
ki_get:
.LFB25:
	.cfi_startproc
	endbr64
	movl	$22222222, %eax
	cmpl	%esi, %edi
	jl	.L127
	ret
	.p2align 4,,10
	.p2align 3
.L127:
	movl	%edi, %r11d
	cmpl	$262143, %edi
	jg	.L124
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movl	%esi, %ebx
	testl	%esi, %esi
	jle	.L99
	testl	%edi, %edi
	setle	%al
	cmpl	$262143, %esi
	setg	%bpl
	testb	%al, %al
	je	.L93
	testb	%bpl, %bpl
	je	.L93
	movl	ki(%rip), %eax
.L91:
	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
.L93:
	.cfi_restore_state
	cmpl	$131071, %r11d
	jg	.L100
	cmpl	$131071, %ebx
	jle	.L95
	testb	%al, %al
	je	.L95
	movl	4+ki(%rip), %r12d
	movl	$22222222, %eax
	cmpl	$131072, %ebx
	jne	.L97
.L96:
	cmpl	%r12d, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	cmovg	%r12d, %eax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L99:
	.cfi_restore_state
	movl	$22222222, %eax
	jmp	.L91
	.p2align 4,,10
	.p2align 3
.L97:
	movl	%ebx, %r8d
	movl	%r11d, %ecx
	movl	$262144, %edx
	movl	$131072, %esi
	movl	$2, %edi
	call	ki_get_i.part.0
	jmp	.L96
	.p2align 4,,10
	.p2align 3
.L95:
	movl	%ebx, %r8d
	movl	%r11d, %ecx
	movl	$131072, %edx
	xorl	%esi, %esi
	movl	$1, %edi
	call	ki_get_i.part.0
	movl	%eax, %r12d
.L94:
	cmpl	$131072, %ebx
	jle	.L102
	cmpl	$131072, %r11d
	jg	.L97
	testb	%bpl, %bpl
	je	.L97
	movl	8+ki(%rip), %eax
	jmp	.L96
	.p2align 4,,10
	.p2align 3
.L100:
	movl	$22222222, %r12d
	jmp	.L94
	.p2align 4,,10
	.p2align 3
.L124:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	movl	$22222222, %eax
	ret
.L102:
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	.cfi_offset 6, -24
	.cfi_offset 12, -16
	movl	$22222222, %eax
	jmp	.L96
	.cfi_endproc
.LFE25:
	.size	ki_get, .-ki_get
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lu\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%eax, %eax
	leaq	N(%rip), %rsi
	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
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L133
	cmpl	$0, N(%rip)
	movl	%eax, %ebx
	movl	$4, %ebp
	movq	a(%rip), %rax
	leaq	basyo(%rip), %r13
	jg	.L131
.L134:
	movl	$0, (%rax)
	movslq	N(%rip), %rdx
	leaq	1048568+ki(%rip), %rcx
	movl	$0, 4(%rax,%rdx,4)
	leaq	1048576(%rcx), %rdx
	leaq	-2097144(%rdx), %rdi
	.p2align 4,,10
	.p2align 3
.L132:
	movl	-4(%rdx), %eax
	movl	(%rdx), %esi
	cmpl	%esi, %eax
	cmovg	%esi, %eax
	subq	$8, %rdx
	movl	%eax, (%rcx)
	movq	%rcx, %rax
	subq	$4, %rcx
	cmpq	%rax, %rdi
	jne	.L132
	movl	N(%rip), %eax
	movl	%eax, 28(%rsp)
	testl	%eax, %eax
	jle	.L180
	movl	12+ki(%rip), %edi
	addl	$1, %eax
	movl	$1, %r14d
	movq	$0, 16(%rsp)
	movl	%eax, 24(%rsp)
	movl	%edi, 36(%rsp)
	movl	16+ki(%rip), %edi
	movl	%edi, 32(%rsp)
	movl	4+ki(%rip), %edi
	movl	%edi, 8(%rsp)
	movl	20+ki(%rip), %edi
	movl	%edi, 44(%rsp)
	movl	24+ki(%rip), %edi
	movl	%edi, 40(%rsp)
	movl	8+ki(%rip), %edi
	movl	%edi, 4(%rsp)
	movl	ki(%rip), %edi
	movl	%edi, 12(%rsp)
	.p2align 4,,10
	.p2align 3
.L178:
	leaq	basyo(%rip), %rax
	xorl	%r12d, %r12d
	movl	(%rax,%r14,4), %ebp
	leal	1(%r12), %eax
	movl	%ebp, %ecx
	leal	1(%rbp), %r8d
	movl	%ebp, %r10d
	movl	12(%rsp), %ebp
	cmpl	%eax, %ecx
	jg	.L155
	jmp	.L270
	.p2align 4,,10
	.p2align 3
.L273:
	movl	%ebp, %ebx
	testb	%r13b, %r13b
	je	.L207
	cmpl	%r14d, %ebx
	jl	.L272
.L137:
	cmpl	$3, %r11d
	jle	.L270
.L155:
	movl	%ecx, %r11d
	movl	%ecx, %r15d
	subl	%r12d, %r11d
	movl	%r11d, %ecx
	shrl	$31, %ecx
	addl	%r11d, %ecx
	sarl	%ecx
	addl	%r12d, %ecx
	cmpl	%ecx, %r8d
	jle	.L137
	cmpl	$262143, %ecx
	jg	.L137
	testl	%r8d, %r8d
	jle	.L137
	testl	%ecx, %ecx
	setle	%al
	cmpl	$262143, %r8d
	setg	%r13b
	testb	%al, %al
	jne	.L273
.L207:
	cmpl	$131071, %ecx
	jg	.L182
	cmpl	$131071, %r8d
	movl	%eax, %edx
	setg	%bl
	andb	%bl, %dl
	je	.L141
	movl	8(%rsp), %r9d
	cmpl	$131072, %r8d
	jne	.L143
.L188:
	movl	$22222222, %ebx
.L142:
	cmpl	%r9d, %ebx
	cmovg	%r9d, %ebx
	cmpl	%r14d, %ebx
	jge	.L137
.L272:
	movl	%ecx, %r12d
	movl	%r15d, %ecx
	leal	1(%r12), %eax
	cmpl	%eax, %ecx
	jg	.L155
	.p2align 4,,10
	.p2align 3
.L270:
	movl	%r10d, %ebx
	movl	24(%rsp), %r12d
	movl	%ecx, %r11d
	movl	12(%rsp), %ebp
	leal	1(%rbx), %eax
	movl	%r10d, %ecx
	movl	%r11d, %r10d
	cmpl	%eax, %r12d
	jg	.L176
	jmp	.L271
	.p2align 4,,10
	.p2align 3
.L275:
	movl	%ebp, %r11d
	testb	%r13b, %r13b
	je	.L208
	cmpl	%r14d, %r11d
	jl	.L274
.L158:
	cmpl	%r12d, %r8d
	jge	.L271
.L176:
	movl	%r12d, %edx
	movl	%ebx, %r15d
	subl	%ebx, %edx
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	addl	%eax, %ebx
	leal	1(%rbx), %r8d
	cmpl	%ecx, %r8d
	jle	.L158
	cmpl	$262143, %ecx
	jg	.L158
	testl	%r8d, %r8d
	jle	.L158
	testl	%ecx, %ecx
	setle	%al
	cmpl	$262143, %r8d
	setg	%r13b
	testb	%al, %al
	jne	.L275
.L208:
	cmpl	$131071, %ecx
	jg	.L195
	cmpl	$131071, %r8d
	movl	%eax, %edx
	setg	%r11b
	andb	%r11b, %dl
	je	.L162
	movl	8(%rsp), %r11d
	cmpl	$131072, %r8d
	je	.L201
.L164:
	cmpl	$196607, %r8d
	jle	.L172
	testb	%dl, %dl
	je	.L172
	movl	44(%rsp), %r9d
	cmpl	$196608, %r8d
	jne	.L174
.L205:
	movl	$22222222, %eax
.L173:
	cmpl	%eax, %r9d
	cmovg	%eax, %r9d
.L163:
	cmpl	%r9d, %r11d
	cmovg	%r9d, %r11d
	cmpl	%r14d, %r11d
	jge	.L158
.L274:
	movl	%ebx, %r12d
	movl	%r15d, %ebx
	leal	1(%rbx), %eax
	cmpl	%eax, %r12d
	jg	.L176
	.p2align 4,,10
	.p2align 3
.L271:
	movl	%ecx, %eax
	subl	%ecx, %ebx
	subl	%r10d, %eax
	addl	$1, %eax
	cltq
	imulq	%r14, %rax
	addq	$1, %r14
	movq	%rax, %rdx
	leal	1(%rbx), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rax, 16(%rsp)
	cmpl	%r14d, 28(%rsp)
	jge	.L178
.L135:
	movq	16(%rsp), %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	jmp	.L128
	.p2align 4,,10
	.p2align 3
.L276:
	movq	a(%rip), %rax
	movslq	(%rax,%rbp), %rdx
	addq	$4, %rbp
	movl	%ebx, 0(%r13,%rdx,4)
	addl	$1, %ebx
	cmpl	%ebx, N(%rip)
	jl	.L134
.L131:
	leaq	(%rax,%rbp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L276
.L133:
	movl	$1, %eax
.L128:
	addq	$72, %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
.L201:
	.cfi_restore_state
	movl	$22222222, %r9d
	jmp	.L163
	.p2align 4,,10
	.p2align 3
.L162:
	cmpl	$65535, %ecx
	jg	.L197
	cmpl	$65535, %r8d
	jle	.L166
	testb	%al, %al
	je	.L166
	movl	36(%rsp), %r9d
	cmpl	$65536, %r8d
	jne	.L168
.L199:
	movl	$22222222, %eax
.L167:
	cmpl	%eax, %r9d
	cmovle	%r9d, %eax
	movl	%eax, %r11d
.L161:
	cmpl	$131072, %r8d
	jle	.L201
	cmpl	$131072, %ecx
	setle	%al
	movl	%eax, %edx
	testb	%r13b, %r13b
	je	.L209
	testb	%al, %al
	je	.L209
	movl	4(%rsp), %r9d
	jmp	.L163
	.p2align 4,,10
	.p2align 3
.L143:
	cmpl	$196607, %ecx
	jg	.L190
	cmpl	$196607, %r8d
	jle	.L151
	testb	%dl, %dl
	je	.L151
	movl	44(%rsp), %ebx
	cmpl	$196608, %r8d
	jne	.L153
.L192:
	movl	$22222222, %eax
.L152:
	cmpl	%eax, %ebx
	cmovg	%eax, %ebx
	jmp	.L142
	.p2align 4,,10
	.p2align 3
.L141:
	cmpl	$65535, %ecx
	jg	.L184
	cmpl	$65535, %r8d
	jle	.L145
	testb	%al, %al
	je	.L145
	movl	36(%rsp), %r9d
	cmpl	$65536, %r8d
	jne	.L147
.L186:
	movl	$22222222, %eax
.L146:
	cmpl	%eax, %r9d
	cmovg	%eax, %r9d
.L140:
	cmpl	$131072, %r8d
	jle	.L188
	cmpl	$131072, %ecx
	setle	%al
	movl	%eax, %edx
	testb	%r13b, %r13b
	je	.L143
	testb	%al, %al
	je	.L143
	movl	4(%rsp), %ebx
	jmp	.L142
	.p2align 4,,10
	.p2align 3
.L195:
	movl	$22222222, %r11d
	jmp	.L161
	.p2align 4,,10
	.p2align 3
.L182:
	movl	$22222222, %r9d
	jmp	.L140
.L172:
	movl	$196608, %edx
	movl	$131072, %esi
	movl	$5, %edi
	movl	%r10d, 56(%rsp)
	movl	%r8d, 52(%rsp)
	movl	%ecx, 48(%rsp)
	call	ki_get_i.part.0
	movl	56(%rsp), %r10d
	movl	52(%rsp), %r8d
	movl	48(%rsp), %ecx
	movl	%eax, %r9d
.L171:
	cmpl	$196608, %r8d
	jle	.L205
	cmpl	$196608, %ecx
	jg	.L174
	movl	40(%rsp), %eax
	testb	%r13b, %r13b
	jne	.L173
.L174:
	movl	$262144, %edx
	movl	$196608, %esi
	movl	$6, %edi
	movl	%r10d, 60(%rsp)
	movl	%r9d, 56(%rsp)
	movl	%r8d, 52(%rsp)
	movl	%ecx, 48(%rsp)
	call	ki_get_i.part.0
	movl	48(%rsp), %ecx
	movl	52(%rsp), %r8d
	movl	56(%rsp), %r9d
	movl	60(%rsp), %r10d
	jmp	.L173
.L145:
	movl	$65536, %edx
	xorl	%esi, %esi
	movl	$3, %edi
	movl	%ecx, 48(%rsp)
	movl	%r10d, 56(%rsp)
	movl	%r8d, 52(%rsp)
	call	ki_get_i.part.0
	movl	48(%rsp), %ecx
	movl	52(%rsp), %r8d
	movl	56(%rsp), %r10d
	movl	%eax, %r9d
.L144:
	cmpl	$65536, %r8d
	jle	.L186
	cmpl	$65536, %ecx
	jg	.L147
	movl	32(%rsp), %eax
	testb	%bl, %bl
	jne	.L146
.L147:
	movl	$131072, %edx
	movl	$65536, %esi
	movl	$4, %edi
	movl	%r10d, 60(%rsp)
	movl	%r9d, 56(%rsp)
	movl	%r8d, 52(%rsp)
	movl	%ecx, 48(%rsp)
	call	ki_get_i.part.0
	movl	48(%rsp), %ecx
	movl	52(%rsp), %r8d
	movl	56(%rsp), %r9d
	movl	60(%rsp), %r10d
	jmp	.L146
.L151:
	movl	$196608, %edx
	movl	$131072, %esi
	movl	$5, %edi
	movl	%r10d, 60(%rsp)
	movl	%r9d, 56(%rsp)
	movl	%r8d, 52(%rsp)
	movl	%ecx, 48(%rsp)
	call	ki_get_i.part.0
	movl	48(%rsp), %ecx
	movl	52(%rsp), %r8d
	movl	56(%rsp), %r9d
	movl	60(%rsp), %r10d
	movl	%eax, %ebx
.L150:
	cmpl	$196608, %r8d
	jle	.L192
	cmpl	$196608, %ecx
	jg	.L153
	movl	40(%rsp), %eax
	testb	%r13b, %r13b
	jne	.L152
.L153:
	movl	$262144, %edx
	movl	$196608, %esi
	movl	$6, %edi
	movl	%r10d, 60(%rsp)
	movl	%r9d, 56(%rsp)
	movl	%r8d, 52(%rsp)
	movl	%ecx, 48(%rsp)
	call	ki_get_i.part.0
	movl	48(%rsp), %ecx
	movl	52(%rsp), %r8d
	movl	56(%rsp), %r9d
	movl	60(%rsp), %r10d
	jmp	.L152
.L166:
	movl	$65536, %edx
	xorl	%esi, %esi
	movl	$3, %edi
	movl	%ecx, 48(%rsp)
	movl	%r10d, 56(%rsp)
	movl	%r8d, 52(%rsp)
	call	ki_get_i.part.0
	movl	48(%rsp), %ecx
	movl	52(%rsp), %r8d
	movl	56(%rsp), %r10d
	movl	%eax, %r9d
.L165:
	cmpl	$65536, %r8d
	jle	.L199
	cmpl	$65536, %ecx
	jg	.L168
	movl	32(%rsp), %eax
	testb	%r11b, %r11b
	jne	.L167
.L168:
	movl	$131072, %edx
	movl	$65536, %esi
	movl	$4, %edi
	movl	%r10d, 60(%rsp)
	movl	%r9d, 56(%rsp)
	movl	%r8d, 52(%rsp)
	movl	%ecx, 48(%rsp)
	call	ki_get_i.part.0
	movl	48(%rsp), %ecx
	movl	52(%rsp), %r8d
	movl	56(%rsp), %r9d
	movl	60(%rsp), %r10d
	jmp	.L167
.L209:
	movl	$22222222, %r9d
	cmpl	$196607, %ecx
	jg	.L171
	jmp	.L164
.L197:
	movl	$22222222, %r9d
	jmp	.L165
.L184:
	movl	$22222222, %r9d
	jmp	.L144
.L190:
	movl	$22222222, %ebx
	jmp	.L150
.L180:
	movq	$0, 16(%rsp)
	jmp	.L135
	.cfi_endproc
.LFE26:
	.size	main, .-main
	.globl	basyo
	.bss
	.align 32
	.type	basyo, @object
	.size	basyo, 888888
basyo:
	.zero	888888
	.globl	a
	.section	.data.rel.local,"aw"
	.align 8
	.type	a, @object
	.size	a, 8
a:
	.quad	ki+1048572
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	ki
	.align 32
	.type	ki, @object
	.size	ki, 2097148
ki:
	.zero	2097148
	.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 <inttypes.h>

#define INF 22222222

#define KI_MAX (1 << 18) /* 262144 */

int ki[KI_MAX * 2 - 1];

void ki_koutiku(void) {
	int i;
	for (i = (KI_MAX - 1) - 1; i >= 0; i--) {
		int l = ki[i * 2 + 1], r = ki[i * 2 + 2];
		ki[i] = l <= r ? l : r;
	}
}

int ki_get_i(int idx, int smin, int smax, int qmin, int qmax) {
	if (smax <= qmin || qmax <= smin) { /* クエリとセグメントが全く重ならない */
		return INF;
	} else if (qmin <= smin && smax <= qmax) { /* セグメントがクエリに完全に含まれる */
		return ki[idx];
	} else {
		int smid = smin + (smax - smin) / 2;
		int l = ki_get_i(idx * 2 + 1, smin, smid, qmin, qmax);
		int r = ki_get_i(idx * 2 + 2, smid, smax, qmin, qmax);
		return l <= r ? l : r;
	}
}

int ki_get(int qmin, int qmax) {
	return qmin < qmax ? ki_get_i(0, 0, KI_MAX, qmin, qmax) : INF;
}

int N;
int* a = ki + (KI_MAX - 1);

int basyo[222222];

int main(void) {
	int i, j;
	uint64_t kotae = 0;
	if (scanf("%d", &N) != 1) return 1;
	for (i = 1; i <= N; i++) {
		if (scanf("%d", &a[i]) != 1) return 1;
		basyo[a[i]] = i;
	}
	a[0] = 0;
	a[N + 1] = 0;
	ki_koutiku();
	for (i = 1; i <= N; i++) {
		int yes, no;
		int hidari, migi;

		no = 0; yes = basyo[i];
		while (no + 1 < yes) {
			int mid = no + (yes - no) / 2;
			if (ki_get(mid, basyo[i] + 1) >= i) yes = mid; else no = mid;
		}
		hidari = yes;

		yes = basyo[i]; no = N + 1;
		while (yes + 1 < no) {
			int mid = yes + (no - yes) / 2;
			if (ki_get(basyo[i], mid + 1) >= i) yes = mid; else no = mid;
		}
		migi = yes;

		kotae += (uint64_t)i * (uint64_t)(basyo[i] - hidari + 1) * (uint64_t)(migi - basyo[i] + 1);
	}
	printf("%" PRIu64 "\n", kotae);
	return 0;
}

3
3 1 2
 3
1 2 3
 4
2 3 1 4
 4
1 3 4 2
 8
5 3 8 1 2 6 7 4
 4
3 2 4 1
 8
4 5 8 1 2 6 7 3
 3
1 3 2
 3
2 3 1
 3
3 2 1

9
 10
 17
 20
 84
 19
 86
 10
 10
 10

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 <inttypes.h>

#define INF 22222222

#define KI_MAX (1 << 18) /* 262144 */

int ki[KI_MAX * 2 - 1];

void ki_koutiku(void) {
	int i;
	for (i = (KI_MAX - 1) - 1; i >= 0; i--) {
		int l = ki[i * 2 + 1], r = ki[i * 2 + 2];
		ki[i] = l <= r ? l : r;
	}
}

int ki_get_i(int idx, int smin, int smax, int qmin, int qmax) {
	if (smax <= qmin || qmax <= smin) { /* クエリとセグメントが全く重ならない */
		return INF;
	} else if (qmin <= smin && smax <= qmax) { /* セグメントがクエリに完全に含まれる */
		return ki[idx];
	} else {
		int smid = smin + (smax - smin) / 2;
		int l = ki_get_i(idx * 2 + 1, smin, smid, qmin, qmax);
		int r = ki_get_i(idx * 2 + 2, smid, smax, qmin, qmax);
		return l <= r ? l : r;
	}
}

int ki_get(int qmin, int qmax) {
	return qmin < qmax ? ki_get_i(0, 0, KI_MAX, qmin, qmax) : INF;
}

int N;
int* a = ki + (KI_MAX - 1);

int basyo[222222];

int main(void) {
	int i, j;
	uint64_t kotae = 0;
	if (scanf("%d", &N) != 1) return 1;
	for (i = 1; i <= N; i++) {
		if (scanf("%d", &a[i]) != 1) return 1;
		basyo[a[i]] = i;
	}
	a[0] = 0;
	a[N + 1] = 0;
	ki_koutiku();
	for (i = 1; i <= N; i++) {
		int yes, no;
		int hidari, migi;

		no = 0; yes = basyo[i];
		while (no + 1 < yes) {
			int mid = no + (yes - no) / 2;
			if (ki_get(mid, basyo[i] + 1) >= i) yes = mid; else no = mid;
		}
		hidari = yes;

		yes = basyo[i]; no = N + 1;
		while (yes + 1 < no) {
			int mid = yes + (no - yes) / 2;
			if (ki_get(basyo[i], mid + 1) >= i) yes = mid; else no = mid;
		}
		migi = yes;

		kotae += (uint64_t)i * (uint64_t)(basyo[i] - hidari + 1) * (uint64_t)(migi - basyo[i] + 1);
	}
	printf("%" PRIu64 "\n", kotae);
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	ki
	.bss
	.align 32
	.type	ki, @object
	.size	ki, 2097148
ki:
	.zero	2097148
	.text
	.globl	ki_koutiku
	.type	ki_koutiku, @function
ki_koutiku:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$262142, -12(%rbp)
	jmp	.L2
.L3:
	movl	-12(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ki(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-12(%rbp), %eax
	addl	$1, %eax
	addl	%eax, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ki(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	ki(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	subl	$1, -12(%rbp)
.L2:
	cmpl	$0, -12(%rbp)
	jns	.L3
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	ki_koutiku, .-ki_koutiku
	.globl	ki_get_i
	.type	ki_get_i, @function
ki_get_i:
.LFB1:
	.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
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	%ecx, -32(%rbp)
	movl	%r8d, -36(%rbp)
	movl	-28(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L5
	movl	-36(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jg	.L6
.L5:
	movl	$22222222, %eax
	jmp	.L7
.L6:
	movl	-32(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jg	.L8
	movl	-28(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jg	.L8
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ki(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L7
.L8:
	movl	-28(%rbp), %eax
	subl	-24(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %edi
	movl	-36(%rbp), %esi
	movl	-32(%rbp), %ecx
	movl	-12(%rbp), %edx
	movl	-24(%rbp), %eax
	movl	%esi, %r8d
	movl	%eax, %esi
	call	ki_get_i
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %eax
	addl	$1, %eax
	leal	(%rax,%rax), %edi
	movl	-36(%rbp), %esi
	movl	-32(%rbp), %ecx
	movl	-28(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%esi, %r8d
	movl	%eax, %esi
	call	ki_get_i
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	ki_get_i, .-ki_get_i
	.globl	ki_get
	.type	ki_get, @function
ki_get:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L10
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %r8d
	movl	%eax, %ecx
	movl	$262144, %edx
	movl	$0, %esi
	movl	$0, %edi
	call	ki_get_i
	jmp	.L12
.L10:
	movl	$22222222, %eax
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	ki_get, .-ki_get
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	a
	.section	.data.rel.local,"aw"
	.align 8
	.type	a, @object
	.size	a, 8
a:
	.quad	ki+1048572
	.globl	basyo
	.bss
	.align 32
	.type	basyo, @object
	.size	basyo, 888888
basyo:
	.zero	888888
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lu\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.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
	movq	$0, -8(%rbp)
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L14
	movl	$1, %eax
	jmp	.L15
.L14:
	movl	$1, -36(%rbp)
	jmp	.L16
.L18:
	movq	a(%rip), %rdx
	movl	-36(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L17
	movl	$1, %eax
	jmp	.L15
.L17:
	movq	a(%rip), %rdx
	movl	-36(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	basyo(%rip), %rdx
	movl	-36(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	addl	$1, -36(%rbp)
.L16:
	movl	N(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L18
	movq	a(%rip), %rax
	movl	$0, (%rax)
	movq	a(%rip), %rdx
	movl	N(%rip), %eax
	cltq
	addq	$1, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	movl	$0, (%rax)
	call	ki_koutiku
	movl	$1, -36(%rbp)
	jmp	.L19
.L26:
	movl	$0, -28(%rbp)
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	basyo(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -32(%rbp)
	jmp	.L20
.L22:
	movl	-32(%rbp), %eax
	subl	-28(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	basyo(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	-12(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	ki_get
	cmpl	%eax, -36(%rbp)
	jg	.L21
	movl	-12(%rbp), %eax
	movl	%eax, -32(%rbp)
	jmp	.L20
.L21:
	movl	-12(%rbp), %eax
	movl	%eax, -28(%rbp)
.L20:
	movl	-28(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -32(%rbp)
	jg	.L22
	movl	-32(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	basyo(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -32(%rbp)
	movl	N(%rip), %eax
	addl	$1, %eax
	movl	%eax, -28(%rbp)
	jmp	.L23
.L25:
	movl	-28(%rbp), %eax
	subl	-32(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -16(%rbp)
	movl	-16(%rbp), %eax
	leal	1(%rax), %edx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	basyo(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	ki_get
	cmpl	%eax, -36(%rbp)
	jg	.L24
	movl	-16(%rbp), %eax
	movl	%eax, -32(%rbp)
	jmp	.L23
.L24:
	movl	-16(%rbp), %eax
	movl	%eax, -28(%rbp)
.L23:
	movl	-32(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -28(%rbp)
	jg	.L25
	movl	-32(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	basyo(%rip), %rax
	movl	(%rcx,%rax), %eax
	subl	-24(%rbp), %eax
	addl	$1, %eax
	cltq
	imulq	%rax, %rdx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	basyo(%rip), %rax
	movl	(%rcx,%rax), %ecx
	movl	-20(%rbp), %eax
	subl	%ecx, %eax
	addl	$1, %eax
	cltq
	imulq	%rdx, %rax
	addq	%rax, -8(%rbp)
	addl	$1, -36(%rbp)
.L19:
	movl	N(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L26
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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	ki
	.bss
	.align 32
	.type	ki, @object
	.size	ki, 2097148
ki:
	.zero	2097148
	.text
	.globl	ki_koutiku
	.type	ki_koutiku, @function
ki_koutiku:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$262142, -12(%rbp)
	jmp	.L2
.L3:
	movl	-12(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ki(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-12(%rbp), %eax
	addl	$1, %eax
	addl	%eax, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ki(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	ki(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	subl	$1, -12(%rbp)
.L2:
	cmpl	$0, -12(%rbp)
	jns	.L3
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	ki_koutiku, .-ki_koutiku
	.globl	ki_get_i
	.type	ki_get_i, @function
ki_get_i:
.LFB1:
	.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
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	%ecx, -32(%rbp)
	movl	%r8d, -36(%rbp)
	movl	-28(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L5
	movl	-36(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jg	.L6
.L5:
	movl	$22222222, %eax
	jmp	.L7
.L6:
	movl	-32(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jg	.L8
	movl	-28(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jg	.L8
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ki(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L7
.L8:
	movl	-28(%rbp), %eax
	subl	-24(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %edi
	movl	-36(%rbp), %esi
	movl	-32(%rbp), %ecx
	movl	-12(%rbp), %edx
	movl	-24(%rbp), %eax
	movl	%esi, %r8d
	movl	%eax, %esi
	call	ki_get_i
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %eax
	addl	$1, %eax
	leal	(%rax,%rax), %edi
	movl	-36(%rbp), %esi
	movl	-32(%rbp), %ecx
	movl	-28(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%esi, %r8d
	movl	%eax, %esi
	call	ki_get_i
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	ki_get_i, .-ki_get_i
	.globl	ki_get
	.type	ki_get, @function
ki_get:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L10
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %r8d
	movl	%eax, %ecx
	movl	$262144, %edx
	movl	$0, %esi
	movl	$0, %edi
	call	ki_get_i
	jmp	.L12
.L10:
	movl	$22222222, %eax
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	ki_get, .-ki_get
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	a
	.section	.data.rel.local,"aw"
	.align 8
	.type	a, @object
	.size	a, 8
a:
	.quad	ki+1048572
	.globl	basyo
	.bss
	.align 32
	.type	basyo, @object
	.size	basyo, 888888
basyo:
	.zero	888888
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lu\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.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
	movq	$0, -8(%rbp)
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L14
	movl	$1, %eax
	jmp	.L15
.L14:
	movl	$1, -36(%rbp)
	jmp	.L16
.L18:
	movq	a(%rip), %rdx
	movl	-36(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L17
	movl	$1, %eax
	jmp	.L15
.L17:
	movq	a(%rip), %rdx
	movl	-36(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	basyo(%rip), %rdx
	movl	-36(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	addl	$1, -36(%rbp)
.L16:
	movl	N(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L18
	movq	a(%rip), %rax
	movl	$0, (%rax)
	movq	a(%rip), %rdx
	movl	N(%rip), %eax
	cltq
	addq	$1, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	movl	$0, (%rax)
	call	ki_koutiku
	movl	$1, -36(%rbp)
	jmp	.L19
.L26:
	movl	$0, -28(%rbp)
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	basyo(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -32(%rbp)
	jmp	.L20
.L22:
	movl	-32(%rbp), %eax
	subl	-28(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	basyo(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	-12(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	ki_get
	cmpl	%eax, -36(%rbp)
	jg	.L21
	movl	-12(%rbp), %eax
	movl	%eax, -32(%rbp)
	jmp	.L20
.L21:
	movl	-12(%rbp), %eax
	movl	%eax, -28(%rbp)
.L20:
	movl	-28(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -32(%rbp)
	jg	.L22
	movl	-32(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	basyo(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -32(%rbp)
	movl	N(%rip), %eax
	addl	$1, %eax
	movl	%eax, -28(%rbp)
	jmp	.L23
.L25:
	movl	-28(%rbp), %eax
	subl	-32(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -16(%rbp)
	movl	-16(%rbp), %eax
	leal	1(%rax), %edx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	basyo(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	ki_get
	cmpl	%eax, -36(%rbp)
	jg	.L24
	movl	-16(%rbp), %eax
	movl	%eax, -32(%rbp)
	jmp	.L23
.L24:
	movl	-16(%rbp), %eax
	movl	%eax, -28(%rbp)
.L23:
	movl	-32(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -28(%rbp)
	jg	.L25
	movl	-32(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	basyo(%rip), %rax
	movl	(%rcx,%rax), %eax
	subl	-24(%rbp), %eax
	addl	$1, %eax
	cltq
	imulq	%rax, %rdx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	basyo(%rip), %rax
	movl	(%rcx,%rax), %ecx
	movl	-20(%rbp), %eax
	subl	%ecx, %eax
	addl	$1, %eax
	cltq
	imulq	%rdx, %rax
	addq	%rax, -8(%rbp)
	addl	$1, -36(%rbp)
.L19:
	movl	N(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L26
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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:
