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

```c
#include <stdio.h>
#include <stdlib.h>

typedef  long long TTYPE;

typedef struct queue{
	TTYPE data;
	struct queue *next;
}Que;

typedef struct head_que{
	Que head;
	Que *last;
	int size;
}HQue;

HQue *create_HQue(){
	HQue *hq;

	if((hq = (HQue *)malloc(sizeof(HQue))) == NULL){
		printf("could not malloc:Que\n");
		return NULL;
	}

	hq->head.data = 0;
	hq->head.next = NULL;
	hq->last = &(hq->head);
	hq->size = 0;

	return hq;
}

int push_Que(HQue *x, TTYPE data){
	Que *p;

	if((p = (Que *)malloc(sizeof(Que))) == NULL){
		printf("could not malloc:Que\n");
		return -1;
	}

	p->data = data;
	p->next = NULL;
	x->last->next = p;
	x->last = p;
	x->size += 1;

	return 0;
}

void pop_Que(HQue *x){
	Que *p;

	if(x->head.next == NULL){
		return;
	}

	p = x->head.next;
	x->head.next = p->next;
	if(x->last == p){
		x->last = &(x->head);
	}
	x->size -= 1;
	free(p);
}

TTYPE access(HQue *x){
	if(x->head.next == NULL){
		printf("error\n");
		return x->head.data;
	}
	return x->head.next->data;
}

int main(){
	int k;
	TTYPE i;
	HQue *p, *q;
	p = create_HQue();
	q = create_HQue();

	scanf("%d", &k);
	for(i=1; i<10; i++){
		push_Que(p, i);
	}

	while(1){
		if(k <= p->size){
			for(i=0; i<k-1; i++){
				pop_Que(p);
			}
			printf("%lld\n", access(p));
			break;
		}
		k -= p->size;

		HQue *tmp = p;
		p = q;
		q = tmp;
		while(q->size != 0){
			TTYPE x = access(q);
			for(i=-1; i<=1; i++){
				TTYPE d = x % 10 + i;
				if(d < 0 || d > 9){
					continue;
				}

				push_Que(p, x*10+d);
			}
			pop_Que(q);
		}
	}

	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"could not malloc:Que"
	.text
	.globl	create_HQue
	.type	create_HQue, @function
create_HQue:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$32, %edi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	jne	.L2
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L3
.L2:
	movq	-8(%rbp), %rax
	movq	$0, (%rax)
	movq	-8(%rbp), %rax
	movq	$0, 8(%rax)
	movq	-8(%rbp), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 16(%rax)
	movq	-8(%rbp), %rax
	movl	$0, 24(%rax)
	movq	-8(%rbp), %rax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	create_HQue, .-create_HQue
	.globl	push_Que
	.type	push_Que, @function
push_Que:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movl	$16, %edi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	jne	.L5
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$-1, %eax
	jmp	.L6
.L5:
	movq	-8(%rbp), %rax
	movq	-32(%rbp), %rdx
	movq	%rdx, (%rax)
	movq	-8(%rbp), %rax
	movq	$0, 8(%rax)
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, 8(%rax)
	movq	-24(%rbp), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, 16(%rax)
	movq	-24(%rbp), %rax
	movl	24(%rax), %eax
	leal	1(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, 24(%rax)
	movl	$0, %eax
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	push_Que, .-push_Que
	.globl	pop_Que
	.type	pop_Que, @function
pop_Que:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movq	-24(%rbp), %rax
	movq	8(%rax), %rax
	testq	%rax, %rax
	je	.L11
	movq	-24(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	8(%rax), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, 8(%rax)
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	cmpq	%rax, -8(%rbp)
	jne	.L10
	movq	-24(%rbp), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, 16(%rax)
.L10:
	movq	-24(%rbp), %rax
	movl	24(%rax), %eax
	leal	-1(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, 24(%rax)
	movq	-8(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	jmp	.L7
.L11:
	nop
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	pop_Que, .-pop_Que
	.section	.rodata
.LC1:
	.string	"error"
	.text
	.globl	access
	.type	access, @function
access:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	testq	%rax, %rax
	jne	.L13
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	jmp	.L14
.L13:
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	(%rax), %rax
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	access, .-access
	.section	.rodata
.LC2:
	.string	"%d"
.LC3:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, %eax
	call	create_HQue
	movq	%rax, -48(%rbp)
	movl	$0, %eax
	call	create_HQue
	movq	%rax, -40(%rbp)
	leaq	-60(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$1, -56(%rbp)
	jmp	.L16
.L17:
	movq	-56(%rbp), %rdx
	movq	-48(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	push_Que
	addq	$1, -56(%rbp)
.L16:
	cmpq	$9, -56(%rbp)
	jle	.L17
.L29:
	movq	-48(%rbp), %rax
	movl	24(%rax), %edx
	movl	-60(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L18
	movq	$0, -56(%rbp)
	jmp	.L19
.L20:
	movq	-48(%rbp), %rax
	movq	%rax, %rdi
	call	pop_Que
	addq	$1, -56(%rbp)
.L19:
	movl	-60(%rbp), %eax
	subl	$1, %eax
	cltq
	cmpq	%rax, -56(%rbp)
	jl	.L20
	movq	-48(%rbp), %rax
	movq	%rax, %rdi
	call	access
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	jmp	.L32
.L18:
	movl	-60(%rbp), %edx
	movq	-48(%rbp), %rax
	movl	24(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -60(%rbp)
	movq	-48(%rbp), %rax
	movq	%rax, -32(%rbp)
	movq	-40(%rbp), %rax
	movq	%rax, -48(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -40(%rbp)
	jmp	.L22
.L28:
	movq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	access
	movq	%rax, -24(%rbp)
	movq	$-1, -56(%rbp)
	jmp	.L23
.L27:
	movq	-24(%rbp), %rcx
	movabsq	$7378697629483820647, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$2, %rax
	movq	%rcx, %rsi
	sarq	$63, %rsi
	subq	%rsi, %rax
	movq	%rax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, -16(%rbp)
	cmpq	$0, -16(%rbp)
	js	.L33
	cmpq	$9, -16(%rbp)
	jg	.L33
	movq	-24(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rax, %rdx
	movq	-48(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	push_Que
	jmp	.L26
.L33:
	nop
.L26:
	addq	$1, -56(%rbp)
.L23:
	cmpq	$1, -56(%rbp)
	jle	.L27
	movq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	pop_Que
.L22:
	movq	-40(%rbp), %rax
	movl	24(%rax), %eax
	testl	%eax, %eax
	jne	.L28
	jmp	.L29
.L32:
	call	__stack_chk_fail@PLT
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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	"could not malloc:Que"
	.text
	.p2align 4
	.globl	create_HQue
	.type	create_HQue, @function
create_HQue:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	$32, %edi
	call	malloc@PLT
	movq	%rax, %r12
	testq	%rax, %rax
	je	.L6
	movq	$0, (%rax)
	movq	$0, 8(%rax)
	movq	%rax, 16(%r12)
	movl	$0, 24(%rax)
.L1:
	movq	%r12, %rax
	popq	%r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L6:
	.cfi_restore_state
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
	jmp	.L1
	.cfi_endproc
.LFE39:
	.size	create_HQue, .-create_HQue
	.p2align 4
	.globl	push_Que
	.type	push_Que, @function
push_Que:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movq	%rdi, %rbx
	movl	$16, %edi
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	call	malloc@PLT
	testq	%rax, %rax
	je	.L11
	movq	16(%rbx), %rdx
	movq	%rbp, (%rax)
	movq	$0, 8(%rax)
	movq	%rax, 8(%rdx)
	addl	$1, 24(%rbx)
	movq	%rax, 16(%rbx)
	xorl	%eax, %eax
.L7:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L11:
	.cfi_restore_state
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
	orl	$-1, %eax
	jmp	.L7
	.cfi_endproc
.LFE40:
	.size	push_Que, .-push_Que
	.p2align 4
	.globl	pop_Que
	.type	pop_Que, @function
pop_Que:
.LFB41:
	.cfi_startproc
	endbr64
	movq	8(%rdi), %r8
	testq	%r8, %r8
	je	.L12
	movq	8(%r8), %rax
	movq	%rax, 8(%rdi)
	cmpq	16(%rdi), %r8
	je	.L15
	subl	$1, 24(%rdi)
	movq	%r8, %rdi
	jmp	free@PLT
	.p2align 4,,10
	.p2align 3
.L15:
	subl	$1, 24(%rdi)
	movq	%rdi, 16(%rdi)
	movq	%r8, %rdi
	jmp	free@PLT
	.p2align 4,,10
	.p2align 3
.L12:
	ret
	.cfi_endproc
.LFE41:
	.size	pop_Que, .-pop_Que
	.section	.rodata.str1.1
.LC1:
	.string	"error"
	.text
	.p2align 4
	.globl	access
	.type	access, @function
access:
.LFB42:
	.cfi_startproc
	endbr64
	movq	8(%rdi), %rax
	testq	%rax, %rax
	je	.L23
	movq	(%rax), %rax
	ret
	.p2align 4,,10
	.p2align 3
.L23:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	%rdi, %rbx
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	movq	(%rbx), %rax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE42:
	.size	access, .-access
	.section	.rodata.str1.1
.LC2:
	.string	"%d"
.LC3:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB43:
	.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
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	$1, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	call	create_HQue
	movq	%rax, %rbp
	xorl	%eax, %eax
	call	create_HQue
	leaq	4(%rsp), %rsi
	leaq	.LC2(%rip), %rdi
	movq	%rax, %r14
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	.p2align 4,,10
	.p2align 3
.L27:
	movl	$16, %edi
	call	malloc@PLT
	testq	%rax, %rax
	je	.L62
	movq	16(%rbp), %rdx
	movq	%rbx, (%rax)
	movq	$0, 8(%rax)
	movq	%rax, 8(%rdx)
	addl	$1, 24(%rbp)
	movq	%rax, 16(%rbp)
.L26:
	addq	$1, %rbx
	cmpq	$10, %rbx
	jne	.L27
	movl	24(%rbp), %eax
	movl	4(%rsp), %edx
	movabsq	$7378697629483820647, %r12
	cmpl	%eax, %edx
	jle	.L63
	.p2align 4,,10
	.p2align 3
.L29:
	subl	%eax, %edx
	movl	%edx, 4(%rsp)
.L45:
	testl	%eax, %eax
	je	.L64
.L47:
	movq	8(%rbp), %rax
	testq	%rax, %rax
	je	.L65
	movq	(%rax), %r13
.L38:
	movq	%r13, %rax
	movq	%r13, %rbx
	imulq	%r12
	movq	%r13, %rax
	sarq	$63, %rax
	sarq	$2, %rdx
	subq	%rax, %rdx
	leaq	(%rdx,%rdx,4), %rax
	addq	%rax, %rax
	subq	%rax, %rbx
	leaq	-1(%rbx), %rax
	cmpq	$9, %rax
	ja	.L39
	leaq	0(%r13,%r13,4), %rdx
	movl	$16, %edi
	leaq	(%rax,%rdx,2), %r15
	call	malloc@PLT
	testq	%rax, %rax
	je	.L40
	movq	16(%r14), %rdx
	movq	%r15, (%rax)
	movq	$0, 8(%rax)
	movq	%rax, 8(%rdx)
	addl	$1, 24(%r14)
	movq	%rax, 16(%r14)
.L39:
	cmpq	$9, %rbx
	ja	.L41
	leaq	0(%r13,%r13,4), %rax
	movl	$16, %edi
	leaq	(%rbx,%rax,2), %r15
	call	malloc@PLT
	testq	%rax, %rax
	je	.L42
	movq	16(%r14), %rdx
	movq	%r15, (%rax)
	movq	$0, 8(%rax)
	movq	%rax, 8(%rdx)
	addl	$1, 24(%r14)
	movq	%rax, 16(%r14)
.L41:
	addq	$1, %rbx
	cmpq	$9, %rbx
	ja	.L43
	leaq	0(%r13,%r13,4), %rax
	movl	$16, %edi
	leaq	(%rbx,%rax,2), %rbx
	call	malloc@PLT
	testq	%rax, %rax
	je	.L44
	movq	16(%r14), %rdx
	movq	%rbx, (%rax)
	movq	$0, 8(%rax)
	movq	%rax, 8(%rdx)
	addl	$1, 24(%r14)
	movq	%rax, 16(%r14)
.L43:
	movq	8(%rbp), %rdi
	movl	24(%rbp), %eax
	testq	%rdi, %rdi
	je	.L45
	movq	8(%rdi), %rdx
	movq	%rdx, 8(%rbp)
	cmpq	16(%rbp), %rdi
	je	.L66
.L46:
	subl	$1, %eax
	movl	%eax, 24(%rbp)
	call	free@PLT
	movl	24(%rbp), %eax
	testl	%eax, %eax
	jne	.L47
.L64:
	movl	24(%r14), %eax
	movl	4(%rsp), %edx
	cmpl	%edx, %eax
	jge	.L28
	movq	%rbp, %rcx
	movq	%r14, %rbp
	movq	%rcx, %r14
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L66:
	movq	%rbp, 16(%rbp)
	jmp	.L46
	.p2align 4,,10
	.p2align 3
.L65:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	movq	0(%rbp), %r13
	jmp	.L38
.L63:
	movq	%rbp, %r14
.L28:
	movq	8(%r14), %rdi
	cmpl	$1, %edx
	jle	.L30
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L33:
	testq	%rdi, %rdi
	je	.L31
	movq	8(%rdi), %rax
	movq	%rax, 8(%r14)
	cmpq	%rdi, 16(%r14)
	je	.L67
.L32:
	subl	$1, 24(%r14)
	addq	$1, %rbx
	call	free@PLT
	movl	4(%rsp), %eax
	movq	8(%r14), %rdi
	subl	$1, %eax
	cltq
	cmpq	%rbx, %rax
	jg	.L33
.L30:
	testq	%rdi, %rdi
	je	.L31
	movq	(%rdi), %rdx
.L35:
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L68
	addq	$24, %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
.L67:
	.cfi_restore_state
	movq	%r14, 16(%r14)
	jmp	.L32
.L31:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	movq	(%r14), %rdx
	jmp	.L35
.L44:
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
	jmp	.L43
.L42:
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
	jmp	.L41
.L40:
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
	jmp	.L39
.L62:
	movq	%r12, %rdi
	call	puts@PLT
	jmp	.L26
.L68:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE43:
	.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	"could not malloc:Que"
	.text
	.p2align 4
	.globl	create_HQue
	.type	create_HQue, @function
create_HQue:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	$32, %edi
	call	malloc@PLT
	movq	%rax, %r12
	testq	%rax, %rax
	je	.L6
	movq	$0, (%rax)
	movq	$0, 8(%rax)
	movq	%rax, 16(%r12)
	movl	$0, 24(%rax)
.L1:
	movq	%r12, %rax
	popq	%r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L6:
	.cfi_restore_state
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
	jmp	.L1
	.cfi_endproc
.LFE39:
	.size	create_HQue, .-create_HQue
	.p2align 4
	.globl	push_Que
	.type	push_Que, @function
push_Que:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movq	%rdi, %rbx
	movl	$16, %edi
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	call	malloc@PLT
	testq	%rax, %rax
	je	.L11
	movq	16(%rbx), %rdx
	movq	%rbp, (%rax)
	movq	$0, 8(%rax)
	movq	%rax, 8(%rdx)
	addl	$1, 24(%rbx)
	movq	%rax, 16(%rbx)
	xorl	%eax, %eax
.L7:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L11:
	.cfi_restore_state
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
	orl	$-1, %eax
	jmp	.L7
	.cfi_endproc
.LFE40:
	.size	push_Que, .-push_Que
	.p2align 4
	.globl	pop_Que
	.type	pop_Que, @function
pop_Que:
.LFB41:
	.cfi_startproc
	endbr64
	movq	8(%rdi), %r8
	testq	%r8, %r8
	je	.L12
	movq	8(%r8), %rax
	movq	%rax, 8(%rdi)
	cmpq	16(%rdi), %r8
	je	.L15
	subl	$1, 24(%rdi)
	movq	%r8, %rdi
	jmp	free@PLT
	.p2align 4,,10
	.p2align 3
.L15:
	subl	$1, 24(%rdi)
	movq	%rdi, 16(%rdi)
	movq	%r8, %rdi
	jmp	free@PLT
	.p2align 4,,10
	.p2align 3
.L12:
	ret
	.cfi_endproc
.LFE41:
	.size	pop_Que, .-pop_Que
	.section	.rodata.str1.1
.LC1:
	.string	"error"
	.text
	.p2align 4
	.globl	access
	.type	access, @function
access:
.LFB42:
	.cfi_startproc
	endbr64
	movq	8(%rdi), %rax
	testq	%rax, %rax
	je	.L23
	movq	(%rax), %rax
	ret
	.p2align 4,,10
	.p2align 3
.L23:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	%rdi, %rbx
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	movq	(%rbx), %rax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE42:
	.size	access, .-access
	.section	.rodata.str1.1
.LC2:
	.string	"%d"
.LC3:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB43:
	.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
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	$1, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	call	create_HQue
	movq	%rax, %rbp
	xorl	%eax, %eax
	call	create_HQue
	leaq	4(%rsp), %rsi
	leaq	.LC2(%rip), %rdi
	movq	%rax, %r14
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	.p2align 4,,10
	.p2align 3
.L27:
	movl	$16, %edi
	call	malloc@PLT
	testq	%rax, %rax
	je	.L62
	movq	16(%rbp), %rdx
	movq	%rbx, (%rax)
	movq	$0, 8(%rax)
	movq	%rax, 8(%rdx)
	addl	$1, 24(%rbp)
	movq	%rax, 16(%rbp)
.L26:
	addq	$1, %rbx
	cmpq	$10, %rbx
	jne	.L27
	movl	24(%rbp), %eax
	movl	4(%rsp), %edx
	movabsq	$7378697629483820647, %r12
	cmpl	%eax, %edx
	jle	.L63
	.p2align 4,,10
	.p2align 3
.L29:
	subl	%eax, %edx
	movl	%edx, 4(%rsp)
.L45:
	testl	%eax, %eax
	je	.L64
.L47:
	movq	8(%rbp), %rax
	testq	%rax, %rax
	je	.L65
	movq	(%rax), %r13
.L38:
	movq	%r13, %rax
	movq	%r13, %rbx
	imulq	%r12
	movq	%r13, %rax
	sarq	$63, %rax
	sarq	$2, %rdx
	subq	%rax, %rdx
	leaq	(%rdx,%rdx,4), %rax
	addq	%rax, %rax
	subq	%rax, %rbx
	leaq	-1(%rbx), %rax
	cmpq	$9, %rax
	ja	.L39
	leaq	0(%r13,%r13,4), %rdx
	movl	$16, %edi
	leaq	(%rax,%rdx,2), %r15
	call	malloc@PLT
	testq	%rax, %rax
	je	.L40
	movq	16(%r14), %rdx
	movq	%r15, (%rax)
	movq	$0, 8(%rax)
	movq	%rax, 8(%rdx)
	addl	$1, 24(%r14)
	movq	%rax, 16(%r14)
.L39:
	cmpq	$9, %rbx
	ja	.L41
	leaq	0(%r13,%r13,4), %rax
	movl	$16, %edi
	leaq	(%rbx,%rax,2), %r15
	call	malloc@PLT
	testq	%rax, %rax
	je	.L42
	movq	16(%r14), %rdx
	movq	%r15, (%rax)
	movq	$0, 8(%rax)
	movq	%rax, 8(%rdx)
	addl	$1, 24(%r14)
	movq	%rax, 16(%r14)
.L41:
	addq	$1, %rbx
	cmpq	$9, %rbx
	ja	.L43
	leaq	0(%r13,%r13,4), %rax
	movl	$16, %edi
	leaq	(%rbx,%rax,2), %rbx
	call	malloc@PLT
	testq	%rax, %rax
	je	.L44
	movq	16(%r14), %rdx
	movq	%rbx, (%rax)
	movq	$0, 8(%rax)
	movq	%rax, 8(%rdx)
	addl	$1, 24(%r14)
	movq	%rax, 16(%r14)
.L43:
	movq	8(%rbp), %rdi
	movl	24(%rbp), %eax
	testq	%rdi, %rdi
	je	.L45
	movq	8(%rdi), %rdx
	movq	%rdx, 8(%rbp)
	cmpq	16(%rbp), %rdi
	je	.L66
.L46:
	subl	$1, %eax
	movl	%eax, 24(%rbp)
	call	free@PLT
	movl	24(%rbp), %eax
	testl	%eax, %eax
	jne	.L47
.L64:
	movl	24(%r14), %eax
	movl	4(%rsp), %edx
	cmpl	%edx, %eax
	jge	.L28
	movq	%rbp, %rcx
	movq	%r14, %rbp
	movq	%rcx, %r14
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L66:
	movq	%rbp, 16(%rbp)
	jmp	.L46
	.p2align 4,,10
	.p2align 3
.L65:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	movq	0(%rbp), %r13
	jmp	.L38
.L63:
	movq	%rbp, %r14
.L28:
	movq	8(%r14), %rdi
	cmpl	$1, %edx
	jle	.L30
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L33:
	testq	%rdi, %rdi
	je	.L31
	movq	8(%rdi), %rax
	movq	%rax, 8(%r14)
	cmpq	%rdi, 16(%r14)
	je	.L67
.L32:
	subl	$1, 24(%r14)
	addq	$1, %rbx
	call	free@PLT
	movl	4(%rsp), %eax
	movq	8(%r14), %rdi
	subl	$1, %eax
	cltq
	cmpq	%rbx, %rax
	jg	.L33
.L30:
	testq	%rdi, %rdi
	je	.L31
	movq	(%rdi), %rdx
.L35:
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L68
	addq	$24, %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
.L67:
	.cfi_restore_state
	movq	%r14, 16(%r14)
	jmp	.L32
.L31:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	movq	(%r14), %rdx
	jmp	.L35
.L44:
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
	jmp	.L43
.L42:
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
	jmp	.L41
.L40:
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
	jmp	.L39
.L62:
	movq	%r12, %rdi
	call	puts@PLT
	jmp	.L26
.L68:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE43:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>
#include <stdlib.h>

typedef  long long TTYPE;

typedef struct queue{
	TTYPE data;
	struct queue *next;
}Que;

typedef struct head_que{
	Que head;
	Que *last;
	int size;
}HQue;

HQue *create_HQue(){
	HQue *hq;

	if((hq = (HQue *)malloc(sizeof(HQue))) == NULL){
		printf("could not malloc:Que\n");
		return NULL;
	}

	hq->head.data = 0;
	hq->head.next = NULL;
	hq->last = &(hq->head);
	hq->size = 0;

	return hq;
}

int push_Que(HQue *x, TTYPE data){
	Que *p;

	if((p = (Que *)malloc(sizeof(Que))) == NULL){
		printf("could not malloc:Que\n");
		return -1;
	}

	p->data = data;
	p->next = NULL;
	x->last->next = p;
	x->last = p;
	x->size += 1;

	return 0;
}

void pop_Que(HQue *x){
	Que *p;

	if(x->head.next == NULL){
		return;
	}

	p = x->head.next;
	x->head.next = p->next;
	if(x->last == p){
		x->last = &(x->head);
	}
	x->size -= 1;
	free(p);
}

TTYPE access(HQue *x){
	if(x->head.next == NULL){
		printf("error\n");
		return x->head.data;
	}
	return x->head.next->data;
}

int main(){
	int k;
	TTYPE i;
	HQue *p, *q;
	p = create_HQue();
	q = create_HQue();

	scanf("%d", &k);
	for(i=1; i<10; i++){
		push_Que(p, i);
	}

	while(1){
		if(k <= p->size){
			for(i=0; i<k-1; i++){
				pop_Que(p);
			}
			printf("%lld\n", access(p));
			break;
		}
		k -= p->size;

		HQue *tmp = p;
		p = q;
		q = tmp;
		while(q->size != 0){
			TTYPE x = access(q);
			for(i=-1; i<=1; i++){
				TTYPE d = x % 10 + i;
				if(d < 0 || d > 9){
					continue;
				}

				push_Que(p, x*10+d);
			}
			pop_Que(q);
		}
	}

	return 0;
}

8
 2
 12
 9
 20
 37
 10
 3
 5
 6

8
 2
 12
 9
 44
 101
 10
 3
 5
 6

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

```c
#include <stdio.h>
#include <stdlib.h>

typedef  long long TTYPE;

typedef struct queue{
	TTYPE data;
	struct queue *next;
}Que;

typedef struct head_que{
	Que head;
	Que *last;
	int size;
}HQue;

HQue *create_HQue(){
	HQue *hq;

	if((hq = (HQue *)malloc(sizeof(HQue))) == NULL){
		printf("could not malloc:Que\n");
		return NULL;
	}

	hq->head.data = 0;
	hq->head.next = NULL;
	hq->last = &(hq->head);
	hq->size = 0;

	return hq;
}

int push_Que(HQue *x, TTYPE data){
	Que *p;

	if((p = (Que *)malloc(sizeof(Que))) == NULL){
		printf("could not malloc:Que\n");
		return -1;
	}

	p->data = data;
	p->next = NULL;
	x->last->next = p;
	x->last = p;
	x->size += 1;

	return 0;
}

void pop_Que(HQue *x){
	Que *p;

	if(x->head.next == NULL){
		return;
	}

	p = x->head.next;
	x->head.next = p->next;
	if(x->last == p){
		x->last = &(x->head);
	}
	x->size -= 1;
	free(p);
}

TTYPE access(HQue *x){
	if(x->head.next == NULL){
		printf("error\n");
		return x->head.data;
	}
	return x->head.next->data;
}

int main(){
	int k;
	TTYPE i;
	HQue *p, *q;
	p = create_HQue();
	q = create_HQue();

	scanf("%d", &k);
	for(i=1; i<10; i++){
		push_Que(p, i);
	}

	while(1){
		if(k <= p->size){
			for(i=0; i<k-1; i++){
				pop_Que(p);
			}
			printf("%lld\n", access(p));
			break;
		}
		k -= p->size;

		HQue *tmp = p;
		p = q;
		q = tmp;
		while(q->size != 0){
			TTYPE x = access(q);
			for(i=-1; i<=1; i++){
				TTYPE d = x % 10 + i;
				if(d < 0 || d > 9){
					continue;
				}

				push_Que(p, x*10+d);
			}
			pop_Que(q);
		}
	}

	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"could not malloc:Que"
	.text
	.globl	create_HQue
	.type	create_HQue, @function
create_HQue:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$32, %edi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	jne	.L2
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L3
.L2:
	movq	-8(%rbp), %rax
	movq	$0, (%rax)
	movq	-8(%rbp), %rax
	movq	$0, 8(%rax)
	movq	-8(%rbp), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 16(%rax)
	movq	-8(%rbp), %rax
	movl	$0, 24(%rax)
	movq	-8(%rbp), %rax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	create_HQue, .-create_HQue
	.globl	push_Que
	.type	push_Que, @function
push_Que:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movl	$16, %edi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	jne	.L5
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$-1, %eax
	jmp	.L6
.L5:
	movq	-8(%rbp), %rax
	movq	-32(%rbp), %rdx
	movq	%rdx, (%rax)
	movq	-8(%rbp), %rax
	movq	$0, 8(%rax)
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, 8(%rax)
	movq	-24(%rbp), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, 16(%rax)
	movq	-24(%rbp), %rax
	movl	24(%rax), %eax
	leal	1(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, 24(%rax)
	movl	$0, %eax
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	push_Que, .-push_Que
	.globl	pop_Que
	.type	pop_Que, @function
pop_Que:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movq	-24(%rbp), %rax
	movq	8(%rax), %rax
	testq	%rax, %rax
	je	.L11
	movq	-24(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	8(%rax), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, 8(%rax)
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	cmpq	%rax, -8(%rbp)
	jne	.L10
	movq	-24(%rbp), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, 16(%rax)
.L10:
	movq	-24(%rbp), %rax
	movl	24(%rax), %eax
	leal	-1(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, 24(%rax)
	movq	-8(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	jmp	.L7
.L11:
	nop
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	pop_Que, .-pop_Que
	.section	.rodata
.LC1:
	.string	"error"
	.text
	.globl	access
	.type	access, @function
access:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	testq	%rax, %rax
	jne	.L13
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	jmp	.L14
.L13:
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	(%rax), %rax
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	access, .-access
	.section	.rodata
.LC2:
	.string	"%d"
.LC3:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, %eax
	call	create_HQue
	movq	%rax, -48(%rbp)
	movl	$0, %eax
	call	create_HQue
	movq	%rax, -40(%rbp)
	leaq	-60(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$1, -56(%rbp)
	jmp	.L16
.L17:
	movq	-56(%rbp), %rdx
	movq	-48(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	push_Que
	addq	$1, -56(%rbp)
.L16:
	cmpq	$9, -56(%rbp)
	jle	.L17
.L29:
	movq	-48(%rbp), %rax
	movl	24(%rax), %edx
	movl	-60(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L18
	movq	$0, -56(%rbp)
	jmp	.L19
.L20:
	movq	-48(%rbp), %rax
	movq	%rax, %rdi
	call	pop_Que
	addq	$1, -56(%rbp)
.L19:
	movl	-60(%rbp), %eax
	subl	$1, %eax
	cltq
	cmpq	%rax, -56(%rbp)
	jl	.L20
	movq	-48(%rbp), %rax
	movq	%rax, %rdi
	call	access
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	jmp	.L32
.L18:
	movl	-60(%rbp), %edx
	movq	-48(%rbp), %rax
	movl	24(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -60(%rbp)
	movq	-48(%rbp), %rax
	movq	%rax, -32(%rbp)
	movq	-40(%rbp), %rax
	movq	%rax, -48(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -40(%rbp)
	jmp	.L22
.L28:
	movq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	access
	movq	%rax, -24(%rbp)
	movq	$-1, -56(%rbp)
	jmp	.L23
.L27:
	movq	-24(%rbp), %rcx
	movabsq	$7378697629483820647, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$2, %rax
	movq	%rcx, %rsi
	sarq	$63, %rsi
	subq	%rsi, %rax
	movq	%rax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, -16(%rbp)
	cmpq	$0, -16(%rbp)
	js	.L33
	cmpq	$9, -16(%rbp)
	jg	.L33
	movq	-24(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rax, %rdx
	movq	-48(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	push_Que
	jmp	.L26
.L33:
	nop
.L26:
	addq	$1, -56(%rbp)
.L23:
	cmpq	$1, -56(%rbp)
	jle	.L27
	movq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	pop_Que
.L22:
	movq	-40(%rbp), %rax
	movl	24(%rax), %eax
	testl	%eax, %eax
	jne	.L28
	jmp	.L29
.L32:
	call	__stack_chk_fail@PLT
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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	"could not malloc:Que"
	.text
	.globl	create_HQue
	.type	create_HQue, @function
create_HQue:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$32, %edi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	jne	.L2
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L3
.L2:
	movq	-8(%rbp), %rax
	movq	$0, (%rax)
	movq	-8(%rbp), %rax
	movq	$0, 8(%rax)
	movq	-8(%rbp), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 16(%rax)
	movq	-8(%rbp), %rax
	movl	$0, 24(%rax)
	movq	-8(%rbp), %rax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	create_HQue, .-create_HQue
	.globl	push_Que
	.type	push_Que, @function
push_Que:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movl	$16, %edi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	jne	.L5
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$-1, %eax
	jmp	.L6
.L5:
	movq	-8(%rbp), %rax
	movq	-32(%rbp), %rdx
	movq	%rdx, (%rax)
	movq	-8(%rbp), %rax
	movq	$0, 8(%rax)
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, 8(%rax)
	movq	-24(%rbp), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, 16(%rax)
	movq	-24(%rbp), %rax
	movl	24(%rax), %eax
	leal	1(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, 24(%rax)
	movl	$0, %eax
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	push_Que, .-push_Que
	.globl	pop_Que
	.type	pop_Que, @function
pop_Que:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movq	-24(%rbp), %rax
	movq	8(%rax), %rax
	testq	%rax, %rax
	je	.L11
	movq	-24(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	8(%rax), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, 8(%rax)
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	cmpq	%rax, -8(%rbp)
	jne	.L10
	movq	-24(%rbp), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, 16(%rax)
.L10:
	movq	-24(%rbp), %rax
	movl	24(%rax), %eax
	leal	-1(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, 24(%rax)
	movq	-8(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	jmp	.L7
.L11:
	nop
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	pop_Que, .-pop_Que
	.section	.rodata
.LC1:
	.string	"error"
	.text
	.globl	access
	.type	access, @function
access:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	testq	%rax, %rax
	jne	.L13
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	jmp	.L14
.L13:
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	(%rax), %rax
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	access, .-access
	.section	.rodata
.LC2:
	.string	"%d"
.LC3:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, %eax
	call	create_HQue
	movq	%rax, -48(%rbp)
	movl	$0, %eax
	call	create_HQue
	movq	%rax, -40(%rbp)
	leaq	-60(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$1, -56(%rbp)
	jmp	.L16
.L17:
	movq	-56(%rbp), %rdx
	movq	-48(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	push_Que
	addq	$1, -56(%rbp)
.L16:
	cmpq	$9, -56(%rbp)
	jle	.L17
.L29:
	movq	-48(%rbp), %rax
	movl	24(%rax), %edx
	movl	-60(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L18
	movq	$0, -56(%rbp)
	jmp	.L19
.L20:
	movq	-48(%rbp), %rax
	movq	%rax, %rdi
	call	pop_Que
	addq	$1, -56(%rbp)
.L19:
	movl	-60(%rbp), %eax
	subl	$1, %eax
	cltq
	cmpq	%rax, -56(%rbp)
	jl	.L20
	movq	-48(%rbp), %rax
	movq	%rax, %rdi
	call	access
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	jmp	.L32
.L18:
	movl	-60(%rbp), %edx
	movq	-48(%rbp), %rax
	movl	24(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -60(%rbp)
	movq	-48(%rbp), %rax
	movq	%rax, -32(%rbp)
	movq	-40(%rbp), %rax
	movq	%rax, -48(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -40(%rbp)
	jmp	.L22
.L28:
	movq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	access
	movq	%rax, -24(%rbp)
	movq	$-1, -56(%rbp)
	jmp	.L23
.L27:
	movq	-24(%rbp), %rcx
	movabsq	$7378697629483820647, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$2, %rax
	movq	%rcx, %rsi
	sarq	$63, %rsi
	subq	%rsi, %rax
	movq	%rax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, -16(%rbp)
	cmpq	$0, -16(%rbp)
	js	.L33
	cmpq	$9, -16(%rbp)
	jg	.L33
	movq	-24(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rax, %rdx
	movq	-48(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	push_Que
	jmp	.L26
.L33:
	nop
.L26:
	addq	$1, -56(%rbp)
.L23:
	cmpq	$1, -56(%rbp)
	jle	.L27
	movq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	pop_Que
.L22:
	movq	-40(%rbp), %rax
	movl	24(%rax), %eax
	testl	%eax, %eax
	jne	.L28
	jmp	.L29
.L32:
	call	__stack_chk_fail@PLT
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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:
