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

int mtoi(char x[]){
	int i,sum=0;

	for(i=0;x[i]!=0;i++){
		if(x[i] == 'm'){
			if(i && isdigit(x[i-1])) sum += (x[i-1] - '0') * 1000;
			else sum += 1000;
		}
		else if(x[i] == 'c'){
			if(i && isdigit(x[i-1])) sum += (x[i-1] - '0') * 100;
			else sum += 100;
		}
		else if(x[i] == 'x'){
			if(i && isdigit(x[i-1])) sum += (x[i-1] - '0') * 10;
			else sum += 10;
		}
		else if(x[i] == 'i'){
			if(i && isdigit(x[i-1])) sum += (x[i-1] - '0');
			else sum += 1;
		}
	}
	return sum;
}

void print_itom(int x){
	int i,d;

	if((d=x/1000) > 0){
		if(d != 1) printf("%d",d);
		printf("m");
	}
	x -= x/1000*1000;
	if((d=x/100) > 0){
		if(d != 1) printf("%d",d);
		printf("c");
	}
	x -= x/100*100;
	if((d=x/10) > 0){
		if(d != 1) printf("%d",d);
		printf("x");
	}
	x -= x/10*10;
	if(x > 0){
		if(x != 1) printf("%d",x);
		printf("i");
	}
	printf("\n");
}

int main(void){
	int n,sum;
	char a[12],b[12];

	scanf("%d",&n);
	while(n--){
		scanf("%s%s",a,b);
		sum = mtoi(a) + mtoi(b);
		print_itom(sum);
	}

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	mtoi
	.type	mtoi, @function
mtoi:
.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	$0, -4(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L2
.L14:
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$109, %al
	jne	.L3
	cmpl	$0, -8(%rbp)
	je	.L4
	call	__ctype_b_loc@PLT
	movq	(%rax), %rdx
	movl	-8(%rbp), %eax
	cltq
	leaq	-1(%rax), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	movsbq	%al, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movzwl	(%rax), %eax
	movzwl	%ax, %eax
	andl	$2048, %eax
	testl	%eax, %eax
	je	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	imull	$1000, %eax, %eax
	addl	%eax, -4(%rbp)
	jmp	.L6
.L4:
	addl	$1000, -4(%rbp)
	jmp	.L6
.L3:
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$99, %al
	jne	.L7
	cmpl	$0, -8(%rbp)
	je	.L8
	call	__ctype_b_loc@PLT
	movq	(%rax), %rdx
	movl	-8(%rbp), %eax
	cltq
	leaq	-1(%rax), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	movsbq	%al, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movzwl	(%rax), %eax
	movzwl	%ax, %eax
	andl	$2048, %eax
	testl	%eax, %eax
	je	.L8
	movl	-8(%rbp), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	imull	$100, %eax, %eax
	addl	%eax, -4(%rbp)
	jmp	.L6
.L8:
	addl	$100, -4(%rbp)
	jmp	.L6
.L7:
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$120, %al
	jne	.L10
	cmpl	$0, -8(%rbp)
	je	.L11
	call	__ctype_b_loc@PLT
	movq	(%rax), %rdx
	movl	-8(%rbp), %eax
	cltq
	leaq	-1(%rax), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	movsbq	%al, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movzwl	(%rax), %eax
	movzwl	%ax, %eax
	andl	$2048, %eax
	testl	%eax, %eax
	je	.L11
	movl	-8(%rbp), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	leal	-48(%rax), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	addl	%eax, -4(%rbp)
	jmp	.L6
.L11:
	addl	$10, -4(%rbp)
	jmp	.L6
.L10:
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$105, %al
	jne	.L6
	cmpl	$0, -8(%rbp)
	je	.L13
	call	__ctype_b_loc@PLT
	movq	(%rax), %rdx
	movl	-8(%rbp), %eax
	cltq
	leaq	-1(%rax), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	movsbq	%al, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movzwl	(%rax), %eax
	movzwl	%ax, %eax
	andl	$2048, %eax
	testl	%eax, %eax
	je	.L13
	movl	-8(%rbp), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	addl	%eax, -4(%rbp)
	jmp	.L6
.L13:
	addl	$1, -4(%rbp)
.L6:
	addl	$1, -8(%rbp)
.L2:
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L14
	movl	-4(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	mtoi, .-mtoi
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	print_itom
	.type	print_itom, @function
print_itom:
.LFB1:
	.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
	movl	%edi, -20(%rbp)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$274877907, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$6, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jle	.L17
	cmpl	$1, -4(%rbp)
	je	.L18
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L18:
	movl	$109, %edi
	call	putchar@PLT
.L17:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$274877907, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$6, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$1000, %edx, %edx
	subl	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jle	.L19
	cmpl	$1, -4(%rbp)
	je	.L20
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L20:
	movl	$99, %edi
	call	putchar@PLT
.L19:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$100, %edx, %edx
	subl	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jle	.L21
	cmpl	$1, -4(%rbp)
	je	.L22
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L22:
	movl	$120, %edi
	call	putchar@PLT
.L21:
	movl	-20(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	subl	%eax, %edx
	movl	%edx, -20(%rbp)
	cmpl	$0, -20(%rbp)
	jle	.L23
	cmpl	$1, -20(%rbp)
	je	.L24
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L24:
	movl	$105, %edi
	call	putchar@PLT
.L23:
	movl	$10, %edi
	call	putchar@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	print_itom, .-print_itom
	.section	.rodata
.LC1:
	.string	"%s%s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L26
.L27:
	leaq	-36(%rbp), %rdx
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-48(%rbp), %rax
	movq	%rax, %rdi
	call	mtoi
	movl	%eax, %ebx
	leaq	-36(%rbp), %rax
	movq	%rax, %rdi
	call	mtoi
	addl	%ebx, %eax
	movl	%eax, -52(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, %edi
	call	print_itom
.L26:
	movl	-56(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -56(%rbp)
	testl	%eax, %eax
	jne	.L27
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L29
	call	__stack_chk_fail@PLT
.L29:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	mtoi
	.type	mtoi, @function
mtoi:
.LFB25:
	.cfi_startproc
	endbr64
	movzbl	(%rdi), %eax
	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
	testb	%al, %al
	je	.L12
	leaq	-1(%rdi), %rbx
	xorl	%r12d, %r12d
	xorl	%ebp, %ebp
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	$99, %al
	je	.L40
	cmpb	$120, %al
	je	.L41
	cmpb	$105, %al
	je	.L42
.L5:
	movzbl	2(%rbx), %eax
	addq	$1, %rbx
	addl	$1, %ebp
	testb	%al, %al
	je	.L1
.L11:
	cmpb	$109, %al
	jne	.L3
	testl	%ebp, %ebp
	je	.L4
	call	__ctype_b_loc@PLT
	movsbq	(%rbx), %rcx
	movq	%rax, %r8
	movq	(%r8), %rdx
	movq	%rcx, %rax
	testb	$8, 1(%rdx,%rcx,2)
	je	.L4
	subl	$48, %eax
	addq	$1, %rbx
	addl	$1, %ebp
	imull	$1000, %eax, %eax
	addl	%eax, %r12d
	movzbl	1(%rbx), %eax
	testb	%al, %al
	jne	.L11
.L1:
	movl	%r12d, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	addl	$1000, %r12d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L40:
	testl	%ebp, %ebp
	je	.L7
	call	__ctype_b_loc@PLT
	movsbq	(%rbx), %rcx
	movq	%rax, %r8
	movq	(%r8), %rdx
	movq	%rcx, %rax
	testb	$8, 1(%rdx,%rcx,2)
	je	.L7
	subl	$48, %eax
	imull	$100, %eax, %eax
	addl	%eax, %r12d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L7:
	addl	$100, %r12d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L41:
	testl	%ebp, %ebp
	je	.L9
	call	__ctype_b_loc@PLT
	movsbq	(%rbx), %rcx
	movq	%rax, %r8
	movq	(%r8), %rdx
	testb	$8, 1(%rdx,%rcx,2)
	je	.L9
	leal	-240(%rcx,%rcx,4), %eax
	leal	(%r12,%rax,2), %r12d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L9:
	addl	$10, %r12d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L42:
	testl	%ebp, %ebp
	je	.L10
	call	__ctype_b_loc@PLT
	movsbq	(%rbx), %rcx
	movq	%rax, %r8
	movq	(%r8), %rdx
	testb	$8, 1(%rdx,%rcx,2)
	je	.L10
	leal	-48(%r12,%rcx), %r12d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L10:
	addl	$1, %r12d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L12:
	xorl	%r12d, %r12d
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	movl	%r12d, %eax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE25:
	.size	mtoi, .-mtoi
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.text
	.p2align 4
	.globl	print_itom
	.type	print_itom, @function
print_itom:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movslq	%edi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movq	%rbp, %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	cmpl	$999, %ebp
	jle	.L44
	imulq	$274877907, %rbp, %rdx
	movl	%ebp, %eax
	sarl	$31, %eax
	sarq	$38, %rdx
	subl	%eax, %edx
	cmpl	$1, %edx
	jne	.L68
.L45:
	movl	$109, %edi
	call	putchar@PLT
.L44:
	imulq	$274877907, %rbp, %rbp
	movl	%ebx, %eax
	sarl	$31, %eax
	sarq	$38, %rbp
	subl	%eax, %ebp
	imull	$1000, %ebp, %eax
	subl	%eax, %ebx
	movl	%ebx, %ebp
	movslq	%ebx, %rbx
	cmpl	$99, %ebp
	jle	.L46
	imulq	$1374389535, %rbx, %rdx
	movl	%ebp, %eax
	sarl	$31, %eax
	sarq	$37, %rdx
	subl	%eax, %edx
	cmpl	$1, %edx
	jne	.L69
.L47:
	movl	$99, %edi
	call	putchar@PLT
.L46:
	imulq	$1374389535, %rbx, %rbx
	movl	%ebp, %eax
	sarl	$31, %eax
	sarq	$37, %rbx
	subl	%eax, %ebx
	imull	$100, %ebx, %eax
	movl	%ebp, %ebx
	subl	%eax, %ebx
	movslq	%ebx, %rbp
	cmpl	$9, %ebx
	jle	.L48
	imulq	$1717986919, %rbp, %rdx
	movl	%ebx, %eax
	sarl	$31, %eax
	sarq	$34, %rdx
	subl	%eax, %edx
	cmpl	$1, %edx
	jne	.L70
.L49:
	movl	$120, %edi
	call	putchar@PLT
.L48:
	imulq	$1717986919, %rbp, %rdx
	movl	%ebx, %eax
	sarl	$31, %eax
	sarq	$34, %rdx
	subl	%eax, %edx
	leal	(%rdx,%rdx,4), %eax
	movl	%ebx, %edx
	addl	%eax, %eax
	subl	%eax, %edx
	testl	%edx, %edx
	jle	.L50
	cmpl	$1, %edx
	jne	.L71
.L51:
	movl	$105, %edi
	call	putchar@PLT
.L50:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movl	$10, %edi
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	putchar@PLT
	.p2align 4,,10
	.p2align 3
.L71:
	.cfi_restore_state
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L51
	.p2align 4,,10
	.p2align 3
.L70:
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L49
	.p2align 4,,10
	.p2align 3
.L69:
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L47
	.p2align 4,,10
	.p2align 3
.L68:
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L45
	.cfi_endproc
.LFE26:
	.size	print_itom, .-print_itom
	.section	.rodata.str1.1
.LC1:
	.string	"%s%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB27:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$56, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 12(%rsp)
	testl	%eax, %eax
	je	.L73
	leaq	28(%rsp), %r12
	leaq	16(%rsp), %rbp
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L74:
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%rbp, %rdi
	call	mtoi
	movq	%r12, %rdi
	movl	%eax, %ebx
	call	mtoi
	leal	(%rbx,%rax), %edi
	call	print_itom
	movl	12(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 12(%rsp)
	testl	%eax, %eax
	jne	.L74
.L73:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L81
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L81:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE27:
	.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	mtoi
	.type	mtoi, @function
mtoi:
.LFB25:
	.cfi_startproc
	endbr64
	movzbl	(%rdi), %eax
	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
	testb	%al, %al
	je	.L12
	leaq	-1(%rdi), %rbx
	xorl	%r12d, %r12d
	xorl	%ebp, %ebp
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	$99, %al
	je	.L40
	cmpb	$120, %al
	je	.L41
	cmpb	$105, %al
	je	.L42
.L5:
	movzbl	2(%rbx), %eax
	addq	$1, %rbx
	addl	$1, %ebp
	testb	%al, %al
	je	.L1
.L11:
	cmpb	$109, %al
	jne	.L3
	testl	%ebp, %ebp
	je	.L4
	call	__ctype_b_loc@PLT
	movsbq	(%rbx), %rcx
	movq	%rax, %r8
	movq	(%r8), %rdx
	movq	%rcx, %rax
	testb	$8, 1(%rdx,%rcx,2)
	je	.L4
	subl	$48, %eax
	addq	$1, %rbx
	addl	$1, %ebp
	imull	$1000, %eax, %eax
	addl	%eax, %r12d
	movzbl	1(%rbx), %eax
	testb	%al, %al
	jne	.L11
.L1:
	movl	%r12d, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	addl	$1000, %r12d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L40:
	testl	%ebp, %ebp
	je	.L7
	call	__ctype_b_loc@PLT
	movsbq	(%rbx), %rcx
	movq	%rax, %r8
	movq	(%r8), %rdx
	movq	%rcx, %rax
	testb	$8, 1(%rdx,%rcx,2)
	je	.L7
	subl	$48, %eax
	imull	$100, %eax, %eax
	addl	%eax, %r12d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L7:
	addl	$100, %r12d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L41:
	testl	%ebp, %ebp
	je	.L9
	call	__ctype_b_loc@PLT
	movsbq	(%rbx), %rcx
	movq	%rax, %r8
	movq	(%r8), %rdx
	testb	$8, 1(%rdx,%rcx,2)
	je	.L9
	leal	-240(%rcx,%rcx,4), %eax
	leal	(%r12,%rax,2), %r12d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L9:
	addl	$10, %r12d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L42:
	testl	%ebp, %ebp
	je	.L10
	call	__ctype_b_loc@PLT
	movsbq	(%rbx), %rcx
	movq	%rax, %r8
	movq	(%r8), %rdx
	testb	$8, 1(%rdx,%rcx,2)
	je	.L10
	leal	-48(%r12,%rcx), %r12d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L10:
	addl	$1, %r12d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L12:
	xorl	%r12d, %r12d
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	movl	%r12d, %eax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE25:
	.size	mtoi, .-mtoi
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.text
	.p2align 4
	.globl	print_itom
	.type	print_itom, @function
print_itom:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movslq	%edi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movq	%rbp, %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	cmpl	$999, %ebp
	jle	.L44
	imulq	$274877907, %rbp, %rdx
	movl	%ebp, %eax
	sarl	$31, %eax
	sarq	$38, %rdx
	subl	%eax, %edx
	cmpl	$1, %edx
	jne	.L68
.L45:
	movl	$109, %edi
	call	putchar@PLT
.L44:
	imulq	$274877907, %rbp, %rbp
	movl	%ebx, %eax
	sarl	$31, %eax
	sarq	$38, %rbp
	subl	%eax, %ebp
	imull	$1000, %ebp, %eax
	subl	%eax, %ebx
	movl	%ebx, %ebp
	movslq	%ebx, %rbx
	cmpl	$99, %ebp
	jle	.L46
	imulq	$1374389535, %rbx, %rdx
	movl	%ebp, %eax
	sarl	$31, %eax
	sarq	$37, %rdx
	subl	%eax, %edx
	cmpl	$1, %edx
	jne	.L69
.L47:
	movl	$99, %edi
	call	putchar@PLT
.L46:
	imulq	$1374389535, %rbx, %rbx
	movl	%ebp, %eax
	sarl	$31, %eax
	sarq	$37, %rbx
	subl	%eax, %ebx
	imull	$100, %ebx, %eax
	movl	%ebp, %ebx
	subl	%eax, %ebx
	movslq	%ebx, %rbp
	cmpl	$9, %ebx
	jle	.L48
	imulq	$1717986919, %rbp, %rdx
	movl	%ebx, %eax
	sarl	$31, %eax
	sarq	$34, %rdx
	subl	%eax, %edx
	cmpl	$1, %edx
	jne	.L70
.L49:
	movl	$120, %edi
	call	putchar@PLT
.L48:
	imulq	$1717986919, %rbp, %rdx
	movl	%ebx, %eax
	sarl	$31, %eax
	sarq	$34, %rdx
	subl	%eax, %edx
	leal	(%rdx,%rdx,4), %eax
	movl	%ebx, %edx
	addl	%eax, %eax
	subl	%eax, %edx
	testl	%edx, %edx
	jle	.L50
	cmpl	$1, %edx
	jne	.L71
.L51:
	movl	$105, %edi
	call	putchar@PLT
.L50:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movl	$10, %edi
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	putchar@PLT
	.p2align 4,,10
	.p2align 3
.L71:
	.cfi_restore_state
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L51
	.p2align 4,,10
	.p2align 3
.L70:
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L49
	.p2align 4,,10
	.p2align 3
.L69:
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L47
	.p2align 4,,10
	.p2align 3
.L68:
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L45
	.cfi_endproc
.LFE26:
	.size	print_itom, .-print_itom
	.section	.rodata.str1.1
.LC1:
	.string	"%s%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB27:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$56, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 12(%rsp)
	testl	%eax, %eax
	je	.L73
	leaq	28(%rsp), %r12
	leaq	16(%rsp), %rbp
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L74:
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%rbp, %rdi
	call	mtoi
	movq	%r12, %rdi
	movl	%eax, %ebx
	call	mtoi
	leal	(%rbx,%rax), %edi
	call	print_itom
	movl	12(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 12(%rsp)
	testl	%eax, %eax
	jne	.L74
.L73:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L81
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L81:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE27:
	.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 <ctype.h>

int mtoi(char x[]){
	int i,sum=0;

	for(i=0;x[i]!=0;i++){
		if(x[i] == 'm'){
			if(i && isdigit(x[i-1])) sum += (x[i-1] - '0') * 1000;
			else sum += 1000;
		}
		else if(x[i] == 'c'){
			if(i && isdigit(x[i-1])) sum += (x[i-1] - '0') * 100;
			else sum += 100;
		}
		else if(x[i] == 'x'){
			if(i && isdigit(x[i-1])) sum += (x[i-1] - '0') * 10;
			else sum += 10;
		}
		else if(x[i] == 'i'){
			if(i && isdigit(x[i-1])) sum += (x[i-1] - '0');
			else sum += 1;
		}
	}
	return sum;
}

void print_itom(int x){
	int i,d;

	if((d=x/1000) > 0){
		if(d != 1) printf("%d",d);
		printf("m");
	}
	x -= x/1000*1000;
	if((d=x/100) > 0){
		if(d != 1) printf("%d",d);
		printf("c");
	}
	x -= x/100*100;
	if((d=x/10) > 0){
		if(d != 1) printf("%d",d);
		printf("x");
	}
	x -= x/10*10;
	if(x > 0){
		if(x != 1) printf("%d",x);
		printf("i");
	}
	printf("\n");
}

int main(void){
	int n,sum;
	char a[12],b[12];

	scanf("%d",&n);
	while(n--){
		scanf("%s%s",a,b);
		sum = mtoi(a) + mtoi(b);
		print_itom(sum);
	}

	return 0;
}
10
xi x9i
i 9i
c2x2i 5c8x8i
m2ci 4m7c9x8i
9c9x9i i
i 9m9c9x8i
m i
i m
m9i i
9m8c7xi c2x8i
 10
xi x9i
i 9i
c2x2i 5c8x8i
m2ci 4m7c9x8i
9c8x9i i
i 9m9c9x8i
m i
i m
m9i i
9m8c7xi c2x8i
 10
xi x9i
i 9i
c2x2i 5c8x8i
m2ci 3m7c9x8i
9c8x9i i
i 9m9c9x8i
m i
i m
m9i i
9m8c7xi c2x8i
 10
xi x9i
i 9i
c2x2i 5c8x8i
m2ci 4m7c9x8i
9c8x9i i
i 9m9c9x8i
m i
i m
m9i i
9m8cx7i c2x8i
 10
xi x9i
i 8i
c2x2i 5c8x8i
m2ci 4m7c9x8i
9c8x9i i
i 9m9c9x8i
m i
i m
m9i i
9m8cx7i c2x8i
 10
xi x9i
i 9i
c2x2i 5c8x8i
m2ci 4m7c9x8i
9c9x9i i
i 9m9c9x8i
m i
i m
m9i i
9m8c7xi c1x8i
 10
xi x9i
i 9i
c2x2i 4c8x8i
m2ci 4m7c9x8i
9c9x9i i
i 9m9c9x7i
m i
i m
m9i i
9m8c7xi c2x8i
 10
xi x9i
i 9i
c2x2i 5c7x8i
m2ci 3m7c9x8i
9c8x9i i
i 9m9c9x8i
m i
i m
m9i i
9m8c7xi c2x8i
 10
xi x9i
i 9i
c2x2i 5c8x9i
m2ci 4m7c9x8i
9c9x9i i
i 9m9c9x8i
m i
i m
m9i i
9m8c7xi c1x8i
 10
xi x9i
i 9i
c2x2i 4c8x8i
mc2i 4m7c9x8i
9c9x9i i
i 9m9c9x7i
m i
i m
m9i i
9m8c7xi c2x8i

3x
x
7cx
5m9c9x9i
m
9m9c9x9i
mi
mi
mx
9m9c9x9i
 3x
x
7cx
5m9c9x9i
9c9x
9m9c9x9i
mi
mi
mx
9m9c9x9i
 3x
x
7cx
4m9c9x9i
9c9x
9m9c9x9i
mi
mi
mx
9m9c9x9i
 3x
x
7cx
5m9c9x9i
9c9x
9m9c9x9i
mi
mi
mx
9m9c4x5i
 3x
9i
7cx
5m9c9x9i
9c9x
9m9c9x9i
mi
mi
mx
9m9c4x5i
 3x
x
7cx
5m9c9x9i
m
9m9c9x9i
mi
mi
mx
9m9c8x9i
 3x
x
6cx
5m9c9x9i
m
9m9c9x8i
mi
mi
mx
9m9c9x9i
 3x
x
7c
4m9c9x9i
9c9x
9m9c9x9i
mi
mi
mx
9m9c9x9i
 3x
x
7cxi
5m9c9x9i
m
9m9c9x9i
mi
mi
mx
9m9c8x9i
 3x
x
6cx
5m9c
m
9m9c9x8i
mi
mi
mx
9m9c9x9i

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

int mtoi(char x[]){
	int i,sum=0;

	for(i=0;x[i]!=0;i++){
		if(x[i] == 'm'){
			if(i && isdigit(x[i-1])) sum += (x[i-1] - '0') * 1000;
			else sum += 1000;
		}
		else if(x[i] == 'c'){
			if(i && isdigit(x[i-1])) sum += (x[i-1] - '0') * 100;
			else sum += 100;
		}
		else if(x[i] == 'x'){
			if(i && isdigit(x[i-1])) sum += (x[i-1] - '0') * 10;
			else sum += 10;
		}
		else if(x[i] == 'i'){
			if(i && isdigit(x[i-1])) sum += (x[i-1] - '0');
			else sum += 1;
		}
	}
	return sum;
}

void print_itom(int x){
	int i,d;

	if((d=x/1000) > 0){
		if(d != 1) printf("%d",d);
		printf("m");
	}
	x -= x/1000*1000;
	if((d=x/100) > 0){
		if(d != 1) printf("%d",d);
		printf("c");
	}
	x -= x/100*100;
	if((d=x/10) > 0){
		if(d != 1) printf("%d",d);
		printf("x");
	}
	x -= x/10*10;
	if(x > 0){
		if(x != 1) printf("%d",x);
		printf("i");
	}
	printf("\n");
}

int main(void){
	int n,sum;
	char a[12],b[12];

	scanf("%d",&n);
	while(n--){
		scanf("%s%s",a,b);
		sum = mtoi(a) + mtoi(b);
		print_itom(sum);
	}

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	mtoi
	.type	mtoi, @function
mtoi:
.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	$0, -4(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L2
.L14:
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$109, %al
	jne	.L3
	cmpl	$0, -8(%rbp)
	je	.L4
	call	__ctype_b_loc@PLT
	movq	(%rax), %rdx
	movl	-8(%rbp), %eax
	cltq
	leaq	-1(%rax), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	movsbq	%al, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movzwl	(%rax), %eax
	movzwl	%ax, %eax
	andl	$2048, %eax
	testl	%eax, %eax
	je	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	imull	$1000, %eax, %eax
	addl	%eax, -4(%rbp)
	jmp	.L6
.L4:
	addl	$1000, -4(%rbp)
	jmp	.L6
.L3:
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$99, %al
	jne	.L7
	cmpl	$0, -8(%rbp)
	je	.L8
	call	__ctype_b_loc@PLT
	movq	(%rax), %rdx
	movl	-8(%rbp), %eax
	cltq
	leaq	-1(%rax), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	movsbq	%al, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movzwl	(%rax), %eax
	movzwl	%ax, %eax
	andl	$2048, %eax
	testl	%eax, %eax
	je	.L8
	movl	-8(%rbp), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	imull	$100, %eax, %eax
	addl	%eax, -4(%rbp)
	jmp	.L6
.L8:
	addl	$100, -4(%rbp)
	jmp	.L6
.L7:
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$120, %al
	jne	.L10
	cmpl	$0, -8(%rbp)
	je	.L11
	call	__ctype_b_loc@PLT
	movq	(%rax), %rdx
	movl	-8(%rbp), %eax
	cltq
	leaq	-1(%rax), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	movsbq	%al, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movzwl	(%rax), %eax
	movzwl	%ax, %eax
	andl	$2048, %eax
	testl	%eax, %eax
	je	.L11
	movl	-8(%rbp), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	leal	-48(%rax), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	addl	%eax, -4(%rbp)
	jmp	.L6
.L11:
	addl	$10, -4(%rbp)
	jmp	.L6
.L10:
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$105, %al
	jne	.L6
	cmpl	$0, -8(%rbp)
	je	.L13
	call	__ctype_b_loc@PLT
	movq	(%rax), %rdx
	movl	-8(%rbp), %eax
	cltq
	leaq	-1(%rax), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	movsbq	%al, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movzwl	(%rax), %eax
	movzwl	%ax, %eax
	andl	$2048, %eax
	testl	%eax, %eax
	je	.L13
	movl	-8(%rbp), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	addl	%eax, -4(%rbp)
	jmp	.L6
.L13:
	addl	$1, -4(%rbp)
.L6:
	addl	$1, -8(%rbp)
.L2:
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L14
	movl	-4(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	mtoi, .-mtoi
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	print_itom
	.type	print_itom, @function
print_itom:
.LFB1:
	.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
	movl	%edi, -20(%rbp)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$274877907, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$6, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jle	.L17
	cmpl	$1, -4(%rbp)
	je	.L18
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L18:
	movl	$109, %edi
	call	putchar@PLT
.L17:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$274877907, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$6, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$1000, %edx, %edx
	subl	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jle	.L19
	cmpl	$1, -4(%rbp)
	je	.L20
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L20:
	movl	$99, %edi
	call	putchar@PLT
.L19:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$100, %edx, %edx
	subl	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jle	.L21
	cmpl	$1, -4(%rbp)
	je	.L22
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L22:
	movl	$120, %edi
	call	putchar@PLT
.L21:
	movl	-20(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	subl	%eax, %edx
	movl	%edx, -20(%rbp)
	cmpl	$0, -20(%rbp)
	jle	.L23
	cmpl	$1, -20(%rbp)
	je	.L24
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L24:
	movl	$105, %edi
	call	putchar@PLT
.L23:
	movl	$10, %edi
	call	putchar@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	print_itom, .-print_itom
	.section	.rodata
.LC1:
	.string	"%s%s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L26
.L27:
	leaq	-36(%rbp), %rdx
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-48(%rbp), %rax
	movq	%rax, %rdi
	call	mtoi
	movl	%eax, %ebx
	leaq	-36(%rbp), %rax
	movq	%rax, %rdi
	call	mtoi
	addl	%ebx, %eax
	movl	%eax, -52(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, %edi
	call	print_itom
.L26:
	movl	-56(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -56(%rbp)
	testl	%eax, %eax
	jne	.L27
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L29
	call	__stack_chk_fail@PLT
.L29:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	mtoi
	.type	mtoi, @function
mtoi:
.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	$0, -4(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L2
.L14:
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$109, %al
	jne	.L3
	cmpl	$0, -8(%rbp)
	je	.L4
	call	__ctype_b_loc@PLT
	movq	(%rax), %rdx
	movl	-8(%rbp), %eax
	cltq
	leaq	-1(%rax), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	movsbq	%al, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movzwl	(%rax), %eax
	movzwl	%ax, %eax
	andl	$2048, %eax
	testl	%eax, %eax
	je	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	imull	$1000, %eax, %eax
	addl	%eax, -4(%rbp)
	jmp	.L6
.L4:
	addl	$1000, -4(%rbp)
	jmp	.L6
.L3:
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$99, %al
	jne	.L7
	cmpl	$0, -8(%rbp)
	je	.L8
	call	__ctype_b_loc@PLT
	movq	(%rax), %rdx
	movl	-8(%rbp), %eax
	cltq
	leaq	-1(%rax), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	movsbq	%al, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movzwl	(%rax), %eax
	movzwl	%ax, %eax
	andl	$2048, %eax
	testl	%eax, %eax
	je	.L8
	movl	-8(%rbp), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	imull	$100, %eax, %eax
	addl	%eax, -4(%rbp)
	jmp	.L6
.L8:
	addl	$100, -4(%rbp)
	jmp	.L6
.L7:
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$120, %al
	jne	.L10
	cmpl	$0, -8(%rbp)
	je	.L11
	call	__ctype_b_loc@PLT
	movq	(%rax), %rdx
	movl	-8(%rbp), %eax
	cltq
	leaq	-1(%rax), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	movsbq	%al, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movzwl	(%rax), %eax
	movzwl	%ax, %eax
	andl	$2048, %eax
	testl	%eax, %eax
	je	.L11
	movl	-8(%rbp), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	leal	-48(%rax), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	addl	%eax, -4(%rbp)
	jmp	.L6
.L11:
	addl	$10, -4(%rbp)
	jmp	.L6
.L10:
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$105, %al
	jne	.L6
	cmpl	$0, -8(%rbp)
	je	.L13
	call	__ctype_b_loc@PLT
	movq	(%rax), %rdx
	movl	-8(%rbp), %eax
	cltq
	leaq	-1(%rax), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	movsbq	%al, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movzwl	(%rax), %eax
	movzwl	%ax, %eax
	andl	$2048, %eax
	testl	%eax, %eax
	je	.L13
	movl	-8(%rbp), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	addl	%eax, -4(%rbp)
	jmp	.L6
.L13:
	addl	$1, -4(%rbp)
.L6:
	addl	$1, -8(%rbp)
.L2:
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L14
	movl	-4(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	mtoi, .-mtoi
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	print_itom
	.type	print_itom, @function
print_itom:
.LFB1:
	.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
	movl	%edi, -20(%rbp)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$274877907, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$6, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jle	.L17
	cmpl	$1, -4(%rbp)
	je	.L18
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L18:
	movl	$109, %edi
	call	putchar@PLT
.L17:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$274877907, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$6, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$1000, %edx, %edx
	subl	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jle	.L19
	cmpl	$1, -4(%rbp)
	je	.L20
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L20:
	movl	$99, %edi
	call	putchar@PLT
.L19:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$100, %edx, %edx
	subl	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jle	.L21
	cmpl	$1, -4(%rbp)
	je	.L22
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L22:
	movl	$120, %edi
	call	putchar@PLT
.L21:
	movl	-20(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	subl	%eax, %edx
	movl	%edx, -20(%rbp)
	cmpl	$0, -20(%rbp)
	jle	.L23
	cmpl	$1, -20(%rbp)
	je	.L24
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L24:
	movl	$105, %edi
	call	putchar@PLT
.L23:
	movl	$10, %edi
	call	putchar@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	print_itom, .-print_itom
	.section	.rodata
.LC1:
	.string	"%s%s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L26
.L27:
	leaq	-36(%rbp), %rdx
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-48(%rbp), %rax
	movq	%rax, %rdi
	call	mtoi
	movl	%eax, %ebx
	leaq	-36(%rbp), %rax
	movq	%rax, %rdi
	call	mtoi
	addl	%ebx, %eax
	movl	%eax, -52(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, %edi
	call	print_itom
.L26:
	movl	-56(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -56(%rbp)
	testl	%eax, %eax
	jne	.L27
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L29
	call	__stack_chk_fail@PLT
.L29:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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:
