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<memory.h>
int n, g[21][21];
int dijkstra(start, goal){
	int c[21], f[21]={0}, i, nearest, t;
	memset(c, 1, sizeof(c));
	c[start] = 0;
	while(1){
		nearest=0;
		for(i=1;i<=n;i++){
			if(!f[i] && (!nearest || c[i]<c[nearest]))
				nearest=i;
		}
		if(!nearest)
			return c[goal];
		f[nearest]=1;
		for(i=1;i<=n;i++){
			t=c[nearest]+g[nearest][i];
			if(t<c[i])
				c[i]=t;
		}
	}
}
int main(){
	int m, x1, x2, y1, y2;
	int i, c12, c21;
	memset(g, 1, sizeof(g));
	scanf("%d%d",&n,&m);
	for(i = 0; i < m; i ++){
		int a,b,c,d;
		scanf("%d,%d,%d,%d",&a,&b,&c,&d);
		g[a][b] = c;
		g[b][a] = d;
	}
	scanf("%d,%d,%d,%d",&x1,&x2,&y1,&y2);
	c12 = dijkstra(x1, x2);
	c21 = dijkstra(x2, x1);
	printf("%d\n", y1-y2-c12-c21);
	exit(0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	g
	.align 32
	.type	g, @object
	.size	g, 1764
g:
	.zero	1764
	.text
	.globl	dijkstra
	.type	dijkstra, @function
dijkstra:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$224, %rsp
	movl	%edi, -212(%rbp)
	movl	%esi, -216(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-96(%rbp), %rdx
	movl	$0, %eax
	movl	$10, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	leaq	-192(%rbp), %rax
	movl	$84, %edx
	movl	$1, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	-212(%rbp), %eax
	cltq
	movl	$0, -192(%rbp,%rax,4)
.L11:
	movl	$0, -200(%rbp)
	movl	$1, -204(%rbp)
	jmp	.L2
.L5:
	movl	-204(%rbp), %eax
	cltq
	movl	-96(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L3
	cmpl	$0, -200(%rbp)
	je	.L4
	movl	-204(%rbp), %eax
	cltq
	movl	-192(%rbp,%rax,4), %edx
	movl	-200(%rbp), %eax
	cltq
	movl	-192(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L3
.L4:
	movl	-204(%rbp), %eax
	movl	%eax, -200(%rbp)
.L3:
	addl	$1, -204(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -204(%rbp)
	jle	.L5
	cmpl	$0, -200(%rbp)
	jne	.L6
	movl	-216(%rbp), %eax
	cltq
	movl	-192(%rbp,%rax,4), %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	jmp	.L13
.L6:
	movl	-200(%rbp), %eax
	cltq
	movl	$1, -96(%rbp,%rax,4)
	movl	$1, -204(%rbp)
	jmp	.L8
.L10:
	movl	-200(%rbp), %eax
	cltq
	movl	-192(%rbp,%rax,4), %ecx
	movl	-204(%rbp), %eax
	movslq	%eax, %rsi
	movl	-200(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	g(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movl	%eax, -196(%rbp)
	movl	-204(%rbp), %eax
	cltq
	movl	-192(%rbp,%rax,4), %eax
	cmpl	%eax, -196(%rbp)
	jge	.L9
	movl	-204(%rbp), %eax
	cltq
	movl	-196(%rbp), %edx
	movl	%edx, -192(%rbp,%rax,4)
.L9:
	addl	$1, -204(%rbp)
.L8:
	movl	n(%rip), %eax
	cmpl	%eax, -204(%rbp)
	jle	.L10
	jmp	.L11
.L13:
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	dijkstra, .-dijkstra
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d,%d,%d,%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.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	$1764, %edx
	movl	$1, %esi
	leaq	g(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-40(%rbp), %rax
	movq	%rax, %rdx
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20(%rbp)
	jmp	.L15
.L16:
	leaq	-24(%rbp), %rsi
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	movl	-32(%rbp), %edx
	movl	-28(%rbp), %ecx
	movslq	%edx, %rsi
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	g(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-32(%rbp), %eax
	movl	-36(%rbp), %edx
	movl	-24(%rbp), %ecx
	movslq	%edx, %rsi
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	g(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -20(%rbp)
.L15:
	movl	-40(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L16
	leaq	-24(%rbp), %rsi
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %edx
	movl	-36(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	movl	$0, %eax
	call	dijkstra
	movl	%eax, -16(%rbp)
	movl	-36(%rbp), %edx
	movl	-32(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	movl	$0, %eax
	call	dijkstra
	movl	%eax, -12(%rbp)
	movl	-28(%rbp), %eax
	movl	-24(%rbp), %edx
	subl	%edx, %eax
	subl	-16(%rbp), %eax
	subl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %edi
	call	exit@PLT
	.cfi_endproc
.LFE1:
	.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	dijkstra
	.type	dijkstra, @function
dijkstra:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movslq	%edi, %r9
	movl	$10, %ecx
	movslq	%esi, %r10
	leaq	g(%rip), %rbx
	subq	$192, %rsp
	.cfi_def_cfa_offset 208
	movl	n(%rip), %r11d
	movdqa	.LC0(%rip), %xmm0
	movq	%fs:40, %rax
	movq	%rax, 184(%rsp)
	xorl	%eax, %eax
	leaq	96(%rsp), %r8
	movl	$16843009, 80(%rsp)
	movq	%r8, %rdi
	movaps	%xmm0, (%rsp)
	movaps	%xmm0, 16(%rsp)
	movaps	%xmm0, 32(%rsp)
	movaps	%xmm0, 48(%rsp)
	movaps	%xmm0, 64(%rsp)
	rep stosq
	movl	$0, (%rsp,%r9,4)
	movl	$0, (%rdi)
	leal	-1(%r11), %edi
	leaq	8(%rsp,%rdi,4), %r9
	addq	$2, %rdi
	testl	%r11d, %r11d
	jle	.L2
	.p2align 4,,10
	.p2align 3
.L19:
	movl	$1, %eax
	xorl	%edx, %edx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L18:
	movslq	%edx, %rcx
	movl	(%rsp,%rcx,4), %ecx
	cmpl	%ecx, (%rsp,%rax,4)
	cmovl	%eax, %edx
.L3:
	addq	$1, %rax
	cmpq	%rdi, %rax
	je	.L17
.L4:
	movl	(%r8,%rax,4), %ecx
	testl	%ecx, %ecx
	jne	.L3
	testl	%edx, %edx
	jne	.L18
	movl	%eax, %edx
	addq	$1, %rax
	cmpq	%rdi, %rax
	jne	.L4
.L17:
	testl	%edx, %edx
	je	.L2
	movslq	%edx, %rcx
	leaq	(%rcx,%rcx,4), %rax
	movl	$1, 96(%rsp,%rcx,4)
	leaq	(%rcx,%rax,4), %rax
	leaq	4(%rbx,%rax,4), %rsi
	leaq	4(%rsp), %rax
	.p2align 4,,10
	.p2align 3
.L7:
	movl	(%rsi), %edx
	addl	(%rsp,%rcx,4), %edx
	cmpl	%edx, (%rax)
	jle	.L6
	movl	%edx, (%rax)
.L6:
	addq	$4, %rax
	addq	$4, %rsi
	cmpq	%r9, %rax
	jne	.L7
	testl	%r11d, %r11d
	jg	.L19
.L2:
	movl	(%rsp,%r10,4), %eax
	movq	184(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L20
	addq	$192, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L20:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	dijkstra, .-dijkstra
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d,%d,%d,%d"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$220, %ecx
	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	g(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %rdi
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rdx
	movabsq	$72340172838076673, %rax
	rep stosq
	xorl	%eax, %eax
	movl	$16843009, (%rdi)
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %eax
	testl	%eax, %eax
	jle	.L29
	xorl	%ebx, %ebx
	leaq	36(%rsp), %r13
	leaq	32(%rsp), %rcx
	leaq	28(%rsp), %r15
	leaq	24(%rsp), %r14
	leaq	.LC2(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L23:
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	movq	%r13, %r8
	movq	%rcx, 8(%rsp)
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movslq	24(%rsp), %rax
	movslq	28(%rsp), %rdx
	movl	32(%rsp), %edi
	movq	8(%rsp), %rcx
	leaq	(%rax,%rax,4), %rsi
	leaq	(%rax,%rsi,4), %rsi
	addq	%rdx, %rsi
	movl	%edi, 0(%rbp,%rsi,4)
	leaq	(%rdx,%rdx,4), %rsi
	leaq	(%rdx,%rsi,4), %rdx
	addq	%rdx, %rax
	movl	36(%rsp), %edx
	cmpl	%ebx, 20(%rsp)
	movl	%edx, 0(%rbp,%rax,4)
	jg	.L23
.L22:
	movq	%r13, %r8
	movq	%r15, %rdx
	movq	%r12, %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %ebp
	movl	24(%rsp), %r12d
	xorl	%eax, %eax
	movl	%ebp, %esi
	movl	%r12d, %edi
	call	dijkstra
	movl	%r12d, %esi
	movl	%ebp, %edi
	movl	%eax, %ebx
	xorl	%eax, %eax
	call	dijkstra
	movl	32(%rsp), %edx
	subl	36(%rsp), %edx
	movl	$1, %edi
	subl	%ebx, %edx
	leaq	.LC3(%rip), %rsi
	subl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%edi, %edi
	call	exit@PLT
.L29:
	leaq	36(%rsp), %r13
	leaq	32(%rsp), %rcx
	leaq	28(%rsp), %r15
	leaq	24(%rsp), %r14
	leaq	.LC2(%rip), %r12
	jmp	.L22
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.globl	g
	.bss
	.align 32
	.type	g, @object
	.size	g, 1764
g:
	.zero	1764
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.quad	72340172838076673
	.quad	72340172838076673
	.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	dijkstra
	.type	dijkstra, @function
dijkstra:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movslq	%edi, %r9
	movl	$10, %ecx
	movslq	%esi, %r10
	leaq	g(%rip), %rbx
	subq	$192, %rsp
	.cfi_def_cfa_offset 208
	movl	n(%rip), %r11d
	movdqa	.LC0(%rip), %xmm0
	movq	%fs:40, %rax
	movq	%rax, 184(%rsp)
	xorl	%eax, %eax
	leaq	96(%rsp), %r8
	movl	$16843009, 80(%rsp)
	movq	%r8, %rdi
	movaps	%xmm0, (%rsp)
	movaps	%xmm0, 16(%rsp)
	movaps	%xmm0, 32(%rsp)
	movaps	%xmm0, 48(%rsp)
	movaps	%xmm0, 64(%rsp)
	rep stosq
	movl	$0, (%rsp,%r9,4)
	movl	$0, (%rdi)
	leal	-1(%r11), %edi
	leaq	8(%rsp,%rdi,4), %r9
	addq	$2, %rdi
	testl	%r11d, %r11d
	jle	.L2
	.p2align 4,,10
	.p2align 3
.L19:
	movl	$1, %eax
	xorl	%edx, %edx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L18:
	movslq	%edx, %rcx
	movl	(%rsp,%rcx,4), %ecx
	cmpl	%ecx, (%rsp,%rax,4)
	cmovl	%eax, %edx
.L3:
	addq	$1, %rax
	cmpq	%rdi, %rax
	je	.L17
.L4:
	movl	(%r8,%rax,4), %ecx
	testl	%ecx, %ecx
	jne	.L3
	testl	%edx, %edx
	jne	.L18
	movl	%eax, %edx
	addq	$1, %rax
	cmpq	%rdi, %rax
	jne	.L4
.L17:
	testl	%edx, %edx
	je	.L2
	movslq	%edx, %rcx
	leaq	(%rcx,%rcx,4), %rax
	movl	$1, 96(%rsp,%rcx,4)
	leaq	(%rcx,%rax,4), %rax
	leaq	4(%rbx,%rax,4), %rsi
	leaq	4(%rsp), %rax
	.p2align 4,,10
	.p2align 3
.L7:
	movl	(%rsi), %edx
	addl	(%rsp,%rcx,4), %edx
	cmpl	%edx, (%rax)
	jle	.L6
	movl	%edx, (%rax)
.L6:
	addq	$4, %rax
	addq	$4, %rsi
	cmpq	%r9, %rax
	jne	.L7
	testl	%r11d, %r11d
	jg	.L19
.L2:
	movl	(%rsp,%r10,4), %eax
	movq	184(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L20
	addq	$192, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L20:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	dijkstra, .-dijkstra
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d,%d,%d,%d"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$220, %ecx
	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	g(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %rdi
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rdx
	movabsq	$72340172838076673, %rax
	rep stosq
	xorl	%eax, %eax
	movl	$16843009, (%rdi)
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %eax
	testl	%eax, %eax
	jle	.L29
	xorl	%ebx, %ebx
	leaq	36(%rsp), %r13
	leaq	32(%rsp), %rcx
	leaq	28(%rsp), %r15
	leaq	24(%rsp), %r14
	leaq	.LC2(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L23:
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	movq	%r13, %r8
	movq	%rcx, 8(%rsp)
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movslq	24(%rsp), %rax
	movslq	28(%rsp), %rdx
	movl	32(%rsp), %edi
	movq	8(%rsp), %rcx
	leaq	(%rax,%rax,4), %rsi
	leaq	(%rax,%rsi,4), %rsi
	addq	%rdx, %rsi
	movl	%edi, 0(%rbp,%rsi,4)
	leaq	(%rdx,%rdx,4), %rsi
	leaq	(%rdx,%rsi,4), %rdx
	addq	%rdx, %rax
	movl	36(%rsp), %edx
	cmpl	%ebx, 20(%rsp)
	movl	%edx, 0(%rbp,%rax,4)
	jg	.L23
.L22:
	movq	%r13, %r8
	movq	%r15, %rdx
	movq	%r12, %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %ebp
	movl	24(%rsp), %r12d
	xorl	%eax, %eax
	movl	%ebp, %esi
	movl	%r12d, %edi
	call	dijkstra
	movl	%r12d, %esi
	movl	%ebp, %edi
	movl	%eax, %ebx
	xorl	%eax, %eax
	call	dijkstra
	movl	32(%rsp), %edx
	subl	36(%rsp), %edx
	movl	$1, %edi
	subl	%ebx, %edx
	leaq	.LC3(%rip), %rsi
	subl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%edi, %edi
	call	exit@PLT
.L29:
	leaq	36(%rsp), %r13
	leaq	32(%rsp), %rcx
	leaq	28(%rsp), %r15
	leaq	24(%rsp), %r14
	leaq	.LC2(%rip), %r12
	jmp	.L22
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.globl	g
	.bss
	.align 32
	.type	g, @object
	.size	g, 1764
g:
	.zero	1764
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.quad	72340172838076673
	.quad	72340172838076673
	.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<memory.h>
int n, g[21][21];
int dijkstra(start, goal){
	int c[21], f[21]={0}, i, nearest, t;
	memset(c, 1, sizeof(c));
	c[start] = 0;
	while(1){
		nearest=0;
		for(i=1;i<=n;i++){
			if(!f[i] && (!nearest || c[i]<c[nearest]))
				nearest=i;
		}
		if(!nearest)
			return c[goal];
		f[nearest]=1;
		for(i=1;i<=n;i++){
			t=c[nearest]+g[nearest][i];
			if(t<c[i])
				c[i]=t;
		}
	}
}
int main(){
	int m, x1, x2, y1, y2;
	int i, c12, c21;
	memset(g, 1, sizeof(g));
	scanf("%d%d",&n,&m);
	for(i = 0; i < m; i ++){
		int a,b,c,d;
		scanf("%d,%d,%d,%d",&a,&b,&c,&d);
		g[a][b] = c;
		g[b][a] = d;
	}
	scanf("%d,%d,%d,%d",&x1,&x2,&y1,&y2);
	c12 = dijkstra(x1, x2);
	c21 = dijkstra(x2, x1);
	printf("%d\n", y1-y2-c12-c21);
	exit(0);
}
6
8
1,2,2,2
1,3,4,3
1,4,4,2
2,5,3,2
3,4,4,2
3,6,1,2
4,6,1,1
5,6,2,2
2,4,50,30
 6
8
1,2,2,2
1,3,4,3
1,4,4,2
2,5,3,2
3,4,4,2
3,6,1,2
4,6,1,1
2,1,6,5
2,4,50,30
 6
8
1,2,2,2
0,3,4,3
2,4,4,1
2,5,3,2
3,4,2,4
3,6,1,2
4,6,1,1
5,6,2,2
2,4,50,30
 6
8
1,1,2,2
3,4,3,0
1,4,4,2
2,3,5,2
3,4,4,2
3,6,1,2
4,6,1,1
5,6,2,2
2,4,50,30
 6
7
1,2,2,2
1,2,4,3
1,4,4,2
2,5,3,2
3,4,4,2
3,6,1,2
4,6,1,1
2,1,6,5
2,4,50,30
 6
8
1,2,2,2
3,4,3,0
2,4,4,1
2,3,5,2
3,4,4,2
3,6,1,2
4,6,1,2
5,6,2,2
2,4,50,31
 6
8
1,2,2,2
0,3,4,3
1,4,4,2
2,5,2,2
3,4,4,2
3,6,1,2
4,6,1,1
5,6,2,2
2,4,50,30
 6
8
1,2,2,2
0,3,4,3
1,4,4,2
1,5,3,2
3,4,2,4
2,1,6,3
4,6,1,1
5,6,2,2
2,4,50,30
 6
8
1,2,2,2
3,4,3,0
1,5,2,4
1,5,3,2
4,4,2,4
2,1,6,3
4,6,1,1
5,6,2,2
2,4,50,30
 6
8
1,2,2,2
0,3,4,3
1,5,2,4
1,6,3,2
4,4,2,4
2,1,6,3
4,6,1,1
5,6,2,2
2,4,50,30

10
 3
 15
 9
 -6
 14
 11
 5
 0
 4

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<memory.h>
int n, g[21][21];
int dijkstra(start, goal){
	int c[21], f[21]={0}, i, nearest, t;
	memset(c, 1, sizeof(c));
	c[start] = 0;
	while(1){
		nearest=0;
		for(i=1;i<=n;i++){
			if(!f[i] && (!nearest || c[i]<c[nearest]))
				nearest=i;
		}
		if(!nearest)
			return c[goal];
		f[nearest]=1;
		for(i=1;i<=n;i++){
			t=c[nearest]+g[nearest][i];
			if(t<c[i])
				c[i]=t;
		}
	}
}
int main(){
	int m, x1, x2, y1, y2;
	int i, c12, c21;
	memset(g, 1, sizeof(g));
	scanf("%d%d",&n,&m);
	for(i = 0; i < m; i ++){
		int a,b,c,d;
		scanf("%d,%d,%d,%d",&a,&b,&c,&d);
		g[a][b] = c;
		g[b][a] = d;
	}
	scanf("%d,%d,%d,%d",&x1,&x2,&y1,&y2);
	c12 = dijkstra(x1, x2);
	c21 = dijkstra(x2, x1);
	printf("%d\n", y1-y2-c12-c21);
	exit(0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	g
	.align 32
	.type	g, @object
	.size	g, 1764
g:
	.zero	1764
	.text
	.globl	dijkstra
	.type	dijkstra, @function
dijkstra:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$224, %rsp
	movl	%edi, -212(%rbp)
	movl	%esi, -216(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-96(%rbp), %rdx
	movl	$0, %eax
	movl	$10, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	leaq	-192(%rbp), %rax
	movl	$84, %edx
	movl	$1, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	-212(%rbp), %eax
	cltq
	movl	$0, -192(%rbp,%rax,4)
.L11:
	movl	$0, -200(%rbp)
	movl	$1, -204(%rbp)
	jmp	.L2
.L5:
	movl	-204(%rbp), %eax
	cltq
	movl	-96(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L3
	cmpl	$0, -200(%rbp)
	je	.L4
	movl	-204(%rbp), %eax
	cltq
	movl	-192(%rbp,%rax,4), %edx
	movl	-200(%rbp), %eax
	cltq
	movl	-192(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L3
.L4:
	movl	-204(%rbp), %eax
	movl	%eax, -200(%rbp)
.L3:
	addl	$1, -204(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -204(%rbp)
	jle	.L5
	cmpl	$0, -200(%rbp)
	jne	.L6
	movl	-216(%rbp), %eax
	cltq
	movl	-192(%rbp,%rax,4), %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	jmp	.L13
.L6:
	movl	-200(%rbp), %eax
	cltq
	movl	$1, -96(%rbp,%rax,4)
	movl	$1, -204(%rbp)
	jmp	.L8
.L10:
	movl	-200(%rbp), %eax
	cltq
	movl	-192(%rbp,%rax,4), %ecx
	movl	-204(%rbp), %eax
	movslq	%eax, %rsi
	movl	-200(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	g(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movl	%eax, -196(%rbp)
	movl	-204(%rbp), %eax
	cltq
	movl	-192(%rbp,%rax,4), %eax
	cmpl	%eax, -196(%rbp)
	jge	.L9
	movl	-204(%rbp), %eax
	cltq
	movl	-196(%rbp), %edx
	movl	%edx, -192(%rbp,%rax,4)
.L9:
	addl	$1, -204(%rbp)
.L8:
	movl	n(%rip), %eax
	cmpl	%eax, -204(%rbp)
	jle	.L10
	jmp	.L11
.L13:
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	dijkstra, .-dijkstra
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d,%d,%d,%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.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	$1764, %edx
	movl	$1, %esi
	leaq	g(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-40(%rbp), %rax
	movq	%rax, %rdx
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20(%rbp)
	jmp	.L15
.L16:
	leaq	-24(%rbp), %rsi
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	movl	-32(%rbp), %edx
	movl	-28(%rbp), %ecx
	movslq	%edx, %rsi
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	g(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-32(%rbp), %eax
	movl	-36(%rbp), %edx
	movl	-24(%rbp), %ecx
	movslq	%edx, %rsi
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	g(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -20(%rbp)
.L15:
	movl	-40(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L16
	leaq	-24(%rbp), %rsi
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %edx
	movl	-36(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	movl	$0, %eax
	call	dijkstra
	movl	%eax, -16(%rbp)
	movl	-36(%rbp), %edx
	movl	-32(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	movl	$0, %eax
	call	dijkstra
	movl	%eax, -12(%rbp)
	movl	-28(%rbp), %eax
	movl	-24(%rbp), %edx
	subl	%edx, %eax
	subl	-16(%rbp), %eax
	subl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %edi
	call	exit@PLT
	.cfi_endproc
.LFE1:
	.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	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	g
	.align 32
	.type	g, @object
	.size	g, 1764
g:
	.zero	1764
	.text
	.globl	dijkstra
	.type	dijkstra, @function
dijkstra:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$224, %rsp
	movl	%edi, -212(%rbp)
	movl	%esi, -216(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-96(%rbp), %rdx
	movl	$0, %eax
	movl	$10, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	leaq	-192(%rbp), %rax
	movl	$84, %edx
	movl	$1, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	-212(%rbp), %eax
	cltq
	movl	$0, -192(%rbp,%rax,4)
.L11:
	movl	$0, -200(%rbp)
	movl	$1, -204(%rbp)
	jmp	.L2
.L5:
	movl	-204(%rbp), %eax
	cltq
	movl	-96(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L3
	cmpl	$0, -200(%rbp)
	je	.L4
	movl	-204(%rbp), %eax
	cltq
	movl	-192(%rbp,%rax,4), %edx
	movl	-200(%rbp), %eax
	cltq
	movl	-192(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L3
.L4:
	movl	-204(%rbp), %eax
	movl	%eax, -200(%rbp)
.L3:
	addl	$1, -204(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -204(%rbp)
	jle	.L5
	cmpl	$0, -200(%rbp)
	jne	.L6
	movl	-216(%rbp), %eax
	cltq
	movl	-192(%rbp,%rax,4), %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	jmp	.L13
.L6:
	movl	-200(%rbp), %eax
	cltq
	movl	$1, -96(%rbp,%rax,4)
	movl	$1, -204(%rbp)
	jmp	.L8
.L10:
	movl	-200(%rbp), %eax
	cltq
	movl	-192(%rbp,%rax,4), %ecx
	movl	-204(%rbp), %eax
	movslq	%eax, %rsi
	movl	-200(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	g(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movl	%eax, -196(%rbp)
	movl	-204(%rbp), %eax
	cltq
	movl	-192(%rbp,%rax,4), %eax
	cmpl	%eax, -196(%rbp)
	jge	.L9
	movl	-204(%rbp), %eax
	cltq
	movl	-196(%rbp), %edx
	movl	%edx, -192(%rbp,%rax,4)
.L9:
	addl	$1, -204(%rbp)
.L8:
	movl	n(%rip), %eax
	cmpl	%eax, -204(%rbp)
	jle	.L10
	jmp	.L11
.L13:
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	dijkstra, .-dijkstra
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d,%d,%d,%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.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	$1764, %edx
	movl	$1, %esi
	leaq	g(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-40(%rbp), %rax
	movq	%rax, %rdx
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20(%rbp)
	jmp	.L15
.L16:
	leaq	-24(%rbp), %rsi
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	movl	-32(%rbp), %edx
	movl	-28(%rbp), %ecx
	movslq	%edx, %rsi
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	g(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-32(%rbp), %eax
	movl	-36(%rbp), %edx
	movl	-24(%rbp), %ecx
	movslq	%edx, %rsi
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	g(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -20(%rbp)
.L15:
	movl	-40(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L16
	leaq	-24(%rbp), %rsi
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %edx
	movl	-36(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	movl	$0, %eax
	call	dijkstra
	movl	%eax, -16(%rbp)
	movl	-36(%rbp), %edx
	movl	-32(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	movl	$0, %eax
	call	dijkstra
	movl	%eax, -12(%rbp)
	movl	-28(%rbp), %eax
	movl	-24(%rbp), %edx
	subl	%edx, %eax
	subl	-16(%rbp), %eax
	subl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %edi
	call	exit@PLT
	.cfi_endproc
.LFE1:
	.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:
