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>
#include <string.h>

#ifdef TEST
struct test {
    int ans;
} td[] = {
    {},
};
#endif

int
distance(int f, int t)
{
    int d = f - t;
    if(d < 0)
        d = -d;
    return d;
}

void
solver(int n, int x, int y)
{
    int i, j;
    int len[2001];
    int min_len;
    int new_len;

    bzero(len, sizeof(len));
    for(i = 1; i < n + 1; i++) {
        for(j = i + 1; j < n + 1; j++) {
            min_len = distance(i, j);
            new_len = distance(i, x) + 1 + distance(j, y);
            if(min_len > new_len)
                min_len = new_len;
            new_len = distance(j, x) + 1 + distance(i, y);
            if(min_len > new_len)
                min_len = new_len;
            len[min_len]++;
        }
    }
    for(i = 1; i < n; i++) {
        printf("%d\n", len[i]);
    }
}

int
main(int argc, char *argv[])
{
#ifdef TEST
    int tt;
    for(tt = 0; tt < sizeof(td) / sizeof(struct test); tt++) {
        solver();
        printf("%d\n", td[tt].ans);
    }
#endif
    int N, X, Y;
    scanf("%d%d%d", &N, &X, &Y);
    solver(N, X, Y);
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	distance
	.type	distance, @function
distance:
.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, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	subl	-24(%rbp), %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jns	.L2
	negl	-4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	distance, .-distance
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	solver
	.type	solver, @function
solver:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$3960, %rsp
	.cfi_offset 3, -24
	movl	%edi, -8052(%rbp)
	movl	%esi, -8056(%rbp)
	movl	%edx, -8060(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-8032(%rbp), %rax
	movq	%rax, %rdx
	movl	$0, %eax
	movl	$1000, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	movl	$1, -8048(%rbp)
	jmp	.L5
.L10:
	movl	-8048(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -8044(%rbp)
	jmp	.L6
.L9:
	movl	-8044(%rbp), %edx
	movl	-8048(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	distance
	movl	%eax, -8040(%rbp)
	movl	-8056(%rbp), %edx
	movl	-8048(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	distance
	leal	1(%rax), %ebx
	movl	-8060(%rbp), %edx
	movl	-8044(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	distance
	addl	%ebx, %eax
	movl	%eax, -8036(%rbp)
	movl	-8040(%rbp), %eax
	cmpl	-8036(%rbp), %eax
	jle	.L7
	movl	-8036(%rbp), %eax
	movl	%eax, -8040(%rbp)
.L7:
	movl	-8056(%rbp), %edx
	movl	-8044(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	distance
	leal	1(%rax), %ebx
	movl	-8060(%rbp), %edx
	movl	-8048(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	distance
	addl	%ebx, %eax
	movl	%eax, -8036(%rbp)
	movl	-8040(%rbp), %eax
	cmpl	-8036(%rbp), %eax
	jle	.L8
	movl	-8036(%rbp), %eax
	movl	%eax, -8040(%rbp)
.L8:
	movl	-8040(%rbp), %eax
	cltq
	movl	-8032(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-8040(%rbp), %eax
	cltq
	movl	%edx, -8032(%rbp,%rax,4)
	addl	$1, -8044(%rbp)
.L6:
	movl	-8052(%rbp), %eax
	cmpl	-8044(%rbp), %eax
	jge	.L9
	addl	$1, -8048(%rbp)
.L5:
	movl	-8052(%rbp), %eax
	cmpl	-8048(%rbp), %eax
	jge	.L10
	movl	$1, -8048(%rbp)
	jmp	.L11
.L12:
	movl	-8048(%rbp), %eax
	cltq
	movl	-8032(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -8048(%rbp)
.L11:
	movl	-8048(%rbp), %eax
	cmpl	-8052(%rbp), %eax
	jl	.L12
	nop
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	solver, .-solver
	.section	.rodata
.LC1:
	.string	"%d%d%d"
	.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
	movl	%edi, -36(%rbp)
	movq	%rsi, -48(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-12(%rbp), %rcx
	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	-12(%rbp), %edx
	movl	-16(%rbp), %ecx
	movl	-20(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	solver
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.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	distance
	.type	distance, @function
distance:
.LFB51:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	movl	%esi, %edx
	subl	%edi, %edx
	subl	%esi, %eax
	cmovs	%edx, %eax
	ret
	.cfi_endproc
.LFE51:
	.size	distance, .-distance
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
	.text
	.p2align 4
	.globl	solver
	.type	solver, @function
solver:
.LFB52:
	.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
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$3944, %rsp
	.cfi_def_cfa_offset 8096
	movl	$1000, %ecx
	movq	%fs:40, %rax
	movq	%rax, 8024(%rsp)
	xorl	%eax, %eax
	movl	%edx, %ebp
	leaq	16(%rsp), %rdx
	movl	%edi, %r10d
	movq	%rdx, %rdi
	rep stosq
	movl	$0, (%rdi)
	testl	%r10d, %r10d
	jle	.L4
	cmpl	$1, %r10d
	je	.L4
	movl	%ebp, %eax
	movl	$1, %r11d
	leal	1(%rbp), %r14d
	movl	%esi, %ebx
	subl	%esi, %eax
	subl	%ebp, %r11d
	movl	$1, %r12d
	subl	%esi, %r14d
	movl	%eax, 12(%rsp)
	movl	$1, %r13d
	.p2align 4,,10
	.p2align 3
.L13:
	movl	12(%rsp), %edi
	movl	%r12d, %r9d
	movl	%ebx, %eax
	addl	$1, %r12d
	subl	%r9d, %eax
	movl	%ebp, %r8d
	leal	(%r14,%r11), %ecx
	movl	$-1, %edx
	addl	%r11d, %edi
	cmovs	%eax, %edi
	subl	%r9d, %r8d
	addl	$1, %edi
	testl	%r11d, %r11d
	cmovns	%r11d, %r8d
	addl	$1, %r11d
	movl	%r11d, %esi
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L9:
	addl	$1, %ecx
	leal	(%rcx,%r8), %r15d
	cmpl	%eax, %r15d
	cmovle	%r15d, %eax
	subl	$1, %edx
	addl	$1, %esi
	cltq
	addl	$1, 16(%rsp,%rax,4)
	movl	%r9d, %eax
	subl	%edx, %eax
	cmpl	%eax, %r10d
	jl	.L22
.L12:
	movl	%edx, %r15d
	movl	%esi, %eax
	negl	%r15d
	cmovs	%edx, %r15d
	negl	%eax
	cmovs	%esi, %eax
	addl	%edi, %eax
	cmpl	%r15d, %eax
	cmovg	%r15d, %eax
	testl	%ecx, %ecx
	jns	.L9
	movl	%r13d, %r15d
	subl	%ecx, %r15d
	addl	%r8d, %r15d
	cmpl	%eax, %r15d
	cmovle	%r15d, %eax
	subl	$1, %edx
	addl	$1, %ecx
	addl	$1, %esi
	cltq
	addl	$1, 16(%rsp,%rax,4)
	movl	%r9d, %eax
	subl	%edx, %eax
	cmpl	%eax, %r10d
	jge	.L12
.L22:
	cmpl	%r10d, %r12d
	jne	.L13
	leal	-2(%r12), %eax
	leaq	20(%rsp), %rbx
	leaq	24(%rsp,%rax,4), %r12
	leaq	.LC0(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L15:
	movl	(%rbx), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%r12, %rbx
	jne	.L15
.L4:
	movq	8024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$8040, %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
.L23:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	solver, .-solver
	.section	.rodata.str1.1
.LC1:
	.string	"%d%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	leaq	.LC1(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	leaq	20(%rsp), %rcx
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %edx
	movl	16(%rsp), %esi
	movl	12(%rsp), %edi
	call	solver
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	xorl	%eax, %eax
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L27:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE53:
	.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	distance
	.type	distance, @function
distance:
.LFB51:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	movl	%esi, %edx
	subl	%edi, %edx
	subl	%esi, %eax
	cmovs	%edx, %eax
	ret
	.cfi_endproc
.LFE51:
	.size	distance, .-distance
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
	.text
	.p2align 4
	.globl	solver
	.type	solver, @function
solver:
.LFB52:
	.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
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$3944, %rsp
	.cfi_def_cfa_offset 8096
	movl	$1000, %ecx
	movq	%fs:40, %rax
	movq	%rax, 8024(%rsp)
	xorl	%eax, %eax
	movl	%edx, %ebp
	leaq	16(%rsp), %rdx
	movl	%edi, %r10d
	movq	%rdx, %rdi
	rep stosq
	movl	$0, (%rdi)
	testl	%r10d, %r10d
	jle	.L4
	cmpl	$1, %r10d
	je	.L4
	movl	%ebp, %eax
	movl	$1, %r11d
	leal	1(%rbp), %r14d
	movl	%esi, %ebx
	subl	%esi, %eax
	subl	%ebp, %r11d
	movl	$1, %r12d
	subl	%esi, %r14d
	movl	%eax, 12(%rsp)
	movl	$1, %r13d
	.p2align 4,,10
	.p2align 3
.L13:
	movl	12(%rsp), %edi
	movl	%r12d, %r9d
	movl	%ebx, %eax
	addl	$1, %r12d
	subl	%r9d, %eax
	movl	%ebp, %r8d
	leal	(%r14,%r11), %ecx
	movl	$-1, %edx
	addl	%r11d, %edi
	cmovs	%eax, %edi
	subl	%r9d, %r8d
	addl	$1, %edi
	testl	%r11d, %r11d
	cmovns	%r11d, %r8d
	addl	$1, %r11d
	movl	%r11d, %esi
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L9:
	addl	$1, %ecx
	leal	(%rcx,%r8), %r15d
	cmpl	%eax, %r15d
	cmovle	%r15d, %eax
	subl	$1, %edx
	addl	$1, %esi
	cltq
	addl	$1, 16(%rsp,%rax,4)
	movl	%r9d, %eax
	subl	%edx, %eax
	cmpl	%eax, %r10d
	jl	.L22
.L12:
	movl	%edx, %r15d
	movl	%esi, %eax
	negl	%r15d
	cmovs	%edx, %r15d
	negl	%eax
	cmovs	%esi, %eax
	addl	%edi, %eax
	cmpl	%r15d, %eax
	cmovg	%r15d, %eax
	testl	%ecx, %ecx
	jns	.L9
	movl	%r13d, %r15d
	subl	%ecx, %r15d
	addl	%r8d, %r15d
	cmpl	%eax, %r15d
	cmovle	%r15d, %eax
	subl	$1, %edx
	addl	$1, %ecx
	addl	$1, %esi
	cltq
	addl	$1, 16(%rsp,%rax,4)
	movl	%r9d, %eax
	subl	%edx, %eax
	cmpl	%eax, %r10d
	jge	.L12
.L22:
	cmpl	%r10d, %r12d
	jne	.L13
	leal	-2(%r12), %eax
	leaq	20(%rsp), %rbx
	leaq	24(%rsp,%rax,4), %r12
	leaq	.LC0(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L15:
	movl	(%rbx), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%r12, %rbx
	jne	.L15
.L4:
	movq	8024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$8040, %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
.L23:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	solver, .-solver
	.section	.rodata.str1.1
.LC1:
	.string	"%d%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	leaq	.LC1(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	leaq	20(%rsp), %rcx
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %edx
	movl	16(%rsp), %esi
	movl	12(%rsp), %edi
	call	solver
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	xorl	%eax, %eax
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L27:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE53:
	.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:

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

#ifdef TEST
struct test {
    int ans;
} td[] = {
    {},
};
#endif

int
distance(int f, int t)
{
    int d = f - t;
    if(d < 0)
        d = -d;
    return d;
}

void
solver(int n, int x, int y)
{
    int i, j;
    int len[2001];
    int min_len;
    int new_len;

    bzero(len, sizeof(len));
    for(i = 1; i < n + 1; i++) {
        for(j = i + 1; j < n + 1; j++) {
            min_len = distance(i, j);
            new_len = distance(i, x) + 1 + distance(j, y);
            if(min_len > new_len)
                min_len = new_len;
            new_len = distance(j, x) + 1 + distance(i, y);
            if(min_len > new_len)
                min_len = new_len;
            len[min_len]++;
        }
    }
    for(i = 1; i < n; i++) {
        printf("%d\n", len[i]);
    }
}

int
main(int argc, char *argv[])
{
#ifdef TEST
    int tt;
    for(tt = 0; tt < sizeof(td) / sizeof(struct test); tt++) {
        solver();
        printf("%d\n", td[tt].ans);
    }
#endif
    int N, X, Y;
    scanf("%d%d%d", &N, &X, &Y);
    solver(N, X, Y);
    return 0;
}
4 1 3
 7 3 4
 10 4 6
 9 2 4
 14 3 4
 10 4 9
 10 4 5
 3 2 3
 5 1 4
 4 1 2

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

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>
#include <string.h>

#ifdef TEST
struct test {
    int ans;
} td[] = {
    {},
};
#endif

int
distance(int f, int t)
{
    int d = f - t;
    if(d < 0)
        d = -d;
    return d;
}

void
solver(int n, int x, int y)
{
    int i, j;
    int len[2001];
    int min_len;
    int new_len;

    bzero(len, sizeof(len));
    for(i = 1; i < n + 1; i++) {
        for(j = i + 1; j < n + 1; j++) {
            min_len = distance(i, j);
            new_len = distance(i, x) + 1 + distance(j, y);
            if(min_len > new_len)
                min_len = new_len;
            new_len = distance(j, x) + 1 + distance(i, y);
            if(min_len > new_len)
                min_len = new_len;
            len[min_len]++;
        }
    }
    for(i = 1; i < n; i++) {
        printf("%d\n", len[i]);
    }
}

int
main(int argc, char *argv[])
{
#ifdef TEST
    int tt;
    for(tt = 0; tt < sizeof(td) / sizeof(struct test); tt++) {
        solver();
        printf("%d\n", td[tt].ans);
    }
#endif
    int N, X, Y;
    scanf("%d%d%d", &N, &X, &Y);
    solver(N, X, Y);
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	distance
	.type	distance, @function
distance:
.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, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	subl	-24(%rbp), %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jns	.L2
	negl	-4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	distance, .-distance
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	solver
	.type	solver, @function
solver:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$3960, %rsp
	.cfi_offset 3, -24
	movl	%edi, -8052(%rbp)
	movl	%esi, -8056(%rbp)
	movl	%edx, -8060(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-8032(%rbp), %rax
	movq	%rax, %rdx
	movl	$0, %eax
	movl	$1000, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	movl	$1, -8048(%rbp)
	jmp	.L5
.L10:
	movl	-8048(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -8044(%rbp)
	jmp	.L6
.L9:
	movl	-8044(%rbp), %edx
	movl	-8048(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	distance
	movl	%eax, -8040(%rbp)
	movl	-8056(%rbp), %edx
	movl	-8048(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	distance
	leal	1(%rax), %ebx
	movl	-8060(%rbp), %edx
	movl	-8044(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	distance
	addl	%ebx, %eax
	movl	%eax, -8036(%rbp)
	movl	-8040(%rbp), %eax
	cmpl	-8036(%rbp), %eax
	jle	.L7
	movl	-8036(%rbp), %eax
	movl	%eax, -8040(%rbp)
.L7:
	movl	-8056(%rbp), %edx
	movl	-8044(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	distance
	leal	1(%rax), %ebx
	movl	-8060(%rbp), %edx
	movl	-8048(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	distance
	addl	%ebx, %eax
	movl	%eax, -8036(%rbp)
	movl	-8040(%rbp), %eax
	cmpl	-8036(%rbp), %eax
	jle	.L8
	movl	-8036(%rbp), %eax
	movl	%eax, -8040(%rbp)
.L8:
	movl	-8040(%rbp), %eax
	cltq
	movl	-8032(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-8040(%rbp), %eax
	cltq
	movl	%edx, -8032(%rbp,%rax,4)
	addl	$1, -8044(%rbp)
.L6:
	movl	-8052(%rbp), %eax
	cmpl	-8044(%rbp), %eax
	jge	.L9
	addl	$1, -8048(%rbp)
.L5:
	movl	-8052(%rbp), %eax
	cmpl	-8048(%rbp), %eax
	jge	.L10
	movl	$1, -8048(%rbp)
	jmp	.L11
.L12:
	movl	-8048(%rbp), %eax
	cltq
	movl	-8032(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -8048(%rbp)
.L11:
	movl	-8048(%rbp), %eax
	cmpl	-8052(%rbp), %eax
	jl	.L12
	nop
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	solver, .-solver
	.section	.rodata
.LC1:
	.string	"%d%d%d"
	.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
	movl	%edi, -36(%rbp)
	movq	%rsi, -48(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-12(%rbp), %rcx
	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	-12(%rbp), %edx
	movl	-16(%rbp), %ecx
	movl	-20(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	solver
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.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	distance
	.type	distance, @function
distance:
.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, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	subl	-24(%rbp), %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jns	.L2
	negl	-4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	distance, .-distance
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	solver
	.type	solver, @function
solver:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$3960, %rsp
	.cfi_offset 3, -24
	movl	%edi, -8052(%rbp)
	movl	%esi, -8056(%rbp)
	movl	%edx, -8060(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-8032(%rbp), %rax
	movq	%rax, %rdx
	movl	$0, %eax
	movl	$1000, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	movl	$1, -8048(%rbp)
	jmp	.L5
.L10:
	movl	-8048(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -8044(%rbp)
	jmp	.L6
.L9:
	movl	-8044(%rbp), %edx
	movl	-8048(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	distance
	movl	%eax, -8040(%rbp)
	movl	-8056(%rbp), %edx
	movl	-8048(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	distance
	leal	1(%rax), %ebx
	movl	-8060(%rbp), %edx
	movl	-8044(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	distance
	addl	%ebx, %eax
	movl	%eax, -8036(%rbp)
	movl	-8040(%rbp), %eax
	cmpl	-8036(%rbp), %eax
	jle	.L7
	movl	-8036(%rbp), %eax
	movl	%eax, -8040(%rbp)
.L7:
	movl	-8056(%rbp), %edx
	movl	-8044(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	distance
	leal	1(%rax), %ebx
	movl	-8060(%rbp), %edx
	movl	-8048(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	distance
	addl	%ebx, %eax
	movl	%eax, -8036(%rbp)
	movl	-8040(%rbp), %eax
	cmpl	-8036(%rbp), %eax
	jle	.L8
	movl	-8036(%rbp), %eax
	movl	%eax, -8040(%rbp)
.L8:
	movl	-8040(%rbp), %eax
	cltq
	movl	-8032(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-8040(%rbp), %eax
	cltq
	movl	%edx, -8032(%rbp,%rax,4)
	addl	$1, -8044(%rbp)
.L6:
	movl	-8052(%rbp), %eax
	cmpl	-8044(%rbp), %eax
	jge	.L9
	addl	$1, -8048(%rbp)
.L5:
	movl	-8052(%rbp), %eax
	cmpl	-8048(%rbp), %eax
	jge	.L10
	movl	$1, -8048(%rbp)
	jmp	.L11
.L12:
	movl	-8048(%rbp), %eax
	cltq
	movl	-8032(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -8048(%rbp)
.L11:
	movl	-8048(%rbp), %eax
	cmpl	-8052(%rbp), %eax
	jl	.L12
	nop
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	solver, .-solver
	.section	.rodata
.LC1:
	.string	"%d%d%d"
	.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
	movl	%edi, -36(%rbp)
	movq	%rsi, -48(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-12(%rbp), %rcx
	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	-12(%rbp), %edx
	movl	-16(%rbp), %ecx
	movl	-20(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	solver
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.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:
