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>

void op_print(char *str, int a, int b)
{
	for(int i = a; i <= b; ++i)
	{
		putchar(str[i]);
	}
	putchar('\n');
}

void op_replace(char *str, int a, int b, char *p)
{
	for(int i = a; i <= b; ++i)
	{
		str[i] = p[i - a];
	}
}

void op_reverse(char *str, int a, int b)
{
	for(; a < b; ++a, --b)
	{
		char temp;
		temp   = str[a];
		str[a] = str[b];
		str[b] = temp;		
	}
}

int main()
{
	int q, a, b;
	char str[1024], p[1024], op[16];

	scanf("%s %d", str, &q);
	for(int i = 0; i < q; ++i)
	{
		scanf("%s %d %d", op, &a, &b);

		if(strcmp(op, "print") == 0)
		{
			op_print(str, a, b);
		}
		if(strcmp(op, "reverse") == 0)
		{
			op_reverse(str, a, b);
		}
		if(strcmp(op, "replace") == 0)
		{
			scanf("%s", p);
			op_replace(str, a, b, p);
		}
	}
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	op_print
	.type	op_print, @function
op_print:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L2
.L3:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	addl	$1, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L3
	movl	$10, %edi
	call	putchar@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	op_print, .-op_print
	.globl	op_replace
	.type	op_replace, @function
op_replace:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movq	%rcx, -40(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L5
.L6:
	movl	-4(%rbp), %eax
	subl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movzbl	(%rax), %eax
	movb	%al, (%rdx)
	addl	$1, -4(%rbp)
.L5:
	movl	-4(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L6
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	op_replace, .-op_replace
	.globl	op_reverse
	.type	op_reverse, @function
op_reverse:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	jmp	.L8
.L9:
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movb	%al, -1(%rbp)
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-28(%rbp), %edx
	movslq	%edx, %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movzbl	(%rax), %eax
	movb	%al, (%rdx)
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movzbl	-1(%rbp), %eax
	movb	%al, (%rdx)
	addl	$1, -28(%rbp)
	subl	$1, -32(%rbp)
.L8:
	movl	-28(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jl	.L9
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	op_reverse, .-op_reverse
	.section	.rodata
.LC0:
	.string	"%s %d"
.LC1:
	.string	"%s %d %d"
.LC2:
	.string	"print"
.LC3:
	.string	"reverse"
.LC4:
	.string	"replace"
.LC5:
	.string	"%s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$2096, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-2096(%rbp), %rdx
	leaq	-2064(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -2084(%rbp)
	jmp	.L11
.L15:
	leaq	-2088(%rbp), %rcx
	leaq	-2092(%rbp), %rdx
	leaq	-2080(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-2080(%rbp), %rax
	leaq	.LC2(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L12
	movl	-2088(%rbp), %edx
	movl	-2092(%rbp), %ecx
	leaq	-2064(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	op_print
.L12:
	leaq	-2080(%rbp), %rax
	leaq	.LC3(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L13
	movl	-2088(%rbp), %edx
	movl	-2092(%rbp), %ecx
	leaq	-2064(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	op_reverse
.L13:
	leaq	-2080(%rbp), %rax
	leaq	.LC4(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L14
	leaq	-1040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-2088(%rbp), %edx
	movl	-2092(%rbp), %esi
	leaq	-1040(%rbp), %rcx
	leaq	-2064(%rbp), %rax
	movq	%rax, %rdi
	call	op_replace
.L14:
	addl	$1, -2084(%rbp)
.L11:
	movl	-2096(%rbp), %eax
	cmpl	%eax, -2084(%rbp)
	jl	.L15
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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
	.p2align 4
	.globl	op_print
	.type	op_print, @function
op_print:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	cmpl	%edx, %esi
	jg	.L2
	movq	%rdi, %r12
	movl	%edx, %ebp
	movslq	%esi, %rbx
	.p2align 4,,10
	.p2align 3
.L3:
	movsbl	(%r12,%rbx), %edi
	movq	stdout(%rip), %rsi
	addq	$1, %rbx
	call	putc@PLT
	cmpl	%ebx, %ebp
	jge	.L3
.L2:
	movq	stdout(%rip), %rsi
	popq	%rbx
	.cfi_def_cfa_offset 24
	movl	$10, %edi
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	jmp	putc@PLT
	.cfi_endproc
.LFE35:
	.size	op_print, .-op_print
	.p2align 4
	.globl	op_replace
	.type	op_replace, @function
op_replace:
.LFB36:
	.cfi_startproc
	endbr64
	movq	%rdi, %r10
	movl	%edx, %edi
	movq	%rcx, %rdx
	cmpl	%edi, %esi
	jg	.L7
	movslq	%esi, %rcx
	leaq	1(%rdx), %r9
	movl	%edi, %r8d
	addq	%r10, %rcx
	subl	%esi, %r8d
	movq	%rcx, %rax
	subq	%r9, %rax
	cmpq	$14, %rax
	jbe	.L9
	cmpl	$6, %r8d
	jbe	.L9
	leal	1(%r8), %r11d
	cmpl	$14, %r8d
	jbe	.L10
	movl	%r11d, %r9d
	xorl	%eax, %eax
	shrl	$4, %r9d
	salq	$4, %r9
	.p2align 4,,10
	.p2align 3
.L11:
	movdqu	(%rdx,%rax), %xmm0
	movups	%xmm0, (%rcx,%rax)
	addq	$16, %rax
	cmpq	%r9, %rax
	jne	.L11
	movl	%r11d, %r9d
	andl	$-16, %r9d
	leal	(%r9,%rsi), %eax
	cmpl	%r9d, %r11d
	je	.L7
	subl	%r9d, %r8d
	leal	1(%r8), %r11d
	cmpl	$6, %r8d
	jbe	.L13
.L17:
	movq	(%rdx,%r9), %r8
	movq	%r8, (%rcx,%r9)
	movl	%r11d, %ecx
	andl	$-8, %ecx
	addl	%ecx, %eax
	cmpl	%ecx, %r11d
	je	.L7
.L13:
	movl	%eax, %ecx
	subl	%esi, %ecx
	movslq	%ecx, %rcx
	movzbl	(%rdx,%rcx), %r8d
	movslq	%eax, %rcx
	movb	%r8b, (%r10,%rcx)
	leal	1(%rax), %ecx
	cmpl	%ecx, %edi
	jl	.L7
	movl	%ecx, %r8d
	movslq	%ecx, %rcx
	subl	%esi, %r8d
	movslq	%r8d, %r8
	movzbl	(%rdx,%r8), %r8d
	movb	%r8b, (%r10,%rcx)
	leal	2(%rax), %ecx
	cmpl	%ecx, %edi
	jl	.L7
	movl	%ecx, %r8d
	movslq	%ecx, %rcx
	subl	%esi, %r8d
	movslq	%r8d, %r8
	movzbl	(%rdx,%r8), %r8d
	movb	%r8b, (%r10,%rcx)
	leal	3(%rax), %ecx
	cmpl	%ecx, %edi
	jl	.L7
	movl	%ecx, %r8d
	movslq	%ecx, %rcx
	subl	%esi, %r8d
	movslq	%r8d, %r8
	movzbl	(%rdx,%r8), %r8d
	movb	%r8b, (%r10,%rcx)
	leal	4(%rax), %ecx
	cmpl	%ecx, %edi
	jl	.L7
	movl	%ecx, %r8d
	movslq	%ecx, %rcx
	subl	%esi, %r8d
	movslq	%r8d, %r8
	movzbl	(%rdx,%r8), %r8d
	movb	%r8b, (%r10,%rcx)
	leal	5(%rax), %ecx
	cmpl	%ecx, %edi
	jl	.L7
	movl	%ecx, %r8d
	addl	$6, %eax
	movslq	%ecx, %rcx
	subl	%esi, %r8d
	movslq	%r8d, %r8
	movzbl	(%rdx,%r8), %r8d
	movb	%r8b, (%r10,%rcx)
	cmpl	%eax, %edi
	jl	.L7
	movl	%eax, %ecx
	cltq
	subl	%esi, %ecx
	movslq	%ecx, %rcx
	movzbl	(%rdx,%rcx), %edx
	movb	%dl, (%r10,%rax)
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L15:
	movzbl	(%rdx,%rax), %esi
	movb	%sil, (%rcx,%rax)
	movq	%rax, %rsi
	addq	$1, %rax
	cmpq	%r8, %rsi
	jne	.L15
	ret
.L10:
	movl	%esi, %eax
	xorl	%r9d, %r9d
	jmp	.L17
	.cfi_endproc
.LFE36:
	.size	op_replace, .-op_replace
	.p2align 4
	.globl	op_reverse
	.type	op_reverse, @function
op_reverse:
.LFB37:
	.cfi_startproc
	endbr64
	cmpl	%edx, %esi
	jge	.L26
	movslq	%esi, %rsi
	movslq	%edx, %rdx
	.p2align 4,,10
	.p2align 3
.L28:
	movzbl	(%rdi,%rsi), %eax
	movzbl	(%rdi,%rdx), %ecx
	movb	%cl, (%rdi,%rsi)
	addq	$1, %rsi
	movb	%al, (%rdi,%rdx)
	subq	$1, %rdx
	cmpl	%esi, %edx
	jg	.L28
.L26:
	ret
	.cfi_endproc
.LFE37:
	.size	op_reverse, .-op_reverse
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s %d"
.LC1:
	.string	"%s %d %d"
.LC2:
	.string	"print"
.LC3:
	.string	"reverse"
.LC4:
	.string	"replace"
.LC5:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB38:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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
	subq	$2120, %rsp
	.cfi_def_cfa_offset 2176
	movq	%fs:40, %rax
	movq	%rax, 2104(%rsp)
	xorl	%eax, %eax
	leaq	48(%rsp), %rbp
	leaq	20(%rsp), %rdx
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %eax
	testl	%eax, %eax
	jle	.L31
	leaq	24(%rsp), %rax
	xorl	%r12d, %r12d
	leaq	28(%rsp), %r15
	movq	%rax, (%rsp)
	leaq	1072(%rsp), %rax
	leaq	32(%rsp), %rbx
	movq	%rax, 8(%rsp)
	jmp	.L44
	.p2align 4,,10
	.p2align 3
.L34:
	movabsq	$28555907813500274, %rax
	cmpq	%rax, (%rbx)
	je	.L50
.L39:
	movabsq	$28538242730059122, %rax
	cmpq	%rax, (%rbx)
	je	.L51
.L43:
	addl	$1, %r12d
	cmpl	%r12d, 20(%rsp)
	jle	.L31
.L44:
	movq	(%rsp), %rdx
	xorl	%eax, %eax
	movq	%r15, %rcx
	movq	%rbx, %rsi
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1852404336, (%rbx)
	jne	.L34
	cmpw	$116, 4(%rbx)
	jne	.L34
	movl	28(%rsp), %r13d
	movl	24(%rsp), %edx
	cmpl	%edx, %r13d
	jl	.L35
	movslq	%edx, %r14
	.p2align 4,,10
	.p2align 3
.L36:
	movsbl	0(%rbp,%r14), %edi
	movq	stdout(%rip), %rsi
	addq	$1, %r14
	call	putc@PLT
	cmpl	%r14d, %r13d
	jge	.L36
.L35:
	movq	stdout(%rip), %rsi
	movl	$10, %edi
	call	putc@PLT
	movabsq	$28555907813500274, %rax
	cmpq	%rax, (%rbx)
	jne	.L39
.L50:
	movl	28(%rsp), %eax
	movl	24(%rsp), %esi
	cmpl	%esi, %eax
	jle	.L39
	movslq	%esi, %rcx
	movslq	%eax, %rdx
	leal	(%rsi,%rax), %r8d
	addq	%rbp, %rcx
	addq	%rbp, %rdx
	.p2align 4,,10
	.p2align 3
.L40:
	movzbl	(%rcx), %esi
	movzbl	(%rdx), %edi
	subl	$1, %eax
	addq	$1, %rcx
	subq	$1, %rdx
	movb	%dil, -1(%rcx)
	movb	%sil, 1(%rdx)
	movl	%r8d, %esi
	subl	%eax, %esi
	cmpl	%esi, %eax
	jg	.L40
	movabsq	$28538242730059122, %rax
	cmpq	%rax, (%rbx)
	jne	.L43
.L51:
	movq	8(%rsp), %r14
	leaq	.LC5(%rip), %rdi
	xorl	%eax, %eax
	movq	%r14, %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %edx
	movl	24(%rsp), %eax
	cmpl	%eax, %edx
	jl	.L43
	subl	%eax, %edx
	movslq	%eax, %rdi
	movq	%r14, %rsi
	addq	%rbp, %rdi
	addq	$1, %rdx
	call	memcpy@PLT
	jmp	.L43
	.p2align 4,,10
	.p2align 3
.L31:
	movq	2104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L52
	addq	$2120, %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
.L52:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE38:
	.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
	.p2align 4
	.globl	op_print
	.type	op_print, @function
op_print:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	cmpl	%edx, %esi
	jg	.L2
	movq	%rdi, %r12
	movl	%edx, %ebp
	movslq	%esi, %rbx
	.p2align 4,,10
	.p2align 3
.L3:
	movsbl	(%r12,%rbx), %edi
	movq	stdout(%rip), %rsi
	addq	$1, %rbx
	call	putc@PLT
	cmpl	%ebx, %ebp
	jge	.L3
.L2:
	movq	stdout(%rip), %rsi
	popq	%rbx
	.cfi_def_cfa_offset 24
	movl	$10, %edi
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	jmp	putc@PLT
	.cfi_endproc
.LFE35:
	.size	op_print, .-op_print
	.p2align 4
	.globl	op_replace
	.type	op_replace, @function
op_replace:
.LFB36:
	.cfi_startproc
	endbr64
	movq	%rdi, %r10
	movl	%edx, %edi
	movq	%rcx, %rdx
	cmpl	%edi, %esi
	jg	.L7
	movslq	%esi, %rcx
	leaq	1(%rdx), %r9
	movl	%edi, %r8d
	addq	%r10, %rcx
	subl	%esi, %r8d
	movq	%rcx, %rax
	subq	%r9, %rax
	cmpq	$14, %rax
	jbe	.L9
	cmpl	$6, %r8d
	jbe	.L9
	leal	1(%r8), %r11d
	cmpl	$14, %r8d
	jbe	.L10
	movl	%r11d, %r9d
	xorl	%eax, %eax
	shrl	$4, %r9d
	salq	$4, %r9
	.p2align 4,,10
	.p2align 3
.L11:
	movdqu	(%rdx,%rax), %xmm0
	movups	%xmm0, (%rcx,%rax)
	addq	$16, %rax
	cmpq	%r9, %rax
	jne	.L11
	movl	%r11d, %r9d
	andl	$-16, %r9d
	leal	(%r9,%rsi), %eax
	cmpl	%r9d, %r11d
	je	.L7
	subl	%r9d, %r8d
	leal	1(%r8), %r11d
	cmpl	$6, %r8d
	jbe	.L13
.L17:
	movq	(%rdx,%r9), %r8
	movq	%r8, (%rcx,%r9)
	movl	%r11d, %ecx
	andl	$-8, %ecx
	addl	%ecx, %eax
	cmpl	%ecx, %r11d
	je	.L7
.L13:
	movl	%eax, %ecx
	subl	%esi, %ecx
	movslq	%ecx, %rcx
	movzbl	(%rdx,%rcx), %r8d
	movslq	%eax, %rcx
	movb	%r8b, (%r10,%rcx)
	leal	1(%rax), %ecx
	cmpl	%ecx, %edi
	jl	.L7
	movl	%ecx, %r8d
	movslq	%ecx, %rcx
	subl	%esi, %r8d
	movslq	%r8d, %r8
	movzbl	(%rdx,%r8), %r8d
	movb	%r8b, (%r10,%rcx)
	leal	2(%rax), %ecx
	cmpl	%ecx, %edi
	jl	.L7
	movl	%ecx, %r8d
	movslq	%ecx, %rcx
	subl	%esi, %r8d
	movslq	%r8d, %r8
	movzbl	(%rdx,%r8), %r8d
	movb	%r8b, (%r10,%rcx)
	leal	3(%rax), %ecx
	cmpl	%ecx, %edi
	jl	.L7
	movl	%ecx, %r8d
	movslq	%ecx, %rcx
	subl	%esi, %r8d
	movslq	%r8d, %r8
	movzbl	(%rdx,%r8), %r8d
	movb	%r8b, (%r10,%rcx)
	leal	4(%rax), %ecx
	cmpl	%ecx, %edi
	jl	.L7
	movl	%ecx, %r8d
	movslq	%ecx, %rcx
	subl	%esi, %r8d
	movslq	%r8d, %r8
	movzbl	(%rdx,%r8), %r8d
	movb	%r8b, (%r10,%rcx)
	leal	5(%rax), %ecx
	cmpl	%ecx, %edi
	jl	.L7
	movl	%ecx, %r8d
	addl	$6, %eax
	movslq	%ecx, %rcx
	subl	%esi, %r8d
	movslq	%r8d, %r8
	movzbl	(%rdx,%r8), %r8d
	movb	%r8b, (%r10,%rcx)
	cmpl	%eax, %edi
	jl	.L7
	movl	%eax, %ecx
	cltq
	subl	%esi, %ecx
	movslq	%ecx, %rcx
	movzbl	(%rdx,%rcx), %edx
	movb	%dl, (%r10,%rax)
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L15:
	movzbl	(%rdx,%rax), %esi
	movb	%sil, (%rcx,%rax)
	movq	%rax, %rsi
	addq	$1, %rax
	cmpq	%r8, %rsi
	jne	.L15
	ret
.L10:
	movl	%esi, %eax
	xorl	%r9d, %r9d
	jmp	.L17
	.cfi_endproc
.LFE36:
	.size	op_replace, .-op_replace
	.p2align 4
	.globl	op_reverse
	.type	op_reverse, @function
op_reverse:
.LFB37:
	.cfi_startproc
	endbr64
	cmpl	%edx, %esi
	jge	.L26
	movslq	%esi, %rsi
	movslq	%edx, %rdx
	.p2align 4,,10
	.p2align 3
.L28:
	movzbl	(%rdi,%rsi), %eax
	movzbl	(%rdi,%rdx), %ecx
	movb	%cl, (%rdi,%rsi)
	addq	$1, %rsi
	movb	%al, (%rdi,%rdx)
	subq	$1, %rdx
	cmpl	%esi, %edx
	jg	.L28
.L26:
	ret
	.cfi_endproc
.LFE37:
	.size	op_reverse, .-op_reverse
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s %d"
.LC1:
	.string	"%s %d %d"
.LC2:
	.string	"print"
.LC3:
	.string	"reverse"
.LC4:
	.string	"replace"
.LC5:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB38:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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
	subq	$2120, %rsp
	.cfi_def_cfa_offset 2176
	movq	%fs:40, %rax
	movq	%rax, 2104(%rsp)
	xorl	%eax, %eax
	leaq	48(%rsp), %rbp
	leaq	20(%rsp), %rdx
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %eax
	testl	%eax, %eax
	jle	.L31
	leaq	24(%rsp), %rax
	xorl	%r12d, %r12d
	leaq	28(%rsp), %r15
	movq	%rax, (%rsp)
	leaq	1072(%rsp), %rax
	leaq	32(%rsp), %rbx
	movq	%rax, 8(%rsp)
	jmp	.L44
	.p2align 4,,10
	.p2align 3
.L34:
	movabsq	$28555907813500274, %rax
	cmpq	%rax, (%rbx)
	je	.L50
.L39:
	movabsq	$28538242730059122, %rax
	cmpq	%rax, (%rbx)
	je	.L51
.L43:
	addl	$1, %r12d
	cmpl	%r12d, 20(%rsp)
	jle	.L31
.L44:
	movq	(%rsp), %rdx
	xorl	%eax, %eax
	movq	%r15, %rcx
	movq	%rbx, %rsi
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1852404336, (%rbx)
	jne	.L34
	cmpw	$116, 4(%rbx)
	jne	.L34
	movl	28(%rsp), %r13d
	movl	24(%rsp), %edx
	cmpl	%edx, %r13d
	jl	.L35
	movslq	%edx, %r14
	.p2align 4,,10
	.p2align 3
.L36:
	movsbl	0(%rbp,%r14), %edi
	movq	stdout(%rip), %rsi
	addq	$1, %r14
	call	putc@PLT
	cmpl	%r14d, %r13d
	jge	.L36
.L35:
	movq	stdout(%rip), %rsi
	movl	$10, %edi
	call	putc@PLT
	movabsq	$28555907813500274, %rax
	cmpq	%rax, (%rbx)
	jne	.L39
.L50:
	movl	28(%rsp), %eax
	movl	24(%rsp), %esi
	cmpl	%esi, %eax
	jle	.L39
	movslq	%esi, %rcx
	movslq	%eax, %rdx
	leal	(%rsi,%rax), %r8d
	addq	%rbp, %rcx
	addq	%rbp, %rdx
	.p2align 4,,10
	.p2align 3
.L40:
	movzbl	(%rcx), %esi
	movzbl	(%rdx), %edi
	subl	$1, %eax
	addq	$1, %rcx
	subq	$1, %rdx
	movb	%dil, -1(%rcx)
	movb	%sil, 1(%rdx)
	movl	%r8d, %esi
	subl	%eax, %esi
	cmpl	%esi, %eax
	jg	.L40
	movabsq	$28538242730059122, %rax
	cmpq	%rax, (%rbx)
	jne	.L43
.L51:
	movq	8(%rsp), %r14
	leaq	.LC5(%rip), %rdi
	xorl	%eax, %eax
	movq	%r14, %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %edx
	movl	24(%rsp), %eax
	cmpl	%eax, %edx
	jl	.L43
	subl	%eax, %edx
	movslq	%eax, %rdi
	movq	%r14, %rsi
	addq	%rbp, %rdi
	addq	$1, %rdx
	call	memcpy@PLT
	jmp	.L43
	.p2align 4,,10
	.p2align 3
.L31:
	movq	2104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L52
	addq	$2120, %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
.L52:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE38:
	.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>

void op_print(char *str, int a, int b)
{
	for(int i = a; i <= b; ++i)
	{
		putchar(str[i]);
	}
	putchar('\n');
}

void op_replace(char *str, int a, int b, char *p)
{
	for(int i = a; i <= b; ++i)
	{
		str[i] = p[i - a];
	}
}

void op_reverse(char *str, int a, int b)
{
	for(; a < b; ++a, --b)
	{
		char temp;
		temp   = str[a];
		str[a] = str[b];
		str[b] = temp;		
	}
}

int main()
{
	int q, a, b;
	char str[1024], p[1024], op[16];

	scanf("%s %d", str, &q);
	for(int i = 0; i < q; ++i)
	{
		scanf("%s %d %d", op, &a, &b);

		if(strcmp(op, "print") == 0)
		{
			op_print(str, a, b);
		}
		if(strcmp(op, "reverse") == 0)
		{
			op_reverse(str, a, b);
		}
		if(strcmp(op, "replace") == 0)
		{
			scanf("%s", p);
			op_replace(str, a, b, p);
		}
	}
	return 0;
}

abcde
3
replace 1 3 xy{
reverse 0 2
print 1 4
 xyz
3
print 0 2
replace 1 2 abc
print 0 2
 abcde
3
replace 1 3 xy{
reverse 0 2
print 1 2
 abcde
3
replace 1 3 yy{
reverse 0 2
print 1 2
 abcde
3
replace 1 3 yy{
reverse 0 2
print 1 1
 xyz
1
print 0 2
replace 0 2 abc
print 0 2
 abcde
3
replace 1 3 xy{
reverse 0 2
print 1 3
 xyz
3
print 0 1
replace 1 2 abc
print 0 2
 abcde
3
replace 1 3 yy{
reverse -1 2
print 1 2
 abcde
3
replace 1 3 xy{
reverse 0 2
print 1 1

xa{e
 xyz
xab
 xa
 ya
 y
 xyz
 xa{
 xy
xab
 a
 x

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>

void op_print(char *str, int a, int b)
{
	for(int i = a; i <= b; ++i)
	{
		putchar(str[i]);
	}
	putchar('\n');
}

void op_replace(char *str, int a, int b, char *p)
{
	for(int i = a; i <= b; ++i)
	{
		str[i] = p[i - a];
	}
}

void op_reverse(char *str, int a, int b)
{
	for(; a < b; ++a, --b)
	{
		char temp;
		temp   = str[a];
		str[a] = str[b];
		str[b] = temp;		
	}
}

int main()
{
	int q, a, b;
	char str[1024], p[1024], op[16];

	scanf("%s %d", str, &q);
	for(int i = 0; i < q; ++i)
	{
		scanf("%s %d %d", op, &a, &b);

		if(strcmp(op, "print") == 0)
		{
			op_print(str, a, b);
		}
		if(strcmp(op, "reverse") == 0)
		{
			op_reverse(str, a, b);
		}
		if(strcmp(op, "replace") == 0)
		{
			scanf("%s", p);
			op_replace(str, a, b, p);
		}
	}
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	op_print
	.type	op_print, @function
op_print:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L2
.L3:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	addl	$1, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L3
	movl	$10, %edi
	call	putchar@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	op_print, .-op_print
	.globl	op_replace
	.type	op_replace, @function
op_replace:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movq	%rcx, -40(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L5
.L6:
	movl	-4(%rbp), %eax
	subl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movzbl	(%rax), %eax
	movb	%al, (%rdx)
	addl	$1, -4(%rbp)
.L5:
	movl	-4(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L6
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	op_replace, .-op_replace
	.globl	op_reverse
	.type	op_reverse, @function
op_reverse:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	jmp	.L8
.L9:
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movb	%al, -1(%rbp)
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-28(%rbp), %edx
	movslq	%edx, %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movzbl	(%rax), %eax
	movb	%al, (%rdx)
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movzbl	-1(%rbp), %eax
	movb	%al, (%rdx)
	addl	$1, -28(%rbp)
	subl	$1, -32(%rbp)
.L8:
	movl	-28(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jl	.L9
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	op_reverse, .-op_reverse
	.section	.rodata
.LC0:
	.string	"%s %d"
.LC1:
	.string	"%s %d %d"
.LC2:
	.string	"print"
.LC3:
	.string	"reverse"
.LC4:
	.string	"replace"
.LC5:
	.string	"%s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$2096, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-2096(%rbp), %rdx
	leaq	-2064(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -2084(%rbp)
	jmp	.L11
.L15:
	leaq	-2088(%rbp), %rcx
	leaq	-2092(%rbp), %rdx
	leaq	-2080(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-2080(%rbp), %rax
	leaq	.LC2(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L12
	movl	-2088(%rbp), %edx
	movl	-2092(%rbp), %ecx
	leaq	-2064(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	op_print
.L12:
	leaq	-2080(%rbp), %rax
	leaq	.LC3(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L13
	movl	-2088(%rbp), %edx
	movl	-2092(%rbp), %ecx
	leaq	-2064(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	op_reverse
.L13:
	leaq	-2080(%rbp), %rax
	leaq	.LC4(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L14
	leaq	-1040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-2088(%rbp), %edx
	movl	-2092(%rbp), %esi
	leaq	-1040(%rbp), %rcx
	leaq	-2064(%rbp), %rax
	movq	%rax, %rdi
	call	op_replace
.L14:
	addl	$1, -2084(%rbp)
.L11:
	movl	-2096(%rbp), %eax
	cmpl	%eax, -2084(%rbp)
	jl	.L15
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	op_print
	.type	op_print, @function
op_print:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L2
.L3:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	addl	$1, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L3
	movl	$10, %edi
	call	putchar@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	op_print, .-op_print
	.globl	op_replace
	.type	op_replace, @function
op_replace:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movq	%rcx, -40(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L5
.L6:
	movl	-4(%rbp), %eax
	subl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movzbl	(%rax), %eax
	movb	%al, (%rdx)
	addl	$1, -4(%rbp)
.L5:
	movl	-4(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L6
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	op_replace, .-op_replace
	.globl	op_reverse
	.type	op_reverse, @function
op_reverse:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	jmp	.L8
.L9:
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movb	%al, -1(%rbp)
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-28(%rbp), %edx
	movslq	%edx, %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movzbl	(%rax), %eax
	movb	%al, (%rdx)
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movzbl	-1(%rbp), %eax
	movb	%al, (%rdx)
	addl	$1, -28(%rbp)
	subl	$1, -32(%rbp)
.L8:
	movl	-28(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jl	.L9
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	op_reverse, .-op_reverse
	.section	.rodata
.LC0:
	.string	"%s %d"
.LC1:
	.string	"%s %d %d"
.LC2:
	.string	"print"
.LC3:
	.string	"reverse"
.LC4:
	.string	"replace"
.LC5:
	.string	"%s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$2096, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-2096(%rbp), %rdx
	leaq	-2064(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -2084(%rbp)
	jmp	.L11
.L15:
	leaq	-2088(%rbp), %rcx
	leaq	-2092(%rbp), %rdx
	leaq	-2080(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-2080(%rbp), %rax
	leaq	.LC2(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L12
	movl	-2088(%rbp), %edx
	movl	-2092(%rbp), %ecx
	leaq	-2064(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	op_print
.L12:
	leaq	-2080(%rbp), %rax
	leaq	.LC3(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L13
	movl	-2088(%rbp), %edx
	movl	-2092(%rbp), %ecx
	leaq	-2064(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	op_reverse
.L13:
	leaq	-2080(%rbp), %rax
	leaq	.LC4(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L14
	leaq	-1040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-2088(%rbp), %edx
	movl	-2092(%rbp), %esi
	leaq	-1040(%rbp), %rcx
	leaq	-2064(%rbp), %rax
	movq	%rax, %rdi
	call	op_replace
.L14:
	addl	$1, -2084(%rbp)
.L11:
	movl	-2096(%rbp), %eax
	cmpl	%eax, -2084(%rbp)
	jl	.L15
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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:
