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>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <ctype.h>

char s[100010];
int buf[100010];
int ind;
int b1[100010];
int b2[100010];

int main(void)
{
  int l,run,i,j;
  fgets(s,100010,stdin);
  
  ind = 0;
  l = strlen(s);
  while(s[l-1] != '0' && s[l-1] != '1'){
    l--;
  }
  for(i=0;i<l;){
    for(j=i;j<l;j++){
      if(s[i]!=s[j]) break;
    }
    run = j-i;
    buf[ind++] = run;
    i += run;
  }
  if( ind<=1 ){
    printf("%d\n",l);
  } else if(ind==2){
    printf("%d\n", (buf[0]>buf[1] ? buf[0] : buf[1]));
  } else {
    j = 0;
    int min_v = 1000000000;
    for(i=0;i<ind-1;i++){
      j += buf[i];
      int v = j > l-j ? j : l-j;
      if(v<min_v) min_v = v;
    }
    printf("%d\n",min_v);
  }
  return EXIT_SUCCESS; 
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 100010
s:
	.zero	100010
	.globl	buf
	.align 32
	.type	buf, @object
	.size	buf, 400040
buf:
	.zero	400040
	.globl	ind
	.align 4
	.type	ind, @object
	.size	ind, 4
ind:
	.zero	4
	.globl	b1
	.align 32
	.type	b1, @object
	.size	b1, 400040
b1:
	.zero	400040
	.globl	b2
	.align 32
	.type	b2, @object
	.size	b2, 400040
b2:
	.zero	400040
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	stdin(%rip), %rax
	movq	%rax, %rdx
	movl	$100010, %esi
	leaq	s(%rip), %rax
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, ind(%rip)
	leaq	s(%rip), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -24(%rbp)
	jmp	.L2
.L4:
	subl	$1, -24(%rbp)
.L2:
	movl	-24(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$48, %al
	je	.L3
	movl	-24(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$49, %al
	jne	.L4
.L3:
	movl	$0, -20(%rbp)
	jmp	.L5
.L10:
	movl	-20(%rbp), %eax
	movl	%eax, -16(%rbp)
	jmp	.L6
.L9:
	movl	-20(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %edx
	movl	-16(%rbp), %eax
	cltq
	leaq	s(%rip), %rcx
	movzbl	(%rax,%rcx), %eax
	cmpb	%al, %dl
	jne	.L18
	addl	$1, -16(%rbp)
.L6:
	movl	-16(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jl	.L9
	jmp	.L8
.L18:
	nop
.L8:
	movl	-16(%rbp), %eax
	subl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	ind(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, ind(%rip)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	buf(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	addl	%eax, -20(%rbp)
.L5:
	movl	-20(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jl	.L10
	movl	ind(%rip), %eax
	cmpl	$1, %eax
	jg	.L11
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L12
.L11:
	movl	ind(%rip), %eax
	cmpl	$2, %eax
	jne	.L13
	movl	4+buf(%rip), %edx
	movl	buf(%rip), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L12
.L13:
	movl	$0, -16(%rbp)
	movl	$1000000000, -12(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L14
.L16:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	buf(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -16(%rbp)
	movl	-24(%rbp), %eax
	subl	-16(%rbp), %eax
	movl	-16(%rbp), %edx
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, -8(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L15
	movl	-8(%rbp), %eax
	movl	%eax, -12(%rbp)
.L15:
	addl	$1, -20(%rbp)
.L14:
	movl	ind(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -20(%rbp)
	jl	.L16
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L12:
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	$100010, %esi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	s(%rip), %rbx
	movq	%rbx, %rdi
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	movq	stdin(%rip), %rdx
	call	fgets@PLT
	movq	%rbx, %rdi
	movl	$0, ind(%rip)
	call	strlen@PLT
	leaq	-1(%rbx), %rcx
	.p2align 4,,10
	.p2align 3
.L2:
	movzbl	(%rcx,%rax), %edi
	movl	%eax, %r8d
	subq	$1, %rax
	leal	-48(%rdi), %edx
	cmpb	$1, %dl
	ja	.L2
	testl	%r8d, %r8d
	jle	.L9
	leaq	buf(%rip), %r11
	xorl	%ebp, %ebp
	xorl	%r9d, %r9d
	xorl	%edi, %edi
	movzbl	s(%rip), %esi
	movq	%r11, %r10
	.p2align 4,,10
	.p2align 3
.L8:
	movslq	%edi, %rdx
	movl	%edi, %eax
	addq	%rbx, %rdx
	.p2align 4,,10
	.p2align 3
.L6:
	movzbl	(%rdx), %ecx
	cmpb	%sil, %cl
	jne	.L5
	addl	$1, %eax
	addq	$1, %rdx
	cmpl	%eax, %r8d
	jg	.L6
	testb	%bpl, %bpl
	je	.L11
	movl	%r9d, ind(%rip)
.L11:
	movslq	ind(%rip), %rcx
	subl	%edi, %eax
	leal	1(%rcx), %edx
	movl	%eax, (%r11,%rcx,4)
	movq	%rcx, %r9
	movl	%edx, ind(%rip)
.L12:
	cmpl	$1, %edx
	jle	.L9
	movl	buf(%rip), %eax
	cmpl	$2, %edx
	je	.L25
	xorl	%ecx, %ecx
	movl	$1000000000, %r10d
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L10:
	addl	(%r11,%rcx,4), %edx
	movl	%r8d, %eax
	subl	%edx, %eax
	cmpl	%edx, %eax
	cmovl	%edx, %eax
	cmpl	%eax, %r10d
	cmovg	%eax, %r10d
	addq	$1, %rcx
	cmpl	%ecx, %r9d
	jg	.L10
	movl	%r10d, %edx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L21:
	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
.L5:
	.cfi_restore_state
	movl	%eax, %esi
	leal	1(%r9), %edx
	addq	$4, %r10
	movl	$1, %ebp
	subl	%edi, %esi
	movl	%esi, -4(%r10)
	cmpl	%eax, %r8d
	jle	.L26
	movl	%ecx, %esi
	movl	%edx, %r9d
	movl	%eax, %edi
	jmp	.L8
.L9:
	movl	%r8d, %edx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L21
.L25:
	movl	4+buf(%rip), %edx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	cmpl	%edx, %eax
	cmovge	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L21
.L26:
	movl	%edx, ind(%rip)
	jmp	.L12
	.cfi_endproc
.LFE53:
	.size	main, .-main
	.globl	b2
	.bss
	.align 32
	.type	b2, @object
	.size	b2, 400040
b2:
	.zero	400040
	.globl	b1
	.align 32
	.type	b1, @object
	.size	b1, 400040
b1:
	.zero	400040
	.globl	ind
	.align 4
	.type	ind, @object
	.size	ind, 4
ind:
	.zero	4
	.globl	buf
	.align 32
	.type	buf, @object
	.size	buf, 400040
buf:
	.zero	400040
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 100010
s:
	.zero	100010
	.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:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	$100010, %esi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	s(%rip), %rbx
	movq	%rbx, %rdi
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	movq	stdin(%rip), %rdx
	call	fgets@PLT
	movq	%rbx, %rdi
	movl	$0, ind(%rip)
	call	strlen@PLT
	leaq	-1(%rbx), %rcx
	.p2align 4,,10
	.p2align 3
.L2:
	movzbl	(%rcx,%rax), %edi
	movl	%eax, %r8d
	subq	$1, %rax
	leal	-48(%rdi), %edx
	cmpb	$1, %dl
	ja	.L2
	testl	%r8d, %r8d
	jle	.L9
	leaq	buf(%rip), %r11
	xorl	%ebp, %ebp
	xorl	%r9d, %r9d
	xorl	%edi, %edi
	movzbl	s(%rip), %esi
	movq	%r11, %r10
	.p2align 4,,10
	.p2align 3
.L8:
	movslq	%edi, %rdx
	movl	%edi, %eax
	addq	%rbx, %rdx
	.p2align 4,,10
	.p2align 3
.L6:
	movzbl	(%rdx), %ecx
	cmpb	%sil, %cl
	jne	.L5
	addl	$1, %eax
	addq	$1, %rdx
	cmpl	%eax, %r8d
	jg	.L6
	testb	%bpl, %bpl
	je	.L11
	movl	%r9d, ind(%rip)
.L11:
	movslq	ind(%rip), %rcx
	subl	%edi, %eax
	leal	1(%rcx), %edx
	movl	%eax, (%r11,%rcx,4)
	movq	%rcx, %r9
	movl	%edx, ind(%rip)
.L12:
	cmpl	$1, %edx
	jle	.L9
	movl	buf(%rip), %eax
	cmpl	$2, %edx
	je	.L25
	xorl	%ecx, %ecx
	movl	$1000000000, %r10d
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L10:
	addl	(%r11,%rcx,4), %edx
	movl	%r8d, %eax
	subl	%edx, %eax
	cmpl	%edx, %eax
	cmovl	%edx, %eax
	cmpl	%eax, %r10d
	cmovg	%eax, %r10d
	addq	$1, %rcx
	cmpl	%ecx, %r9d
	jg	.L10
	movl	%r10d, %edx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L21:
	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
.L5:
	.cfi_restore_state
	movl	%eax, %esi
	leal	1(%r9), %edx
	addq	$4, %r10
	movl	$1, %ebp
	subl	%edi, %esi
	movl	%esi, -4(%r10)
	cmpl	%eax, %r8d
	jle	.L26
	movl	%ecx, %esi
	movl	%edx, %r9d
	movl	%eax, %edi
	jmp	.L8
.L9:
	movl	%r8d, %edx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L21
.L25:
	movl	4+buf(%rip), %edx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	cmpl	%edx, %eax
	cmovge	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L21
.L26:
	movl	%edx, ind(%rip)
	jmp	.L12
	.cfi_endproc
.LFE53:
	.size	main, .-main
	.globl	b2
	.bss
	.align 32
	.type	b2, @object
	.size	b2, 400040
b2:
	.zero	400040
	.globl	b1
	.align 32
	.type	b1, @object
	.size	b1, 400040
b1:
	.zero	400040
	.globl	ind
	.align 4
	.type	ind, @object
	.size	ind, 4
ind:
	.zero	4
	.globl	buf
	.align 32
	.type	buf, @object
	.size	buf, 400040
buf:
	.zero	400040
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 100010
s:
	.zero	100010
	.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>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <ctype.h>

char s[100010];
int buf[100010];
int ind;
int b1[100010];
int b2[100010];

int main(void)
{
  int l,run,i,j;
  fgets(s,100010,stdin);
  
  ind = 0;
  l = strlen(s);
  while(s[l-1] != '0' && s[l-1] != '1'){
    l--;
  }
  for(i=0;i<l;){
    for(j=i;j<l;j++){
      if(s[i]!=s[j]) break;
    }
    run = j-i;
    buf[ind++] = run;
    i += run;
  }
  if( ind<=1 ){
    printf("%d\n",l);
  } else if(ind==2){
    printf("%d\n", (buf[0]>buf[1] ? buf[0] : buf[1]));
  } else {
    j = 0;
    int min_v = 1000000000;
    for(i=0;i<ind-1;i++){
      j += buf[i];
      int v = j > l-j ? j : l-j;
      if(v<min_v) min_v = v;
    }
    printf("%d\n",min_v);
  }
  return EXIT_SUCCESS; 
}


100000010
 011
 00001101
 111
 00011101
 100000101
 11111111
 000000000
 100000011
 100001011

7
 2
 4
 3
 5
 6
 8
 9
 7
 5

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>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <ctype.h>

char s[100010];
int buf[100010];
int ind;
int b1[100010];
int b2[100010];

int main(void)
{
  int l,run,i,j;
  fgets(s,100010,stdin);
  
  ind = 0;
  l = strlen(s);
  while(s[l-1] != '0' && s[l-1] != '1'){
    l--;
  }
  for(i=0;i<l;){
    for(j=i;j<l;j++){
      if(s[i]!=s[j]) break;
    }
    run = j-i;
    buf[ind++] = run;
    i += run;
  }
  if( ind<=1 ){
    printf("%d\n",l);
  } else if(ind==2){
    printf("%d\n", (buf[0]>buf[1] ? buf[0] : buf[1]));
  } else {
    j = 0;
    int min_v = 1000000000;
    for(i=0;i<ind-1;i++){
      j += buf[i];
      int v = j > l-j ? j : l-j;
      if(v<min_v) min_v = v;
    }
    printf("%d\n",min_v);
  }
  return EXIT_SUCCESS; 
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 100010
s:
	.zero	100010
	.globl	buf
	.align 32
	.type	buf, @object
	.size	buf, 400040
buf:
	.zero	400040
	.globl	ind
	.align 4
	.type	ind, @object
	.size	ind, 4
ind:
	.zero	4
	.globl	b1
	.align 32
	.type	b1, @object
	.size	b1, 400040
b1:
	.zero	400040
	.globl	b2
	.align 32
	.type	b2, @object
	.size	b2, 400040
b2:
	.zero	400040
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	stdin(%rip), %rax
	movq	%rax, %rdx
	movl	$100010, %esi
	leaq	s(%rip), %rax
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, ind(%rip)
	leaq	s(%rip), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -24(%rbp)
	jmp	.L2
.L4:
	subl	$1, -24(%rbp)
.L2:
	movl	-24(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$48, %al
	je	.L3
	movl	-24(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$49, %al
	jne	.L4
.L3:
	movl	$0, -20(%rbp)
	jmp	.L5
.L10:
	movl	-20(%rbp), %eax
	movl	%eax, -16(%rbp)
	jmp	.L6
.L9:
	movl	-20(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %edx
	movl	-16(%rbp), %eax
	cltq
	leaq	s(%rip), %rcx
	movzbl	(%rax,%rcx), %eax
	cmpb	%al, %dl
	jne	.L18
	addl	$1, -16(%rbp)
.L6:
	movl	-16(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jl	.L9
	jmp	.L8
.L18:
	nop
.L8:
	movl	-16(%rbp), %eax
	subl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	ind(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, ind(%rip)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	buf(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	addl	%eax, -20(%rbp)
.L5:
	movl	-20(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jl	.L10
	movl	ind(%rip), %eax
	cmpl	$1, %eax
	jg	.L11
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L12
.L11:
	movl	ind(%rip), %eax
	cmpl	$2, %eax
	jne	.L13
	movl	4+buf(%rip), %edx
	movl	buf(%rip), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L12
.L13:
	movl	$0, -16(%rbp)
	movl	$1000000000, -12(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L14
.L16:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	buf(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -16(%rbp)
	movl	-24(%rbp), %eax
	subl	-16(%rbp), %eax
	movl	-16(%rbp), %edx
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, -8(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L15
	movl	-8(%rbp), %eax
	movl	%eax, -12(%rbp)
.L15:
	addl	$1, -20(%rbp)
.L14:
	movl	ind(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -20(%rbp)
	jl	.L16
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L12:
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 100010
s:
	.zero	100010
	.globl	buf
	.align 32
	.type	buf, @object
	.size	buf, 400040
buf:
	.zero	400040
	.globl	ind
	.align 4
	.type	ind, @object
	.size	ind, 4
ind:
	.zero	4
	.globl	b1
	.align 32
	.type	b1, @object
	.size	b1, 400040
b1:
	.zero	400040
	.globl	b2
	.align 32
	.type	b2, @object
	.size	b2, 400040
b2:
	.zero	400040
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	stdin(%rip), %rax
	movq	%rax, %rdx
	movl	$100010, %esi
	leaq	s(%rip), %rax
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, ind(%rip)
	leaq	s(%rip), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -24(%rbp)
	jmp	.L2
.L4:
	subl	$1, -24(%rbp)
.L2:
	movl	-24(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$48, %al
	je	.L3
	movl	-24(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$49, %al
	jne	.L4
.L3:
	movl	$0, -20(%rbp)
	jmp	.L5
.L10:
	movl	-20(%rbp), %eax
	movl	%eax, -16(%rbp)
	jmp	.L6
.L9:
	movl	-20(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %edx
	movl	-16(%rbp), %eax
	cltq
	leaq	s(%rip), %rcx
	movzbl	(%rax,%rcx), %eax
	cmpb	%al, %dl
	jne	.L18
	addl	$1, -16(%rbp)
.L6:
	movl	-16(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jl	.L9
	jmp	.L8
.L18:
	nop
.L8:
	movl	-16(%rbp), %eax
	subl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	ind(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, ind(%rip)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	buf(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	addl	%eax, -20(%rbp)
.L5:
	movl	-20(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jl	.L10
	movl	ind(%rip), %eax
	cmpl	$1, %eax
	jg	.L11
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L12
.L11:
	movl	ind(%rip), %eax
	cmpl	$2, %eax
	jne	.L13
	movl	4+buf(%rip), %edx
	movl	buf(%rip), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L12
.L13:
	movl	$0, -16(%rbp)
	movl	$1000000000, -12(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L14
.L16:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	buf(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -16(%rbp)
	movl	-24(%rbp), %eax
	subl	-16(%rbp), %eax
	movl	-16(%rbp), %edx
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, -8(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L15
	movl	-8(%rbp), %eax
	movl	%eax, -12(%rbp)
.L15:
	addl	$1, -20(%rbp)
.L14:
	movl	ind(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -20(%rbp)
	jl	.L16
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L12:
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
