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>

int go[100000];

int main(void)
{
	int n;
	
	while (scanf("%d", &n), n != 0){
		int i, j;
		int cnt;
		
		for (i = 0; i < n; i++) scanf("%d", go + i);
		for (i = 1; i < n; i += 2){
			if (go[i - 1] != go[i]){
				for (j = i - 1; j >= 0 && go[j] != go[i]; j--){
					go[j] = go[i];
				}
			}
		}
		for (i = cnt = 0; i < n; i++) cnt += !go[i];
		printf("%d\n", cnt);
	}
	
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	4+go(%rip), %r15
	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
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r8d
	testl	%r8d, %r8d
	je	.L15
	leaq	go(%rip), %r14
	movl	$0, %r13d
	jle	.L17
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r8d
	addq	$4, %r14
	cmpl	%r13d, %r8d
	jg	.L3
.L17:
	cmpl	$1, %r8d
	jle	.L4
	leal	-2(%r8), %eax
	leaq	4+go(%rip), %rcx
	xorl	%edi, %edi
	shrl	%eax
	leal	1(%rax), %r9d
	addq	%r9, %r9
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L8:
	addq	$2, %rdi
	addq	$8, %rcx
	cmpq	%r9, %rdi
	je	.L34
.L6:
	movl	(%rcx), %edx
	cmpl	%edx, -4(%rcx)
	je	.L8
	movq	%rcx, %rax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L35:
	movl	(%rcx), %edx
	subq	$4, %rax
	cmpl	%edx, -8(%rsi)
	je	.L8
.L9:
	movl	%edx, -4(%rax)
	movq	%rax, %rsi
	cmpq	%r15, %rax
	jne	.L35
	addq	$2, %rdi
	addq	$8, %rcx
	cmpq	%r9, %rdi
	jne	.L6
.L34:
	testl	%r8d, %r8d
	movl	$1, %esi
	cmovg	%r8d, %esi
	cmpl	$3, %r8d
	jle	.L36
	leaq	go(%rip), %rcx
	pxor	%xmm0, %xmm0
	movl	%esi, %edx
	shrl	$2, %edx
	leaq	16(%rcx), %rdi
	movdqa	%xmm0, %xmm2
	movq	%rcx, %rax
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rdi, %rdx
	.p2align 4,,10
	.p2align 3
.L10:
	movdqa	%xmm2, %xmm1
	addq	$16, %rax
	pcmpeqd	-16(%rax), %xmm1
	psubd	%xmm1, %xmm0
	cmpq	%rdx, %rax
	jne	.L10
	movdqa	%xmm0, %xmm1
	movl	%esi, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	andl	$3, %esi
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	je	.L12
	movslq	%eax, %rsi
	cmpl	$1, (%rcx,%rsi,4)
	adcl	$0, %edx
	addl	$1, %eax
	cmpl	%r8d, %eax
	jge	.L12
.L18:
	movslq	%eax, %rsi
	cmpl	$1, (%rcx,%rsi,4)
	adcl	$0, %edx
	addl	$1, %eax
	cmpl	%eax, %r8d
	jle	.L12
	cltq
	cmpl	$1, (%rcx,%rax,4)
	adcl	$0, %edx
.L12:
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L15:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L37
	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
.L4:
	.cfi_restore_state
	je	.L11
	xorl	%edx, %edx
	jmp	.L12
.L36:
	movl	go(%rip), %eax
	xorl	%edx, %edx
	leaq	go(%rip), %rcx
	testl	%eax, %eax
	movl	$1, %eax
	sete	%dl
	jmp	.L18
.L37:
	call	__stack_chk_fail@PLT
.L11:
	xorl	%edx, %edx
	cmpl	$0, go(%rip)
	sete	%dl
	jmp	.L12
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	go
	.bss
	.align 32
	.type	go, @object
	.size	go, 400000
go:
	.zero	400000
	.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"
.LC1:
	.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
	leaq	4+go(%rip), %r15
	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
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r8d
	testl	%r8d, %r8d
	je	.L15
	leaq	go(%rip), %r14
	movl	$0, %r13d
	jle	.L17
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r8d
	addq	$4, %r14
	cmpl	%r13d, %r8d
	jg	.L3
.L17:
	cmpl	$1, %r8d
	jle	.L4
	leal	-2(%r8), %eax
	leaq	4+go(%rip), %rcx
	xorl	%edi, %edi
	shrl	%eax
	leal	1(%rax), %r9d
	addq	%r9, %r9
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L8:
	addq	$2, %rdi
	addq	$8, %rcx
	cmpq	%r9, %rdi
	je	.L34
.L6:
	movl	(%rcx), %edx
	cmpl	%edx, -4(%rcx)
	je	.L8
	movq	%rcx, %rax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L35:
	movl	(%rcx), %edx
	subq	$4, %rax
	cmpl	%edx, -8(%rsi)
	je	.L8
.L9:
	movl	%edx, -4(%rax)
	movq	%rax, %rsi
	cmpq	%r15, %rax
	jne	.L35
	addq	$2, %rdi
	addq	$8, %rcx
	cmpq	%r9, %rdi
	jne	.L6
.L34:
	testl	%r8d, %r8d
	movl	$1, %esi
	cmovg	%r8d, %esi
	cmpl	$3, %r8d
	jle	.L36
	leaq	go(%rip), %rcx
	pxor	%xmm0, %xmm0
	movl	%esi, %edx
	shrl	$2, %edx
	leaq	16(%rcx), %rdi
	movdqa	%xmm0, %xmm2
	movq	%rcx, %rax
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rdi, %rdx
	.p2align 4,,10
	.p2align 3
.L10:
	movdqa	%xmm2, %xmm1
	addq	$16, %rax
	pcmpeqd	-16(%rax), %xmm1
	psubd	%xmm1, %xmm0
	cmpq	%rdx, %rax
	jne	.L10
	movdqa	%xmm0, %xmm1
	movl	%esi, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	andl	$3, %esi
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	je	.L12
	movslq	%eax, %rsi
	cmpl	$1, (%rcx,%rsi,4)
	adcl	$0, %edx
	addl	$1, %eax
	cmpl	%r8d, %eax
	jge	.L12
.L18:
	movslq	%eax, %rsi
	cmpl	$1, (%rcx,%rsi,4)
	adcl	$0, %edx
	addl	$1, %eax
	cmpl	%eax, %r8d
	jle	.L12
	cltq
	cmpl	$1, (%rcx,%rax,4)
	adcl	$0, %edx
.L12:
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L15:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L37
	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
.L4:
	.cfi_restore_state
	je	.L11
	xorl	%edx, %edx
	jmp	.L12
.L36:
	movl	go(%rip), %eax
	xorl	%edx, %edx
	leaq	go(%rip), %rcx
	testl	%eax, %eax
	movl	$1, %eax
	sete	%dl
	jmp	.L18
.L37:
	call	__stack_chk_fail@PLT
.L11:
	xorl	%edx, %edx
	cmpl	$0, go(%rip)
	sete	%dl
	jmp	.L12
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	go
	.bss
	.align 32
	.type	go, @object
	.size	go, 400000
go:
	.zero	400000
	.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"
.LC1:
	.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
	leaq	4+go(%rip), %r15
	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
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r8d
	testl	%r8d, %r8d
	je	.L15
	leaq	go(%rip), %r14
	movl	$0, %r13d
	jle	.L17
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r8d
	addq	$4, %r14
	cmpl	%r13d, %r8d
	jg	.L3
.L17:
	cmpl	$1, %r8d
	jle	.L4
	leal	-2(%r8), %eax
	leaq	4+go(%rip), %rcx
	xorl	%edi, %edi
	shrl	%eax
	leal	1(%rax), %r9d
	addq	%r9, %r9
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L8:
	addq	$2, %rdi
	addq	$8, %rcx
	cmpq	%r9, %rdi
	je	.L34
.L6:
	movl	(%rcx), %edx
	cmpl	%edx, -4(%rcx)
	je	.L8
	movq	%rcx, %rax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L35:
	movl	(%rcx), %edx
	subq	$4, %rax
	cmpl	%edx, -8(%rsi)
	je	.L8
.L9:
	movl	%edx, -4(%rax)
	movq	%rax, %rsi
	cmpq	%r15, %rax
	jne	.L35
	addq	$2, %rdi
	addq	$8, %rcx
	cmpq	%r9, %rdi
	jne	.L6
.L34:
	testl	%r8d, %r8d
	movl	$1, %esi
	cmovg	%r8d, %esi
	cmpl	$3, %r8d
	jle	.L36
	leaq	go(%rip), %rcx
	pxor	%xmm0, %xmm0
	movl	%esi, %edx
	shrl	$2, %edx
	leaq	16(%rcx), %rdi
	movdqa	%xmm0, %xmm2
	movq	%rcx, %rax
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rdi, %rdx
	.p2align 4,,10
	.p2align 3
.L10:
	movdqa	%xmm2, %xmm1
	addq	$16, %rax
	pcmpeqd	-16(%rax), %xmm1
	psubd	%xmm1, %xmm0
	cmpq	%rdx, %rax
	jne	.L10
	movdqa	%xmm0, %xmm1
	movl	%esi, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	andl	$3, %esi
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	je	.L12
	movslq	%eax, %rsi
	cmpl	$1, (%rcx,%rsi,4)
	adcl	$0, %edx
	addl	$1, %eax
	cmpl	%r8d, %eax
	jge	.L12
.L18:
	movslq	%eax, %rsi
	cmpl	$1, (%rcx,%rsi,4)
	adcl	$0, %edx
	addl	$1, %eax
	cmpl	%eax, %r8d
	jle	.L12
	cltq
	cmpl	$1, (%rcx,%rax,4)
	adcl	$0, %edx
.L12:
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L15:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L37
	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
.L4:
	.cfi_restore_state
	je	.L11
	xorl	%edx, %edx
	jmp	.L12
.L36:
	movl	go(%rip), %eax
	xorl	%edx, %edx
	leaq	go(%rip), %rcx
	testl	%eax, %eax
	movl	$1, %eax
	sete	%dl
	jmp	.L18
.L37:
	call	__stack_chk_fail@PLT
.L11:
	xorl	%edx, %edx
	cmpl	$0, go(%rip)
	sete	%dl
	jmp	.L12
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	go
	.bss
	.align 32
	.type	go, @object
	.size	go, 400000
go:
	.zero	400000
	.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>

int go[100000];

int main(void)
{
	int n;
	
	while (scanf("%d", &n), n != 0){
		int i, j;
		int cnt;
		
		for (i = 0; i < n; i++) scanf("%d", go + i);
		for (i = 1; i < n; i += 2){
			if (go[i - 1] != go[i]){
				for (j = i - 1; j >= 0 && go[j] != go[i]; j--){
					go[j] = go[i];
				}
			}
		}
		for (i = cnt = 0; i < n; i++) cnt += !go[i];
		printf("%d\n", cnt);
	}
	
	return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>

int go[100000];

int main(void)
{
	int n;
	
	while (scanf("%d", &n), n != 0){
		int i, j;
		int cnt;
		
		for (i = 0; i < n; i++) scanf("%d", go + i);
		for (i = 1; i < n; i += 2){
			if (go[i - 1] != go[i]){
				for (j = i - 1; j >= 0 && go[j] != go[i]; j--){
					go[j] = go[i];
				}
			}
		}
		for (i = cnt = 0; i < n; i++) cnt += !go[i];
		printf("%d\n", cnt);
	}
	
	return 0;
}```

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:

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

```c
#include <stdio.h>

int go[100000];

int main(void)
{
	int n;
	
	while (scanf("%d", &n), n != 0){
		int i, j;
		int cnt;
		
		for (i = 0; i < n; i++) scanf("%d", go + i);
		for (i = 1; i < n; i += 2){
			if (go[i - 1] != go[i]){
				for (j = i - 1; j >= 0 && go[j] != go[i]; j--){
					go[j] = go[i];
				}
			}
		}
		for (i = cnt = 0; i < n; i++) cnt += !go[i];
		printf("%d\n", cnt);
	}
	
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	4+go(%rip), %r15
	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
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r8d
	testl	%r8d, %r8d
	je	.L15
	leaq	go(%rip), %r14
	movl	$0, %r13d
	jle	.L17
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r8d
	addq	$4, %r14
	cmpl	%r13d, %r8d
	jg	.L3
.L17:
	cmpl	$1, %r8d
	jle	.L4
	leal	-2(%r8), %eax
	leaq	4+go(%rip), %rcx
	xorl	%edi, %edi
	shrl	%eax
	leal	1(%rax), %r9d
	addq	%r9, %r9
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L8:
	addq	$2, %rdi
	addq	$8, %rcx
	cmpq	%r9, %rdi
	je	.L34
.L6:
	movl	(%rcx), %edx
	cmpl	%edx, -4(%rcx)
	je	.L8
	movq	%rcx, %rax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L35:
	movl	(%rcx), %edx
	subq	$4, %rax
	cmpl	%edx, -8(%rsi)
	je	.L8
.L9:
	movl	%edx, -4(%rax)
	movq	%rax, %rsi
	cmpq	%r15, %rax
	jne	.L35
	addq	$2, %rdi
	addq	$8, %rcx
	cmpq	%r9, %rdi
	jne	.L6
.L34:
	testl	%r8d, %r8d
	movl	$1, %esi
	cmovg	%r8d, %esi
	cmpl	$3, %r8d
	jle	.L36
	leaq	go(%rip), %rcx
	pxor	%xmm0, %xmm0
	movl	%esi, %edx
	shrl	$2, %edx
	leaq	16(%rcx), %rdi
	movdqa	%xmm0, %xmm2
	movq	%rcx, %rax
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rdi, %rdx
	.p2align 4,,10
	.p2align 3
.L10:
	movdqa	%xmm2, %xmm1
	addq	$16, %rax
	pcmpeqd	-16(%rax), %xmm1
	psubd	%xmm1, %xmm0
	cmpq	%rdx, %rax
	jne	.L10
	movdqa	%xmm0, %xmm1
	movl	%esi, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	andl	$3, %esi
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	je	.L12
	movslq	%eax, %rsi
	cmpl	$1, (%rcx,%rsi,4)
	adcl	$0, %edx
	addl	$1, %eax
	cmpl	%r8d, %eax
	jge	.L12
.L18:
	movslq	%eax, %rsi
	cmpl	$1, (%rcx,%rsi,4)
	adcl	$0, %edx
	addl	$1, %eax
	cmpl	%eax, %r8d
	jle	.L12
	cltq
	cmpl	$1, (%rcx,%rax,4)
	adcl	$0, %edx
.L12:
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L15:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L37
	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
.L4:
	.cfi_restore_state
	je	.L11
	xorl	%edx, %edx
	jmp	.L12
.L36:
	movl	go(%rip), %eax
	xorl	%edx, %edx
	leaq	go(%rip), %rcx
	testl	%eax, %eax
	movl	$1, %eax
	sete	%dl
	jmp	.L18
.L37:
	call	__stack_chk_fail@PLT
.L11:
	xorl	%edx, %edx
	cmpl	$0, go(%rip)
	sete	%dl
	jmp	.L12
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	go
	.bss
	.align 32
	.type	go, @object
	.size	go, 400000
go:
	.zero	400000
	.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"
.LC1:
	.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
	leaq	4+go(%rip), %r15
	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
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r8d
	testl	%r8d, %r8d
	je	.L15
	leaq	go(%rip), %r14
	movl	$0, %r13d
	jle	.L17
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r8d
	addq	$4, %r14
	cmpl	%r13d, %r8d
	jg	.L3
.L17:
	cmpl	$1, %r8d
	jle	.L4
	leal	-2(%r8), %eax
	leaq	4+go(%rip), %rcx
	xorl	%edi, %edi
	shrl	%eax
	leal	1(%rax), %r9d
	addq	%r9, %r9
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L8:
	addq	$2, %rdi
	addq	$8, %rcx
	cmpq	%r9, %rdi
	je	.L34
.L6:
	movl	(%rcx), %edx
	cmpl	%edx, -4(%rcx)
	je	.L8
	movq	%rcx, %rax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L35:
	movl	(%rcx), %edx
	subq	$4, %rax
	cmpl	%edx, -8(%rsi)
	je	.L8
.L9:
	movl	%edx, -4(%rax)
	movq	%rax, %rsi
	cmpq	%r15, %rax
	jne	.L35
	addq	$2, %rdi
	addq	$8, %rcx
	cmpq	%r9, %rdi
	jne	.L6
.L34:
	testl	%r8d, %r8d
	movl	$1, %esi
	cmovg	%r8d, %esi
	cmpl	$3, %r8d
	jle	.L36
	leaq	go(%rip), %rcx
	pxor	%xmm0, %xmm0
	movl	%esi, %edx
	shrl	$2, %edx
	leaq	16(%rcx), %rdi
	movdqa	%xmm0, %xmm2
	movq	%rcx, %rax
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rdi, %rdx
	.p2align 4,,10
	.p2align 3
.L10:
	movdqa	%xmm2, %xmm1
	addq	$16, %rax
	pcmpeqd	-16(%rax), %xmm1
	psubd	%xmm1, %xmm0
	cmpq	%rdx, %rax
	jne	.L10
	movdqa	%xmm0, %xmm1
	movl	%esi, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	andl	$3, %esi
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	je	.L12
	movslq	%eax, %rsi
	cmpl	$1, (%rcx,%rsi,4)
	adcl	$0, %edx
	addl	$1, %eax
	cmpl	%r8d, %eax
	jge	.L12
.L18:
	movslq	%eax, %rsi
	cmpl	$1, (%rcx,%rsi,4)
	adcl	$0, %edx
	addl	$1, %eax
	cmpl	%eax, %r8d
	jle	.L12
	cltq
	cmpl	$1, (%rcx,%rax,4)
	adcl	$0, %edx
.L12:
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L15:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L37
	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
.L4:
	.cfi_restore_state
	je	.L11
	xorl	%edx, %edx
	jmp	.L12
.L36:
	movl	go(%rip), %eax
	xorl	%edx, %edx
	leaq	go(%rip), %rcx
	testl	%eax, %eax
	movl	$1, %eax
	sete	%dl
	jmp	.L18
.L37:
	call	__stack_chk_fail@PLT
.L11:
	xorl	%edx, %edx
	cmpl	$0, go(%rip)
	sete	%dl
	jmp	.L12
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	go
	.bss
	.align 32
	.type	go, @object
	.size	go, 400000
go:
	.zero	400000
	.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:
```