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

```c
// Aizu Vol-5 0594: Super Metropolis
// 2017.8.31 bal4u@uu

#include <stdio.h>

#define abs(x) ((x)>=0?(x):-(x))
#define max(x,y) ((x)>=(y)?(x):(y))

int shortpath(int xf, int yf, int xt, int yt)
{
	if ((xt >= xf && yt <= yf) || (xt <= xf && yt >= yf)) return abs(xt-xf)+abs(yt-yf);
	return max(abs(xt-xf), abs(yt-yf)); 
}

int main()
{
	int w, h, n, x1, y1, x2, y2, ans;

	scanf("%d%d%d%d%d", &w, &h, &n, &x1, &y1);
	for (ans = 0, n--; n-- > 0; x1 = x2, y1 = y2) {
		scanf("%d%d", &x2, &y2);
		ans += shortpath(x1, y1, x2, y2);
	}
	printf("%d\n", ans);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	shortpath
	.type	shortpath, @function
shortpath:
.LFB0:
	.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	%edx, -12(%rbp)
	movl	%ecx, -16(%rbp)
	movl	-12(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L2
	movl	-16(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L3
.L2:
	movl	-12(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jg	.L4
	movl	-16(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L4
.L3:
	movl	-12(%rbp), %eax
	subl	-4(%rbp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, %ecx
	movl	-16(%rbp), %eax
	subl	-8(%rbp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	addl	%ecx, %eax
	jmp	.L5
.L4:
	movl	-12(%rbp), %eax
	subl	-4(%rbp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovs	%eax, %edx
	movl	-16(%rbp), %eax
	subl	-8(%rbp), %eax
	movl	%eax, %ecx
	negl	%ecx
	cmovns	%ecx, %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
.L5:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	shortpath, .-shortpath
	.section	.rodata
.LC0:
	.string	"%d%d%d%d%d"
.LC1:
	.string	"%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
	leaq	-24(%rbp), %rdi
	leaq	-28(%rbp), %rsi
	leaq	-32(%rbp), %rcx
	leaq	-36(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rdi, %r9
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	movl	-32(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -32(%rbp)
	jmp	.L7
.L8:
	leaq	-16(%rbp), %rdx
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %ecx
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %esi
	movl	-28(%rbp), %eax
	movl	%eax, %edi
	call	shortpath
	addl	%eax, -12(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	-16(%rbp), %eax
	movl	%eax, -24(%rbp)
.L7:
	movl	-32(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -32(%rbp)
	testl	%eax, %eax
	jg	.L8
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.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	shortpath
	.type	shortpath, @function
shortpath:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%edx, %eax
	movl	%ecx, %r9d
	subl	%edi, %eax
	movl	%eax, %r8d
	negl	%r8d
	cmovs	%eax, %r8d
	subl	%esi, %r9d
	movl	%r9d, %eax
	negl	%eax
	cmovs	%r9d, %eax
	cmpl	%edi, %edx
	jl	.L16
	cmpl	%esi, %ecx
	jg	.L18
	addl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L18:
	cmpl	%edi, %edx
	jle	.L16
.L4:
	cmpl	%r8d, %eax
	cmovl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	cmpl	%esi, %ecx
	jl	.L4
	addl	%r8d, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	shortpath, .-shortpath
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%d%d%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$56, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	20(%rsp), %rcx
	leaq	12(%rsp), %rsi
	leaq	28(%rsp), %r9
	leaq	24(%rsp), %r8
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %eax
	leal	-2(%rax), %edx
	movl	%edx, 20(%rsp)
	cmpl	$1, %eax
	jle	.L20
	leaq	36(%rsp), %r13
	leaq	32(%rsp), %rbp
	leaq	.LC1(%rip), %rbx
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L41:
	cmpl	%esi, %edx
	jle	.L39
.L23:
	movl	%ecx, %r8d
	subl	%edi, %r8d
	movl	%edx, %edi
	movl	%r8d, %eax
	negl	%eax
	cmovs	%r8d, %eax
	subl	%esi, %edi
	movl	%edi, %esi
	negl	%esi
	cmovs	%edi, %esi
	cmpl	%esi, %eax
	cmovl	%esi, %eax
.L24:
	addl	%eax, %r12d
	movl	20(%rsp), %eax
	movl	%edx, 24(%rsp)
	movl	%ecx, 28(%rsp)
	leal	-1(%rax), %edx
	movl	%edx, 20(%rsp)
	testl	%eax, %eax
	jle	.L20
.L25:
	movq	%r13, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %edx
	movl	24(%rsp), %esi
	movl	36(%rsp), %ecx
	movl	28(%rsp), %edi
	cmpl	%esi, %edx
	jl	.L39
	cmpl	%edi, %ecx
	jg	.L41
.L21:
	movl	%edx, %r8d
	subl	%esi, %r8d
	movl	%r8d, %eax
	negl	%eax
	cmovs	%r8d, %eax
	movl	%ecx, %r8d
	subl	%edi, %r8d
	movl	%r8d, %esi
	negl	%esi
	cmovs	%r8d, %esi
	addl	%esi, %eax
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L39:
	cmpl	%edi, %ecx
	jge	.L21
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L20:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L42
	addq	$56, %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
.L42:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	shortpath
	.type	shortpath, @function
shortpath:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%edx, %eax
	movl	%ecx, %r9d
	subl	%edi, %eax
	movl	%eax, %r8d
	negl	%r8d
	cmovs	%eax, %r8d
	subl	%esi, %r9d
	movl	%r9d, %eax
	negl	%eax
	cmovs	%r9d, %eax
	cmpl	%edi, %edx
	jl	.L16
	cmpl	%esi, %ecx
	jg	.L18
	addl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L18:
	cmpl	%edi, %edx
	jle	.L16
.L4:
	cmpl	%r8d, %eax
	cmovl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	cmpl	%esi, %ecx
	jl	.L4
	addl	%r8d, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	shortpath, .-shortpath
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%d%d%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$56, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	20(%rsp), %rcx
	leaq	12(%rsp), %rsi
	leaq	28(%rsp), %r9
	leaq	24(%rsp), %r8
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %eax
	leal	-2(%rax), %edx
	movl	%edx, 20(%rsp)
	cmpl	$1, %eax
	jle	.L20
	leaq	36(%rsp), %r13
	leaq	32(%rsp), %rbp
	leaq	.LC1(%rip), %rbx
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L41:
	cmpl	%esi, %edx
	jle	.L39
.L23:
	movl	%ecx, %r8d
	subl	%edi, %r8d
	movl	%edx, %edi
	movl	%r8d, %eax
	negl	%eax
	cmovs	%r8d, %eax
	subl	%esi, %edi
	movl	%edi, %esi
	negl	%esi
	cmovs	%edi, %esi
	cmpl	%esi, %eax
	cmovl	%esi, %eax
.L24:
	addl	%eax, %r12d
	movl	20(%rsp), %eax
	movl	%edx, 24(%rsp)
	movl	%ecx, 28(%rsp)
	leal	-1(%rax), %edx
	movl	%edx, 20(%rsp)
	testl	%eax, %eax
	jle	.L20
.L25:
	movq	%r13, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %edx
	movl	24(%rsp), %esi
	movl	36(%rsp), %ecx
	movl	28(%rsp), %edi
	cmpl	%esi, %edx
	jl	.L39
	cmpl	%edi, %ecx
	jg	.L41
.L21:
	movl	%edx, %r8d
	subl	%esi, %r8d
	movl	%r8d, %eax
	negl	%eax
	cmovs	%r8d, %eax
	movl	%ecx, %r8d
	subl	%edi, %r8d
	movl	%r8d, %esi
	negl	%esi
	cmovs	%r8d, %esi
	addl	%esi, %eax
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L39:
	cmpl	%edi, %ecx
	jge	.L21
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L20:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L42
	addq	$56, %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
.L42:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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:

// Aizu Vol-5 0594: Super Metropolis
// 2017.8.31 bal4u@uu

#include <stdio.h>

#define abs(x) ((x)>=0?(x):-(x))
#define max(x,y) ((x)>=(y)?(x):(y))

int shortpath(int xf, int yf, int xt, int yt)
{
	if ((xt >= xf && yt <= yf) || (xt <= xf && yt >= yf)) return abs(xt-xf)+abs(yt-yf);
	return max(abs(xt-xf), abs(yt-yf)); 
}

int main()
{
	int w, h, n, x1, y1, x2, y2, ans;

	scanf("%d%d%d%d%d", &w, &h, &n, &x1, &y1);
	for (ans = 0, n--; n-- > 0; x1 = x2, y1 = y2) {
		scanf("%d%d", &x2, &y2);
		ans += shortpath(x1, y1, x2, y2);
	}
	printf("%d\n", ans);
	return 0;
}
4 3 3
1 1
3 3
4 1

5

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

```c
// Aizu Vol-5 0594: Super Metropolis
// 2017.8.31 bal4u@uu

#include <stdio.h>

#define abs(x) ((x)>=0?(x):-(x))
#define max(x,y) ((x)>=(y)?(x):(y))

int shortpath(int xf, int yf, int xt, int yt)
{
	if ((xt >= xf && yt <= yf) || (xt <= xf && yt >= yf)) return abs(xt-xf)+abs(yt-yf);
	return max(abs(xt-xf), abs(yt-yf)); 
}

int main()
{
	int w, h, n, x1, y1, x2, y2, ans;

	scanf("%d%d%d%d%d", &w, &h, &n, &x1, &y1);
	for (ans = 0, n--; n-- > 0; x1 = x2, y1 = y2) {
		scanf("%d%d", &x2, &y2);
		ans += shortpath(x1, y1, x2, y2);
	}
	printf("%d\n", ans);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	shortpath
	.type	shortpath, @function
shortpath:
.LFB0:
	.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	%edx, -12(%rbp)
	movl	%ecx, -16(%rbp)
	movl	-12(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L2
	movl	-16(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L3
.L2:
	movl	-12(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jg	.L4
	movl	-16(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L4
.L3:
	movl	-12(%rbp), %eax
	subl	-4(%rbp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, %ecx
	movl	-16(%rbp), %eax
	subl	-8(%rbp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	addl	%ecx, %eax
	jmp	.L5
.L4:
	movl	-12(%rbp), %eax
	subl	-4(%rbp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovs	%eax, %edx
	movl	-16(%rbp), %eax
	subl	-8(%rbp), %eax
	movl	%eax, %ecx
	negl	%ecx
	cmovns	%ecx, %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
.L5:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	shortpath, .-shortpath
	.section	.rodata
.LC0:
	.string	"%d%d%d%d%d"
.LC1:
	.string	"%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
	leaq	-24(%rbp), %rdi
	leaq	-28(%rbp), %rsi
	leaq	-32(%rbp), %rcx
	leaq	-36(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rdi, %r9
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	movl	-32(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -32(%rbp)
	jmp	.L7
.L8:
	leaq	-16(%rbp), %rdx
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %ecx
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %esi
	movl	-28(%rbp), %eax
	movl	%eax, %edi
	call	shortpath
	addl	%eax, -12(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	-16(%rbp), %eax
	movl	%eax, -24(%rbp)
.L7:
	movl	-32(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -32(%rbp)
	testl	%eax, %eax
	jg	.L8
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.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	shortpath
	.type	shortpath, @function
shortpath:
.LFB0:
	.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	%edx, -12(%rbp)
	movl	%ecx, -16(%rbp)
	movl	-12(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L2
	movl	-16(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L3
.L2:
	movl	-12(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jg	.L4
	movl	-16(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L4
.L3:
	movl	-12(%rbp), %eax
	subl	-4(%rbp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, %ecx
	movl	-16(%rbp), %eax
	subl	-8(%rbp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	addl	%ecx, %eax
	jmp	.L5
.L4:
	movl	-12(%rbp), %eax
	subl	-4(%rbp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovs	%eax, %edx
	movl	-16(%rbp), %eax
	subl	-8(%rbp), %eax
	movl	%eax, %ecx
	negl	%ecx
	cmovns	%ecx, %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
.L5:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	shortpath, .-shortpath
	.section	.rodata
.LC0:
	.string	"%d%d%d%d%d"
.LC1:
	.string	"%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
	leaq	-24(%rbp), %rdi
	leaq	-28(%rbp), %rsi
	leaq	-32(%rbp), %rcx
	leaq	-36(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rdi, %r9
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	movl	-32(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -32(%rbp)
	jmp	.L7
.L8:
	leaq	-16(%rbp), %rdx
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %ecx
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %esi
	movl	-28(%rbp), %eax
	movl	%eax, %edi
	call	shortpath
	addl	%eax, -12(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	-16(%rbp), %eax
	movl	%eax, -24(%rbp)
.L7:
	movl	-32(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -32(%rbp)
	testl	%eax, %eax
	jg	.L8
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.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:
