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 FOR(i,a,n) for(i=(a);i<(n);i++)
#define swap(type,a,b) do{type t=a;a=b;b=t;}while(0);
#define MAX(a,b) (((a)>(b))?(a):(b))
#define INF 1000000000000000LL
#define ll long long
#define MAX_V 100000
#define MAX_E 200000
typedef struct LIST{
	int to;
	struct LIST *next;
}Edge;
Edge *g[MAX_V];
Edge edge[MAX_E];
int e_size=0;
void add_edge(int s,int t){
	edge[e_size].next=g[s]; g[s]=&edge[e_size++];
	g[s]->to=t;
	return;
}
int color[MAX_V];
int dfs(int v,int c){
	Edge *e;
	color[v]=c;
	for(e=g[v];e!=NULL;e=e->next){
		if(color[e->to]==-c) continue;
		if(color[e->to]==color[v]||!dfs(e->to,-c)) return 0;
	}
	return 1;
}
int main(void)
{
	int n,m,a,b,cnt=0,flag,i;
	scanf("%d%d",&n,&m);
	FOR(i,0,m){
		scanf("%d%d",&a,&b);
		add_edge(--a,--b);
		add_edge(b,a);
	}
	flag=dfs(0,1);
	FOR(i,0,n) cnt+=(color[i]==1);
	if(!flag) printf("%lld\n",(ll)n*(n-1)/2-m);
	else printf("%lld\n",(ll)cnt*(n-cnt)-m);
	return 0;
}
    ```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	g
	.bss
	.align 32
	.type	g, @object
	.size	g, 800000
g:
	.zero	800000
	.globl	edge
	.align 32
	.type	edge, @object
	.size	edge, 3200000
edge:
	.zero	3200000
	.globl	e_size
	.align 4
	.type	e_size, @object
	.size	e_size, 4
e_size:
	.zero	4
	.text
	.globl	add_edge
	.type	add_edge, @function
add_edge:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	e_size(%rip), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	g(%rip), %rax
	movq	(%rcx,%rax), %rax
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	8+edge(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	e_size(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, e_size(%rip)
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	edge(%rip), %rax
	leaq	(%rdx,%rax), %rcx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	g(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	g(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	-8(%rbp), %edx
	movl	%edx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	add_edge, .-add_edge
	.globl	color
	.bss
	.align 32
	.type	color, @object
	.size	color, 400000
color:
	.zero	400000
	.text
	.globl	dfs
	.type	dfs, @function
dfs:
.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)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	color(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	g(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -8(%rbp)
	jmp	.L4
.L9:
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	negl	%edx
	cmpl	%edx, %eax
	je	.L10
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	color(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	je	.L7
	movl	-24(%rbp), %eax
	negl	%eax
	movl	%eax, %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dfs
	testl	%eax, %eax
	jne	.L6
.L7:
	movl	$0, %eax
	jmp	.L8
.L10:
	nop
.L6:
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -8(%rbp)
.L4:
	cmpq	$0, -8(%rbp)
	jne	.L9
	movl	$1, %eax
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	dfs, .-dfs
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.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	$0, -20(%rbp)
	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	$0, -16(%rbp)
	jmp	.L12
.L13:
	leaq	-24(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -24(%rbp)
	movl	-24(%rbp), %edx
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -28(%rbp)
	movl	-28(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	add_edge
	movl	-28(%rbp), %edx
	movl	-24(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	add_edge
	addl	$1, -16(%rbp)
.L12:
	movl	-32(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L13
	movl	$1, %esi
	movl	$0, %edi
	call	dfs
	movl	%eax, -12(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L14
.L15:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	sete	%al
	movzbl	%al, %eax
	addl	%eax, -20(%rbp)
	addl	$1, -16(%rbp)
.L14:
	movl	-36(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L15
	cmpl	$0, -12(%rbp)
	jne	.L16
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	subl	$1, %eax
	cltq
	imulq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, %rcx
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L17
.L16:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	subl	-20(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	subq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L17:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	add_edge
	.type	add_edge, @function
add_edge:
.LFB39:
	.cfi_startproc
	endbr64
	movslq	e_size(%rip), %rcx
	leaq	edge(%rip), %rax
	movslq	%edi, %rdi
	movq	%rcx, %rdx
	salq	$4, %rcx
	addq	%rcx, %rax
	leaq	g(%rip), %rcx
	addl	$1, %edx
	movq	(%rcx,%rdi,8), %r8
	movl	%edx, e_size(%rip)
	movq	%rax, (%rcx,%rdi,8)
	movq	%r8, 8(%rax)
	movl	%esi, (%rax)
	ret
	.cfi_endproc
.LFE39:
	.size	add_edge, .-add_edge
	.p2align 4
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edi, %rax
	leaq	color(%rip), %rcx
	leaq	g(%rip), %rdx
	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
	subq	$120, %rsp
	.cfi_def_cfa_offset 176
	movl	%esi, (%rcx,%rax,4)
	movq	%rax, 56(%rsp)
	movq	(%rdx,%rax,8), %rax
	movq	%rax, (%rsp)
	testq	%rax, %rax
	je	.L34
	movl	%esi, %r11d
	negl	%esi
	movl	%r11d, %r8d
.L6:
	movq	(%rsp), %rax
	movslq	(%rax), %rax
	movq	%rax, 24(%rsp)
	movl	(%rcx,%rax,4), %eax
	cmpl	%esi, %eax
	je	.L8
	movq	56(%rsp), %rdi
	cmpl	(%rcx,%rdi,4), %eax
	je	.L11
	movq	24(%rsp), %rax
	movl	%esi, (%rcx,%rax,4)
	movq	(%rdx,%rax,8), %rax
	movq	%rax, 8(%rsp)
	testq	%rax, %rax
	je	.L8
	movl	%r8d, %r11d
.L10:
	movq	8(%rsp), %rax
	movslq	(%rax), %rax
	movq	%rax, 32(%rsp)
	movl	(%rcx,%rax,4), %eax
	cmpl	%eax, %r11d
	je	.L12
	movq	24(%rsp), %rdi
	cmpl	(%rcx,%rdi,4), %eax
	je	.L11
	movq	32(%rsp), %rax
	movl	%r11d, (%rcx,%rax,4)
	movq	(%rdx,%rax,8), %rax
	movq	%rax, 16(%rsp)
	testq	%rax, %rax
	je	.L12
	movl	%r11d, %r10d
.L14:
	movq	16(%rsp), %rax
	movslq	(%rax), %rax
	movq	%rax, 40(%rsp)
	movl	(%rcx,%rax,4), %eax
	cmpl	%esi, %eax
	je	.L15
	movq	32(%rsp), %rdi
	cmpl	(%rcx,%rdi,4), %eax
	je	.L11
	movq	40(%rsp), %rax
	movq	(%rdx,%rax,8), %r11
	movl	%esi, (%rcx,%rax,4)
	testq	%r11, %r11
	je	.L15
	movl	%r10d, %r13d
.L17:
	movslq	(%r11), %rax
	movq	%rax, 48(%rsp)
	movl	(%rcx,%rax,4), %eax
	cmpl	%eax, %r13d
	je	.L18
	movq	40(%rsp), %rdi
	cmpl	(%rcx,%rdi,4), %eax
	je	.L11
	movq	48(%rsp), %rax
	movq	(%rdx,%rax,8), %r10
	movl	%r13d, (%rcx,%rax,4)
	testq	%r10, %r10
	je	.L18
	movq	%r11, 64(%rsp)
	movl	%r13d, %r11d
.L20:
	movslq	(%r10), %r15
	movl	(%rcx,%r15,4), %eax
	cmpl	%esi, %eax
	je	.L21
	movq	48(%rsp), %rdi
	cmpl	(%rcx,%rdi,4), %eax
	je	.L11
	movq	(%rdx,%r15,8), %r14
	movl	%esi, (%rcx,%r15,4)
	testq	%r14, %r14
	je	.L21
	movq	%r14, %r8
	movq	%r15, %r9
	.p2align 4,,10
	.p2align 3
.L23:
	movslq	(%r8), %r13
	movl	(%rcx,%r13,4), %eax
	cmpl	%eax, %r11d
	je	.L24
	cmpl	(%rcx,%r9,4), %eax
	je	.L11
	movq	(%rdx,%r13,8), %rbx
	movl	%r11d, (%rcx,%r13,4)
	testq	%rbx, %rbx
	je	.L24
	movq	%r13, %rax
	movl	%r11d, %r13d
	movq	%rax, %r11
	.p2align 4,,10
	.p2align 3
.L26:
	movslq	(%rbx), %rbp
	movl	(%rcx,%rbp,4), %eax
	cmpl	%esi, %eax
	je	.L27
	cmpl	(%rcx,%r11,4), %eax
	je	.L11
	movq	(%rdx,%rbp,8), %r14
	movl	%esi, (%rcx,%rbp,4)
	testq	%r14, %r14
	je	.L27
	.p2align 4,,10
	.p2align 3
.L29:
	movslq	(%r14), %r15
	movl	(%rcx,%r15,4), %eax
	cmpl	%eax, %r13d
	je	.L30
	cmpl	(%rcx,%rbp,4), %eax
	je	.L11
	movq	(%rdx,%r15,8), %r12
	movl	%r13d, (%rcx,%r15,4)
	testq	%r12, %r12
	je	.L30
	.p2align 4,,10
	.p2align 3
.L32:
	movslq	(%r12), %rax
	movq	%rax, %rdi
	movl	(%rcx,%rax,4), %eax
	cmpl	%esi, %eax
	je	.L33
	movq	%r11, 104(%rsp)
	movq	%r9, 96(%rsp)
	movq	%r8, 88(%rsp)
	movq	%r10, 80(%rsp)
	cmpl	(%rcx,%r15,4), %eax
	je	.L11
	movl	%esi, 76(%rsp)
	call	dfs
	movl	76(%rsp), %esi
	movq	80(%rsp), %r10
	leaq	color(%rip), %rcx
	testl	%eax, %eax
	movq	88(%rsp), %r8
	movq	96(%rsp), %r9
	leaq	g(%rip), %rdx
	movq	104(%rsp), %r11
	je	.L11
	.p2align 4,,10
	.p2align 3
.L33:
	movq	8(%r12), %r12
	testq	%r12, %r12
	jne	.L32
.L30:
	movq	8(%r14), %r14
	testq	%r14, %r14
	jne	.L29
.L27:
	movq	8(%rbx), %rbx
	testq	%rbx, %rbx
	jne	.L26
	movl	%r13d, %r11d
.L24:
	movq	8(%r8), %r8
	testq	%r8, %r8
	jne	.L23
.L21:
	movq	8(%r10), %r10
	testq	%r10, %r10
	jne	.L20
	movl	%r11d, %r13d
	movq	64(%rsp), %r11
.L18:
	movq	8(%r11), %r11
	testq	%r11, %r11
	jne	.L17
	movl	%r13d, %r10d
.L15:
	movq	16(%rsp), %rax
	movq	8(%rax), %rax
	movq	%rax, 16(%rsp)
	testq	%rax, %rax
	jne	.L14
	movl	%r10d, %r11d
.L12:
	movq	8(%rsp), %rax
	movq	8(%rax), %rax
	movq	%rax, 8(%rsp)
	testq	%rax, %rax
	jne	.L10
	movl	%r11d, %r8d
.L8:
	movq	(%rsp), %rax
	movq	8(%rax), %rax
	movq	%rax, (%rsp)
	testq	%rax, %rax
	jne	.L6
.L34:
	addq	$120, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	$1, %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
.L11:
	.cfi_restore_state
	addq	$120, %rsp
	.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
	.cfi_endproc
.LFE40:
	.size	dfs, .-dfs
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB41:
	.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	.LC0(%rip), %rbx
	movq	%rbx, %rdi
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L76
	xorl	%r15d, %r15d
	leaq	20(%rsp), %r12
	leaq	16(%rsp), %rbp
	leaq	edge(%rip), %r14
	leaq	g(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L73:
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %eax
	movslq	e_size(%rip), %rdi
	addl	$1, %r15d
	leal	-1(%rax), %edx
	movl	16(%rsp), %eax
	movq	%rdi, %rsi
	salq	$4, %rdi
	leaq	(%r14,%rdi), %r8
	movl	%edx, 20(%rsp)
	leal	-1(%rax), %ecx
	movl	%edx, (%r8)
	movslq	%edx, %rdx
	movslq	%ecx, %r9
	movl	%ecx, 16(%rsp)
	movq	0(%r13,%r9,8), %rax
	movq	%r8, 0(%r13,%r9,8)
	movq	%rax, 8(%r8)
	leal	1(%rsi), %eax
	movq	0(%r13,%rdx,8), %r8
	addl	$2, %esi
	cltq
	movl	%esi, e_size(%rip)
	leaq	16(%r14,%rdi), %rsi
	salq	$4, %rax
	movq	%rsi, 0(%r13,%rdx,8)
	addq	%r14, %rax
	movq	%r8, 8(%rax)
	movl	%ecx, (%rax)
	cmpl	%r15d, 12(%rsp)
	jg	.L73
.L76:
	movl	$1, %esi
	xorl	%edi, %edi
	call	dfs
	movl	8(%rsp), %esi
	xorl	%ecx, %ecx
	movl	%eax, %r8d
	testl	%esi, %esi
	jle	.L75
	leal	-1(%rsi), %eax
	cmpl	$2, %eax
	jbe	.L85
	movl	%esi, %eax
	leaq	color(%rip), %rdi
	movdqa	.LC1(%rip), %xmm2
	pxor	%xmm0, %xmm0
	shrl	$2, %eax
	leaq	16(%rdi), %rcx
	movq	%rdi, %rdx
	subl	$1, %eax
	salq	$4, %rax
	addq	%rcx, %rax
	.p2align 4,,10
	.p2align 3
.L78:
	movdqa	%xmm2, %xmm1
	addq	$16, %rdx
	pcmpeqd	-16(%rdx), %xmm1
	psubd	%xmm1, %xmm0
	cmpq	%rdx, %rax
	jne	.L78
	movdqa	%xmm0, %xmm1
	movl	%esi, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %ecx
	testb	$3, %sil
	je	.L75
.L77:
	movslq	%eax, %rdx
	cmpl	$1, (%rdi,%rdx,4)
	sete	%dl
	movzbl	%dl, %edx
	addl	%edx, %ecx
	leal	1(%rax), %edx
	cmpl	%esi, %edx
	jge	.L75
	movslq	%edx, %rdx
	cmpl	$1, (%rdi,%rdx,4)
	sete	%dl
	addl	$2, %eax
	movzbl	%dl, %edx
	addl	%edx, %ecx
	cmpl	%eax, %esi
	jle	.L75
	cltq
	cmpl	$1, (%rdi,%rax,4)
	sete	%al
	movzbl	%al, %eax
	addl	%eax, %ecx
.L75:
	movslq	12(%rsp), %rdi
	testl	%r8d, %r8d
	jne	.L81
	leal	-1(%rsi), %eax
	movslq	%esi, %rdx
	movl	$2, %ecx
	cltq
	leaq	.LC2(%rip), %rsi
	imulq	%rdx, %rax
	cqto
	idivq	%rcx
	subq	%rdi, %rax
	movl	$1, %edi
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L82:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L89
	addq	$40, %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
.L81:
	.cfi_restore_state
	subl	%ecx, %esi
	movslq	%ecx, %rcx
	xorl	%eax, %eax
	movslq	%esi, %rdx
	leaq	.LC2(%rip), %rsi
	imulq	%rcx, %rdx
	subq	%rdi, %rdx
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L82
.L85:
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	leaq	color(%rip), %rdi
	jmp	.L77
.L89:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE41:
	.size	main, .-main
	.globl	color
	.bss
	.align 32
	.type	color, @object
	.size	color, 400000
color:
	.zero	400000
	.globl	e_size
	.align 4
	.type	e_size, @object
	.size	e_size, 4
e_size:
	.zero	4
	.globl	edge
	.align 32
	.type	edge, @object
	.size	edge, 3200000
edge:
	.zero	3200000
	.globl	g
	.align 32
	.type	g, @object
	.size	g, 800000
g:
	.zero	800000
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	1
	.long	1
	.long	1
	.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	add_edge
	.type	add_edge, @function
add_edge:
.LFB39:
	.cfi_startproc
	endbr64
	movslq	e_size(%rip), %rcx
	leaq	edge(%rip), %rax
	movslq	%edi, %rdi
	movq	%rcx, %rdx
	salq	$4, %rcx
	addq	%rcx, %rax
	leaq	g(%rip), %rcx
	addl	$1, %edx
	movq	(%rcx,%rdi,8), %r8
	movl	%edx, e_size(%rip)
	movq	%rax, (%rcx,%rdi,8)
	movq	%r8, 8(%rax)
	movl	%esi, (%rax)
	ret
	.cfi_endproc
.LFE39:
	.size	add_edge, .-add_edge
	.p2align 4
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edi, %rax
	leaq	color(%rip), %rcx
	leaq	g(%rip), %rdx
	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
	subq	$120, %rsp
	.cfi_def_cfa_offset 176
	movl	%esi, (%rcx,%rax,4)
	movq	%rax, 56(%rsp)
	movq	(%rdx,%rax,8), %rax
	movq	%rax, (%rsp)
	testq	%rax, %rax
	je	.L34
	movl	%esi, %r11d
	negl	%esi
	movl	%r11d, %r8d
.L6:
	movq	(%rsp), %rax
	movslq	(%rax), %rax
	movq	%rax, 24(%rsp)
	movl	(%rcx,%rax,4), %eax
	cmpl	%esi, %eax
	je	.L8
	movq	56(%rsp), %rdi
	cmpl	(%rcx,%rdi,4), %eax
	je	.L11
	movq	24(%rsp), %rax
	movl	%esi, (%rcx,%rax,4)
	movq	(%rdx,%rax,8), %rax
	movq	%rax, 8(%rsp)
	testq	%rax, %rax
	je	.L8
	movl	%r8d, %r11d
.L10:
	movq	8(%rsp), %rax
	movslq	(%rax), %rax
	movq	%rax, 32(%rsp)
	movl	(%rcx,%rax,4), %eax
	cmpl	%eax, %r11d
	je	.L12
	movq	24(%rsp), %rdi
	cmpl	(%rcx,%rdi,4), %eax
	je	.L11
	movq	32(%rsp), %rax
	movl	%r11d, (%rcx,%rax,4)
	movq	(%rdx,%rax,8), %rax
	movq	%rax, 16(%rsp)
	testq	%rax, %rax
	je	.L12
	movl	%r11d, %r10d
.L14:
	movq	16(%rsp), %rax
	movslq	(%rax), %rax
	movq	%rax, 40(%rsp)
	movl	(%rcx,%rax,4), %eax
	cmpl	%esi, %eax
	je	.L15
	movq	32(%rsp), %rdi
	cmpl	(%rcx,%rdi,4), %eax
	je	.L11
	movq	40(%rsp), %rax
	movq	(%rdx,%rax,8), %r11
	movl	%esi, (%rcx,%rax,4)
	testq	%r11, %r11
	je	.L15
	movl	%r10d, %r13d
.L17:
	movslq	(%r11), %rax
	movq	%rax, 48(%rsp)
	movl	(%rcx,%rax,4), %eax
	cmpl	%eax, %r13d
	je	.L18
	movq	40(%rsp), %rdi
	cmpl	(%rcx,%rdi,4), %eax
	je	.L11
	movq	48(%rsp), %rax
	movq	(%rdx,%rax,8), %r10
	movl	%r13d, (%rcx,%rax,4)
	testq	%r10, %r10
	je	.L18
	movq	%r11, 64(%rsp)
	movl	%r13d, %r11d
.L20:
	movslq	(%r10), %r15
	movl	(%rcx,%r15,4), %eax
	cmpl	%esi, %eax
	je	.L21
	movq	48(%rsp), %rdi
	cmpl	(%rcx,%rdi,4), %eax
	je	.L11
	movq	(%rdx,%r15,8), %r14
	movl	%esi, (%rcx,%r15,4)
	testq	%r14, %r14
	je	.L21
	movq	%r14, %r8
	movq	%r15, %r9
	.p2align 4,,10
	.p2align 3
.L23:
	movslq	(%r8), %r13
	movl	(%rcx,%r13,4), %eax
	cmpl	%eax, %r11d
	je	.L24
	cmpl	(%rcx,%r9,4), %eax
	je	.L11
	movq	(%rdx,%r13,8), %rbx
	movl	%r11d, (%rcx,%r13,4)
	testq	%rbx, %rbx
	je	.L24
	movq	%r13, %rax
	movl	%r11d, %r13d
	movq	%rax, %r11
	.p2align 4,,10
	.p2align 3
.L26:
	movslq	(%rbx), %rbp
	movl	(%rcx,%rbp,4), %eax
	cmpl	%esi, %eax
	je	.L27
	cmpl	(%rcx,%r11,4), %eax
	je	.L11
	movq	(%rdx,%rbp,8), %r14
	movl	%esi, (%rcx,%rbp,4)
	testq	%r14, %r14
	je	.L27
	.p2align 4,,10
	.p2align 3
.L29:
	movslq	(%r14), %r15
	movl	(%rcx,%r15,4), %eax
	cmpl	%eax, %r13d
	je	.L30
	cmpl	(%rcx,%rbp,4), %eax
	je	.L11
	movq	(%rdx,%r15,8), %r12
	movl	%r13d, (%rcx,%r15,4)
	testq	%r12, %r12
	je	.L30
	.p2align 4,,10
	.p2align 3
.L32:
	movslq	(%r12), %rax
	movq	%rax, %rdi
	movl	(%rcx,%rax,4), %eax
	cmpl	%esi, %eax
	je	.L33
	movq	%r11, 104(%rsp)
	movq	%r9, 96(%rsp)
	movq	%r8, 88(%rsp)
	movq	%r10, 80(%rsp)
	cmpl	(%rcx,%r15,4), %eax
	je	.L11
	movl	%esi, 76(%rsp)
	call	dfs
	movl	76(%rsp), %esi
	movq	80(%rsp), %r10
	leaq	color(%rip), %rcx
	testl	%eax, %eax
	movq	88(%rsp), %r8
	movq	96(%rsp), %r9
	leaq	g(%rip), %rdx
	movq	104(%rsp), %r11
	je	.L11
	.p2align 4,,10
	.p2align 3
.L33:
	movq	8(%r12), %r12
	testq	%r12, %r12
	jne	.L32
.L30:
	movq	8(%r14), %r14
	testq	%r14, %r14
	jne	.L29
.L27:
	movq	8(%rbx), %rbx
	testq	%rbx, %rbx
	jne	.L26
	movl	%r13d, %r11d
.L24:
	movq	8(%r8), %r8
	testq	%r8, %r8
	jne	.L23
.L21:
	movq	8(%r10), %r10
	testq	%r10, %r10
	jne	.L20
	movl	%r11d, %r13d
	movq	64(%rsp), %r11
.L18:
	movq	8(%r11), %r11
	testq	%r11, %r11
	jne	.L17
	movl	%r13d, %r10d
.L15:
	movq	16(%rsp), %rax
	movq	8(%rax), %rax
	movq	%rax, 16(%rsp)
	testq	%rax, %rax
	jne	.L14
	movl	%r10d, %r11d
.L12:
	movq	8(%rsp), %rax
	movq	8(%rax), %rax
	movq	%rax, 8(%rsp)
	testq	%rax, %rax
	jne	.L10
	movl	%r11d, %r8d
.L8:
	movq	(%rsp), %rax
	movq	8(%rax), %rax
	movq	%rax, (%rsp)
	testq	%rax, %rax
	jne	.L6
.L34:
	addq	$120, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	$1, %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
.L11:
	.cfi_restore_state
	addq	$120, %rsp
	.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
	.cfi_endproc
.LFE40:
	.size	dfs, .-dfs
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB41:
	.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	.LC0(%rip), %rbx
	movq	%rbx, %rdi
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L76
	xorl	%r15d, %r15d
	leaq	20(%rsp), %r12
	leaq	16(%rsp), %rbp
	leaq	edge(%rip), %r14
	leaq	g(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L73:
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %eax
	movslq	e_size(%rip), %rdi
	addl	$1, %r15d
	leal	-1(%rax), %edx
	movl	16(%rsp), %eax
	movq	%rdi, %rsi
	salq	$4, %rdi
	leaq	(%r14,%rdi), %r8
	movl	%edx, 20(%rsp)
	leal	-1(%rax), %ecx
	movl	%edx, (%r8)
	movslq	%edx, %rdx
	movslq	%ecx, %r9
	movl	%ecx, 16(%rsp)
	movq	0(%r13,%r9,8), %rax
	movq	%r8, 0(%r13,%r9,8)
	movq	%rax, 8(%r8)
	leal	1(%rsi), %eax
	movq	0(%r13,%rdx,8), %r8
	addl	$2, %esi
	cltq
	movl	%esi, e_size(%rip)
	leaq	16(%r14,%rdi), %rsi
	salq	$4, %rax
	movq	%rsi, 0(%r13,%rdx,8)
	addq	%r14, %rax
	movq	%r8, 8(%rax)
	movl	%ecx, (%rax)
	cmpl	%r15d, 12(%rsp)
	jg	.L73
.L76:
	movl	$1, %esi
	xorl	%edi, %edi
	call	dfs
	movl	8(%rsp), %esi
	xorl	%ecx, %ecx
	movl	%eax, %r8d
	testl	%esi, %esi
	jle	.L75
	leal	-1(%rsi), %eax
	cmpl	$2, %eax
	jbe	.L85
	movl	%esi, %eax
	leaq	color(%rip), %rdi
	movdqa	.LC1(%rip), %xmm2
	pxor	%xmm0, %xmm0
	shrl	$2, %eax
	leaq	16(%rdi), %rcx
	movq	%rdi, %rdx
	subl	$1, %eax
	salq	$4, %rax
	addq	%rcx, %rax
	.p2align 4,,10
	.p2align 3
.L78:
	movdqa	%xmm2, %xmm1
	addq	$16, %rdx
	pcmpeqd	-16(%rdx), %xmm1
	psubd	%xmm1, %xmm0
	cmpq	%rdx, %rax
	jne	.L78
	movdqa	%xmm0, %xmm1
	movl	%esi, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %ecx
	testb	$3, %sil
	je	.L75
.L77:
	movslq	%eax, %rdx
	cmpl	$1, (%rdi,%rdx,4)
	sete	%dl
	movzbl	%dl, %edx
	addl	%edx, %ecx
	leal	1(%rax), %edx
	cmpl	%esi, %edx
	jge	.L75
	movslq	%edx, %rdx
	cmpl	$1, (%rdi,%rdx,4)
	sete	%dl
	addl	$2, %eax
	movzbl	%dl, %edx
	addl	%edx, %ecx
	cmpl	%eax, %esi
	jle	.L75
	cltq
	cmpl	$1, (%rdi,%rax,4)
	sete	%al
	movzbl	%al, %eax
	addl	%eax, %ecx
.L75:
	movslq	12(%rsp), %rdi
	testl	%r8d, %r8d
	jne	.L81
	leal	-1(%rsi), %eax
	movslq	%esi, %rdx
	movl	$2, %ecx
	cltq
	leaq	.LC2(%rip), %rsi
	imulq	%rdx, %rax
	cqto
	idivq	%rcx
	subq	%rdi, %rax
	movl	$1, %edi
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L82:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L89
	addq	$40, %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
.L81:
	.cfi_restore_state
	subl	%ecx, %esi
	movslq	%ecx, %rcx
	xorl	%eax, %eax
	movslq	%esi, %rdx
	leaq	.LC2(%rip), %rsi
	imulq	%rcx, %rdx
	subq	%rdi, %rdx
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L82
.L85:
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	leaq	color(%rip), %rdi
	jmp	.L77
.L89:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE41:
	.size	main, .-main
	.globl	color
	.bss
	.align 32
	.type	color, @object
	.size	color, 400000
color:
	.zero	400000
	.globl	e_size
	.align 4
	.type	e_size, @object
	.size	e_size, 4
e_size:
	.zero	4
	.globl	edge
	.align 32
	.type	edge, @object
	.size	edge, 3200000
edge:
	.zero	3200000
	.globl	g
	.align 32
	.type	g, @object
	.size	g, 800000
g:
	.zero	800000
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	1
	.long	1
	.long	1
	.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>
#include <stdlib.h>
#define FOR(i,a,n) for(i=(a);i<(n);i++)
#define swap(type,a,b) do{type t=a;a=b;b=t;}while(0);
#define MAX(a,b) (((a)>(b))?(a):(b))
#define INF 1000000000000000LL
#define ll long long
#define MAX_V 100000
#define MAX_E 200000
typedef struct LIST{
	int to;
	struct LIST *next;
}Edge;
Edge *g[MAX_V];
Edge edge[MAX_E];
int e_size=0;
void add_edge(int s,int t){
	edge[e_size].next=g[s]; g[s]=&edge[e_size++];
	g[s]->to=t;
	return;
}
int color[MAX_V];
int dfs(int v,int c){
	Edge *e;
	color[v]=c;
	for(e=g[v];e!=NULL;e=e->next){
		if(color[e->to]==-c) continue;
		if(color[e->to]==color[v]||!dfs(e->to,-c)) return 0;
	}
	return 1;
}
int main(void)
{
	int n,m,a,b,cnt=0,flag,i;
	scanf("%d%d",&n,&m);
	FOR(i,0,m){
		scanf("%d%d",&a,&b);
		add_edge(--a,--b);
		add_edge(b,a);
	}
	flag=dfs(0,1);
	FOR(i,0,n) cnt+=(color[i]==1);
	if(!flag) printf("%lld\n",(ll)n*(n-1)/2-m);
	else printf("%lld\n",(ll)cnt*(n-cnt)-m);
	return 0;
}
    
6 5
1 2
2 3
3 4
4 5
4 6
 5 5
1 2
2 3
3 1
5 3
5 1
 6 5
1 2
2 2
3 4
4 5
5 6
 5 5
1 2
2 3
3 2
5 4
5 1
 6 5
1 2
2 3
3 4
4 5
3 6
 12 5
1 2
2 3
3 3
0 5
4 6
 9 5
1 2
2 3
3 3
0 5
4 6
 15 5
1 2
2 3
3 3
0 5
4 2
 8 5
1 1
2 3
3 1
5 3
5 1
 14 5
1 2
2 3
3 3
0 4
0 6

3
 5
 10
 1
 4
 61
 31
 100
 23
 86

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 FOR(i,a,n) for(i=(a);i<(n);i++)
#define swap(type,a,b) do{type t=a;a=b;b=t;}while(0);
#define MAX(a,b) (((a)>(b))?(a):(b))
#define INF 1000000000000000LL
#define ll long long
#define MAX_V 100000
#define MAX_E 200000
typedef struct LIST{
	int to;
	struct LIST *next;
}Edge;
Edge *g[MAX_V];
Edge edge[MAX_E];
int e_size=0;
void add_edge(int s,int t){
	edge[e_size].next=g[s]; g[s]=&edge[e_size++];
	g[s]->to=t;
	return;
}
int color[MAX_V];
int dfs(int v,int c){
	Edge *e;
	color[v]=c;
	for(e=g[v];e!=NULL;e=e->next){
		if(color[e->to]==-c) continue;
		if(color[e->to]==color[v]||!dfs(e->to,-c)) return 0;
	}
	return 1;
}
int main(void)
{
	int n,m,a,b,cnt=0,flag,i;
	scanf("%d%d",&n,&m);
	FOR(i,0,m){
		scanf("%d%d",&a,&b);
		add_edge(--a,--b);
		add_edge(b,a);
	}
	flag=dfs(0,1);
	FOR(i,0,n) cnt+=(color[i]==1);
	if(!flag) printf("%lld\n",(ll)n*(n-1)/2-m);
	else printf("%lld\n",(ll)cnt*(n-cnt)-m);
	return 0;
}
    ```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	g
	.bss
	.align 32
	.type	g, @object
	.size	g, 800000
g:
	.zero	800000
	.globl	edge
	.align 32
	.type	edge, @object
	.size	edge, 3200000
edge:
	.zero	3200000
	.globl	e_size
	.align 4
	.type	e_size, @object
	.size	e_size, 4
e_size:
	.zero	4
	.text
	.globl	add_edge
	.type	add_edge, @function
add_edge:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	e_size(%rip), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	g(%rip), %rax
	movq	(%rcx,%rax), %rax
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	8+edge(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	e_size(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, e_size(%rip)
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	edge(%rip), %rax
	leaq	(%rdx,%rax), %rcx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	g(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	g(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	-8(%rbp), %edx
	movl	%edx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	add_edge, .-add_edge
	.globl	color
	.bss
	.align 32
	.type	color, @object
	.size	color, 400000
color:
	.zero	400000
	.text
	.globl	dfs
	.type	dfs, @function
dfs:
.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)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	color(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	g(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -8(%rbp)
	jmp	.L4
.L9:
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	negl	%edx
	cmpl	%edx, %eax
	je	.L10
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	color(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	je	.L7
	movl	-24(%rbp), %eax
	negl	%eax
	movl	%eax, %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dfs
	testl	%eax, %eax
	jne	.L6
.L7:
	movl	$0, %eax
	jmp	.L8
.L10:
	nop
.L6:
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -8(%rbp)
.L4:
	cmpq	$0, -8(%rbp)
	jne	.L9
	movl	$1, %eax
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	dfs, .-dfs
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.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	$0, -20(%rbp)
	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	$0, -16(%rbp)
	jmp	.L12
.L13:
	leaq	-24(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -24(%rbp)
	movl	-24(%rbp), %edx
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -28(%rbp)
	movl	-28(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	add_edge
	movl	-28(%rbp), %edx
	movl	-24(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	add_edge
	addl	$1, -16(%rbp)
.L12:
	movl	-32(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L13
	movl	$1, %esi
	movl	$0, %edi
	call	dfs
	movl	%eax, -12(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L14
.L15:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	sete	%al
	movzbl	%al, %eax
	addl	%eax, -20(%rbp)
	addl	$1, -16(%rbp)
.L14:
	movl	-36(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L15
	cmpl	$0, -12(%rbp)
	jne	.L16
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	subl	$1, %eax
	cltq
	imulq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, %rcx
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L17
.L16:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	subl	-20(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	subq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L17:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	g
	.bss
	.align 32
	.type	g, @object
	.size	g, 800000
g:
	.zero	800000
	.globl	edge
	.align 32
	.type	edge, @object
	.size	edge, 3200000
edge:
	.zero	3200000
	.globl	e_size
	.align 4
	.type	e_size, @object
	.size	e_size, 4
e_size:
	.zero	4
	.text
	.globl	add_edge
	.type	add_edge, @function
add_edge:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	e_size(%rip), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	g(%rip), %rax
	movq	(%rcx,%rax), %rax
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	8+edge(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	e_size(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, e_size(%rip)
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	edge(%rip), %rax
	leaq	(%rdx,%rax), %rcx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	g(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	g(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	-8(%rbp), %edx
	movl	%edx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	add_edge, .-add_edge
	.globl	color
	.bss
	.align 32
	.type	color, @object
	.size	color, 400000
color:
	.zero	400000
	.text
	.globl	dfs
	.type	dfs, @function
dfs:
.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)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	color(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	g(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -8(%rbp)
	jmp	.L4
.L9:
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	negl	%edx
	cmpl	%edx, %eax
	je	.L10
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	color(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	je	.L7
	movl	-24(%rbp), %eax
	negl	%eax
	movl	%eax, %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dfs
	testl	%eax, %eax
	jne	.L6
.L7:
	movl	$0, %eax
	jmp	.L8
.L10:
	nop
.L6:
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -8(%rbp)
.L4:
	cmpq	$0, -8(%rbp)
	jne	.L9
	movl	$1, %eax
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	dfs, .-dfs
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.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	$0, -20(%rbp)
	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	$0, -16(%rbp)
	jmp	.L12
.L13:
	leaq	-24(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -24(%rbp)
	movl	-24(%rbp), %edx
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -28(%rbp)
	movl	-28(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	add_edge
	movl	-28(%rbp), %edx
	movl	-24(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	add_edge
	addl	$1, -16(%rbp)
.L12:
	movl	-32(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L13
	movl	$1, %esi
	movl	$0, %edi
	call	dfs
	movl	%eax, -12(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L14
.L15:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	color(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	sete	%al
	movzbl	%al, %eax
	addl	%eax, -20(%rbp)
	addl	$1, -16(%rbp)
.L14:
	movl	-36(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L15
	cmpl	$0, -12(%rbp)
	jne	.L16
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	subl	$1, %eax
	cltq
	imulq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, %rcx
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L17
.L16:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	subl	-20(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	subq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L17:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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:
