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

```c
#include <stdio.h>
#include <stdlib.h>

#define MAXV 100
#define MAXE 1000

int v, e;
int a = 0;
int *visited;
int *s, *t;

void resultSearch(int);

int main(){

        int i;

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

        if(e < 0 || MAXE < e || v < 1 || MAXV < v)return 0;

        s = (int*)malloc(e*sizeof(int));
        t = (int*)malloc(e*sizeof(int));


        visited = (int*)malloc(v*sizeof(int));

        for(i = 0;i < e;i ++)
                {
                        scanf("%d %d", &s[i], &t[i]);
                }

        for(i = 0;i < v;i ++)
                {
                        visited[i] = 0;
                }

        for(i = 0;i < v;i ++)
                {
                        if(a == 1)
                                {
                                        break;
                                }else if(visited[i]  == 0 && a == 0)
                                {
                                        resultSearch(i);
                                }
                }

        printf("%d\n", a);

        free(s);
        free(t);
        free(visited);

        return 0;
}

void resultSearch(int v){
        int i;

        if(visited[v] == 1){
                a = 1;
        }else if(visited[v] == 0){
                visited[v] = 1;

                for(i = 0; i < e; i ++)
                {
                        if(s[i] == v)resultSearch(t[i]);
                }
                visited[v] = 2;
        }
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	v
	.bss
	.align 4
	.type	v, @object
	.size	v, 4
v:
	.zero	4
	.globl	e
	.align 4
	.type	e, @object
	.size	e, 4
e:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	visited
	.align 8
	.type	visited, @object
	.size	visited, 8
visited:
	.zero	8
	.globl	s
	.align 8
	.type	s, @object
	.size	s, 8
s:
	.zero	8
	.globl	t
	.align 8
	.type	t, @object
	.size	t, 8
t:
	.zero	8
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d\n"
	.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	$16, %rsp
	leaq	e(%rip), %rax
	movq	%rax, %rdx
	leaq	v(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	e(%rip), %eax
	testl	%eax, %eax
	js	.L2
	movl	e(%rip), %eax
	cmpl	$1000, %eax
	jg	.L2
	movl	v(%rip), %eax
	testl	%eax, %eax
	jle	.L2
	movl	v(%rip), %eax
	cmpl	$100, %eax
	jle	.L3
.L2:
	movl	$0, %eax
	jmp	.L4
.L3:
	movl	e(%rip), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, s(%rip)
	movl	e(%rip), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, t(%rip)
	movl	v(%rip), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, visited(%rip)
	movl	$0, -4(%rbp)
	jmp	.L5
.L6:
	movq	t(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	movq	s(%rip), %rcx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4(%rbp)
.L5:
	movl	e(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L6
	movl	$0, -4(%rbp)
	jmp	.L7
.L8:
	movq	visited(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	$0, (%rax)
	addl	$1, -4(%rbp)
.L7:
	movl	v(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L8
	movl	$0, -4(%rbp)
	jmp	.L9
.L13:
	movl	a(%rip), %eax
	cmpl	$1, %eax
	je	.L14
	movq	visited(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L12
	movl	a(%rip), %eax
	testl	%eax, %eax
	jne	.L12
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	resultSearch
.L12:
	addl	$1, -4(%rbp)
.L9:
	movl	v(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L13
	jmp	.L11
.L14:
	nop
.L11:
	movl	a(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	s(%rip), %rax
	movq	%rax, %rdi
	call	free@PLT
	movq	t(%rip), %rax
	movq	%rax, %rdi
	call	free@PLT
	movq	visited(%rip), %rax
	movq	%rax, %rdi
	call	free@PLT
	movl	$0, %eax
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	resultSearch
	.type	resultSearch, @function
resultSearch:
.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	visited(%rip), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	$1, %eax
	jne	.L16
	movl	$1, a(%rip)
	jmp	.L21
.L16:
	movq	visited(%rip), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L21
	movq	visited(%rip), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	$1, (%rax)
	movl	$0, -4(%rbp)
	jmp	.L18
.L20:
	movq	s(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -20(%rbp)
	jne	.L19
	movq	t(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, %edi
	call	resultSearch
.L19:
	addl	$1, -4(%rbp)
.L18:
	movl	e(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L20
	movq	visited(%rip), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	$2, (%rax)
.L21:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	resultSearch, .-resultSearch
	.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	resultSearch
	.type	resultSearch, @function
resultSearch:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edi, %rax
	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
	movq	%rax, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	visited(%rip), %r13
	leaq	0(%r13,%rax,4), %r12
	movl	(%r12), %eax
	cmpl	$1, %eax
	je	.L19
	testl	%eax, %eax
	jne	.L1
	movl	$1, (%r12)
	movl	e(%rip), %eax
	xorl	%ebx, %ebx
	movq	s(%rip), %r14
	testl	%eax, %eax
	jle	.L12
.L11:
	cmpl	%ebp, (%r14,%rbx,4)
	je	.L20
.L5:
	addq	$1, %rbx
	cmpl	%ebx, %eax
	jg	.L11
.L12:
	movl	$2, (%r12)
.L1:
	addq	$40, %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
.L19:
	.cfi_restore_state
	movl	$1, a(%rip)
	addq	$40, %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
.L20:
	.cfi_restore_state
	movq	t(%rip), %r8
	movslq	(%r8,%rbx,4), %rcx
	movq	%rcx, %rdx
	leaq	0(%r13,%rcx,4), %rcx
	movl	(%rcx), %esi
	cmpl	$1, %esi
	je	.L21
	testl	%esi, %esi
	jne	.L5
	movl	$1, (%rcx)
	movl	e(%rip), %eax
	xorl	%r15d, %r15d
	testl	%eax, %eax
	jle	.L10
.L7:
	cmpl	(%r14,%r15,4), %edx
	je	.L22
	addq	$1, %r15
	cmpl	%r15d, %eax
	jg	.L7
.L10:
	movl	$2, (%rcx)
	movl	e(%rip), %eax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L21:
	movl	$1, a(%rip)
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L22:
	movl	(%r8,%r15,4), %edi
	movq	%rcx, 24(%rsp)
	addq	$1, %r15
	movl	%edx, 20(%rsp)
	movq	%r8, 8(%rsp)
	call	resultSearch
	movl	e(%rip), %eax
	movq	8(%rsp), %r8
	movl	20(%rsp), %edx
	movq	24(%rsp), %rcx
	cmpl	%r15d, %eax
	jg	.L7
	jmp	.L10
	.cfi_endproc
.LFE40:
	.size	resultSearch, .-resultSearch
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	e(%rip), %rdx
	leaq	v(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movq	%rbp, %rdi
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	call	__isoc99_scanf@PLT
	movl	e(%rip), %r12d
	cmpl	$1000, %r12d
	ja	.L24
	movl	v(%rip), %ebx
	leal	-1(%rbx), %eax
	cmpl	$99, %eax
	jbe	.L40
.L24:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L40:
	.cfi_restore_state
	movslq	%r12d, %r13
	salq	$2, %r13
	movq	%r13, %rdi
	call	malloc@PLT
	movq	%r13, %rdi
	movq	%rax, s(%rip)
	call	malloc@PLT
	movslq	%ebx, %rdi
	xorl	%ebx, %ebx
	salq	$2, %rdi
	movq	%rax, t(%rip)
	call	malloc@PLT
	movq	%rax, visited(%rip)
	testl	%r12d, %r12d
	je	.L27
	.p2align 4,,10
	.p2align 3
.L25:
	movq	t(%rip), %rdx
	leaq	0(,%rbx,4), %rsi
	xorl	%eax, %eax
	movq	%rbp, %rdi
	addq	$1, %rbx
	addq	%rsi, %rdx
	addq	s(%rip), %rsi
	call	__isoc99_scanf@PLT
	cmpl	%ebx, e(%rip)
	jg	.L25
	cmpl	$0, v(%rip)
	jle	.L41
.L27:
	movq	visited(%rip), %r10
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L26:
	movl	$0, (%r10,%rax,4)
	movl	v(%rip), %ecx
	addq	$1, %rax
	cmpl	%eax, %ecx
	jg	.L26
	movl	a(%rip), %edx
	testl	%ecx, %ecx
	jle	.L28
	xorl	%r9d, %r9d
	.p2align 4,,10
	.p2align 3
.L31:
	movl	%r9d, %edi
	cmpl	$1, %edx
	je	.L28
	movl	%edx, %eax
	orl	(%r10,%r9,4), %eax
	je	.L42
	addq	$1, %r9
	cmpl	%r9d, v(%rip)
	jg	.L31
.L28:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	s(%rip), %rdi
	call	free@PLT
	movq	t(%rip), %rdi
	call	free@PLT
	movq	visited(%rip), %rdi
	call	free@PLT
	jmp	.L24
.L42:
	call	resultSearch
	addq	$1, %r9
	cmpl	%r9d, v(%rip)
	movl	a(%rip), %edx
	jg	.L31
	jmp	.L28
.L41:
	movl	a(%rip), %edx
	jmp	.L28
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.globl	t
	.bss
	.align 8
	.type	t, @object
	.size	t, 8
t:
	.zero	8
	.globl	s
	.align 8
	.type	s, @object
	.size	s, 8
s:
	.zero	8
	.globl	visited
	.align 8
	.type	visited, @object
	.size	visited, 8
visited:
	.zero	8
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	e
	.align 4
	.type	e, @object
	.size	e, 4
e:
	.zero	4
	.globl	v
	.align 4
	.type	v, @object
	.size	v, 4
v:
	.zero	4
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	resultSearch
	.type	resultSearch, @function
resultSearch:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edi, %rax
	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
	movq	%rax, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	visited(%rip), %r13
	leaq	0(%r13,%rax,4), %r12
	movl	(%r12), %eax
	cmpl	$1, %eax
	je	.L19
	testl	%eax, %eax
	jne	.L1
	movl	$1, (%r12)
	movl	e(%rip), %eax
	xorl	%ebx, %ebx
	movq	s(%rip), %r14
	testl	%eax, %eax
	jle	.L12
.L11:
	cmpl	%ebp, (%r14,%rbx,4)
	je	.L20
.L5:
	addq	$1, %rbx
	cmpl	%ebx, %eax
	jg	.L11
.L12:
	movl	$2, (%r12)
.L1:
	addq	$40, %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
.L19:
	.cfi_restore_state
	movl	$1, a(%rip)
	addq	$40, %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
.L20:
	.cfi_restore_state
	movq	t(%rip), %r8
	movslq	(%r8,%rbx,4), %rcx
	movq	%rcx, %rdx
	leaq	0(%r13,%rcx,4), %rcx
	movl	(%rcx), %esi
	cmpl	$1, %esi
	je	.L21
	testl	%esi, %esi
	jne	.L5
	movl	$1, (%rcx)
	movl	e(%rip), %eax
	xorl	%r15d, %r15d
	testl	%eax, %eax
	jle	.L10
.L7:
	cmpl	(%r14,%r15,4), %edx
	je	.L22
	addq	$1, %r15
	cmpl	%r15d, %eax
	jg	.L7
.L10:
	movl	$2, (%rcx)
	movl	e(%rip), %eax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L21:
	movl	$1, a(%rip)
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L22:
	movl	(%r8,%r15,4), %edi
	movq	%rcx, 24(%rsp)
	addq	$1, %r15
	movl	%edx, 20(%rsp)
	movq	%r8, 8(%rsp)
	call	resultSearch
	movl	e(%rip), %eax
	movq	8(%rsp), %r8
	movl	20(%rsp), %edx
	movq	24(%rsp), %rcx
	cmpl	%r15d, %eax
	jg	.L7
	jmp	.L10
	.cfi_endproc
.LFE40:
	.size	resultSearch, .-resultSearch
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	e(%rip), %rdx
	leaq	v(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movq	%rbp, %rdi
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	call	__isoc99_scanf@PLT
	movl	e(%rip), %r12d
	cmpl	$1000, %r12d
	ja	.L24
	movl	v(%rip), %ebx
	leal	-1(%rbx), %eax
	cmpl	$99, %eax
	jbe	.L40
.L24:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L40:
	.cfi_restore_state
	movslq	%r12d, %r13
	salq	$2, %r13
	movq	%r13, %rdi
	call	malloc@PLT
	movq	%r13, %rdi
	movq	%rax, s(%rip)
	call	malloc@PLT
	movslq	%ebx, %rdi
	xorl	%ebx, %ebx
	salq	$2, %rdi
	movq	%rax, t(%rip)
	call	malloc@PLT
	movq	%rax, visited(%rip)
	testl	%r12d, %r12d
	je	.L27
	.p2align 4,,10
	.p2align 3
.L25:
	movq	t(%rip), %rdx
	leaq	0(,%rbx,4), %rsi
	xorl	%eax, %eax
	movq	%rbp, %rdi
	addq	$1, %rbx
	addq	%rsi, %rdx
	addq	s(%rip), %rsi
	call	__isoc99_scanf@PLT
	cmpl	%ebx, e(%rip)
	jg	.L25
	cmpl	$0, v(%rip)
	jle	.L41
.L27:
	movq	visited(%rip), %r10
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L26:
	movl	$0, (%r10,%rax,4)
	movl	v(%rip), %ecx
	addq	$1, %rax
	cmpl	%eax, %ecx
	jg	.L26
	movl	a(%rip), %edx
	testl	%ecx, %ecx
	jle	.L28
	xorl	%r9d, %r9d
	.p2align 4,,10
	.p2align 3
.L31:
	movl	%r9d, %edi
	cmpl	$1, %edx
	je	.L28
	movl	%edx, %eax
	orl	(%r10,%r9,4), %eax
	je	.L42
	addq	$1, %r9
	cmpl	%r9d, v(%rip)
	jg	.L31
.L28:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	s(%rip), %rdi
	call	free@PLT
	movq	t(%rip), %rdi
	call	free@PLT
	movq	visited(%rip), %rdi
	call	free@PLT
	jmp	.L24
.L42:
	call	resultSearch
	addq	$1, %r9
	cmpl	%r9d, v(%rip)
	movl	a(%rip), %edx
	jg	.L31
	jmp	.L28
.L41:
	movl	a(%rip), %edx
	jmp	.L28
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.globl	t
	.bss
	.align 8
	.type	t, @object
	.size	t, 8
t:
	.zero	8
	.globl	s
	.align 8
	.type	s, @object
	.size	s, 8
s:
	.zero	8
	.globl	visited
	.align 8
	.type	visited, @object
	.size	visited, 8
visited:
	.zero	8
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	e
	.align 4
	.type	e, @object
	.size	e, 4
e:
	.zero	4
	.globl	v
	.align 4
	.type	v, @object
	.size	v, 4
v:
	.zero	4
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>
#include <stdlib.h>

#define MAXV 100
#define MAXE 1000

int v, e;
int a = 0;
int *visited;
int *s, *t;

void resultSearch(int);

int main(){

        int i;

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

        if(e < 0 || MAXE < e || v < 1 || MAXV < v)return 0;

        s = (int*)malloc(e*sizeof(int));
        t = (int*)malloc(e*sizeof(int));


        visited = (int*)malloc(v*sizeof(int));

        for(i = 0;i < e;i ++)
                {
                        scanf("%d %d", &s[i], &t[i]);
                }

        for(i = 0;i < v;i ++)
                {
                        visited[i] = 0;
                }

        for(i = 0;i < v;i ++)
                {
                        if(a == 1)
                                {
                                        break;
                                }else if(visited[i]  == 0 && a == 0)
                                {
                                        resultSearch(i);
                                }
                }

        printf("%d\n", a);

        free(s);
        free(t);
        free(visited);

        return 0;
}

void resultSearch(int v){
        int i;

        if(visited[v] == 1){
                a = 1;
        }else if(visited[v] == 0){
                visited[v] = 1;

                for(i = 0; i < e; i ++)
                {
                        if(s[i] == v)resultSearch(t[i]);
                }
                visited[v] = 2;
        }
}

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

0
 0
 0
 0
 0
 0
 0
 0
 0
 0

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

```c
#include <stdio.h>
#include <stdlib.h>

#define MAXV 100
#define MAXE 1000

int v, e;
int a = 0;
int *visited;
int *s, *t;

void resultSearch(int);

int main(){

        int i;

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

        if(e < 0 || MAXE < e || v < 1 || MAXV < v)return 0;

        s = (int*)malloc(e*sizeof(int));
        t = (int*)malloc(e*sizeof(int));


        visited = (int*)malloc(v*sizeof(int));

        for(i = 0;i < e;i ++)
                {
                        scanf("%d %d", &s[i], &t[i]);
                }

        for(i = 0;i < v;i ++)
                {
                        visited[i] = 0;
                }

        for(i = 0;i < v;i ++)
                {
                        if(a == 1)
                                {
                                        break;
                                }else if(visited[i]  == 0 && a == 0)
                                {
                                        resultSearch(i);
                                }
                }

        printf("%d\n", a);

        free(s);
        free(t);
        free(visited);

        return 0;
}

void resultSearch(int v){
        int i;

        if(visited[v] == 1){
                a = 1;
        }else if(visited[v] == 0){
                visited[v] = 1;

                for(i = 0; i < e; i ++)
                {
                        if(s[i] == v)resultSearch(t[i]);
                }
                visited[v] = 2;
        }
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	v
	.bss
	.align 4
	.type	v, @object
	.size	v, 4
v:
	.zero	4
	.globl	e
	.align 4
	.type	e, @object
	.size	e, 4
e:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	visited
	.align 8
	.type	visited, @object
	.size	visited, 8
visited:
	.zero	8
	.globl	s
	.align 8
	.type	s, @object
	.size	s, 8
s:
	.zero	8
	.globl	t
	.align 8
	.type	t, @object
	.size	t, 8
t:
	.zero	8
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d\n"
	.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	$16, %rsp
	leaq	e(%rip), %rax
	movq	%rax, %rdx
	leaq	v(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	e(%rip), %eax
	testl	%eax, %eax
	js	.L2
	movl	e(%rip), %eax
	cmpl	$1000, %eax
	jg	.L2
	movl	v(%rip), %eax
	testl	%eax, %eax
	jle	.L2
	movl	v(%rip), %eax
	cmpl	$100, %eax
	jle	.L3
.L2:
	movl	$0, %eax
	jmp	.L4
.L3:
	movl	e(%rip), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, s(%rip)
	movl	e(%rip), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, t(%rip)
	movl	v(%rip), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, visited(%rip)
	movl	$0, -4(%rbp)
	jmp	.L5
.L6:
	movq	t(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	movq	s(%rip), %rcx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4(%rbp)
.L5:
	movl	e(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L6
	movl	$0, -4(%rbp)
	jmp	.L7
.L8:
	movq	visited(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	$0, (%rax)
	addl	$1, -4(%rbp)
.L7:
	movl	v(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L8
	movl	$0, -4(%rbp)
	jmp	.L9
.L13:
	movl	a(%rip), %eax
	cmpl	$1, %eax
	je	.L14
	movq	visited(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L12
	movl	a(%rip), %eax
	testl	%eax, %eax
	jne	.L12
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	resultSearch
.L12:
	addl	$1, -4(%rbp)
.L9:
	movl	v(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L13
	jmp	.L11
.L14:
	nop
.L11:
	movl	a(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	s(%rip), %rax
	movq	%rax, %rdi
	call	free@PLT
	movq	t(%rip), %rax
	movq	%rax, %rdi
	call	free@PLT
	movq	visited(%rip), %rax
	movq	%rax, %rdi
	call	free@PLT
	movl	$0, %eax
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	resultSearch
	.type	resultSearch, @function
resultSearch:
.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	visited(%rip), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	$1, %eax
	jne	.L16
	movl	$1, a(%rip)
	jmp	.L21
.L16:
	movq	visited(%rip), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L21
	movq	visited(%rip), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	$1, (%rax)
	movl	$0, -4(%rbp)
	jmp	.L18
.L20:
	movq	s(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -20(%rbp)
	jne	.L19
	movq	t(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, %edi
	call	resultSearch
.L19:
	addl	$1, -4(%rbp)
.L18:
	movl	e(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L20
	movq	visited(%rip), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	$2, (%rax)
.L21:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	resultSearch, .-resultSearch
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	v
	.bss
	.align 4
	.type	v, @object
	.size	v, 4
v:
	.zero	4
	.globl	e
	.align 4
	.type	e, @object
	.size	e, 4
e:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	visited
	.align 8
	.type	visited, @object
	.size	visited, 8
visited:
	.zero	8
	.globl	s
	.align 8
	.type	s, @object
	.size	s, 8
s:
	.zero	8
	.globl	t
	.align 8
	.type	t, @object
	.size	t, 8
t:
	.zero	8
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d\n"
	.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	$16, %rsp
	leaq	e(%rip), %rax
	movq	%rax, %rdx
	leaq	v(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	e(%rip), %eax
	testl	%eax, %eax
	js	.L2
	movl	e(%rip), %eax
	cmpl	$1000, %eax
	jg	.L2
	movl	v(%rip), %eax
	testl	%eax, %eax
	jle	.L2
	movl	v(%rip), %eax
	cmpl	$100, %eax
	jle	.L3
.L2:
	movl	$0, %eax
	jmp	.L4
.L3:
	movl	e(%rip), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, s(%rip)
	movl	e(%rip), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, t(%rip)
	movl	v(%rip), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, visited(%rip)
	movl	$0, -4(%rbp)
	jmp	.L5
.L6:
	movq	t(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	movq	s(%rip), %rcx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4(%rbp)
.L5:
	movl	e(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L6
	movl	$0, -4(%rbp)
	jmp	.L7
.L8:
	movq	visited(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	$0, (%rax)
	addl	$1, -4(%rbp)
.L7:
	movl	v(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L8
	movl	$0, -4(%rbp)
	jmp	.L9
.L13:
	movl	a(%rip), %eax
	cmpl	$1, %eax
	je	.L14
	movq	visited(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L12
	movl	a(%rip), %eax
	testl	%eax, %eax
	jne	.L12
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	resultSearch
.L12:
	addl	$1, -4(%rbp)
.L9:
	movl	v(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L13
	jmp	.L11
.L14:
	nop
.L11:
	movl	a(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	s(%rip), %rax
	movq	%rax, %rdi
	call	free@PLT
	movq	t(%rip), %rax
	movq	%rax, %rdi
	call	free@PLT
	movq	visited(%rip), %rax
	movq	%rax, %rdi
	call	free@PLT
	movl	$0, %eax
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	resultSearch
	.type	resultSearch, @function
resultSearch:
.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	visited(%rip), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	$1, %eax
	jne	.L16
	movl	$1, a(%rip)
	jmp	.L21
.L16:
	movq	visited(%rip), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L21
	movq	visited(%rip), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	$1, (%rax)
	movl	$0, -4(%rbp)
	jmp	.L18
.L20:
	movq	s(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -20(%rbp)
	jne	.L19
	movq	t(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, %edi
	call	resultSearch
.L19:
	addl	$1, -4(%rbp)
.L18:
	movl	e(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L20
	movq	visited(%rip), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	$2, (%rax)
.L21:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	resultSearch, .-resultSearch
	.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:
