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 main(){
    int n;
    scanf("%d", &n);
    int v[n];
    for(int i=0; i<n; i++){
        scanf("%d", &v[i]);
    }
    int a, b;
    int p=0, q=0;
    int t[100001];
    for(int i=0; i<=100000; i++){
        t[i] = 0;
    }
    for(int i=0; i<n; i+=2){
        t[v[i]]++;
    }
    for(int i=1; i<=100000; i++){
        if(t[i] > q){
            p = i;
            q = t[i];
        }
    }
    a = n/2 - q;
    q=0;
    for(int i=0; i<=100000; i++){
        t[i] = 0;
    }
    for(int i=1; i<n; i+=2){
        t[v[i]]++;
    }
    for(int i=1; i<=100000; i++){
        if(i == p){
            continue;
        }
        if(t[i] > q){
            q = t[i];
        }
    }
    a += n/2 - q;

    p=0, q=0;
    for(int i=0; i<=100000; i++){
        t[i] = 0;
    }
    for(int i=1; i<n; i+=2){
        t[v[i]]++;
    }
    for(int i=1; i<=100000; i++){
        if(t[i] > q){
            p = i;
            q = t[i];
        }
    }
    b = n/2 - q;
    q=0;
    for(int i=0; i<=100000; i++){
        t[i] = 0;
    }
    for(int i=0; i<n; i+=2){
        t[v[i]]++;
    }
    for(int i=1; i<=100000; i++){
        if(i == p){
            continue;
        }
        if(t[i] > q){
            q = t[i];
        }
    }
    b += n/2 - q;
    //printf("%d %d\n", a, b);
    printf("%d", a<b?a:b);

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2808, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-400152(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-400152(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -400080(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -400072(%rbp)
	movl	$0, -400148(%rbp)
	jmp	.L5
.L6:
	movl	-400148(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-400072(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -400148(%rbp)
.L5:
	movl	-400152(%rbp), %eax
	cmpl	%eax, -400148(%rbp)
	jl	.L6
	movl	$0, -400144(%rbp)
	movl	$0, -400140(%rbp)
	movl	$0, -400136(%rbp)
	jmp	.L7
.L8:
	movl	-400136(%rbp), %eax
	cltq
	movl	$0, -400064(%rbp,%rax,4)
	addl	$1, -400136(%rbp)
.L7:
	cmpl	$100000, -400136(%rbp)
	jle	.L8
	movl	$0, -400132(%rbp)
	jmp	.L9
.L10:
	movq	-400072(%rbp), %rax
	movl	-400132(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rdx
	movl	-400064(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -400064(%rbp,%rax,4)
	addl	$2, -400132(%rbp)
.L9:
	movl	-400152(%rbp), %eax
	cmpl	%eax, -400132(%rbp)
	jl	.L10
	movl	$1, -400128(%rbp)
	jmp	.L11
.L13:
	movl	-400128(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	cmpl	%eax, -400140(%rbp)
	jge	.L12
	movl	-400128(%rbp), %eax
	movl	%eax, -400144(%rbp)
	movl	-400128(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	movl	%eax, -400140(%rbp)
.L12:
	addl	$1, -400128(%rbp)
.L11:
	cmpl	$100000, -400128(%rbp)
	jle	.L13
	movl	-400152(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	subl	-400140(%rbp), %eax
	movl	%eax, -400088(%rbp)
	movl	$0, -400140(%rbp)
	movl	$0, -400124(%rbp)
	jmp	.L14
.L15:
	movl	-400124(%rbp), %eax
	cltq
	movl	$0, -400064(%rbp,%rax,4)
	addl	$1, -400124(%rbp)
.L14:
	cmpl	$100000, -400124(%rbp)
	jle	.L15
	movl	$1, -400120(%rbp)
	jmp	.L16
.L17:
	movq	-400072(%rbp), %rax
	movl	-400120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rdx
	movl	-400064(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -400064(%rbp,%rax,4)
	addl	$2, -400120(%rbp)
.L16:
	movl	-400152(%rbp), %eax
	cmpl	%eax, -400120(%rbp)
	jl	.L17
	movl	$1, -400116(%rbp)
	jmp	.L18
.L21:
	movl	-400116(%rbp), %eax
	cmpl	-400144(%rbp), %eax
	je	.L39
	movl	-400116(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	cmpl	%eax, -400140(%rbp)
	jge	.L20
	movl	-400116(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	movl	%eax, -400140(%rbp)
	jmp	.L20
.L39:
	nop
.L20:
	addl	$1, -400116(%rbp)
.L18:
	cmpl	$100000, -400116(%rbp)
	jle	.L21
	movl	-400152(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	subl	-400140(%rbp), %eax
	addl	%eax, -400088(%rbp)
	movl	$0, -400144(%rbp)
	movl	$0, -400140(%rbp)
	movl	$0, -400112(%rbp)
	jmp	.L22
.L23:
	movl	-400112(%rbp), %eax
	cltq
	movl	$0, -400064(%rbp,%rax,4)
	addl	$1, -400112(%rbp)
.L22:
	cmpl	$100000, -400112(%rbp)
	jle	.L23
	movl	$1, -400108(%rbp)
	jmp	.L24
.L25:
	movq	-400072(%rbp), %rax
	movl	-400108(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rdx
	movl	-400064(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -400064(%rbp,%rax,4)
	addl	$2, -400108(%rbp)
.L24:
	movl	-400152(%rbp), %eax
	cmpl	%eax, -400108(%rbp)
	jl	.L25
	movl	$1, -400104(%rbp)
	jmp	.L26
.L28:
	movl	-400104(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	cmpl	%eax, -400140(%rbp)
	jge	.L27
	movl	-400104(%rbp), %eax
	movl	%eax, -400144(%rbp)
	movl	-400104(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	movl	%eax, -400140(%rbp)
.L27:
	addl	$1, -400104(%rbp)
.L26:
	cmpl	$100000, -400104(%rbp)
	jle	.L28
	movl	-400152(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	subl	-400140(%rbp), %eax
	movl	%eax, -400084(%rbp)
	movl	$0, -400140(%rbp)
	movl	$0, -400100(%rbp)
	jmp	.L29
.L30:
	movl	-400100(%rbp), %eax
	cltq
	movl	$0, -400064(%rbp,%rax,4)
	addl	$1, -400100(%rbp)
.L29:
	cmpl	$100000, -400100(%rbp)
	jle	.L30
	movl	$0, -400096(%rbp)
	jmp	.L31
.L32:
	movq	-400072(%rbp), %rax
	movl	-400096(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rdx
	movl	-400064(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -400064(%rbp,%rax,4)
	addl	$2, -400096(%rbp)
.L31:
	movl	-400152(%rbp), %eax
	cmpl	%eax, -400096(%rbp)
	jl	.L32
	movl	$1, -400092(%rbp)
	jmp	.L33
.L36:
	movl	-400092(%rbp), %eax
	cmpl	-400144(%rbp), %eax
	je	.L40
	movl	-400092(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	cmpl	%eax, -400140(%rbp)
	jge	.L35
	movl	-400092(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	movl	%eax, -400140(%rbp)
	jmp	.L35
.L40:
	nop
.L35:
	addl	$1, -400092(%rbp)
.L33:
	cmpl	$100000, -400092(%rbp)
	jle	.L36
	movl	-400152(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	subl	-400140(%rbp), %eax
	addl	%eax, -400084(%rbp)
	movl	-400084(%rbp), %edx
	movl	-400088(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L38
	call	__stack_chk_fail@PLT
.L38:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2744, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %r12
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leaq	-400068(%rbp), %rsi
	call	__isoc99_scanf@PLT
	movslq	-400068(%rbp), %rax
	movq	%rsp, %rcx
	movq	%rax, %r14
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L3
.L39:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L39
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L40
.L4:
	movq	%rsp, %r15
	testl	%r14d, %r14d
	jle	.L5
	movq	%r15, %r13
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	-400068(%rbp), %r14d
	addq	$4, %r13
	cmpl	%ebx, %r14d
	jg	.L6
	leaq	-400064(%rbp), %rcx
	movl	$400004, %edx
	xorl	%esi, %esi
	movq	%rcx, %rdi
	call	memset@PLT
	movq	%rax, %rcx
	testl	%r14d, %r14d
	jle	.L7
	leal	-1(%r14), %edx
	movq	%r15, %rax
	shrl	%edx
	leaq	8(%r15,%rdx,8), %rsi
	.p2align 4,,10
	.p2align 3
.L8:
	movslq	(%rax), %rdx
	addq	$8, %rax
	addl	$1, -400064(%rbp,%rdx,4)
	cmpq	%rax, %rsi
	jne	.L8
.L7:
	movl	$1, %eax
	xorl	%esi, %esi
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L10:
	movl	(%rcx,%rax,4), %edx
	cmpl	%esi, %edx
	jle	.L9
	movl	%edx, %esi
	movl	%eax, %r13d
.L9:
	addq	$1, %rax
	cmpq	$100001, %rax
	jne	.L10
	movl	%r14d, %ebx
	movq	%rcx, %rdi
	movl	$400004, %edx
	shrl	$31, %ebx
	addl	%r14d, %ebx
	sarl	%ebx
	movl	%ebx, %eax
	subl	%esi, %eax
	xorl	%esi, %esi
	movl	%eax, -400084(%rbp)
	call	memset@PLT
	movq	%rax, %rcx
	cmpl	$1, %r14d
	jle	.L11
	leal	-2(%r14), %edx
	leaq	4(%r15), %rax
	shrl	%edx
	leaq	12(%r15,%rdx,8), %rsi
	.p2align 4,,10
	.p2align 3
.L12:
	movslq	(%rax), %rdx
	addq	$8, %rax
	addl	$1, -400064(%rbp,%rdx,4)
	cmpq	%rax, %rsi
	jne	.L12
.L11:
	movl	$1, %eax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L14:
	cmpl	%eax, %r13d
	je	.L13
	movl	(%rcx,%rax,4), %esi
	cmpl	%esi, %edx
	cmovl	%esi, %edx
.L13:
	addq	$1, %rax
	cmpq	$100001, %rax
	jne	.L14
	movl	%ebx, %r13d
	movq	%rcx, %rdi
	xorl	%esi, %esi
	subl	%edx, %r13d
	movl	$400004, %edx
	addl	-400084(%rbp), %r13d
	call	memset@PLT
	movq	%rax, %rcx
	cmpl	$1, %r14d
	jle	.L15
	leal	-2(%r14), %edx
	leaq	4(%r15), %rax
	shrl	%edx
	leaq	12(%r15,%rdx,8), %rsi
	.p2align 4,,10
	.p2align 3
.L16:
	movslq	(%rax), %rdx
	addq	$8, %rax
	addl	$1, -400064(%rbp,%rdx,4)
	cmpq	%rsi, %rax
	jne	.L16
.L15:
	movl	$1, %eax
	xorl	%esi, %esi
	xorl	%r9d, %r9d
	.p2align 4,,10
	.p2align 3
.L18:
	movl	(%rcx,%rax,4), %edx
	cmpl	%edx, %esi
	jge	.L17
	movl	%edx, %esi
	movl	%eax, %r9d
.L17:
	addq	$1, %rax
	cmpq	$100001, %rax
	jne	.L18
	movl	%ebx, %eax
	movq	%rcx, %rdi
	movl	$400004, %edx
	movl	%r9d, -400088(%rbp)
	subl	%esi, %eax
	xorl	%esi, %esi
	movl	%eax, -400084(%rbp)
	call	memset@PLT
	testl	%r14d, %r14d
	movl	-400088(%rbp), %r9d
	movq	%rax, %rcx
	jle	.L19
	leal	-1(%r14), %r8d
	shrl	%r8d
	movl	%r8d, %eax
	leaq	8(%r15,%rax,8), %rdx
	.p2align 4,,10
	.p2align 3
.L20:
	movslq	(%r15), %rax
	addq	$8, %r15
	addl	$1, -400064(%rbp,%rax,4)
	cmpq	%rdx, %r15
	jne	.L20
.L19:
	movl	$1, %eax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L22:
	cmpl	%eax, %r9d
	je	.L21
	movl	(%rcx,%rax,4), %esi
	cmpl	%esi, %edx
	cmovl	%esi, %edx
.L21:
	addq	$1, %rax
	cmpq	$100001, %rax
	jne	.L22
	movl	-400084(%rbp), %eax
	subl	%edx, %ebx
	movl	%r13d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	addl	%ebx, %eax
	cmpl	%r13d, %eax
	cmovle	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L41
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L40:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L5:
	leaq	-400064(%rbp), %rcx
	movl	$400004, %edx
	xorl	%esi, %esi
	movq	%rcx, %rdi
	call	memset@PLT
	movq	%rax, %rcx
	jmp	.L7
.L41:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:

rule
	.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	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2744, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %r12
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leaq	-400068(%rbp), %rsi
	call	__isoc99_scanf@PLT
	movslq	-400068(%rbp), %rax
	movq	%rsp, %rcx
	movq	%rax, %r14
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L3
.L39:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L39
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L40
.L4:
	movq	%rsp, %r15
	testl	%r14d, %r14d
	jle	.L5
	movq	%r15, %r13
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	-400068(%rbp), %r14d
	addq	$4, %r13
	cmpl	%ebx, %r14d
	jg	.L6
	leaq	-400064(%rbp), %rcx
	movl	$400004, %edx
	xorl	%esi, %esi
	movq	%rcx, %rdi
	call	memset@PLT
	movq	%rax, %rcx
	testl	%r14d, %r14d
	jle	.L7
	leal	-1(%r14), %edx
	movq	%r15, %rax
	shrl	%edx
	leaq	8(%r15,%rdx,8), %rsi
	.p2align 4,,10
	.p2align 3
.L8:
	movslq	(%rax), %rdx
	addq	$8, %rax
	addl	$1, -400064(%rbp,%rdx,4)
	cmpq	%rax, %rsi
	jne	.L8
.L7:
	movl	$1, %eax
	xorl	%esi, %esi
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L10:
	movl	(%rcx,%rax,4), %edx
	cmpl	%esi, %edx
	jle	.L9
	movl	%edx, %esi
	movl	%eax, %r13d
.L9:
	addq	$1, %rax
	cmpq	$100001, %rax
	jne	.L10
	movl	%r14d, %ebx
	movq	%rcx, %rdi
	movl	$400004, %edx
	shrl	$31, %ebx
	addl	%r14d, %ebx
	sarl	%ebx
	movl	%ebx, %eax
	subl	%esi, %eax
	xorl	%esi, %esi
	movl	%eax, -400084(%rbp)
	call	memset@PLT
	movq	%rax, %rcx
	cmpl	$1, %r14d
	jle	.L11
	leal	-2(%r14), %edx
	leaq	4(%r15), %rax
	shrl	%edx
	leaq	12(%r15,%rdx,8), %rsi
	.p2align 4,,10
	.p2align 3
.L12:
	movslq	(%rax), %rdx
	addq	$8, %rax
	addl	$1, -400064(%rbp,%rdx,4)
	cmpq	%rax, %rsi
	jne	.L12
.L11:
	movl	$1, %eax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L14:
	cmpl	%eax, %r13d
	je	.L13
	movl	(%rcx,%rax,4), %esi
	cmpl	%esi, %edx
	cmovl	%esi, %edx
.L13:
	addq	$1, %rax
	cmpq	$100001, %rax
	jne	.L14
	movl	%ebx, %r13d
	movq	%rcx, %rdi
	xorl	%esi, %esi
	subl	%edx, %r13d
	movl	$400004, %edx
	addl	-400084(%rbp), %r13d
	call	memset@PLT
	movq	%rax, %rcx
	cmpl	$1, %r14d
	jle	.L15
	leal	-2(%r14), %edx
	leaq	4(%r15), %rax
	shrl	%edx
	leaq	12(%r15,%rdx,8), %rsi
	.p2align 4,,10
	.p2align 3
.L16:
	movslq	(%rax), %rdx
	addq	$8, %rax
	addl	$1, -400064(%rbp,%rdx,4)
	cmpq	%rsi, %rax
	jne	.L16
.L15:
	movl	$1, %eax
	xorl	%esi, %esi
	xorl	%r9d, %r9d
	.p2align 4,,10
	.p2align 3
.L18:
	movl	(%rcx,%rax,4), %edx
	cmpl	%edx, %esi
	jge	.L17
	movl	%edx, %esi
	movl	%eax, %r9d
.L17:
	addq	$1, %rax
	cmpq	$100001, %rax
	jne	.L18
	movl	%ebx, %eax
	movq	%rcx, %rdi
	movl	$400004, %edx
	movl	%r9d, -400088(%rbp)
	subl	%esi, %eax
	xorl	%esi, %esi
	movl	%eax, -400084(%rbp)
	call	memset@PLT
	testl	%r14d, %r14d
	movl	-400088(%rbp), %r9d
	movq	%rax, %rcx
	jle	.L19
	leal	-1(%r14), %r8d
	shrl	%r8d
	movl	%r8d, %eax
	leaq	8(%r15,%rax,8), %rdx
	.p2align 4,,10
	.p2align 3
.L20:
	movslq	(%r15), %rax
	addq	$8, %r15
	addl	$1, -400064(%rbp,%rax,4)
	cmpq	%rdx, %r15
	jne	.L20
.L19:
	movl	$1, %eax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L22:
	cmpl	%eax, %r9d
	je	.L21
	movl	(%rcx,%rax,4), %esi
	cmpl	%esi, %edx
	cmovl	%esi, %edx
.L21:
	addq	$1, %rax
	cmpq	$100001, %rax
	jne	.L22
	movl	-400084(%rbp), %eax
	subl	%edx, %ebx
	movl	%r13d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	addl	%ebx, %eax
	cmpl	%r13d, %eax
	cmovle	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L41
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L40:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L5:
	leaq	-400064(%rbp), %rcx
	movl	$400004, %edx
	xorl	%esi, %esi
	movq	%rcx, %rdi
	call	memset@PLT
	movq	%rax, %rcx
	jmp	.L7
.L41:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:

#include<stdio.h>

int main(){
    int n;
    scanf("%d", &n);
    int v[n];
    for(int i=0; i<n; i++){
        scanf("%d", &v[i]);
    }
    int a, b;
    int p=0, q=0;
    int t[100001];
    for(int i=0; i<=100000; i++){
        t[i] = 0;
    }
    for(int i=0; i<n; i+=2){
        t[v[i]]++;
    }
    for(int i=1; i<=100000; i++){
        if(t[i] > q){
            p = i;
            q = t[i];
        }
    }
    a = n/2 - q;
    q=0;
    for(int i=0; i<=100000; i++){
        t[i] = 0;
    }
    for(int i=1; i<n; i+=2){
        t[v[i]]++;
    }
    for(int i=1; i<=100000; i++){
        if(i == p){
            continue;
        }
        if(t[i] > q){
            q = t[i];
        }
    }
    a += n/2 - q;

    p=0, q=0;
    for(int i=0; i<=100000; i++){
        t[i] = 0;
    }
    for(int i=1; i<n; i+=2){
        t[v[i]]++;
    }
    for(int i=1; i<=100000; i++){
        if(t[i] > q){
            p = i;
            q = t[i];
        }
    }
    b = n/2 - q;
    q=0;
    for(int i=0; i<=100000; i++){
        t[i] = 0;
    }
    for(int i=0; i<n; i+=2){
        t[v[i]]++;
    }
    for(int i=1; i<=100000; i++){
        if(i == p){
            continue;
        }
        if(t[i] > q){
            q = t[i];
        }
    }
    b += n/2 - q;
    //printf("%d %d\n", a, b);
    printf("%d", a<b?a:b);

    return 0;
}
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 unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>

int main(){
    int n;
    scanf("%d", &n);
    int v[n];
    for(int i=0; i<n; i++){
        scanf("%d", &v[i]);
    }
    int a, b;
    int p=0, q=0;
    int t[100001];
    for(int i=0; i<=100000; i++){
        t[i] = 0;
    }
    for(int i=0; i<n; i+=2){
        t[v[i]]++;
    }
    for(int i=1; i<=100000; i++){
        if(t[i] > q){
            p = i;
            q = t[i];
        }
    }
    a = n/2 - q;
    q=0;
    for(int i=0; i<=100000; i++){
        t[i] = 0;
    }
    for(int i=1; i<n; i+=2){
        t[v[i]]++;
    }
    for(int i=1; i<=100000; i++){
        if(i == p){
            continue;
        }
        if(t[i] > q){
            q = t[i];
        }
    }
    a += n/2 - q;

    p=0, q=0;
    for(int i=0; i<=100000; i++){
        t[i] = 0;
    }
    for(int i=1; i<n; i+=2){
        t[v[i]]++;
    }
    for(int i=1; i<=100000; i++){
        if(t[i] > q){
            p = i;
            q = t[i];
        }
    }
    b = n/2 - q;
    q=0;
    for(int i=0; i<=100000; i++){
        t[i] = 0;
    }
    for(int i=0; i<n; i+=2){
        t[v[i]]++;
    }
    for(int i=1; i<=100000; i++){
        if(i == p){
            continue;
        }
        if(t[i] > q){
            q = t[i];
        }
    }
    b += n/2 - q;
    //printf("%d %d\n", a, b);
    printf("%d", a<b?a:b);

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2808, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-400152(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-400152(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -400080(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -400072(%rbp)
	movl	$0, -400148(%rbp)
	jmp	.L5
.L6:
	movl	-400148(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-400072(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -400148(%rbp)
.L5:
	movl	-400152(%rbp), %eax
	cmpl	%eax, -400148(%rbp)
	jl	.L6
	movl	$0, -400144(%rbp)
	movl	$0, -400140(%rbp)
	movl	$0, -400136(%rbp)
	jmp	.L7
.L8:
	movl	-400136(%rbp), %eax
	cltq
	movl	$0, -400064(%rbp,%rax,4)
	addl	$1, -400136(%rbp)
.L7:
	cmpl	$100000, -400136(%rbp)
	jle	.L8
	movl	$0, -400132(%rbp)
	jmp	.L9
.L10:
	movq	-400072(%rbp), %rax
	movl	-400132(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rdx
	movl	-400064(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -400064(%rbp,%rax,4)
	addl	$2, -400132(%rbp)
.L9:
	movl	-400152(%rbp), %eax
	cmpl	%eax, -400132(%rbp)
	jl	.L10
	movl	$1, -400128(%rbp)
	jmp	.L11
.L13:
	movl	-400128(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	cmpl	%eax, -400140(%rbp)
	jge	.L12
	movl	-400128(%rbp), %eax
	movl	%eax, -400144(%rbp)
	movl	-400128(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	movl	%eax, -400140(%rbp)
.L12:
	addl	$1, -400128(%rbp)
.L11:
	cmpl	$100000, -400128(%rbp)
	jle	.L13
	movl	-400152(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	subl	-400140(%rbp), %eax
	movl	%eax, -400088(%rbp)
	movl	$0, -400140(%rbp)
	movl	$0, -400124(%rbp)
	jmp	.L14
.L15:
	movl	-400124(%rbp), %eax
	cltq
	movl	$0, -400064(%rbp,%rax,4)
	addl	$1, -400124(%rbp)
.L14:
	cmpl	$100000, -400124(%rbp)
	jle	.L15
	movl	$1, -400120(%rbp)
	jmp	.L16
.L17:
	movq	-400072(%rbp), %rax
	movl	-400120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rdx
	movl	-400064(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -400064(%rbp,%rax,4)
	addl	$2, -400120(%rbp)
.L16:
	movl	-400152(%rbp), %eax
	cmpl	%eax, -400120(%rbp)
	jl	.L17
	movl	$1, -400116(%rbp)
	jmp	.L18
.L21:
	movl	-400116(%rbp), %eax
	cmpl	-400144(%rbp), %eax
	je	.L39
	movl	-400116(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	cmpl	%eax, -400140(%rbp)
	jge	.L20
	movl	-400116(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	movl	%eax, -400140(%rbp)
	jmp	.L20
.L39:
	nop
.L20:
	addl	$1, -400116(%rbp)
.L18:
	cmpl	$100000, -400116(%rbp)
	jle	.L21
	movl	-400152(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	subl	-400140(%rbp), %eax
	addl	%eax, -400088(%rbp)
	movl	$0, -400144(%rbp)
	movl	$0, -400140(%rbp)
	movl	$0, -400112(%rbp)
	jmp	.L22
.L23:
	movl	-400112(%rbp), %eax
	cltq
	movl	$0, -400064(%rbp,%rax,4)
	addl	$1, -400112(%rbp)
.L22:
	cmpl	$100000, -400112(%rbp)
	jle	.L23
	movl	$1, -400108(%rbp)
	jmp	.L24
.L25:
	movq	-400072(%rbp), %rax
	movl	-400108(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rdx
	movl	-400064(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -400064(%rbp,%rax,4)
	addl	$2, -400108(%rbp)
.L24:
	movl	-400152(%rbp), %eax
	cmpl	%eax, -400108(%rbp)
	jl	.L25
	movl	$1, -400104(%rbp)
	jmp	.L26
.L28:
	movl	-400104(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	cmpl	%eax, -400140(%rbp)
	jge	.L27
	movl	-400104(%rbp), %eax
	movl	%eax, -400144(%rbp)
	movl	-400104(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	movl	%eax, -400140(%rbp)
.L27:
	addl	$1, -400104(%rbp)
.L26:
	cmpl	$100000, -400104(%rbp)
	jle	.L28
	movl	-400152(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	subl	-400140(%rbp), %eax
	movl	%eax, -400084(%rbp)
	movl	$0, -400140(%rbp)
	movl	$0, -400100(%rbp)
	jmp	.L29
.L30:
	movl	-400100(%rbp), %eax
	cltq
	movl	$0, -400064(%rbp,%rax,4)
	addl	$1, -400100(%rbp)
.L29:
	cmpl	$100000, -400100(%rbp)
	jle	.L30
	movl	$0, -400096(%rbp)
	jmp	.L31
.L32:
	movq	-400072(%rbp), %rax
	movl	-400096(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rdx
	movl	-400064(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -400064(%rbp,%rax,4)
	addl	$2, -400096(%rbp)
.L31:
	movl	-400152(%rbp), %eax
	cmpl	%eax, -400096(%rbp)
	jl	.L32
	movl	$1, -400092(%rbp)
	jmp	.L33
.L36:
	movl	-400092(%rbp), %eax
	cmpl	-400144(%rbp), %eax
	je	.L40
	movl	-400092(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	cmpl	%eax, -400140(%rbp)
	jge	.L35
	movl	-400092(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	movl	%eax, -400140(%rbp)
	jmp	.L35
.L40:
	nop
.L35:
	addl	$1, -400092(%rbp)
.L33:
	cmpl	$100000, -400092(%rbp)
	jle	.L36
	movl	-400152(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	subl	-400140(%rbp), %eax
	addl	%eax, -400084(%rbp)
	movl	-400084(%rbp), %edx
	movl	-400088(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L38
	call	__stack_chk_fail@PLT
.L38:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2808, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-400152(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-400152(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -400080(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -400072(%rbp)
	movl	$0, -400148(%rbp)
	jmp	.L5
.L6:
	movl	-400148(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-400072(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -400148(%rbp)
.L5:
	movl	-400152(%rbp), %eax
	cmpl	%eax, -400148(%rbp)
	jl	.L6
	movl	$0, -400144(%rbp)
	movl	$0, -400140(%rbp)
	movl	$0, -400136(%rbp)
	jmp	.L7
.L8:
	movl	-400136(%rbp), %eax
	cltq
	movl	$0, -400064(%rbp,%rax,4)
	addl	$1, -400136(%rbp)
.L7:
	cmpl	$100000, -400136(%rbp)
	jle	.L8
	movl	$0, -400132(%rbp)
	jmp	.L9
.L10:
	movq	-400072(%rbp), %rax
	movl	-400132(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rdx
	movl	-400064(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -400064(%rbp,%rax,4)
	addl	$2, -400132(%rbp)
.L9:
	movl	-400152(%rbp), %eax
	cmpl	%eax, -400132(%rbp)
	jl	.L10
	movl	$1, -400128(%rbp)
	jmp	.L11
.L13:
	movl	-400128(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	cmpl	%eax, -400140(%rbp)
	jge	.L12
	movl	-400128(%rbp), %eax
	movl	%eax, -400144(%rbp)
	movl	-400128(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	movl	%eax, -400140(%rbp)
.L12:
	addl	$1, -400128(%rbp)
.L11:
	cmpl	$100000, -400128(%rbp)
	jle	.L13
	movl	-400152(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	subl	-400140(%rbp), %eax
	movl	%eax, -400088(%rbp)
	movl	$0, -400140(%rbp)
	movl	$0, -400124(%rbp)
	jmp	.L14
.L15:
	movl	-400124(%rbp), %eax
	cltq
	movl	$0, -400064(%rbp,%rax,4)
	addl	$1, -400124(%rbp)
.L14:
	cmpl	$100000, -400124(%rbp)
	jle	.L15
	movl	$1, -400120(%rbp)
	jmp	.L16
.L17:
	movq	-400072(%rbp), %rax
	movl	-400120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rdx
	movl	-400064(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -400064(%rbp,%rax,4)
	addl	$2, -400120(%rbp)
.L16:
	movl	-400152(%rbp), %eax
	cmpl	%eax, -400120(%rbp)
	jl	.L17
	movl	$1, -400116(%rbp)
	jmp	.L18
.L21:
	movl	-400116(%rbp), %eax
	cmpl	-400144(%rbp), %eax
	je	.L39
	movl	-400116(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	cmpl	%eax, -400140(%rbp)
	jge	.L20
	movl	-400116(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	movl	%eax, -400140(%rbp)
	jmp	.L20
.L39:
	nop
.L20:
	addl	$1, -400116(%rbp)
.L18:
	cmpl	$100000, -400116(%rbp)
	jle	.L21
	movl	-400152(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	subl	-400140(%rbp), %eax
	addl	%eax, -400088(%rbp)
	movl	$0, -400144(%rbp)
	movl	$0, -400140(%rbp)
	movl	$0, -400112(%rbp)
	jmp	.L22
.L23:
	movl	-400112(%rbp), %eax
	cltq
	movl	$0, -400064(%rbp,%rax,4)
	addl	$1, -400112(%rbp)
.L22:
	cmpl	$100000, -400112(%rbp)
	jle	.L23
	movl	$1, -400108(%rbp)
	jmp	.L24
.L25:
	movq	-400072(%rbp), %rax
	movl	-400108(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rdx
	movl	-400064(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -400064(%rbp,%rax,4)
	addl	$2, -400108(%rbp)
.L24:
	movl	-400152(%rbp), %eax
	cmpl	%eax, -400108(%rbp)
	jl	.L25
	movl	$1, -400104(%rbp)
	jmp	.L26
.L28:
	movl	-400104(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	cmpl	%eax, -400140(%rbp)
	jge	.L27
	movl	-400104(%rbp), %eax
	movl	%eax, -400144(%rbp)
	movl	-400104(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	movl	%eax, -400140(%rbp)
.L27:
	addl	$1, -400104(%rbp)
.L26:
	cmpl	$100000, -400104(%rbp)
	jle	.L28
	movl	-400152(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	subl	-400140(%rbp), %eax
	movl	%eax, -400084(%rbp)
	movl	$0, -400140(%rbp)
	movl	$0, -400100(%rbp)
	jmp	.L29
.L30:
	movl	-400100(%rbp), %eax
	cltq
	movl	$0, -400064(%rbp,%rax,4)
	addl	$1, -400100(%rbp)
.L29:
	cmpl	$100000, -400100(%rbp)
	jle	.L30
	movl	$0, -400096(%rbp)
	jmp	.L31
.L32:
	movq	-400072(%rbp), %rax
	movl	-400096(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rdx
	movl	-400064(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -400064(%rbp,%rax,4)
	addl	$2, -400096(%rbp)
.L31:
	movl	-400152(%rbp), %eax
	cmpl	%eax, -400096(%rbp)
	jl	.L32
	movl	$1, -400092(%rbp)
	jmp	.L33
.L36:
	movl	-400092(%rbp), %eax
	cmpl	-400144(%rbp), %eax
	je	.L40
	movl	-400092(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	cmpl	%eax, -400140(%rbp)
	jge	.L35
	movl	-400092(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	movl	%eax, -400140(%rbp)
	jmp	.L35
.L40:
	nop
.L35:
	addl	$1, -400092(%rbp)
.L33:
	cmpl	$100000, -400092(%rbp)
	jle	.L36
	movl	-400152(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	subl	-400140(%rbp), %eax
	addl	%eax, -400084(%rbp)
	movl	-400084(%rbp), %edx
	movl	-400088(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L38
	call	__stack_chk_fail@PLT
.L38:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
