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>
#define END 2100000000

typedef struct cell{
	int data;
	struct cell *left;
	struct cell *right;
}cell;

cell * makecell(int x){
	cell *new=malloc(sizeof(cell));
	new->data=x;
	new->left=NULL;
	new->right=NULL;
	return new;
}

int main(){
	int q,com,x;
	cell *new;
	cell *front=makecell(END);
	cell *p=front;
	
	scanf("%d",&q);
	
	for(int i=0;i<q;i++){
		
		scanf("%d",&com);
		
		if(com==0){
			scanf("%d",&x);
			new=makecell(x);
			if(front==p){/*先頭*/
				front=new;
				new->right=p;
				p->left=new;
				p=new;
			}
			else {
				p->left->right=new;
				new->left=p->left;
				new->right=p;
				p->left=new;
				p=new;
			}
			
		}
		
		if(com==1){
			scanf("%d",&x);
			if(x>0)for(int j=0;j<x;j++)p=p->right;
			else for(int j=0;j<(-x);j++)p=p->left;
		}
		
		if(com==2){
			if(front==p){/*先頭*/
				p->right->left=NULL;
				front=front->right;
				p=front;
			}
			else {
				p->left->right=p->right;
				p->right->left=p->left;
				p=p->right;
			}
		}
	}

	
	p=front;
	while(p!=NULL){
		if(p->data!=END)printf("%d\n",p->data);
		p=p->right;
	}
	
	return 0;
	
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	makecell
	.type	makecell, @function
makecell:
.LFB6:
	.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
	movl	%edi, -20(%rbp)
	movl	$24, %edi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movl	-20(%rbp), %edx
	movl	%edx, (%rax)
	movq	-8(%rbp), %rax
	movq	$0, 8(%rax)
	movq	-8(%rbp), %rax
	movq	$0, 16(%rax)
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	makecell, .-makecell
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.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	$2100000000, %edi
	call	makecell
	movq	%rax, -32(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -24(%rbp)
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -44(%rbp)
	jmp	.L4
.L15:
	leaq	-52(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-52(%rbp), %eax
	testl	%eax, %eax
	jne	.L5
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %eax
	movl	%eax, %edi
	call	makecell
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	cmpq	-24(%rbp), %rax
	jne	.L6
	movq	-16(%rbp), %rax
	movq	%rax, -32(%rbp)
	movq	-16(%rbp), %rax
	movq	-24(%rbp), %rdx
	movq	%rdx, 16(%rax)
	movq	-24(%rbp), %rax
	movq	-16(%rbp), %rdx
	movq	%rdx, 8(%rax)
	movq	-16(%rbp), %rax
	movq	%rax, -24(%rbp)
	jmp	.L5
.L6:
	movq	-24(%rbp), %rax
	movq	8(%rax), %rax
	movq	-16(%rbp), %rdx
	movq	%rdx, 16(%rax)
	movq	-24(%rbp), %rax
	movq	8(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	%rdx, 8(%rax)
	movq	-16(%rbp), %rax
	movq	-24(%rbp), %rdx
	movq	%rdx, 16(%rax)
	movq	-24(%rbp), %rax
	movq	-16(%rbp), %rdx
	movq	%rdx, 8(%rax)
	movq	-16(%rbp), %rax
	movq	%rax, -24(%rbp)
.L5:
	movl	-52(%rbp), %eax
	cmpl	$1, %eax
	jne	.L7
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %eax
	testl	%eax, %eax
	jle	.L8
	movl	$0, -40(%rbp)
	jmp	.L9
.L10:
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -24(%rbp)
	addl	$1, -40(%rbp)
.L9:
	movl	-48(%rbp), %eax
	cmpl	%eax, -40(%rbp)
	jl	.L10
	jmp	.L7
.L8:
	movl	$0, -36(%rbp)
	jmp	.L11
.L12:
	movq	-24(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -24(%rbp)
	addl	$1, -36(%rbp)
.L11:
	movl	-48(%rbp), %eax
	negl	%eax
	cmpl	%eax, -36(%rbp)
	jl	.L12
.L7:
	movl	-52(%rbp), %eax
	cmpl	$2, %eax
	jne	.L13
	movq	-32(%rbp), %rax
	cmpq	-24(%rbp), %rax
	jne	.L14
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	$0, 8(%rax)
	movq	-32(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -24(%rbp)
	jmp	.L13
.L14:
	movq	-24(%rbp), %rax
	movq	8(%rax), %rax
	movq	-24(%rbp), %rdx
	movq	16(%rdx), %rdx
	movq	%rdx, 16(%rax)
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	-24(%rbp), %rdx
	movq	8(%rdx), %rdx
	movq	%rdx, 8(%rax)
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -24(%rbp)
.L13:
	addl	$1, -44(%rbp)
.L4:
	movl	-56(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L15
	movq	-32(%rbp), %rax
	movq	%rax, -24(%rbp)
	jmp	.L16
.L18:
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	cmpl	$2100000000, %eax
	je	.L17
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L17:
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -24(%rbp)
.L16:
	cmpq	$0, -24(%rbp)
	jne	.L18
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	makecell
	.type	makecell, @function
makecell:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	%edi, %ebx
	movl	$24, %edi
	call	malloc@PLT
	pxor	%xmm0, %xmm0
	movl	%ebx, (%rax)
	movups	%xmm0, 8(%rax)
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE39:
	.size	makecell, .-makecell
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$24, %edi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	call	malloc@PLT
	pxor	%xmm0, %xmm0
	leaq	28(%rsp), %rsi
	movq	%r13, %rdi
	movl	$2100000000, (%rax)
	movq	%rax, %rbx
	movups	%xmm0, 8(%rax)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L5
	movq	%rbx, %rbp
	leaq	32(%rsp), %r14
	leaq	36(%rsp), %r15
	xorl	%r12d, %r12d
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L11:
	addl	$1, %r12d
	cmpl	%r12d, 28(%rsp)
	jle	.L31
.L13:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %edx
	testl	%edx, %edx
	je	.L32
.L6:
	cmpl	$1, %edx
	je	.L33
.L8:
	cmpl	$2, %edx
	jne	.L11
	movq	16(%rbp), %rax
	cmpq	%rbp, %rbx
	je	.L34
	movq	8(%rbp), %rdx
	addl	$1, %r12d
	movq	%rax, %rbp
	movq	%rax, 16(%rdx)
	movq	%rdx, 8(%rax)
	cmpl	%r12d, 28(%rsp)
	jg	.L13
.L31:
	testq	%rbx, %rbx
	je	.L16
.L5:
	leaq	.LC1(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L17:
	movl	(%rbx), %edx
	cmpl	$2100000000, %edx
	je	.L14
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	16(%rbx), %rbx
	testq	%rbx, %rbx
	jne	.L17
.L16:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L35
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L32:
	.cfi_restore_state
	movq	%r15, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %edx
	movl	$24, %edi
	movl	%edx, 12(%rsp)
	call	malloc@PLT
	movl	12(%rsp), %edx
	movq	$0, 8(%rax)
	movl	%edx, (%rax)
	cmpq	%rbp, %rbx
	je	.L36
	movq	8(%rbp), %rdx
	movq	%rbp, %xmm1
	movq	%rax, 16(%rdx)
	movq	%rdx, %xmm0
	movl	32(%rsp), %edx
	punpcklqdq	%xmm1, %xmm0
	movups	%xmm0, 8(%rax)
	movq	%rax, 8(%rbp)
	movq	%rax, %rbp
	cmpl	$1, %edx
	jne	.L8
.L33:
	movq	%r15, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %ecx
	xorl	%eax, %eax
	testl	%ecx, %ecx
	jle	.L37
	.p2align 4,,10
	.p2align 3
.L9:
	addl	$1, %eax
	movq	16(%rbp), %rbp
	cmpl	%eax, %ecx
	jne	.L9
	movl	32(%rsp), %edx
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L14:
	movq	16(%rbx), %rbx
	testq	%rbx, %rbx
	jne	.L17
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L34:
	movq	16(%rbx), %rbx
	movq	$0, 8(%rax)
	movq	%rbx, %rbp
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L36:
	movq	%rbx, 16(%rax)
	movl	32(%rsp), %edx
	movq	%rax, %rbp
	movq	%rax, 8(%rbx)
	movq	%rax, %rbx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L37:
	movl	%ecx, %esi
	movl	32(%rsp), %edx
	negl	%esi
	testl	%ecx, %ecx
	je	.L8
	.p2align 4,,10
	.p2align 3
.L10:
	addl	$1, %eax
	movq	8(%rbp), %rbp
	cmpl	%esi, %eax
	jl	.L10
	jmp	.L8
.L35:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.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	makecell
	.type	makecell, @function
makecell:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	%edi, %ebx
	movl	$24, %edi
	call	malloc@PLT
	pxor	%xmm0, %xmm0
	movl	%ebx, (%rax)
	movups	%xmm0, 8(%rax)
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE39:
	.size	makecell, .-makecell
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$24, %edi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	call	malloc@PLT
	pxor	%xmm0, %xmm0
	leaq	28(%rsp), %rsi
	movq	%r13, %rdi
	movl	$2100000000, (%rax)
	movq	%rax, %rbx
	movups	%xmm0, 8(%rax)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L5
	movq	%rbx, %rbp
	leaq	32(%rsp), %r14
	leaq	36(%rsp), %r15
	xorl	%r12d, %r12d
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L11:
	addl	$1, %r12d
	cmpl	%r12d, 28(%rsp)
	jle	.L31
.L13:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %edx
	testl	%edx, %edx
	je	.L32
.L6:
	cmpl	$1, %edx
	je	.L33
.L8:
	cmpl	$2, %edx
	jne	.L11
	movq	16(%rbp), %rax
	cmpq	%rbp, %rbx
	je	.L34
	movq	8(%rbp), %rdx
	addl	$1, %r12d
	movq	%rax, %rbp
	movq	%rax, 16(%rdx)
	movq	%rdx, 8(%rax)
	cmpl	%r12d, 28(%rsp)
	jg	.L13
.L31:
	testq	%rbx, %rbx
	je	.L16
.L5:
	leaq	.LC1(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L17:
	movl	(%rbx), %edx
	cmpl	$2100000000, %edx
	je	.L14
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	16(%rbx), %rbx
	testq	%rbx, %rbx
	jne	.L17
.L16:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L35
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L32:
	.cfi_restore_state
	movq	%r15, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %edx
	movl	$24, %edi
	movl	%edx, 12(%rsp)
	call	malloc@PLT
	movl	12(%rsp), %edx
	movq	$0, 8(%rax)
	movl	%edx, (%rax)
	cmpq	%rbp, %rbx
	je	.L36
	movq	8(%rbp), %rdx
	movq	%rbp, %xmm1
	movq	%rax, 16(%rdx)
	movq	%rdx, %xmm0
	movl	32(%rsp), %edx
	punpcklqdq	%xmm1, %xmm0
	movups	%xmm0, 8(%rax)
	movq	%rax, 8(%rbp)
	movq	%rax, %rbp
	cmpl	$1, %edx
	jne	.L8
.L33:
	movq	%r15, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %ecx
	xorl	%eax, %eax
	testl	%ecx, %ecx
	jle	.L37
	.p2align 4,,10
	.p2align 3
.L9:
	addl	$1, %eax
	movq	16(%rbp), %rbp
	cmpl	%eax, %ecx
	jne	.L9
	movl	32(%rsp), %edx
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L14:
	movq	16(%rbx), %rbx
	testq	%rbx, %rbx
	jne	.L17
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L34:
	movq	16(%rbx), %rbx
	movq	$0, 8(%rax)
	movq	%rbx, %rbp
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L36:
	movq	%rbx, 16(%rax)
	movl	32(%rsp), %edx
	movq	%rax, %rbp
	movq	%rax, 8(%rbx)
	movq	%rax, %rbx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L37:
	movl	%ecx, %esi
	movl	32(%rsp), %edx
	negl	%esi
	testl	%ecx, %ecx
	je	.L8
	.p2align 4,,10
	.p2align 3
.L10:
	addl	$1, %eax
	movq	8(%rbp), %rbp
	cmpl	%esi, %eax
	jl	.L10
	jmp	.L8
.L35:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.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>
#define END 2100000000

typedef struct cell{
	int data;
	struct cell *left;
	struct cell *right;
}cell;

cell * makecell(int x){
	cell *new=malloc(sizeof(cell));
	new->data=x;
	new->left=NULL;
	new->right=NULL;
	return new;
}

int main(){
	int q,com,x;
	cell *new;
	cell *front=makecell(END);
	cell *p=front;
	
	scanf("%d",&q);
	
	for(int i=0;i<q;i++){
		
		scanf("%d",&com);
		
		if(com==0){
			scanf("%d",&x);
			new=makecell(x);
			if(front==p){/*先頭*/
				front=new;
				new->right=p;
				p->left=new;
				p=new;
			}
			else {
				p->left->right=new;
				new->left=p->left;
				new->right=p;
				p->left=new;
				p=new;
			}
			
		}
		
		if(com==1){
			scanf("%d",&x);
			if(x>0)for(int j=0;j<x;j++)p=p->right;
			else for(int j=0;j<(-x);j++)p=p->left;
		}
		
		if(com==2){
			if(front==p){/*先頭*/
				p->right->left=NULL;
				front=front->right;
				p=front;
			}
			else {
				p->left->right=p->right;
				p->right->left=p->left;
				p=p->right;
			}
		}
	}

	
	p=front;
	while(p!=NULL){
		if(p->data!=END)printf("%d\n",p->data);
		p=p->right;
	}
	
	return 0;
	
}

5
0 1
0 2
0 2
1 1
2
 5
0 1
0 2
0 2
0 1
2
 5
0 1
0 2
0 3
0 1
2
 5
0 1
0 2
0 4
1 1
2
 5
0 1
0 2
0 4
0 0
2
 5
0 1
0 0
0 2
0 0
2
 5
0 1
0 0
0 1
0 0
2
 5
0 1
0 0
0 1
1 0
2
 5
0 1
0 -1
0 1
1 0
2

2
1
 2
2
1
 3
2
1
 4
1
 4
2
1
 2
0
1
 1
0
1
 0
1
 -1
1

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>
#define END 2100000000

typedef struct cell{
	int data;
	struct cell *left;
	struct cell *right;
}cell;

cell * makecell(int x){
	cell *new=malloc(sizeof(cell));
	new->data=x;
	new->left=NULL;
	new->right=NULL;
	return new;
}

int main(){
	int q,com,x;
	cell *new;
	cell *front=makecell(END);
	cell *p=front;
	
	scanf("%d",&q);
	
	for(int i=0;i<q;i++){
		
		scanf("%d",&com);
		
		if(com==0){
			scanf("%d",&x);
			new=makecell(x);
			if(front==p){/*先頭*/
				front=new;
				new->right=p;
				p->left=new;
				p=new;
			}
			else {
				p->left->right=new;
				new->left=p->left;
				new->right=p;
				p->left=new;
				p=new;
			}
			
		}
		
		if(com==1){
			scanf("%d",&x);
			if(x>0)for(int j=0;j<x;j++)p=p->right;
			else for(int j=0;j<(-x);j++)p=p->left;
		}
		
		if(com==2){
			if(front==p){/*先頭*/
				p->right->left=NULL;
				front=front->right;
				p=front;
			}
			else {
				p->left->right=p->right;
				p->right->left=p->left;
				p=p->right;
			}
		}
	}

	
	p=front;
	while(p!=NULL){
		if(p->data!=END)printf("%d\n",p->data);
		p=p->right;
	}
	
	return 0;
	
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	makecell
	.type	makecell, @function
makecell:
.LFB6:
	.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
	movl	%edi, -20(%rbp)
	movl	$24, %edi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movl	-20(%rbp), %edx
	movl	%edx, (%rax)
	movq	-8(%rbp), %rax
	movq	$0, 8(%rax)
	movq	-8(%rbp), %rax
	movq	$0, 16(%rax)
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	makecell, .-makecell
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.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	$2100000000, %edi
	call	makecell
	movq	%rax, -32(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -24(%rbp)
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -44(%rbp)
	jmp	.L4
.L15:
	leaq	-52(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-52(%rbp), %eax
	testl	%eax, %eax
	jne	.L5
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %eax
	movl	%eax, %edi
	call	makecell
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	cmpq	-24(%rbp), %rax
	jne	.L6
	movq	-16(%rbp), %rax
	movq	%rax, -32(%rbp)
	movq	-16(%rbp), %rax
	movq	-24(%rbp), %rdx
	movq	%rdx, 16(%rax)
	movq	-24(%rbp), %rax
	movq	-16(%rbp), %rdx
	movq	%rdx, 8(%rax)
	movq	-16(%rbp), %rax
	movq	%rax, -24(%rbp)
	jmp	.L5
.L6:
	movq	-24(%rbp), %rax
	movq	8(%rax), %rax
	movq	-16(%rbp), %rdx
	movq	%rdx, 16(%rax)
	movq	-24(%rbp), %rax
	movq	8(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	%rdx, 8(%rax)
	movq	-16(%rbp), %rax
	movq	-24(%rbp), %rdx
	movq	%rdx, 16(%rax)
	movq	-24(%rbp), %rax
	movq	-16(%rbp), %rdx
	movq	%rdx, 8(%rax)
	movq	-16(%rbp), %rax
	movq	%rax, -24(%rbp)
.L5:
	movl	-52(%rbp), %eax
	cmpl	$1, %eax
	jne	.L7
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %eax
	testl	%eax, %eax
	jle	.L8
	movl	$0, -40(%rbp)
	jmp	.L9
.L10:
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -24(%rbp)
	addl	$1, -40(%rbp)
.L9:
	movl	-48(%rbp), %eax
	cmpl	%eax, -40(%rbp)
	jl	.L10
	jmp	.L7
.L8:
	movl	$0, -36(%rbp)
	jmp	.L11
.L12:
	movq	-24(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -24(%rbp)
	addl	$1, -36(%rbp)
.L11:
	movl	-48(%rbp), %eax
	negl	%eax
	cmpl	%eax, -36(%rbp)
	jl	.L12
.L7:
	movl	-52(%rbp), %eax
	cmpl	$2, %eax
	jne	.L13
	movq	-32(%rbp), %rax
	cmpq	-24(%rbp), %rax
	jne	.L14
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	$0, 8(%rax)
	movq	-32(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -24(%rbp)
	jmp	.L13
.L14:
	movq	-24(%rbp), %rax
	movq	8(%rax), %rax
	movq	-24(%rbp), %rdx
	movq	16(%rdx), %rdx
	movq	%rdx, 16(%rax)
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	-24(%rbp), %rdx
	movq	8(%rdx), %rdx
	movq	%rdx, 8(%rax)
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -24(%rbp)
.L13:
	addl	$1, -44(%rbp)
.L4:
	movl	-56(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L15
	movq	-32(%rbp), %rax
	movq	%rax, -24(%rbp)
	jmp	.L16
.L18:
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	cmpl	$2100000000, %eax
	je	.L17
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L17:
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -24(%rbp)
.L16:
	cmpq	$0, -24(%rbp)
	jne	.L18
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	makecell
	.type	makecell, @function
makecell:
.LFB6:
	.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
	movl	%edi, -20(%rbp)
	movl	$24, %edi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movl	-20(%rbp), %edx
	movl	%edx, (%rax)
	movq	-8(%rbp), %rax
	movq	$0, 8(%rax)
	movq	-8(%rbp), %rax
	movq	$0, 16(%rax)
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	makecell, .-makecell
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.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	$2100000000, %edi
	call	makecell
	movq	%rax, -32(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -24(%rbp)
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -44(%rbp)
	jmp	.L4
.L15:
	leaq	-52(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-52(%rbp), %eax
	testl	%eax, %eax
	jne	.L5
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %eax
	movl	%eax, %edi
	call	makecell
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	cmpq	-24(%rbp), %rax
	jne	.L6
	movq	-16(%rbp), %rax
	movq	%rax, -32(%rbp)
	movq	-16(%rbp), %rax
	movq	-24(%rbp), %rdx
	movq	%rdx, 16(%rax)
	movq	-24(%rbp), %rax
	movq	-16(%rbp), %rdx
	movq	%rdx, 8(%rax)
	movq	-16(%rbp), %rax
	movq	%rax, -24(%rbp)
	jmp	.L5
.L6:
	movq	-24(%rbp), %rax
	movq	8(%rax), %rax
	movq	-16(%rbp), %rdx
	movq	%rdx, 16(%rax)
	movq	-24(%rbp), %rax
	movq	8(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	%rdx, 8(%rax)
	movq	-16(%rbp), %rax
	movq	-24(%rbp), %rdx
	movq	%rdx, 16(%rax)
	movq	-24(%rbp), %rax
	movq	-16(%rbp), %rdx
	movq	%rdx, 8(%rax)
	movq	-16(%rbp), %rax
	movq	%rax, -24(%rbp)
.L5:
	movl	-52(%rbp), %eax
	cmpl	$1, %eax
	jne	.L7
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %eax
	testl	%eax, %eax
	jle	.L8
	movl	$0, -40(%rbp)
	jmp	.L9
.L10:
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -24(%rbp)
	addl	$1, -40(%rbp)
.L9:
	movl	-48(%rbp), %eax
	cmpl	%eax, -40(%rbp)
	jl	.L10
	jmp	.L7
.L8:
	movl	$0, -36(%rbp)
	jmp	.L11
.L12:
	movq	-24(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -24(%rbp)
	addl	$1, -36(%rbp)
.L11:
	movl	-48(%rbp), %eax
	negl	%eax
	cmpl	%eax, -36(%rbp)
	jl	.L12
.L7:
	movl	-52(%rbp), %eax
	cmpl	$2, %eax
	jne	.L13
	movq	-32(%rbp), %rax
	cmpq	-24(%rbp), %rax
	jne	.L14
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	$0, 8(%rax)
	movq	-32(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -24(%rbp)
	jmp	.L13
.L14:
	movq	-24(%rbp), %rax
	movq	8(%rax), %rax
	movq	-24(%rbp), %rdx
	movq	16(%rdx), %rdx
	movq	%rdx, 16(%rax)
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	-24(%rbp), %rdx
	movq	8(%rdx), %rdx
	movq	%rdx, 8(%rax)
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -24(%rbp)
.L13:
	addl	$1, -44(%rbp)
.L4:
	movl	-56(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L15
	movq	-32(%rbp), %rax
	movq	%rax, -24(%rbp)
	jmp	.L16
.L18:
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	cmpl	$2100000000, %eax
	je	.L17
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L17:
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -24(%rbp)
.L16:
	cmpq	$0, -24(%rbp)
	jne	.L18
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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:
