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>
int main(void)
{
	int i,j,k,d,S[6],T[6],C[6];
	int Dice[6][6]={{1,2,3,5,4,6},
					{2,6,3,1,4,5},
					{3,6,5,1,2,4},
					{4,6,2,1,5,3},
					{5,6,4,1,3,2},
					{6,5,3,2,4,1}};
	for(i=0;i<6;i++){scanf("%d",&S[i]);}
	for(i=0;i<6;i++){scanf("%d",&T[i]);}
	for(i=0;i<6;i++)
	{
		for(j=0;j<4;j++)
		{
			for(k=0;k<4;k++){C[k+1]=T[Dice[i][(j+k)%4+1]-1];}
			C[0]=T[Dice[i][0]-1];C[5]=T[Dice[i][5]-1];
			for(d=0,k=0;k<6;k++)
			{
				if(S[Dice[0][k]-1]==C[k])d+=1;
			}
			if(d==6)break;
		}
		if(d==6)break;
	}
	if(d==6){printf("Yes\n");}
	else{printf("No\n");}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"Yes"
.LC2:
	.string	"No"
	.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	$272, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1, -160(%rbp)
	movl	$2, -156(%rbp)
	movl	$3, -152(%rbp)
	movl	$5, -148(%rbp)
	movl	$4, -144(%rbp)
	movl	$6, -140(%rbp)
	movl	$2, -136(%rbp)
	movl	$6, -132(%rbp)
	movl	$3, -128(%rbp)
	movl	$1, -124(%rbp)
	movl	$4, -120(%rbp)
	movl	$5, -116(%rbp)
	movl	$3, -112(%rbp)
	movl	$6, -108(%rbp)
	movl	$5, -104(%rbp)
	movl	$1, -100(%rbp)
	movl	$2, -96(%rbp)
	movl	$4, -92(%rbp)
	movl	$4, -88(%rbp)
	movl	$6, -84(%rbp)
	movl	$2, -80(%rbp)
	movl	$1, -76(%rbp)
	movl	$5, -72(%rbp)
	movl	$3, -68(%rbp)
	movl	$5, -64(%rbp)
	movl	$6, -60(%rbp)
	movl	$4, -56(%rbp)
	movl	$1, -52(%rbp)
	movl	$3, -48(%rbp)
	movl	$2, -44(%rbp)
	movl	$6, -40(%rbp)
	movl	$5, -36(%rbp)
	movl	$3, -32(%rbp)
	movl	$2, -28(%rbp)
	movl	$4, -24(%rbp)
	movl	$1, -20(%rbp)
	movl	$0, -272(%rbp)
	jmp	.L2
.L3:
	leaq	-256(%rbp), %rdx
	movl	-272(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -272(%rbp)
.L2:
	cmpl	$5, -272(%rbp)
	jle	.L3
	movl	$0, -272(%rbp)
	jmp	.L4
.L5:
	leaq	-224(%rbp), %rdx
	movl	-272(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -272(%rbp)
.L4:
	cmpl	$5, -272(%rbp)
	jle	.L5
	movl	$0, -272(%rbp)
	jmp	.L6
.L18:
	movl	$0, -268(%rbp)
	jmp	.L7
.L15:
	movl	$0, -264(%rbp)
	jmp	.L8
.L9:
	movl	-268(%rbp), %edx
	movl	-264(%rbp), %eax
	addl	%edx, %eax
	cltd
	shrl	$30, %edx
	addl	%edx, %eax
	andl	$3, %eax
	subl	%edx, %eax
	addl	$1, %eax
	movslq	%eax, %rcx
	movl	-272(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-160(%rbp,%rax,4), %eax
	leal	-1(%rax), %edx
	movl	-264(%rbp), %eax
	leal	1(%rax), %ecx
	movslq	%edx, %rax
	movl	-224(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -192(%rbp,%rax,4)
	addl	$1, -264(%rbp)
.L8:
	cmpl	$3, -264(%rbp)
	jle	.L9
	movl	-272(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rbp, %rax
	subq	$160, %rax
	movl	(%rax), %eax
	subl	$1, %eax
	cltq
	movl	-224(%rbp,%rax,4), %eax
	movl	%eax, -192(%rbp)
	movl	-272(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rbp, %rax
	subq	$140, %rax
	movl	(%rax), %eax
	subl	$1, %eax
	cltq
	movl	-224(%rbp,%rax,4), %eax
	movl	%eax, -172(%rbp)
	movl	$0, -260(%rbp)
	movl	$0, -264(%rbp)
	jmp	.L10
.L12:
	movl	-264(%rbp), %eax
	cltq
	movl	-160(%rbp,%rax,4), %eax
	subl	$1, %eax
	cltq
	movl	-256(%rbp,%rax,4), %edx
	movl	-264(%rbp), %eax
	cltq
	movl	-192(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L11
	addl	$1, -260(%rbp)
.L11:
	addl	$1, -264(%rbp)
.L10:
	cmpl	$5, -264(%rbp)
	jle	.L12
	cmpl	$6, -260(%rbp)
	je	.L23
	addl	$1, -268(%rbp)
.L7:
	cmpl	$3, -268(%rbp)
	jle	.L15
	jmp	.L14
.L23:
	nop
.L14:
	cmpl	$6, -260(%rbp)
	je	.L24
	addl	$1, -272(%rbp)
.L6:
	cmpl	$5, -272(%rbp)
	jle	.L18
	jmp	.L17
.L24:
	nop
.L17:
	cmpl	$6, -260(%rbp)
	jne	.L19
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L20
.L19:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L20:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	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
.LC9:
	.string	"%d"
.LC10:
	.string	"Yes"
.LC11:
	.string	"No"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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	.LC9(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$248, %rsp
	.cfi_def_cfa_offset 304
	movdqa	.LC0(%rip), %xmm0
	movq	%fs:40, %rax
	movq	%rax, 232(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbx
	leaq	40(%rsp), %r12
	movaps	%xmm0, 80(%rsp)
	movdqa	.LC1(%rip), %xmm0
	movaps	%xmm0, 96(%rsp)
	movdqa	.LC2(%rip), %xmm0
	movaps	%xmm0, 112(%rsp)
	movdqa	.LC3(%rip), %xmm0
	movaps	%xmm0, 128(%rsp)
	movdqa	.LC4(%rip), %xmm0
	movaps	%xmm0, 144(%rsp)
	movdqa	.LC5(%rip), %xmm0
	movaps	%xmm0, 160(%rsp)
	movdqa	.LC6(%rip), %xmm0
	movaps	%xmm0, 176(%rsp)
	movdqa	.LC7(%rip), %xmm0
	movaps	%xmm0, 192(%rsp)
	movdqa	.LC8(%rip), %xmm0
	movaps	%xmm0, 208(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%rbx, %r12
	jne	.L2
	leaq	48(%rsp), %rbx
	leaq	72(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%rbx, %r12
	jne	.L3
	leaq	224(%rsp), %rax
	movl	16(%rsp), %r14d
	movl	20(%rsp), %ebp
	leaq	80(%rsp), %rdx
	movl	24(%rsp), %ebx
	movl	32(%rsp), %r11d
	movq	%rax, 8(%rsp)
	movl	28(%rsp), %r10d
	movl	36(%rsp), %r13d
.L4:
	movl	4(%rdx), %eax
	subl	$1, %eax
	cltq
	movl	48(%rsp,%rax,4), %r8d
	movl	8(%rdx), %eax
	subl	$1, %eax
	cltq
	movl	48(%rsp,%rax,4), %edi
	movl	12(%rdx), %eax
	subl	$1, %eax
	cltq
	movl	48(%rsp,%rax,4), %esi
	movl	16(%rdx), %eax
	subl	$1, %eax
	cltq
	movl	48(%rsp,%rax,4), %r9d
	movl	20(%rdx), %eax
	subl	$1, %eax
	cltq
	movl	48(%rsp,%rax,4), %r12d
	movl	(%rdx), %eax
	subl	$1, %eax
	cltq
	cmpl	%r14d, 48(%rsp,%rax,4)
	sete	%al
	xorl	%ecx, %ecx
	cmpl	%ebp, %r8d
	sete	%cl
	movzbl	%al, %eax
	xorl	%r15d, %r15d
	addl	%eax, %ecx
	cmpl	%ebx, %edi
	sete	%r15b
	addl	%r15d, %ecx
	xorl	%r15d, %r15d
	cmpl	%r11d, %esi
	sete	%r15b
	addl	%r15d, %ecx
	cmpl	%r10d, %r9d
	je	.L45
.L9:
	xorl	%ecx, %ecx
	cmpl	%ebp, %edi
	sete	%cl
	xorl	%r15d, %r15d
	addl	%eax, %ecx
	cmpl	%ebx, %esi
	sete	%r15b
	addl	%r15d, %ecx
	xorl	%r15d, %r15d
	cmpl	%r11d, %r9d
	sete	%r15b
	addl	%r15d, %ecx
	cmpl	%r10d, %r8d
	je	.L46
.L14:
	xorl	%ecx, %ecx
	cmpl	%ebp, %esi
	sete	%cl
	xorl	%r15d, %r15d
	addl	%eax, %ecx
	cmpl	%ebx, %r9d
	sete	%r15b
	addl	%r15d, %ecx
	xorl	%r15d, %r15d
	cmpl	%r11d, %r8d
	sete	%r15b
	addl	%r15d, %ecx
	cmpl	%r10d, %edi
	je	.L47
.L18:
	xorl	%ecx, %ecx
	cmpl	%ebp, %r9d
	sete	%cl
	addl	%ecx, %eax
	xorl	%ecx, %ecx
	cmpl	%ebx, %r8d
	sete	%cl
	addl	%ecx, %eax
	xorl	%ecx, %ecx
	cmpl	%r11d, %edi
	sete	%cl
	addl	%ecx, %eax
	cmpl	%r10d, %esi
	je	.L48
.L22:
	addq	$24, %rdx
	cmpq	%rdx, 8(%rsp)
	jne	.L4
	leaq	.LC11(%rip), %rdi
	call	puts@PLT
.L23:
	movq	232(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L49
	addq	$248, %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
.L45:
	.cfi_restore_state
	cmpl	%r12d, %r13d
	jne	.L9
	cmpl	$4, %ecx
	jne	.L9
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L46:
	cmpl	%r12d, %r13d
	jne	.L14
	cmpl	$4, %ecx
	jne	.L14
.L10:
	leaq	.LC10(%rip), %rdi
	call	puts@PLT
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L47:
	cmpl	%r12d, %r13d
	jne	.L18
	cmpl	$4, %ecx
	jne	.L18
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L48:
	cmpl	%r12d, %r13d
	jne	.L22
	cmpl	$4, %eax
	jne	.L22
	jmp	.L10
.L49:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	2
	.long	3
	.long	5
	.align 16
.LC1:
	.long	4
	.long	6
	.long	2
	.long	6
	.align 16
.LC2:
	.long	3
	.long	1
	.long	4
	.long	5
	.align 16
.LC3:
	.long	3
	.long	6
	.long	5
	.long	1
	.align 16
.LC4:
	.long	2
	.long	4
	.long	4
	.long	6
	.align 16
.LC5:
	.long	2
	.long	1
	.long	5
	.long	3
	.align 16
.LC6:
	.long	5
	.long	6
	.long	4
	.long	1
	.align 16
.LC7:
	.long	3
	.long	2
	.long	6
	.long	5
	.align 16
.LC8:
	.long	3
	.long	2
	.long	4
	.long	1
	.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
.LC9:
	.string	"%d"
.LC10:
	.string	"Yes"
.LC11:
	.string	"No"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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	.LC9(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$248, %rsp
	.cfi_def_cfa_offset 304
	movdqa	.LC0(%rip), %xmm0
	movq	%fs:40, %rax
	movq	%rax, 232(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbx
	leaq	40(%rsp), %r12
	movaps	%xmm0, 80(%rsp)
	movdqa	.LC1(%rip), %xmm0
	movaps	%xmm0, 96(%rsp)
	movdqa	.LC2(%rip), %xmm0
	movaps	%xmm0, 112(%rsp)
	movdqa	.LC3(%rip), %xmm0
	movaps	%xmm0, 128(%rsp)
	movdqa	.LC4(%rip), %xmm0
	movaps	%xmm0, 144(%rsp)
	movdqa	.LC5(%rip), %xmm0
	movaps	%xmm0, 160(%rsp)
	movdqa	.LC6(%rip), %xmm0
	movaps	%xmm0, 176(%rsp)
	movdqa	.LC7(%rip), %xmm0
	movaps	%xmm0, 192(%rsp)
	movdqa	.LC8(%rip), %xmm0
	movaps	%xmm0, 208(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%rbx, %r12
	jne	.L2
	leaq	48(%rsp), %rbx
	leaq	72(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%rbx, %r12
	jne	.L3
	leaq	224(%rsp), %rax
	movl	16(%rsp), %r14d
	movl	20(%rsp), %ebp
	leaq	80(%rsp), %rdx
	movl	24(%rsp), %ebx
	movl	32(%rsp), %r11d
	movq	%rax, 8(%rsp)
	movl	28(%rsp), %r10d
	movl	36(%rsp), %r13d
.L4:
	movl	4(%rdx), %eax
	subl	$1, %eax
	cltq
	movl	48(%rsp,%rax,4), %r8d
	movl	8(%rdx), %eax
	subl	$1, %eax
	cltq
	movl	48(%rsp,%rax,4), %edi
	movl	12(%rdx), %eax
	subl	$1, %eax
	cltq
	movl	48(%rsp,%rax,4), %esi
	movl	16(%rdx), %eax
	subl	$1, %eax
	cltq
	movl	48(%rsp,%rax,4), %r9d
	movl	20(%rdx), %eax
	subl	$1, %eax
	cltq
	movl	48(%rsp,%rax,4), %r12d
	movl	(%rdx), %eax
	subl	$1, %eax
	cltq
	cmpl	%r14d, 48(%rsp,%rax,4)
	sete	%al
	xorl	%ecx, %ecx
	cmpl	%ebp, %r8d
	sete	%cl
	movzbl	%al, %eax
	xorl	%r15d, %r15d
	addl	%eax, %ecx
	cmpl	%ebx, %edi
	sete	%r15b
	addl	%r15d, %ecx
	xorl	%r15d, %r15d
	cmpl	%r11d, %esi
	sete	%r15b
	addl	%r15d, %ecx
	cmpl	%r10d, %r9d
	je	.L45
.L9:
	xorl	%ecx, %ecx
	cmpl	%ebp, %edi
	sete	%cl
	xorl	%r15d, %r15d
	addl	%eax, %ecx
	cmpl	%ebx, %esi
	sete	%r15b
	addl	%r15d, %ecx
	xorl	%r15d, %r15d
	cmpl	%r11d, %r9d
	sete	%r15b
	addl	%r15d, %ecx
	cmpl	%r10d, %r8d
	je	.L46
.L14:
	xorl	%ecx, %ecx
	cmpl	%ebp, %esi
	sete	%cl
	xorl	%r15d, %r15d
	addl	%eax, %ecx
	cmpl	%ebx, %r9d
	sete	%r15b
	addl	%r15d, %ecx
	xorl	%r15d, %r15d
	cmpl	%r11d, %r8d
	sete	%r15b
	addl	%r15d, %ecx
	cmpl	%r10d, %edi
	je	.L47
.L18:
	xorl	%ecx, %ecx
	cmpl	%ebp, %r9d
	sete	%cl
	addl	%ecx, %eax
	xorl	%ecx, %ecx
	cmpl	%ebx, %r8d
	sete	%cl
	addl	%ecx, %eax
	xorl	%ecx, %ecx
	cmpl	%r11d, %edi
	sete	%cl
	addl	%ecx, %eax
	cmpl	%r10d, %esi
	je	.L48
.L22:
	addq	$24, %rdx
	cmpq	%rdx, 8(%rsp)
	jne	.L4
	leaq	.LC11(%rip), %rdi
	call	puts@PLT
.L23:
	movq	232(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L49
	addq	$248, %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
.L45:
	.cfi_restore_state
	cmpl	%r12d, %r13d
	jne	.L9
	cmpl	$4, %ecx
	jne	.L9
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L46:
	cmpl	%r12d, %r13d
	jne	.L14
	cmpl	$4, %ecx
	jne	.L14
.L10:
	leaq	.LC10(%rip), %rdi
	call	puts@PLT
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L47:
	cmpl	%r12d, %r13d
	jne	.L18
	cmpl	$4, %ecx
	jne	.L18
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L48:
	cmpl	%r12d, %r13d
	jne	.L22
	cmpl	$4, %eax
	jne	.L22
	jmp	.L10
.L49:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	2
	.long	3
	.long	5
	.align 16
.LC1:
	.long	4
	.long	6
	.long	2
	.long	6
	.align 16
.LC2:
	.long	3
	.long	1
	.long	4
	.long	5
	.align 16
.LC3:
	.long	3
	.long	6
	.long	5
	.long	1
	.align 16
.LC4:
	.long	2
	.long	4
	.long	4
	.long	6
	.align 16
.LC5:
	.long	2
	.long	1
	.long	5
	.long	3
	.align 16
.LC6:
	.long	5
	.long	6
	.long	4
	.long	1
	.align 16
.LC7:
	.long	3
	.long	2
	.long	6
	.long	5
	.align 16
.LC8:
	.long	3
	.long	2
	.long	4
	.long	1
	.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>
int main(void)
{
	int i,j,k,d,S[6],T[6],C[6];
	int Dice[6][6]={{1,2,3,5,4,6},
					{2,6,3,1,4,5},
					{3,6,5,1,2,4},
					{4,6,2,1,5,3},
					{5,6,4,1,3,2},
					{6,5,3,2,4,1}};
	for(i=0;i<6;i++){scanf("%d",&S[i]);}
	for(i=0;i<6;i++){scanf("%d",&T[i]);}
	for(i=0;i<6;i++)
	{
		for(j=0;j<4;j++)
		{
			for(k=0;k<4;k++){C[k+1]=T[Dice[i][(j+k)%4+1]-1];}
			C[0]=T[Dice[i][0]-1];C[5]=T[Dice[i][5]-1];
			for(d=0,k=0;k<6;k++)
			{
				if(S[Dice[0][k]-1]==C[k])d+=1;
			}
			if(d==6)break;
		}
		if(d==6)break;
	}
	if(d==6){printf("Yes\n");}
	else{printf("No\n");}
	return 0;
}
1 2 3 2 5 6
6 5 4 3 2 1
 1 2 3 2 5 6
6 1 4 3 2 1
 1 2 3 2 5 6
6 0 4 3 2 1
 1 2 3 2 5 6
6 0 4 3 4 1
 1 2 3 2 7 6
6 0 4 3 4 1
 1 2 3 2 7 3
6 0 4 3 4 1
 1 2 2 2 7 6
6 0 4 3 4 1
 1 2 2 2 7 9
6 0 4 3 4 1
 1 2 2 2 7 9
6 0 4 5 4 1
 1 0 2 2 7 9
6 0 4 5 4 1

No
 No
 No
 No
 No
 No
 No
 No
 No
 No

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>
int main(void)
{
	int i,j,k,d,S[6],T[6],C[6];
	int Dice[6][6]={{1,2,3,5,4,6},
					{2,6,3,1,4,5},
					{3,6,5,1,2,4},
					{4,6,2,1,5,3},
					{5,6,4,1,3,2},
					{6,5,3,2,4,1}};
	for(i=0;i<6;i++){scanf("%d",&S[i]);}
	for(i=0;i<6;i++){scanf("%d",&T[i]);}
	for(i=0;i<6;i++)
	{
		for(j=0;j<4;j++)
		{
			for(k=0;k<4;k++){C[k+1]=T[Dice[i][(j+k)%4+1]-1];}
			C[0]=T[Dice[i][0]-1];C[5]=T[Dice[i][5]-1];
			for(d=0,k=0;k<6;k++)
			{
				if(S[Dice[0][k]-1]==C[k])d+=1;
			}
			if(d==6)break;
		}
		if(d==6)break;
	}
	if(d==6){printf("Yes\n");}
	else{printf("No\n");}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"Yes"
.LC2:
	.string	"No"
	.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	$272, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1, -160(%rbp)
	movl	$2, -156(%rbp)
	movl	$3, -152(%rbp)
	movl	$5, -148(%rbp)
	movl	$4, -144(%rbp)
	movl	$6, -140(%rbp)
	movl	$2, -136(%rbp)
	movl	$6, -132(%rbp)
	movl	$3, -128(%rbp)
	movl	$1, -124(%rbp)
	movl	$4, -120(%rbp)
	movl	$5, -116(%rbp)
	movl	$3, -112(%rbp)
	movl	$6, -108(%rbp)
	movl	$5, -104(%rbp)
	movl	$1, -100(%rbp)
	movl	$2, -96(%rbp)
	movl	$4, -92(%rbp)
	movl	$4, -88(%rbp)
	movl	$6, -84(%rbp)
	movl	$2, -80(%rbp)
	movl	$1, -76(%rbp)
	movl	$5, -72(%rbp)
	movl	$3, -68(%rbp)
	movl	$5, -64(%rbp)
	movl	$6, -60(%rbp)
	movl	$4, -56(%rbp)
	movl	$1, -52(%rbp)
	movl	$3, -48(%rbp)
	movl	$2, -44(%rbp)
	movl	$6, -40(%rbp)
	movl	$5, -36(%rbp)
	movl	$3, -32(%rbp)
	movl	$2, -28(%rbp)
	movl	$4, -24(%rbp)
	movl	$1, -20(%rbp)
	movl	$0, -272(%rbp)
	jmp	.L2
.L3:
	leaq	-256(%rbp), %rdx
	movl	-272(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -272(%rbp)
.L2:
	cmpl	$5, -272(%rbp)
	jle	.L3
	movl	$0, -272(%rbp)
	jmp	.L4
.L5:
	leaq	-224(%rbp), %rdx
	movl	-272(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -272(%rbp)
.L4:
	cmpl	$5, -272(%rbp)
	jle	.L5
	movl	$0, -272(%rbp)
	jmp	.L6
.L18:
	movl	$0, -268(%rbp)
	jmp	.L7
.L15:
	movl	$0, -264(%rbp)
	jmp	.L8
.L9:
	movl	-268(%rbp), %edx
	movl	-264(%rbp), %eax
	addl	%edx, %eax
	cltd
	shrl	$30, %edx
	addl	%edx, %eax
	andl	$3, %eax
	subl	%edx, %eax
	addl	$1, %eax
	movslq	%eax, %rcx
	movl	-272(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-160(%rbp,%rax,4), %eax
	leal	-1(%rax), %edx
	movl	-264(%rbp), %eax
	leal	1(%rax), %ecx
	movslq	%edx, %rax
	movl	-224(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -192(%rbp,%rax,4)
	addl	$1, -264(%rbp)
.L8:
	cmpl	$3, -264(%rbp)
	jle	.L9
	movl	-272(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rbp, %rax
	subq	$160, %rax
	movl	(%rax), %eax
	subl	$1, %eax
	cltq
	movl	-224(%rbp,%rax,4), %eax
	movl	%eax, -192(%rbp)
	movl	-272(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rbp, %rax
	subq	$140, %rax
	movl	(%rax), %eax
	subl	$1, %eax
	cltq
	movl	-224(%rbp,%rax,4), %eax
	movl	%eax, -172(%rbp)
	movl	$0, -260(%rbp)
	movl	$0, -264(%rbp)
	jmp	.L10
.L12:
	movl	-264(%rbp), %eax
	cltq
	movl	-160(%rbp,%rax,4), %eax
	subl	$1, %eax
	cltq
	movl	-256(%rbp,%rax,4), %edx
	movl	-264(%rbp), %eax
	cltq
	movl	-192(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L11
	addl	$1, -260(%rbp)
.L11:
	addl	$1, -264(%rbp)
.L10:
	cmpl	$5, -264(%rbp)
	jle	.L12
	cmpl	$6, -260(%rbp)
	je	.L23
	addl	$1, -268(%rbp)
.L7:
	cmpl	$3, -268(%rbp)
	jle	.L15
	jmp	.L14
.L23:
	nop
.L14:
	cmpl	$6, -260(%rbp)
	je	.L24
	addl	$1, -272(%rbp)
.L6:
	cmpl	$5, -272(%rbp)
	jle	.L18
	jmp	.L17
.L24:
	nop
.L17:
	cmpl	$6, -260(%rbp)
	jne	.L19
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L20
.L19:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L20:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	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	"%d"
.LC1:
	.string	"Yes"
.LC2:
	.string	"No"
	.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	$272, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1, -160(%rbp)
	movl	$2, -156(%rbp)
	movl	$3, -152(%rbp)
	movl	$5, -148(%rbp)
	movl	$4, -144(%rbp)
	movl	$6, -140(%rbp)
	movl	$2, -136(%rbp)
	movl	$6, -132(%rbp)
	movl	$3, -128(%rbp)
	movl	$1, -124(%rbp)
	movl	$4, -120(%rbp)
	movl	$5, -116(%rbp)
	movl	$3, -112(%rbp)
	movl	$6, -108(%rbp)
	movl	$5, -104(%rbp)
	movl	$1, -100(%rbp)
	movl	$2, -96(%rbp)
	movl	$4, -92(%rbp)
	movl	$4, -88(%rbp)
	movl	$6, -84(%rbp)
	movl	$2, -80(%rbp)
	movl	$1, -76(%rbp)
	movl	$5, -72(%rbp)
	movl	$3, -68(%rbp)
	movl	$5, -64(%rbp)
	movl	$6, -60(%rbp)
	movl	$4, -56(%rbp)
	movl	$1, -52(%rbp)
	movl	$3, -48(%rbp)
	movl	$2, -44(%rbp)
	movl	$6, -40(%rbp)
	movl	$5, -36(%rbp)
	movl	$3, -32(%rbp)
	movl	$2, -28(%rbp)
	movl	$4, -24(%rbp)
	movl	$1, -20(%rbp)
	movl	$0, -272(%rbp)
	jmp	.L2
.L3:
	leaq	-256(%rbp), %rdx
	movl	-272(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -272(%rbp)
.L2:
	cmpl	$5, -272(%rbp)
	jle	.L3
	movl	$0, -272(%rbp)
	jmp	.L4
.L5:
	leaq	-224(%rbp), %rdx
	movl	-272(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -272(%rbp)
.L4:
	cmpl	$5, -272(%rbp)
	jle	.L5
	movl	$0, -272(%rbp)
	jmp	.L6
.L18:
	movl	$0, -268(%rbp)
	jmp	.L7
.L15:
	movl	$0, -264(%rbp)
	jmp	.L8
.L9:
	movl	-268(%rbp), %edx
	movl	-264(%rbp), %eax
	addl	%edx, %eax
	cltd
	shrl	$30, %edx
	addl	%edx, %eax
	andl	$3, %eax
	subl	%edx, %eax
	addl	$1, %eax
	movslq	%eax, %rcx
	movl	-272(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-160(%rbp,%rax,4), %eax
	leal	-1(%rax), %edx
	movl	-264(%rbp), %eax
	leal	1(%rax), %ecx
	movslq	%edx, %rax
	movl	-224(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -192(%rbp,%rax,4)
	addl	$1, -264(%rbp)
.L8:
	cmpl	$3, -264(%rbp)
	jle	.L9
	movl	-272(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rbp, %rax
	subq	$160, %rax
	movl	(%rax), %eax
	subl	$1, %eax
	cltq
	movl	-224(%rbp,%rax,4), %eax
	movl	%eax, -192(%rbp)
	movl	-272(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rbp, %rax
	subq	$140, %rax
	movl	(%rax), %eax
	subl	$1, %eax
	cltq
	movl	-224(%rbp,%rax,4), %eax
	movl	%eax, -172(%rbp)
	movl	$0, -260(%rbp)
	movl	$0, -264(%rbp)
	jmp	.L10
.L12:
	movl	-264(%rbp), %eax
	cltq
	movl	-160(%rbp,%rax,4), %eax
	subl	$1, %eax
	cltq
	movl	-256(%rbp,%rax,4), %edx
	movl	-264(%rbp), %eax
	cltq
	movl	-192(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L11
	addl	$1, -260(%rbp)
.L11:
	addl	$1, -264(%rbp)
.L10:
	cmpl	$5, -264(%rbp)
	jle	.L12
	cmpl	$6, -260(%rbp)
	je	.L23
	addl	$1, -268(%rbp)
.L7:
	cmpl	$3, -268(%rbp)
	jle	.L15
	jmp	.L14
.L23:
	nop
.L14:
	cmpl	$6, -260(%rbp)
	je	.L24
	addl	$1, -272(%rbp)
.L6:
	cmpl	$5, -272(%rbp)
	jle	.L18
	jmp	.L17
.L24:
	nop
.L17:
	cmpl	$6, -260(%rbp)
	jne	.L19
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L20
.L19:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L20:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	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:
