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 LARGE 100


int V,E;
int color=0;

typedef struct list{
	int id;
	struct list *next;
}list;


list * makelist(int x){
	list *new=malloc(sizeof(list));
	new->id=x;
	new->next=NULL;
	return new;
}

void list_insert(list* L[],int x,list *new){
	list **p=&L[x];
	
	while((*p)!=NULL){
		p=&((*p)->next);
	}
	(*p)=new;
	
	return;
}

int push(int stack[],int x,int top){
	stack[top++]=x;
	return top;
}

int pop(int stack[],int *top){
	(*top)--;
	return stack[*top];
}

int dfs(int C[],int x,list* L[]){
	int stack[LARGE];
	int top=0;
	int temp;
	list *p;
	
	color++;
	top=push(stack,x,top);
	while(top>0){
		temp=pop(stack,&top);
		if(C[temp]==0)C[temp]=color;
		p=L[temp];
		while(p!=NULL){
			if(p->id==x)return 0;
			if(C[p->id]==0){
				top=push(stack,p->id,top);
				C[p->id]=color;
			}
			p=p->next;
		}
	}
	
	return 1;
}

int main(){
	int i,j;
	int s,t;
	int x,y;
	list *L[LARGE];
	list *new;
	int C[LARGE];
	int flg;
	
	scanf("%d %d",&V,&E);
	
	for(i=0;i<V;i++){
		L[i]=NULL;
		C[i]=0;
	}
	
	for(i=0;i<E;i++){
		scanf("%d %d",&s,&t);
		new=makelist(t);
		list_insert(L,s,new);
	}
	
	for(i=0;i<V;i++){
		for(j=0;j<V;j++)C[j]=0;
		flg=dfs(C,i,L);
		if(!flg){
			printf("1\n");
			break;
		}
	}
	
	if(flg)printf("0\n");
	
	return 0;
	
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	V
	.bss
	.align 4
	.type	V, @object
	.size	V, 4
V:
	.zero	4
	.globl	E
	.align 4
	.type	E, @object
	.size	E, 4
E:
	.zero	4
	.globl	color
	.align 4
	.type	color, @object
	.size	color, 4
color:
	.zero	4
	.text
	.globl	makelist
	.type	makelist, @function
makelist:
.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	$16, %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
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	makelist, .-makelist
	.globl	list_insert
	.type	list_insert, @function
list_insert:
.LFB7:
	.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	%esi, -28(%rbp)
	movq	%rdx, -40(%rbp)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, -8(%rbp)
	jmp	.L4
.L5:
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	addq	$8, %rax
	movq	%rax, -8(%rbp)
.L4:
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	jne	.L5
	movq	-8(%rbp), %rax
	movq	-40(%rbp), %rdx
	movq	%rdx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	list_insert, .-list_insert
	.globl	push
	.type	push, @function
push:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movl	%edx, -16(%rbp)
	movl	-16(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -16(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rdx)
	movl	-16(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	push, .-push
	.globl	pop
	.type	pop, @function
pop:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	leal	-1(%rax), %edx
	movq	-16(%rbp), %rax
	movl	%edx, (%rax)
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	pop, .-pop
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$464, %rsp
	movq	%rdi, -440(%rbp)
	movl	%esi, -444(%rbp)
	movq	%rdx, -456(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -432(%rbp)
	movl	color(%rip), %eax
	addl	$1, %eax
	movl	%eax, color(%rip)
	movl	-432(%rbp), %edx
	movl	-444(%rbp), %ecx
	leaq	-416(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	push
	movl	%eax, -432(%rbp)
	jmp	.L12
.L19:
	leaq	-432(%rbp), %rdx
	leaq	-416(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	pop
	movl	%eax, -428(%rbp)
	movl	-428(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-440(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L13
	movl	-428(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-440(%rbp), %rax
	addq	%rax, %rdx
	movl	color(%rip), %eax
	movl	%eax, (%rdx)
.L13:
	movl	-428(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-456(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -424(%rbp)
	jmp	.L14
.L18:
	movq	-424(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -444(%rbp)
	jne	.L15
	movl	$0, %eax
	jmp	.L20
.L15:
	movq	-424(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-440(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L17
	movl	-432(%rbp), %edx
	movq	-424(%rbp), %rax
	movl	(%rax), %ecx
	leaq	-416(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	push
	movl	%eax, -432(%rbp)
	movq	-424(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-440(%rbp), %rax
	addq	%rax, %rdx
	movl	color(%rip), %eax
	movl	%eax, (%rdx)
.L17:
	movq	-424(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -424(%rbp)
.L14:
	cmpq	$0, -424(%rbp)
	jne	.L18
.L12:
	movl	-432(%rbp), %eax
	testl	%eax, %eax
	jg	.L19
	movl	$1, %eax
.L20:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	dfs, .-dfs
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"1"
.LC2:
	.string	"0"
	.text
	.globl	main
	.type	main, @function
main:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1248, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	E(%rip), %rax
	movq	%rax, %rdx
	leaq	V(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1236(%rbp)
	jmp	.L23
.L24:
	movl	-1236(%rbp), %eax
	cltq
	movq	$0, -816(%rbp,%rax,8)
	movl	-1236(%rbp), %eax
	cltq
	movl	$0, -1216(%rbp,%rax,4)
	addl	$1, -1236(%rbp)
.L23:
	movl	V(%rip), %eax
	cmpl	%eax, -1236(%rbp)
	jl	.L24
	movl	$0, -1236(%rbp)
	jmp	.L25
.L26:
	leaq	-1240(%rbp), %rdx
	leaq	-1244(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1240(%rbp), %eax
	movl	%eax, %edi
	call	makelist
	movq	%rax, -1224(%rbp)
	movl	-1244(%rbp), %ecx
	movq	-1224(%rbp), %rdx
	leaq	-816(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	list_insert
	addl	$1, -1236(%rbp)
.L25:
	movl	E(%rip), %eax
	cmpl	%eax, -1236(%rbp)
	jl	.L26
	movl	$0, -1236(%rbp)
	jmp	.L27
.L32:
	movl	$0, -1232(%rbp)
	jmp	.L28
.L29:
	movl	-1232(%rbp), %eax
	cltq
	movl	$0, -1216(%rbp,%rax,4)
	addl	$1, -1232(%rbp)
.L28:
	movl	V(%rip), %eax
	cmpl	%eax, -1232(%rbp)
	jl	.L29
	leaq	-816(%rbp), %rdx
	movl	-1236(%rbp), %ecx
	leaq	-1216(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	dfs
	movl	%eax, -1228(%rbp)
	cmpl	$0, -1228(%rbp)
	jne	.L30
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L31
.L30:
	addl	$1, -1236(%rbp)
.L27:
	movl	V(%rip), %eax
	cmpl	%eax, -1236(%rbp)
	jl	.L32
.L31:
	cmpl	$0, -1228(%rbp)
	je	.L33
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L33:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L35
	call	__stack_chk_fail@PLT
.L35:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.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	makelist
	.type	makelist, @function
makelist:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	%edi, %ebx
	movl	$16, %edi
	call	malloc@PLT
	movl	%ebx, (%rax)
	movq	$0, 8(%rax)
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE39:
	.size	makelist, .-makelist
	.p2align 4
	.globl	list_insert
	.type	list_insert, @function
list_insert:
.LFB40:
	.cfi_startproc
	endbr64
	movslq	%esi, %rsi
	leaq	(%rdi,%rsi,8), %rcx
	movq	(%rcx), %rax
	testq	%rax, %rax
	je	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rax, %rcx
	movq	8(%rax), %rax
	testq	%rax, %rax
	jne	.L6
	addq	$8, %rcx
.L5:
	movq	%rdx, (%rcx)
	ret
	.cfi_endproc
.LFE40:
	.size	list_insert, .-list_insert
	.p2align 4
	.globl	push
	.type	push, @function
push:
.LFB41:
	.cfi_startproc
	endbr64
	movslq	%edx, %rax
	movl	%esi, (%rdi,%rax,4)
	leal	1(%rdx), %eax
	ret
	.cfi_endproc
.LFE41:
	.size	push, .-push
	.p2align 4
	.globl	pop
	.type	pop, @function
pop:
.LFB42:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	subl	$1, %eax
	movl	%eax, (%rsi)
	cltq
	movl	(%rdi,%rax,4), %eax
	ret
	.cfi_endproc
.LFE42:
	.size	pop, .-pop
	.p2align 4
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB43:
	.cfi_startproc
	endbr64
	subq	$424, %rsp
	.cfi_def_cfa_offset 432
	movq	%rdi, %r8
	movq	%rdx, %r10
	movl	%esi, %edi
	movq	%fs:40, %rax
	movq	%rax, 408(%rsp)
	xorl	%eax, %eax
	addl	$1, color(%rip)
	movslq	%esi, %rax
	xorl	%ecx, %ecx
	movl	%esi, (%rsp)
.L21:
	leaq	(%r8,%rax,4), %rdx
	movl	(%rdx), %r11d
	testl	%r11d, %r11d
	jne	.L14
	movl	color(%rip), %esi
	movl	%esi, (%rdx)
.L14:
	movq	(%r10,%rax,8), %rax
	testq	%rax, %rax
	je	.L15
	.p2align 4,,10
	.p2align 3
.L20:
	movl	(%rax), %edx
	cmpl	%edi, %edx
	je	.L23
.L33:
	movslq	%edx, %rsi
	leaq	(%r8,%rsi,4), %rsi
	movl	(%rsi), %r9d
	testl	%r9d, %r9d
	jne	.L17
	leal	1(%rcx), %r9d
	movslq	%ecx, %rcx
	movq	8(%rax), %rax
	movl	%edx, (%rsp,%rcx,4)
	movl	color(%rip), %edx
	movl	%edx, (%rsi)
	testq	%rax, %rax
	je	.L19
	movl	(%rax), %edx
	movl	%r9d, %ecx
	cmpl	%edi, %edx
	jne	.L33
.L23:
	xorl	%eax, %eax
.L13:
	movq	408(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L34
	addq	$424, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	movq	8(%rax), %rax
	testq	%rax, %rax
	jne	.L20
.L15:
	testl	%ecx, %ecx
	je	.L25
	movl	%ecx, %r9d
.L19:
	leal	-1(%r9), %ecx
	movslq	%ecx, %rax
	movslq	(%rsp,%rax,4), %rax
	jmp	.L21
.L25:
	movl	$1, %eax
	jmp	.L13
.L34:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE43:
	.size	dfs, .-dfs
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"0"
.LC2:
	.string	"1"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB44:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	E(%rip), %rdx
	leaq	V(%rip), %rsi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %rdi
	subq	$1240, %rsp
	.cfi_def_cfa_offset 1296
	movq	%fs:40, %rax
	movq	%rax, 1224(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	V(%rip), %r13d
	testl	%r13d, %r13d
	jle	.L36
	movslq	%r13d, %r12
	leaq	416(%rsp), %rbx
	xorl	%esi, %esi
	leaq	0(,%r12,8), %rdx
	movq	%rbx, %rdi
	leaq	16(%rsp), %r14
	call	memset@PLT
	leaq	0(,%r12,4), %rdx
	xorl	%esi, %esi
	movq	%r14, %rdi
	call	memset@PLT
	movl	E(%rip), %eax
	testl	%eax, %eax
	jle	.L37
.L45:
	xorl	%r14d, %r14d
	leaq	12(%rsp), %r13
	leaq	8(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L40:
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	$16, %edi
	movl	12(%rsp), %r15d
	call	malloc@PLT
	movslq	8(%rsp), %rdx
	movl	%r15d, (%rax)
	leaq	(%rbx,%rdx,8), %rcx
	movq	$0, 8(%rax)
	movq	(%rcx), %rdx
	testq	%rdx, %rdx
	je	.L38
	.p2align 4,,10
	.p2align 3
.L39:
	movq	%rdx, %rcx
	movq	8(%rdx), %rdx
	testq	%rdx, %rdx
	jne	.L39
	addq	$8, %rcx
.L38:
	addl	$1, %r14d
	cmpl	%r14d, E(%rip)
	movq	%rax, (%rcx)
	jg	.L40
	movslq	V(%rip), %r12
	leaq	16(%rsp), %r14
	movq	%r12, %r13
	testl	%r12d, %r12d
	jle	.L44
.L37:
	xorl	%r15d, %r15d
	movl	$4, %ebp
	jmp	.L43
	.p2align 4,,10
	.p2align 3
.L42:
	movl	V(%rip), %r13d
	addl	$1, %r15d
	cmpl	%r15d, %r13d
	jle	.L44
	movslq	%r13d, %r12
.L43:
	testl	%r13d, %r13d
	leaq	0(,%r12,4), %rdx
	movq	%r14, %rdi
	cmovle	%rbp, %rdx
	xorl	%esi, %esi
	call	memset@PLT
	movq	%rbx, %rdx
	movl	%r15d, %esi
	movq	%r14, %rdi
	call	dfs
	testl	%eax, %eax
	jne	.L42
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L41
.L36:
	cmpl	$0, E(%rip)
	leaq	416(%rsp), %rbx
	jg	.L45
.L44:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L41:
	movq	1224(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L57
	addq	$1240, %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
.L57:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE44:
	.size	main, .-main
	.globl	color
	.bss
	.align 4
	.type	color, @object
	.size	color, 4
color:
	.zero	4
	.globl	E
	.align 4
	.type	E, @object
	.size	E, 4
E:
	.zero	4
	.globl	V
	.align 4
	.type	V, @object
	.size	V, 4
V:
	.zero	4
	.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	makelist
	.type	makelist, @function
makelist:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	%edi, %ebx
	movl	$16, %edi
	call	malloc@PLT
	movl	%ebx, (%rax)
	movq	$0, 8(%rax)
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE39:
	.size	makelist, .-makelist
	.p2align 4
	.globl	list_insert
	.type	list_insert, @function
list_insert:
.LFB40:
	.cfi_startproc
	endbr64
	movslq	%esi, %rsi
	leaq	(%rdi,%rsi,8), %rcx
	movq	(%rcx), %rax
	testq	%rax, %rax
	je	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rax, %rcx
	movq	8(%rax), %rax
	testq	%rax, %rax
	jne	.L6
	addq	$8, %rcx
.L5:
	movq	%rdx, (%rcx)
	ret
	.cfi_endproc
.LFE40:
	.size	list_insert, .-list_insert
	.p2align 4
	.globl	push
	.type	push, @function
push:
.LFB41:
	.cfi_startproc
	endbr64
	movslq	%edx, %rax
	movl	%esi, (%rdi,%rax,4)
	leal	1(%rdx), %eax
	ret
	.cfi_endproc
.LFE41:
	.size	push, .-push
	.p2align 4
	.globl	pop
	.type	pop, @function
pop:
.LFB42:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	subl	$1, %eax
	movl	%eax, (%rsi)
	cltq
	movl	(%rdi,%rax,4), %eax
	ret
	.cfi_endproc
.LFE42:
	.size	pop, .-pop
	.p2align 4
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB43:
	.cfi_startproc
	endbr64
	subq	$424, %rsp
	.cfi_def_cfa_offset 432
	movq	%rdi, %r8
	movq	%rdx, %r10
	movl	%esi, %edi
	movq	%fs:40, %rax
	movq	%rax, 408(%rsp)
	xorl	%eax, %eax
	addl	$1, color(%rip)
	movslq	%esi, %rax
	xorl	%ecx, %ecx
	movl	%esi, (%rsp)
.L21:
	leaq	(%r8,%rax,4), %rdx
	movl	(%rdx), %r11d
	testl	%r11d, %r11d
	jne	.L14
	movl	color(%rip), %esi
	movl	%esi, (%rdx)
.L14:
	movq	(%r10,%rax,8), %rax
	testq	%rax, %rax
	je	.L15
	.p2align 4,,10
	.p2align 3
.L20:
	movl	(%rax), %edx
	cmpl	%edi, %edx
	je	.L23
.L33:
	movslq	%edx, %rsi
	leaq	(%r8,%rsi,4), %rsi
	movl	(%rsi), %r9d
	testl	%r9d, %r9d
	jne	.L17
	leal	1(%rcx), %r9d
	movslq	%ecx, %rcx
	movq	8(%rax), %rax
	movl	%edx, (%rsp,%rcx,4)
	movl	color(%rip), %edx
	movl	%edx, (%rsi)
	testq	%rax, %rax
	je	.L19
	movl	(%rax), %edx
	movl	%r9d, %ecx
	cmpl	%edi, %edx
	jne	.L33
.L23:
	xorl	%eax, %eax
.L13:
	movq	408(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L34
	addq	$424, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	movq	8(%rax), %rax
	testq	%rax, %rax
	jne	.L20
.L15:
	testl	%ecx, %ecx
	je	.L25
	movl	%ecx, %r9d
.L19:
	leal	-1(%r9), %ecx
	movslq	%ecx, %rax
	movslq	(%rsp,%rax,4), %rax
	jmp	.L21
.L25:
	movl	$1, %eax
	jmp	.L13
.L34:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE43:
	.size	dfs, .-dfs
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"0"
.LC2:
	.string	"1"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB44:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	E(%rip), %rdx
	leaq	V(%rip), %rsi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %rdi
	subq	$1240, %rsp
	.cfi_def_cfa_offset 1296
	movq	%fs:40, %rax
	movq	%rax, 1224(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	V(%rip), %r13d
	testl	%r13d, %r13d
	jle	.L36
	movslq	%r13d, %r12
	leaq	416(%rsp), %rbx
	xorl	%esi, %esi
	leaq	0(,%r12,8), %rdx
	movq	%rbx, %rdi
	leaq	16(%rsp), %r14
	call	memset@PLT
	leaq	0(,%r12,4), %rdx
	xorl	%esi, %esi
	movq	%r14, %rdi
	call	memset@PLT
	movl	E(%rip), %eax
	testl	%eax, %eax
	jle	.L37
.L45:
	xorl	%r14d, %r14d
	leaq	12(%rsp), %r13
	leaq	8(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L40:
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	$16, %edi
	movl	12(%rsp), %r15d
	call	malloc@PLT
	movslq	8(%rsp), %rdx
	movl	%r15d, (%rax)
	leaq	(%rbx,%rdx,8), %rcx
	movq	$0, 8(%rax)
	movq	(%rcx), %rdx
	testq	%rdx, %rdx
	je	.L38
	.p2align 4,,10
	.p2align 3
.L39:
	movq	%rdx, %rcx
	movq	8(%rdx), %rdx
	testq	%rdx, %rdx
	jne	.L39
	addq	$8, %rcx
.L38:
	addl	$1, %r14d
	cmpl	%r14d, E(%rip)
	movq	%rax, (%rcx)
	jg	.L40
	movslq	V(%rip), %r12
	leaq	16(%rsp), %r14
	movq	%r12, %r13
	testl	%r12d, %r12d
	jle	.L44
.L37:
	xorl	%r15d, %r15d
	movl	$4, %ebp
	jmp	.L43
	.p2align 4,,10
	.p2align 3
.L42:
	movl	V(%rip), %r13d
	addl	$1, %r15d
	cmpl	%r15d, %r13d
	jle	.L44
	movslq	%r13d, %r12
.L43:
	testl	%r13d, %r13d
	leaq	0(,%r12,4), %rdx
	movq	%r14, %rdi
	cmovle	%rbp, %rdx
	xorl	%esi, %esi
	call	memset@PLT
	movq	%rbx, %rdx
	movl	%r15d, %esi
	movq	%r14, %rdi
	call	dfs
	testl	%eax, %eax
	jne	.L42
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L41
.L36:
	cmpl	$0, E(%rip)
	leaq	416(%rsp), %rbx
	jg	.L45
.L44:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L41:
	movq	1224(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L57
	addq	$1240, %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
.L57:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE44:
	.size	main, .-main
	.globl	color
	.bss
	.align 4
	.type	color, @object
	.size	color, 4
color:
	.zero	4
	.globl	E
	.align 4
	.type	E, @object
	.size	E, 4
E:
	.zero	4
	.globl	V
	.align 4
	.type	V, @object
	.size	V, 4
V:
	.zero	4
	.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 LARGE 100


int V,E;
int color=0;

typedef struct list{
	int id;
	struct list *next;
}list;


list * makelist(int x){
	list *new=malloc(sizeof(list));
	new->id=x;
	new->next=NULL;
	return new;
}

void list_insert(list* L[],int x,list *new){
	list **p=&L[x];
	
	while((*p)!=NULL){
		p=&((*p)->next);
	}
	(*p)=new;
	
	return;
}

int push(int stack[],int x,int top){
	stack[top++]=x;
	return top;
}

int pop(int stack[],int *top){
	(*top)--;
	return stack[*top];
}

int dfs(int C[],int x,list* L[]){
	int stack[LARGE];
	int top=0;
	int temp;
	list *p;
	
	color++;
	top=push(stack,x,top);
	while(top>0){
		temp=pop(stack,&top);
		if(C[temp]==0)C[temp]=color;
		p=L[temp];
		while(p!=NULL){
			if(p->id==x)return 0;
			if(C[p->id]==0){
				top=push(stack,p->id,top);
				C[p->id]=color;
			}
			p=p->next;
		}
	}
	
	return 1;
}

int main(){
	int i,j;
	int s,t;
	int x,y;
	list *L[LARGE];
	list *new;
	int C[LARGE];
	int flg;
	
	scanf("%d %d",&V,&E);
	
	for(i=0;i<V;i++){
		L[i]=NULL;
		C[i]=0;
	}
	
	for(i=0;i<E;i++){
		scanf("%d %d",&s,&t);
		new=makelist(t);
		list_insert(L,s,new);
	}
	
	for(i=0;i<V;i++){
		for(j=0;j<V;j++)C[j]=0;
		flg=dfs(C,i,L);
		if(!flg){
			printf("1\n");
			break;
		}
	}
	
	if(flg)printf("0\n");
	
	return 0;
	
}


5 3
0 1
0 2
1 2
 8 3
0 1
0 2
1 2
 8 3
0 2
0 2
1 2
 5 3
0 2
0 2
1 2
 11 3
0 1
0 2
1 2
 8 2
0 1
0 2
1 2
 8 3
1 2
0 2
1 2
 8 2
0 1
0 2
1 4
 8 2
0 1
0 2
2 4
 8 2
0 2
0 2
2 4

0
 0
 0
 0
 0
 0
 0
 0
 0
 0

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 LARGE 100


int V,E;
int color=0;

typedef struct list{
	int id;
	struct list *next;
}list;


list * makelist(int x){
	list *new=malloc(sizeof(list));
	new->id=x;
	new->next=NULL;
	return new;
}

void list_insert(list* L[],int x,list *new){
	list **p=&L[x];
	
	while((*p)!=NULL){
		p=&((*p)->next);
	}
	(*p)=new;
	
	return;
}

int push(int stack[],int x,int top){
	stack[top++]=x;
	return top;
}

int pop(int stack[],int *top){
	(*top)--;
	return stack[*top];
}

int dfs(int C[],int x,list* L[]){
	int stack[LARGE];
	int top=0;
	int temp;
	list *p;
	
	color++;
	top=push(stack,x,top);
	while(top>0){
		temp=pop(stack,&top);
		if(C[temp]==0)C[temp]=color;
		p=L[temp];
		while(p!=NULL){
			if(p->id==x)return 0;
			if(C[p->id]==0){
				top=push(stack,p->id,top);
				C[p->id]=color;
			}
			p=p->next;
		}
	}
	
	return 1;
}

int main(){
	int i,j;
	int s,t;
	int x,y;
	list *L[LARGE];
	list *new;
	int C[LARGE];
	int flg;
	
	scanf("%d %d",&V,&E);
	
	for(i=0;i<V;i++){
		L[i]=NULL;
		C[i]=0;
	}
	
	for(i=0;i<E;i++){
		scanf("%d %d",&s,&t);
		new=makelist(t);
		list_insert(L,s,new);
	}
	
	for(i=0;i<V;i++){
		for(j=0;j<V;j++)C[j]=0;
		flg=dfs(C,i,L);
		if(!flg){
			printf("1\n");
			break;
		}
	}
	
	if(flg)printf("0\n");
	
	return 0;
	
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	V
	.bss
	.align 4
	.type	V, @object
	.size	V, 4
V:
	.zero	4
	.globl	E
	.align 4
	.type	E, @object
	.size	E, 4
E:
	.zero	4
	.globl	color
	.align 4
	.type	color, @object
	.size	color, 4
color:
	.zero	4
	.text
	.globl	makelist
	.type	makelist, @function
makelist:
.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	$16, %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
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	makelist, .-makelist
	.globl	list_insert
	.type	list_insert, @function
list_insert:
.LFB7:
	.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	%esi, -28(%rbp)
	movq	%rdx, -40(%rbp)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, -8(%rbp)
	jmp	.L4
.L5:
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	addq	$8, %rax
	movq	%rax, -8(%rbp)
.L4:
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	jne	.L5
	movq	-8(%rbp), %rax
	movq	-40(%rbp), %rdx
	movq	%rdx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	list_insert, .-list_insert
	.globl	push
	.type	push, @function
push:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movl	%edx, -16(%rbp)
	movl	-16(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -16(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rdx)
	movl	-16(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	push, .-push
	.globl	pop
	.type	pop, @function
pop:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	leal	-1(%rax), %edx
	movq	-16(%rbp), %rax
	movl	%edx, (%rax)
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	pop, .-pop
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$464, %rsp
	movq	%rdi, -440(%rbp)
	movl	%esi, -444(%rbp)
	movq	%rdx, -456(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -432(%rbp)
	movl	color(%rip), %eax
	addl	$1, %eax
	movl	%eax, color(%rip)
	movl	-432(%rbp), %edx
	movl	-444(%rbp), %ecx
	leaq	-416(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	push
	movl	%eax, -432(%rbp)
	jmp	.L12
.L19:
	leaq	-432(%rbp), %rdx
	leaq	-416(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	pop
	movl	%eax, -428(%rbp)
	movl	-428(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-440(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L13
	movl	-428(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-440(%rbp), %rax
	addq	%rax, %rdx
	movl	color(%rip), %eax
	movl	%eax, (%rdx)
.L13:
	movl	-428(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-456(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -424(%rbp)
	jmp	.L14
.L18:
	movq	-424(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -444(%rbp)
	jne	.L15
	movl	$0, %eax
	jmp	.L20
.L15:
	movq	-424(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-440(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L17
	movl	-432(%rbp), %edx
	movq	-424(%rbp), %rax
	movl	(%rax), %ecx
	leaq	-416(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	push
	movl	%eax, -432(%rbp)
	movq	-424(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-440(%rbp), %rax
	addq	%rax, %rdx
	movl	color(%rip), %eax
	movl	%eax, (%rdx)
.L17:
	movq	-424(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -424(%rbp)
.L14:
	cmpq	$0, -424(%rbp)
	jne	.L18
.L12:
	movl	-432(%rbp), %eax
	testl	%eax, %eax
	jg	.L19
	movl	$1, %eax
.L20:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	dfs, .-dfs
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"1"
.LC2:
	.string	"0"
	.text
	.globl	main
	.type	main, @function
main:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1248, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	E(%rip), %rax
	movq	%rax, %rdx
	leaq	V(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1236(%rbp)
	jmp	.L23
.L24:
	movl	-1236(%rbp), %eax
	cltq
	movq	$0, -816(%rbp,%rax,8)
	movl	-1236(%rbp), %eax
	cltq
	movl	$0, -1216(%rbp,%rax,4)
	addl	$1, -1236(%rbp)
.L23:
	movl	V(%rip), %eax
	cmpl	%eax, -1236(%rbp)
	jl	.L24
	movl	$0, -1236(%rbp)
	jmp	.L25
.L26:
	leaq	-1240(%rbp), %rdx
	leaq	-1244(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1240(%rbp), %eax
	movl	%eax, %edi
	call	makelist
	movq	%rax, -1224(%rbp)
	movl	-1244(%rbp), %ecx
	movq	-1224(%rbp), %rdx
	leaq	-816(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	list_insert
	addl	$1, -1236(%rbp)
.L25:
	movl	E(%rip), %eax
	cmpl	%eax, -1236(%rbp)
	jl	.L26
	movl	$0, -1236(%rbp)
	jmp	.L27
.L32:
	movl	$0, -1232(%rbp)
	jmp	.L28
.L29:
	movl	-1232(%rbp), %eax
	cltq
	movl	$0, -1216(%rbp,%rax,4)
	addl	$1, -1232(%rbp)
.L28:
	movl	V(%rip), %eax
	cmpl	%eax, -1232(%rbp)
	jl	.L29
	leaq	-816(%rbp), %rdx
	movl	-1236(%rbp), %ecx
	leaq	-1216(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	dfs
	movl	%eax, -1228(%rbp)
	cmpl	$0, -1228(%rbp)
	jne	.L30
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L31
.L30:
	addl	$1, -1236(%rbp)
.L27:
	movl	V(%rip), %eax
	cmpl	%eax, -1236(%rbp)
	jl	.L32
.L31:
	cmpl	$0, -1228(%rbp)
	je	.L33
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L33:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L35
	call	__stack_chk_fail@PLT
.L35:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.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	V
	.bss
	.align 4
	.type	V, @object
	.size	V, 4
V:
	.zero	4
	.globl	E
	.align 4
	.type	E, @object
	.size	E, 4
E:
	.zero	4
	.globl	color
	.align 4
	.type	color, @object
	.size	color, 4
color:
	.zero	4
	.text
	.globl	makelist
	.type	makelist, @function
makelist:
.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	$16, %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
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	makelist, .-makelist
	.globl	list_insert
	.type	list_insert, @function
list_insert:
.LFB7:
	.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	%esi, -28(%rbp)
	movq	%rdx, -40(%rbp)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, -8(%rbp)
	jmp	.L4
.L5:
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	addq	$8, %rax
	movq	%rax, -8(%rbp)
.L4:
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	jne	.L5
	movq	-8(%rbp), %rax
	movq	-40(%rbp), %rdx
	movq	%rdx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	list_insert, .-list_insert
	.globl	push
	.type	push, @function
push:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movl	%edx, -16(%rbp)
	movl	-16(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -16(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rdx)
	movl	-16(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	push, .-push
	.globl	pop
	.type	pop, @function
pop:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	leal	-1(%rax), %edx
	movq	-16(%rbp), %rax
	movl	%edx, (%rax)
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	pop, .-pop
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$464, %rsp
	movq	%rdi, -440(%rbp)
	movl	%esi, -444(%rbp)
	movq	%rdx, -456(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -432(%rbp)
	movl	color(%rip), %eax
	addl	$1, %eax
	movl	%eax, color(%rip)
	movl	-432(%rbp), %edx
	movl	-444(%rbp), %ecx
	leaq	-416(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	push
	movl	%eax, -432(%rbp)
	jmp	.L12
.L19:
	leaq	-432(%rbp), %rdx
	leaq	-416(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	pop
	movl	%eax, -428(%rbp)
	movl	-428(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-440(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L13
	movl	-428(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-440(%rbp), %rax
	addq	%rax, %rdx
	movl	color(%rip), %eax
	movl	%eax, (%rdx)
.L13:
	movl	-428(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-456(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -424(%rbp)
	jmp	.L14
.L18:
	movq	-424(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -444(%rbp)
	jne	.L15
	movl	$0, %eax
	jmp	.L20
.L15:
	movq	-424(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-440(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L17
	movl	-432(%rbp), %edx
	movq	-424(%rbp), %rax
	movl	(%rax), %ecx
	leaq	-416(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	push
	movl	%eax, -432(%rbp)
	movq	-424(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-440(%rbp), %rax
	addq	%rax, %rdx
	movl	color(%rip), %eax
	movl	%eax, (%rdx)
.L17:
	movq	-424(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -424(%rbp)
.L14:
	cmpq	$0, -424(%rbp)
	jne	.L18
.L12:
	movl	-432(%rbp), %eax
	testl	%eax, %eax
	jg	.L19
	movl	$1, %eax
.L20:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	dfs, .-dfs
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"1"
.LC2:
	.string	"0"
	.text
	.globl	main
	.type	main, @function
main:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1248, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	E(%rip), %rax
	movq	%rax, %rdx
	leaq	V(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1236(%rbp)
	jmp	.L23
.L24:
	movl	-1236(%rbp), %eax
	cltq
	movq	$0, -816(%rbp,%rax,8)
	movl	-1236(%rbp), %eax
	cltq
	movl	$0, -1216(%rbp,%rax,4)
	addl	$1, -1236(%rbp)
.L23:
	movl	V(%rip), %eax
	cmpl	%eax, -1236(%rbp)
	jl	.L24
	movl	$0, -1236(%rbp)
	jmp	.L25
.L26:
	leaq	-1240(%rbp), %rdx
	leaq	-1244(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1240(%rbp), %eax
	movl	%eax, %edi
	call	makelist
	movq	%rax, -1224(%rbp)
	movl	-1244(%rbp), %ecx
	movq	-1224(%rbp), %rdx
	leaq	-816(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	list_insert
	addl	$1, -1236(%rbp)
.L25:
	movl	E(%rip), %eax
	cmpl	%eax, -1236(%rbp)
	jl	.L26
	movl	$0, -1236(%rbp)
	jmp	.L27
.L32:
	movl	$0, -1232(%rbp)
	jmp	.L28
.L29:
	movl	-1232(%rbp), %eax
	cltq
	movl	$0, -1216(%rbp,%rax,4)
	addl	$1, -1232(%rbp)
.L28:
	movl	V(%rip), %eax
	cmpl	%eax, -1232(%rbp)
	jl	.L29
	leaq	-816(%rbp), %rdx
	movl	-1236(%rbp), %ecx
	leaq	-1216(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	dfs
	movl	%eax, -1228(%rbp)
	cmpl	$0, -1228(%rbp)
	jne	.L30
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L31
.L30:
	addl	$1, -1236(%rbp)
.L27:
	movl	V(%rip), %eax
	cmpl	%eax, -1236(%rbp)
	jl	.L32
.L31:
	cmpl	$0, -1228(%rbp)
	je	.L33
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L33:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L35
	call	__stack_chk_fail@PLT
.L35:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.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:
