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 n,a[1000001],b[1000001],c[1010100];i,ans;
char s[1010101];
int main(void){
    scanf("%d",&n);
    scanf("%s",s);
    //aは左から右へ黒を数える
    for(i = 1;i <= n;i++){
        if(s[i-1] == '#'){
            a[i] += a[i-1]+1;
        }else{
            a[i] = a[i-1];
        }
    //printf("%d",a[i])
    }
    //bは右から白を数える
    for(i = n-1;i>=0;i--){
        if(s[i] == '.'){
            b[i] += b[i+1]+1;
        }else{
            b[i] = b[i+1];
        }
    }
  /* for(i=n-1;i>=0;i--){
      printf("%d",b[i]);
    }*/
    for(i = 0;i <= n+1;i++){
        c[i] = a[i]+b[i];
    }
    ans = c[0];
    for(i=0;i<=n;i++){
    if(c[i]<ans){
        ans = c[i];
    }
    }
printf("%d",ans);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 4000004
a:
	.zero	4000004
	.globl	b
	.align 32
	.type	b, @object
	.size	b, 4000004
b:
	.zero	4000004
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 4040400
c:
	.zero	4040400
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	ans
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 1010101
s:
	.zero	1010101
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
	.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	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	s(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, i(%rip)
	jmp	.L2
.L5:
	movl	i(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$35, %al
	jne	.L3
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	i(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	i(%rip), %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L4
.L3:
	movl	i(%rip), %eax
	subl	$1, %eax
	movl	i(%rip), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	a(%rip), %rax
	movl	(%rcx,%rax), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L4:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L2:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jle	.L5
	movl	n(%rip), %eax
	subl	$1, %eax
	movl	%eax, i(%rip)
	jmp	.L6
.L9:
	movl	i(%rip), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$46, %al
	jne	.L7
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	i(%rip), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	i(%rip), %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L8
.L7:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	i(%rip), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	b(%rip), %rax
	movl	(%rcx,%rax), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	b(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L8:
	movl	i(%rip), %eax
	subl	$1, %eax
	movl	%eax, i(%rip)
.L6:
	movl	i(%rip), %eax
	testl	%eax, %eax
	jns	.L9
	movl	$0, i(%rip)
	jmp	.L10
.L11:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	i(%rip), %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L10:
	movl	n(%rip), %eax
	leal	1(%rax), %edx
	movl	i(%rip), %eax
	cmpl	%eax, %edx
	jge	.L11
	movl	c(%rip), %eax
	movl	%eax, ans(%rip)
	movl	$0, i(%rip)
	jmp	.L12
.L14:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	ans(%rip), %eax
	cmpl	%eax, %edx
	jge	.L13
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, ans(%rip)
.L13:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L12:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jle	.L14
	movl	ans(%rip), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	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"
.LC1:
	.string	"%s"
	.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
	leaq	.LC0(%rip), %rbp
	leaq	n(%rip), %rsi
	xorl	%eax, %eax
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movq	%rbp, %rdi
	leaq	s(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	call	__isoc99_scanf@PLT
	leaq	.LC1(%rip), %rdi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %edi
	testl	%edi, %edi
	jle	.L2
	leaq	4+a(%rip), %rax
	leal	-1(%rdi), %r8d
	movq	%rbx, %rcx
	leaq	4(%rax), %rsi
	movq	%r8, %rdx
	leaq	(%rsi,%r8,4), %r8
	.p2align 4,,10
	.p2align 3
.L6:
	cmpb	$35, (%rcx)
	movl	-4(%rax), %esi
	je	.L38
	movl	%esi, (%rax)
	addq	$4, %rax
	addq	$1, %rcx
	cmpq	%rax, %r8
	jne	.L6
.L5:
	movslq	%edi, %rax
	leaq	b(%rip), %rcx
	movslq	%edx, %rdx
	leaq	(%rcx,%rax,4), %rax
	.p2align 4,,10
	.p2align 3
.L10:
	cmpb	$46, (%rbx,%rdx)
	movl	(%rax), %ecx
	je	.L39
	subq	$1, %rdx
	movl	%ecx, -4(%rax)
	subq	$4, %rax
	testl	%edx, %edx
	jns	.L10
.L2:
	movl	%edi, %r9d
	addl	$1, %r9d
	js	.L11
	leal	2(%rdi), %r10d
	cmpl	$2, %r9d
	jle	.L24
	movl	%r10d, %edx
	xorl	%eax, %eax
	leaq	b(%rip), %rcx
	shrl	$2, %edx
	leaq	c(%rip), %rsi
	leaq	a(%rip), %r8
	salq	$4, %rdx
	.p2align 4,,10
	.p2align 3
.L13:
	movdqa	(%r8,%rax), %xmm0
	paddd	(%rcx,%rax), %xmm0
	movaps	%xmm0, (%rsi,%rax)
	addq	$16, %rax
	cmpq	%rax, %rdx
	jne	.L13
	movl	%r10d, %edx
	andl	$-4, %edx
	movl	%edx, %eax
	cmpl	%edx, %r10d
	je	.L11
.L12:
	movl	%edi, %r11d
	subl	%edx, %r11d
	leal	2(%r11), %r10d
	cmpl	$-1, %r11d
	je	.L15
	movq	(%r8,%rdx,4), %xmm0
	movq	(%rcx,%rdx,4), %xmm1
	paddd	%xmm1, %xmm0
	movq	%xmm0, (%rsi,%rdx,4)
	movl	%r10d, %edx
	andl	$-2, %edx
	addl	%edx, %eax
	cmpl	%edx, %r10d
	je	.L11
.L15:
	cltq
	movl	(%rcx,%rax,4), %edx
	addl	(%r8,%rax,4), %edx
	movl	%edx, (%rsi,%rax,4)
.L11:
	movl	$0, i(%rip)
	movl	c(%rip), %ecx
	movl	%ecx, ans(%rip)
	testl	%edi, %edi
	js	.L20
	je	.L34
	leaq	4+c(%rip), %rax
	leal	-1(%rdi), %esi
	xorl	%edi, %edi
	leaq	4(%rax), %rdx
	leaq	(%rdx,%rsi,4), %rsi
	.p2align 4,,10
	.p2align 3
.L22:
	movl	(%rax), %edx
	cmpl	%edx, %ecx
	jle	.L21
	movl	%edx, %ecx
	movl	$1, %edi
.L21:
	addq	$4, %rax
	cmpq	%rsi, %rax
	jne	.L22
	movl	%r9d, i(%rip)
	testb	%dil, %dil
	je	.L20
	movl	%ecx, ans(%rip)
.L20:
	movl	ans(%rip), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L39:
	.cfi_restore_state
	subq	$1, %rdx
	addl	$1, %ecx
	addl	%ecx, -4(%rax)
	subq	$4, %rax
	testl	%edx, %edx
	jns	.L10
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L38:
	addl	$1, %esi
	addl	%esi, (%rax)
	addq	$4, %rax
	addq	$1, %rcx
	cmpq	%rax, %r8
	jne	.L6
	jmp	.L5
.L34:
	movl	%r9d, i(%rip)
	jmp	.L20
.L24:
	xorl	%edx, %edx
	xorl	%eax, %eax
	leaq	b(%rip), %rcx
	leaq	c(%rip), %rsi
	leaq	a(%rip), %r8
	jmp	.L12
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 1010101
s:
	.zero	1010101
	.globl	ans
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 4040400
c:
	.zero	4040400
	.globl	b
	.align 32
	.type	b, @object
	.size	b, 4000004
b:
	.zero	4000004
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 4000004
a:
	.zero	4000004
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.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"
.LC1:
	.string	"%s"
	.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
	leaq	.LC0(%rip), %rbp
	leaq	n(%rip), %rsi
	xorl	%eax, %eax
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movq	%rbp, %rdi
	leaq	s(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	call	__isoc99_scanf@PLT
	leaq	.LC1(%rip), %rdi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %edi
	testl	%edi, %edi
	jle	.L2
	leaq	4+a(%rip), %rax
	leal	-1(%rdi), %r8d
	movq	%rbx, %rcx
	leaq	4(%rax), %rsi
	movq	%r8, %rdx
	leaq	(%rsi,%r8,4), %r8
	.p2align 4,,10
	.p2align 3
.L6:
	cmpb	$35, (%rcx)
	movl	-4(%rax), %esi
	je	.L38
	movl	%esi, (%rax)
	addq	$4, %rax
	addq	$1, %rcx
	cmpq	%rax, %r8
	jne	.L6
.L5:
	movslq	%edi, %rax
	leaq	b(%rip), %rcx
	movslq	%edx, %rdx
	leaq	(%rcx,%rax,4), %rax
	.p2align 4,,10
	.p2align 3
.L10:
	cmpb	$46, (%rbx,%rdx)
	movl	(%rax), %ecx
	je	.L39
	subq	$1, %rdx
	movl	%ecx, -4(%rax)
	subq	$4, %rax
	testl	%edx, %edx
	jns	.L10
.L2:
	movl	%edi, %r9d
	addl	$1, %r9d
	js	.L11
	leal	2(%rdi), %r10d
	cmpl	$2, %r9d
	jle	.L24
	movl	%r10d, %edx
	xorl	%eax, %eax
	leaq	b(%rip), %rcx
	shrl	$2, %edx
	leaq	c(%rip), %rsi
	leaq	a(%rip), %r8
	salq	$4, %rdx
	.p2align 4,,10
	.p2align 3
.L13:
	movdqa	(%r8,%rax), %xmm0
	paddd	(%rcx,%rax), %xmm0
	movaps	%xmm0, (%rsi,%rax)
	addq	$16, %rax
	cmpq	%rax, %rdx
	jne	.L13
	movl	%r10d, %edx
	andl	$-4, %edx
	movl	%edx, %eax
	cmpl	%edx, %r10d
	je	.L11
.L12:
	movl	%edi, %r11d
	subl	%edx, %r11d
	leal	2(%r11), %r10d
	cmpl	$-1, %r11d
	je	.L15
	movq	(%r8,%rdx,4), %xmm0
	movq	(%rcx,%rdx,4), %xmm1
	paddd	%xmm1, %xmm0
	movq	%xmm0, (%rsi,%rdx,4)
	movl	%r10d, %edx
	andl	$-2, %edx
	addl	%edx, %eax
	cmpl	%edx, %r10d
	je	.L11
.L15:
	cltq
	movl	(%rcx,%rax,4), %edx
	addl	(%r8,%rax,4), %edx
	movl	%edx, (%rsi,%rax,4)
.L11:
	movl	$0, i(%rip)
	movl	c(%rip), %ecx
	movl	%ecx, ans(%rip)
	testl	%edi, %edi
	js	.L20
	je	.L34
	leaq	4+c(%rip), %rax
	leal	-1(%rdi), %esi
	xorl	%edi, %edi
	leaq	4(%rax), %rdx
	leaq	(%rdx,%rsi,4), %rsi
	.p2align 4,,10
	.p2align 3
.L22:
	movl	(%rax), %edx
	cmpl	%edx, %ecx
	jle	.L21
	movl	%edx, %ecx
	movl	$1, %edi
.L21:
	addq	$4, %rax
	cmpq	%rsi, %rax
	jne	.L22
	movl	%r9d, i(%rip)
	testb	%dil, %dil
	je	.L20
	movl	%ecx, ans(%rip)
.L20:
	movl	ans(%rip), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L39:
	.cfi_restore_state
	subq	$1, %rdx
	addl	$1, %ecx
	addl	%ecx, -4(%rax)
	subq	$4, %rax
	testl	%edx, %edx
	jns	.L10
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L38:
	addl	$1, %esi
	addl	%esi, (%rax)
	addq	$4, %rax
	addq	$1, %rcx
	cmpq	%rax, %r8
	jne	.L6
	jmp	.L5
.L34:
	movl	%r9d, i(%rip)
	jmp	.L20
.L24:
	xorl	%edx, %edx
	xorl	%eax, %eax
	leaq	b(%rip), %rcx
	leaq	c(%rip), %rsi
	leaq	a(%rip), %r8
	jmp	.L12
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 1010101
s:
	.zero	1010101
	.globl	ans
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 4040400
c:
	.zero	4040400
	.globl	b
	.align 32
	.type	b, @object
	.size	b, 4000004
b:
	.zero	4000004
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 4000004
a:
	.zero	4000004
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.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 n,a[1000001],b[1000001],c[1010100];i,ans;
char s[1010101];
int main(void){
    scanf("%d",&n);
    scanf("%s",s);
    //aは左から右へ黒を数える
    for(i = 1;i <= n;i++){
        if(s[i-1] == '#'){
            a[i] += a[i-1]+1;
        }else{
            a[i] = a[i-1];
        }
    //printf("%d",a[i])
    }
    //bは右から白を数える
    for(i = n-1;i>=0;i--){
        if(s[i] == '.'){
            b[i] += b[i+1]+1;
        }else{
            b[i] = b[i+1];
        }
    }
  /* for(i=n-1;i>=0;i--){
      printf("%d",b[i]);
    }*/
    for(i = 0;i <= n+1;i++){
        c[i] = a[i]+b[i];
    }
    ans = c[0];
    for(i=0;i<=n;i++){
    if(c[i]<ans){
        ans = c[i];
    }
    }
printf("%d",ans);
}
5
.#.#
 3
.##
 3
##.
 5
..##
 5
#..#
 3
.# 
 3
##.
 3
.##
 5
.#.#
 5
..##

1 0 1 0 1 0 1 0 1 0
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 n,a[1000001],b[1000001],c[1010100];i,ans;
char s[1010101];
int main(void){
    scanf("%d",&n);
    scanf("%s",s);
    //aは左から右へ黒を数える
    for(i = 1;i <= n;i++){
        if(s[i-1] == '#'){
            a[i] += a[i-1]+1;
        }else{
            a[i] = a[i-1];
        }
    //printf("%d",a[i])
    }
    //bは右から白を数える
    for(i = n-1;i>=0;i--){
        if(s[i] == '.'){
            b[i] += b[i+1]+1;
        }else{
            b[i] = b[i+1];
        }
    }
  /* for(i=n-1;i>=0;i--){
      printf("%d",b[i]);
    }*/
    for(i = 0;i <= n+1;i++){
        c[i] = a[i]+b[i];
    }
    ans = c[0];
    for(i=0;i<=n;i++){
    if(c[i]<ans){
        ans = c[i];
    }
    }
printf("%d",ans);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 4000004
a:
	.zero	4000004
	.globl	b
	.align 32
	.type	b, @object
	.size	b, 4000004
b:
	.zero	4000004
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 4040400
c:
	.zero	4040400
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	ans
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 1010101
s:
	.zero	1010101
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
	.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	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	s(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, i(%rip)
	jmp	.L2
.L5:
	movl	i(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$35, %al
	jne	.L3
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	i(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	i(%rip), %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L4
.L3:
	movl	i(%rip), %eax
	subl	$1, %eax
	movl	i(%rip), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	a(%rip), %rax
	movl	(%rcx,%rax), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L4:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L2:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jle	.L5
	movl	n(%rip), %eax
	subl	$1, %eax
	movl	%eax, i(%rip)
	jmp	.L6
.L9:
	movl	i(%rip), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$46, %al
	jne	.L7
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	i(%rip), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	i(%rip), %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L8
.L7:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	i(%rip), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	b(%rip), %rax
	movl	(%rcx,%rax), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	b(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L8:
	movl	i(%rip), %eax
	subl	$1, %eax
	movl	%eax, i(%rip)
.L6:
	movl	i(%rip), %eax
	testl	%eax, %eax
	jns	.L9
	movl	$0, i(%rip)
	jmp	.L10
.L11:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	i(%rip), %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L10:
	movl	n(%rip), %eax
	leal	1(%rax), %edx
	movl	i(%rip), %eax
	cmpl	%eax, %edx
	jge	.L11
	movl	c(%rip), %eax
	movl	%eax, ans(%rip)
	movl	$0, i(%rip)
	jmp	.L12
.L14:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	ans(%rip), %eax
	cmpl	%eax, %edx
	jge	.L13
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, ans(%rip)
.L13:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L12:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jle	.L14
	movl	ans(%rip), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	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
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 4000004
a:
	.zero	4000004
	.globl	b
	.align 32
	.type	b, @object
	.size	b, 4000004
b:
	.zero	4000004
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 4040400
c:
	.zero	4040400
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	ans
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 1010101
s:
	.zero	1010101
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
	.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	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	s(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, i(%rip)
	jmp	.L2
.L5:
	movl	i(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$35, %al
	jne	.L3
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	i(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	i(%rip), %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L4
.L3:
	movl	i(%rip), %eax
	subl	$1, %eax
	movl	i(%rip), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	a(%rip), %rax
	movl	(%rcx,%rax), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L4:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L2:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jle	.L5
	movl	n(%rip), %eax
	subl	$1, %eax
	movl	%eax, i(%rip)
	jmp	.L6
.L9:
	movl	i(%rip), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$46, %al
	jne	.L7
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	i(%rip), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	i(%rip), %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L8
.L7:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	i(%rip), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	b(%rip), %rax
	movl	(%rcx,%rax), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	b(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L8:
	movl	i(%rip), %eax
	subl	$1, %eax
	movl	%eax, i(%rip)
.L6:
	movl	i(%rip), %eax
	testl	%eax, %eax
	jns	.L9
	movl	$0, i(%rip)
	jmp	.L10
.L11:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	i(%rip), %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L10:
	movl	n(%rip), %eax
	leal	1(%rax), %edx
	movl	i(%rip), %eax
	cmpl	%eax, %edx
	jge	.L11
	movl	c(%rip), %eax
	movl	%eax, ans(%rip)
	movl	$0, i(%rip)
	jmp	.L12
.L14:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	ans(%rip), %eax
	cmpl	%eax, %edx
	jge	.L13
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, ans(%rip)
.L13:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L12:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jle	.L14
	movl	ans(%rip), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	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:
