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

```c
#include<stdio.h>
#define rep(i,l,r)for(int i=(l);i<(r);i++)
#define max(p,q)((p)>(q)?(p):(q))

int a[2][100010];
int main(){
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		int t;
		scanf("%d",&t);
		a[i%2][t]++;
	}
	int M[2][2]={},c[2][2];
	for(int i=1;i<=100000;i++){
		for(int j=0;j<2;j++){
			if(M[j][0]<=a[j][i]){
				M[j][1]=M[j][0];
				c[j][1]=c[j][0];
				M[j][0]=a[j][i];
				c[j][0]=i;
			}else if(M[j][1]<=a[j][i]){
				M[j][1]=a[j][i];
				c[j][1]=i;
			}
		}
	}
	int ans;
	if(c[0][0]==c[1][0])ans=M[0][0]+max(M[0][1],M[1][1]);
	else ans=M[0][0]+M[1][0];
	printf("%d",n-ans);
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	leaq	a(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %rdi
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %edx
	testl	%edx, %edx
	jle	.L2
	xorl	%r15d, %r15d
	leaq	4(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r14, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	%r15d, %eax
	movslq	4(%rsp), %rdx
	addl	$1, %r15d
	andl	$1, %eax
	imulq	$100010, %rax, %rax
	addq	%rdx, %rax
	movl	(%rsp), %edx
	addl	$1, 0(%r13,%rax,4)
	cmpl	%r15d, %edx
	jg	.L3
.L2:
	movl	$1, %eax
	xorl	%r9d, %r9d
	xorl	%edi, %edi
	xorl	%esi, %esi
	xorl	%r8d, %r8d
	leaq	400040+a(%rip), %r11
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L18:
	cmpl	%ecx, %esi
	cmovl	%ecx, %esi
	movl	(%r11,%rax,4), %ecx
	cmpl	%ecx, %edi
	jle	.L11
.L19:
	cmpl	%ecx, %r9d
	cmovl	%ecx, %r9d
	addq	$1, %rax
	cmpq	$100001, %rax
	je	.L17
.L6:
	movl	0(%r13,%rax,4), %ecx
	movl	%eax, %r10d
	cmpl	%r8d, %ecx
	jl	.L18
	movl	%r8d, %esi
	movl	%ecx, %r8d
	movl	(%r11,%rax,4), %ecx
	movl	%eax, %r12d
	cmpl	%ecx, %edi
	jg	.L19
.L11:
	addq	$1, %rax
	movl	%edi, %r9d
	movl	%r10d, %ebx
	movl	%ecx, %edi
	cmpq	$100001, %rax
	jne	.L6
.L17:
	cmpl	%r9d, %esi
	movl	%r9d, %eax
	cmovge	%esi, %eax
	addl	%r8d, %edi
	movq	%rbp, %rsi
	addl	%r8d, %eax
	cmpl	%ebx, %r12d
	cmovne	%edi, %eax
	movl	$1, %edi
	subl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$24, %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
.L20:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 800080
a:
	.zero	800080
	.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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	leaq	a(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %rdi
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %edx
	testl	%edx, %edx
	jle	.L2
	xorl	%r15d, %r15d
	leaq	4(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r14, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	%r15d, %eax
	movslq	4(%rsp), %rdx
	addl	$1, %r15d
	andl	$1, %eax
	imulq	$100010, %rax, %rax
	addq	%rdx, %rax
	movl	(%rsp), %edx
	addl	$1, 0(%r13,%rax,4)
	cmpl	%r15d, %edx
	jg	.L3
.L2:
	movl	$1, %eax
	xorl	%r9d, %r9d
	xorl	%edi, %edi
	xorl	%esi, %esi
	xorl	%r8d, %r8d
	leaq	400040+a(%rip), %r11
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L18:
	cmpl	%ecx, %esi
	cmovl	%ecx, %esi
	movl	(%r11,%rax,4), %ecx
	cmpl	%ecx, %edi
	jle	.L11
.L19:
	cmpl	%ecx, %r9d
	cmovl	%ecx, %r9d
	addq	$1, %rax
	cmpq	$100001, %rax
	je	.L17
.L6:
	movl	0(%r13,%rax,4), %ecx
	movl	%eax, %r10d
	cmpl	%r8d, %ecx
	jl	.L18
	movl	%r8d, %esi
	movl	%ecx, %r8d
	movl	(%r11,%rax,4), %ecx
	movl	%eax, %r12d
	cmpl	%ecx, %edi
	jg	.L19
.L11:
	addq	$1, %rax
	movl	%edi, %r9d
	movl	%r10d, %ebx
	movl	%ecx, %edi
	cmpq	$100001, %rax
	jne	.L6
.L17:
	cmpl	%r9d, %esi
	movl	%r9d, %eax
	cmovge	%esi, %eax
	addl	%r8d, %edi
	movq	%rbp, %rsi
	addl	%r8d, %eax
	cmpl	%ebx, %r12d
	cmovne	%edi, %eax
	movl	$1, %edi
	subl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$24, %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
.L20:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 800080
a:
	.zero	800080
	.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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	leaq	a(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %rdi
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %edx
	testl	%edx, %edx
	jle	.L2
	xorl	%r15d, %r15d
	leaq	4(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r14, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	%r15d, %eax
	movslq	4(%rsp), %rdx
	addl	$1, %r15d
	andl	$1, %eax
	imulq	$100010, %rax, %rax
	addq	%rdx, %rax
	movl	(%rsp), %edx
	addl	$1, 0(%r13,%rax,4)
	cmpl	%r15d, %edx
	jg	.L3
.L2:
	movl	$1, %eax
	xorl	%r9d, %r9d
	xorl	%edi, %edi
	xorl	%esi, %esi
	xorl	%r8d, %r8d
	leaq	400040+a(%rip), %r11
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L18:
	cmpl	%ecx, %esi
	cmovl	%ecx, %esi
	movl	(%r11,%rax,4), %ecx
	cmpl	%ecx, %edi
	jle	.L11
.L19:
	cmpl	%ecx, %r9d
	cmovl	%ecx, %r9d
	addq	$1, %rax
	cmpq	$100001, %rax
	je	.L17
.L6:
	movl	0(%r13,%rax,4), %ecx
	movl	%eax, %r10d
	cmpl	%r8d, %ecx
	jl	.L18
	movl	%r8d, %esi
	movl	%ecx, %r8d
	movl	(%r11,%rax,4), %ecx
	movl	%eax, %r12d
	cmpl	%ecx, %edi
	jg	.L19
.L11:
	addq	$1, %rax
	movl	%edi, %r9d
	movl	%r10d, %ebx
	movl	%ecx, %edi
	cmpq	$100001, %rax
	jne	.L6
.L17:
	cmpl	%r9d, %esi
	movl	%r9d, %eax
	cmovge	%esi, %eax
	addl	%r8d, %edi
	movq	%rbp, %rsi
	addl	%r8d, %eax
	cmpl	%ebx, %r12d
	cmovne	%edi, %eax
	movl	$1, %edi
	subl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$24, %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
.L20:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 800080
a:
	.zero	800080
	.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:
```
```c
#include<stdio.h>
#define rep(i,l,r)for(int i=(l);i<(r);i++)
#define max(p,q)((p)>(q)?(p):(q))

int a[2][100010];
int main(){
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		int t;
		scanf("%d",&t);
		a[i%2][t]++;
	}
	int M[2][2]={},c[2][2];
	for(int i=1;i<=100000;i++){
		for(int j=0;j<2;j++){
			if(M[j][0]<=a[j][i]){
				M[j][1]=M[j][0];
				c[j][1]=c[j][0];
				M[j][0]=a[j][i];
				c[j][0]=i;
			}else if(M[j][1]<=a[j][i]){
				M[j][1]=a[j][i];
				c[j][1]=i;
			}
		}
	}
	int ans;
	if(c[0][0]==c[1][0])ans=M[0][0]+max(M[0][1],M[1][1]);
	else ans=M[0][0]+M[1][0];
	printf("%d",n-ans);
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
#define rep(i,l,r)for(int i=(l);i<(r);i++)
#define max(p,q)((p)>(q)?(p):(q))

int a[2][100010];
int main(){
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		int t;
		scanf("%d",&t);
		a[i%2][t]++;
	}
	int M[2][2]={},c[2][2];
	for(int i=1;i<=100000;i++){
		for(int j=0;j<2;j++){
			if(M[j][0]<=a[j][i]){
				M[j][1]=M[j][0];
				c[j][1]=c[j][0];
				M[j][0]=a[j][i];
				c[j][0]=i;
			}else if(M[j][1]<=a[j][i]){
				M[j][1]=a[j][i];
				c[j][1]=i;
			}
		}
	}
	int ans;
	if(c[0][0]==c[1][0])ans=M[0][0]+max(M[0][1],M[1][1]);
	else ans=M[0][0]+M[1][0];
	printf("%d",n-ans);
}```

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.
Optimized Assembly Code:

4
3 2 3 2
 6
105 119 204 119 105 119
 4
4 1 3 2
 6
105 120 54 119 105 78
 6
105 120 54 119 190 78
 6
105 119 204 119 105 78
 4
4 1 3 0
 6
105 119 54 119 105 78
 4
4 1 3 1
 4
4 1 6 1

0 1 2 3 4 2 2 2 1 1
Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
#define rep(i,l,r)for(int i=(l);i<(r);i++)
#define max(p,q)((p)>(q)?(p):(q))

int a[2][100010];
int main(){
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		int t;
		scanf("%d",&t);
		a[i%2][t]++;
	}
	int M[2][2]={},c[2][2];
	for(int i=1;i<=100000;i++){
		for(int j=0;j<2;j++){
			if(M[j][0]<=a[j][i]){
				M[j][1]=M[j][0];
				c[j][1]=c[j][0];
				M[j][0]=a[j][i];
				c[j][0]=i;
			}else if(M[j][1]<=a[j][i]){
				M[j][1]=a[j][i];
				c[j][1]=i;
			}
		}
	}
	int ans;
	if(c[0][0]==c[1][0])ans=M[0][0]+max(M[0][1],M[1][1]);
	else ans=M[0][0]+M[1][0];
	printf("%d",n-ans);
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	leaq	a(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %rdi
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %edx
	testl	%edx, %edx
	jle	.L2
	xorl	%r15d, %r15d
	leaq	4(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r14, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	%r15d, %eax
	movslq	4(%rsp), %rdx
	addl	$1, %r15d
	andl	$1, %eax
	imulq	$100010, %rax, %rax
	addq	%rdx, %rax
	movl	(%rsp), %edx
	addl	$1, 0(%r13,%rax,4)
	cmpl	%r15d, %edx
	jg	.L3
.L2:
	movl	$1, %eax
	xorl	%r9d, %r9d
	xorl	%edi, %edi
	xorl	%esi, %esi
	xorl	%r8d, %r8d
	leaq	400040+a(%rip), %r11
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L18:
	cmpl	%ecx, %esi
	cmovl	%ecx, %esi
	movl	(%r11,%rax,4), %ecx
	cmpl	%ecx, %edi
	jle	.L11
.L19:
	cmpl	%ecx, %r9d
	cmovl	%ecx, %r9d
	addq	$1, %rax
	cmpq	$100001, %rax
	je	.L17
.L6:
	movl	0(%r13,%rax,4), %ecx
	movl	%eax, %r10d
	cmpl	%r8d, %ecx
	jl	.L18
	movl	%r8d, %esi
	movl	%ecx, %r8d
	movl	(%r11,%rax,4), %ecx
	movl	%eax, %r12d
	cmpl	%ecx, %edi
	jg	.L19
.L11:
	addq	$1, %rax
	movl	%edi, %r9d
	movl	%r10d, %ebx
	movl	%ecx, %edi
	cmpq	$100001, %rax
	jne	.L6
.L17:
	cmpl	%r9d, %esi
	movl	%r9d, %eax
	cmovge	%esi, %eax
	addl	%r8d, %edi
	movq	%rbp, %rsi
	addl	%r8d, %eax
	cmpl	%ebx, %r12d
	cmovne	%edi, %eax
	movl	$1, %edi
	subl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$24, %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
.L20:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 800080
a:
	.zero	800080
	.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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	leaq	a(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %rdi
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %edx
	testl	%edx, %edx
	jle	.L2
	xorl	%r15d, %r15d
	leaq	4(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r14, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	%r15d, %eax
	movslq	4(%rsp), %rdx
	addl	$1, %r15d
	andl	$1, %eax
	imulq	$100010, %rax, %rax
	addq	%rdx, %rax
	movl	(%rsp), %edx
	addl	$1, 0(%r13,%rax,4)
	cmpl	%r15d, %edx
	jg	.L3
.L2:
	movl	$1, %eax
	xorl	%r9d, %r9d
	xorl	%edi, %edi
	xorl	%esi, %esi
	xorl	%r8d, %r8d
	leaq	400040+a(%rip), %r11
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L18:
	cmpl	%ecx, %esi
	cmovl	%ecx, %esi
	movl	(%r11,%rax,4), %ecx
	cmpl	%ecx, %edi
	jle	.L11
.L19:
	cmpl	%ecx, %r9d
	cmovl	%ecx, %r9d
	addq	$1, %rax
	cmpq	$100001, %rax
	je	.L17
.L6:
	movl	0(%r13,%rax,4), %ecx
	movl	%eax, %r10d
	cmpl	%r8d, %ecx
	jl	.L18
	movl	%r8d, %esi
	movl	%ecx, %r8d
	movl	(%r11,%rax,4), %ecx
	movl	%eax, %r12d
	cmpl	%ecx, %edi
	jg	.L19
.L11:
	addq	$1, %rax
	movl	%edi, %r9d
	movl	%r10d, %ebx
	movl	%ecx, %edi
	cmpq	$100001, %rax
	jne	.L6
.L17:
	cmpl	%r9d, %esi
	movl	%r9d, %eax
	cmovge	%esi, %eax
	addl	%r8d, %edi
	movq	%rbp, %rsi
	addl	%r8d, %eax
	cmpl	%ebx, %r12d
	cmovne	%edi, %eax
	movl	$1, %edi
	subl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$24, %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
.L20:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 800080
a:
	.zero	800080
	.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:
```