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

```c
u[];main(c){char*x,*y,*z;for(;c=scanf("%s%s%s",x=u,y=u+14,z=u+28)/2;puts(y))for(c=*y++;c-*z&&putchar(c),*z;)c=c==*z?++z,*x++:*y++;}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	u
	.bss
	.align 4
	.type	u, @object
	.size	u, 4
u:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%s%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	$48, %rsp
	movl	%edi, -36(%rbp)
	jmp	.L2
.L9:
	movq	-16(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, -16(%rbp)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, -36(%rbp)
	jmp	.L3
.L8:
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	cmpl	%eax, -36(%rbp)
	jne	.L4
	addq	$1, -8(%rbp)
	movq	-24(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, -24(%rbp)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	jmp	.L5
.L4:
	movq	-16(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, -16(%rbp)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
.L5:
	movl	%eax, -36(%rbp)
.L3:
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	cmpl	%eax, -36(%rbp)
	je	.L7
	movl	-36(%rbp), %eax
	movl	%eax, %edi
	call	putchar@PLT
	testl	%eax, %eax
.L7:
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L8
	movq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L2:
	leaq	112+u(%rip), %rax
	movq	%rax, -8(%rbp)
	leaq	56+u(%rip), %rax
	movq	%rax, -16(%rbp)
	leaq	u(%rip), %rax
	movq	%rax, -24(%rbp)
	movq	-8(%rbp), %rcx
	movq	-16(%rbp), %rdx
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -36(%rbp)
	cmpl	$0, -36(%rbp)
	jne	.L9
	movl	$0, %eax
	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%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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
	leaq	112+u(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-112(%rbp), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbp, %rcx
	leaq	-56(%rbp), %rdx
	movq	%rbx, %rsi
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rdi
	call	scanf@PLT
	addl	$1, %eax
	cmpl	$2, %eax
	jbe	.L14
	leaq	112+u(%rip), %r13
	movsbl	56+u(%rip), %r15d
	movzbl	0(%rbp), %eax
	movq	%rbx, %r12
	leaq	-55(%r13), %r14
.L3:
	movsbl	%al, %edx
	cmpl	%r15d, %edx
	je	.L6
.L15:
	movl	%r15d, %edi
	call	putchar@PLT
	movzbl	0(%r13), %eax
	testb	%al, %al
	je	.L10
	movsbl	%al, %edx
	cmpl	%r15d, %edx
	je	.L9
	movsbl	(%r14), %r15d
	movsbl	%al, %edx
	addq	$1, %r14
	cmpl	%r15d, %edx
	jne	.L15
.L6:
	testb	%al, %al
	je	.L10
.L9:
	movsbl	(%r12), %r15d
	addq	$1, %r13
	addq	$1, %r12
	movzbl	0(%r13), %eax
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%r14, %rdi
	call	puts@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L14:
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	u
	.bss
	.align 4
	.type	u, @object
	.size	u, 4
u:
	.zero	4
	.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%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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
	leaq	112+u(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-112(%rbp), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbp, %rcx
	leaq	-56(%rbp), %rdx
	movq	%rbx, %rsi
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rdi
	call	scanf@PLT
	addl	$1, %eax
	cmpl	$2, %eax
	jbe	.L14
	leaq	112+u(%rip), %r13
	movsbl	56+u(%rip), %r15d
	movzbl	0(%rbp), %eax
	movq	%rbx, %r12
	leaq	-55(%r13), %r14
.L3:
	movsbl	%al, %edx
	cmpl	%r15d, %edx
	je	.L6
.L15:
	movl	%r15d, %edi
	call	putchar@PLT
	movzbl	0(%r13), %eax
	testb	%al, %al
	je	.L10
	movsbl	%al, %edx
	cmpl	%r15d, %edx
	je	.L9
	movsbl	(%r14), %r15d
	movsbl	%al, %edx
	addq	$1, %r14
	cmpl	%r15d, %edx
	jne	.L15
.L6:
	testb	%al, %al
	je	.L10
.L9:
	movsbl	(%r12), %r15d
	addq	$1, %r13
	addq	$1, %r12
	movzbl	0(%r13), %eax
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%r14, %rdi
	call	puts@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L14:
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	u
	.bss
	.align 4
	.type	u, @object
	.size	u, 4
u:
	.zero	4
	.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:

u[];main(c){char*x,*y,*z;for(;c=scanf("%s%s%s",x=u,y=u+14,z=u+28)/2;puts(y))for(c=*y++;c-*z&&putchar(c),*z;)c=c==*z?++z,*x++:*y++;}
CBA
cba
cCa
X
YZ
Z
-
 CBA
cba
cCa
Y
YZ
Z
-
 CBA
cca
cCa
X
ZY
Z
-
 CAB
cba
cCa
X
YZ
Z
-
 CAB
cca
cCa
X
YZ
Z
-
 CAA
cca
cCa
X
YZ
Z
-
 CBA
abc
aCc
X
ZY
Z
-
 CBA
cba
cCa
X
XZ
Z
-
 CBB
cca
cCa
X
ZY
Z
-
 CAB
cba
cCa
X
ZY
Z
-

BbA
YX
 BbA
YY
 BcA
XY
 AbB
YX
 AcB
YX
 AcA
YX
 BbA
XY
 BbA
XX
 BcB
XY
 AbB
XY

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

```c
u[];main(c){char*x,*y,*z;for(;c=scanf("%s%s%s",x=u,y=u+14,z=u+28)/2;puts(y))for(c=*y++;c-*z&&putchar(c),*z;)c=c==*z?++z,*x++:*y++;}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	u
	.bss
	.align 4
	.type	u, @object
	.size	u, 4
u:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%s%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	$48, %rsp
	movl	%edi, -36(%rbp)
	jmp	.L2
.L9:
	movq	-16(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, -16(%rbp)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, -36(%rbp)
	jmp	.L3
.L8:
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	cmpl	%eax, -36(%rbp)
	jne	.L4
	addq	$1, -8(%rbp)
	movq	-24(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, -24(%rbp)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	jmp	.L5
.L4:
	movq	-16(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, -16(%rbp)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
.L5:
	movl	%eax, -36(%rbp)
.L3:
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	cmpl	%eax, -36(%rbp)
	je	.L7
	movl	-36(%rbp), %eax
	movl	%eax, %edi
	call	putchar@PLT
	testl	%eax, %eax
.L7:
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L8
	movq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L2:
	leaq	112+u(%rip), %rax
	movq	%rax, -8(%rbp)
	leaq	56+u(%rip), %rax
	movq	%rax, -16(%rbp)
	leaq	u(%rip), %rax
	movq	%rax, -24(%rbp)
	movq	-8(%rbp), %rcx
	movq	-16(%rbp), %rdx
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -36(%rbp)
	cmpl	$0, -36(%rbp)
	jne	.L9
	movl	$0, %eax
	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
	.globl	u
	.bss
	.align 4
	.type	u, @object
	.size	u, 4
u:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%s%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	$48, %rsp
	movl	%edi, -36(%rbp)
	jmp	.L2
.L9:
	movq	-16(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, -16(%rbp)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, -36(%rbp)
	jmp	.L3
.L8:
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	cmpl	%eax, -36(%rbp)
	jne	.L4
	addq	$1, -8(%rbp)
	movq	-24(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, -24(%rbp)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	jmp	.L5
.L4:
	movq	-16(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, -16(%rbp)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
.L5:
	movl	%eax, -36(%rbp)
.L3:
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	cmpl	%eax, -36(%rbp)
	je	.L7
	movl	-36(%rbp), %eax
	movl	%eax, %edi
	call	putchar@PLT
	testl	%eax, %eax
.L7:
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L8
	movq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L2:
	leaq	112+u(%rip), %rax
	movq	%rax, -8(%rbp)
	leaq	56+u(%rip), %rax
	movq	%rax, -16(%rbp)
	leaq	u(%rip), %rax
	movq	%rax, -24(%rbp)
	movq	-8(%rbp), %rcx
	movq	-16(%rbp), %rdx
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -36(%rbp)
	cmpl	$0, -36(%rbp)
	jne	.L9
	movl	$0, %eax
	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:
