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 <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; 
}

```

Assembly Code:

```assembly
	.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:
```

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\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
```assembly
	.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:
```
```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; 
}

```
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 <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; 
}

```

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:

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 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; 
}

```

Assembly Code:

```assembly
	.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:
```

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\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:
```