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>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#define swap(type,a,b) do{type t=a;a=b;b=t;}while(0);
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define ll long long
#define INF 100000000
#define FOR(i,a,n) for(i=(a);i<(n);i++)
int comp(const void* a,const void* b){
	return *(int*)a-*(int*)b;
}
void fill(int a[],int b,int c){
	int i;
	FOR(i,0,b) a[i]=c;
	return;
}
int a[100000];
int main(void)
{
	int n,i;
	ll res=0,sum;
	scanf("%d",&n);
	FOR(i,0,n) scanf("%d",&a[i]);
	FOR(i,0,n){
		sum=0;
		while(a[i]!=0) sum+=a[i++];
		res+=sum/2;
	}
	printf("%lld\n",res);
	return 0;
}
    
    
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	comp
	.type	comp, @function
comp:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	comp, .-comp
	.p2align 4
	.globl	fill
	.type	fill, @function
fill:
.LFB52:
	.cfi_startproc
	endbr64
	movl	%esi, %ecx
	testl	%esi, %esi
	jle	.L3
	leal	-1(%rsi), %eax
	cmpl	$2, %eax
	jbe	.L8
	shrl	$2, %esi
	movd	%edx, %xmm1
	movq	%rdi, %rax
	subl	$1, %esi
	pshufd	$0, %xmm1, %xmm0
	salq	$4, %rsi
	leaq	16(%rdi,%rsi), %rsi
	.p2align 4,,10
	.p2align 3
.L6:
	movups	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rsi, %rax
	jne	.L6
	movl	%ecx, %eax
	andl	$-4, %eax
	testb	$3, %cl
	je	.L10
.L5:
	movslq	%eax, %rsi
	movl	%edx, (%rdi,%rsi,4)
	leaq	0(,%rsi,4), %r8
	leal	1(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L3
	addl	$2, %eax
	movl	%edx, 4(%rdi,%r8)
	cmpl	%eax, %ecx
	jle	.L3
	movl	%edx, 8(%rdi,%r8)
.L3:
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	ret
.L8:
	xorl	%eax, %eax
	jmp	.L5
	.cfi_endproc
.LFE52:
	.size	fill, .-fill
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L12
	leaq	a(%rip), %rbx
	xorl	%ebp, %ebp
	movq	%rbx, %r12
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r8d
	addq	$4, %r12
	cmpl	%ebp, %r8d
	jg	.L13
	testl	%r8d, %r8d
	jle	.L12
	xorl	%r9d, %r9d
	xorl	%esi, %esi
	leaq	-4+a(%rip), %rdi
	.p2align 4,,10
	.p2align 3
.L14:
	movslq	%esi, %rax
	leal	1(%rsi), %edx
	xorl	%ecx, %ecx
	movslq	(%rbx,%rax,4), %rax
	movslq	%edx, %rdx
	testl	%eax, %eax
	je	.L18
	.p2align 4,,10
	.p2align 3
.L15:
	movl	%edx, %esi
	addq	$1, %rdx
	addq	%rax, %rcx
	movslq	(%rdi,%rdx,4), %rax
	testl	%eax, %eax
	jne	.L15
	movq	%rcx, %rax
	shrq	$63, %rax
	addq	%rcx, %rax
	sarq	%rax
	addq	%rax, %r9
.L18:
	addl	$1, %esi
	cmpl	%esi, %r8d
	jg	.L14
.L16:
	xorl	%eax, %eax
	movq	%r9, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L12:
	.cfi_restore_state
	xorl	%r9d, %r9d
	jmp	.L16
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE53:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 400000
a:
	.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
	.p2align 4
	.globl	comp
	.type	comp, @function
comp:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	comp, .-comp
	.p2align 4
	.globl	fill
	.type	fill, @function
fill:
.LFB52:
	.cfi_startproc
	endbr64
	movl	%esi, %ecx
	testl	%esi, %esi
	jle	.L3
	leal	-1(%rsi), %eax
	cmpl	$2, %eax
	jbe	.L8
	shrl	$2, %esi
	movd	%edx, %xmm1
	movq	%rdi, %rax
	subl	$1, %esi
	pshufd	$0, %xmm1, %xmm0
	salq	$4, %rsi
	leaq	16(%rdi,%rsi), %rsi
	.p2align 4,,10
	.p2align 3
.L6:
	movups	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rsi, %rax
	jne	.L6
	movl	%ecx, %eax
	andl	$-4, %eax
	testb	$3, %cl
	je	.L10
.L5:
	movslq	%eax, %rsi
	movl	%edx, (%rdi,%rsi,4)
	leaq	0(,%rsi,4), %r8
	leal	1(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L3
	addl	$2, %eax
	movl	%edx, 4(%rdi,%r8)
	cmpl	%eax, %ecx
	jle	.L3
	movl	%edx, 8(%rdi,%r8)
.L3:
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	ret
.L8:
	xorl	%eax, %eax
	jmp	.L5
	.cfi_endproc
.LFE52:
	.size	fill, .-fill
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L12
	leaq	a(%rip), %rbx
	xorl	%ebp, %ebp
	movq	%rbx, %r12
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r8d
	addq	$4, %r12
	cmpl	%ebp, %r8d
	jg	.L13
	testl	%r8d, %r8d
	jle	.L12
	xorl	%r9d, %r9d
	xorl	%esi, %esi
	leaq	-4+a(%rip), %rdi
	.p2align 4,,10
	.p2align 3
.L14:
	movslq	%esi, %rax
	leal	1(%rsi), %edx
	xorl	%ecx, %ecx
	movslq	(%rbx,%rax,4), %rax
	movslq	%edx, %rdx
	testl	%eax, %eax
	je	.L18
	.p2align 4,,10
	.p2align 3
.L15:
	movl	%edx, %esi
	addq	$1, %rdx
	addq	%rax, %rcx
	movslq	(%rdi,%rdx,4), %rax
	testl	%eax, %eax
	jne	.L15
	movq	%rcx, %rax
	shrq	$63, %rax
	addq	%rcx, %rax
	sarq	%rax
	addq	%rax, %r9
.L18:
	addl	$1, %esi
	cmpl	%esi, %r8d
	jg	.L14
.L16:
	xorl	%eax, %eax
	movq	%r9, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L12:
	.cfi_restore_state
	xorl	%r9d, %r9d
	jmp	.L16
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE53:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 400000
a:
	.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
	.p2align 4
	.globl	comp
	.type	comp, @function
comp:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	comp, .-comp
	.p2align 4
	.globl	fill
	.type	fill, @function
fill:
.LFB52:
	.cfi_startproc
	endbr64
	movl	%esi, %ecx
	testl	%esi, %esi
	jle	.L3
	leal	-1(%rsi), %eax
	cmpl	$2, %eax
	jbe	.L8
	shrl	$2, %esi
	movd	%edx, %xmm1
	movq	%rdi, %rax
	subl	$1, %esi
	pshufd	$0, %xmm1, %xmm0
	salq	$4, %rsi
	leaq	16(%rdi,%rsi), %rsi
	.p2align 4,,10
	.p2align 3
.L6:
	movups	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rsi, %rax
	jne	.L6
	movl	%ecx, %eax
	andl	$-4, %eax
	testb	$3, %cl
	je	.L10
.L5:
	movslq	%eax, %rsi
	movl	%edx, (%rdi,%rsi,4)
	leaq	0(,%rsi,4), %r8
	leal	1(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L3
	addl	$2, %eax
	movl	%edx, 4(%rdi,%r8)
	cmpl	%eax, %ecx
	jle	.L3
	movl	%edx, 8(%rdi,%r8)
.L3:
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	ret
.L8:
	xorl	%eax, %eax
	jmp	.L5
	.cfi_endproc
.LFE52:
	.size	fill, .-fill
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L12
	leaq	a(%rip), %rbx
	xorl	%ebp, %ebp
	movq	%rbx, %r12
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r8d
	addq	$4, %r12
	cmpl	%ebp, %r8d
	jg	.L13
	testl	%r8d, %r8d
	jle	.L12
	xorl	%r9d, %r9d
	xorl	%esi, %esi
	leaq	-4+a(%rip), %rdi
	.p2align 4,,10
	.p2align 3
.L14:
	movslq	%esi, %rax
	leal	1(%rsi), %edx
	xorl	%ecx, %ecx
	movslq	(%rbx,%rax,4), %rax
	movslq	%edx, %rdx
	testl	%eax, %eax
	je	.L18
	.p2align 4,,10
	.p2align 3
.L15:
	movl	%edx, %esi
	addq	$1, %rdx
	addq	%rax, %rcx
	movslq	(%rdi,%rdx,4), %rax
	testl	%eax, %eax
	jne	.L15
	movq	%rcx, %rax
	shrq	$63, %rax
	addq	%rcx, %rax
	sarq	%rax
	addq	%rax, %r9
.L18:
	addl	$1, %esi
	cmpl	%esi, %r8d
	jg	.L14
.L16:
	xorl	%eax, %eax
	movq	%r9, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L12:
	.cfi_restore_state
	xorl	%r9d, %r9d
	jmp	.L16
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE53:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 400000
a:
	.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>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#define swap(type,a,b) do{type t=a;a=b;b=t;}while(0);
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define ll long long
#define INF 100000000
#define FOR(i,a,n) for(i=(a);i<(n);i++)
int comp(const void* a,const void* b){
	return *(int*)a-*(int*)b;
}
void fill(int a[],int b,int c){
	int i;
	FOR(i,0,b) a[i]=c;
	return;
}
int a[100000];
int main(void)
{
	int n,i;
	ll res=0,sum;
	scanf("%d",&n);
	FOR(i,0,n) scanf("%d",&a[i]);
	FOR(i,0,n){
		sum=0;
		while(a[i]!=0) sum+=a[i++];
		res+=sum/2;
	}
	printf("%lld\n",res);
	return 0;
}
    
    
```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#define swap(type,a,b) do{type t=a;a=b;b=t;}while(0);
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define ll long long
#define INF 100000000
#define FOR(i,a,n) for(i=(a);i<(n);i++)
int comp(const void* a,const void* b){
	return *(int*)a-*(int*)b;
}
void fill(int a[],int b,int c){
	int i;
	FOR(i,0,b) a[i]=c;
	return;
}
int a[100000];
int main(void)
{
	int n,i;
	ll res=0,sum;
	scanf("%d",&n);
	FOR(i,0,n) scanf("%d",&a[i]);
	FOR(i,0,n){
		sum=0;
		while(a[i]!=0) sum+=a[i++];
		res+=sum/2;
	}
	printf("%lld\n",res);
	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
2
0
1
6
1
8
2
1
 4
4
0
3
1
 8
2
0
1
9
1
8
2
1
 4
3
0
3
1
 4
0
0
3
1
 8
1
0
1
9
1
5
2
1
 8
1
0
1
1
1
5
1
1
 8
0
0
1
4
1
5
1
1
 8
0
0
1
4
1
5
2
1
 8
1
1
2
0
1
5
4
2

10
 4
 12
 3
 2
 9
 5
 6
 7
 8

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>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#define swap(type,a,b) do{type t=a;a=b;b=t;}while(0);
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define ll long long
#define INF 100000000
#define FOR(i,a,n) for(i=(a);i<(n);i++)
int comp(const void* a,const void* b){
	return *(int*)a-*(int*)b;
}
void fill(int a[],int b,int c){
	int i;
	FOR(i,0,b) a[i]=c;
	return;
}
int a[100000];
int main(void)
{
	int n,i;
	ll res=0,sum;
	scanf("%d",&n);
	FOR(i,0,n) scanf("%d",&a[i]);
	FOR(i,0,n){
		sum=0;
		while(a[i]!=0) sum+=a[i++];
		res+=sum/2;
	}
	printf("%lld\n",res);
	return 0;
}
    
    
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	comp
	.type	comp, @function
comp:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	comp, .-comp
	.p2align 4
	.globl	fill
	.type	fill, @function
fill:
.LFB52:
	.cfi_startproc
	endbr64
	movl	%esi, %ecx
	testl	%esi, %esi
	jle	.L3
	leal	-1(%rsi), %eax
	cmpl	$2, %eax
	jbe	.L8
	shrl	$2, %esi
	movd	%edx, %xmm1
	movq	%rdi, %rax
	subl	$1, %esi
	pshufd	$0, %xmm1, %xmm0
	salq	$4, %rsi
	leaq	16(%rdi,%rsi), %rsi
	.p2align 4,,10
	.p2align 3
.L6:
	movups	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rsi, %rax
	jne	.L6
	movl	%ecx, %eax
	andl	$-4, %eax
	testb	$3, %cl
	je	.L10
.L5:
	movslq	%eax, %rsi
	movl	%edx, (%rdi,%rsi,4)
	leaq	0(,%rsi,4), %r8
	leal	1(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L3
	addl	$2, %eax
	movl	%edx, 4(%rdi,%r8)
	cmpl	%eax, %ecx
	jle	.L3
	movl	%edx, 8(%rdi,%r8)
.L3:
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	ret
.L8:
	xorl	%eax, %eax
	jmp	.L5
	.cfi_endproc
.LFE52:
	.size	fill, .-fill
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L12
	leaq	a(%rip), %rbx
	xorl	%ebp, %ebp
	movq	%rbx, %r12
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r8d
	addq	$4, %r12
	cmpl	%ebp, %r8d
	jg	.L13
	testl	%r8d, %r8d
	jle	.L12
	xorl	%r9d, %r9d
	xorl	%esi, %esi
	leaq	-4+a(%rip), %rdi
	.p2align 4,,10
	.p2align 3
.L14:
	movslq	%esi, %rax
	leal	1(%rsi), %edx
	xorl	%ecx, %ecx
	movslq	(%rbx,%rax,4), %rax
	movslq	%edx, %rdx
	testl	%eax, %eax
	je	.L18
	.p2align 4,,10
	.p2align 3
.L15:
	movl	%edx, %esi
	addq	$1, %rdx
	addq	%rax, %rcx
	movslq	(%rdi,%rdx,4), %rax
	testl	%eax, %eax
	jne	.L15
	movq	%rcx, %rax
	shrq	$63, %rax
	addq	%rcx, %rax
	sarq	%rax
	addq	%rax, %r9
.L18:
	addl	$1, %esi
	cmpl	%esi, %r8d
	jg	.L14
.L16:
	xorl	%eax, %eax
	movq	%r9, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L12:
	.cfi_restore_state
	xorl	%r9d, %r9d
	jmp	.L16
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE53:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 400000
a:
	.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
	.p2align 4
	.globl	comp
	.type	comp, @function
comp:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	comp, .-comp
	.p2align 4
	.globl	fill
	.type	fill, @function
fill:
.LFB52:
	.cfi_startproc
	endbr64
	movl	%esi, %ecx
	testl	%esi, %esi
	jle	.L3
	leal	-1(%rsi), %eax
	cmpl	$2, %eax
	jbe	.L8
	shrl	$2, %esi
	movd	%edx, %xmm1
	movq	%rdi, %rax
	subl	$1, %esi
	pshufd	$0, %xmm1, %xmm0
	salq	$4, %rsi
	leaq	16(%rdi,%rsi), %rsi
	.p2align 4,,10
	.p2align 3
.L6:
	movups	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rsi, %rax
	jne	.L6
	movl	%ecx, %eax
	andl	$-4, %eax
	testb	$3, %cl
	je	.L10
.L5:
	movslq	%eax, %rsi
	movl	%edx, (%rdi,%rsi,4)
	leaq	0(,%rsi,4), %r8
	leal	1(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L3
	addl	$2, %eax
	movl	%edx, 4(%rdi,%r8)
	cmpl	%eax, %ecx
	jle	.L3
	movl	%edx, 8(%rdi,%r8)
.L3:
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	ret
.L8:
	xorl	%eax, %eax
	jmp	.L5
	.cfi_endproc
.LFE52:
	.size	fill, .-fill
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L12
	leaq	a(%rip), %rbx
	xorl	%ebp, %ebp
	movq	%rbx, %r12
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r8d
	addq	$4, %r12
	cmpl	%ebp, %r8d
	jg	.L13
	testl	%r8d, %r8d
	jle	.L12
	xorl	%r9d, %r9d
	xorl	%esi, %esi
	leaq	-4+a(%rip), %rdi
	.p2align 4,,10
	.p2align 3
.L14:
	movslq	%esi, %rax
	leal	1(%rsi), %edx
	xorl	%ecx, %ecx
	movslq	(%rbx,%rax,4), %rax
	movslq	%edx, %rdx
	testl	%eax, %eax
	je	.L18
	.p2align 4,,10
	.p2align 3
.L15:
	movl	%edx, %esi
	addq	$1, %rdx
	addq	%rax, %rcx
	movslq	(%rdi,%rdx,4), %rax
	testl	%eax, %eax
	jne	.L15
	movq	%rcx, %rax
	shrq	$63, %rax
	addq	%rcx, %rax
	sarq	%rax
	addq	%rax, %r9
.L18:
	addl	$1, %esi
	cmpl	%esi, %r8d
	jg	.L14
.L16:
	xorl	%eax, %eax
	movq	%r9, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L12:
	.cfi_restore_state
	xorl	%r9d, %r9d
	jmp	.L16
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE53:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 400000
a:
	.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:
```