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 Go[100000];
	int i,j,k;
	int n;
	int sum;
	
	while(1){
		scanf("%d\n",&n);
		if(n==0)break;
		for(i=0;i<n;i++){
			scanf("%d\n",&Go[i]);
			if(i%2&&Go[i]^Go[i-1]){
				for(k=i-1;k>=0;k--){
					if(Go[k]==Go[i])break;
					Go[k]=Go[i];
				}
			}
		}
		sum=0;
		for(i=0;i<n;i++)sum+=Go[i];
		printf("%d\n",n-sum);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d\n"
	.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
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2720, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L12:
	leaq	-400032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-400032(%rbp), %eax
	testl	%eax, %eax
	je	.L16
	movl	$0, -400028(%rbp)
	jmp	.L4
.L9:
	leaq	-400016(%rbp), %rdx
	movl	-400028(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-400028(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L5
	movl	-400028(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movl	-400028(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	je	.L5
	movl	-400028(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -400024(%rbp)
	jmp	.L6
.L8:
	movl	-400024(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movl	-400028(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	je	.L17
	movl	-400028(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movl	-400024(%rbp), %eax
	cltq
	movl	%edx, -400016(%rbp,%rax,4)
	subl	$1, -400024(%rbp)
.L6:
	cmpl	$0, -400024(%rbp)
	jns	.L8
	jmp	.L5
.L17:
	nop
.L5:
	addl	$1, -400028(%rbp)
.L4:
	movl	-400032(%rbp), %eax
	cmpl	%eax, -400028(%rbp)
	jl	.L9
	movl	$0, -400020(%rbp)
	movl	$0, -400028(%rbp)
	jmp	.L10
.L11:
	movl	-400028(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	addl	%eax, -400020(%rbp)
	addl	$1, -400028(%rbp)
.L10:
	movl	-400032(%rbp), %eax
	cmpl	%eax, -400028(%rbp)
	jl	.L11
	movl	-400032(%rbp), %eax
	subl	-400020(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L12
.L16:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.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\n"
	.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
	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	-397312(%rsp), %r11
	.cfi_def_cfa 11, 397368
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2744, %rsp
	.cfi_def_cfa_offset 400112
	leaq	.LC0(%rip), %r12
	movq	%fs:40, %rax
	movq	%rax, 400040(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	leaq	32(%rsp), %r13
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L14:
	movq	8(%rsp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %edx
	testl	%edx, %edx
	je	.L2
	jle	.L4
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	movq	%r13, %rbp
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %edx
	xorl	%r15d, %r15d
	movl	$1, %r14d
	cmpl	$1, %edx
	jg	.L6
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L8:
	addq	$1, %r15
	movl	28(%rsp), %edx
	leal	1(%r15), %r14d
	cmpl	%r14d, %edx
	jle	.L7
.L6:
	movq	%rbp, %rbx
	addq	$4, %rbp
	xorl	%eax, %eax
	movq	%r12, %rdi
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	andl	$1, %r14d
	je	.L8
	movl	4(%rbx), %eax
	movq	%rbx, %rcx
	cmpl	(%rbx), %eax
	je	.L8
	leaq	0(,%r15,4), %rdx
	movq	%rbx, %rsi
	subq	%rdx, %rsi
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L10:
	movl	4(%rcx), %eax
	subq	$4, %rbx
	cmpl	%eax, -4(%rdx)
	je	.L8
.L9:
	movl	%eax, (%rbx)
	movq	%rbx, %rdx
	cmpq	%rsi, %rbx
	jne	.L10
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L7:
	testl	%edx, %edx
	jle	.L4
	leal	-1(%rdx), %eax
	cmpl	$2, %eax
	jbe	.L17
	movl	%edx, %ecx
	movq	%r13, %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %ecx
	subl	$1, %ecx
	salq	$4, %rcx
	leaq	48(%rsp,%rcx), %rcx
	.p2align 4,,10
	.p2align 3
.L12:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rcx, %rax
	jne	.L12
	movdqa	%xmm0, %xmm1
	movl	%edx, %ecx
	psrldq	$8, %xmm1
	andl	$-4, %ecx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	testb	$3, %dl
	je	.L13
.L11:
	movslq	%ecx, %rsi
	addl	32(%rsp,%rsi,4), %eax
	leal	1(%rcx), %esi
	cmpl	%edx, %esi
	jge	.L13
	movslq	%esi, %rsi
	addl	$2, %ecx
	addl	32(%rsp,%rsi,4), %eax
	cmpl	%ecx, %edx
	jle	.L13
	movslq	%ecx, %rcx
	addl	32(%rsp,%rcx,4), %eax
.L13:
	subl	%eax, %edx
.L4:
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L14
.L2:
	movq	400040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$400056, %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
.L17:
	.cfi_restore_state
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	jmp	.L11
.L24:
	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\n"
	.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
	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	-397312(%rsp), %r11
	.cfi_def_cfa 11, 397368
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2744, %rsp
	.cfi_def_cfa_offset 400112
	leaq	.LC0(%rip), %r12
	movq	%fs:40, %rax
	movq	%rax, 400040(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	leaq	32(%rsp), %r13
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L14:
	movq	8(%rsp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %edx
	testl	%edx, %edx
	je	.L2
	jle	.L4
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	movq	%r13, %rbp
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %edx
	xorl	%r15d, %r15d
	movl	$1, %r14d
	cmpl	$1, %edx
	jg	.L6
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L8:
	addq	$1, %r15
	movl	28(%rsp), %edx
	leal	1(%r15), %r14d
	cmpl	%r14d, %edx
	jle	.L7
.L6:
	movq	%rbp, %rbx
	addq	$4, %rbp
	xorl	%eax, %eax
	movq	%r12, %rdi
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	andl	$1, %r14d
	je	.L8
	movl	4(%rbx), %eax
	movq	%rbx, %rcx
	cmpl	(%rbx), %eax
	je	.L8
	leaq	0(,%r15,4), %rdx
	movq	%rbx, %rsi
	subq	%rdx, %rsi
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L10:
	movl	4(%rcx), %eax
	subq	$4, %rbx
	cmpl	%eax, -4(%rdx)
	je	.L8
.L9:
	movl	%eax, (%rbx)
	movq	%rbx, %rdx
	cmpq	%rsi, %rbx
	jne	.L10
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L7:
	testl	%edx, %edx
	jle	.L4
	leal	-1(%rdx), %eax
	cmpl	$2, %eax
	jbe	.L17
	movl	%edx, %ecx
	movq	%r13, %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %ecx
	subl	$1, %ecx
	salq	$4, %rcx
	leaq	48(%rsp,%rcx), %rcx
	.p2align 4,,10
	.p2align 3
.L12:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rcx, %rax
	jne	.L12
	movdqa	%xmm0, %xmm1
	movl	%edx, %ecx
	psrldq	$8, %xmm1
	andl	$-4, %ecx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	testb	$3, %dl
	je	.L13
.L11:
	movslq	%ecx, %rsi
	addl	32(%rsp,%rsi,4), %eax
	leal	1(%rcx), %esi
	cmpl	%edx, %esi
	jge	.L13
	movslq	%esi, %rsi
	addl	$2, %ecx
	addl	32(%rsp,%rsi,4), %eax
	cmpl	%ecx, %edx
	jle	.L13
	movslq	%ecx, %rcx
	addl	32(%rsp,%rcx,4), %eax
.L13:
	subl	%eax, %edx
.L4:
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L14
.L2:
	movq	400040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$400056, %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
.L17:
	.cfi_restore_state
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	jmp	.L11
.L24:
	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 Go[100000];
	int i,j,k;
	int n;
	int sum;
	
	while(1){
		scanf("%d\n",&n);
		if(n==0)break;
		for(i=0;i<n;i++){
			scanf("%d\n",&Go[i]);
			if(i%2&&Go[i]^Go[i-1]){
				for(k=i-1;k>=0;k--){
					if(Go[k]==Go[i])break;
					Go[k]=Go[i];
				}
			}
		}
		sum=0;
		for(i=0;i<n;i++)sum+=Go[i];
		printf("%d\n",n-sum);
	}
	return 0;
}
8
1
1
1
1
0
0
0
0
8
1
0
1
1
0
0
0
1
0
 8
1
1
1
1
0
0
0
0
8
1
0
0
1
0
0
0
1
0
 8
1
0
1
1
0
0
0
0
4
1
0
1
1
0
0
0
1
0
 8
1
0
1
1
0
0
0
0
2
1
0
1
1
0
0
-1
1
0
 8
0
0
1
1
0
0
0
0
2
1
0
2
1
0
0
-1
1
0
 8
1
1
1
1
0
0
0
0
8
1
0
1
1
0
0
1
1
0
 8
1
0
1
1
0
0
-1
0
8
1
0
0
1
0
0
0
1
0
 8
1
1
2
1
0
0
0
0
1
0
0
1
1
0
0
0
1
0
 8
0
0
1
1
0
0
0
0
3
1
0
1
1
0
0
-1
1
0
 8
1
1
1
1
1
0
0
0
8
1
0
1
1
0
0
1
1
0

4
2
 4
0
 6
2
 6
2
0
 6
2
2
 4
4
 6
0
 4
1
 6
2
1
 8
4

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 Go[100000];
	int i,j,k;
	int n;
	int sum;
	
	while(1){
		scanf("%d\n",&n);
		if(n==0)break;
		for(i=0;i<n;i++){
			scanf("%d\n",&Go[i]);
			if(i%2&&Go[i]^Go[i-1]){
				for(k=i-1;k>=0;k--){
					if(Go[k]==Go[i])break;
					Go[k]=Go[i];
				}
			}
		}
		sum=0;
		for(i=0;i<n;i++)sum+=Go[i];
		printf("%d\n",n-sum);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d\n"
	.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
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2720, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L12:
	leaq	-400032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-400032(%rbp), %eax
	testl	%eax, %eax
	je	.L16
	movl	$0, -400028(%rbp)
	jmp	.L4
.L9:
	leaq	-400016(%rbp), %rdx
	movl	-400028(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-400028(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L5
	movl	-400028(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movl	-400028(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	je	.L5
	movl	-400028(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -400024(%rbp)
	jmp	.L6
.L8:
	movl	-400024(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movl	-400028(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	je	.L17
	movl	-400028(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movl	-400024(%rbp), %eax
	cltq
	movl	%edx, -400016(%rbp,%rax,4)
	subl	$1, -400024(%rbp)
.L6:
	cmpl	$0, -400024(%rbp)
	jns	.L8
	jmp	.L5
.L17:
	nop
.L5:
	addl	$1, -400028(%rbp)
.L4:
	movl	-400032(%rbp), %eax
	cmpl	%eax, -400028(%rbp)
	jl	.L9
	movl	$0, -400020(%rbp)
	movl	$0, -400028(%rbp)
	jmp	.L10
.L11:
	movl	-400028(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	addl	%eax, -400020(%rbp)
	addl	$1, -400028(%rbp)
.L10:
	movl	-400032(%rbp), %eax
	cmpl	%eax, -400028(%rbp)
	jl	.L11
	movl	-400032(%rbp), %eax
	subl	-400020(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L12
.L16:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.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\n"
	.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
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2720, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L12:
	leaq	-400032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-400032(%rbp), %eax
	testl	%eax, %eax
	je	.L16
	movl	$0, -400028(%rbp)
	jmp	.L4
.L9:
	leaq	-400016(%rbp), %rdx
	movl	-400028(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-400028(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L5
	movl	-400028(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movl	-400028(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	je	.L5
	movl	-400028(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -400024(%rbp)
	jmp	.L6
.L8:
	movl	-400024(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movl	-400028(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	je	.L17
	movl	-400028(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movl	-400024(%rbp), %eax
	cltq
	movl	%edx, -400016(%rbp,%rax,4)
	subl	$1, -400024(%rbp)
.L6:
	cmpl	$0, -400024(%rbp)
	jns	.L8
	jmp	.L5
.L17:
	nop
.L5:
	addl	$1, -400028(%rbp)
.L4:
	movl	-400032(%rbp), %eax
	cmpl	%eax, -400028(%rbp)
	jl	.L9
	movl	$0, -400020(%rbp)
	movl	$0, -400028(%rbp)
	jmp	.L10
.L11:
	movl	-400028(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	addl	%eax, -400020(%rbp)
	addl	$1, -400028(%rbp)
.L10:
	movl	-400032(%rbp), %eax
	cmpl	%eax, -400028(%rbp)
	jl	.L11
	movl	-400032(%rbp), %eax
	subl	-400020(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L12
.L16:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.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:
