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[100001];
  int q,i,rev=0,len;
  scanf("%s",s);
  scanf("%d",&q);
  len=strlen(s);
  char be[q+1],af[q+1];
  int benum=0,afnum=0;
  int t[q+1],f;
  for(i=0;i<q;i++){
    scanf("%d",&t[i]);
    if(t[i]==1)
      rev++;
    else{
      scanf("%d ",&f);
      if((rev+f)%2==0)
        scanf("%c",&af[afnum++]);
      else
        scanf("%c",&be[benum++]);
    }
  }
  if(rev%2==0){
    for(i=benum-1;i>=0;i--)
      printf("%c",be[i]);
    for(i=0;i<len;i++)
      printf("%c",s[i]);
    for(i=0;i<afnum;i++)
      printf("%c",af[i]);
    }
  else{
    for(i=afnum-1;i>=0;i--)
      printf("%c",af[i]);
    for(i=len-1;i>=0;i--)
      printf("%c",s[i]);
    for(i=0;i<benum;i++)
      printf("%c",be[i]);
    }
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d "
.LC3:
	.string	"%c"
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	leaq	-98304(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1864, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movl	$0, -100128(%rbp)
	leaq	-100064(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-100140(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-100064(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -100116(%rbp)
	movl	-100140(%rbp), %eax
	leal	1(%rax), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -100112(%rbp)
	movslq	%edx, %rax
	movq	%rax, -100160(%rbp)
	movq	$0, -100152(%rbp)
	movslq	%edx, %rax
	movq	%rax, -100176(%rbp)
	movq	$0, -100168(%rbp)
	movslq	%edx, %rax
	movl	$16, %edx
	subq	$1, %rdx
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$0, %rax
	movq	%rax, -100104(%rbp)
	movl	-100140(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -100096(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -100192(%rbp)
	movq	$0, -100184(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -100208(%rbp)
	movq	$0, -100200(%rbp)
	cltq
	movl	$16, %edx
	subq	$1, %rdx
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$0, %rax
	movq	%rax, -100088(%rbp)
	movl	$0, -100124(%rbp)
	movl	$0, -100120(%rbp)
	movl	-100140(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -100080(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L8:
	cmpq	%rdx, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L9:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L10
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L10:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -100072(%rbp)
	movl	$0, -100132(%rbp)
	jmp	.L11
.L15:
	movl	-100132(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-100072(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-100072(%rbp), %rax
	movl	-100132(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$1, %eax
	jne	.L12
	addl	$1, -100128(%rbp)
	jmp	.L13
.L12:
	leaq	-100136(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-100136(%rbp), %edx
	movl	-100128(%rbp), %eax
	addl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L14
	movl	-100120(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -100120(%rbp)
	movslq	%eax, %rdx
	movq	-100088(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L13
.L14:
	movl	-100124(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -100124(%rbp)
	movslq	%eax, %rdx
	movq	-100104(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
.L13:
	addl	$1, -100132(%rbp)
.L11:
	movl	-100140(%rbp), %eax
	cmpl	%eax, -100132(%rbp)
	jl	.L15
	movl	-100128(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L16
	movl	-100124(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -100132(%rbp)
	jmp	.L17
.L18:
	movq	-100104(%rbp), %rdx
	movl	-100132(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	subl	$1, -100132(%rbp)
.L17:
	cmpl	$0, -100132(%rbp)
	jns	.L18
	movl	$0, -100132(%rbp)
	jmp	.L19
.L20:
	movl	-100132(%rbp), %eax
	cltq
	movzbl	-100064(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	addl	$1, -100132(%rbp)
.L19:
	movl	-100132(%rbp), %eax
	cmpl	-100116(%rbp), %eax
	jl	.L20
	movl	$0, -100132(%rbp)
	jmp	.L21
.L22:
	movq	-100088(%rbp), %rdx
	movl	-100132(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	addl	$1, -100132(%rbp)
.L21:
	movl	-100132(%rbp), %eax
	cmpl	-100120(%rbp), %eax
	jl	.L22
	jmp	.L23
.L16:
	movl	-100120(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -100132(%rbp)
	jmp	.L24
.L25:
	movq	-100088(%rbp), %rdx
	movl	-100132(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	subl	$1, -100132(%rbp)
.L24:
	cmpl	$0, -100132(%rbp)
	jns	.L25
	movl	-100116(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -100132(%rbp)
	jmp	.L26
.L27:
	movl	-100132(%rbp), %eax
	cltq
	movzbl	-100064(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	subl	$1, -100132(%rbp)
.L26:
	cmpl	$0, -100132(%rbp)
	jns	.L27
	movl	$0, -100132(%rbp)
	jmp	.L28
.L29:
	movq	-100104(%rbp), %rdx
	movl	-100132(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	addl	$1, -100132(%rbp)
.L28:
	movl	-100132(%rbp), %eax
	cmpl	-100124(%rbp), %eax
	jl	.L29
.L23:
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	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	"%s"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d "
.LC3:
	.string	"%c"
	.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
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	leaq	-98304(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1784, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rdi
	leaq	.LC1(%rip), %r14
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leaq	-100064(%rbp), %rbx
	movq	%rbx, %rsi
	movq	%rbx, -100128(%rbp)
	call	__isoc99_scanf@PLT
	leaq	-100072(%rbp), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	movl	-100072(%rbp), %esi
	movq	%rsp, %rdi
	movq	%rax, -100120(%rbp)
	leal	1(%rsi), %edx
	movslq	%edx, %rdx
	leaq	15(%rdx), %rax
	movq	%rax, %r8
	movq	%rax, %rcx
	andq	$-4096, %r8
	andq	$-16, %rcx
	subq	%r8, %rdi
	cmpq	%rdi, %rsp
	je	.L3
.L68:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rdi, %rsp
	jne	.L68
.L3:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L69
.L4:
	movq	%rsp, -100104(%rbp)
	movq	%rax, %rcx
	movq	%rsp, %rdi
	andq	$-4096, %rax
	andq	$-16, %rcx
	subq	%rax, %rdi
.L5:
	cmpq	%rdi, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L69:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L4
.L6:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L70
.L7:
	leaq	15(,%rdx,4), %rax
	movq	%rsp, -100112(%rbp)
	movq	%rsp, %rcx
	movq	%rax, %rdx
	andq	$-4096, %rax
	andq	$-16, %rdx
	subq	%rax, %rcx
.L8:
	cmpq	%rcx, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L70:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L7
.L9:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	je	.L10
	orq	$0, -8(%rsp,%rdx)
.L10:
	movq	%rsp, %rdx
	testl	%esi, %esi
	jle	.L11
	leaq	-100068(%rbp), %rax
	movq	%rdx, %r15
	xorl	%r12d, %r12d
	xorl	%r13d, %r13d
	movl	$0, -100084(%rbp)
	xorl	%ebx, %ebx
	movq	%rax, -100096(%rbp)
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L72:
	addl	$1, %r13d
.L13:
	addl	$1, %ebx
	addq	$4, %r15
	cmpl	%ebx, -100072(%rbp)
	jle	.L71
.L15:
	xorl	%eax, %eax
	movq	%r15, %rsi
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, (%r15)
	je	.L72
	movq	-100096(%rbp), %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-100068(%rbp), %eax
	addl	%r13d, %eax
	testb	$1, %al
	jne	.L14
	leal	1(%r12), %eax
	movslq	%r12d, %rsi
	addl	$1, %ebx
	addq	$4, %r15
	movl	%eax, -100088(%rbp)
	addq	-100112(%rbp), %rsi
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-100088(%rbp), %r12d
	cmpl	%ebx, -100072(%rbp)
	jg	.L15
.L71:
	andl	$1, %r13d
	je	.L73
	testl	%r12d, %r12d
	je	.L23
	movq	-100112(%rbp), %rdx
	movslq	%r12d, %rax
	leaq	-2(%rdx,%rax), %rbx
	leaq	-1(%rdx,%rax), %r13
	leal	-1(%r12), %eax
	subq	%rax, %rbx
	.p2align 4,,10
	.p2align 3
.L24:
	movsbl	0(%r13), %edi
	subq	$1, %r13
	call	putchar@PLT
	cmpq	%rbx, %r13
	jne	.L24
.L23:
	movq	-100120(%rbp), %rax
	leal	-1(%rax), %ebx
	testl	%eax, %eax
	je	.L25
	movq	-100128(%rbp), %r12
	movslq	%ebx, %rbx
	.p2align 4,,10
	.p2align 3
.L26:
	movsbl	(%r12,%rbx), %edi
	subq	$1, %rbx
	call	putchar@PLT
	cmpl	$-1, %ebx
	jne	.L26
.L25:
	movl	-100084(%rbp), %eax
	testl	%eax, %eax
	je	.L21
	movq	-100104(%rbp), %rbx
	subl	$1, %eax
	leaq	1(%rbx,%rax), %r12
	.p2align 4,,10
	.p2align 3
.L27:
	movsbl	(%rbx), %edi
	addq	$1, %rbx
	call	putchar@PLT
	cmpq	%rbx, %r12
	jne	.L27
.L21:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L74
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	movslq	-100084(%rbp), %rsi
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	leal	1(%rsi), %ecx
	addq	-100104(%rbp), %rsi
	movl	%ecx, -100084(%rbp)
	call	__isoc99_scanf@PLT
	jmp	.L13
.L73:
	movl	-100084(%rbp), %edx
	testl	%edx, %edx
	je	.L17
	movq	-100104(%rbp), %rcx
	movslq	%edx, %rax
	leaq	-2(%rcx,%rax), %rbx
	leaq	-1(%rcx,%rax), %r13
	leal	-1(%rdx), %eax
	subq	%rax, %rbx
	.p2align 4,,10
	.p2align 3
.L18:
	movsbl	0(%r13), %edi
	subq	$1, %r13
	call	putchar@PLT
	cmpq	%r13, %rbx
	jne	.L18
.L17:
	cmpq	$0, -100120(%rbp)
	je	.L19
.L28:
	movq	-100120(%rbp), %rax
	movq	-100128(%rbp), %r15
	subl	$1, %eax
	leaq	-100063(%rbp,%rax), %r13
	.p2align 4,,10
	.p2align 3
.L20:
	movsbl	(%r15), %edi
	addq	$1, %r15
	call	putchar@PLT
	cmpq	%r15, %r13
	jne	.L20
.L19:
	testl	%r12d, %r12d
	je	.L21
	movq	-100112(%rbp), %rbx
	leal	-1(%r12), %eax
	leaq	1(%rbx,%rax), %r12
	.p2align 4,,10
	.p2align 3
.L22:
	movsbl	(%rbx), %edi
	addq	$1, %rbx
	call	putchar@PLT
	cmpq	%r12, %rbx
	jne	.L22
	jmp	.L21
.L11:
	xorl	%r12d, %r12d
	cmpq	$0, -100120(%rbp)
	jne	.L28
	jmp	.L21
.L74:
	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	"%d"
.LC2:
	.string	"%d "
.LC3:
	.string	"%c"
	.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
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	leaq	-98304(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1784, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rdi
	leaq	.LC1(%rip), %r14
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leaq	-100064(%rbp), %rbx
	movq	%rbx, %rsi
	movq	%rbx, -100128(%rbp)
	call	__isoc99_scanf@PLT
	leaq	-100072(%rbp), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	movl	-100072(%rbp), %esi
	movq	%rsp, %rdi
	movq	%rax, -100120(%rbp)
	leal	1(%rsi), %edx
	movslq	%edx, %rdx
	leaq	15(%rdx), %rax
	movq	%rax, %r8
	movq	%rax, %rcx
	andq	$-4096, %r8
	andq	$-16, %rcx
	subq	%r8, %rdi
	cmpq	%rdi, %rsp
	je	.L3
.L68:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rdi, %rsp
	jne	.L68
.L3:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L69
.L4:
	movq	%rsp, -100104(%rbp)
	movq	%rax, %rcx
	movq	%rsp, %rdi
	andq	$-4096, %rax
	andq	$-16, %rcx
	subq	%rax, %rdi
.L5:
	cmpq	%rdi, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L69:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L4
.L6:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L70
.L7:
	leaq	15(,%rdx,4), %rax
	movq	%rsp, -100112(%rbp)
	movq	%rsp, %rcx
	movq	%rax, %rdx
	andq	$-4096, %rax
	andq	$-16, %rdx
	subq	%rax, %rcx
.L8:
	cmpq	%rcx, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L70:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L7
.L9:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	je	.L10
	orq	$0, -8(%rsp,%rdx)
.L10:
	movq	%rsp, %rdx
	testl	%esi, %esi
	jle	.L11
	leaq	-100068(%rbp), %rax
	movq	%rdx, %r15
	xorl	%r12d, %r12d
	xorl	%r13d, %r13d
	movl	$0, -100084(%rbp)
	xorl	%ebx, %ebx
	movq	%rax, -100096(%rbp)
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L72:
	addl	$1, %r13d
.L13:
	addl	$1, %ebx
	addq	$4, %r15
	cmpl	%ebx, -100072(%rbp)
	jle	.L71
.L15:
	xorl	%eax, %eax
	movq	%r15, %rsi
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, (%r15)
	je	.L72
	movq	-100096(%rbp), %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-100068(%rbp), %eax
	addl	%r13d, %eax
	testb	$1, %al
	jne	.L14
	leal	1(%r12), %eax
	movslq	%r12d, %rsi
	addl	$1, %ebx
	addq	$4, %r15
	movl	%eax, -100088(%rbp)
	addq	-100112(%rbp), %rsi
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-100088(%rbp), %r12d
	cmpl	%ebx, -100072(%rbp)
	jg	.L15
.L71:
	andl	$1, %r13d
	je	.L73
	testl	%r12d, %r12d
	je	.L23
	movq	-100112(%rbp), %rdx
	movslq	%r12d, %rax
	leaq	-2(%rdx,%rax), %rbx
	leaq	-1(%rdx,%rax), %r13
	leal	-1(%r12), %eax
	subq	%rax, %rbx
	.p2align 4,,10
	.p2align 3
.L24:
	movsbl	0(%r13), %edi
	subq	$1, %r13
	call	putchar@PLT
	cmpq	%rbx, %r13
	jne	.L24
.L23:
	movq	-100120(%rbp), %rax
	leal	-1(%rax), %ebx
	testl	%eax, %eax
	je	.L25
	movq	-100128(%rbp), %r12
	movslq	%ebx, %rbx
	.p2align 4,,10
	.p2align 3
.L26:
	movsbl	(%r12,%rbx), %edi
	subq	$1, %rbx
	call	putchar@PLT
	cmpl	$-1, %ebx
	jne	.L26
.L25:
	movl	-100084(%rbp), %eax
	testl	%eax, %eax
	je	.L21
	movq	-100104(%rbp), %rbx
	subl	$1, %eax
	leaq	1(%rbx,%rax), %r12
	.p2align 4,,10
	.p2align 3
.L27:
	movsbl	(%rbx), %edi
	addq	$1, %rbx
	call	putchar@PLT
	cmpq	%rbx, %r12
	jne	.L27
.L21:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L74
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	movslq	-100084(%rbp), %rsi
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	leal	1(%rsi), %ecx
	addq	-100104(%rbp), %rsi
	movl	%ecx, -100084(%rbp)
	call	__isoc99_scanf@PLT
	jmp	.L13
.L73:
	movl	-100084(%rbp), %edx
	testl	%edx, %edx
	je	.L17
	movq	-100104(%rbp), %rcx
	movslq	%edx, %rax
	leaq	-2(%rcx,%rax), %rbx
	leaq	-1(%rcx,%rax), %r13
	leal	-1(%rdx), %eax
	subq	%rax, %rbx
	.p2align 4,,10
	.p2align 3
.L18:
	movsbl	0(%r13), %edi
	subq	$1, %r13
	call	putchar@PLT
	cmpq	%r13, %rbx
	jne	.L18
.L17:
	cmpq	$0, -100120(%rbp)
	je	.L19
.L28:
	movq	-100120(%rbp), %rax
	movq	-100128(%rbp), %r15
	subl	$1, %eax
	leaq	-100063(%rbp,%rax), %r13
	.p2align 4,,10
	.p2align 3
.L20:
	movsbl	(%r15), %edi
	addq	$1, %r15
	call	putchar@PLT
	cmpq	%r15, %r13
	jne	.L20
.L19:
	testl	%r12d, %r12d
	je	.L21
	movq	-100112(%rbp), %rbx
	leal	-1(%r12), %eax
	leaq	1(%rbx,%rax), %r12
	.p2align 4,,10
	.p2align 3
.L22:
	movsbl	(%rbx), %edi
	addq	$1, %rbx
	call	putchar@PLT
	cmpq	%r12, %rbx
	jne	.L22
	jmp	.L21
.L11:
	xorl	%r12d, %r12d
	cmpq	$0, -100120(%rbp)
	jne	.L28
	jmp	.L21
.L74:
	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[100001];
  int q,i,rev=0,len;
  scanf("%s",s);
  scanf("%d",&q);
  len=strlen(s);
  char be[q+1],af[q+1];
  int benum=0,afnum=0;
  int t[q+1],f;
  for(i=0;i<q;i++){
    scanf("%d",&t[i]);
    if(t[i]==1)
      rev++;
    else{
      scanf("%d ",&f);
      if((rev+f)%2==0)
        scanf("%c",&af[afnum++]);
      else
        scanf("%c",&be[benum++]);
    }
  }
  if(rev%2==0){
    for(i=benum-1;i>=0;i--)
      printf("%c",be[i]);
    for(i=0;i<len;i++)
      printf("%c",s[i]);
    for(i=0;i<afnum;i++)
      printf("%c",af[i]);
    }
  else{
    for(i=afnum-1;i>=0;i--)
      printf("%c",af[i]);
    for(i=len-1;i>=0;i--)
      printf("%c",s[i]);
    for(i=0;i<benum;i++)
      printf("%c",be[i]);
    }
  return 0;
}

a
6
2 2 a
2 1 b
1
2 2 d
1
1
 a
6
2 2 b
2 1 b
1
2 2 d
1
1
 b
4
2 1 p
1
2 2 c
1
 a
6
2 2 a
2 1 b
1
2 1 c
1
1
 a
6
2 2 a
2 1 b
1
2 1 b
1
1
 `
4
2 1 p
1
2 2 c
1
 a
6
2 2 b
2 1 b
1
2 2 c
1
1
 b
6
2 2 a
2 1 b
1
2 2 c
1
1
 a
6
2 2 b
2 1 b
1
2 1 c
1
1
 y
0
1 1 x

aabd babd cpb caab baab cp` babc abbc cbab y
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[100001];
  int q,i,rev=0,len;
  scanf("%s",s);
  scanf("%d",&q);
  len=strlen(s);
  char be[q+1],af[q+1];
  int benum=0,afnum=0;
  int t[q+1],f;
  for(i=0;i<q;i++){
    scanf("%d",&t[i]);
    if(t[i]==1)
      rev++;
    else{
      scanf("%d ",&f);
      if((rev+f)%2==0)
        scanf("%c",&af[afnum++]);
      else
        scanf("%c",&be[benum++]);
    }
  }
  if(rev%2==0){
    for(i=benum-1;i>=0;i--)
      printf("%c",be[i]);
    for(i=0;i<len;i++)
      printf("%c",s[i]);
    for(i=0;i<afnum;i++)
      printf("%c",af[i]);
    }
  else{
    for(i=afnum-1;i>=0;i--)
      printf("%c",af[i]);
    for(i=len-1;i>=0;i--)
      printf("%c",s[i]);
    for(i=0;i<benum;i++)
      printf("%c",be[i]);
    }
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d "
.LC3:
	.string	"%c"
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	leaq	-98304(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1864, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movl	$0, -100128(%rbp)
	leaq	-100064(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-100140(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-100064(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -100116(%rbp)
	movl	-100140(%rbp), %eax
	leal	1(%rax), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -100112(%rbp)
	movslq	%edx, %rax
	movq	%rax, -100160(%rbp)
	movq	$0, -100152(%rbp)
	movslq	%edx, %rax
	movq	%rax, -100176(%rbp)
	movq	$0, -100168(%rbp)
	movslq	%edx, %rax
	movl	$16, %edx
	subq	$1, %rdx
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$0, %rax
	movq	%rax, -100104(%rbp)
	movl	-100140(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -100096(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -100192(%rbp)
	movq	$0, -100184(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -100208(%rbp)
	movq	$0, -100200(%rbp)
	cltq
	movl	$16, %edx
	subq	$1, %rdx
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$0, %rax
	movq	%rax, -100088(%rbp)
	movl	$0, -100124(%rbp)
	movl	$0, -100120(%rbp)
	movl	-100140(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -100080(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L8:
	cmpq	%rdx, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L9:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L10
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L10:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -100072(%rbp)
	movl	$0, -100132(%rbp)
	jmp	.L11
.L15:
	movl	-100132(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-100072(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-100072(%rbp), %rax
	movl	-100132(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$1, %eax
	jne	.L12
	addl	$1, -100128(%rbp)
	jmp	.L13
.L12:
	leaq	-100136(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-100136(%rbp), %edx
	movl	-100128(%rbp), %eax
	addl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L14
	movl	-100120(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -100120(%rbp)
	movslq	%eax, %rdx
	movq	-100088(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L13
.L14:
	movl	-100124(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -100124(%rbp)
	movslq	%eax, %rdx
	movq	-100104(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
.L13:
	addl	$1, -100132(%rbp)
.L11:
	movl	-100140(%rbp), %eax
	cmpl	%eax, -100132(%rbp)
	jl	.L15
	movl	-100128(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L16
	movl	-100124(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -100132(%rbp)
	jmp	.L17
.L18:
	movq	-100104(%rbp), %rdx
	movl	-100132(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	subl	$1, -100132(%rbp)
.L17:
	cmpl	$0, -100132(%rbp)
	jns	.L18
	movl	$0, -100132(%rbp)
	jmp	.L19
.L20:
	movl	-100132(%rbp), %eax
	cltq
	movzbl	-100064(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	addl	$1, -100132(%rbp)
.L19:
	movl	-100132(%rbp), %eax
	cmpl	-100116(%rbp), %eax
	jl	.L20
	movl	$0, -100132(%rbp)
	jmp	.L21
.L22:
	movq	-100088(%rbp), %rdx
	movl	-100132(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	addl	$1, -100132(%rbp)
.L21:
	movl	-100132(%rbp), %eax
	cmpl	-100120(%rbp), %eax
	jl	.L22
	jmp	.L23
.L16:
	movl	-100120(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -100132(%rbp)
	jmp	.L24
.L25:
	movq	-100088(%rbp), %rdx
	movl	-100132(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	subl	$1, -100132(%rbp)
.L24:
	cmpl	$0, -100132(%rbp)
	jns	.L25
	movl	-100116(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -100132(%rbp)
	jmp	.L26
.L27:
	movl	-100132(%rbp), %eax
	cltq
	movzbl	-100064(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	subl	$1, -100132(%rbp)
.L26:
	cmpl	$0, -100132(%rbp)
	jns	.L27
	movl	$0, -100132(%rbp)
	jmp	.L28
.L29:
	movq	-100104(%rbp), %rdx
	movl	-100132(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	addl	$1, -100132(%rbp)
.L28:
	movl	-100132(%rbp), %eax
	cmpl	-100124(%rbp), %eax
	jl	.L29
.L23:
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	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
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d "
.LC3:
	.string	"%c"
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	leaq	-98304(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1864, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movl	$0, -100128(%rbp)
	leaq	-100064(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-100140(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-100064(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -100116(%rbp)
	movl	-100140(%rbp), %eax
	leal	1(%rax), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -100112(%rbp)
	movslq	%edx, %rax
	movq	%rax, -100160(%rbp)
	movq	$0, -100152(%rbp)
	movslq	%edx, %rax
	movq	%rax, -100176(%rbp)
	movq	$0, -100168(%rbp)
	movslq	%edx, %rax
	movl	$16, %edx
	subq	$1, %rdx
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$0, %rax
	movq	%rax, -100104(%rbp)
	movl	-100140(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -100096(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -100192(%rbp)
	movq	$0, -100184(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -100208(%rbp)
	movq	$0, -100200(%rbp)
	cltq
	movl	$16, %edx
	subq	$1, %rdx
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$0, %rax
	movq	%rax, -100088(%rbp)
	movl	$0, -100124(%rbp)
	movl	$0, -100120(%rbp)
	movl	-100140(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -100080(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L8:
	cmpq	%rdx, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L9:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L10
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L10:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -100072(%rbp)
	movl	$0, -100132(%rbp)
	jmp	.L11
.L15:
	movl	-100132(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-100072(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-100072(%rbp), %rax
	movl	-100132(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$1, %eax
	jne	.L12
	addl	$1, -100128(%rbp)
	jmp	.L13
.L12:
	leaq	-100136(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-100136(%rbp), %edx
	movl	-100128(%rbp), %eax
	addl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L14
	movl	-100120(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -100120(%rbp)
	movslq	%eax, %rdx
	movq	-100088(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L13
.L14:
	movl	-100124(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -100124(%rbp)
	movslq	%eax, %rdx
	movq	-100104(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
.L13:
	addl	$1, -100132(%rbp)
.L11:
	movl	-100140(%rbp), %eax
	cmpl	%eax, -100132(%rbp)
	jl	.L15
	movl	-100128(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L16
	movl	-100124(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -100132(%rbp)
	jmp	.L17
.L18:
	movq	-100104(%rbp), %rdx
	movl	-100132(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	subl	$1, -100132(%rbp)
.L17:
	cmpl	$0, -100132(%rbp)
	jns	.L18
	movl	$0, -100132(%rbp)
	jmp	.L19
.L20:
	movl	-100132(%rbp), %eax
	cltq
	movzbl	-100064(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	addl	$1, -100132(%rbp)
.L19:
	movl	-100132(%rbp), %eax
	cmpl	-100116(%rbp), %eax
	jl	.L20
	movl	$0, -100132(%rbp)
	jmp	.L21
.L22:
	movq	-100088(%rbp), %rdx
	movl	-100132(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	addl	$1, -100132(%rbp)
.L21:
	movl	-100132(%rbp), %eax
	cmpl	-100120(%rbp), %eax
	jl	.L22
	jmp	.L23
.L16:
	movl	-100120(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -100132(%rbp)
	jmp	.L24
.L25:
	movq	-100088(%rbp), %rdx
	movl	-100132(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	subl	$1, -100132(%rbp)
.L24:
	cmpl	$0, -100132(%rbp)
	jns	.L25
	movl	-100116(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -100132(%rbp)
	jmp	.L26
.L27:
	movl	-100132(%rbp), %eax
	cltq
	movzbl	-100064(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	subl	$1, -100132(%rbp)
.L26:
	cmpl	$0, -100132(%rbp)
	jns	.L27
	movl	$0, -100132(%rbp)
	jmp	.L28
.L29:
	movq	-100104(%rbp), %rdx
	movl	-100132(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	addl	$1, -100132(%rbp)
.L28:
	movl	-100132(%rbp), %eax
	cmpl	-100124(%rbp), %eax
	jl	.L29
.L23:
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	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:
