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

```c
#include<stdio.h>
#include<stdlib.h>
long long 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]]||N[H[a]]==N[H[b]]&&H[a]%2==1?1:0;
}
//挿入関数
void hin(long long 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(){
  long long n,a[200010],b[200010],i,lb=0,bf,ans=0,ra,j,r,l;
  scanf("%lld",&n);
  for(i=0;i<n;i++)scanf("%lld %lld",&a[i],&b[i]);
  if(n%2==0){
    for(i=0;i<n;i++)hin(a[i]*2);
    for(i=0;i<n/2;i++)j=N[hout()];
    l=(N[H[1]]+j)/2;
    R=C=1;
    for(i=0;i<n;i++)hin(b[i]*2);
    for(i=0;i<n/2;i++)j=N[hout()];
    r=(N[H[1]]+j)/2;//printf("%lld %lld\n",l,r);
    printf("%lld\n",r-l+1);
  }
  else{
    for(i=0;i<n;i++)hin(a[i]);
    for(i=0;i<n/2;i++)hout();
    l=N[H[1]];
    R=C=1;
    for(i=0;i<n;i++)hin(b[i]);
    for(i=0;i<n/2;i++)hout();
    r=N[H[1]];
    printf("%lld\n",r-l+1);
  }
  return 0;
}
    
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	R
	.data
	.align 8
	.type	R, @object
	.size	R, 8
R:
	.quad	1
	.globl	C
	.align 8
	.type	C, @object
	.size	C, 8
C:
	.quad	1
	.globl	H
	.bss
	.align 32
	.type	H, @object
	.size	H, 16000080
H:
	.zero	16000080
	.globl	N
	.align 32
	.type	N, @object
	.size	N, 16000080
N:
	.zero	16000080
	.text
	.globl	hyouka
	.type	hyouka, @function
hyouka:
.LFB6:
	.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	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	C(%rip), %rax
	cmpq	%rax, %rdx
	jle	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	C(%rip), %rax
	cmpq	%rax, %rdx
	jg	.L4
	cmpl	$0, -8(%rbp)
	jne	.L5
.L4:
	movl	$0, %eax
	jmp	.L3
.L5:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	H(%rip), %rax
	movq	(%rdx,%rax), %rax
	leaq	0(,%rax,8), %rdx
	leaq	N(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	H(%rip), %rax
	movq	(%rcx,%rax), %rax
	leaq	0(,%rax,8), %rcx
	leaq	N(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	jl	.L6
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	H(%rip), %rax
	movq	(%rdx,%rax), %rax
	leaq	0(,%rax,8), %rdx
	leaq	N(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	H(%rip), %rax
	movq	(%rcx,%rax), %rax
	leaq	0(,%rax,8), %rcx
	leaq	N(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	jne	.L7
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	H(%rip), %rax
	movq	(%rdx,%rax), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	cmpq	$1, %rax
	jne	.L7
.L6:
	movl	$1, %eax
	jmp	.L3
.L7:
	movl	$0, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	hyouka, .-hyouka
	.globl	hin
	.type	hin, @function
hin:
.LFB7:
	.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
	movq	%rdi, -24(%rbp)
	movq	C(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, C(%rip)
	movl	%eax, -4(%rbp)
	movq	R(%rip), %rax
	movq	%rax, H(%rip)
	movq	H(%rip), %rax
	leaq	0(,%rax,8), %rcx
	leaq	N(%rip), %rdx
	movq	-24(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
	jmp	.L10
.L11:
	movl	-4(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	H(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	H(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
.L10:
	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	.L11
	movq	R(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, R(%rip)
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	H(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	hin, .-hin
	.globl	hout
	.type	hout, @function
hout:
.LFB8:
	.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
	movq	8+H(%rip), %rax
	movl	%eax, -16(%rbp)
	movl	$2, -20(%rbp)
	movq	C(%rip), %rax
	subq	$1, %rax
	movq	%rax, C(%rip)
	movq	C(%rip), %rax
	leaq	0(,%rax,8), %rdx
	leaq	H(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	%eax, -12(%rbp)
	movl	$1, -24(%rbp)
	jmp	.L13
.L14:
	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,8), %rdx
	leaq	H(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	H(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	movl	%eax, -24(%rbp)
.L13:
	movq	C(%rip), %rax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	hyouka
	testl	%eax, %eax
	jne	.L14
	movl	-20(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-12(%rbp), %eax
	cltq
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	H(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-16(%rbp), %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	hout, .-hout
	.section	.rodata
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld %lld"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-3198976(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1264, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -3200208(%rbp)
	movq	$0, -3200200(%rbp)
	leaq	-3200232(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -3200224(%rbp)
	jmp	.L17
.L18:
	leaq	-1600096(%rbp), %rdx
	movq	-3200224(%rbp), %rax
	salq	$3, %rax
	addq	%rax, %rdx
	leaq	-3200176(%rbp), %rcx
	movq	-3200224(%rbp), %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -3200224(%rbp)
.L17:
	movq	-3200232(%rbp), %rax
	cmpq	%rax, -3200224(%rbp)
	jl	.L18
	movq	-3200232(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L19
	movq	$0, -3200224(%rbp)
	jmp	.L20
.L21:
	movq	-3200224(%rbp), %rax
	movq	-3200176(%rbp,%rax,8), %rax
	addq	%rax, %rax
	movq	%rax, %rdi
	call	hin
	addq	$1, -3200224(%rbp)
.L20:
	movq	-3200232(%rbp), %rax
	cmpq	%rax, -3200224(%rbp)
	jl	.L21
	movq	$0, -3200224(%rbp)
	jmp	.L22
.L23:
	movl	$0, %eax
	call	hout
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	N(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -3200216(%rbp)
	addq	$1, -3200224(%rbp)
.L22:
	movq	-3200232(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	cmpq	%rax, -3200224(%rbp)
	jl	.L23
	movq	8+H(%rip), %rax
	leaq	0(,%rax,8), %rdx
	leaq	N(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-3200216(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -3200192(%rbp)
	movq	$1, C(%rip)
	movq	C(%rip), %rax
	movq	%rax, R(%rip)
	movq	$0, -3200224(%rbp)
	jmp	.L24
.L25:
	movq	-3200224(%rbp), %rax
	movq	-1600096(%rbp,%rax,8), %rax
	addq	%rax, %rax
	movq	%rax, %rdi
	call	hin
	addq	$1, -3200224(%rbp)
.L24:
	movq	-3200232(%rbp), %rax
	cmpq	%rax, -3200224(%rbp)
	jl	.L25
	movq	$0, -3200224(%rbp)
	jmp	.L26
.L27:
	movl	$0, %eax
	call	hout
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	N(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -3200216(%rbp)
	addq	$1, -3200224(%rbp)
.L26:
	movq	-3200232(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	cmpq	%rax, -3200224(%rbp)
	jl	.L27
	movq	8+H(%rip), %rax
	leaq	0(,%rax,8), %rdx
	leaq	N(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-3200216(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -3200184(%rbp)
	movq	-3200184(%rbp), %rax
	subq	-3200192(%rbp), %rax
	addq	$1, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L28
.L19:
	movq	$0, -3200224(%rbp)
	jmp	.L29
.L30:
	movq	-3200224(%rbp), %rax
	movq	-3200176(%rbp,%rax,8), %rax
	movq	%rax, %rdi
	call	hin
	addq	$1, -3200224(%rbp)
.L29:
	movq	-3200232(%rbp), %rax
	cmpq	%rax, -3200224(%rbp)
	jl	.L30
	movq	$0, -3200224(%rbp)
	jmp	.L31
.L32:
	movl	$0, %eax
	call	hout
	addq	$1, -3200224(%rbp)
.L31:
	movq	-3200232(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	cmpq	%rax, -3200224(%rbp)
	jl	.L32
	movq	8+H(%rip), %rax
	leaq	0(,%rax,8), %rdx
	leaq	N(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -3200192(%rbp)
	movq	$1, C(%rip)
	movq	C(%rip), %rax
	movq	%rax, R(%rip)
	movq	$0, -3200224(%rbp)
	jmp	.L33
.L34:
	movq	-3200224(%rbp), %rax
	movq	-1600096(%rbp,%rax,8), %rax
	movq	%rax, %rdi
	call	hin
	addq	$1, -3200224(%rbp)
.L33:
	movq	-3200232(%rbp), %rax
	cmpq	%rax, -3200224(%rbp)
	jl	.L34
	movq	$0, -3200224(%rbp)
	jmp	.L35
.L36:
	movl	$0, %eax
	call	hout
	addq	$1, -3200224(%rbp)
.L35:
	movq	-3200232(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	cmpq	%rax, -3200224(%rbp)
	jl	.L36
	movq	8+H(%rip), %rax
	leaq	0(,%rax,8), %rdx
	leaq	N(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -3200184(%rbp)
	movq	-3200184(%rbp), %rax
	subq	-3200192(%rbp), %rax
	addq	$1, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L28:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L38
	call	__stack_chk_fail@PLT
.L38:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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:
.LFB39:
	.cfi_startproc
	endbr64
	movq	C(%rip), %rax
	movslq	%esi, %rdx
	movl	$1, %r8d
	cmpq	%rax, %rdx
	jg	.L1
	movslq	%edi, %rdi
	cmpq	%rdi, %rax
	jl	.L4
	testl	%esi, %esi
	je	.L4
	leaq	H(%rip), %rsi
	leaq	N(%rip), %rcx
	movq	(%rsi,%rdx,8), %rdx
	movq	(%rsi,%rdi,8), %rax
	movq	(%rcx,%rdx,8), %rdx
	cmpq	%rdx, (%rcx,%rax,8)
	jge	.L8
.L1:
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%r8d, %r8d
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	movl	$0, %r8d
	jne	.L1
	movq	%rax, %rdx
	xorl	%r8d, %r8d
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	cmpq	$1, %rax
	sete	%r8b
	jmp	.L1
	.cfi_endproc
.LFE39:
	.size	hyouka, .-hyouka
	.p2align 4
	.globl	hin
	.type	hin, @function
hin:
.LFB40:
	.cfi_startproc
	endbr64
	movq	C(%rip), %rdx
	movq	R(%rip), %r8
	movq	%rdi, %r10
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	N(%rip), %r9
	leaq	H(%rip), %rsi
	leaq	1(%rdx), %rdi
	movq	%r8, H(%rip)
	movq	%rdi, C(%rip)
	movq	%rdi, %r11
	movq	%r10, (%r9,%r8,8)
	shrq	$63, %r11
.L10:
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	movslq	%eax, %rcx
	cmpq	%rcx, %rdi
	jl	.L11
	testl	%eax, %eax
	je	.L12
	testb	%r11b, %r11b
	jne	.L12
	movq	(%rsi,%rcx,8), %rcx
	movq	(%rsi), %r10
	movq	(%r9,%rcx,8), %rbx
	cmpq	%rbx, (%r9,%r10,8)
	jge	.L18
.L13:
	movslq	%edx, %rdx
	movq	%rcx, (%rsi,%rdx,8)
	movl	%eax, %edx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L18:
	je	.L19
.L12:
	leaq	1(%r8), %rax
	movslq	%edx, %rdx
	movq	%r8, (%rsi,%rdx,8)
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	movq	%rax, R(%rip)
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	movq	(%rsi,%rcx,8), %rcx
	movslq	%edx, %rdx
	movq	%rcx, (%rsi,%rdx,8)
	movl	%eax, %edx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L19:
	movq	%r10, %rbx
	shrq	$63, %rbx
	addq	%rbx, %r10
	andl	$1, %r10d
	subq	%rbx, %r10
	cmpq	$1, %r10
	jne	.L12
	jmp	.L13
	.cfi_endproc
.LFE40:
	.size	hin, .-hin
	.p2align 4
	.globl	hout
	.type	hout, @function
hout:
.LFB41:
	.cfi_startproc
	endbr64
	movq	C(%rip), %rax
	leaq	H(%rip), %rsi
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	8+H(%rip), %r10d
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	subq	$1, %rax
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	testl	%eax, %eax
	movslq	%eax, %rdx
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rax, C(%rip)
	sete	%bpl
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	(%rsi,%rax,8), %r8
	cmpq	%rdx, %rax
	jl	.L30
	movl	$1, %ecx
	movl	$2, %edx
	leaq	N(%rip), %r12
	movslq	%eax, %rbx
	movslq	%ecx, %rdi
	cmpq	%rdi, %rax
	jl	.L22
.L37:
	testb	%bpl, %bpl
	jne	.L22
	movq	(%rsi,%rbx,8), %r11
	movq	(%rsi,%rdi,8), %r9
	movq	(%r12,%r11,8), %r14
	cmpq	%r14, (%r12,%r9,8)
	jge	.L35
.L23:
	addl	%ecx, %ecx
	leal	1(%rcx), %edx
	movslq	%edx, %r9
	cmpq	%r9, %rax
	jl	.L24
	movslq	%ecx, %r11
	movq	(%rsi,%r9,8), %r9
	cmpq	%r11, %rax
	jl	.L25
	movq	(%rsi,%r11,8), %r11
	movq	(%r12,%r9,8), %r14
	cmpq	%r14, (%r12,%r11,8)
	jl	.L31
	je	.L36
.L25:
	movq	%r9, (%rsi,%rdi,8)
	movl	%edx, %ecx
.L38:
	movslq	%ecx, %rdi
	cmpq	%rdi, %rax
	jge	.L37
.L22:
	sarl	%edx
	movslq	%r8d, %rax
	movslq	%edx, %rdx
	movq	%rax, (%rsi,%rdx,8)
	movl	%r10d, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L35:
	.cfi_restore_state
	jne	.L22
	movq	%r9, %r11
	shrq	$63, %r11
	addq	%r11, %r9
	andl	$1, %r9d
	subq	%r11, %r9
	cmpq	$1, %r9
	jne	.L22
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L24:
	movslq	%ecx, %rdx
	movq	(%rsi,%rdx,8), %r9
	movl	%ecx, %edx
	movl	%edx, %ecx
	movq	%r9, (%rsi,%rdi,8)
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L30:
	movl	$1, %edx
	leaq	N(%rip), %r10
	leal	(%rdx,%rdx), %edi
	leal	1(%rdi), %ecx
	movslq	%ecx, %r8
	cmpq	%r8, %rax
	jl	.L39
.L33:
	movslq	%edi, %r9
	movq	(%rsi,%r8,8), %r8
	cmpq	%r9, %rax
	jl	.L27
	movq	(%rsi,%r9,8), %r9
	movq	(%r10,%r8,8), %rbx
	cmpq	%rbx, (%r10,%r9,8)
	jge	.L40
	movq	%r9, %r8
	movl	%edi, %ecx
.L27:
	movq	%r8, (%rsi,%rdx,8)
	movslq	%ecx, %rdx
.L41:
	leal	(%rdx,%rdx), %edi
	leal	1(%rdi), %ecx
	movslq	%ecx, %r8
	cmpq	%r8, %rax
	jge	.L33
.L39:
	movslq	%edi, %rcx
	movq	(%rsi,%rcx,8), %r8
	movl	%edi, %ecx
	movq	%r8, (%rsi,%rdx,8)
	movslq	%ecx, %rdx
	jmp	.L41
	.p2align 4,,10
	.p2align 3
.L31:
	movq	%r11, %r9
	movl	%ecx, %edx
	movq	%r9, (%rsi,%rdi,8)
	movl	%edx, %ecx
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L40:
	jne	.L27
	movq	%r9, %rbx
	shrq	$63, %rbx
	leaq	(%r9,%rbx), %r11
	andl	$1, %r11d
	subq	%rbx, %r11
	cmpq	$1, %r11
	cmove	%r9, %r8
	cmove	%edi, %ecx
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L36:
	movq	%r11, %r14
	shrq	$63, %r14
	leaq	(%r11,%r14), %r13
	andl	$1, %r13d
	subq	%r14, %r13
	cmpq	$1, %r13
	cmove	%r11, %r9
	cmove	%ecx, %edx
	jmp	.L25
	.cfi_endproc
.LFE41:
	.size	hout, .-hout
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld %lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB42:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-3198976(%rsp), %r11
	.cfi_def_cfa 11, 3199032
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1224, %rsp
	.cfi_def_cfa_offset 3200256
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 3200184(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rax
	testq	%rax, %rax
	jle	.L43
	leaq	16(%rsp), %r14
	xorl	%ebx, %ebx
	leaq	1600096(%rsp), %r13
	movq	%r14, %rbp
	leaq	.LC1(%rip), %r15
	.p2align 4,,10
	.p2align 3
.L44:
	leaq	0(%r13,%rbx,8), %rdx
	movq	%rbp, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rax
	addq	$1, %rbx
	addq	$8, %rbp
	cmpq	%rbx, %rax
	jg	.L44
	xorl	%ebx, %ebx
	testb	$1, %al
	jne	.L93
	testq	%rax, %rax
	jle	.L52
	.p2align 4,,10
	.p2align 3
.L49:
	movq	(%r14,%rbx,8), %rax
	addq	$1, %rbx
	leaq	(%rax,%rax), %rdi
	call	hin
	cmpq	%rbx, 8(%rsp)
	jg	.L49
.L52:
	xorl	%ebp, %ebp
	cmpq	$1, 8(%rsp)
	leaq	N(%rip), %rbx
	jle	.L51
	.p2align 4,,10
	.p2align 3
.L50:
	xorl	%eax, %eax
	addq	$1, %rbp
	call	hout
	movq	8(%rsp), %rdx
	cltq
	movq	(%rbx,%rax,8), %r12
	movq	%rdx, %rax
	shrq	$63, %rax
	addq	%rdx, %rax
	sarq	%rax
	cmpq	%rbp, %rax
	jg	.L50
.L51:
	movq	8+H(%rip), %rax
	xorl	%r14d, %r14d
	movq	$1, C(%rip)
	leaq	1600096(%rsp), %r13
	movq	$1, R(%rip)
	movq	(%rbx,%rax,8), %rcx
	addq	%r12, %rcx
	movq	%rcx, %rax
	movl	$2, %ecx
	cqto
	idivq	%rcx
	cmpq	$0, 8(%rsp)
	movq	%rax, %rbp
	jle	.L56
	.p2align 4,,10
	.p2align 3
.L53:
	movq	0(%r13,%r14,8), %rax
	addq	$1, %r14
	leaq	(%rax,%rax), %rdi
	call	hin
	cmpq	%r14, 8(%rsp)
	jg	.L53
.L56:
	xorl	%r13d, %r13d
	cmpq	$1, 8(%rsp)
	jle	.L55
	.p2align 4,,10
	.p2align 3
.L54:
	xorl	%eax, %eax
	addq	$1, %r13
	call	hout
	cltq
	movq	(%rbx,%rax,8), %r12
	movq	8(%rsp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rax, %rdx
	sarq	%rdx
	cmpq	%r13, %rdx
	jg	.L54
.L55:
	movq	8+H(%rip), %rax
	movl	$2, %ecx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	addq	(%rbx,%rax,8), %r12
	movq	%r12, %rax
	cqto
	idivq	%rcx
	subq	%rbp, %rax
	leaq	1(%rax), %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L57
.L93:
	testq	%rax, %rax
	jle	.L58
	.p2align 4,,10
	.p2align 3
.L46:
	movq	(%r14,%rbx,8), %rdi
	addq	$1, %rbx
	call	hin
	cmpq	%rbx, 8(%rsp)
	jg	.L46
.L58:
	xorl	%ebx, %ebx
	cmpq	$1, 8(%rsp)
	jle	.L48
	.p2align 4,,10
	.p2align 3
.L47:
	xorl	%eax, %eax
	addq	$1, %rbx
	call	hout
	movq	8(%rsp), %rdx
	movq	%rdx, %rax
	shrq	$63, %rax
	addq	%rdx, %rax
	sarq	%rax
	cmpq	%rbx, %rax
	jg	.L47
.L48:
	movq	8+H(%rip), %rax
	xorl	%r12d, %r12d
	leaq	N(%rip), %rbx
	cmpq	$0, 8(%rsp)
	movq	$1, C(%rip)
	leaq	1600096(%rsp), %r13
	movq	$1, R(%rip)
	movq	(%rbx,%rax,8), %rbp
	jle	.L60
	.p2align 4,,10
	.p2align 3
.L59:
	movq	0(%r13,%r12,8), %rdi
	addq	$1, %r12
	call	hin
	cmpq	%r12, 8(%rsp)
	jg	.L59
.L60:
	xorl	%r12d, %r12d
	cmpq	$1, 8(%rsp)
	jle	.L62
	.p2align 4,,10
	.p2align 3
.L61:
	xorl	%eax, %eax
	addq	$1, %r12
	call	hout
	movq	8(%rsp), %rdx
	movq	%rdx, %rax
	shrq	$63, %rax
	addq	%rdx, %rax
	sarq	%rax
	cmpq	%r12, %rax
	jg	.L61
.L62:
	movq	8+H(%rip), %rax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	movq	(%rbx,%rax,8), %rdx
	xorl	%eax, %eax
	subq	%rbp, %rdx
	addq	$1, %rdx
	call	__printf_chk@PLT
.L57:
	movq	3200184(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L94
	addq	$3200200, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L43:
	.cfi_restore_state
	leaq	N(%rip), %rbx
	testb	$1, %al
	je	.L51
	jmp	.L58
.L94:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE42:
	.size	main, .-main
	.globl	N
	.bss
	.align 32
	.type	N, @object
	.size	N, 16000080
N:
	.zero	16000080
	.globl	H
	.align 32
	.type	H, @object
	.size	H, 16000080
H:
	.zero	16000080
	.globl	C
	.data
	.align 8
	.type	C, @object
	.size	C, 8
C:
	.quad	1
	.globl	R
	.align 8
	.type	R, @object
	.size	R, 8
R:
	.quad	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:
.LFB39:
	.cfi_startproc
	endbr64
	movq	C(%rip), %rax
	movslq	%esi, %rdx
	movl	$1, %r8d
	cmpq	%rax, %rdx
	jg	.L1
	movslq	%edi, %rdi
	cmpq	%rdi, %rax
	jl	.L4
	testl	%esi, %esi
	je	.L4
	leaq	H(%rip), %rsi
	leaq	N(%rip), %rcx
	movq	(%rsi,%rdx,8), %rdx
	movq	(%rsi,%rdi,8), %rax
	movq	(%rcx,%rdx,8), %rdx
	cmpq	%rdx, (%rcx,%rax,8)
	jge	.L8
.L1:
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%r8d, %r8d
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	movl	$0, %r8d
	jne	.L1
	movq	%rax, %rdx
	xorl	%r8d, %r8d
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	cmpq	$1, %rax
	sete	%r8b
	jmp	.L1
	.cfi_endproc
.LFE39:
	.size	hyouka, .-hyouka
	.p2align 4
	.globl	hin
	.type	hin, @function
hin:
.LFB40:
	.cfi_startproc
	endbr64
	movq	C(%rip), %rdx
	movq	R(%rip), %r8
	movq	%rdi, %r10
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	N(%rip), %r9
	leaq	H(%rip), %rsi
	leaq	1(%rdx), %rdi
	movq	%r8, H(%rip)
	movq	%rdi, C(%rip)
	movq	%rdi, %r11
	movq	%r10, (%r9,%r8,8)
	shrq	$63, %r11
.L10:
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	movslq	%eax, %rcx
	cmpq	%rcx, %rdi
	jl	.L11
	testl	%eax, %eax
	je	.L12
	testb	%r11b, %r11b
	jne	.L12
	movq	(%rsi,%rcx,8), %rcx
	movq	(%rsi), %r10
	movq	(%r9,%rcx,8), %rbx
	cmpq	%rbx, (%r9,%r10,8)
	jge	.L18
.L13:
	movslq	%edx, %rdx
	movq	%rcx, (%rsi,%rdx,8)
	movl	%eax, %edx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L18:
	je	.L19
.L12:
	leaq	1(%r8), %rax
	movslq	%edx, %rdx
	movq	%r8, (%rsi,%rdx,8)
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	movq	%rax, R(%rip)
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	movq	(%rsi,%rcx,8), %rcx
	movslq	%edx, %rdx
	movq	%rcx, (%rsi,%rdx,8)
	movl	%eax, %edx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L19:
	movq	%r10, %rbx
	shrq	$63, %rbx
	addq	%rbx, %r10
	andl	$1, %r10d
	subq	%rbx, %r10
	cmpq	$1, %r10
	jne	.L12
	jmp	.L13
	.cfi_endproc
.LFE40:
	.size	hin, .-hin
	.p2align 4
	.globl	hout
	.type	hout, @function
hout:
.LFB41:
	.cfi_startproc
	endbr64
	movq	C(%rip), %rax
	leaq	H(%rip), %rsi
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	8+H(%rip), %r10d
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	subq	$1, %rax
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	testl	%eax, %eax
	movslq	%eax, %rdx
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rax, C(%rip)
	sete	%bpl
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	(%rsi,%rax,8), %r8
	cmpq	%rdx, %rax
	jl	.L30
	movl	$1, %ecx
	movl	$2, %edx
	leaq	N(%rip), %r12
	movslq	%eax, %rbx
	movslq	%ecx, %rdi
	cmpq	%rdi, %rax
	jl	.L22
.L37:
	testb	%bpl, %bpl
	jne	.L22
	movq	(%rsi,%rbx,8), %r11
	movq	(%rsi,%rdi,8), %r9
	movq	(%r12,%r11,8), %r14
	cmpq	%r14, (%r12,%r9,8)
	jge	.L35
.L23:
	addl	%ecx, %ecx
	leal	1(%rcx), %edx
	movslq	%edx, %r9
	cmpq	%r9, %rax
	jl	.L24
	movslq	%ecx, %r11
	movq	(%rsi,%r9,8), %r9
	cmpq	%r11, %rax
	jl	.L25
	movq	(%rsi,%r11,8), %r11
	movq	(%r12,%r9,8), %r14
	cmpq	%r14, (%r12,%r11,8)
	jl	.L31
	je	.L36
.L25:
	movq	%r9, (%rsi,%rdi,8)
	movl	%edx, %ecx
.L38:
	movslq	%ecx, %rdi
	cmpq	%rdi, %rax
	jge	.L37
.L22:
	sarl	%edx
	movslq	%r8d, %rax
	movslq	%edx, %rdx
	movq	%rax, (%rsi,%rdx,8)
	movl	%r10d, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L35:
	.cfi_restore_state
	jne	.L22
	movq	%r9, %r11
	shrq	$63, %r11
	addq	%r11, %r9
	andl	$1, %r9d
	subq	%r11, %r9
	cmpq	$1, %r9
	jne	.L22
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L24:
	movslq	%ecx, %rdx
	movq	(%rsi,%rdx,8), %r9
	movl	%ecx, %edx
	movl	%edx, %ecx
	movq	%r9, (%rsi,%rdi,8)
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L30:
	movl	$1, %edx
	leaq	N(%rip), %r10
	leal	(%rdx,%rdx), %edi
	leal	1(%rdi), %ecx
	movslq	%ecx, %r8
	cmpq	%r8, %rax
	jl	.L39
.L33:
	movslq	%edi, %r9
	movq	(%rsi,%r8,8), %r8
	cmpq	%r9, %rax
	jl	.L27
	movq	(%rsi,%r9,8), %r9
	movq	(%r10,%r8,8), %rbx
	cmpq	%rbx, (%r10,%r9,8)
	jge	.L40
	movq	%r9, %r8
	movl	%edi, %ecx
.L27:
	movq	%r8, (%rsi,%rdx,8)
	movslq	%ecx, %rdx
.L41:
	leal	(%rdx,%rdx), %edi
	leal	1(%rdi), %ecx
	movslq	%ecx, %r8
	cmpq	%r8, %rax
	jge	.L33
.L39:
	movslq	%edi, %rcx
	movq	(%rsi,%rcx,8), %r8
	movl	%edi, %ecx
	movq	%r8, (%rsi,%rdx,8)
	movslq	%ecx, %rdx
	jmp	.L41
	.p2align 4,,10
	.p2align 3
.L31:
	movq	%r11, %r9
	movl	%ecx, %edx
	movq	%r9, (%rsi,%rdi,8)
	movl	%edx, %ecx
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L40:
	jne	.L27
	movq	%r9, %rbx
	shrq	$63, %rbx
	leaq	(%r9,%rbx), %r11
	andl	$1, %r11d
	subq	%rbx, %r11
	cmpq	$1, %r11
	cmove	%r9, %r8
	cmove	%edi, %ecx
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L36:
	movq	%r11, %r14
	shrq	$63, %r14
	leaq	(%r11,%r14), %r13
	andl	$1, %r13d
	subq	%r14, %r13
	cmpq	$1, %r13
	cmove	%r11, %r9
	cmove	%ecx, %edx
	jmp	.L25
	.cfi_endproc
.LFE41:
	.size	hout, .-hout
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld %lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB42:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-3198976(%rsp), %r11
	.cfi_def_cfa 11, 3199032
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1224, %rsp
	.cfi_def_cfa_offset 3200256
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 3200184(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rax
	testq	%rax, %rax
	jle	.L43
	leaq	16(%rsp), %r14
	xorl	%ebx, %ebx
	leaq	1600096(%rsp), %r13
	movq	%r14, %rbp
	leaq	.LC1(%rip), %r15
	.p2align 4,,10
	.p2align 3
.L44:
	leaq	0(%r13,%rbx,8), %rdx
	movq	%rbp, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rax
	addq	$1, %rbx
	addq	$8, %rbp
	cmpq	%rbx, %rax
	jg	.L44
	xorl	%ebx, %ebx
	testb	$1, %al
	jne	.L93
	testq	%rax, %rax
	jle	.L52
	.p2align 4,,10
	.p2align 3
.L49:
	movq	(%r14,%rbx,8), %rax
	addq	$1, %rbx
	leaq	(%rax,%rax), %rdi
	call	hin
	cmpq	%rbx, 8(%rsp)
	jg	.L49
.L52:
	xorl	%ebp, %ebp
	cmpq	$1, 8(%rsp)
	leaq	N(%rip), %rbx
	jle	.L51
	.p2align 4,,10
	.p2align 3
.L50:
	xorl	%eax, %eax
	addq	$1, %rbp
	call	hout
	movq	8(%rsp), %rdx
	cltq
	movq	(%rbx,%rax,8), %r12
	movq	%rdx, %rax
	shrq	$63, %rax
	addq	%rdx, %rax
	sarq	%rax
	cmpq	%rbp, %rax
	jg	.L50
.L51:
	movq	8+H(%rip), %rax
	xorl	%r14d, %r14d
	movq	$1, C(%rip)
	leaq	1600096(%rsp), %r13
	movq	$1, R(%rip)
	movq	(%rbx,%rax,8), %rcx
	addq	%r12, %rcx
	movq	%rcx, %rax
	movl	$2, %ecx
	cqto
	idivq	%rcx
	cmpq	$0, 8(%rsp)
	movq	%rax, %rbp
	jle	.L56
	.p2align 4,,10
	.p2align 3
.L53:
	movq	0(%r13,%r14,8), %rax
	addq	$1, %r14
	leaq	(%rax,%rax), %rdi
	call	hin
	cmpq	%r14, 8(%rsp)
	jg	.L53
.L56:
	xorl	%r13d, %r13d
	cmpq	$1, 8(%rsp)
	jle	.L55
	.p2align 4,,10
	.p2align 3
.L54:
	xorl	%eax, %eax
	addq	$1, %r13
	call	hout
	cltq
	movq	(%rbx,%rax,8), %r12
	movq	8(%rsp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rax, %rdx
	sarq	%rdx
	cmpq	%r13, %rdx
	jg	.L54
.L55:
	movq	8+H(%rip), %rax
	movl	$2, %ecx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	addq	(%rbx,%rax,8), %r12
	movq	%r12, %rax
	cqto
	idivq	%rcx
	subq	%rbp, %rax
	leaq	1(%rax), %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L57
.L93:
	testq	%rax, %rax
	jle	.L58
	.p2align 4,,10
	.p2align 3
.L46:
	movq	(%r14,%rbx,8), %rdi
	addq	$1, %rbx
	call	hin
	cmpq	%rbx, 8(%rsp)
	jg	.L46
.L58:
	xorl	%ebx, %ebx
	cmpq	$1, 8(%rsp)
	jle	.L48
	.p2align 4,,10
	.p2align 3
.L47:
	xorl	%eax, %eax
	addq	$1, %rbx
	call	hout
	movq	8(%rsp), %rdx
	movq	%rdx, %rax
	shrq	$63, %rax
	addq	%rdx, %rax
	sarq	%rax
	cmpq	%rbx, %rax
	jg	.L47
.L48:
	movq	8+H(%rip), %rax
	xorl	%r12d, %r12d
	leaq	N(%rip), %rbx
	cmpq	$0, 8(%rsp)
	movq	$1, C(%rip)
	leaq	1600096(%rsp), %r13
	movq	$1, R(%rip)
	movq	(%rbx,%rax,8), %rbp
	jle	.L60
	.p2align 4,,10
	.p2align 3
.L59:
	movq	0(%r13,%r12,8), %rdi
	addq	$1, %r12
	call	hin
	cmpq	%r12, 8(%rsp)
	jg	.L59
.L60:
	xorl	%r12d, %r12d
	cmpq	$1, 8(%rsp)
	jle	.L62
	.p2align 4,,10
	.p2align 3
.L61:
	xorl	%eax, %eax
	addq	$1, %r12
	call	hout
	movq	8(%rsp), %rdx
	movq	%rdx, %rax
	shrq	$63, %rax
	addq	%rdx, %rax
	sarq	%rax
	cmpq	%r12, %rax
	jg	.L61
.L62:
	movq	8+H(%rip), %rax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	movq	(%rbx,%rax,8), %rdx
	xorl	%eax, %eax
	subq	%rbp, %rdx
	addq	$1, %rdx
	call	__printf_chk@PLT
.L57:
	movq	3200184(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L94
	addq	$3200200, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L43:
	.cfi_restore_state
	leaq	N(%rip), %rbx
	testb	$1, %al
	je	.L51
	jmp	.L58
.L94:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE42:
	.size	main, .-main
	.globl	N
	.bss
	.align 32
	.type	N, @object
	.size	N, 16000080
N:
	.zero	16000080
	.globl	H
	.align 32
	.type	H, @object
	.size	H, 16000080
H:
	.zero	16000080
	.globl	C
	.data
	.align 8
	.type	C, @object
	.size	C, 8
C:
	.quad	1
	.globl	R
	.align 8
	.type	R, @object
	.size	R, 8
R:
	.quad	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>
#include<stdlib.h>
long long 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]]||N[H[a]]==N[H[b]]&&H[a]%2==1?1:0;
}
//挿入関数
void hin(long long 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(){
  long long n,a[200010],b[200010],i,lb=0,bf,ans=0,ra,j,r,l;
  scanf("%lld",&n);
  for(i=0;i<n;i++)scanf("%lld %lld",&a[i],&b[i]);
  if(n%2==0){
    for(i=0;i<n;i++)hin(a[i]*2);
    for(i=0;i<n/2;i++)j=N[hout()];
    l=(N[H[1]]+j)/2;
    R=C=1;
    for(i=0;i<n;i++)hin(b[i]*2);
    for(i=0;i<n/2;i++)j=N[hout()];
    r=(N[H[1]]+j)/2;//printf("%lld %lld\n",l,r);
    printf("%lld\n",r-l+1);
  }
  else{
    for(i=0;i<n;i++)hin(a[i]);
    for(i=0;i<n/2;i++)hout();
    l=N[H[1]];
    R=C=1;
    for(i=0;i<n;i++)hin(b[i]);
    for(i=0;i<n/2;i++)hout();
    r=N[H[1]];
    printf("%lld\n",r-l+1);
  }
  return 0;
}
    

3
100 100
8 10000
1 1000000000
 2
1 2
2 4
 3
100 100
8 11000
1 1000000000
 2
1 1
2 4
 2
1 1
1 7
 2
0 1
1 7
 2
0 1
0 7
 3
000 010
8 11000
1 1001000000
 2
0 1
0 8
 3
000 010
8 11000
2 1001000000

9993
 4
 10993
 3
 7
 8
 9
 11000
 10
 10999

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

```c
#include<stdio.h>
#include<stdlib.h>
long long 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]]||N[H[a]]==N[H[b]]&&H[a]%2==1?1:0;
}
//挿入関数
void hin(long long 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(){
  long long n,a[200010],b[200010],i,lb=0,bf,ans=0,ra,j,r,l;
  scanf("%lld",&n);
  for(i=0;i<n;i++)scanf("%lld %lld",&a[i],&b[i]);
  if(n%2==0){
    for(i=0;i<n;i++)hin(a[i]*2);
    for(i=0;i<n/2;i++)j=N[hout()];
    l=(N[H[1]]+j)/2;
    R=C=1;
    for(i=0;i<n;i++)hin(b[i]*2);
    for(i=0;i<n/2;i++)j=N[hout()];
    r=(N[H[1]]+j)/2;//printf("%lld %lld\n",l,r);
    printf("%lld\n",r-l+1);
  }
  else{
    for(i=0;i<n;i++)hin(a[i]);
    for(i=0;i<n/2;i++)hout();
    l=N[H[1]];
    R=C=1;
    for(i=0;i<n;i++)hin(b[i]);
    for(i=0;i<n/2;i++)hout();
    r=N[H[1]];
    printf("%lld\n",r-l+1);
  }
  return 0;
}
    
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	R
	.data
	.align 8
	.type	R, @object
	.size	R, 8
R:
	.quad	1
	.globl	C
	.align 8
	.type	C, @object
	.size	C, 8
C:
	.quad	1
	.globl	H
	.bss
	.align 32
	.type	H, @object
	.size	H, 16000080
H:
	.zero	16000080
	.globl	N
	.align 32
	.type	N, @object
	.size	N, 16000080
N:
	.zero	16000080
	.text
	.globl	hyouka
	.type	hyouka, @function
hyouka:
.LFB6:
	.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	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	C(%rip), %rax
	cmpq	%rax, %rdx
	jle	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	C(%rip), %rax
	cmpq	%rax, %rdx
	jg	.L4
	cmpl	$0, -8(%rbp)
	jne	.L5
.L4:
	movl	$0, %eax
	jmp	.L3
.L5:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	H(%rip), %rax
	movq	(%rdx,%rax), %rax
	leaq	0(,%rax,8), %rdx
	leaq	N(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	H(%rip), %rax
	movq	(%rcx,%rax), %rax
	leaq	0(,%rax,8), %rcx
	leaq	N(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	jl	.L6
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	H(%rip), %rax
	movq	(%rdx,%rax), %rax
	leaq	0(,%rax,8), %rdx
	leaq	N(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	H(%rip), %rax
	movq	(%rcx,%rax), %rax
	leaq	0(,%rax,8), %rcx
	leaq	N(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	jne	.L7
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	H(%rip), %rax
	movq	(%rdx,%rax), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	cmpq	$1, %rax
	jne	.L7
.L6:
	movl	$1, %eax
	jmp	.L3
.L7:
	movl	$0, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	hyouka, .-hyouka
	.globl	hin
	.type	hin, @function
hin:
.LFB7:
	.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
	movq	%rdi, -24(%rbp)
	movq	C(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, C(%rip)
	movl	%eax, -4(%rbp)
	movq	R(%rip), %rax
	movq	%rax, H(%rip)
	movq	H(%rip), %rax
	leaq	0(,%rax,8), %rcx
	leaq	N(%rip), %rdx
	movq	-24(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
	jmp	.L10
.L11:
	movl	-4(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	H(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	H(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
.L10:
	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	.L11
	movq	R(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, R(%rip)
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	H(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	hin, .-hin
	.globl	hout
	.type	hout, @function
hout:
.LFB8:
	.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
	movq	8+H(%rip), %rax
	movl	%eax, -16(%rbp)
	movl	$2, -20(%rbp)
	movq	C(%rip), %rax
	subq	$1, %rax
	movq	%rax, C(%rip)
	movq	C(%rip), %rax
	leaq	0(,%rax,8), %rdx
	leaq	H(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	%eax, -12(%rbp)
	movl	$1, -24(%rbp)
	jmp	.L13
.L14:
	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,8), %rdx
	leaq	H(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	H(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	movl	%eax, -24(%rbp)
.L13:
	movq	C(%rip), %rax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	hyouka
	testl	%eax, %eax
	jne	.L14
	movl	-20(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-12(%rbp), %eax
	cltq
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	H(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-16(%rbp), %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	hout, .-hout
	.section	.rodata
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld %lld"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-3198976(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1264, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -3200208(%rbp)
	movq	$0, -3200200(%rbp)
	leaq	-3200232(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -3200224(%rbp)
	jmp	.L17
.L18:
	leaq	-1600096(%rbp), %rdx
	movq	-3200224(%rbp), %rax
	salq	$3, %rax
	addq	%rax, %rdx
	leaq	-3200176(%rbp), %rcx
	movq	-3200224(%rbp), %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -3200224(%rbp)
.L17:
	movq	-3200232(%rbp), %rax
	cmpq	%rax, -3200224(%rbp)
	jl	.L18
	movq	-3200232(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L19
	movq	$0, -3200224(%rbp)
	jmp	.L20
.L21:
	movq	-3200224(%rbp), %rax
	movq	-3200176(%rbp,%rax,8), %rax
	addq	%rax, %rax
	movq	%rax, %rdi
	call	hin
	addq	$1, -3200224(%rbp)
.L20:
	movq	-3200232(%rbp), %rax
	cmpq	%rax, -3200224(%rbp)
	jl	.L21
	movq	$0, -3200224(%rbp)
	jmp	.L22
.L23:
	movl	$0, %eax
	call	hout
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	N(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -3200216(%rbp)
	addq	$1, -3200224(%rbp)
.L22:
	movq	-3200232(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	cmpq	%rax, -3200224(%rbp)
	jl	.L23
	movq	8+H(%rip), %rax
	leaq	0(,%rax,8), %rdx
	leaq	N(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-3200216(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -3200192(%rbp)
	movq	$1, C(%rip)
	movq	C(%rip), %rax
	movq	%rax, R(%rip)
	movq	$0, -3200224(%rbp)
	jmp	.L24
.L25:
	movq	-3200224(%rbp), %rax
	movq	-1600096(%rbp,%rax,8), %rax
	addq	%rax, %rax
	movq	%rax, %rdi
	call	hin
	addq	$1, -3200224(%rbp)
.L24:
	movq	-3200232(%rbp), %rax
	cmpq	%rax, -3200224(%rbp)
	jl	.L25
	movq	$0, -3200224(%rbp)
	jmp	.L26
.L27:
	movl	$0, %eax
	call	hout
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	N(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -3200216(%rbp)
	addq	$1, -3200224(%rbp)
.L26:
	movq	-3200232(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	cmpq	%rax, -3200224(%rbp)
	jl	.L27
	movq	8+H(%rip), %rax
	leaq	0(,%rax,8), %rdx
	leaq	N(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-3200216(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -3200184(%rbp)
	movq	-3200184(%rbp), %rax
	subq	-3200192(%rbp), %rax
	addq	$1, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L28
.L19:
	movq	$0, -3200224(%rbp)
	jmp	.L29
.L30:
	movq	-3200224(%rbp), %rax
	movq	-3200176(%rbp,%rax,8), %rax
	movq	%rax, %rdi
	call	hin
	addq	$1, -3200224(%rbp)
.L29:
	movq	-3200232(%rbp), %rax
	cmpq	%rax, -3200224(%rbp)
	jl	.L30
	movq	$0, -3200224(%rbp)
	jmp	.L31
.L32:
	movl	$0, %eax
	call	hout
	addq	$1, -3200224(%rbp)
.L31:
	movq	-3200232(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	cmpq	%rax, -3200224(%rbp)
	jl	.L32
	movq	8+H(%rip), %rax
	leaq	0(,%rax,8), %rdx
	leaq	N(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -3200192(%rbp)
	movq	$1, C(%rip)
	movq	C(%rip), %rax
	movq	%rax, R(%rip)
	movq	$0, -3200224(%rbp)
	jmp	.L33
.L34:
	movq	-3200224(%rbp), %rax
	movq	-1600096(%rbp,%rax,8), %rax
	movq	%rax, %rdi
	call	hin
	addq	$1, -3200224(%rbp)
.L33:
	movq	-3200232(%rbp), %rax
	cmpq	%rax, -3200224(%rbp)
	jl	.L34
	movq	$0, -3200224(%rbp)
	jmp	.L35
.L36:
	movl	$0, %eax
	call	hout
	addq	$1, -3200224(%rbp)
.L35:
	movq	-3200232(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	cmpq	%rax, -3200224(%rbp)
	jl	.L36
	movq	8+H(%rip), %rax
	leaq	0(,%rax,8), %rdx
	leaq	N(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -3200184(%rbp)
	movq	-3200184(%rbp), %rax
	subq	-3200192(%rbp), %rax
	addq	$1, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L28:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L38
	call	__stack_chk_fail@PLT
.L38:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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 8
	.type	R, @object
	.size	R, 8
R:
	.quad	1
	.globl	C
	.align 8
	.type	C, @object
	.size	C, 8
C:
	.quad	1
	.globl	H
	.bss
	.align 32
	.type	H, @object
	.size	H, 16000080
H:
	.zero	16000080
	.globl	N
	.align 32
	.type	N, @object
	.size	N, 16000080
N:
	.zero	16000080
	.text
	.globl	hyouka
	.type	hyouka, @function
hyouka:
.LFB6:
	.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	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	C(%rip), %rax
	cmpq	%rax, %rdx
	jle	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	C(%rip), %rax
	cmpq	%rax, %rdx
	jg	.L4
	cmpl	$0, -8(%rbp)
	jne	.L5
.L4:
	movl	$0, %eax
	jmp	.L3
.L5:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	H(%rip), %rax
	movq	(%rdx,%rax), %rax
	leaq	0(,%rax,8), %rdx
	leaq	N(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	H(%rip), %rax
	movq	(%rcx,%rax), %rax
	leaq	0(,%rax,8), %rcx
	leaq	N(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	jl	.L6
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	H(%rip), %rax
	movq	(%rdx,%rax), %rax
	leaq	0(,%rax,8), %rdx
	leaq	N(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	H(%rip), %rax
	movq	(%rcx,%rax), %rax
	leaq	0(,%rax,8), %rcx
	leaq	N(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	jne	.L7
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	H(%rip), %rax
	movq	(%rdx,%rax), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	cmpq	$1, %rax
	jne	.L7
.L6:
	movl	$1, %eax
	jmp	.L3
.L7:
	movl	$0, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	hyouka, .-hyouka
	.globl	hin
	.type	hin, @function
hin:
.LFB7:
	.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
	movq	%rdi, -24(%rbp)
	movq	C(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, C(%rip)
	movl	%eax, -4(%rbp)
	movq	R(%rip), %rax
	movq	%rax, H(%rip)
	movq	H(%rip), %rax
	leaq	0(,%rax,8), %rcx
	leaq	N(%rip), %rdx
	movq	-24(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
	jmp	.L10
.L11:
	movl	-4(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	H(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	H(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
.L10:
	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	.L11
	movq	R(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, R(%rip)
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	H(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	hin, .-hin
	.globl	hout
	.type	hout, @function
hout:
.LFB8:
	.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
	movq	8+H(%rip), %rax
	movl	%eax, -16(%rbp)
	movl	$2, -20(%rbp)
	movq	C(%rip), %rax
	subq	$1, %rax
	movq	%rax, C(%rip)
	movq	C(%rip), %rax
	leaq	0(,%rax,8), %rdx
	leaq	H(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	%eax, -12(%rbp)
	movl	$1, -24(%rbp)
	jmp	.L13
.L14:
	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,8), %rdx
	leaq	H(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	H(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	movl	%eax, -24(%rbp)
.L13:
	movq	C(%rip), %rax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	hyouka
	testl	%eax, %eax
	jne	.L14
	movl	-20(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-12(%rbp), %eax
	cltq
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	H(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-16(%rbp), %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	hout, .-hout
	.section	.rodata
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld %lld"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-3198976(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1264, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -3200208(%rbp)
	movq	$0, -3200200(%rbp)
	leaq	-3200232(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -3200224(%rbp)
	jmp	.L17
.L18:
	leaq	-1600096(%rbp), %rdx
	movq	-3200224(%rbp), %rax
	salq	$3, %rax
	addq	%rax, %rdx
	leaq	-3200176(%rbp), %rcx
	movq	-3200224(%rbp), %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -3200224(%rbp)
.L17:
	movq	-3200232(%rbp), %rax
	cmpq	%rax, -3200224(%rbp)
	jl	.L18
	movq	-3200232(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L19
	movq	$0, -3200224(%rbp)
	jmp	.L20
.L21:
	movq	-3200224(%rbp), %rax
	movq	-3200176(%rbp,%rax,8), %rax
	addq	%rax, %rax
	movq	%rax, %rdi
	call	hin
	addq	$1, -3200224(%rbp)
.L20:
	movq	-3200232(%rbp), %rax
	cmpq	%rax, -3200224(%rbp)
	jl	.L21
	movq	$0, -3200224(%rbp)
	jmp	.L22
.L23:
	movl	$0, %eax
	call	hout
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	N(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -3200216(%rbp)
	addq	$1, -3200224(%rbp)
.L22:
	movq	-3200232(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	cmpq	%rax, -3200224(%rbp)
	jl	.L23
	movq	8+H(%rip), %rax
	leaq	0(,%rax,8), %rdx
	leaq	N(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-3200216(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -3200192(%rbp)
	movq	$1, C(%rip)
	movq	C(%rip), %rax
	movq	%rax, R(%rip)
	movq	$0, -3200224(%rbp)
	jmp	.L24
.L25:
	movq	-3200224(%rbp), %rax
	movq	-1600096(%rbp,%rax,8), %rax
	addq	%rax, %rax
	movq	%rax, %rdi
	call	hin
	addq	$1, -3200224(%rbp)
.L24:
	movq	-3200232(%rbp), %rax
	cmpq	%rax, -3200224(%rbp)
	jl	.L25
	movq	$0, -3200224(%rbp)
	jmp	.L26
.L27:
	movl	$0, %eax
	call	hout
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	N(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -3200216(%rbp)
	addq	$1, -3200224(%rbp)
.L26:
	movq	-3200232(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	cmpq	%rax, -3200224(%rbp)
	jl	.L27
	movq	8+H(%rip), %rax
	leaq	0(,%rax,8), %rdx
	leaq	N(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-3200216(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -3200184(%rbp)
	movq	-3200184(%rbp), %rax
	subq	-3200192(%rbp), %rax
	addq	$1, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L28
.L19:
	movq	$0, -3200224(%rbp)
	jmp	.L29
.L30:
	movq	-3200224(%rbp), %rax
	movq	-3200176(%rbp,%rax,8), %rax
	movq	%rax, %rdi
	call	hin
	addq	$1, -3200224(%rbp)
.L29:
	movq	-3200232(%rbp), %rax
	cmpq	%rax, -3200224(%rbp)
	jl	.L30
	movq	$0, -3200224(%rbp)
	jmp	.L31
.L32:
	movl	$0, %eax
	call	hout
	addq	$1, -3200224(%rbp)
.L31:
	movq	-3200232(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	cmpq	%rax, -3200224(%rbp)
	jl	.L32
	movq	8+H(%rip), %rax
	leaq	0(,%rax,8), %rdx
	leaq	N(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -3200192(%rbp)
	movq	$1, C(%rip)
	movq	C(%rip), %rax
	movq	%rax, R(%rip)
	movq	$0, -3200224(%rbp)
	jmp	.L33
.L34:
	movq	-3200224(%rbp), %rax
	movq	-1600096(%rbp,%rax,8), %rax
	movq	%rax, %rdi
	call	hin
	addq	$1, -3200224(%rbp)
.L33:
	movq	-3200232(%rbp), %rax
	cmpq	%rax, -3200224(%rbp)
	jl	.L34
	movq	$0, -3200224(%rbp)
	jmp	.L35
.L36:
	movl	$0, %eax
	call	hout
	addq	$1, -3200224(%rbp)
.L35:
	movq	-3200232(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	cmpq	%rax, -3200224(%rbp)
	jl	.L36
	movq	8+H(%rip), %rax
	leaq	0(,%rax,8), %rdx
	leaq	N(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -3200184(%rbp)
	movq	-3200184(%rbp), %rax
	subq	-3200192(%rbp), %rax
	addq	$1, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L28:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L38
	call	__stack_chk_fail@PLT
.L38:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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:
