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>
struct node{
  int key;
  struct node *next;
};
typedef struct node *GG;

GG G[100000];
int color[100000];

GG MNode(int,GG);
void Insert(int,int);
void Dye(int,int);
int main()
{
  int p,i,s,t,id=1,q,n,m;
  scanf("%d%d",&n,&m);
  for(i=0;i<n;i++)G[i]=MNode(i,NULL);
  for(i=0;i<m;i++){
    scanf("%d%d",&s,&t);
    Insert(s,t);
    Insert(t,s);
  }
  for(i=0;i<n;i++)color[i]=0;
  for(i=0;i<n;i++){
    if(color[i]==0){
      Dye(i,id);
      id++;
    }
  }
  
  scanf("%d",&q);
  for(i=0;i<q;i++){
    scanf("%d%d",&s,&t);
    if(color[s]==color[t])printf("yes\n");
    else printf("no\n");
  }
  // for(i=0;i<n;i++)printf("%d ",color[i]);
  return 0;
}

GG MNode(int key,GG Node)
{
  GG n;
  n=(GG)malloc(sizeof(struct node));
  n->key=key;
  n->next=Node;
  return n;
}
void Insert(int s,int t)
{
  GG GGG;
  GGG=MNode(t,G[s]->next);
  G[s]->next=GGG;
}

void Dye(int c,int id)
{
  int S[100000],head=0,u,v;
  GG GGG;
  S[head]=c;
  head++;
  color[c]=id;
  while(head!=0){
    u=S[head-1];
    head--;
    for(GGG=G[u]->next;GGG!=NULL;GGG=GGG->next){
      v=GGG->key;
      if(color[v]==0){
        color[v]=id;
	S[head]=v;
	head++;
      }
    }
  }
}
    ```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	G
	.bss
	.align 32
	.type	G, @object
	.size	G, 800000
G:
	.zero	800000
	.globl	color
	.align 32
	.type	color, @object
	.size	color, 400000
color:
	.zero	400000
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"yes"
.LC3:
	.string	"no"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1, -12(%rbp)
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -16(%rbp)
	jmp	.L2
.L3:
	movl	-16(%rbp), %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	MNode
	movl	-16(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	G(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -16(%rbp)
.L2:
	movl	-24(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L3
	movl	$0, -16(%rbp)
	jmp	.L4
.L5:
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %edx
	movl	-36(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	Insert
	movl	-36(%rbp), %edx
	movl	-32(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	Insert
	addl	$1, -16(%rbp)
.L4:
	movl	-20(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L5
	movl	$0, -16(%rbp)
	jmp	.L6
.L7:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L6:
	movl	-24(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L7
	movl	$0, -16(%rbp)
	jmp	.L8
.L10:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L9
	movl	-12(%rbp), %edx
	movl	-16(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	Dye
	addl	$1, -12(%rbp)
.L9:
	addl	$1, -16(%rbp)
.L8:
	movl	-24(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L10
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -16(%rbp)
	jmp	.L11
.L14:
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	color(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jne	.L12
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L13
.L12:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L13:
	addl	$1, -16(%rbp)
.L11:
	movl	-28(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L14
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	MNode
	.type	MNode, @function
MNode:
.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
	movl	%edi, -20(%rbp)
	movq	%rsi, -32(%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	-32(%rbp), %rdx
	movq	%rdx, 8(%rax)
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	MNode, .-MNode
	.globl	Insert
	.type	Insert, @function
Insert:
.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
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	G(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	8(%rax), %rdx
	movl	-24(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	MNode
	movq	%rax, -8(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	G(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, 8(%rax)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	Insert, .-Insert
	.globl	Dye
	.type	Dye, @function
Dye:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2752, %rsp
	movl	%edi, -400052(%rbp)
	movl	%esi, -400056(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -400036(%rbp)
	movl	-400036(%rbp), %eax
	cltq
	movl	-400052(%rbp), %edx
	movl	%edx, -400016(%rbp,%rax,4)
	addl	$1, -400036(%rbp)
	movl	-400052(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	color(%rip), %rdx
	movl	-400056(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L21
.L25:
	movl	-400036(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	movl	%eax, -400032(%rbp)
	subl	$1, -400036(%rbp)
	movl	-400032(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	G(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	8(%rax), %rax
	movq	%rax, -400024(%rbp)
	jmp	.L22
.L24:
	movq	-400024(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -400028(%rbp)
	movl	-400028(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L23
	movl	-400028(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	color(%rip), %rdx
	movl	-400056(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-400036(%rbp), %eax
	cltq
	movl	-400028(%rbp), %edx
	movl	%edx, -400016(%rbp,%rax,4)
	addl	$1, -400036(%rbp)
.L23:
	movq	-400024(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -400024(%rbp)
.L22:
	cmpq	$0, -400024(%rbp)
	jne	.L24
.L21:
	cmpl	$0, -400036(%rbp)
	jne	.L25
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	Dye, .-Dye
	.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	MNode
	.type	MNode, @function
MNode:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	%edi, %ebp
	movl	$16, %edi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movq	%rsi, %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	call	malloc@PLT
	movl	%ebp, (%rax)
	movq	%rbx, 8(%rax)
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE40:
	.size	MNode, .-MNode
	.p2align 4
	.globl	Insert
	.type	Insert, @function
Insert:
.LFB41:
	.cfi_startproc
	endbr64
	movslq	%edi, %rdi
	leaq	G(%rip), %rax
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	(%rax,%rdi,8), %rbp
	movl	$16, %edi
	movl	%esi, %ebx
	movq	8(%rbp), %r12
	call	malloc@PLT
	movl	%ebx, (%rax)
	movq	%r12, 8(%rax)
	movq	%rax, 8(%rbp)
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE41:
	.size	Insert, .-Insert
	.p2align 4
	.globl	Dye
	.type	Dye, @function
Dye:
.LFB42:
	.cfi_startproc
	endbr64
	leaq	-397312(%rsp), %r11
	.cfi_def_cfa 11, 397320
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2712, %rsp
	.cfi_def_cfa_offset 400032
	leaq	color(%rip), %r8
	leaq	G(%rip), %r9
	movq	%fs:40, %rax
	movq	%rax, 400008(%rsp)
	xorl	%eax, %eax
	movslq	%edi, %rax
	movl	%edi, (%rsp)
	xorl	%edi, %edi
	movl	%esi, (%r8,%rax,4)
	.p2align 4,,10
	.p2align 3
.L13:
	movq	(%r9,%rax,8), %rax
	.p2align 4,,10
	.p2align 3
.L22:
	movq	8(%rax), %rax
	testq	%rax, %rax
	je	.L7
.L11:
	movslq	(%rax), %rcx
	movl	(%r8,%rcx,4), %r10d
	movq	%rcx, %rdx
	testl	%r10d, %r10d
	jne	.L22
	movq	8(%rax), %rax
	movl	%esi, (%r8,%rcx,4)
	movslq	%edi, %rcx
	addl	$1, %edi
	movl	%edx, (%rsp,%rcx,4)
	testq	%rax, %rax
	jne	.L11
.L10:
	subl	$1, %edi
	movslq	%edi, %rax
	movslq	(%rsp,%rax,4), %rax
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L7:
	testl	%edi, %edi
	jne	.L10
	movq	400008(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$400024, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L23:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE42:
	.size	Dye, .-Dye
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"yes"
.LC3:
	.string	"no"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.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
	movq	%r12, %rdi
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	G(%rip), %rbx
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	52(%rsp), %rdx
	leaq	48(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	48(%rsp), %r13
	testl	%r13d, %r13d
	jle	.L29
	.p2align 4,,10
	.p2align 3
.L28:
	movl	$16, %edi
	call	malloc@PLT
	movl	%ebp, (%rax)
	movq	%rax, (%rbx,%rbp,8)
	addq	$1, %rbp
	movq	$0, 8(%rax)
	cmpq	%r13, %rbp
	jne	.L28
.L29:
	movl	52(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L27
	xorl	%r15d, %r15d
	leaq	40(%rsp), %r14
	leaq	36(%rsp), %r13
	leaq	G(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L26:
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	36(%rsp), %rax
	movl	$16, %edi
	movslq	40(%rsp), %rbp
	addl	$1, %r15d
	movq	(%rbx,%rax,8), %rcx
	movl	%eax, 28(%rsp)
	movq	8(%rcx), %rsi
	movq	%rcx, 16(%rsp)
	movq	%rsi, 8(%rsp)
	call	malloc@PLT
	movq	8(%rsp), %rsi
	movq	16(%rsp), %rcx
	movl	$16, %edi
	movl	%ebp, (%rax)
	movq	%rsi, 8(%rax)
	movq	%rax, 8(%rcx)
	movq	(%rbx,%rbp,8), %rbp
	movq	8(%rbp), %rcx
	movq	%rcx, 8(%rsp)
	call	malloc@PLT
	movl	28(%rsp), %edx
	movq	8(%rsp), %rcx
	movl	%edx, (%rax)
	movq	%rcx, 8(%rax)
	movq	%rax, 8(%rbp)
	cmpl	%r15d, 52(%rsp)
	jg	.L26
.L27:
	movl	48(%rsp), %r13d
	testl	%r13d, %r13d
	jle	.L31
	movslq	%r13d, %rdx
	leaq	color(%rip), %rbx
	xorl	%esi, %esi
	xorl	%ebp, %ebp
	salq	$2, %rdx
	movq	%rbx, %rdi
	movl	$1, %r14d
	call	memset@PLT
	.p2align 4,,10
	.p2align 3
.L36:
	movl	(%rbx,%rbp,4), %eax
	movl	%ebp, %edi
	testl	%eax, %eax
	je	.L48
	addq	$1, %rbp
	cmpl	%ebp, %r13d
	jg	.L36
.L31:
	leaq	44(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %edx
	testl	%edx, %edx
	jle	.L33
	xorl	%ebp, %ebp
	leaq	40(%rsp), %r14
	leaq	36(%rsp), %r13
	leaq	color(%rip), %rbx
	leaq	.LC3(%rip), %r15
	.p2align 4,,10
	.p2align 3
.L32:
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	40(%rsp), %rax
	movslq	36(%rsp), %rdx
	movl	(%rbx,%rax,4), %eax
	cmpl	%eax, (%rbx,%rdx,4)
	je	.L49
	movq	%r15, %rdi
	addl	$1, %ebp
	call	puts@PLT
	cmpl	%ebp, 44(%rsp)
	jg	.L32
.L33:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L50
	addq	$72, %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
.L49:
	.cfi_restore_state
	leaq	.LC2(%rip), %rdi
	addl	$1, %ebp
	call	puts@PLT
	cmpl	%ebp, 44(%rsp)
	jg	.L32
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L48:
	movl	%r14d, %esi
	addq	$1, %rbp
	addl	$1, %r14d
	call	Dye
	movl	48(%rsp), %r13d
	cmpl	%ebp, %r13d
	jg	.L36
	jmp	.L31
.L50:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.globl	color
	.bss
	.align 32
	.type	color, @object
	.size	color, 400000
color:
	.zero	400000
	.globl	G
	.align 32
	.type	G, @object
	.size	G, 800000
G:
	.zero	800000
	.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	MNode
	.type	MNode, @function
MNode:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	%edi, %ebp
	movl	$16, %edi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movq	%rsi, %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	call	malloc@PLT
	movl	%ebp, (%rax)
	movq	%rbx, 8(%rax)
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE40:
	.size	MNode, .-MNode
	.p2align 4
	.globl	Insert
	.type	Insert, @function
Insert:
.LFB41:
	.cfi_startproc
	endbr64
	movslq	%edi, %rdi
	leaq	G(%rip), %rax
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	(%rax,%rdi,8), %rbp
	movl	$16, %edi
	movl	%esi, %ebx
	movq	8(%rbp), %r12
	call	malloc@PLT
	movl	%ebx, (%rax)
	movq	%r12, 8(%rax)
	movq	%rax, 8(%rbp)
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE41:
	.size	Insert, .-Insert
	.p2align 4
	.globl	Dye
	.type	Dye, @function
Dye:
.LFB42:
	.cfi_startproc
	endbr64
	leaq	-397312(%rsp), %r11
	.cfi_def_cfa 11, 397320
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2712, %rsp
	.cfi_def_cfa_offset 400032
	leaq	color(%rip), %r8
	leaq	G(%rip), %r9
	movq	%fs:40, %rax
	movq	%rax, 400008(%rsp)
	xorl	%eax, %eax
	movslq	%edi, %rax
	movl	%edi, (%rsp)
	xorl	%edi, %edi
	movl	%esi, (%r8,%rax,4)
	.p2align 4,,10
	.p2align 3
.L13:
	movq	(%r9,%rax,8), %rax
	.p2align 4,,10
	.p2align 3
.L22:
	movq	8(%rax), %rax
	testq	%rax, %rax
	je	.L7
.L11:
	movslq	(%rax), %rcx
	movl	(%r8,%rcx,4), %r10d
	movq	%rcx, %rdx
	testl	%r10d, %r10d
	jne	.L22
	movq	8(%rax), %rax
	movl	%esi, (%r8,%rcx,4)
	movslq	%edi, %rcx
	addl	$1, %edi
	movl	%edx, (%rsp,%rcx,4)
	testq	%rax, %rax
	jne	.L11
.L10:
	subl	$1, %edi
	movslq	%edi, %rax
	movslq	(%rsp,%rax,4), %rax
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L7:
	testl	%edi, %edi
	jne	.L10
	movq	400008(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$400024, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L23:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE42:
	.size	Dye, .-Dye
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"yes"
.LC3:
	.string	"no"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.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
	movq	%r12, %rdi
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	G(%rip), %rbx
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	52(%rsp), %rdx
	leaq	48(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	48(%rsp), %r13
	testl	%r13d, %r13d
	jle	.L29
	.p2align 4,,10
	.p2align 3
.L28:
	movl	$16, %edi
	call	malloc@PLT
	movl	%ebp, (%rax)
	movq	%rax, (%rbx,%rbp,8)
	addq	$1, %rbp
	movq	$0, 8(%rax)
	cmpq	%r13, %rbp
	jne	.L28
.L29:
	movl	52(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L27
	xorl	%r15d, %r15d
	leaq	40(%rsp), %r14
	leaq	36(%rsp), %r13
	leaq	G(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L26:
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	36(%rsp), %rax
	movl	$16, %edi
	movslq	40(%rsp), %rbp
	addl	$1, %r15d
	movq	(%rbx,%rax,8), %rcx
	movl	%eax, 28(%rsp)
	movq	8(%rcx), %rsi
	movq	%rcx, 16(%rsp)
	movq	%rsi, 8(%rsp)
	call	malloc@PLT
	movq	8(%rsp), %rsi
	movq	16(%rsp), %rcx
	movl	$16, %edi
	movl	%ebp, (%rax)
	movq	%rsi, 8(%rax)
	movq	%rax, 8(%rcx)
	movq	(%rbx,%rbp,8), %rbp
	movq	8(%rbp), %rcx
	movq	%rcx, 8(%rsp)
	call	malloc@PLT
	movl	28(%rsp), %edx
	movq	8(%rsp), %rcx
	movl	%edx, (%rax)
	movq	%rcx, 8(%rax)
	movq	%rax, 8(%rbp)
	cmpl	%r15d, 52(%rsp)
	jg	.L26
.L27:
	movl	48(%rsp), %r13d
	testl	%r13d, %r13d
	jle	.L31
	movslq	%r13d, %rdx
	leaq	color(%rip), %rbx
	xorl	%esi, %esi
	xorl	%ebp, %ebp
	salq	$2, %rdx
	movq	%rbx, %rdi
	movl	$1, %r14d
	call	memset@PLT
	.p2align 4,,10
	.p2align 3
.L36:
	movl	(%rbx,%rbp,4), %eax
	movl	%ebp, %edi
	testl	%eax, %eax
	je	.L48
	addq	$1, %rbp
	cmpl	%ebp, %r13d
	jg	.L36
.L31:
	leaq	44(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %edx
	testl	%edx, %edx
	jle	.L33
	xorl	%ebp, %ebp
	leaq	40(%rsp), %r14
	leaq	36(%rsp), %r13
	leaq	color(%rip), %rbx
	leaq	.LC3(%rip), %r15
	.p2align 4,,10
	.p2align 3
.L32:
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	40(%rsp), %rax
	movslq	36(%rsp), %rdx
	movl	(%rbx,%rax,4), %eax
	cmpl	%eax, (%rbx,%rdx,4)
	je	.L49
	movq	%r15, %rdi
	addl	$1, %ebp
	call	puts@PLT
	cmpl	%ebp, 44(%rsp)
	jg	.L32
.L33:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L50
	addq	$72, %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
.L49:
	.cfi_restore_state
	leaq	.LC2(%rip), %rdi
	addl	$1, %ebp
	call	puts@PLT
	cmpl	%ebp, 44(%rsp)
	jg	.L32
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L48:
	movl	%r14d, %esi
	addq	$1, %rbp
	addl	$1, %r14d
	call	Dye
	movl	48(%rsp), %r13d
	cmpl	%ebp, %r13d
	jg	.L36
	jmp	.L31
.L50:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.globl	color
	.bss
	.align 32
	.type	color, @object
	.size	color, 400000
color:
	.zero	400000
	.globl	G
	.align 32
	.type	G, @object
	.size	G, 800000
G:
	.zero	800000
	.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>
struct node{
  int key;
  struct node *next;
};
typedef struct node *GG;

GG G[100000];
int color[100000];

GG MNode(int,GG);
void Insert(int,int);
void Dye(int,int);
int main()
{
  int p,i,s,t,id=1,q,n,m;
  scanf("%d%d",&n,&m);
  for(i=0;i<n;i++)G[i]=MNode(i,NULL);
  for(i=0;i<m;i++){
    scanf("%d%d",&s,&t);
    Insert(s,t);
    Insert(t,s);
  }
  for(i=0;i<n;i++)color[i]=0;
  for(i=0;i<n;i++){
    if(color[i]==0){
      Dye(i,id);
      id++;
    }
  }
  
  scanf("%d",&q);
  for(i=0;i<q;i++){
    scanf("%d%d",&s,&t);
    if(color[s]==color[t])printf("yes\n");
    else printf("no\n");
  }
  // for(i=0;i<n;i++)printf("%d ",color[i]);
  return 0;
}

GG MNode(int key,GG Node)
{
  GG n;
  n=(GG)malloc(sizeof(struct node));
  n->key=key;
  n->next=Node;
  return n;
}
void Insert(int s,int t)
{
  GG GGG;
  GGG=MNode(t,G[s]->next);
  G[s]->next=GGG;
}

void Dye(int c,int id)
{
  int S[100000],head=0,u,v;
  GG GGG;
  S[head]=c;
  head++;
  color[c]=id;
  while(head!=0){
    u=S[head-1];
    head--;
    for(GGG=G[u]->next;GGG!=NULL;GGG=GGG->next){
      v=GGG->key;
      if(color[v]==0){
        color[v]=id;
	S[head]=v;
	head++;
      }
    }
  }
}
    
10 9
0 1
0 2
3 4
5 7
5 6
3 7
6 8
7 8
8 9
3
0 1
5 9
1 3
 16 9
0 2
0 2
3 4
5 7
5 6
3 7
6 13
7 8
8 9
3
0 1
5 9
1 3
 16 9
0 2
0 2
3 4
2 7
5 6
3 7
6 13
7 8
8 9
3
0 1
5 9
1 3
 16 9
0 2
0 2
3 4
2 7
5 6
3 7
6 13
7 8
8 9
3
0 0
5 9
1 3
 10 9
0 1
0 2
3 4
5 7
5 6
3 7
0 8
7 8
8 9
3
0 1
5 9
1 3
 16 9
0 2
0 2
3 4
2 7
5 6
3 7
0 13
7 8
8 9
3
1 0
5 2
2 3
 16 9
0 2
0 2
3 4
2 7
5 6
3 7
0 13
7 8
8 9
3
1 0
4 2
2 3
 10 9
0 1
0 2
3 4
5 7
5 6
3 7
0 8
7 8
8 5
3
0 1
5 9
1 3
 16 9
0 2
0 2
0 4
2 7
5 6
3 11
6 13
3 8
8 9
1
0 1
5 9
1 3
 16 9
0 2
1 2
0 4
4 7
5 6
3 11
6 7
3 8
8 9
1
0 1
5 9
1 3

yes
yes
no
 no
yes
no
 no
no
no
 yes
no
no
 yes
yes
yes
 no
no
yes
 no
yes
yes
 yes
no
yes
 no
 yes

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

```c
#include<stdio.h>
#include<stdlib.h>
struct node{
  int key;
  struct node *next;
};
typedef struct node *GG;

GG G[100000];
int color[100000];

GG MNode(int,GG);
void Insert(int,int);
void Dye(int,int);
int main()
{
  int p,i,s,t,id=1,q,n,m;
  scanf("%d%d",&n,&m);
  for(i=0;i<n;i++)G[i]=MNode(i,NULL);
  for(i=0;i<m;i++){
    scanf("%d%d",&s,&t);
    Insert(s,t);
    Insert(t,s);
  }
  for(i=0;i<n;i++)color[i]=0;
  for(i=0;i<n;i++){
    if(color[i]==0){
      Dye(i,id);
      id++;
    }
  }
  
  scanf("%d",&q);
  for(i=0;i<q;i++){
    scanf("%d%d",&s,&t);
    if(color[s]==color[t])printf("yes\n");
    else printf("no\n");
  }
  // for(i=0;i<n;i++)printf("%d ",color[i]);
  return 0;
}

GG MNode(int key,GG Node)
{
  GG n;
  n=(GG)malloc(sizeof(struct node));
  n->key=key;
  n->next=Node;
  return n;
}
void Insert(int s,int t)
{
  GG GGG;
  GGG=MNode(t,G[s]->next);
  G[s]->next=GGG;
}

void Dye(int c,int id)
{
  int S[100000],head=0,u,v;
  GG GGG;
  S[head]=c;
  head++;
  color[c]=id;
  while(head!=0){
    u=S[head-1];
    head--;
    for(GGG=G[u]->next;GGG!=NULL;GGG=GGG->next){
      v=GGG->key;
      if(color[v]==0){
        color[v]=id;
	S[head]=v;
	head++;
      }
    }
  }
}
    ```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	G
	.bss
	.align 32
	.type	G, @object
	.size	G, 800000
G:
	.zero	800000
	.globl	color
	.align 32
	.type	color, @object
	.size	color, 400000
color:
	.zero	400000
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"yes"
.LC3:
	.string	"no"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1, -12(%rbp)
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -16(%rbp)
	jmp	.L2
.L3:
	movl	-16(%rbp), %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	MNode
	movl	-16(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	G(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -16(%rbp)
.L2:
	movl	-24(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L3
	movl	$0, -16(%rbp)
	jmp	.L4
.L5:
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %edx
	movl	-36(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	Insert
	movl	-36(%rbp), %edx
	movl	-32(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	Insert
	addl	$1, -16(%rbp)
.L4:
	movl	-20(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L5
	movl	$0, -16(%rbp)
	jmp	.L6
.L7:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L6:
	movl	-24(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L7
	movl	$0, -16(%rbp)
	jmp	.L8
.L10:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L9
	movl	-12(%rbp), %edx
	movl	-16(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	Dye
	addl	$1, -12(%rbp)
.L9:
	addl	$1, -16(%rbp)
.L8:
	movl	-24(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L10
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -16(%rbp)
	jmp	.L11
.L14:
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	color(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jne	.L12
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L13
.L12:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L13:
	addl	$1, -16(%rbp)
.L11:
	movl	-28(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L14
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	MNode
	.type	MNode, @function
MNode:
.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
	movl	%edi, -20(%rbp)
	movq	%rsi, -32(%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	-32(%rbp), %rdx
	movq	%rdx, 8(%rax)
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	MNode, .-MNode
	.globl	Insert
	.type	Insert, @function
Insert:
.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
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	G(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	8(%rax), %rdx
	movl	-24(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	MNode
	movq	%rax, -8(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	G(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, 8(%rax)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	Insert, .-Insert
	.globl	Dye
	.type	Dye, @function
Dye:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2752, %rsp
	movl	%edi, -400052(%rbp)
	movl	%esi, -400056(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -400036(%rbp)
	movl	-400036(%rbp), %eax
	cltq
	movl	-400052(%rbp), %edx
	movl	%edx, -400016(%rbp,%rax,4)
	addl	$1, -400036(%rbp)
	movl	-400052(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	color(%rip), %rdx
	movl	-400056(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L21
.L25:
	movl	-400036(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	movl	%eax, -400032(%rbp)
	subl	$1, -400036(%rbp)
	movl	-400032(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	G(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	8(%rax), %rax
	movq	%rax, -400024(%rbp)
	jmp	.L22
.L24:
	movq	-400024(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -400028(%rbp)
	movl	-400028(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L23
	movl	-400028(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	color(%rip), %rdx
	movl	-400056(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-400036(%rbp), %eax
	cltq
	movl	-400028(%rbp), %edx
	movl	%edx, -400016(%rbp,%rax,4)
	addl	$1, -400036(%rbp)
.L23:
	movq	-400024(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -400024(%rbp)
.L22:
	cmpq	$0, -400024(%rbp)
	jne	.L24
.L21:
	cmpl	$0, -400036(%rbp)
	jne	.L25
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	Dye, .-Dye
	.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	G
	.bss
	.align 32
	.type	G, @object
	.size	G, 800000
G:
	.zero	800000
	.globl	color
	.align 32
	.type	color, @object
	.size	color, 400000
color:
	.zero	400000
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"yes"
.LC3:
	.string	"no"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1, -12(%rbp)
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -16(%rbp)
	jmp	.L2
.L3:
	movl	-16(%rbp), %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	MNode
	movl	-16(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	G(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -16(%rbp)
.L2:
	movl	-24(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L3
	movl	$0, -16(%rbp)
	jmp	.L4
.L5:
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %edx
	movl	-36(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	Insert
	movl	-36(%rbp), %edx
	movl	-32(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	Insert
	addl	$1, -16(%rbp)
.L4:
	movl	-20(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L5
	movl	$0, -16(%rbp)
	jmp	.L6
.L7:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L6:
	movl	-24(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L7
	movl	$0, -16(%rbp)
	jmp	.L8
.L10:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L9
	movl	-12(%rbp), %edx
	movl	-16(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	Dye
	addl	$1, -12(%rbp)
.L9:
	addl	$1, -16(%rbp)
.L8:
	movl	-24(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L10
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -16(%rbp)
	jmp	.L11
.L14:
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	color(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jne	.L12
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L13
.L12:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L13:
	addl	$1, -16(%rbp)
.L11:
	movl	-28(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L14
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	MNode
	.type	MNode, @function
MNode:
.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
	movl	%edi, -20(%rbp)
	movq	%rsi, -32(%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	-32(%rbp), %rdx
	movq	%rdx, 8(%rax)
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	MNode, .-MNode
	.globl	Insert
	.type	Insert, @function
Insert:
.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
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	G(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	8(%rax), %rdx
	movl	-24(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	MNode
	movq	%rax, -8(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	G(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, 8(%rax)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	Insert, .-Insert
	.globl	Dye
	.type	Dye, @function
Dye:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2752, %rsp
	movl	%edi, -400052(%rbp)
	movl	%esi, -400056(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -400036(%rbp)
	movl	-400036(%rbp), %eax
	cltq
	movl	-400052(%rbp), %edx
	movl	%edx, -400016(%rbp,%rax,4)
	addl	$1, -400036(%rbp)
	movl	-400052(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	color(%rip), %rdx
	movl	-400056(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L21
.L25:
	movl	-400036(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	movl	%eax, -400032(%rbp)
	subl	$1, -400036(%rbp)
	movl	-400032(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	G(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	8(%rax), %rax
	movq	%rax, -400024(%rbp)
	jmp	.L22
.L24:
	movq	-400024(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -400028(%rbp)
	movl	-400028(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L23
	movl	-400028(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	color(%rip), %rdx
	movl	-400056(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-400036(%rbp), %eax
	cltq
	movl	-400028(%rbp), %edx
	movl	%edx, -400016(%rbp,%rax,4)
	addl	$1, -400036(%rbp)
.L23:
	movq	-400024(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -400024(%rbp)
.L22:
	cmpq	$0, -400024(%rbp)
	jne	.L24
.L21:
	cmpl	$0, -400036(%rbp)
	jne	.L25
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	Dye, .-Dye
	.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:
