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>
#define N 101

int main()
{
  int i,j,n,count=0,v,c,c1,v1;
  int G[N][N],col[N],d[N],pi[N],mincost,i2;

  for(i = 0; i < N; i++){

    for(j = 0; j < N; j++)
      G[i][j] = -1;

  }

  scanf("%d",&n);

  for(i = 0; i < n; i++){

    scanf("%d%d",&v,&c);

    for(j = 0; j < c; j++){
      scanf("%d%d",&v1,&c1);
      G[v][v1] = c1;
    }

  }
 
  for(i = 0; i < n; i++){

    col[i] = 0;
    pi[i] = -1;
    d[i] = 10000001;

  }

  d[0] = 0;
 
  while(1){

    mincost = 10000001;

    for(i = 0; i < n; i++){

      if(col[i] != 2 && d[i] < mincost){
        mincost = d[i];
        i2 = i;
      }

    }

    if(mincost == 10000001)break;

    col[i2] = 2;

    for(i = 0; i < n; i++){

      if(G[i2][i] != -1 && col[i] != 2 && (G[i2][i]+d[i2]) < d[i]){
	pi[i] = i2;
	d[i] = G[i2][i] + d[i2];
	col[i] = 1;
      }

    }

  }

  for(i = 0; i < n; i++)printf("%d %d\n",i,d[i]);

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-40960(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1152, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -42068(%rbp)
	movl	$0, -42084(%rbp)
	jmp	.L2
.L5:
	movl	$0, -42080(%rbp)
	jmp	.L3
.L4:
	movl	-42080(%rbp), %eax
	movslq	%eax, %rcx
	movl	-42084(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	$-1, -40816(%rbp,%rax,4)
	addl	$1, -42080(%rbp)
.L3:
	cmpl	$100, -42080(%rbp)
	jle	.L4
	addl	$1, -42084(%rbp)
.L2:
	cmpl	$100, -42084(%rbp)
	jle	.L5
	leaq	-42104(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -42084(%rbp)
	jmp	.L6
.L9:
	leaq	-42096(%rbp), %rdx
	leaq	-42100(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -42080(%rbp)
	jmp	.L7
.L8:
	leaq	-42092(%rbp), %rdx
	leaq	-42088(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-42100(%rbp), %eax
	movl	-42088(%rbp), %edx
	movl	-42092(%rbp), %ecx
	movslq	%edx, %rsi
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	movl	%ecx, -40816(%rbp,%rax,4)
	addl	$1, -42080(%rbp)
.L7:
	movl	-42096(%rbp), %eax
	cmpl	%eax, -42080(%rbp)
	jl	.L8
	addl	$1, -42084(%rbp)
.L6:
	movl	-42104(%rbp), %eax
	cmpl	%eax, -42084(%rbp)
	jl	.L9
	movl	$0, -42084(%rbp)
	jmp	.L10
.L11:
	movl	-42084(%rbp), %eax
	cltq
	movl	$0, -42064(%rbp,%rax,4)
	movl	-42084(%rbp), %eax
	cltq
	movl	$-1, -41232(%rbp,%rax,4)
	movl	-42084(%rbp), %eax
	cltq
	movl	$10000001, -41648(%rbp,%rax,4)
	addl	$1, -42084(%rbp)
.L10:
	movl	-42104(%rbp), %eax
	cmpl	%eax, -42084(%rbp)
	jl	.L11
	movl	$0, -41648(%rbp)
.L20:
	movl	$10000001, -42076(%rbp)
	movl	$0, -42084(%rbp)
	jmp	.L12
.L14:
	movl	-42084(%rbp), %eax
	cltq
	movl	-42064(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	je	.L13
	movl	-42084(%rbp), %eax
	cltq
	movl	-41648(%rbp,%rax,4), %eax
	cmpl	%eax, -42076(%rbp)
	jle	.L13
	movl	-42084(%rbp), %eax
	cltq
	movl	-41648(%rbp,%rax,4), %eax
	movl	%eax, -42076(%rbp)
	movl	-42084(%rbp), %eax
	movl	%eax, -42072(%rbp)
.L13:
	addl	$1, -42084(%rbp)
.L12:
	movl	-42104(%rbp), %eax
	cmpl	%eax, -42084(%rbp)
	jl	.L14
	cmpl	$10000001, -42076(%rbp)
	je	.L26
	movl	-42072(%rbp), %eax
	cltq
	movl	$2, -42064(%rbp,%rax,4)
	movl	$0, -42084(%rbp)
	jmp	.L17
.L19:
	movl	-42084(%rbp), %eax
	movslq	%eax, %rcx
	movl	-42072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-40816(%rbp,%rax,4), %eax
	cmpl	$-1, %eax
	je	.L18
	movl	-42084(%rbp), %eax
	cltq
	movl	-42064(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	je	.L18
	movl	-42084(%rbp), %eax
	movslq	%eax, %rcx
	movl	-42072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-40816(%rbp,%rax,4), %edx
	movl	-42072(%rbp), %eax
	cltq
	movl	-41648(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-42084(%rbp), %eax
	cltq
	movl	-41648(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L18
	movl	-42084(%rbp), %eax
	cltq
	movl	-42072(%rbp), %edx
	movl	%edx, -41232(%rbp,%rax,4)
	movl	-42084(%rbp), %eax
	movslq	%eax, %rcx
	movl	-42072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-40816(%rbp,%rax,4), %edx
	movl	-42072(%rbp), %eax
	cltq
	movl	-41648(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-42084(%rbp), %eax
	cltq
	movl	%edx, -41648(%rbp,%rax,4)
	movl	-42084(%rbp), %eax
	cltq
	movl	$1, -42064(%rbp,%rax,4)
.L18:
	addl	$1, -42084(%rbp)
.L17:
	movl	-42104(%rbp), %eax
	cmpl	%eax, -42084(%rbp)
	jl	.L19
	jmp	.L20
.L26:
	nop
	movl	$0, -42084(%rbp)
	jmp	.L21
.L22:
	movl	-42084(%rbp), %eax
	cltq
	movl	-41648(%rbp,%rax,4), %edx
	movl	-42084(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -42084(%rbp)
.L21:
	movl	-42104(%rbp), %eax
	cmpl	%eax, -42084(%rbp)
	jl	.L22
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC3:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-40960(%rsp), %r11
	.cfi_def_cfa 11, 41016
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$760, %rsp
	.cfi_def_cfa_offset 41776
	movl	$40804, %edx
	movl	$255, %esi
	movq	%fs:40, %rax
	movq	%rax, 41704(%rsp)
	xorl	%eax, %eax
	leaq	896(%rsp), %r15
	movq	%r15, %rdi
	call	memset@PLT
	leaq	44(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %r12d
	testl	%r12d, %r12d
	jle	.L40
	leaq	52(%rsp), %rax
	xorl	%r13d, %r13d
	leaq	56(%rsp), %rbp
	movq	%rax, 24(%rsp)
	leaq	48(%rsp), %rax
	leaq	.LC1(%rip), %rbx
	movq	%rax, 16(%rsp)
.L4:
	movq	24(%rsp), %rdx
	movq	16(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	xorl	%r14d, %r14d
	leaq	60(%rsp), %r12
	call	__isoc99_scanf@PLT
	movl	52(%rsp), %eax
	testl	%eax, %eax
	jle	.L6
.L3:
	movq	%rbp, %rdx
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	48(%rsp), %rax
	movslq	60(%rsp), %rsi
	addl	$1, %r14d
	leaq	(%rax,%rax,4), %rdx
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rax,%rdx,4), %rax
	movl	56(%rsp), %edx
	addq	%rsi, %rax
	movl	%edx, 896(%rsp,%rax,4)
	cmpl	%r14d, 52(%rsp)
	jg	.L3
.L6:
	movl	44(%rsp), %r12d
	addl	$1, %r13d
	cmpl	%r13d, %r12d
	jg	.L4
	testl	%r12d, %r12d
	jle	.L40
	movl	%r12d, %edx
	leaq	64(%rsp), %rdi
	xorl	%esi, %esi
	salq	$2, %rdx
	call	memset@PLT
	leal	-1(%r12), %r8d
	movq	%rax, %rdi
	cmpl	$2, %r8d
	jbe	.L20
	movl	%r12d, %edx
	movdqa	.LC2(%rip), %xmm0
	leaq	480(%rsp), %rax
	shrl	$2, %edx
	subl	$1, %edx
	salq	$4, %rdx
	leaq	496(%rsp,%rdx), %rdx
.L8:
	movaps	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L8
	movl	%r12d, %eax
	andl	$-4, %eax
	testb	$3, %r12b
	je	.L2
.L7:
	movslq	%eax, %rdx
	movl	$10000001, 480(%rsp,%rdx,4)
	leal	1(%rax), %edx
	cmpl	%edx, %r12d
	jle	.L2
	movslq	%edx, %rdx
	addl	$2, %eax
	movl	$10000001, 480(%rsp,%rdx,4)
	cmpl	%eax, %r12d
	jle	.L2
	cltq
	movl	$10000001, 480(%rsp,%rax,4)
.L2:
	movl	$0, 480(%rsp)
	leaq	68(%rsp,%r8,4), %r9
	leaq	480(%rsp), %rbx
	testl	%r12d, %r12d
	jle	.L10
.L43:
	xorl	%eax, %eax
	movl	$10000001, %ecx
	jmp	.L12
.L21:
	movq	%rdx, %rax
.L12:
	cmpl	$2, (%rdi,%rax,4)
	je	.L11
	movl	(%rbx,%rax,4), %edx
	cmpl	%ecx, %edx
	jge	.L11
	movl	%eax, 12(%rsp)
	movl	%edx, %ecx
.L11:
	leaq	1(%rax), %rdx
	cmpq	%rax, %r8
	jne	.L21
	cmpl	$10000001, %ecx
	je	.L42
	movslq	12(%rsp), %r10
	movq	%rbx, %rsi
	movq	%rdi, %rax
	movl	$2, 64(%rsp,%r10,4)
	imulq	$404, %r10, %rdx
	addq	%r15, %rdx
.L16:
	movl	(%rdx), %ecx
	cmpl	$-1, %ecx
	je	.L15
	cmpl	$2, (%rax)
	je	.L15
	addl	480(%rsp,%r10,4), %ecx
	cmpl	(%rsi), %ecx
	jge	.L15
	movl	%ecx, (%rsi)
	movl	$1, (%rax)
.L15:
	addq	$4, %rax
	addq	$4, %rdx
	addq	$4, %rsi
	cmpq	%r9, %rax
	jne	.L16
	testl	%r12d, %r12d
	jg	.L43
.L10:
	movq	41704(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L44
	addq	$41720, %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
.L42:
	.cfi_restore_state
	xorl	%ebp, %ebp
	leaq	.LC3(%rip), %r12
.L13:
	movl	(%rbx,%rbp,4), %ecx
	movl	%ebp, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__printf_chk@PLT
	cmpl	%ebp, 44(%rsp)
	jg	.L13
	jmp	.L10
.L40:
	leaq	64(%rsp), %rdi
	leal	-1(%r12), %r8d
	jmp	.L2
.L20:
	xorl	%eax, %eax
	jmp	.L7
.L44:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.long	10000001
	.long	10000001
	.long	10000001
	.long	10000001
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC3:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-40960(%rsp), %r11
	.cfi_def_cfa 11, 41016
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$760, %rsp
	.cfi_def_cfa_offset 41776
	movl	$40804, %edx
	movl	$255, %esi
	movq	%fs:40, %rax
	movq	%rax, 41704(%rsp)
	xorl	%eax, %eax
	leaq	896(%rsp), %r15
	movq	%r15, %rdi
	call	memset@PLT
	leaq	44(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %r12d
	testl	%r12d, %r12d
	jle	.L40
	leaq	52(%rsp), %rax
	xorl	%r13d, %r13d
	leaq	56(%rsp), %rbp
	movq	%rax, 24(%rsp)
	leaq	48(%rsp), %rax
	leaq	.LC1(%rip), %rbx
	movq	%rax, 16(%rsp)
.L4:
	movq	24(%rsp), %rdx
	movq	16(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	xorl	%r14d, %r14d
	leaq	60(%rsp), %r12
	call	__isoc99_scanf@PLT
	movl	52(%rsp), %eax
	testl	%eax, %eax
	jle	.L6
.L3:
	movq	%rbp, %rdx
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	48(%rsp), %rax
	movslq	60(%rsp), %rsi
	addl	$1, %r14d
	leaq	(%rax,%rax,4), %rdx
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rax,%rdx,4), %rax
	movl	56(%rsp), %edx
	addq	%rsi, %rax
	movl	%edx, 896(%rsp,%rax,4)
	cmpl	%r14d, 52(%rsp)
	jg	.L3
.L6:
	movl	44(%rsp), %r12d
	addl	$1, %r13d
	cmpl	%r13d, %r12d
	jg	.L4
	testl	%r12d, %r12d
	jle	.L40
	movl	%r12d, %edx
	leaq	64(%rsp), %rdi
	xorl	%esi, %esi
	salq	$2, %rdx
	call	memset@PLT
	leal	-1(%r12), %r8d
	movq	%rax, %rdi
	cmpl	$2, %r8d
	jbe	.L20
	movl	%r12d, %edx
	movdqa	.LC2(%rip), %xmm0
	leaq	480(%rsp), %rax
	shrl	$2, %edx
	subl	$1, %edx
	salq	$4, %rdx
	leaq	496(%rsp,%rdx), %rdx
.L8:
	movaps	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L8
	movl	%r12d, %eax
	andl	$-4, %eax
	testb	$3, %r12b
	je	.L2
.L7:
	movslq	%eax, %rdx
	movl	$10000001, 480(%rsp,%rdx,4)
	leal	1(%rax), %edx
	cmpl	%edx, %r12d
	jle	.L2
	movslq	%edx, %rdx
	addl	$2, %eax
	movl	$10000001, 480(%rsp,%rdx,4)
	cmpl	%eax, %r12d
	jle	.L2
	cltq
	movl	$10000001, 480(%rsp,%rax,4)
.L2:
	movl	$0, 480(%rsp)
	leaq	68(%rsp,%r8,4), %r9
	leaq	480(%rsp), %rbx
	testl	%r12d, %r12d
	jle	.L10
.L43:
	xorl	%eax, %eax
	movl	$10000001, %ecx
	jmp	.L12
.L21:
	movq	%rdx, %rax
.L12:
	cmpl	$2, (%rdi,%rax,4)
	je	.L11
	movl	(%rbx,%rax,4), %edx
	cmpl	%ecx, %edx
	jge	.L11
	movl	%eax, 12(%rsp)
	movl	%edx, %ecx
.L11:
	leaq	1(%rax), %rdx
	cmpq	%rax, %r8
	jne	.L21
	cmpl	$10000001, %ecx
	je	.L42
	movslq	12(%rsp), %r10
	movq	%rbx, %rsi
	movq	%rdi, %rax
	movl	$2, 64(%rsp,%r10,4)
	imulq	$404, %r10, %rdx
	addq	%r15, %rdx
.L16:
	movl	(%rdx), %ecx
	cmpl	$-1, %ecx
	je	.L15
	cmpl	$2, (%rax)
	je	.L15
	addl	480(%rsp,%r10,4), %ecx
	cmpl	(%rsi), %ecx
	jge	.L15
	movl	%ecx, (%rsi)
	movl	$1, (%rax)
.L15:
	addq	$4, %rax
	addq	$4, %rdx
	addq	$4, %rsi
	cmpq	%r9, %rax
	jne	.L16
	testl	%r12d, %r12d
	jg	.L43
.L10:
	movq	41704(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L44
	addq	$41720, %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
.L42:
	.cfi_restore_state
	xorl	%ebp, %ebp
	leaq	.LC3(%rip), %r12
.L13:
	movl	(%rbx,%rbp,4), %ecx
	movl	%ebp, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__printf_chk@PLT
	cmpl	%ebp, 44(%rsp)
	jg	.L13
	jmp	.L10
.L40:
	leaq	64(%rsp), %rdi
	leal	-1(%r12), %r8d
	jmp	.L2
.L20:
	xorl	%eax, %eax
	jmp	.L7
.L44:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.long	10000001
	.long	10000001
	.long	10000001
	.long	10000001
	.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>
#define N 101

int main()
{
  int i,j,n,count=0,v,c,c1,v1;
  int G[N][N],col[N],d[N],pi[N],mincost,i2;

  for(i = 0; i < N; i++){

    for(j = 0; j < N; j++)
      G[i][j] = -1;

  }

  scanf("%d",&n);

  for(i = 0; i < n; i++){

    scanf("%d%d",&v,&c);

    for(j = 0; j < c; j++){
      scanf("%d%d",&v1,&c1);
      G[v][v1] = c1;
    }

  }
 
  for(i = 0; i < n; i++){

    col[i] = 0;
    pi[i] = -1;
    d[i] = 10000001;

  }

  d[0] = 0;
 
  while(1){

    mincost = 10000001;

    for(i = 0; i < n; i++){

      if(col[i] != 2 && d[i] < mincost){
        mincost = d[i];
        i2 = i;
      }

    }

    if(mincost == 10000001)break;

    col[i2] = 2;

    for(i = 0; i < n; i++){

      if(G[i2][i] != -1 && col[i] != 2 && (G[i2][i]+d[i2]) < d[i]){
	pi[i] = i2;
	d[i] = G[i2][i] + d[i2];
	col[i] = 1;
      }

    }

  }

  for(i = 0; i < n; i++)printf("%d %d\n",i,d[i]);

  return 0;
}
5
0 3 2 3 3 1 1 2
1 2 0 2 3 4
2 3 0 3 3 1 4 1
3 4 2 1 0 1 1 4 4 3
4 2 2 1 3 3

0 0
1 2
2 2
3 1
4 3

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>
#define N 101

int main()
{
  int i,j,n,count=0,v,c,c1,v1;
  int G[N][N],col[N],d[N],pi[N],mincost,i2;

  for(i = 0; i < N; i++){

    for(j = 0; j < N; j++)
      G[i][j] = -1;

  }

  scanf("%d",&n);

  for(i = 0; i < n; i++){

    scanf("%d%d",&v,&c);

    for(j = 0; j < c; j++){
      scanf("%d%d",&v1,&c1);
      G[v][v1] = c1;
    }

  }
 
  for(i = 0; i < n; i++){

    col[i] = 0;
    pi[i] = -1;
    d[i] = 10000001;

  }

  d[0] = 0;
 
  while(1){

    mincost = 10000001;

    for(i = 0; i < n; i++){

      if(col[i] != 2 && d[i] < mincost){
        mincost = d[i];
        i2 = i;
      }

    }

    if(mincost == 10000001)break;

    col[i2] = 2;

    for(i = 0; i < n; i++){

      if(G[i2][i] != -1 && col[i] != 2 && (G[i2][i]+d[i2]) < d[i]){
	pi[i] = i2;
	d[i] = G[i2][i] + d[i2];
	col[i] = 1;
      }

    }

  }

  for(i = 0; i < n; i++)printf("%d %d\n",i,d[i]);

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-40960(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1152, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -42068(%rbp)
	movl	$0, -42084(%rbp)
	jmp	.L2
.L5:
	movl	$0, -42080(%rbp)
	jmp	.L3
.L4:
	movl	-42080(%rbp), %eax
	movslq	%eax, %rcx
	movl	-42084(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	$-1, -40816(%rbp,%rax,4)
	addl	$1, -42080(%rbp)
.L3:
	cmpl	$100, -42080(%rbp)
	jle	.L4
	addl	$1, -42084(%rbp)
.L2:
	cmpl	$100, -42084(%rbp)
	jle	.L5
	leaq	-42104(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -42084(%rbp)
	jmp	.L6
.L9:
	leaq	-42096(%rbp), %rdx
	leaq	-42100(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -42080(%rbp)
	jmp	.L7
.L8:
	leaq	-42092(%rbp), %rdx
	leaq	-42088(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-42100(%rbp), %eax
	movl	-42088(%rbp), %edx
	movl	-42092(%rbp), %ecx
	movslq	%edx, %rsi
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	movl	%ecx, -40816(%rbp,%rax,4)
	addl	$1, -42080(%rbp)
.L7:
	movl	-42096(%rbp), %eax
	cmpl	%eax, -42080(%rbp)
	jl	.L8
	addl	$1, -42084(%rbp)
.L6:
	movl	-42104(%rbp), %eax
	cmpl	%eax, -42084(%rbp)
	jl	.L9
	movl	$0, -42084(%rbp)
	jmp	.L10
.L11:
	movl	-42084(%rbp), %eax
	cltq
	movl	$0, -42064(%rbp,%rax,4)
	movl	-42084(%rbp), %eax
	cltq
	movl	$-1, -41232(%rbp,%rax,4)
	movl	-42084(%rbp), %eax
	cltq
	movl	$10000001, -41648(%rbp,%rax,4)
	addl	$1, -42084(%rbp)
.L10:
	movl	-42104(%rbp), %eax
	cmpl	%eax, -42084(%rbp)
	jl	.L11
	movl	$0, -41648(%rbp)
.L20:
	movl	$10000001, -42076(%rbp)
	movl	$0, -42084(%rbp)
	jmp	.L12
.L14:
	movl	-42084(%rbp), %eax
	cltq
	movl	-42064(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	je	.L13
	movl	-42084(%rbp), %eax
	cltq
	movl	-41648(%rbp,%rax,4), %eax
	cmpl	%eax, -42076(%rbp)
	jle	.L13
	movl	-42084(%rbp), %eax
	cltq
	movl	-41648(%rbp,%rax,4), %eax
	movl	%eax, -42076(%rbp)
	movl	-42084(%rbp), %eax
	movl	%eax, -42072(%rbp)
.L13:
	addl	$1, -42084(%rbp)
.L12:
	movl	-42104(%rbp), %eax
	cmpl	%eax, -42084(%rbp)
	jl	.L14
	cmpl	$10000001, -42076(%rbp)
	je	.L26
	movl	-42072(%rbp), %eax
	cltq
	movl	$2, -42064(%rbp,%rax,4)
	movl	$0, -42084(%rbp)
	jmp	.L17
.L19:
	movl	-42084(%rbp), %eax
	movslq	%eax, %rcx
	movl	-42072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-40816(%rbp,%rax,4), %eax
	cmpl	$-1, %eax
	je	.L18
	movl	-42084(%rbp), %eax
	cltq
	movl	-42064(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	je	.L18
	movl	-42084(%rbp), %eax
	movslq	%eax, %rcx
	movl	-42072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-40816(%rbp,%rax,4), %edx
	movl	-42072(%rbp), %eax
	cltq
	movl	-41648(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-42084(%rbp), %eax
	cltq
	movl	-41648(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L18
	movl	-42084(%rbp), %eax
	cltq
	movl	-42072(%rbp), %edx
	movl	%edx, -41232(%rbp,%rax,4)
	movl	-42084(%rbp), %eax
	movslq	%eax, %rcx
	movl	-42072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-40816(%rbp,%rax,4), %edx
	movl	-42072(%rbp), %eax
	cltq
	movl	-41648(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-42084(%rbp), %eax
	cltq
	movl	%edx, -41648(%rbp,%rax,4)
	movl	-42084(%rbp), %eax
	cltq
	movl	$1, -42064(%rbp,%rax,4)
.L18:
	addl	$1, -42084(%rbp)
.L17:
	movl	-42104(%rbp), %eax
	cmpl	%eax, -42084(%rbp)
	jl	.L19
	jmp	.L20
.L26:
	nop
	movl	$0, -42084(%rbp)
	jmp	.L21
.L22:
	movl	-42084(%rbp), %eax
	cltq
	movl	-41648(%rbp,%rax,4), %edx
	movl	-42084(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -42084(%rbp)
.L21:
	movl	-42104(%rbp), %eax
	cmpl	%eax, -42084(%rbp)
	jl	.L22
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-40960(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1152, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -42068(%rbp)
	movl	$0, -42084(%rbp)
	jmp	.L2
.L5:
	movl	$0, -42080(%rbp)
	jmp	.L3
.L4:
	movl	-42080(%rbp), %eax
	movslq	%eax, %rcx
	movl	-42084(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	$-1, -40816(%rbp,%rax,4)
	addl	$1, -42080(%rbp)
.L3:
	cmpl	$100, -42080(%rbp)
	jle	.L4
	addl	$1, -42084(%rbp)
.L2:
	cmpl	$100, -42084(%rbp)
	jle	.L5
	leaq	-42104(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -42084(%rbp)
	jmp	.L6
.L9:
	leaq	-42096(%rbp), %rdx
	leaq	-42100(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -42080(%rbp)
	jmp	.L7
.L8:
	leaq	-42092(%rbp), %rdx
	leaq	-42088(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-42100(%rbp), %eax
	movl	-42088(%rbp), %edx
	movl	-42092(%rbp), %ecx
	movslq	%edx, %rsi
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	movl	%ecx, -40816(%rbp,%rax,4)
	addl	$1, -42080(%rbp)
.L7:
	movl	-42096(%rbp), %eax
	cmpl	%eax, -42080(%rbp)
	jl	.L8
	addl	$1, -42084(%rbp)
.L6:
	movl	-42104(%rbp), %eax
	cmpl	%eax, -42084(%rbp)
	jl	.L9
	movl	$0, -42084(%rbp)
	jmp	.L10
.L11:
	movl	-42084(%rbp), %eax
	cltq
	movl	$0, -42064(%rbp,%rax,4)
	movl	-42084(%rbp), %eax
	cltq
	movl	$-1, -41232(%rbp,%rax,4)
	movl	-42084(%rbp), %eax
	cltq
	movl	$10000001, -41648(%rbp,%rax,4)
	addl	$1, -42084(%rbp)
.L10:
	movl	-42104(%rbp), %eax
	cmpl	%eax, -42084(%rbp)
	jl	.L11
	movl	$0, -41648(%rbp)
.L20:
	movl	$10000001, -42076(%rbp)
	movl	$0, -42084(%rbp)
	jmp	.L12
.L14:
	movl	-42084(%rbp), %eax
	cltq
	movl	-42064(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	je	.L13
	movl	-42084(%rbp), %eax
	cltq
	movl	-41648(%rbp,%rax,4), %eax
	cmpl	%eax, -42076(%rbp)
	jle	.L13
	movl	-42084(%rbp), %eax
	cltq
	movl	-41648(%rbp,%rax,4), %eax
	movl	%eax, -42076(%rbp)
	movl	-42084(%rbp), %eax
	movl	%eax, -42072(%rbp)
.L13:
	addl	$1, -42084(%rbp)
.L12:
	movl	-42104(%rbp), %eax
	cmpl	%eax, -42084(%rbp)
	jl	.L14
	cmpl	$10000001, -42076(%rbp)
	je	.L26
	movl	-42072(%rbp), %eax
	cltq
	movl	$2, -42064(%rbp,%rax,4)
	movl	$0, -42084(%rbp)
	jmp	.L17
.L19:
	movl	-42084(%rbp), %eax
	movslq	%eax, %rcx
	movl	-42072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-40816(%rbp,%rax,4), %eax
	cmpl	$-1, %eax
	je	.L18
	movl	-42084(%rbp), %eax
	cltq
	movl	-42064(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	je	.L18
	movl	-42084(%rbp), %eax
	movslq	%eax, %rcx
	movl	-42072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-40816(%rbp,%rax,4), %edx
	movl	-42072(%rbp), %eax
	cltq
	movl	-41648(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-42084(%rbp), %eax
	cltq
	movl	-41648(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L18
	movl	-42084(%rbp), %eax
	cltq
	movl	-42072(%rbp), %edx
	movl	%edx, -41232(%rbp,%rax,4)
	movl	-42084(%rbp), %eax
	movslq	%eax, %rcx
	movl	-42072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-40816(%rbp,%rax,4), %edx
	movl	-42072(%rbp), %eax
	cltq
	movl	-41648(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-42084(%rbp), %eax
	cltq
	movl	%edx, -41648(%rbp,%rax,4)
	movl	-42084(%rbp), %eax
	cltq
	movl	$1, -42064(%rbp,%rax,4)
.L18:
	addl	$1, -42084(%rbp)
.L17:
	movl	-42104(%rbp), %eax
	cmpl	%eax, -42084(%rbp)
	jl	.L19
	jmp	.L20
.L26:
	nop
	movl	$0, -42084(%rbp)
	jmp	.L21
.L22:
	movl	-42084(%rbp), %eax
	cltq
	movl	-41648(%rbp,%rax,4), %edx
	movl	-42084(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -42084(%rbp)
.L21:
	movl	-42104(%rbp), %eax
	cmpl	%eax, -42084(%rbp)
	jl	.L22
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
