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<string.h>
int main(){
  char s[100010],s1[100010],s2[100010]={};
  int i,r=0,c=0;
  scanf("%s",s);
  for(i=0;s[i];i++){
    if(s[i]-'x')s1[r++]=s[i];
  }
  s[i]=r=0;
  while(i--){
    if(s[i]-'x')s2[r++]=s[i];
  }
  if(strcmp(s1,s2)){
    printf("-1\n");
    return 0;
  }
  for(r=0;s[r+1];r++);
  for(i=0;s[i];i++){//printf("%c %c %d\n",s[i],s[r],c);
    if(s[i]==s[r]){
      r--;
      continue;
    }
    c++;
    if(s[i]=='x');
    else{
      r--;
      i--;
    }
  }//printf("%d\n",r);
  c+=r+1;
  printf("%d\n",c/2);
  return 0;
}
  
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"-1"
.LC2:
	.string	"%d\n"
	.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	-299008(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1072, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -100032(%rbp)
	movq	$0, -100024(%rbp)
	leaq	-100016(%rbp), %rax
	movl	$99994, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -300072(%rbp)
	movl	$0, -300068(%rbp)
	leaq	-300064(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -300076(%rbp)
	jmp	.L2
.L4:
	movl	-300076(%rbp), %eax
	cltq
	movzbl	-300064(%rbp,%rax), %eax
	cmpb	$120, %al
	je	.L3
	movl	-300072(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -300072(%rbp)
	movl	-300076(%rbp), %edx
	movslq	%edx, %rdx
	movzbl	-300064(%rbp,%rdx), %edx
	cltq
	movb	%dl, -200048(%rbp,%rax)
.L3:
	addl	$1, -300076(%rbp)
.L2:
	movl	-300076(%rbp), %eax
	cltq
	movzbl	-300064(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L4
	movl	$0, -300072(%rbp)
	movl	-300076(%rbp), %eax
	cltq
	movb	$0, -300064(%rbp,%rax)
	jmp	.L5
.L6:
	movl	-300076(%rbp), %eax
	cltq
	movzbl	-300064(%rbp,%rax), %eax
	cmpb	$120, %al
	je	.L5
	movl	-300072(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -300072(%rbp)
	movl	-300076(%rbp), %edx
	movslq	%edx, %rdx
	movzbl	-300064(%rbp,%rdx), %edx
	cltq
	movb	%dl, -100032(%rbp,%rax)
.L5:
	movl	-300076(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -300076(%rbp)
	testl	%eax, %eax
	jne	.L6
	leaq	-100032(%rbp), %rdx
	leaq	-200048(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	je	.L7
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L15
.L7:
	movl	$0, -300072(%rbp)
	jmp	.L9
.L10:
	addl	$1, -300072(%rbp)
.L9:
	movl	-300072(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-300064(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L10
	movl	$0, -300076(%rbp)
	jmp	.L11
.L14:
	movl	-300076(%rbp), %eax
	cltq
	movzbl	-300064(%rbp,%rax), %edx
	movl	-300072(%rbp), %eax
	cltq
	movzbl	-300064(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L12
	subl	$1, -300072(%rbp)
	jmp	.L13
.L12:
	addl	$1, -300068(%rbp)
	movl	-300076(%rbp), %eax
	cltq
	movzbl	-300064(%rbp,%rax), %eax
	cmpb	$120, %al
	je	.L13
	subl	$1, -300072(%rbp)
	subl	$1, -300076(%rbp)
.L13:
	addl	$1, -300076(%rbp)
.L11:
	movl	-300076(%rbp), %eax
	cltq
	movzbl	-300064(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L14
	movl	-300072(%rbp), %eax
	addl	$1, %eax
	addl	%eax, -300068(%rbp)
	movl	-300068(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L15:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.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	"%s"
.LC1:
	.string	"-1"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	-299008(%rsp), %r11
	.cfi_def_cfa 11, 299032
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1064, %rsp
	.cfi_def_cfa_offset 300096
	pxor	%xmm0, %xmm0
	movl	$99994, %edx
	xorl	%esi, %esi
	movq	%fs:40, %rax
	movq	%rax, 300056(%rsp)
	xorl	%eax, %eax
	leaq	200048(%rsp), %rdi
	movq	%rsp, %rbp
	movaps	%xmm0, 200032(%rsp)
	call	memset@PLT
	movq	%rbp, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	(%rsp), %ebx
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	movl	%ebx, %edx
	testb	%bl, %bl
	jne	.L2
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L37:
	movb	%dl, 100016(%rsp,%rcx)
	movzbl	1(%rbp,%rax), %edx
	leal	1(%rcx), %r8d
	leaq	1(%rax), %rsi
	testb	%dl, %dl
	je	.L7
	movslq	%r8d, %rcx
.L6:
	movq	%rsi, %rax
.L2:
	movslq	%eax, %rdi
	cmpb	$120, %dl
	jne	.L37
	movzbl	1(%rbp,%rax), %edx
	leaq	1(%rax), %rsi
	testb	%dl, %dl
	jne	.L6
.L7:
	leaq	-1(%rsp,%rdi), %rsi
	leaq	0(%rbp,%rdi), %rdx
	xorl	%ecx, %ecx
	subq	%rax, %rsi
	.p2align 4,,10
	.p2align 3
.L9:
	movzbl	(%rdx), %eax
	cmpb	$120, %al
	je	.L8
	movslq	%ecx, %rdi
	addl	$1, %ecx
	movb	%al, 200032(%rsp,%rdi)
.L8:
	subq	$1, %rdx
	cmpq	%rdx, %rsi
	jne	.L9
.L10:
	leaq	200032(%rsp), %rsi
	leaq	100016(%rsp), %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L3
	movl	%ebx, %esi
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L4:
	movl	%edx, %ecx
	addq	$1, %rdx
	movl	%esi, %edi
	movzbl	0(%rbp,%rdx), %esi
	testb	%sil, %sil
	jne	.L4
	xorl	%edx, %edx
	testb	%bl, %bl
	jne	.L17
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L15:
	subl	$1, %ecx
.L16:
	movslq	%ecx, %rsi
	movzbl	(%rsp,%rsi), %edi
.L17:
	cmpb	%bl, %dil
	je	.L38
	addl	$1, %edx
	cmpb	$120, %bl
	jne	.L15
	addl	$1, %eax
	movslq	%eax, %rsi
	movzbl	(%rsp,%rsi), %ebx
.L14:
	testb	%bl, %bl
	jne	.L16
.L12:
	leal	1(%rcx,%rdx), %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%eax, %edx
	xorl	%eax, %eax
	sarl	%edx
	call	__printf_chk@PLT
.L11:
	movq	300056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L39
	addq	$300072, %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
.L38:
	.cfi_restore_state
	addl	$1, %eax
	subl	$1, %ecx
	movslq	%eax, %rsi
	movzbl	(%rsp,%rsi), %ebx
	jmp	.L14
.L3:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L11
.L39:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"-1"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	-299008(%rsp), %r11
	.cfi_def_cfa 11, 299032
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1064, %rsp
	.cfi_def_cfa_offset 300096
	pxor	%xmm0, %xmm0
	movl	$99994, %edx
	xorl	%esi, %esi
	movq	%fs:40, %rax
	movq	%rax, 300056(%rsp)
	xorl	%eax, %eax
	leaq	200048(%rsp), %rdi
	movq	%rsp, %rbp
	movaps	%xmm0, 200032(%rsp)
	call	memset@PLT
	movq	%rbp, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	(%rsp), %ebx
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	movl	%ebx, %edx
	testb	%bl, %bl
	jne	.L2
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L37:
	movb	%dl, 100016(%rsp,%rcx)
	movzbl	1(%rbp,%rax), %edx
	leal	1(%rcx), %r8d
	leaq	1(%rax), %rsi
	testb	%dl, %dl
	je	.L7
	movslq	%r8d, %rcx
.L6:
	movq	%rsi, %rax
.L2:
	movslq	%eax, %rdi
	cmpb	$120, %dl
	jne	.L37
	movzbl	1(%rbp,%rax), %edx
	leaq	1(%rax), %rsi
	testb	%dl, %dl
	jne	.L6
.L7:
	leaq	-1(%rsp,%rdi), %rsi
	leaq	0(%rbp,%rdi), %rdx
	xorl	%ecx, %ecx
	subq	%rax, %rsi
	.p2align 4,,10
	.p2align 3
.L9:
	movzbl	(%rdx), %eax
	cmpb	$120, %al
	je	.L8
	movslq	%ecx, %rdi
	addl	$1, %ecx
	movb	%al, 200032(%rsp,%rdi)
.L8:
	subq	$1, %rdx
	cmpq	%rdx, %rsi
	jne	.L9
.L10:
	leaq	200032(%rsp), %rsi
	leaq	100016(%rsp), %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L3
	movl	%ebx, %esi
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L4:
	movl	%edx, %ecx
	addq	$1, %rdx
	movl	%esi, %edi
	movzbl	0(%rbp,%rdx), %esi
	testb	%sil, %sil
	jne	.L4
	xorl	%edx, %edx
	testb	%bl, %bl
	jne	.L17
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L15:
	subl	$1, %ecx
.L16:
	movslq	%ecx, %rsi
	movzbl	(%rsp,%rsi), %edi
.L17:
	cmpb	%bl, %dil
	je	.L38
	addl	$1, %edx
	cmpb	$120, %bl
	jne	.L15
	addl	$1, %eax
	movslq	%eax, %rsi
	movzbl	(%rsp,%rsi), %ebx
.L14:
	testb	%bl, %bl
	jne	.L16
.L12:
	leal	1(%rcx,%rdx), %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%eax, %edx
	xorl	%eax, %eax
	sarl	%edx
	call	__printf_chk@PLT
.L11:
	movq	300056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L39
	addq	$300072, %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
.L38:
	.cfi_restore_state
	addl	$1, %eax
	subl	$1, %ecx
	movslq	%eax, %rsi
	movzbl	(%rsp,%rsi), %ebx
	jmp	.L14
.L3:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L11
.L39:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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:

#include<stdio.h>
#include<string.h>
int main(){
  char s[100010],s1[100010],s2[100010]={};
  int i,r=0,c=0;
  scanf("%s",s);
  for(i=0;s[i];i++){
    if(s[i]-'x')s1[r++]=s[i];
  }
  s[i]=r=0;
  while(i--){
    if(s[i]-'x')s2[r++]=s[i];
  }
  if(strcmp(s1,s2)){
    printf("-1\n");
    return 0;
  }
  for(r=0;s[r+1];r++);
  for(i=0;s[i];i++){//printf("%c %c %d\n",s[i],s[r],c);
    if(s[i]==s[r]){
      r--;
      continue;
    }
    c++;
    if(s[i]=='x');
    else{
      r--;
      i--;
    }
  }//printf("%d\n",r);
  c+=r+1;
  printf("%d\n",c/2);
  return 0;
}
  

b
 axbax
 `b
 xxxo
 tpxt
 c
 bxbax
 b`
 yxxo
 d

0
 2
 -1
 3
 1
 0
 -1
 -1
 -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>
#include<string.h>
int main(){
  char s[100010],s1[100010],s2[100010]={};
  int i,r=0,c=0;
  scanf("%s",s);
  for(i=0;s[i];i++){
    if(s[i]-'x')s1[r++]=s[i];
  }
  s[i]=r=0;
  while(i--){
    if(s[i]-'x')s2[r++]=s[i];
  }
  if(strcmp(s1,s2)){
    printf("-1\n");
    return 0;
  }
  for(r=0;s[r+1];r++);
  for(i=0;s[i];i++){//printf("%c %c %d\n",s[i],s[r],c);
    if(s[i]==s[r]){
      r--;
      continue;
    }
    c++;
    if(s[i]=='x');
    else{
      r--;
      i--;
    }
  }//printf("%d\n",r);
  c+=r+1;
  printf("%d\n",c/2);
  return 0;
}
  
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"-1"
.LC2:
	.string	"%d\n"
	.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	-299008(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1072, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -100032(%rbp)
	movq	$0, -100024(%rbp)
	leaq	-100016(%rbp), %rax
	movl	$99994, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -300072(%rbp)
	movl	$0, -300068(%rbp)
	leaq	-300064(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -300076(%rbp)
	jmp	.L2
.L4:
	movl	-300076(%rbp), %eax
	cltq
	movzbl	-300064(%rbp,%rax), %eax
	cmpb	$120, %al
	je	.L3
	movl	-300072(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -300072(%rbp)
	movl	-300076(%rbp), %edx
	movslq	%edx, %rdx
	movzbl	-300064(%rbp,%rdx), %edx
	cltq
	movb	%dl, -200048(%rbp,%rax)
.L3:
	addl	$1, -300076(%rbp)
.L2:
	movl	-300076(%rbp), %eax
	cltq
	movzbl	-300064(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L4
	movl	$0, -300072(%rbp)
	movl	-300076(%rbp), %eax
	cltq
	movb	$0, -300064(%rbp,%rax)
	jmp	.L5
.L6:
	movl	-300076(%rbp), %eax
	cltq
	movzbl	-300064(%rbp,%rax), %eax
	cmpb	$120, %al
	je	.L5
	movl	-300072(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -300072(%rbp)
	movl	-300076(%rbp), %edx
	movslq	%edx, %rdx
	movzbl	-300064(%rbp,%rdx), %edx
	cltq
	movb	%dl, -100032(%rbp,%rax)
.L5:
	movl	-300076(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -300076(%rbp)
	testl	%eax, %eax
	jne	.L6
	leaq	-100032(%rbp), %rdx
	leaq	-200048(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	je	.L7
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L15
.L7:
	movl	$0, -300072(%rbp)
	jmp	.L9
.L10:
	addl	$1, -300072(%rbp)
.L9:
	movl	-300072(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-300064(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L10
	movl	$0, -300076(%rbp)
	jmp	.L11
.L14:
	movl	-300076(%rbp), %eax
	cltq
	movzbl	-300064(%rbp,%rax), %edx
	movl	-300072(%rbp), %eax
	cltq
	movzbl	-300064(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L12
	subl	$1, -300072(%rbp)
	jmp	.L13
.L12:
	addl	$1, -300068(%rbp)
	movl	-300076(%rbp), %eax
	cltq
	movzbl	-300064(%rbp,%rax), %eax
	cmpb	$120, %al
	je	.L13
	subl	$1, -300072(%rbp)
	subl	$1, -300076(%rbp)
.L13:
	addl	$1, -300076(%rbp)
.L11:
	movl	-300076(%rbp), %eax
	cltq
	movzbl	-300064(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L14
	movl	-300072(%rbp), %eax
	addl	$1, %eax
	addl	%eax, -300068(%rbp)
	movl	-300068(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L15:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.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
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"-1"
.LC2:
	.string	"%d\n"
	.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	-299008(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1072, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -100032(%rbp)
	movq	$0, -100024(%rbp)
	leaq	-100016(%rbp), %rax
	movl	$99994, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -300072(%rbp)
	movl	$0, -300068(%rbp)
	leaq	-300064(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -300076(%rbp)
	jmp	.L2
.L4:
	movl	-300076(%rbp), %eax
	cltq
	movzbl	-300064(%rbp,%rax), %eax
	cmpb	$120, %al
	je	.L3
	movl	-300072(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -300072(%rbp)
	movl	-300076(%rbp), %edx
	movslq	%edx, %rdx
	movzbl	-300064(%rbp,%rdx), %edx
	cltq
	movb	%dl, -200048(%rbp,%rax)
.L3:
	addl	$1, -300076(%rbp)
.L2:
	movl	-300076(%rbp), %eax
	cltq
	movzbl	-300064(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L4
	movl	$0, -300072(%rbp)
	movl	-300076(%rbp), %eax
	cltq
	movb	$0, -300064(%rbp,%rax)
	jmp	.L5
.L6:
	movl	-300076(%rbp), %eax
	cltq
	movzbl	-300064(%rbp,%rax), %eax
	cmpb	$120, %al
	je	.L5
	movl	-300072(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -300072(%rbp)
	movl	-300076(%rbp), %edx
	movslq	%edx, %rdx
	movzbl	-300064(%rbp,%rdx), %edx
	cltq
	movb	%dl, -100032(%rbp,%rax)
.L5:
	movl	-300076(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -300076(%rbp)
	testl	%eax, %eax
	jne	.L6
	leaq	-100032(%rbp), %rdx
	leaq	-200048(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	je	.L7
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L15
.L7:
	movl	$0, -300072(%rbp)
	jmp	.L9
.L10:
	addl	$1, -300072(%rbp)
.L9:
	movl	-300072(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-300064(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L10
	movl	$0, -300076(%rbp)
	jmp	.L11
.L14:
	movl	-300076(%rbp), %eax
	cltq
	movzbl	-300064(%rbp,%rax), %edx
	movl	-300072(%rbp), %eax
	cltq
	movzbl	-300064(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L12
	subl	$1, -300072(%rbp)
	jmp	.L13
.L12:
	addl	$1, -300068(%rbp)
	movl	-300076(%rbp), %eax
	cltq
	movzbl	-300064(%rbp,%rax), %eax
	cmpb	$120, %al
	je	.L13
	subl	$1, -300072(%rbp)
	subl	$1, -300076(%rbp)
.L13:
	addl	$1, -300076(%rbp)
.L11:
	movl	-300076(%rbp), %eax
	cltq
	movzbl	-300064(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L14
	movl	-300072(%rbp), %eax
	addl	$1, %eax
	addl	%eax, -300068(%rbp)
	movl	-300068(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L15:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.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:
