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>
int R=1,C=1,H[2000010],N[2000010];
//評価関数（いまはMIN）
int hyouka(int a,int b){
  if(C<b)return 1;
  if(C<a||b==0)return 0;
  return N[H[a]]<N[H[b]]?1:0;
}
//挿入関数
void hin(int a){
  int i=C++;
  for(N[H[0]=R]=a;hyouka(0,i/2);i/=2)H[i]=H[i/2];
  H[i]=R++;
}
//取り出す関数
int hout(){
  int rt=H[1],i,j=2,k=H[--C];
  for(i=1;hyouka(i,C);i=j)H[i]=H[j=i*2+1-hyouka(i*2,i*2+1)];
  H[j/2]=k;
  return rt;
}
int main(){
  int n,a,i;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&a);
    hin(a);
  }
  for(i=a=0;i<n;i++){
    if(i%2==hout()%2)a++;
  }
  printf("%d\n",a/2);
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	R
	.data
	.align 4
	.type	R, @object
	.size	R, 4
R:
	.long	1
	.globl	C
	.align 4
	.type	C, @object
	.size	C, 4
C:
	.long	1
	.globl	H
	.bss
	.align 32
	.type	H, @object
	.size	H, 8000040
H:
	.zero	8000040
	.globl	N
	.align 32
	.type	N, @object
	.size	N, 8000040
N:
	.zero	8000040
	.text
	.globl	hyouka
	.type	hyouka, @function
hyouka:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	C(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jle	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	movl	C(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jg	.L4
	cmpl	$0, -8(%rbp)
	jne	.L5
.L4:
	movl	$0, %eax
	jmp	.L3
.L5:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	H(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	N(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	H(%rip), %rax
	movl	(%rcx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	N(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	setl	%al
	movzbl	%al, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	hyouka, .-hyouka
	.globl	hin
	.type	hin, @function
hin:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$24, %rsp
	movl	%edi, -20(%rbp)
	movl	C(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, C(%rip)
	movl	%eax, -4(%rbp)
	movl	R(%rip), %eax
	movl	%eax, H(%rip)
	movl	H(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	N(%rip), %rdx
	movl	-20(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L7
.L8:
	movl	-4(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	H(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	H(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
.L7:
	movl	-4(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %esi
	movl	$0, %edi
	call	hyouka
	testl	%eax, %eax
	jne	.L8
	movl	R(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, R(%rip)
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	H(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	hin, .-hin
	.globl	hout
	.type	hout, @function
hout:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset 3, -24
	movl	4+H(%rip), %eax
	movl	%eax, -16(%rbp)
	movl	$2, -20(%rbp)
	movl	C(%rip), %eax
	subl	$1, %eax
	movl	%eax, C(%rip)
	movl	C(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	H(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
	movl	$1, -24(%rbp)
	jmp	.L10
.L11:
	movl	-24(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %ebx
	movl	-24(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %edx
	movl	-24(%rbp), %eax
	addl	%eax, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	hyouka
	movl	%eax, %edx
	movl	%ebx, %eax
	subl	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	H(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	H(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	movl	%eax, -24(%rbp)
.L10:
	movl	C(%rip), %edx
	movl	-24(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	hyouka
	testl	%eax, %eax
	jne	.L11
	movl	-20(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	H(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-16(%rbp), %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	hout, .-hout
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\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
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -28(%rbp)
	jmp	.L14
.L15:
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %eax
	movl	%eax, %edi
	call	hin
	addl	$1, -28(%rbp)
.L14:
	movl	-36(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L15
	movl	$0, -32(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -28(%rbp)
	jmp	.L16
.L18:
	movl	-28(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	movl	%eax, %ebx
	movl	$0, %eax
	call	hout
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	cmpl	%eax, %ebx
	jne	.L17
	movl	-32(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -32(%rbp)
.L17:
	addl	$1, -28(%rbp)
.L16:
	movl	-36(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L18
	movl	-32(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	movq	-8(%rbp), %rbx
	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
	.globl	hyouka
	.type	hyouka, @function
hyouka:
.LFB23:
	.cfi_startproc
	endbr64
	movl	C(%rip), %edx
	movl	$1, %eax
	cmpl	%esi, %edx
	jl	.L1
	testl	%esi, %esi
	je	.L4
	cmpl	%edi, %edx
	jl	.L4
	leaq	H(%rip), %rdx
	movslq	%edi, %rdi
	movslq	%esi, %rsi
	movslq	(%rdx,%rdi,4), %rcx
	movslq	(%rdx,%rsi,4), %rdx
	leaq	N(%rip), %rax
	movl	(%rax,%rdx,4), %edx
	cmpl	%edx, (%rax,%rcx,4)
	setl	%al
	movzbl	%al, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%eax, %eax
.L1:
	ret
	.cfi_endproc
.LFE23:
	.size	hyouka, .-hyouka
	.p2align 4
	.globl	hin
	.type	hin, @function
hin:
.LFB24:
	.cfi_startproc
	endbr64
	movslq	C(%rip), %rdx
	movslq	R(%rip), %rax
	movl	%edi, %r10d
	leaq	N(%rip), %r9
	leaq	H(%rip), %rcx
	leal	1(%rdx), %edi
	movl	%eax, H(%rip)
	movq	%rax, %r8
	movl	%edi, C(%rip)
	movl	%r10d, (%r9,%rax,4)
	movl	%edi, %r10d
	shrl	$31, %r10d
.L12:
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, %edi
	jl	.L14
	testl	%eax, %eax
	je	.L16
	testb	%r10b, %r10b
	jne	.L16
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
.L18:
	movslq	%eax, %rsi
	movslq	(%rcx), %rbx
	movslq	(%rcx,%rsi,4), %r11
	movq	%r11, %rsi
	movl	(%r9,%r11,4), %r11d
	cmpl	%r11d, (%r9,%rbx,4)
	jge	.L9
.L10:
	movl	%esi, (%rcx,%rdx,4)
	movslq	%eax, %rdx
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, %edi
	jl	.L8
	testl	%eax, %eax
	je	.L9
	testb	%r10b, %r10b
	je	.L18
.L9:
	leal	1(%r8), %eax
	movl	%r8d, (%rcx,%rdx,4)
	popq	%rbx
	.cfi_def_cfa_offset 8
	movl	%eax, R(%rip)
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore 3
	leal	1(%r8), %eax
	movl	%r8d, (%rcx,%rdx,4)
	movl	%eax, R(%rip)
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movslq	%eax, %rsi
	movl	(%rcx,%rsi,4), %esi
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	movslq	%eax, %rsi
	movl	(%rcx,%rsi,4), %esi
	movl	%esi, (%rcx,%rdx,4)
	movslq	%eax, %rdx
	jmp	.L12
	.cfi_endproc
.LFE24:
	.size	hin, .-hin
	.p2align 4
	.globl	hout
	.type	hout, @function
hout:
.LFB25:
	.cfi_startproc
	endbr64
	movl	C(%rip), %eax
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	H(%rip), %rcx
	movl	4+H(%rip), %r10d
	leal	-1(%rax), %edx
	movl	$1, %eax
	movslq	%edx, %rbx
	movl	%edx, C(%rip)
	movl	(%rcx,%rbx,4), %r11d
	testl	%edx, %edx
	jle	.L21
	movslq	%r11d, %r8
	movslq	%r10d, %rsi
	movl	$2, %eax
	movl	$1, %edi
	leaq	N(%rip), %r9
.L22:
	movl	(%r9,%r8,4), %r8d
	cmpl	%r8d, (%r9,%rsi,4)
	jge	.L30
	leal	(%rdi,%rdi), %eax
	leal	1(%rax), %r8d
	cmpl	%r8d, %edx
	jl	.L23
	cmpl	%eax, %edx
	jl	.L24
	cltq
	movslq	(%rcx,%rax,4), %rsi
	movslq	%r8d, %rax
	movslq	(%rcx,%rax,4), %rax
	movl	(%r9,%rax,4), %eax
	cmpl	%eax, (%r9,%rsi,4)
	movl	%r8d, %eax
	setl	%sil
	movzbl	%sil, %esi
	subl	%esi, %eax
.L23:
	movslq	%eax, %rsi
	movslq	(%rcx,%rsi,4), %rsi
	movl	%esi, (%rcx,%rdi,4)
	cmpl	%eax, %edx
	jl	.L30
	movslq	(%rcx,%rbx,4), %r8
	movslq	%eax, %rdi
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L30:
	sarl	%eax
.L21:
	cltq
	movl	%r11d, (%rcx,%rax,4)
	movl	%r10d, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L24:
	.cfi_restore_state
	movslq	%r8d, %rax
	movslq	(%rcx,%rax,4), %rsi
	movl	%r8d, %eax
	movl	%esi, (%rcx,%rdi,4)
	movslq	%eax, %rdi
	movslq	(%rcx,%rbx,4), %r8
	jmp	.L22
	.cfi_endproc
.LFE25:
	.size	hout, .-hout
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rbp, %rdi
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %eax
	testl	%eax, %eax
	jle	.L32
	xorl	%ebx, %ebx
	leaq	4(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L33:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %edi
	call	hin
	movl	(%rsp), %eax
	cmpl	%ebx, %eax
	jg	.L33
	movl	$0, 4(%rsp)
	testl	%eax, %eax
	jle	.L37
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L34:
	xorl	%eax, %eax
	call	hout
	movl	%ebx, %ecx
	movl	%eax, %edx
	andl	$1, %ecx
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	cmpl	%eax, %ecx
	je	.L43
	addl	$1, %ebx
	cmpl	%ebx, (%rsp)
	jg	.L34
.L37:
	movl	4(%rsp), %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%eax, %edx
	xorl	%eax, %eax
	sarl	%edx
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L44
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.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
.L43:
	.cfi_restore_state
	addl	$1, 4(%rsp)
	addl	$1, %ebx
	cmpl	%ebx, (%rsp)
	jg	.L34
	jmp	.L37
.L32:
	movl	$0, 4(%rsp)
	jmp	.L37
.L44:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE26:
	.size	main, .-main
	.globl	N
	.bss
	.align 32
	.type	N, @object
	.size	N, 8000040
N:
	.zero	8000040
	.globl	H
	.align 32
	.type	H, @object
	.size	H, 8000040
H:
	.zero	8000040
	.globl	C
	.data
	.align 4
	.type	C, @object
	.size	C, 4
C:
	.long	1
	.globl	R
	.align 4
	.type	R, @object
	.size	R, 4
R:
	.long	1
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	hyouka
	.type	hyouka, @function
hyouka:
.LFB23:
	.cfi_startproc
	endbr64
	movl	C(%rip), %edx
	movl	$1, %eax
	cmpl	%esi, %edx
	jl	.L1
	testl	%esi, %esi
	je	.L4
	cmpl	%edi, %edx
	jl	.L4
	leaq	H(%rip), %rdx
	movslq	%edi, %rdi
	movslq	%esi, %rsi
	movslq	(%rdx,%rdi,4), %rcx
	movslq	(%rdx,%rsi,4), %rdx
	leaq	N(%rip), %rax
	movl	(%rax,%rdx,4), %edx
	cmpl	%edx, (%rax,%rcx,4)
	setl	%al
	movzbl	%al, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%eax, %eax
.L1:
	ret
	.cfi_endproc
.LFE23:
	.size	hyouka, .-hyouka
	.p2align 4
	.globl	hin
	.type	hin, @function
hin:
.LFB24:
	.cfi_startproc
	endbr64
	movslq	C(%rip), %rdx
	movslq	R(%rip), %rax
	movl	%edi, %r10d
	leaq	N(%rip), %r9
	leaq	H(%rip), %rcx
	leal	1(%rdx), %edi
	movl	%eax, H(%rip)
	movq	%rax, %r8
	movl	%edi, C(%rip)
	movl	%r10d, (%r9,%rax,4)
	movl	%edi, %r10d
	shrl	$31, %r10d
.L12:
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, %edi
	jl	.L14
	testl	%eax, %eax
	je	.L16
	testb	%r10b, %r10b
	jne	.L16
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
.L18:
	movslq	%eax, %rsi
	movslq	(%rcx), %rbx
	movslq	(%rcx,%rsi,4), %r11
	movq	%r11, %rsi
	movl	(%r9,%r11,4), %r11d
	cmpl	%r11d, (%r9,%rbx,4)
	jge	.L9
.L10:
	movl	%esi, (%rcx,%rdx,4)
	movslq	%eax, %rdx
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, %edi
	jl	.L8
	testl	%eax, %eax
	je	.L9
	testb	%r10b, %r10b
	je	.L18
.L9:
	leal	1(%r8), %eax
	movl	%r8d, (%rcx,%rdx,4)
	popq	%rbx
	.cfi_def_cfa_offset 8
	movl	%eax, R(%rip)
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore 3
	leal	1(%r8), %eax
	movl	%r8d, (%rcx,%rdx,4)
	movl	%eax, R(%rip)
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movslq	%eax, %rsi
	movl	(%rcx,%rsi,4), %esi
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	movslq	%eax, %rsi
	movl	(%rcx,%rsi,4), %esi
	movl	%esi, (%rcx,%rdx,4)
	movslq	%eax, %rdx
	jmp	.L12
	.cfi_endproc
.LFE24:
	.size	hin, .-hin
	.p2align 4
	.globl	hout
	.type	hout, @function
hout:
.LFB25:
	.cfi_startproc
	endbr64
	movl	C(%rip), %eax
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	H(%rip), %rcx
	movl	4+H(%rip), %r10d
	leal	-1(%rax), %edx
	movl	$1, %eax
	movslq	%edx, %rbx
	movl	%edx, C(%rip)
	movl	(%rcx,%rbx,4), %r11d
	testl	%edx, %edx
	jle	.L21
	movslq	%r11d, %r8
	movslq	%r10d, %rsi
	movl	$2, %eax
	movl	$1, %edi
	leaq	N(%rip), %r9
.L22:
	movl	(%r9,%r8,4), %r8d
	cmpl	%r8d, (%r9,%rsi,4)
	jge	.L30
	leal	(%rdi,%rdi), %eax
	leal	1(%rax), %r8d
	cmpl	%r8d, %edx
	jl	.L23
	cmpl	%eax, %edx
	jl	.L24
	cltq
	movslq	(%rcx,%rax,4), %rsi
	movslq	%r8d, %rax
	movslq	(%rcx,%rax,4), %rax
	movl	(%r9,%rax,4), %eax
	cmpl	%eax, (%r9,%rsi,4)
	movl	%r8d, %eax
	setl	%sil
	movzbl	%sil, %esi
	subl	%esi, %eax
.L23:
	movslq	%eax, %rsi
	movslq	(%rcx,%rsi,4), %rsi
	movl	%esi, (%rcx,%rdi,4)
	cmpl	%eax, %edx
	jl	.L30
	movslq	(%rcx,%rbx,4), %r8
	movslq	%eax, %rdi
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L30:
	sarl	%eax
.L21:
	cltq
	movl	%r11d, (%rcx,%rax,4)
	movl	%r10d, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L24:
	.cfi_restore_state
	movslq	%r8d, %rax
	movslq	(%rcx,%rax,4), %rsi
	movl	%r8d, %eax
	movl	%esi, (%rcx,%rdi,4)
	movslq	%eax, %rdi
	movslq	(%rcx,%rbx,4), %r8
	jmp	.L22
	.cfi_endproc
.LFE25:
	.size	hout, .-hout
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rbp, %rdi
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %eax
	testl	%eax, %eax
	jle	.L32
	xorl	%ebx, %ebx
	leaq	4(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L33:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %edi
	call	hin
	movl	(%rsp), %eax
	cmpl	%ebx, %eax
	jg	.L33
	movl	$0, 4(%rsp)
	testl	%eax, %eax
	jle	.L37
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L34:
	xorl	%eax, %eax
	call	hout
	movl	%ebx, %ecx
	movl	%eax, %edx
	andl	$1, %ecx
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	cmpl	%eax, %ecx
	je	.L43
	addl	$1, %ebx
	cmpl	%ebx, (%rsp)
	jg	.L34
.L37:
	movl	4(%rsp), %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%eax, %edx
	xorl	%eax, %eax
	sarl	%edx
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L44
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.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
.L43:
	.cfi_restore_state
	addl	$1, 4(%rsp)
	addl	$1, %ebx
	cmpl	%ebx, (%rsp)
	jg	.L34
	jmp	.L37
.L32:
	movl	$0, 4(%rsp)
	jmp	.L37
.L44:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE26:
	.size	main, .-main
	.globl	N
	.bss
	.align 32
	.type	N, @object
	.size	N, 8000040
N:
	.zero	8000040
	.globl	H
	.align 32
	.type	H, @object
	.size	H, 8000040
H:
	.zero	8000040
	.globl	C
	.data
	.align 4
	.type	C, @object
	.size	C, 4
C:
	.long	1
	.globl	R
	.align 4
	.type	R, @object
	.size	R, 4
R:
	.long	1
	.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>
int R=1,C=1,H[2000010],N[2000010];
//評価関数（いまはMIN）
int hyouka(int a,int b){
  if(C<b)return 1;
  if(C<a||b==0)return 0;
  return N[H[a]]<N[H[b]]?1:0;
}
//挿入関数
void hin(int a){
  int i=C++;
  for(N[H[0]=R]=a;hyouka(0,i/2);i/=2)H[i]=H[i/2];
  H[i]=R++;
}
//取り出す関数
int hout(){
  int rt=H[1],i,j=2,k=H[--C];
  for(i=1;hyouka(i,C);i=j)H[i]=H[j=i*2+1-hyouka(i*2,i*2+1)];
  H[j/2]=k;
  return rt;
}
int main(){
  int n,a,i;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&a);
    hin(a);
  }
  for(i=a=0;i<n;i++){
    if(i%2==hout()%2)a++;
  }
  printf("%d\n",a/2);
  return 0;
}

4
2
4
2
1
 4
2
4
6
1
 4
0
13
10
1
 4
2
4
2
0
 4
2
4
8
1
 4
2
4
10
1
 4
2
4
13
1
 5
10
8
5
6
2
 4
2
4
11
1
 4
2
5
10
1

1
 2
 0
 1
 2
 2
 2
 1
 2
 2

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

```c
#include<stdio.h>
int R=1,C=1,H[2000010],N[2000010];
//評価関数（いまはMIN）
int hyouka(int a,int b){
  if(C<b)return 1;
  if(C<a||b==0)return 0;
  return N[H[a]]<N[H[b]]?1:0;
}
//挿入関数
void hin(int a){
  int i=C++;
  for(N[H[0]=R]=a;hyouka(0,i/2);i/=2)H[i]=H[i/2];
  H[i]=R++;
}
//取り出す関数
int hout(){
  int rt=H[1],i,j=2,k=H[--C];
  for(i=1;hyouka(i,C);i=j)H[i]=H[j=i*2+1-hyouka(i*2,i*2+1)];
  H[j/2]=k;
  return rt;
}
int main(){
  int n,a,i;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&a);
    hin(a);
  }
  for(i=a=0;i<n;i++){
    if(i%2==hout()%2)a++;
  }
  printf("%d\n",a/2);
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	R
	.data
	.align 4
	.type	R, @object
	.size	R, 4
R:
	.long	1
	.globl	C
	.align 4
	.type	C, @object
	.size	C, 4
C:
	.long	1
	.globl	H
	.bss
	.align 32
	.type	H, @object
	.size	H, 8000040
H:
	.zero	8000040
	.globl	N
	.align 32
	.type	N, @object
	.size	N, 8000040
N:
	.zero	8000040
	.text
	.globl	hyouka
	.type	hyouka, @function
hyouka:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	C(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jle	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	movl	C(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jg	.L4
	cmpl	$0, -8(%rbp)
	jne	.L5
.L4:
	movl	$0, %eax
	jmp	.L3
.L5:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	H(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	N(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	H(%rip), %rax
	movl	(%rcx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	N(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	setl	%al
	movzbl	%al, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	hyouka, .-hyouka
	.globl	hin
	.type	hin, @function
hin:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$24, %rsp
	movl	%edi, -20(%rbp)
	movl	C(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, C(%rip)
	movl	%eax, -4(%rbp)
	movl	R(%rip), %eax
	movl	%eax, H(%rip)
	movl	H(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	N(%rip), %rdx
	movl	-20(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L7
.L8:
	movl	-4(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	H(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	H(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
.L7:
	movl	-4(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %esi
	movl	$0, %edi
	call	hyouka
	testl	%eax, %eax
	jne	.L8
	movl	R(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, R(%rip)
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	H(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	hin, .-hin
	.globl	hout
	.type	hout, @function
hout:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset 3, -24
	movl	4+H(%rip), %eax
	movl	%eax, -16(%rbp)
	movl	$2, -20(%rbp)
	movl	C(%rip), %eax
	subl	$1, %eax
	movl	%eax, C(%rip)
	movl	C(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	H(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
	movl	$1, -24(%rbp)
	jmp	.L10
.L11:
	movl	-24(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %ebx
	movl	-24(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %edx
	movl	-24(%rbp), %eax
	addl	%eax, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	hyouka
	movl	%eax, %edx
	movl	%ebx, %eax
	subl	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	H(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	H(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	movl	%eax, -24(%rbp)
.L10:
	movl	C(%rip), %edx
	movl	-24(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	hyouka
	testl	%eax, %eax
	jne	.L11
	movl	-20(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	H(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-16(%rbp), %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	hout, .-hout
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\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
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -28(%rbp)
	jmp	.L14
.L15:
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %eax
	movl	%eax, %edi
	call	hin
	addl	$1, -28(%rbp)
.L14:
	movl	-36(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L15
	movl	$0, -32(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -28(%rbp)
	jmp	.L16
.L18:
	movl	-28(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	movl	%eax, %ebx
	movl	$0, %eax
	call	hout
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	cmpl	%eax, %ebx
	jne	.L17
	movl	-32(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -32(%rbp)
.L17:
	addl	$1, -28(%rbp)
.L16:
	movl	-36(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L18
	movl	-32(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	movq	-8(%rbp), %rbx
	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	R
	.data
	.align 4
	.type	R, @object
	.size	R, 4
R:
	.long	1
	.globl	C
	.align 4
	.type	C, @object
	.size	C, 4
C:
	.long	1
	.globl	H
	.bss
	.align 32
	.type	H, @object
	.size	H, 8000040
H:
	.zero	8000040
	.globl	N
	.align 32
	.type	N, @object
	.size	N, 8000040
N:
	.zero	8000040
	.text
	.globl	hyouka
	.type	hyouka, @function
hyouka:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	C(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jle	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	movl	C(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jg	.L4
	cmpl	$0, -8(%rbp)
	jne	.L5
.L4:
	movl	$0, %eax
	jmp	.L3
.L5:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	H(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	N(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	H(%rip), %rax
	movl	(%rcx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	N(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	setl	%al
	movzbl	%al, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	hyouka, .-hyouka
	.globl	hin
	.type	hin, @function
hin:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$24, %rsp
	movl	%edi, -20(%rbp)
	movl	C(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, C(%rip)
	movl	%eax, -4(%rbp)
	movl	R(%rip), %eax
	movl	%eax, H(%rip)
	movl	H(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	N(%rip), %rdx
	movl	-20(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L7
.L8:
	movl	-4(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	H(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	H(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
.L7:
	movl	-4(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %esi
	movl	$0, %edi
	call	hyouka
	testl	%eax, %eax
	jne	.L8
	movl	R(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, R(%rip)
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	H(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	hin, .-hin
	.globl	hout
	.type	hout, @function
hout:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset 3, -24
	movl	4+H(%rip), %eax
	movl	%eax, -16(%rbp)
	movl	$2, -20(%rbp)
	movl	C(%rip), %eax
	subl	$1, %eax
	movl	%eax, C(%rip)
	movl	C(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	H(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
	movl	$1, -24(%rbp)
	jmp	.L10
.L11:
	movl	-24(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %ebx
	movl	-24(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %edx
	movl	-24(%rbp), %eax
	addl	%eax, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	hyouka
	movl	%eax, %edx
	movl	%ebx, %eax
	subl	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	H(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	H(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	movl	%eax, -24(%rbp)
.L10:
	movl	C(%rip), %edx
	movl	-24(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	hyouka
	testl	%eax, %eax
	jne	.L11
	movl	-20(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	H(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-16(%rbp), %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	hout, .-hout
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\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
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -28(%rbp)
	jmp	.L14
.L15:
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %eax
	movl	%eax, %edi
	call	hin
	addl	$1, -28(%rbp)
.L14:
	movl	-36(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L15
	movl	$0, -32(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -28(%rbp)
	jmp	.L16
.L18:
	movl	-28(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	movl	%eax, %ebx
	movl	$0, %eax
	call	hout
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	cmpl	%eax, %ebx
	jne	.L17
	movl	-32(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -32(%rbp)
.L17:
	addl	$1, -28(%rbp)
.L16:
	movl	-36(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L18
	movl	-32(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	movq	-8(%rbp), %rbx
	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:
