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>
int G = 1, n;
int c[101][101], d[101]={0};
int first[101], second[101];
void DFS(int u);
int main(){
  int i, j, k, u, v;
  scanf("%d",&n);
  for(i = 0; i < n; i++){
    for(j = 0; j < n; j++){
c[i][j] = 0; }
}
  for(i = 0; i < n; i++){
    scanf("%d%d", &u, &k);
    for(j = 0; j < k; j++){
      scanf("%d", &v);
      c[u-1][v-1] = 1;
    }
}
  for(i = 0; i < n; i++){
    if(d[i] == 0){
DFS(i); }
}
  for(i = 0; i < n; i++){
    printf("%d %d %d\n", i+1, first[i], second[i]);
}
return 0; }
void DFS(int u){
  int v;
  first[u] = G++;
  d[u] = 1;
  for(v = 0; v < n; v++){
    if(c[u][v]==1 && d[v]==0){
      DFS(v);
} }
  second[u] = G++;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	G
	.data
	.align 4
	.type	G, @object
	.size	G, 4
G:
	.long	1
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 40804
c:
	.zero	40804
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 404
d:
	.zero	404
	.globl	first
	.align 32
	.type	first, @object
	.size	first, 404
first:
	.zero	404
	.globl	second
	.align 32
	.type	second, @object
	.size	second, 404
second:
	.zero	404
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d %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
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -16(%rbp)
	jmp	.L2
.L5:
	movl	$0, -12(%rbp)
	jmp	.L3
.L4:
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%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
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L3:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L4
	addl	$1, -16(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L5
	movl	$0, -16(%rbp)
	jmp	.L6
.L9:
	leaq	-28(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L7
.L8:
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-20(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movslq	%edx, %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
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	$1, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L7:
	movl	-28(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L8
	addl	$1, -16(%rbp)
.L6:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L9
	movl	$0, -16(%rbp)
	jmp	.L10
.L12:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L11
	movl	-16(%rbp), %eax
	movl	%eax, %edi
	call	DFS
.L11:
	addl	$1, -16(%rbp)
.L10:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L12
	movl	$0, -16(%rbp)
	jmp	.L13
.L14:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	second(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	first(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	-16(%rbp), %ecx
	leal	1(%rcx), %esi
	movl	%edx, %ecx
	movl	%eax, %edx
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -16(%rbp)
.L13:
	movl	n(%rip), %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
.LFE0:
	.size	main, .-main
	.globl	DFS
	.type	DFS, @function
DFS:
.LFB1:
	.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	G(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, G(%rip)
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	first(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	$0, -4(%rbp)
	jmp	.L18
.L20:
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%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
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L19
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L19
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	DFS
.L19:
	addl	$1, -4(%rbp)
.L18:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L20
	movl	G(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, G(%rip)
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	second(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	DFS, .-DFS
	.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	DFS
	.type	DFS, @function
DFS:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	first(%rip), %r9
	leaq	d(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	second(%rip), %r8
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movslq	%edi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	G(%rip), %eax
	movl	$1, (%r15,%r13,4)
	movl	%eax, (%r9,%r13,4)
	leal	1(%rax), %edx
	movl	n(%rip), %eax
	testl	%eax, %eax
	jle	.L2
	imulq	$404, %r13, %r14
	leaq	c(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%rsi, %rbp
	addq	%rsi, %r14
.L8:
	cmpl	$1, (%r14,%rbx,4)
	je	.L15
.L3:
	addq	$1, %rbx
	addq	$404, %rbp
	cmpl	%ebx, %eax
	jg	.L8
.L2:
	leal	1(%rdx), %eax
	movl	%edx, (%r8,%r13,4)
	movl	%eax, G(%rip)
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L15:
	.cfi_restore_state
	movl	(%r15,%rbx,4), %r12d
	testl	%r12d, %r12d
	jne	.L3
	movl	$1, (%r15,%rbx,4)
	leal	1(%rdx), %ecx
	xorl	%r12d, %r12d
	movl	%edx, (%r9,%rbx,4)
	movq	%rsi, %rdx
.L7:
	cmpl	$1, 0(%rbp,%r12,4)
	je	.L16
.L4:
	addq	$1, %r12
	addq	$404, %rdx
	cmpl	%r12d, %eax
	jg	.L7
	movl	%ecx, (%r8,%rbx,4)
	leal	1(%rcx), %edx
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L16:
	movl	(%r15,%r12,4), %r11d
	testl	%r11d, %r11d
	jne	.L4
	leal	1(%rcx), %edi
	movl	$1, (%r15,%r12,4)
	movl	%edi, G(%rip)
	movl	%ecx, (%r9,%r12,4)
	xorl	%ecx, %ecx
.L6:
	cmpl	$1, (%rdx,%rcx,4)
	movl	%ecx, %edi
	je	.L17
.L5:
	addq	$1, %rcx
	cmpl	%ecx, %eax
	jg	.L6
	movl	G(%rip), %edi
	movl	%edi, (%r8,%r12,4)
	leal	1(%rdi), %ecx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L17:
	movl	(%r15,%rcx,4), %r10d
	testl	%r10d, %r10d
	jne	.L5
	movq	%rcx, 8(%rsp)
	movq	%rdx, (%rsp)
	call	DFS
	movl	n(%rip), %eax
	movq	(%rsp), %rdx
	leaq	first(%rip), %r9
	movq	8(%rsp), %rcx
	leaq	second(%rip), %r8
	leaq	c(%rip), %rsi
	jmp	.L5
	.cfi_endproc
.LFE24:
	.size	DFS, .-DFS
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d %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
	leaq	n(%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	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	jle	.L38
	leal	-1(%rax), %r13d
	leaq	c(%rip), %rbx
	imulq	$404, %r13, %r13
	leaq	404(%rbx), %rdx
	movq	%rbx, %rcx
	leaq	0(,%rax,4), %r12
	addq	%rdx, %r13
	.p2align 4,,10
	.p2align 3
.L20:
	movq	%rcx, %rdi
	movq	%r12, %rdx
	xorl	%esi, %esi
	call	memset@PLT
	movq	%rax, %rcx
	addq	$404, %rcx
	cmpq	%rcx, %r13
	jne	.L20
	leaq	64(%rsp), %rax
	xorl	%r13d, %r13d
	leaq	60(%rsp), %r15
	movq	%rax, 8(%rsp)
	leaq	68(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L22:
	movq	8(%rsp), %rsi
	movq	%r15, %rdx
	xorl	%eax, %eax
	xorl	%r14d, %r14d
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	60(%rsp), %r11d
	testl	%r11d, %r11d
	jle	.L24
	.p2align 4,,10
	.p2align 3
.L21:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	68(%rsp), %eax
	leal	-1(%rax), %edx
	movl	64(%rsp), %eax
	movslq	%edx, %rdx
	subl	$1, %eax
	cltq
	leaq	(%rax,%rax,4), %rsi
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rax,%rsi,4), %rax
	addq	%rdx, %rax
	movl	$1, (%rbx,%rax,4)
	cmpl	%r14d, 60(%rsp)
	jg	.L21
.L24:
	movl	n(%rip), %eax
	addl	$1, %r13d
	cmpl	%r13d, %eax
	jg	.L22
	testl	%eax, %eax
	jle	.L38
	leaq	c(%rip), %r13
	xorl	%r12d, %r12d
	leaq	d(%rip), %r15
	leaq	first(%rip), %r9
	leaq	second(%rip), %r8
	jmp	.L37
	.p2align 4,,10
	.p2align 3
.L25:
	addq	$1, %r12
	addq	$404, %r13
	cmpl	%r12d, %eax
	jle	.L56
.L37:
	movl	(%r15,%r12,4), %r10d
	testl	%r10d, %r10d
	jne	.L25
	movl	G(%rip), %ecx
	movl	$1, (%r15,%r12,4)
	movq	%rbx, %r14
	xorl	%ebp, %ebp
	movl	%ecx, (%r9,%r12,4)
	leal	1(%rcx), %edx
.L36:
	cmpl	$1, 0(%r13,%rbp,4)
	je	.L57
.L26:
	addq	$1, %rbp
	addq	$404, %r14
	cmpl	%ebp, %eax
	jg	.L36
	movl	%edx, (%r8,%r12,4)
	leal	1(%rdx), %ecx
	addq	$1, %r12
	addq	$404, %r13
	movl	%ecx, G(%rip)
	cmpl	%r12d, %eax
	jg	.L37
.L56:
	testl	%eax, %eax
	jle	.L38
	xorl	%ebx, %ebx
	leaq	first(%rip), %r13
	leaq	second(%rip), %r12
	leaq	.LC2(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L39:
	movl	0(%r13,%rbx,4), %ecx
	movl	(%r12,%rbx,4), %r8d
	leal	1(%rbx), %edx
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movl	$1, %edi
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, n(%rip)
	jg	.L39
.L38:
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L58
	addq	$88, %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
.L57:
	.cfi_restore_state
	movl	(%r15,%rbp,4), %edi
	testl	%edi, %edi
	jne	.L26
	movl	%edx, (%r9,%rbp,4)
	leal	1(%rdx), %edi
	movl	$1, (%r15,%rbp,4)
	testl	%eax, %eax
	jle	.L27
	movq	%rbx, %rcx
	xorl	%edx, %edx
.L35:
	cmpl	$1, (%r14,%rdx,4)
	je	.L59
.L28:
	addq	$1, %rdx
	addq	$404, %rcx
	cmpl	%edx, %eax
	jg	.L35
.L27:
	movl	%edi, (%r8,%rbp,4)
	leal	1(%rdi), %edx
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L59:
	movl	(%r15,%rdx,4), %esi
	testl	%esi, %esi
	jne	.L28
	movl	%edi, (%r9,%rdx,4)
	xorl	%esi, %esi
	leal	1(%rdi), %r10d
	movl	$1, (%r15,%rdx,4)
.L29:
	cmpl	$1, (%rcx,%rsi,4)
	je	.L60
.L30:
	addq	$1, %rsi
	cmpl	%esi, %eax
	jg	.L29
	movl	%r10d, (%r8,%rdx,4)
	leal	1(%r10), %edi
	jmp	.L28
.L60:
	cmpl	$0, (%r15,%rsi,4)
	jne	.L30
	leal	1(%r10), %eax
	movl	%r10d, (%r9,%rsi,4)
	imulq	$404, %rsi, %r10
	movl	$1, (%r15,%rsi,4)
	movl	%eax, G(%rip)
	xorl	%eax, %eax
	addq	%rbx, %r10
.L31:
	cmpl	$1, (%r10,%rax,4)
	movl	%eax, %edi
	je	.L61
.L32:
	addq	$1, %rax
	cmpl	%eax, n(%rip)
	jg	.L31
	movl	G(%rip), %r10d
	movl	%r10d, %eax
	addl	$1, %r10d
	movl	%eax, (%r8,%rsi,4)
	movl	n(%rip), %eax
	jmp	.L30
.L61:
	cmpl	$0, (%r15,%rax,4)
	jne	.L32
	movq	%rax, 40(%rsp)
	movq	%rsi, 32(%rsp)
	movq	%r10, 24(%rsp)
	movq	%rdx, 16(%rsp)
	movq	%rcx, 8(%rsp)
	call	DFS
	movq	40(%rsp), %rax
	movq	32(%rsp), %rsi
	leaq	second(%rip), %r8
	movq	24(%rsp), %r10
	movq	16(%rsp), %rdx
	leaq	first(%rip), %r9
	movq	8(%rsp), %rcx
	jmp	.L32
.L58:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	second
	.bss
	.align 32
	.type	second, @object
	.size	second, 404
second:
	.zero	404
	.globl	first
	.align 32
	.type	first, @object
	.size	first, 404
first:
	.zero	404
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 404
d:
	.zero	404
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 40804
c:
	.zero	40804
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	G
	.data
	.align 4
	.type	G, @object
	.size	G, 4
G:
	.long	1
	.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	DFS
	.type	DFS, @function
DFS:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	first(%rip), %r9
	leaq	d(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	second(%rip), %r8
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movslq	%edi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	G(%rip), %eax
	movl	$1, (%r15,%r13,4)
	movl	%eax, (%r9,%r13,4)
	leal	1(%rax), %edx
	movl	n(%rip), %eax
	testl	%eax, %eax
	jle	.L2
	imulq	$404, %r13, %r14
	leaq	c(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%rsi, %rbp
	addq	%rsi, %r14
.L8:
	cmpl	$1, (%r14,%rbx,4)
	je	.L15
.L3:
	addq	$1, %rbx
	addq	$404, %rbp
	cmpl	%ebx, %eax
	jg	.L8
.L2:
	leal	1(%rdx), %eax
	movl	%edx, (%r8,%r13,4)
	movl	%eax, G(%rip)
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L15:
	.cfi_restore_state
	movl	(%r15,%rbx,4), %r12d
	testl	%r12d, %r12d
	jne	.L3
	movl	$1, (%r15,%rbx,4)
	leal	1(%rdx), %ecx
	xorl	%r12d, %r12d
	movl	%edx, (%r9,%rbx,4)
	movq	%rsi, %rdx
.L7:
	cmpl	$1, 0(%rbp,%r12,4)
	je	.L16
.L4:
	addq	$1, %r12
	addq	$404, %rdx
	cmpl	%r12d, %eax
	jg	.L7
	movl	%ecx, (%r8,%rbx,4)
	leal	1(%rcx), %edx
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L16:
	movl	(%r15,%r12,4), %r11d
	testl	%r11d, %r11d
	jne	.L4
	leal	1(%rcx), %edi
	movl	$1, (%r15,%r12,4)
	movl	%edi, G(%rip)
	movl	%ecx, (%r9,%r12,4)
	xorl	%ecx, %ecx
.L6:
	cmpl	$1, (%rdx,%rcx,4)
	movl	%ecx, %edi
	je	.L17
.L5:
	addq	$1, %rcx
	cmpl	%ecx, %eax
	jg	.L6
	movl	G(%rip), %edi
	movl	%edi, (%r8,%r12,4)
	leal	1(%rdi), %ecx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L17:
	movl	(%r15,%rcx,4), %r10d
	testl	%r10d, %r10d
	jne	.L5
	movq	%rcx, 8(%rsp)
	movq	%rdx, (%rsp)
	call	DFS
	movl	n(%rip), %eax
	movq	(%rsp), %rdx
	leaq	first(%rip), %r9
	movq	8(%rsp), %rcx
	leaq	second(%rip), %r8
	leaq	c(%rip), %rsi
	jmp	.L5
	.cfi_endproc
.LFE24:
	.size	DFS, .-DFS
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d %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
	leaq	n(%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	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	jle	.L38
	leal	-1(%rax), %r13d
	leaq	c(%rip), %rbx
	imulq	$404, %r13, %r13
	leaq	404(%rbx), %rdx
	movq	%rbx, %rcx
	leaq	0(,%rax,4), %r12
	addq	%rdx, %r13
	.p2align 4,,10
	.p2align 3
.L20:
	movq	%rcx, %rdi
	movq	%r12, %rdx
	xorl	%esi, %esi
	call	memset@PLT
	movq	%rax, %rcx
	addq	$404, %rcx
	cmpq	%rcx, %r13
	jne	.L20
	leaq	64(%rsp), %rax
	xorl	%r13d, %r13d
	leaq	60(%rsp), %r15
	movq	%rax, 8(%rsp)
	leaq	68(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L22:
	movq	8(%rsp), %rsi
	movq	%r15, %rdx
	xorl	%eax, %eax
	xorl	%r14d, %r14d
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	60(%rsp), %r11d
	testl	%r11d, %r11d
	jle	.L24
	.p2align 4,,10
	.p2align 3
.L21:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	68(%rsp), %eax
	leal	-1(%rax), %edx
	movl	64(%rsp), %eax
	movslq	%edx, %rdx
	subl	$1, %eax
	cltq
	leaq	(%rax,%rax,4), %rsi
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rax,%rsi,4), %rax
	addq	%rdx, %rax
	movl	$1, (%rbx,%rax,4)
	cmpl	%r14d, 60(%rsp)
	jg	.L21
.L24:
	movl	n(%rip), %eax
	addl	$1, %r13d
	cmpl	%r13d, %eax
	jg	.L22
	testl	%eax, %eax
	jle	.L38
	leaq	c(%rip), %r13
	xorl	%r12d, %r12d
	leaq	d(%rip), %r15
	leaq	first(%rip), %r9
	leaq	second(%rip), %r8
	jmp	.L37
	.p2align 4,,10
	.p2align 3
.L25:
	addq	$1, %r12
	addq	$404, %r13
	cmpl	%r12d, %eax
	jle	.L56
.L37:
	movl	(%r15,%r12,4), %r10d
	testl	%r10d, %r10d
	jne	.L25
	movl	G(%rip), %ecx
	movl	$1, (%r15,%r12,4)
	movq	%rbx, %r14
	xorl	%ebp, %ebp
	movl	%ecx, (%r9,%r12,4)
	leal	1(%rcx), %edx
.L36:
	cmpl	$1, 0(%r13,%rbp,4)
	je	.L57
.L26:
	addq	$1, %rbp
	addq	$404, %r14
	cmpl	%ebp, %eax
	jg	.L36
	movl	%edx, (%r8,%r12,4)
	leal	1(%rdx), %ecx
	addq	$1, %r12
	addq	$404, %r13
	movl	%ecx, G(%rip)
	cmpl	%r12d, %eax
	jg	.L37
.L56:
	testl	%eax, %eax
	jle	.L38
	xorl	%ebx, %ebx
	leaq	first(%rip), %r13
	leaq	second(%rip), %r12
	leaq	.LC2(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L39:
	movl	0(%r13,%rbx,4), %ecx
	movl	(%r12,%rbx,4), %r8d
	leal	1(%rbx), %edx
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movl	$1, %edi
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, n(%rip)
	jg	.L39
.L38:
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L58
	addq	$88, %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
.L57:
	.cfi_restore_state
	movl	(%r15,%rbp,4), %edi
	testl	%edi, %edi
	jne	.L26
	movl	%edx, (%r9,%rbp,4)
	leal	1(%rdx), %edi
	movl	$1, (%r15,%rbp,4)
	testl	%eax, %eax
	jle	.L27
	movq	%rbx, %rcx
	xorl	%edx, %edx
.L35:
	cmpl	$1, (%r14,%rdx,4)
	je	.L59
.L28:
	addq	$1, %rdx
	addq	$404, %rcx
	cmpl	%edx, %eax
	jg	.L35
.L27:
	movl	%edi, (%r8,%rbp,4)
	leal	1(%rdi), %edx
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L59:
	movl	(%r15,%rdx,4), %esi
	testl	%esi, %esi
	jne	.L28
	movl	%edi, (%r9,%rdx,4)
	xorl	%esi, %esi
	leal	1(%rdi), %r10d
	movl	$1, (%r15,%rdx,4)
.L29:
	cmpl	$1, (%rcx,%rsi,4)
	je	.L60
.L30:
	addq	$1, %rsi
	cmpl	%esi, %eax
	jg	.L29
	movl	%r10d, (%r8,%rdx,4)
	leal	1(%r10), %edi
	jmp	.L28
.L60:
	cmpl	$0, (%r15,%rsi,4)
	jne	.L30
	leal	1(%r10), %eax
	movl	%r10d, (%r9,%rsi,4)
	imulq	$404, %rsi, %r10
	movl	$1, (%r15,%rsi,4)
	movl	%eax, G(%rip)
	xorl	%eax, %eax
	addq	%rbx, %r10
.L31:
	cmpl	$1, (%r10,%rax,4)
	movl	%eax, %edi
	je	.L61
.L32:
	addq	$1, %rax
	cmpl	%eax, n(%rip)
	jg	.L31
	movl	G(%rip), %r10d
	movl	%r10d, %eax
	addl	$1, %r10d
	movl	%eax, (%r8,%rsi,4)
	movl	n(%rip), %eax
	jmp	.L30
.L61:
	cmpl	$0, (%r15,%rax,4)
	jne	.L32
	movq	%rax, 40(%rsp)
	movq	%rsi, 32(%rsp)
	movq	%r10, 24(%rsp)
	movq	%rdx, 16(%rsp)
	movq	%rcx, 8(%rsp)
	call	DFS
	movq	40(%rsp), %rax
	movq	32(%rsp), %rsi
	leaq	second(%rip), %r8
	movq	24(%rsp), %r10
	movq	16(%rsp), %rdx
	leaq	first(%rip), %r9
	movq	8(%rsp), %rcx
	jmp	.L32
.L58:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	second
	.bss
	.align 32
	.type	second, @object
	.size	second, 404
second:
	.zero	404
	.globl	first
	.align 32
	.type	first, @object
	.size	first, 404
first:
	.zero	404
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 404
d:
	.zero	404
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 40804
c:
	.zero	40804
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	G
	.data
	.align 4
	.type	G, @object
	.size	G, 4
G:
	.long	1
	.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>
int G = 1, n;
int c[101][101], d[101]={0};
int first[101], second[101];
void DFS(int u);
int main(){
  int i, j, k, u, v;
  scanf("%d",&n);
  for(i = 0; i < n; i++){
    for(j = 0; j < n; j++){
c[i][j] = 0; }
}
  for(i = 0; i < n; i++){
    scanf("%d%d", &u, &k);
    for(j = 0; j < k; j++){
      scanf("%d", &v);
      c[u-1][v-1] = 1;
    }
}
  for(i = 0; i < n; i++){
    if(d[i] == 0){
DFS(i); }
}
  for(i = 0; i < n; i++){
    printf("%d %d %d\n", i+1, first[i], second[i]);
}
return 0; }
void DFS(int u){
  int v;
  first[u] = G++;
  d[u] = 1;
  for(v = 0; v < n; v++){
    if(c[u][v]==1 && d[v]==0){
      DFS(v);
} }
  second[u] = G++;
}


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

1 1 10
2 2 9
3 3 6
4 7 8
5 11 12
6 4 5
 1 1 2
2 3 8
3 5 6
4 4 7
 1 1 2
2 3 6
3 7 8
4 4 5
 1 1 12
2 2 11
3 3 8
4 9 10
5 4 7
6 5 6
 1 1 4
2 5 8
3 2 3
4 6 7
 1 1 4
2 5 6
3 2 3
4 7 8
 1 1 12
2 2 7
3 8 11
4 3 6
5 9 10
6 4 5
 1 1 6
2 2 5
3 7 8
4 3 4
 1 1 4
2 2 3
3 5 6
4 7 8
 1 1 8
2 2 7
3 4 5
4 3 6

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

```c
#include <stdio.h>
int G = 1, n;
int c[101][101], d[101]={0};
int first[101], second[101];
void DFS(int u);
int main(){
  int i, j, k, u, v;
  scanf("%d",&n);
  for(i = 0; i < n; i++){
    for(j = 0; j < n; j++){
c[i][j] = 0; }
}
  for(i = 0; i < n; i++){
    scanf("%d%d", &u, &k);
    for(j = 0; j < k; j++){
      scanf("%d", &v);
      c[u-1][v-1] = 1;
    }
}
  for(i = 0; i < n; i++){
    if(d[i] == 0){
DFS(i); }
}
  for(i = 0; i < n; i++){
    printf("%d %d %d\n", i+1, first[i], second[i]);
}
return 0; }
void DFS(int u){
  int v;
  first[u] = G++;
  d[u] = 1;
  for(v = 0; v < n; v++){
    if(c[u][v]==1 && d[v]==0){
      DFS(v);
} }
  second[u] = G++;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	G
	.data
	.align 4
	.type	G, @object
	.size	G, 4
G:
	.long	1
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 40804
c:
	.zero	40804
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 404
d:
	.zero	404
	.globl	first
	.align 32
	.type	first, @object
	.size	first, 404
first:
	.zero	404
	.globl	second
	.align 32
	.type	second, @object
	.size	second, 404
second:
	.zero	404
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d %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
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -16(%rbp)
	jmp	.L2
.L5:
	movl	$0, -12(%rbp)
	jmp	.L3
.L4:
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%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
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L3:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L4
	addl	$1, -16(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L5
	movl	$0, -16(%rbp)
	jmp	.L6
.L9:
	leaq	-28(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L7
.L8:
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-20(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movslq	%edx, %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
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	$1, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L7:
	movl	-28(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L8
	addl	$1, -16(%rbp)
.L6:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L9
	movl	$0, -16(%rbp)
	jmp	.L10
.L12:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L11
	movl	-16(%rbp), %eax
	movl	%eax, %edi
	call	DFS
.L11:
	addl	$1, -16(%rbp)
.L10:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L12
	movl	$0, -16(%rbp)
	jmp	.L13
.L14:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	second(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	first(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	-16(%rbp), %ecx
	leal	1(%rcx), %esi
	movl	%edx, %ecx
	movl	%eax, %edx
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -16(%rbp)
.L13:
	movl	n(%rip), %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
.LFE0:
	.size	main, .-main
	.globl	DFS
	.type	DFS, @function
DFS:
.LFB1:
	.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	G(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, G(%rip)
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	first(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	$0, -4(%rbp)
	jmp	.L18
.L20:
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%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
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L19
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L19
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	DFS
.L19:
	addl	$1, -4(%rbp)
.L18:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L20
	movl	G(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, G(%rip)
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	second(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	DFS, .-DFS
	.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
	.data
	.align 4
	.type	G, @object
	.size	G, 4
G:
	.long	1
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 40804
c:
	.zero	40804
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 404
d:
	.zero	404
	.globl	first
	.align 32
	.type	first, @object
	.size	first, 404
first:
	.zero	404
	.globl	second
	.align 32
	.type	second, @object
	.size	second, 404
second:
	.zero	404
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d %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
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -16(%rbp)
	jmp	.L2
.L5:
	movl	$0, -12(%rbp)
	jmp	.L3
.L4:
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%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
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L3:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L4
	addl	$1, -16(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L5
	movl	$0, -16(%rbp)
	jmp	.L6
.L9:
	leaq	-28(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L7
.L8:
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-20(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movslq	%edx, %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
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	$1, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L7:
	movl	-28(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L8
	addl	$1, -16(%rbp)
.L6:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L9
	movl	$0, -16(%rbp)
	jmp	.L10
.L12:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L11
	movl	-16(%rbp), %eax
	movl	%eax, %edi
	call	DFS
.L11:
	addl	$1, -16(%rbp)
.L10:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L12
	movl	$0, -16(%rbp)
	jmp	.L13
.L14:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	second(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	first(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	-16(%rbp), %ecx
	leal	1(%rcx), %esi
	movl	%edx, %ecx
	movl	%eax, %edx
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -16(%rbp)
.L13:
	movl	n(%rip), %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
.LFE0:
	.size	main, .-main
	.globl	DFS
	.type	DFS, @function
DFS:
.LFB1:
	.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	G(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, G(%rip)
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	first(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	$0, -4(%rbp)
	jmp	.L18
.L20:
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%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
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L19
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L19
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	DFS
.L19:
	addl	$1, -4(%rbp)
.L18:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L20
	movl	G(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, G(%rip)
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	second(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	DFS, .-DFS
	.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:
