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 check(int e[]){
	int i;
	for(i=0;i<3;i++){
		if(e[i]!=e[i+1])
			return 0;
	}
	for(i++;i<7;i++){
		if(e[i]!=e[i+1])
			return 0;
	}
	for(i++;i<11;i++){
		if(e[i]!=e[i+1])
			return 0;
	}
	return 1;
}
int main(void){
	int i,j,e[12];
	for(i=0;i<12;i++)
		scanf("%d",&e[i]);
	for(i=0;i<11;i++){
		for(j=11;j>i;j--){
			if(e[j-1]>e[j]){
				int tmp=e[j-1];
				e[j-1]=e[j];
				e[j]=tmp;
			}
		}
	}
	if(check(e))
		puts("yes");
	else
		puts("no");
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	check
	.type	check, @function
check:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L5:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	je	.L3
	movl	$0, %eax
	jmp	.L4
.L3:
	addl	$1, -4(%rbp)
.L2:
	cmpl	$2, -4(%rbp)
	jle	.L5
	addl	$1, -4(%rbp)
	jmp	.L6
.L8:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	je	.L7
	movl	$0, %eax
	jmp	.L4
.L7:
	addl	$1, -4(%rbp)
.L6:
	cmpl	$6, -4(%rbp)
	jle	.L8
	addl	$1, -4(%rbp)
	jmp	.L9
.L11:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	je	.L10
	movl	$0, %eax
	jmp	.L4
.L10:
	addl	$1, -4(%rbp)
.L9:
	cmpl	$10, -4(%rbp)
	jle	.L11
	movl	$1, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	check, .-check
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"yes"
.LC2:
	.string	"no"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -76(%rbp)
	jmp	.L13
.L14:
	leaq	-64(%rbp), %rdx
	movl	-76(%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, -76(%rbp)
.L13:
	cmpl	$11, -76(%rbp)
	jle	.L14
	movl	$0, -76(%rbp)
	jmp	.L15
.L19:
	movl	$11, -72(%rbp)
	jmp	.L16
.L18:
	movl	-72(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-64(%rbp,%rax,4), %edx
	movl	-72(%rbp), %eax
	cltq
	movl	-64(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L17
	movl	-72(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-64(%rbp,%rax,4), %eax
	movl	%eax, -68(%rbp)
	movl	-72(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-72(%rbp), %eax
	cltq
	movl	-64(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -64(%rbp,%rax,4)
	movl	-72(%rbp), %eax
	cltq
	movl	-68(%rbp), %edx
	movl	%edx, -64(%rbp,%rax,4)
.L17:
	subl	$1, -72(%rbp)
.L16:
	movl	-72(%rbp), %eax
	cmpl	-76(%rbp), %eax
	jg	.L18
	addl	$1, -76(%rbp)
.L15:
	cmpl	$10, -76(%rbp)
	jle	.L19
	leaq	-64(%rbp), %rax
	movq	%rax, %rdi
	call	check
	testl	%eax, %eax
	je	.L20
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L21
.L20:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L21:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	check
	.type	check, @function
check:
.LFB23:
	.cfi_startproc
	endbr64
	movl	4(%rdi), %eax
	cmpl	%eax, (%rdi)
	jne	.L10
	cmpl	8(%rdi), %eax
	jne	.L10
	cmpl	12(%rdi), %eax
	jne	.L10
	movl	20(%rdi), %eax
	cmpl	%eax, 16(%rdi)
	jne	.L10
	cmpl	24(%rdi), %eax
	jne	.L10
	cmpl	28(%rdi), %eax
	jne	.L10
	movl	36(%rdi), %eax
	cmpl	%eax, 32(%rdi)
	jne	.L10
	cmpl	40(%rdi), %eax
	jne	.L10
	cmpl	%eax, 44(%rdi)
	sete	%al
	movzbl	%al, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	check, .-check
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"yes"
.LC2:
	.string	"no"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$72, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	leaq	48(%rsp), %r13
	movq	%rbp, %rbx
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%rbx, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%r13, %rbx
	jne	.L13
	xorl	%eax, %eax
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L61:
	movq	36(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm3
	movd	%xmm0, %edx
	movd	%xmm3, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jge	.L21
	movq	%xmm1, 36(%rsp)
.L21:
	cmpl	$9, %eax
	je	.L16
	movq	32(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm4
	movd	%xmm0, %edx
	movd	%xmm4, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jge	.L22
	movq	%xmm1, 32(%rsp)
.L22:
	cmpl	$8, %eax
	je	.L16
	movq	28(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm5
	movd	%xmm0, %edx
	movd	%xmm5, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jge	.L23
	movq	%xmm1, 28(%rsp)
.L23:
	cmpl	$7, %eax
	je	.L16
	movq	24(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm6
	movd	%xmm0, %edx
	movd	%xmm6, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jge	.L24
	movq	%xmm1, 24(%rsp)
.L24:
	cmpl	$6, %eax
	je	.L16
	movq	20(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm7
	movd	%xmm0, %edx
	movd	%xmm7, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jge	.L25
	movq	%xmm1, 20(%rsp)
.L25:
	cmpl	$5, %eax
	je	.L16
	movq	16(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm7
	movd	%xmm0, %edx
	movd	%xmm7, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jge	.L26
	movq	%xmm1, 16(%rsp)
.L26:
	cmpl	$4, %eax
	je	.L16
	movq	12(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm6
	movd	%xmm0, %edx
	movd	%xmm6, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jge	.L27
	movq	%xmm1, 12(%rsp)
.L27:
	cmpl	$3, %eax
	je	.L16
	movq	8(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm5
	movd	%xmm0, %edx
	movd	%xmm5, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jge	.L28
	movq	%xmm1, 8(%rsp)
.L28:
	cmpl	$2, %eax
	je	.L16
	movq	4(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm4
	movd	%xmm0, %edx
	movd	%xmm4, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jge	.L29
	movq	%xmm1, 4(%rsp)
.L29:
	testl	%eax, %eax
	jne	.L16
	movq	(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm3
	movd	%xmm0, %edx
	movd	%xmm3, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jge	.L16
	movq	%xmm1, (%rsp)
	.p2align 4,,10
	.p2align 3
.L16:
	addl	$1, %eax
.L14:
	movq	40(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %edx
	movd	%xmm2, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jge	.L19
	movq	%xmm1, 40(%rsp)
.L19:
	cmpl	$10, %eax
	jne	.L61
	movq	%rbp, %rdi
	call	check
	testl	%eax, %eax
	je	.L62
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L31:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L63
	addq	$72, %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
.L62:
	.cfi_restore_state
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L31
.L63:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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	check
	.type	check, @function
check:
.LFB23:
	.cfi_startproc
	endbr64
	movl	4(%rdi), %eax
	cmpl	%eax, (%rdi)
	jne	.L10
	cmpl	8(%rdi), %eax
	jne	.L10
	cmpl	12(%rdi), %eax
	jne	.L10
	movl	20(%rdi), %eax
	cmpl	%eax, 16(%rdi)
	jne	.L10
	cmpl	24(%rdi), %eax
	jne	.L10
	cmpl	28(%rdi), %eax
	jne	.L10
	movl	36(%rdi), %eax
	cmpl	%eax, 32(%rdi)
	jne	.L10
	cmpl	40(%rdi), %eax
	jne	.L10
	cmpl	%eax, 44(%rdi)
	sete	%al
	movzbl	%al, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	check, .-check
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"yes"
.LC2:
	.string	"no"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$72, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	leaq	48(%rsp), %r13
	movq	%rbp, %rbx
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%rbx, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%r13, %rbx
	jne	.L13
	xorl	%eax, %eax
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L61:
	movq	36(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm3
	movd	%xmm0, %edx
	movd	%xmm3, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jge	.L21
	movq	%xmm1, 36(%rsp)
.L21:
	cmpl	$9, %eax
	je	.L16
	movq	32(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm4
	movd	%xmm0, %edx
	movd	%xmm4, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jge	.L22
	movq	%xmm1, 32(%rsp)
.L22:
	cmpl	$8, %eax
	je	.L16
	movq	28(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm5
	movd	%xmm0, %edx
	movd	%xmm5, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jge	.L23
	movq	%xmm1, 28(%rsp)
.L23:
	cmpl	$7, %eax
	je	.L16
	movq	24(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm6
	movd	%xmm0, %edx
	movd	%xmm6, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jge	.L24
	movq	%xmm1, 24(%rsp)
.L24:
	cmpl	$6, %eax
	je	.L16
	movq	20(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm7
	movd	%xmm0, %edx
	movd	%xmm7, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jge	.L25
	movq	%xmm1, 20(%rsp)
.L25:
	cmpl	$5, %eax
	je	.L16
	movq	16(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm7
	movd	%xmm0, %edx
	movd	%xmm7, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jge	.L26
	movq	%xmm1, 16(%rsp)
.L26:
	cmpl	$4, %eax
	je	.L16
	movq	12(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm6
	movd	%xmm0, %edx
	movd	%xmm6, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jge	.L27
	movq	%xmm1, 12(%rsp)
.L27:
	cmpl	$3, %eax
	je	.L16
	movq	8(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm5
	movd	%xmm0, %edx
	movd	%xmm5, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jge	.L28
	movq	%xmm1, 8(%rsp)
.L28:
	cmpl	$2, %eax
	je	.L16
	movq	4(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm4
	movd	%xmm0, %edx
	movd	%xmm4, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jge	.L29
	movq	%xmm1, 4(%rsp)
.L29:
	testl	%eax, %eax
	jne	.L16
	movq	(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm3
	movd	%xmm0, %edx
	movd	%xmm3, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jge	.L16
	movq	%xmm1, (%rsp)
	.p2align 4,,10
	.p2align 3
.L16:
	addl	$1, %eax
.L14:
	movq	40(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %edx
	movd	%xmm2, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jge	.L19
	movq	%xmm1, 40(%rsp)
.L19:
	cmpl	$10, %eax
	jne	.L61
	movq	%rbp, %rdi
	call	check
	testl	%eax, %eax
	je	.L62
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L31:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L63
	addq	$72, %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
.L62:
	.cfi_restore_state
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L31
.L63:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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 check(int e[]){
	int i;
	for(i=0;i<3;i++){
		if(e[i]!=e[i+1])
			return 0;
	}
	for(i++;i<7;i++){
		if(e[i]!=e[i+1])
			return 0;
	}
	for(i++;i<11;i++){
		if(e[i]!=e[i+1])
			return 0;
	}
	return 1;
}
int main(void){
	int i,j,e[12];
	for(i=0;i<12;i++)
		scanf("%d",&e[i]);
	for(i=0;i<11;i++){
		for(j=11;j>i;j--){
			if(e[j-1]>e[j]){
				int tmp=e[j-1];
				e[j-1]=e[j];
				e[j]=tmp;
			}
		}
	}
	if(check(e))
		puts("yes");
	else
		puts("no");
	return 0;
}
1 1 2 2 3 1 1 3 3 3 1 2
 1 1 3 4 8 9 7 3 3 5 5 5
 1 0 2 2 3 1 1 3 3 3 1 2
 1 1 3 7 8 9 7 3 3 5 5 5
 0 0 2 2 3 1 1 3 3 3 1 2
 1 1 2 2 5 1 2 3 3 3 1 2
 1 1 3 4 8 9 3 3 4 5 5 5
 1 1 2 2 3 1 2 3 2 3 1 2
 1 1 3 4 8 9 7 3 3 4 5 5
 1 0 2 2 3 1 1 3 3 3 1 3

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 check(int e[]){
	int i;
	for(i=0;i<3;i++){
		if(e[i]!=e[i+1])
			return 0;
	}
	for(i++;i<7;i++){
		if(e[i]!=e[i+1])
			return 0;
	}
	for(i++;i<11;i++){
		if(e[i]!=e[i+1])
			return 0;
	}
	return 1;
}
int main(void){
	int i,j,e[12];
	for(i=0;i<12;i++)
		scanf("%d",&e[i]);
	for(i=0;i<11;i++){
		for(j=11;j>i;j--){
			if(e[j-1]>e[j]){
				int tmp=e[j-1];
				e[j-1]=e[j];
				e[j]=tmp;
			}
		}
	}
	if(check(e))
		puts("yes");
	else
		puts("no");
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	check
	.type	check, @function
check:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L5:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	je	.L3
	movl	$0, %eax
	jmp	.L4
.L3:
	addl	$1, -4(%rbp)
.L2:
	cmpl	$2, -4(%rbp)
	jle	.L5
	addl	$1, -4(%rbp)
	jmp	.L6
.L8:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	je	.L7
	movl	$0, %eax
	jmp	.L4
.L7:
	addl	$1, -4(%rbp)
.L6:
	cmpl	$6, -4(%rbp)
	jle	.L8
	addl	$1, -4(%rbp)
	jmp	.L9
.L11:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	je	.L10
	movl	$0, %eax
	jmp	.L4
.L10:
	addl	$1, -4(%rbp)
.L9:
	cmpl	$10, -4(%rbp)
	jle	.L11
	movl	$1, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	check, .-check
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"yes"
.LC2:
	.string	"no"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -76(%rbp)
	jmp	.L13
.L14:
	leaq	-64(%rbp), %rdx
	movl	-76(%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, -76(%rbp)
.L13:
	cmpl	$11, -76(%rbp)
	jle	.L14
	movl	$0, -76(%rbp)
	jmp	.L15
.L19:
	movl	$11, -72(%rbp)
	jmp	.L16
.L18:
	movl	-72(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-64(%rbp,%rax,4), %edx
	movl	-72(%rbp), %eax
	cltq
	movl	-64(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L17
	movl	-72(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-64(%rbp,%rax,4), %eax
	movl	%eax, -68(%rbp)
	movl	-72(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-72(%rbp), %eax
	cltq
	movl	-64(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -64(%rbp,%rax,4)
	movl	-72(%rbp), %eax
	cltq
	movl	-68(%rbp), %edx
	movl	%edx, -64(%rbp,%rax,4)
.L17:
	subl	$1, -72(%rbp)
.L16:
	movl	-72(%rbp), %eax
	cmpl	-76(%rbp), %eax
	jg	.L18
	addl	$1, -76(%rbp)
.L15:
	cmpl	$10, -76(%rbp)
	jle	.L19
	leaq	-64(%rbp), %rax
	movq	%rax, %rdi
	call	check
	testl	%eax, %eax
	je	.L20
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L21
.L20:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L21:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	check
	.type	check, @function
check:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L5:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	je	.L3
	movl	$0, %eax
	jmp	.L4
.L3:
	addl	$1, -4(%rbp)
.L2:
	cmpl	$2, -4(%rbp)
	jle	.L5
	addl	$1, -4(%rbp)
	jmp	.L6
.L8:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	je	.L7
	movl	$0, %eax
	jmp	.L4
.L7:
	addl	$1, -4(%rbp)
.L6:
	cmpl	$6, -4(%rbp)
	jle	.L8
	addl	$1, -4(%rbp)
	jmp	.L9
.L11:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	je	.L10
	movl	$0, %eax
	jmp	.L4
.L10:
	addl	$1, -4(%rbp)
.L9:
	cmpl	$10, -4(%rbp)
	jle	.L11
	movl	$1, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	check, .-check
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"yes"
.LC2:
	.string	"no"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -76(%rbp)
	jmp	.L13
.L14:
	leaq	-64(%rbp), %rdx
	movl	-76(%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, -76(%rbp)
.L13:
	cmpl	$11, -76(%rbp)
	jle	.L14
	movl	$0, -76(%rbp)
	jmp	.L15
.L19:
	movl	$11, -72(%rbp)
	jmp	.L16
.L18:
	movl	-72(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-64(%rbp,%rax,4), %edx
	movl	-72(%rbp), %eax
	cltq
	movl	-64(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L17
	movl	-72(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-64(%rbp,%rax,4), %eax
	movl	%eax, -68(%rbp)
	movl	-72(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-72(%rbp), %eax
	cltq
	movl	-64(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -64(%rbp,%rax,4)
	movl	-72(%rbp), %eax
	cltq
	movl	-68(%rbp), %edx
	movl	%edx, -64(%rbp,%rax,4)
.L17:
	subl	$1, -72(%rbp)
.L16:
	movl	-72(%rbp), %eax
	cmpl	-76(%rbp), %eax
	jg	.L18
	addl	$1, -76(%rbp)
.L15:
	cmpl	$10, -76(%rbp)
	jle	.L19
	leaq	-64(%rbp), %rax
	movq	%rax, %rdi
	call	check
	testl	%eax, %eax
	je	.L20
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L21
.L20:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L21:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
