Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
#include<string.h>
int main(void){
    char s[4],t[4];
    scanf("%s%s",s,t);
    if(strcmp(s,t)==0)
    printf("3");
    else if(strncmp(s,t,2)==0||(s[0]==t[0]&&s[2]==t[2])||(s[1]==t[1]&&s[2]==t[2]))
    printf("2");
    else if(s[0]==t[0]||s[1]==t[1]||s[2]==t[2])
    printf("1");
    else
    { printf("0");}
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s%s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-12(%rbp), %rdx
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-12(%rbp), %rdx
	leaq	-16(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L2
	movl	$51, %edi
	call	putchar@PLT
	jmp	.L3
.L2:
	leaq	-12(%rbp), %rcx
	leaq	-16(%rbp), %rax
	movl	$2, %edx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	strncmp@PLT
	testl	%eax, %eax
	je	.L4
	movzbl	-16(%rbp), %edx
	movzbl	-12(%rbp), %eax
	cmpb	%al, %dl
	jne	.L5
	movzbl	-14(%rbp), %edx
	movzbl	-10(%rbp), %eax
	cmpb	%al, %dl
	je	.L4
.L5:
	movzbl	-15(%rbp), %edx
	movzbl	-11(%rbp), %eax
	cmpb	%al, %dl
	jne	.L6
	movzbl	-14(%rbp), %edx
	movzbl	-10(%rbp), %eax
	cmpb	%al, %dl
	jne	.L6
.L4:
	movl	$50, %edi
	call	putchar@PLT
	jmp	.L3
.L6:
	movzbl	-16(%rbp), %edx
	movzbl	-12(%rbp), %eax
	cmpb	%al, %dl
	je	.L7
	movzbl	-15(%rbp), %edx
	movzbl	-11(%rbp), %eax
	cmpb	%al, %dl
	je	.L7
	movzbl	-14(%rbp), %edx
	movzbl	-10(%rbp), %eax
	cmpb	%al, %dl
	jne	.L8
.L7:
	movl	$49, %edi
	call	putchar@PLT
	jmp	.L3
.L8:
	movl	$48, %edi
	call	putchar@PLT
.L3:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	subq	$24, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %r12
	movq	%rsp, %rbp
	movq	%rbp, %rsi
	movq	%r12, %rdx
	call	__isoc99_scanf@PLT
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	je	.L19
	movl	$2, %edx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	strncmp@PLT
	testl	%eax, %eax
	je	.L4
	movzbl	2(%rsp), %edx
	movzbl	6(%rsp), %eax
	movzbl	4(%rsp), %ecx
	cmpb	%cl, (%rsp)
	je	.L8
	movzbl	1(%rsp), %ecx
	cmpb	%cl, 5(%rsp)
	je	.L8
	cmpb	%dl, %al
	je	.L6
	movl	$48, %edi
	call	putchar@PLT
	jmp	.L3
.L4:
	movl	$50, %edi
	call	putchar@PLT
.L3:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L19:
	.cfi_restore_state
	movl	$51, %edi
	call	putchar@PLT
	jmp	.L3
.L8:
	cmpb	%dl, %al
	je	.L4
.L6:
	movl	$49, %edi
	call	putchar@PLT
	jmp	.L3
.L20:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	subq	$24, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %r12
	movq	%rsp, %rbp
	movq	%rbp, %rsi
	movq	%r12, %rdx
	call	__isoc99_scanf@PLT
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	je	.L19
	movl	$2, %edx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	strncmp@PLT
	testl	%eax, %eax
	je	.L4
	movzbl	2(%rsp), %edx
	movzbl	6(%rsp), %eax
	movzbl	4(%rsp), %ecx
	cmpb	%cl, (%rsp)
	je	.L8
	movzbl	1(%rsp), %ecx
	cmpb	%cl, 5(%rsp)
	je	.L8
	cmpb	%dl, %al
	je	.L6
	movl	$48, %edi
	call	putchar@PLT
	jmp	.L3
.L4:
	movl	$50, %edi
	call	putchar@PLT
.L3:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L19:
	.cfi_restore_state
	movl	$51, %edi
	call	putchar@PLT
	jmp	.L3
.L8:
	cmpb	%dl, %al
	je	.L4
.L6:
	movl	$49, %edi
	call	putchar@PLT
	jmp	.L3
.L20:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include<stdio.h>
#include<string.h>
int main(void){
    char s[4],t[4];
    scanf("%s%s",s,t);
    if(strcmp(s,t)==0)
    printf("3");
    else if(strncmp(s,t,2)==0||(s[0]==t[0]&&s[2]==t[2])||(s[1]==t[1]&&s[2]==t[2]))
    printf("2");
    else if(s[0]==t[0]||s[1]==t[1]||s[2]==t[2])
    printf("1");
    else
    { printf("0");}
    return 0;
}
CSS
BSR
 SRR
SSR
 SSR
RTS
 STR
STR
 RSR
SSS
 SSC
BSR
 RSR
SSR
 SSR
RSS
 SSC
RSB
 RTR
SSR

1 2 0 3 1 1 2 1 1 1
Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
#include<string.h>
int main(void){
    char s[4],t[4];
    scanf("%s%s",s,t);
    if(strcmp(s,t)==0)
    printf("3");
    else if(strncmp(s,t,2)==0||(s[0]==t[0]&&s[2]==t[2])||(s[1]==t[1]&&s[2]==t[2]))
    printf("2");
    else if(s[0]==t[0]||s[1]==t[1]||s[2]==t[2])
    printf("1");
    else
    { printf("0");}
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s%s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-12(%rbp), %rdx
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-12(%rbp), %rdx
	leaq	-16(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L2
	movl	$51, %edi
	call	putchar@PLT
	jmp	.L3
.L2:
	leaq	-12(%rbp), %rcx
	leaq	-16(%rbp), %rax
	movl	$2, %edx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	strncmp@PLT
	testl	%eax, %eax
	je	.L4
	movzbl	-16(%rbp), %edx
	movzbl	-12(%rbp), %eax
	cmpb	%al, %dl
	jne	.L5
	movzbl	-14(%rbp), %edx
	movzbl	-10(%rbp), %eax
	cmpb	%al, %dl
	je	.L4
.L5:
	movzbl	-15(%rbp), %edx
	movzbl	-11(%rbp), %eax
	cmpb	%al, %dl
	jne	.L6
	movzbl	-14(%rbp), %edx
	movzbl	-10(%rbp), %eax
	cmpb	%al, %dl
	jne	.L6
.L4:
	movl	$50, %edi
	call	putchar@PLT
	jmp	.L3
.L6:
	movzbl	-16(%rbp), %edx
	movzbl	-12(%rbp), %eax
	cmpb	%al, %dl
	je	.L7
	movzbl	-15(%rbp), %edx
	movzbl	-11(%rbp), %eax
	cmpb	%al, %dl
	je	.L7
	movzbl	-14(%rbp), %edx
	movzbl	-10(%rbp), %eax
	cmpb	%al, %dl
	jne	.L8
.L7:
	movl	$49, %edi
	call	putchar@PLT
	jmp	.L3
.L8:
	movl	$48, %edi
	call	putchar@PLT
.L3:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s%s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-12(%rbp), %rdx
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-12(%rbp), %rdx
	leaq	-16(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L2
	movl	$51, %edi
	call	putchar@PLT
	jmp	.L3
.L2:
	leaq	-12(%rbp), %rcx
	leaq	-16(%rbp), %rax
	movl	$2, %edx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	strncmp@PLT
	testl	%eax, %eax
	je	.L4
	movzbl	-16(%rbp), %edx
	movzbl	-12(%rbp), %eax
	cmpb	%al, %dl
	jne	.L5
	movzbl	-14(%rbp), %edx
	movzbl	-10(%rbp), %eax
	cmpb	%al, %dl
	je	.L4
.L5:
	movzbl	-15(%rbp), %edx
	movzbl	-11(%rbp), %eax
	cmpb	%al, %dl
	jne	.L6
	movzbl	-14(%rbp), %edx
	movzbl	-10(%rbp), %eax
	cmpb	%al, %dl
	jne	.L6
.L4:
	movl	$50, %edi
	call	putchar@PLT
	jmp	.L3
.L6:
	movzbl	-16(%rbp), %edx
	movzbl	-12(%rbp), %eax
	cmpb	%al, %dl
	je	.L7
	movzbl	-15(%rbp), %edx
	movzbl	-11(%rbp), %eax
	cmpb	%al, %dl
	je	.L7
	movzbl	-14(%rbp), %edx
	movzbl	-10(%rbp), %eax
	cmpb	%al, %dl
	jne	.L8
.L7:
	movl	$49, %edi
	call	putchar@PLT
	jmp	.L3
.L8:
	movl	$48, %edi
	call	putchar@PLT
.L3:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
