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()
{
    int a;
    scanf("%d",&a);
    int dice[a][6],box,flg=0,cnt=0,cnt2=0,cnt3=0;
    for(int i=0;i<a;i++)
    {
        for(int j=0;j<6;j++)
        {
            scanf("%d",&dice[i][j]);
            //printf("%d ",dice[i][j]);
        }
        //printf("\n");
    }
    for(int i=1;i<a;i++)
    {
        cnt = 0;
        cnt2 = 0;
        while(1)
        {
            if(dice[0][1]==dice[i][1]||4 < cnt){
                cnt = 0;
                cnt2 += 1;
                box = dice[0][5];
                dice[0][5] = dice[0][2];
                dice[0][2] = dice[0][0];
                dice[0][0] = dice[0][3];
                dice[0][3] = box;
                if(dice[0][0]==dice[i][0]&&dice[0][1]==dice[i][1]&&dice[0][2]==dice[i][2]&&dice[0][3]==dice[i][3]&&dice[0][4]==dice[i][4]&&dice[0][5]==dice[i][5]){
                    printf("No\n");
                    /*printf("%d",i);
                    for(int l=0;l<6;l++){
                        printf("%d ",dice[0][l]);
                    }
                    printf("\n");
                    for(int l=0;l<6;l++){
                        printf("%d ",dice[i][l]);
                    }*/
                    flg = 1;
                    break;
                }else if(4 < cnt2){
                    cnt3 += 1;
                    //printf("%d回目\n",cnt3);
                    break;
                }
            }else {
                cnt += 1;
                box = dice[0][5];
                dice[0][5] = dice[0][1];
                dice[0][1] = dice[0][0];
                dice[0][0] = dice[0][4];
                dice[0][4] = box;
            }
        }
        if(flg == 1) break;
    }
    if(cnt3 == a-1) printf("Yes\n");
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"No"
.LC2:
	.string	"Yes"
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-108(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-108(%rbp), %ecx
	movslq	%ecx, %rax
	subq	$1, %rax
	movq	%rax, -72(%rbp)
	movslq	%ecx, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	imulq	$192, %r15, %rdx
	imulq	$0, %r14, %rax
	leaq	(%rdx,%rax), %rsi
	movl	$192, %eax
	mulq	%r14
	addq	%rdx, %rsi
	movq	%rsi, %rdx
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movslq	%ecx, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	imulq	$192, %r13, %rdx
	imulq	$0, %r12, %rax
	leaq	(%rdx,%rax), %rsi
	movl	$192, %eax
	mulq	%r12
	addq	%rdx, %rsi
	movq	%rsi, %rdx
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -104(%rbp)
	movl	$0, -100(%rbp)
	movl	$0, -96(%rbp)
	movl	$0, -92(%rbp)
	movl	$0, -88(%rbp)
	jmp	.L5
.L8:
	movl	$0, -84(%rbp)
	jmp	.L6
.L7:
	movl	-84(%rbp), %eax
	movslq	%eax, %rcx
	movl	-88(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -84(%rbp)
.L6:
	cmpl	$5, -84(%rbp)
	jle	.L7
	addl	$1, -88(%rbp)
.L5:
	movl	-108(%rbp), %eax
	cmpl	%eax, -88(%rbp)
	jl	.L8
	movl	$1, -80(%rbp)
	jmp	.L9
.L19:
	movl	$0, -100(%rbp)
	movl	$0, -96(%rbp)
.L16:
	movq	-64(%rbp), %rax
	movl	4(%rax), %ecx
	movq	-64(%rbp), %rsi
	movl	-80(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$4, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	je	.L10
	cmpl	$4, -100(%rbp)
	jle	.L11
.L10:
	movl	$0, -100(%rbp)
	addl	$1, -96(%rbp)
	movq	-64(%rbp), %rax
	movl	20(%rax), %eax
	movl	%eax, -76(%rbp)
	movq	-64(%rbp), %rax
	movl	8(%rax), %edx
	movq	-64(%rbp), %rax
	movl	%edx, 20(%rax)
	movq	-64(%rbp), %rax
	movl	(%rax), %edx
	movq	-64(%rbp), %rax
	movl	%edx, 8(%rax)
	movq	-64(%rbp), %rax
	movl	12(%rax), %edx
	movq	-64(%rbp), %rax
	movl	%edx, (%rax)
	movq	-64(%rbp), %rax
	movl	-76(%rbp), %edx
	movl	%edx, 12(%rax)
	movq	-64(%rbp), %rax
	movl	(%rax), %ecx
	movq	-64(%rbp), %rsi
	movl	-80(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jne	.L12
	movq	-64(%rbp), %rax
	movl	4(%rax), %ecx
	movq	-64(%rbp), %rsi
	movl	-80(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$4, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jne	.L12
	movq	-64(%rbp), %rax
	movl	8(%rax), %ecx
	movq	-64(%rbp), %rsi
	movl	-80(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$8, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jne	.L12
	movq	-64(%rbp), %rax
	movl	12(%rax), %ecx
	movq	-64(%rbp), %rsi
	movl	-80(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$12, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jne	.L12
	movq	-64(%rbp), %rax
	movl	16(%rax), %ecx
	movq	-64(%rbp), %rsi
	movl	-80(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$16, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jne	.L12
	movq	-64(%rbp), %rax
	movl	20(%rax), %ecx
	movq	-64(%rbp), %rsi
	movl	-80(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$20, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jne	.L12
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$1, -104(%rbp)
	jmp	.L13
.L12:
	cmpl	$4, -96(%rbp)
	jle	.L23
	addl	$1, -92(%rbp)
	jmp	.L13
.L11:
	addl	$1, -100(%rbp)
	movq	-64(%rbp), %rax
	movl	20(%rax), %eax
	movl	%eax, -76(%rbp)
	movq	-64(%rbp), %rax
	movl	4(%rax), %edx
	movq	-64(%rbp), %rax
	movl	%edx, 20(%rax)
	movq	-64(%rbp), %rax
	movl	(%rax), %edx
	movq	-64(%rbp), %rax
	movl	%edx, 4(%rax)
	movq	-64(%rbp), %rax
	movl	16(%rax), %edx
	movq	-64(%rbp), %rax
	movl	%edx, (%rax)
	movq	-64(%rbp), %rax
	movl	-76(%rbp), %edx
	movl	%edx, 16(%rax)
	jmp	.L16
.L23:
	nop
	jmp	.L16
.L13:
	cmpl	$1, -104(%rbp)
	je	.L24
	addl	$1, -80(%rbp)
.L9:
	movl	-108(%rbp), %eax
	cmpl	%eax, -80(%rbp)
	jl	.L19
	jmp	.L18
.L24:
	nop
.L18:
	movl	-108(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -92(%rbp)
	jne	.L20
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L20:
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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	"%d"
.LC1:
	.string	"No"
.LC2:
	.string	"Yes"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	leaq	.LC0(%rip), %r14
	leaq	-60(%rbp), %rsi
	pushq	%r13
	movq	%r14, %rdi
	pushq	%r12
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-60(%rbp), %rax
	movq	%rsp, %rcx
	movl	%eax, -76(%rbp)
	leaq	(%rax,%rax,2), %rax
	leaq	15(,%rax,8), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L3
.L45:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L45
.L3:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	jne	.L46
.L4:
	leaq	3(%rsp), %rbx
	movq	%rbx, %rax
	andq	$-4, %rbx
	shrq	$2, %rax
	cmpl	$0, -76(%rbp)
	movq	%rax, -88(%rbp)
	jle	.L24
	leaq	24(%rbx), %rax
	xorl	%r15d, %r15d
	movq	%rax, -72(%rbp)
	movq	%rax, %r13
	.p2align 4,,10
	.p2align 3
.L7:
	leaq	-24(%r13), %r12
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addq	$4, %r12
	call	__isoc99_scanf@PLT
	cmpq	%r13, %r12
	jne	.L6
	movl	-60(%rbp), %eax
	addq	$1, %r15
	leaq	24(%r12), %r13
	cmpl	%r15d, %eax
	jg	.L7
	movl	%eax, -76(%rbp)
	cmpl	$1, %eax
	jle	.L24
	movl	%eax, %edi
	movq	-88(%rbp), %rax
	movq	-72(%rbp), %r15
	xorl	%r13d, %r13d
	subl	$1, %edi
	movl	%edi, -72(%rbp)
	movl	4(,%rax,4), %edx
	movl	20(,%rax,4), %r9d
	movl	8(,%rax,4), %ecx
	movl	0(,%rax,4), %esi
	movl	12(,%rax,4), %eax
	.p2align 4,,10
	.p2align 3
.L19:
	movl	%esi, %edi
	movl	4(%r15), %r14d
	movl	%eax, %esi
	xorl	%r11d, %r11d
	movl	%r9d, %eax
	xorl	%r8d, %r8d
	movl	%ecx, %r9d
	movl	%edi, %ecx
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L9:
	movl	(%r15), %r12d
	leal	1(%r11), %r10d
	cmpl	%esi, %r12d
	sete	%r8b
	andb	%dil, %r8b
	jne	.L47
	cmpl	$4, %r10d
	jg	.L14
	cmpl	%edx, %r14d
	je	.L48
	movl	%ecx, 8(%rbx)
	movl	%esi, %edi
	movl	%r10d, %r11d
	movl	$1, %r8d
	movl	%eax, 12(%rbx)
	movl	%esi, (%rbx)
	movl	%eax, %esi
	movl	%r9d, %eax
	movl	%r9d, 20(%rbx)
	movl	%ecx, %r9d
.L10:
	movl	16(%rbx), %ecx
	movd	%edi, %xmm1
	movd	%edx, %xmm2
	movd	%ecx, %xmm0
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, (%rbx)
	movd	%eax, %xmm0
	movl	%edx, %eax
	movl	%edi, %edx
	punpckldq	%xmm2, %xmm0
	movq	%xmm0, 16(%rbx)
.L20:
	cmpl	%edx, %r14d
	sete	%dil
	cmpl	$5, %r8d
	je	.L9
	testb	%dil, %dil
	jne	.L9
	addl	$1, %r8d
	movl	%ecx, %edi
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L48:
	movl	%r8d, %edi
	leal	2(%r11), %r8d
	cmpl	%eax, %r12d
	je	.L49
.L16:
	cmpl	$5, %r8d
	je	.L26
	addl	$3, %r11d
	cmpl	%r9d, %r12d
	je	.L50
.L17:
	cmpl	$5, %r11d
	je	.L28
	cmpl	%ecx, %r12d
	je	.L51
.L18:
	cmpl	$3, %r11d
	jne	.L30
	testb	%dil, %dil
	jne	.L52
	.p2align 4,,10
	.p2align 3
.L14:
	movl	%eax, 12(%rbx)
	addl	$1, %r13d
	addq	$24, %r15
	movl	%esi, (%rbx)
	movl	%ecx, 8(%rbx)
	movl	%r9d, 20(%rbx)
	cmpl	-72(%rbp), %r13d
	jne	.L19
.L5:
	movl	-76(%rbp), %eax
	subl	$1, %eax
	cmpl	-72(%rbp), %eax
	je	.L53
.L21:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L54
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L47:
	.cfi_restore_state
	movl	%r8d, %edi
	cmpl	%ecx, 8(%r15)
	je	.L55
.L12:
	cmpl	$4, %r10d
	jg	.L14
	leal	2(%r11), %r8d
	cmpl	%eax, %r12d
	jne	.L16
.L49:
	cmpl	%esi, 8(%r15)
	jne	.L16
	cmpl	%r9d, 12(%r15)
	jne	.L16
	movl	16(%r15), %r14d
	cmpl	%r14d, 16(%rbx)
	jne	.L16
	cmpl	%ecx, 20(%r15)
	jne	.L16
	movl	%ecx, %edi
	movl	%esi, %ecx
	movl	%eax, %esi
	movl	%r9d, %eax
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L55:
	cmpl	%eax, 12(%r15)
	jne	.L12
	movl	16(%rbx), %r14d
	cmpl	%r14d, 16(%r15)
	jne	.L12
	movl	20(%r15), %r8d
	cmpl	%r8d, %r9d
	jne	.L12
	movl	%r8d, %edi
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L26:
	movl	%esi, %edi
	movl	%eax, %esi
	movl	%r9d, %eax
	movl	%ecx, %r9d
	movl	%edi, %ecx
	jmp	.L14
.L50:
	cmpl	%eax, 8(%r15)
	jne	.L17
	cmpl	%ecx, 12(%r15)
	jne	.L17
	movl	16(%r15), %r14d
	cmpl	%r14d, 16(%rbx)
	jne	.L17
	cmpl	%esi, 20(%r15)
	jne	.L17
	movl	%esi, %edi
	xchgl	%eax, %ecx
	movl	%r12d, %esi
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L28:
	movl	%ecx, %edi
	movl	%eax, %ecx
	movl	%edi, %eax
	movl	%esi, %edi
	movl	%r9d, %esi
	movl	%edi, %r9d
	jmp	.L14
.L51:
	cmpl	8(%r15), %r9d
	jne	.L18
	cmpl	12(%r15), %esi
	jne	.L18
	movl	16(%r15), %r14d
	cmpl	%r14d, 16(%rbx)
	jne	.L18
	movl	20(%r15), %r8d
	cmpl	%r8d, %eax
	jne	.L18
	movl	%esi, %eax
	movl	%r8d, %edi
	movl	%ecx, %esi
	movl	%r9d, %ecx
.L13:
	movq	-88(%rbp), %rdx
	movl	%edi, 20(,%rdx,4)
	leaq	.LC1(%rip), %rdi
	movl	%eax, 12(,%rdx,4)
	movl	%esi, 0(,%rdx,4)
	movl	%ecx, 8(,%rdx,4)
	call	puts@PLT
	movl	-60(%rbp), %eax
	movl	%r13d, -72(%rbp)
	movl	%eax, -76(%rbp)
	jmp	.L5
.L30:
	movl	%esi, %edi
	movl	%ecx, %esi
	movl	%r9d, %ecx
	movl	%eax, %r9d
	movl	%edi, %eax
	jmp	.L14
.L52:
	cmpl	%ecx, 8(%r15)
	jne	.L14
	cmpl	%eax, 12(%r15)
	jne	.L14
	movl	16(%r15), %edi
	cmpl	%edi, 16(%rbx)
	jne	.L14
	cmpl	%r9d, 20(%r15)
	jne	.L14
	movl	%r9d, %edi
	jmp	.L13
.L53:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L21
.L46:
	orq	$0, -8(%rsp,%rax)
	jmp	.L4
.L24:
	movl	$0, -72(%rbp)
	jmp	.L5
.L54:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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	"%d"
.LC1:
	.string	"No"
.LC2:
	.string	"Yes"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	leaq	.LC0(%rip), %r14
	leaq	-60(%rbp), %rsi
	pushq	%r13
	movq	%r14, %rdi
	pushq	%r12
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-60(%rbp), %rax
	movq	%rsp, %rcx
	movl	%eax, -76(%rbp)
	leaq	(%rax,%rax,2), %rax
	leaq	15(,%rax,8), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L3
.L45:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L45
.L3:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	jne	.L46
.L4:
	leaq	3(%rsp), %rbx
	movq	%rbx, %rax
	andq	$-4, %rbx
	shrq	$2, %rax
	cmpl	$0, -76(%rbp)
	movq	%rax, -88(%rbp)
	jle	.L24
	leaq	24(%rbx), %rax
	xorl	%r15d, %r15d
	movq	%rax, -72(%rbp)
	movq	%rax, %r13
	.p2align 4,,10
	.p2align 3
.L7:
	leaq	-24(%r13), %r12
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addq	$4, %r12
	call	__isoc99_scanf@PLT
	cmpq	%r13, %r12
	jne	.L6
	movl	-60(%rbp), %eax
	addq	$1, %r15
	leaq	24(%r12), %r13
	cmpl	%r15d, %eax
	jg	.L7
	movl	%eax, -76(%rbp)
	cmpl	$1, %eax
	jle	.L24
	movl	%eax, %edi
	movq	-88(%rbp), %rax
	movq	-72(%rbp), %r15
	xorl	%r13d, %r13d
	subl	$1, %edi
	movl	%edi, -72(%rbp)
	movl	4(,%rax,4), %edx
	movl	20(,%rax,4), %r9d
	movl	8(,%rax,4), %ecx
	movl	0(,%rax,4), %esi
	movl	12(,%rax,4), %eax
	.p2align 4,,10
	.p2align 3
.L19:
	movl	%esi, %edi
	movl	4(%r15), %r14d
	movl	%eax, %esi
	xorl	%r11d, %r11d
	movl	%r9d, %eax
	xorl	%r8d, %r8d
	movl	%ecx, %r9d
	movl	%edi, %ecx
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L9:
	movl	(%r15), %r12d
	leal	1(%r11), %r10d
	cmpl	%esi, %r12d
	sete	%r8b
	andb	%dil, %r8b
	jne	.L47
	cmpl	$4, %r10d
	jg	.L14
	cmpl	%edx, %r14d
	je	.L48
	movl	%ecx, 8(%rbx)
	movl	%esi, %edi
	movl	%r10d, %r11d
	movl	$1, %r8d
	movl	%eax, 12(%rbx)
	movl	%esi, (%rbx)
	movl	%eax, %esi
	movl	%r9d, %eax
	movl	%r9d, 20(%rbx)
	movl	%ecx, %r9d
.L10:
	movl	16(%rbx), %ecx
	movd	%edi, %xmm1
	movd	%edx, %xmm2
	movd	%ecx, %xmm0
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, (%rbx)
	movd	%eax, %xmm0
	movl	%edx, %eax
	movl	%edi, %edx
	punpckldq	%xmm2, %xmm0
	movq	%xmm0, 16(%rbx)
.L20:
	cmpl	%edx, %r14d
	sete	%dil
	cmpl	$5, %r8d
	je	.L9
	testb	%dil, %dil
	jne	.L9
	addl	$1, %r8d
	movl	%ecx, %edi
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L48:
	movl	%r8d, %edi
	leal	2(%r11), %r8d
	cmpl	%eax, %r12d
	je	.L49
.L16:
	cmpl	$5, %r8d
	je	.L26
	addl	$3, %r11d
	cmpl	%r9d, %r12d
	je	.L50
.L17:
	cmpl	$5, %r11d
	je	.L28
	cmpl	%ecx, %r12d
	je	.L51
.L18:
	cmpl	$3, %r11d
	jne	.L30
	testb	%dil, %dil
	jne	.L52
	.p2align 4,,10
	.p2align 3
.L14:
	movl	%eax, 12(%rbx)
	addl	$1, %r13d
	addq	$24, %r15
	movl	%esi, (%rbx)
	movl	%ecx, 8(%rbx)
	movl	%r9d, 20(%rbx)
	cmpl	-72(%rbp), %r13d
	jne	.L19
.L5:
	movl	-76(%rbp), %eax
	subl	$1, %eax
	cmpl	-72(%rbp), %eax
	je	.L53
.L21:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L54
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L47:
	.cfi_restore_state
	movl	%r8d, %edi
	cmpl	%ecx, 8(%r15)
	je	.L55
.L12:
	cmpl	$4, %r10d
	jg	.L14
	leal	2(%r11), %r8d
	cmpl	%eax, %r12d
	jne	.L16
.L49:
	cmpl	%esi, 8(%r15)
	jne	.L16
	cmpl	%r9d, 12(%r15)
	jne	.L16
	movl	16(%r15), %r14d
	cmpl	%r14d, 16(%rbx)
	jne	.L16
	cmpl	%ecx, 20(%r15)
	jne	.L16
	movl	%ecx, %edi
	movl	%esi, %ecx
	movl	%eax, %esi
	movl	%r9d, %eax
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L55:
	cmpl	%eax, 12(%r15)
	jne	.L12
	movl	16(%rbx), %r14d
	cmpl	%r14d, 16(%r15)
	jne	.L12
	movl	20(%r15), %r8d
	cmpl	%r8d, %r9d
	jne	.L12
	movl	%r8d, %edi
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L26:
	movl	%esi, %edi
	movl	%eax, %esi
	movl	%r9d, %eax
	movl	%ecx, %r9d
	movl	%edi, %ecx
	jmp	.L14
.L50:
	cmpl	%eax, 8(%r15)
	jne	.L17
	cmpl	%ecx, 12(%r15)
	jne	.L17
	movl	16(%r15), %r14d
	cmpl	%r14d, 16(%rbx)
	jne	.L17
	cmpl	%esi, 20(%r15)
	jne	.L17
	movl	%esi, %edi
	xchgl	%eax, %ecx
	movl	%r12d, %esi
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L28:
	movl	%ecx, %edi
	movl	%eax, %ecx
	movl	%edi, %eax
	movl	%esi, %edi
	movl	%r9d, %esi
	movl	%edi, %r9d
	jmp	.L14
.L51:
	cmpl	8(%r15), %r9d
	jne	.L18
	cmpl	12(%r15), %esi
	jne	.L18
	movl	16(%r15), %r14d
	cmpl	%r14d, 16(%rbx)
	jne	.L18
	movl	20(%r15), %r8d
	cmpl	%r8d, %eax
	jne	.L18
	movl	%esi, %eax
	movl	%r8d, %edi
	movl	%ecx, %esi
	movl	%r9d, %ecx
.L13:
	movq	-88(%rbp), %rdx
	movl	%edi, 20(,%rdx,4)
	leaq	.LC1(%rip), %rdi
	movl	%eax, 12(,%rdx,4)
	movl	%esi, 0(,%rdx,4)
	movl	%ecx, 8(,%rdx,4)
	call	puts@PLT
	movl	-60(%rbp), %eax
	movl	%r13d, -72(%rbp)
	movl	%eax, -76(%rbp)
	jmp	.L5
.L30:
	movl	%esi, %edi
	movl	%ecx, %esi
	movl	%r9d, %ecx
	movl	%eax, %r9d
	movl	%edi, %eax
	jmp	.L14
.L52:
	cmpl	%ecx, 8(%r15)
	jne	.L14
	cmpl	%eax, 12(%r15)
	jne	.L14
	movl	16(%r15), %edi
	cmpl	%edi, 16(%rbx)
	jne	.L14
	cmpl	%r9d, 20(%r15)
	jne	.L14
	movl	%r9d, %edi
	jmp	.L13
.L53:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L21
.L46:
	orq	$0, -8(%rsp,%rax)
	jmp	.L4
.L24:
	movl	$0, -72(%rbp)
	jmp	.L5
.L54:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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>


int main()
{
    int a;
    scanf("%d",&a);
    int dice[a][6],box,flg=0,cnt=0,cnt2=0,cnt3=0;
    for(int i=0;i<a;i++)
    {
        for(int j=0;j<6;j++)
        {
            scanf("%d",&dice[i][j]);
            //printf("%d ",dice[i][j]);
        }
        //printf("\n");
    }
    for(int i=1;i<a;i++)
    {
        cnt = 0;
        cnt2 = 0;
        while(1)
        {
            if(dice[0][1]==dice[i][1]||4 < cnt){
                cnt = 0;
                cnt2 += 1;
                box = dice[0][5];
                dice[0][5] = dice[0][2];
                dice[0][2] = dice[0][0];
                dice[0][0] = dice[0][3];
                dice[0][3] = box;
                if(dice[0][0]==dice[i][0]&&dice[0][1]==dice[i][1]&&dice[0][2]==dice[i][2]&&dice[0][3]==dice[i][3]&&dice[0][4]==dice[i][4]&&dice[0][5]==dice[i][5]){
                    printf("No\n");
                    /*printf("%d",i);
                    for(int l=0;l<6;l++){
                        printf("%d ",dice[0][l]);
                    }
                    printf("\n");
                    for(int l=0;l<6;l++){
                        printf("%d ",dice[i][l]);
                    }*/
                    flg = 1;
                    break;
                }else if(4 < cnt2){
                    cnt3 += 1;
                    //printf("%d回目\n",cnt3);
                    break;
                }
            }else {
                cnt += 1;
                box = dice[0][5];
                dice[0][5] = dice[0][1];
                dice[0][1] = dice[0][0];
                dice[0][0] = dice[0][4];
                dice[0][4] = box;
            }
        }
        if(flg == 1) break;
    }
    if(cnt3 == a-1) printf("Yes\n");
    return 0;
}

3
1 2 3 4 5 6
6 5 4 3 2 1
5 4 0 2 1 6
 3
1 2 3 4 5 6
6 2 5 3 5 1
6 5 4 3 2 1
 3
1 2 3 4 5 6
5 5 4 3 2 1
5 4 0 2 1 6
 3
1 2 3 4 5 6
6 2 5 3 0 1
6 5 4 3 2 1
 3
1 2 3 3 5 6
5 5 4 3 2 1
5 4 0 2 1 6
 3
1 4 3 4 5 6
6 2 5 3 0 1
6 5 4 3 2 1
 3
1 2 3 3 5 6
5 2 4 3 2 1
5 4 0 2 1 6
 3
1 6 3 4 5 6
6 2 5 3 0 1
6 5 4 3 2 1
 3
1 2 3 3 5 6
5 2 4 3 2 1
5 4 0 2 1 1
 3
1 6 3 4 5 6
6 2 5 3 0 1
6 5 2 3 2 1

Yes
 Yes
 Yes
 Yes
 Yes
 Yes
 Yes
 Yes
 Yes
 Yes

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()
{
    int a;
    scanf("%d",&a);
    int dice[a][6],box,flg=0,cnt=0,cnt2=0,cnt3=0;
    for(int i=0;i<a;i++)
    {
        for(int j=0;j<6;j++)
        {
            scanf("%d",&dice[i][j]);
            //printf("%d ",dice[i][j]);
        }
        //printf("\n");
    }
    for(int i=1;i<a;i++)
    {
        cnt = 0;
        cnt2 = 0;
        while(1)
        {
            if(dice[0][1]==dice[i][1]||4 < cnt){
                cnt = 0;
                cnt2 += 1;
                box = dice[0][5];
                dice[0][5] = dice[0][2];
                dice[0][2] = dice[0][0];
                dice[0][0] = dice[0][3];
                dice[0][3] = box;
                if(dice[0][0]==dice[i][0]&&dice[0][1]==dice[i][1]&&dice[0][2]==dice[i][2]&&dice[0][3]==dice[i][3]&&dice[0][4]==dice[i][4]&&dice[0][5]==dice[i][5]){
                    printf("No\n");
                    /*printf("%d",i);
                    for(int l=0;l<6;l++){
                        printf("%d ",dice[0][l]);
                    }
                    printf("\n");
                    for(int l=0;l<6;l++){
                        printf("%d ",dice[i][l]);
                    }*/
                    flg = 1;
                    break;
                }else if(4 < cnt2){
                    cnt3 += 1;
                    //printf("%d回目\n",cnt3);
                    break;
                }
            }else {
                cnt += 1;
                box = dice[0][5];
                dice[0][5] = dice[0][1];
                dice[0][1] = dice[0][0];
                dice[0][0] = dice[0][4];
                dice[0][4] = box;
            }
        }
        if(flg == 1) break;
    }
    if(cnt3 == a-1) printf("Yes\n");
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"No"
.LC2:
	.string	"Yes"
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-108(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-108(%rbp), %ecx
	movslq	%ecx, %rax
	subq	$1, %rax
	movq	%rax, -72(%rbp)
	movslq	%ecx, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	imulq	$192, %r15, %rdx
	imulq	$0, %r14, %rax
	leaq	(%rdx,%rax), %rsi
	movl	$192, %eax
	mulq	%r14
	addq	%rdx, %rsi
	movq	%rsi, %rdx
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movslq	%ecx, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	imulq	$192, %r13, %rdx
	imulq	$0, %r12, %rax
	leaq	(%rdx,%rax), %rsi
	movl	$192, %eax
	mulq	%r12
	addq	%rdx, %rsi
	movq	%rsi, %rdx
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -104(%rbp)
	movl	$0, -100(%rbp)
	movl	$0, -96(%rbp)
	movl	$0, -92(%rbp)
	movl	$0, -88(%rbp)
	jmp	.L5
.L8:
	movl	$0, -84(%rbp)
	jmp	.L6
.L7:
	movl	-84(%rbp), %eax
	movslq	%eax, %rcx
	movl	-88(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -84(%rbp)
.L6:
	cmpl	$5, -84(%rbp)
	jle	.L7
	addl	$1, -88(%rbp)
.L5:
	movl	-108(%rbp), %eax
	cmpl	%eax, -88(%rbp)
	jl	.L8
	movl	$1, -80(%rbp)
	jmp	.L9
.L19:
	movl	$0, -100(%rbp)
	movl	$0, -96(%rbp)
.L16:
	movq	-64(%rbp), %rax
	movl	4(%rax), %ecx
	movq	-64(%rbp), %rsi
	movl	-80(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$4, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	je	.L10
	cmpl	$4, -100(%rbp)
	jle	.L11
.L10:
	movl	$0, -100(%rbp)
	addl	$1, -96(%rbp)
	movq	-64(%rbp), %rax
	movl	20(%rax), %eax
	movl	%eax, -76(%rbp)
	movq	-64(%rbp), %rax
	movl	8(%rax), %edx
	movq	-64(%rbp), %rax
	movl	%edx, 20(%rax)
	movq	-64(%rbp), %rax
	movl	(%rax), %edx
	movq	-64(%rbp), %rax
	movl	%edx, 8(%rax)
	movq	-64(%rbp), %rax
	movl	12(%rax), %edx
	movq	-64(%rbp), %rax
	movl	%edx, (%rax)
	movq	-64(%rbp), %rax
	movl	-76(%rbp), %edx
	movl	%edx, 12(%rax)
	movq	-64(%rbp), %rax
	movl	(%rax), %ecx
	movq	-64(%rbp), %rsi
	movl	-80(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jne	.L12
	movq	-64(%rbp), %rax
	movl	4(%rax), %ecx
	movq	-64(%rbp), %rsi
	movl	-80(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$4, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jne	.L12
	movq	-64(%rbp), %rax
	movl	8(%rax), %ecx
	movq	-64(%rbp), %rsi
	movl	-80(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$8, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jne	.L12
	movq	-64(%rbp), %rax
	movl	12(%rax), %ecx
	movq	-64(%rbp), %rsi
	movl	-80(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$12, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jne	.L12
	movq	-64(%rbp), %rax
	movl	16(%rax), %ecx
	movq	-64(%rbp), %rsi
	movl	-80(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$16, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jne	.L12
	movq	-64(%rbp), %rax
	movl	20(%rax), %ecx
	movq	-64(%rbp), %rsi
	movl	-80(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$20, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jne	.L12
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$1, -104(%rbp)
	jmp	.L13
.L12:
	cmpl	$4, -96(%rbp)
	jle	.L23
	addl	$1, -92(%rbp)
	jmp	.L13
.L11:
	addl	$1, -100(%rbp)
	movq	-64(%rbp), %rax
	movl	20(%rax), %eax
	movl	%eax, -76(%rbp)
	movq	-64(%rbp), %rax
	movl	4(%rax), %edx
	movq	-64(%rbp), %rax
	movl	%edx, 20(%rax)
	movq	-64(%rbp), %rax
	movl	(%rax), %edx
	movq	-64(%rbp), %rax
	movl	%edx, 4(%rax)
	movq	-64(%rbp), %rax
	movl	16(%rax), %edx
	movq	-64(%rbp), %rax
	movl	%edx, (%rax)
	movq	-64(%rbp), %rax
	movl	-76(%rbp), %edx
	movl	%edx, 16(%rax)
	jmp	.L16
.L23:
	nop
	jmp	.L16
.L13:
	cmpl	$1, -104(%rbp)
	je	.L24
	addl	$1, -80(%rbp)
.L9:
	movl	-108(%rbp), %eax
	cmpl	%eax, -80(%rbp)
	jl	.L19
	jmp	.L18
.L24:
	nop
.L18:
	movl	-108(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -92(%rbp)
	jne	.L20
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L20:
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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	"No"
.LC2:
	.string	"Yes"
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-108(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-108(%rbp), %ecx
	movslq	%ecx, %rax
	subq	$1, %rax
	movq	%rax, -72(%rbp)
	movslq	%ecx, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	imulq	$192, %r15, %rdx
	imulq	$0, %r14, %rax
	leaq	(%rdx,%rax), %rsi
	movl	$192, %eax
	mulq	%r14
	addq	%rdx, %rsi
	movq	%rsi, %rdx
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movslq	%ecx, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	imulq	$192, %r13, %rdx
	imulq	$0, %r12, %rax
	leaq	(%rdx,%rax), %rsi
	movl	$192, %eax
	mulq	%r12
	addq	%rdx, %rsi
	movq	%rsi, %rdx
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -104(%rbp)
	movl	$0, -100(%rbp)
	movl	$0, -96(%rbp)
	movl	$0, -92(%rbp)
	movl	$0, -88(%rbp)
	jmp	.L5
.L8:
	movl	$0, -84(%rbp)
	jmp	.L6
.L7:
	movl	-84(%rbp), %eax
	movslq	%eax, %rcx
	movl	-88(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -84(%rbp)
.L6:
	cmpl	$5, -84(%rbp)
	jle	.L7
	addl	$1, -88(%rbp)
.L5:
	movl	-108(%rbp), %eax
	cmpl	%eax, -88(%rbp)
	jl	.L8
	movl	$1, -80(%rbp)
	jmp	.L9
.L19:
	movl	$0, -100(%rbp)
	movl	$0, -96(%rbp)
.L16:
	movq	-64(%rbp), %rax
	movl	4(%rax), %ecx
	movq	-64(%rbp), %rsi
	movl	-80(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$4, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	je	.L10
	cmpl	$4, -100(%rbp)
	jle	.L11
.L10:
	movl	$0, -100(%rbp)
	addl	$1, -96(%rbp)
	movq	-64(%rbp), %rax
	movl	20(%rax), %eax
	movl	%eax, -76(%rbp)
	movq	-64(%rbp), %rax
	movl	8(%rax), %edx
	movq	-64(%rbp), %rax
	movl	%edx, 20(%rax)
	movq	-64(%rbp), %rax
	movl	(%rax), %edx
	movq	-64(%rbp), %rax
	movl	%edx, 8(%rax)
	movq	-64(%rbp), %rax
	movl	12(%rax), %edx
	movq	-64(%rbp), %rax
	movl	%edx, (%rax)
	movq	-64(%rbp), %rax
	movl	-76(%rbp), %edx
	movl	%edx, 12(%rax)
	movq	-64(%rbp), %rax
	movl	(%rax), %ecx
	movq	-64(%rbp), %rsi
	movl	-80(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jne	.L12
	movq	-64(%rbp), %rax
	movl	4(%rax), %ecx
	movq	-64(%rbp), %rsi
	movl	-80(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$4, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jne	.L12
	movq	-64(%rbp), %rax
	movl	8(%rax), %ecx
	movq	-64(%rbp), %rsi
	movl	-80(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$8, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jne	.L12
	movq	-64(%rbp), %rax
	movl	12(%rax), %ecx
	movq	-64(%rbp), %rsi
	movl	-80(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$12, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jne	.L12
	movq	-64(%rbp), %rax
	movl	16(%rax), %ecx
	movq	-64(%rbp), %rsi
	movl	-80(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$16, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jne	.L12
	movq	-64(%rbp), %rax
	movl	20(%rax), %ecx
	movq	-64(%rbp), %rsi
	movl	-80(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$20, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jne	.L12
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$1, -104(%rbp)
	jmp	.L13
.L12:
	cmpl	$4, -96(%rbp)
	jle	.L23
	addl	$1, -92(%rbp)
	jmp	.L13
.L11:
	addl	$1, -100(%rbp)
	movq	-64(%rbp), %rax
	movl	20(%rax), %eax
	movl	%eax, -76(%rbp)
	movq	-64(%rbp), %rax
	movl	4(%rax), %edx
	movq	-64(%rbp), %rax
	movl	%edx, 20(%rax)
	movq	-64(%rbp), %rax
	movl	(%rax), %edx
	movq	-64(%rbp), %rax
	movl	%edx, 4(%rax)
	movq	-64(%rbp), %rax
	movl	16(%rax), %edx
	movq	-64(%rbp), %rax
	movl	%edx, (%rax)
	movq	-64(%rbp), %rax
	movl	-76(%rbp), %edx
	movl	%edx, 16(%rax)
	jmp	.L16
.L23:
	nop
	jmp	.L16
.L13:
	cmpl	$1, -104(%rbp)
	je	.L24
	addl	$1, -80(%rbp)
.L9:
	movl	-108(%rbp), %eax
	cmpl	%eax, -80(%rbp)
	jl	.L19
	jmp	.L18
.L24:
	nop
.L18:
	movl	-108(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -92(%rbp)
	jne	.L20
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L20:
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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:
