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 <string.h>

int main (void) {
    int     i;
    char    s[200001];
    int     q;
    int     t, f;
    char    c;
    char    prefix_[200001], suffix_[200001];
    char    *prefix = prefix_, *suffix = suffix_;
    char    *tmp_c;
    int     tmp_d;
    int     prefix_len = 0, suffix_len = 0;
    int     order = 1;

    scanf("%s%d", s, &q);

    for ( i=0; i<q; i++ ) {
        scanf("%d", &t);
        if ( t == 1 ) {
            order *= -1;
            tmp_c = prefix;
            prefix = suffix;
            suffix = tmp_c;
            tmp_d = prefix_len;
            prefix_len = suffix_len;
            suffix_len = tmp_d;
        }
        else {
            scanf("%d %c", &f, &c);
            if ( f == 1 ) {
                prefix[prefix_len] = c;
                prefix_len++;
            }
            else {
                suffix[suffix_len] = c;
                suffix_len++;
            }
        }
    }

    prefix[prefix_len] = '\0';
    suffix[suffix_len] = '\0';

    for ( i=strlen(prefix)-1; i>=0; i-- )
        printf("%c", prefix[i]);
    if ( order == 1 ) {
        printf("%s", s);
    }
    else {
        for ( i=strlen(s)-1; i>=0; i-- )
            printf("%c", s[i]);
    }
    printf("%s\n", suffix);
    return EXIT_SUCCESS;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d %c"
.LC3:
	.string	"%s"
	.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
	leaq	-598016(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2096, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-400032(%rbp), %rax
	movq	%rax, -600072(%rbp)
	leaq	-200016(%rbp), %rax
	movq	%rax, -600064(%rbp)
	movl	$0, -600088(%rbp)
	movl	$0, -600084(%rbp)
	movl	$1, -600080(%rbp)
	leaq	-600104(%rbp), %rdx
	leaq	-600048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -600092(%rbp)
	jmp	.L2
.L6:
	leaq	-600100(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-600100(%rbp), %eax
	cmpl	$1, %eax
	jne	.L3
	negl	-600080(%rbp)
	movq	-600072(%rbp), %rax
	movq	%rax, -600056(%rbp)
	movq	-600064(%rbp), %rax
	movq	%rax, -600072(%rbp)
	movq	-600056(%rbp), %rax
	movq	%rax, -600064(%rbp)
	movl	-600088(%rbp), %eax
	movl	%eax, -600076(%rbp)
	movl	-600084(%rbp), %eax
	movl	%eax, -600088(%rbp)
	movl	-600076(%rbp), %eax
	movl	%eax, -600084(%rbp)
	jmp	.L4
.L3:
	leaq	-600105(%rbp), %rdx
	leaq	-600096(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-600096(%rbp), %eax
	cmpl	$1, %eax
	jne	.L5
	movl	-600088(%rbp), %eax
	movslq	%eax, %rdx
	movq	-600072(%rbp), %rax
	addq	%rax, %rdx
	movzbl	-600105(%rbp), %eax
	movb	%al, (%rdx)
	addl	$1, -600088(%rbp)
	jmp	.L4
.L5:
	movl	-600084(%rbp), %eax
	movslq	%eax, %rdx
	movq	-600064(%rbp), %rax
	addq	%rax, %rdx
	movzbl	-600105(%rbp), %eax
	movb	%al, (%rdx)
	addl	$1, -600084(%rbp)
.L4:
	addl	$1, -600092(%rbp)
.L2:
	movl	-600104(%rbp), %eax
	cmpl	%eax, -600092(%rbp)
	jl	.L6
	movl	-600088(%rbp), %eax
	movslq	%eax, %rdx
	movq	-600072(%rbp), %rax
	addq	%rdx, %rax
	movb	$0, (%rax)
	movl	-600084(%rbp), %eax
	movslq	%eax, %rdx
	movq	-600064(%rbp), %rax
	addq	%rdx, %rax
	movb	$0, (%rax)
	movq	-600072(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	subl	$1, %eax
	movl	%eax, -600092(%rbp)
	jmp	.L7
.L8:
	movl	-600092(%rbp), %eax
	movslq	%eax, %rdx
	movq	-600072(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	subl	$1, -600092(%rbp)
.L7:
	cmpl	$0, -600092(%rbp)
	jns	.L8
	cmpl	$1, -600080(%rbp)
	jne	.L9
	leaq	-600048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L10
.L9:
	leaq	-600048(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	subl	$1, %eax
	movl	%eax, -600092(%rbp)
	jmp	.L11
.L12:
	movl	-600092(%rbp), %eax
	cltq
	movzbl	-600048(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	subl	$1, -600092(%rbp)
.L11:
	cmpl	$0, -600092(%rbp)
	jns	.L12
.L10:
	movq	-600064(%rbp), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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	"%s%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d %c"
.LC3:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-598016(%rsp), %r11
	.cfi_def_cfa 11, 598072
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2072, %rsp
	.cfi_def_cfa_offset 600144
	leaq	.LC0(%rip), %rdi
	movl	$0, %r12d
	movq	%fs:40, %rax
	movq	%rax, 600072(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rax
	leaq	20(%rsp), %rdx
	movq	%rax, (%rsp)
	movq	%rax, %rsi
	xorl	%eax, %eax
	leaq	400064(%rsp), %r13
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %eax
	movl	$1, 12(%rsp)
	leaq	200048(%rsp), %rbp
	movl	$0, 8(%rsp)
	testl	%eax, %eax
	jle	.L2
	xorl	%ebx, %ebx
	leaq	24(%rsp), %r15
	leaq	.LC1(%rip), %r14
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L26:
	movl	8(%rsp), %eax
	negl	12(%rsp)
	movl	%r12d, 8(%rsp)
	movl	%eax, %r12d
	movq	%rbp, %rax
	movq	%r13, %rbp
	movq	%rax, %r13
.L4:
	addl	$1, %ebx
	cmpl	%ebx, 20(%rsp)
	jle	.L2
.L6:
	xorl	%eax, %eax
	movq	%r15, %rsi
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, 24(%rsp)
	je	.L26
	xorl	%eax, %eax
	leaq	19(%rsp), %rdx
	leaq	28(%rsp), %rsi
	leaq	.LC2(%rip), %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, 28(%rsp)
	je	.L27
	movzbl	19(%rsp), %edx
	movslq	%r12d, %rax
	addl	$1, %ebx
	addl	$1, %r12d
	movb	%dl, 0(%r13,%rax)
	cmpl	%ebx, 20(%rsp)
	jg	.L6
.L2:
	movslq	8(%rsp), %rax
	movslq	%r12d, %r12
	movq	%rbp, %rdi
	movb	$0, 0(%rbp,%rax)
	movb	$0, 0(%r13,%r12)
	call	strlen@PLT
	subl	$1, %eax
	movslq	%eax, %rbx
	cmpl	$-1, %eax
	je	.L11
	.p2align 4,,10
	.p2align 3
.L10:
	movsbl	0(%rbp,%rbx), %edi
	subq	$1, %rbx
	call	putchar@PLT
	cmpl	$-1, %ebx
	jne	.L10
.L11:
	cmpl	$1, 12(%rsp)
	je	.L28
	movq	(%rsp), %rdi
	call	strlen@PLT
	subl	$1, %eax
	movslq	%eax, %rbx
	cmpl	$-1, %eax
	je	.L12
	.p2align 4,,10
	.p2align 3
.L14:
	movq	(%rsp), %rax
	movsbl	(%rax,%rbx), %edi
	subq	$1, %rbx
	call	putchar@PLT
	cmpl	$-1, %ebx
	jne	.L14
.L12:
	movq	%r13, %rdi
	call	puts@PLT
	movq	600072(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	addq	$600088, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L27:
	.cfi_restore_state
	movslq	8(%rsp), %rax
	movzbl	19(%rsp), %edx
	movq	%rax, %rcx
	movb	%dl, 0(%rbp,%rax)
	addl	$1, %ecx
	movl	%ecx, 8(%rsp)
	jmp	.L4
.L28:
	movq	(%rsp), %rdx
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L12
.L29:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d %c"
.LC3:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-598016(%rsp), %r11
	.cfi_def_cfa 11, 598072
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2072, %rsp
	.cfi_def_cfa_offset 600144
	leaq	.LC0(%rip), %rdi
	movl	$0, %r12d
	movq	%fs:40, %rax
	movq	%rax, 600072(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rax
	leaq	20(%rsp), %rdx
	movq	%rax, (%rsp)
	movq	%rax, %rsi
	xorl	%eax, %eax
	leaq	400064(%rsp), %r13
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %eax
	movl	$1, 12(%rsp)
	leaq	200048(%rsp), %rbp
	movl	$0, 8(%rsp)
	testl	%eax, %eax
	jle	.L2
	xorl	%ebx, %ebx
	leaq	24(%rsp), %r15
	leaq	.LC1(%rip), %r14
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L26:
	movl	8(%rsp), %eax
	negl	12(%rsp)
	movl	%r12d, 8(%rsp)
	movl	%eax, %r12d
	movq	%rbp, %rax
	movq	%r13, %rbp
	movq	%rax, %r13
.L4:
	addl	$1, %ebx
	cmpl	%ebx, 20(%rsp)
	jle	.L2
.L6:
	xorl	%eax, %eax
	movq	%r15, %rsi
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, 24(%rsp)
	je	.L26
	xorl	%eax, %eax
	leaq	19(%rsp), %rdx
	leaq	28(%rsp), %rsi
	leaq	.LC2(%rip), %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, 28(%rsp)
	je	.L27
	movzbl	19(%rsp), %edx
	movslq	%r12d, %rax
	addl	$1, %ebx
	addl	$1, %r12d
	movb	%dl, 0(%r13,%rax)
	cmpl	%ebx, 20(%rsp)
	jg	.L6
.L2:
	movslq	8(%rsp), %rax
	movslq	%r12d, %r12
	movq	%rbp, %rdi
	movb	$0, 0(%rbp,%rax)
	movb	$0, 0(%r13,%r12)
	call	strlen@PLT
	subl	$1, %eax
	movslq	%eax, %rbx
	cmpl	$-1, %eax
	je	.L11
	.p2align 4,,10
	.p2align 3
.L10:
	movsbl	0(%rbp,%rbx), %edi
	subq	$1, %rbx
	call	putchar@PLT
	cmpl	$-1, %ebx
	jne	.L10
.L11:
	cmpl	$1, 12(%rsp)
	je	.L28
	movq	(%rsp), %rdi
	call	strlen@PLT
	subl	$1, %eax
	movslq	%eax, %rbx
	cmpl	$-1, %eax
	je	.L12
	.p2align 4,,10
	.p2align 3
.L14:
	movq	(%rsp), %rax
	movsbl	(%rax,%rbx), %edi
	subq	$1, %rbx
	call	putchar@PLT
	cmpl	$-1, %ebx
	jne	.L14
.L12:
	movq	%r13, %rdi
	call	puts@PLT
	movq	600072(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	addq	$600088, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L27:
	.cfi_restore_state
	movslq	8(%rsp), %rax
	movzbl	19(%rsp), %edx
	movq	%rax, %rcx
	movb	%dl, 0(%rbp,%rax)
	addl	$1, %ecx
	movl	%ecx, 8(%rsp)
	jmp	.L4
.L28:
	movq	(%rsp), %rdx
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L12
.L29:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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 <stdlib.h>
#include <string.h>

int main (void) {
    int     i;
    char    s[200001];
    int     q;
    int     t, f;
    char    c;
    char    prefix_[200001], suffix_[200001];
    char    *prefix = prefix_, *suffix = suffix_;
    char    *tmp_c;
    int     tmp_d;
    int     prefix_len = 0, suffix_len = 0;
    int     order = 1;

    scanf("%s%d", s, &q);

    for ( i=0; i<q; i++ ) {
        scanf("%d", &t);
        if ( t == 1 ) {
            order *= -1;
            tmp_c = prefix;
            prefix = suffix;
            suffix = tmp_c;
            tmp_d = prefix_len;
            prefix_len = suffix_len;
            suffix_len = tmp_d;
        }
        else {
            scanf("%d %c", &f, &c);
            if ( f == 1 ) {
                prefix[prefix_len] = c;
                prefix_len++;
            }
            else {
                suffix[suffix_len] = c;
                suffix_len++;
            }
        }
    }

    prefix[prefix_len] = '\0';
    suffix[suffix_len] = '\0';

    for ( i=strlen(prefix)-1; i>=0; i-- )
        printf("%c", prefix[i]);
    if ( order == 1 ) {
        printf("%s", s);
    }
    else {
        for ( i=strlen(s)-1; i>=0; i-- )
            printf("%c", s[i]);
    }
    printf("%s\n", suffix);
    return EXIT_SUCCESS;
}


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

int main (void) {
    int     i;
    char    s[200001];
    int     q;
    int     t, f;
    char    c;
    char    prefix_[200001], suffix_[200001];
    char    *prefix = prefix_, *suffix = suffix_;
    char    *tmp_c;
    int     tmp_d;
    int     prefix_len = 0, suffix_len = 0;
    int     order = 1;

    scanf("%s%d", s, &q);

    for ( i=0; i<q; i++ ) {
        scanf("%d", &t);
        if ( t == 1 ) {
            order *= -1;
            tmp_c = prefix;
            prefix = suffix;
            suffix = tmp_c;
            tmp_d = prefix_len;
            prefix_len = suffix_len;
            suffix_len = tmp_d;
        }
        else {
            scanf("%d %c", &f, &c);
            if ( f == 1 ) {
                prefix[prefix_len] = c;
                prefix_len++;
            }
            else {
                suffix[suffix_len] = c;
                suffix_len++;
            }
        }
    }

    prefix[prefix_len] = '\0';
    suffix[suffix_len] = '\0';

    for ( i=strlen(prefix)-1; i>=0; i-- )
        printf("%c", prefix[i]);
    if ( order == 1 ) {
        printf("%s", s);
    }
    else {
        for ( i=strlen(s)-1; i>=0; i-- )
            printf("%c", s[i]);
    }
    printf("%s\n", suffix);
    return EXIT_SUCCESS;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d %c"
.LC3:
	.string	"%s"
	.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
	leaq	-598016(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2096, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-400032(%rbp), %rax
	movq	%rax, -600072(%rbp)
	leaq	-200016(%rbp), %rax
	movq	%rax, -600064(%rbp)
	movl	$0, -600088(%rbp)
	movl	$0, -600084(%rbp)
	movl	$1, -600080(%rbp)
	leaq	-600104(%rbp), %rdx
	leaq	-600048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -600092(%rbp)
	jmp	.L2
.L6:
	leaq	-600100(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-600100(%rbp), %eax
	cmpl	$1, %eax
	jne	.L3
	negl	-600080(%rbp)
	movq	-600072(%rbp), %rax
	movq	%rax, -600056(%rbp)
	movq	-600064(%rbp), %rax
	movq	%rax, -600072(%rbp)
	movq	-600056(%rbp), %rax
	movq	%rax, -600064(%rbp)
	movl	-600088(%rbp), %eax
	movl	%eax, -600076(%rbp)
	movl	-600084(%rbp), %eax
	movl	%eax, -600088(%rbp)
	movl	-600076(%rbp), %eax
	movl	%eax, -600084(%rbp)
	jmp	.L4
.L3:
	leaq	-600105(%rbp), %rdx
	leaq	-600096(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-600096(%rbp), %eax
	cmpl	$1, %eax
	jne	.L5
	movl	-600088(%rbp), %eax
	movslq	%eax, %rdx
	movq	-600072(%rbp), %rax
	addq	%rax, %rdx
	movzbl	-600105(%rbp), %eax
	movb	%al, (%rdx)
	addl	$1, -600088(%rbp)
	jmp	.L4
.L5:
	movl	-600084(%rbp), %eax
	movslq	%eax, %rdx
	movq	-600064(%rbp), %rax
	addq	%rax, %rdx
	movzbl	-600105(%rbp), %eax
	movb	%al, (%rdx)
	addl	$1, -600084(%rbp)
.L4:
	addl	$1, -600092(%rbp)
.L2:
	movl	-600104(%rbp), %eax
	cmpl	%eax, -600092(%rbp)
	jl	.L6
	movl	-600088(%rbp), %eax
	movslq	%eax, %rdx
	movq	-600072(%rbp), %rax
	addq	%rdx, %rax
	movb	$0, (%rax)
	movl	-600084(%rbp), %eax
	movslq	%eax, %rdx
	movq	-600064(%rbp), %rax
	addq	%rdx, %rax
	movb	$0, (%rax)
	movq	-600072(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	subl	$1, %eax
	movl	%eax, -600092(%rbp)
	jmp	.L7
.L8:
	movl	-600092(%rbp), %eax
	movslq	%eax, %rdx
	movq	-600072(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	subl	$1, -600092(%rbp)
.L7:
	cmpl	$0, -600092(%rbp)
	jns	.L8
	cmpl	$1, -600080(%rbp)
	jne	.L9
	leaq	-600048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L10
.L9:
	leaq	-600048(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	subl	$1, %eax
	movl	%eax, -600092(%rbp)
	jmp	.L11
.L12:
	movl	-600092(%rbp), %eax
	cltq
	movzbl	-600048(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	subl	$1, -600092(%rbp)
.L11:
	cmpl	$0, -600092(%rbp)
	jns	.L12
.L10:
	movq	-600064(%rbp), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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
	.section	.rodata
.LC0:
	.string	"%s%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d %c"
.LC3:
	.string	"%s"
	.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
	leaq	-598016(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2096, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-400032(%rbp), %rax
	movq	%rax, -600072(%rbp)
	leaq	-200016(%rbp), %rax
	movq	%rax, -600064(%rbp)
	movl	$0, -600088(%rbp)
	movl	$0, -600084(%rbp)
	movl	$1, -600080(%rbp)
	leaq	-600104(%rbp), %rdx
	leaq	-600048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -600092(%rbp)
	jmp	.L2
.L6:
	leaq	-600100(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-600100(%rbp), %eax
	cmpl	$1, %eax
	jne	.L3
	negl	-600080(%rbp)
	movq	-600072(%rbp), %rax
	movq	%rax, -600056(%rbp)
	movq	-600064(%rbp), %rax
	movq	%rax, -600072(%rbp)
	movq	-600056(%rbp), %rax
	movq	%rax, -600064(%rbp)
	movl	-600088(%rbp), %eax
	movl	%eax, -600076(%rbp)
	movl	-600084(%rbp), %eax
	movl	%eax, -600088(%rbp)
	movl	-600076(%rbp), %eax
	movl	%eax, -600084(%rbp)
	jmp	.L4
.L3:
	leaq	-600105(%rbp), %rdx
	leaq	-600096(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-600096(%rbp), %eax
	cmpl	$1, %eax
	jne	.L5
	movl	-600088(%rbp), %eax
	movslq	%eax, %rdx
	movq	-600072(%rbp), %rax
	addq	%rax, %rdx
	movzbl	-600105(%rbp), %eax
	movb	%al, (%rdx)
	addl	$1, -600088(%rbp)
	jmp	.L4
.L5:
	movl	-600084(%rbp), %eax
	movslq	%eax, %rdx
	movq	-600064(%rbp), %rax
	addq	%rax, %rdx
	movzbl	-600105(%rbp), %eax
	movb	%al, (%rdx)
	addl	$1, -600084(%rbp)
.L4:
	addl	$1, -600092(%rbp)
.L2:
	movl	-600104(%rbp), %eax
	cmpl	%eax, -600092(%rbp)
	jl	.L6
	movl	-600088(%rbp), %eax
	movslq	%eax, %rdx
	movq	-600072(%rbp), %rax
	addq	%rdx, %rax
	movb	$0, (%rax)
	movl	-600084(%rbp), %eax
	movslq	%eax, %rdx
	movq	-600064(%rbp), %rax
	addq	%rdx, %rax
	movb	$0, (%rax)
	movq	-600072(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	subl	$1, %eax
	movl	%eax, -600092(%rbp)
	jmp	.L7
.L8:
	movl	-600092(%rbp), %eax
	movslq	%eax, %rdx
	movq	-600072(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	subl	$1, -600092(%rbp)
.L7:
	cmpl	$0, -600092(%rbp)
	jns	.L8
	cmpl	$1, -600080(%rbp)
	jne	.L9
	leaq	-600048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L10
.L9:
	leaq	-600048(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	subl	$1, %eax
	movl	%eax, -600092(%rbp)
	jmp	.L11
.L12:
	movl	-600092(%rbp), %eax
	cltq
	movzbl	-600048(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	subl	$1, -600092(%rbp)
.L11:
	cmpl	$0, -600092(%rbp)
	jns	.L12
.L10:
	movq	-600064(%rbp), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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:
