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>

int main()
{
	int N, A, B, C, D;
	scanf("%d %d %d %d %d", &N, &A, &B, &C, &D);
	
	int i, j, k, l, r, m;
	long long L, R;
	l = 0;
	r = N - 1;
	while (l < r) {
		m = (l + r) / 2;
		L = A - (long long)D * m + (long long)C * (N - m - 1);
		R = A - (long long)C * m + (long long)D * (N - m - 1);
		if (B >= L && B <= R) break;
		else if (L > B) l = m + 1;
		else r = m;
	}
	
	if (l < r) printf("YES\n");
	else printf("NO\n");
	fflush(stdout);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d %d %d %d"
.LC1:
	.string	"YES"
.LC2:
	.string	"NO"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-40(%rbp), %rdi
	leaq	-44(%rbp), %rsi
	leaq	-48(%rbp), %rcx
	leaq	-52(%rbp), %rdx
	leaq	-56(%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, -36(%rbp)
	movl	-56(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -32(%rbp)
	jmp	.L2
.L6:
	movl	-36(%rbp), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -28(%rbp)
	movl	-52(%rbp), %eax
	cltq
	movl	-40(%rbp), %edx
	movslq	%edx, %rcx
	movl	-28(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	subq	%rdx, %rax
	movq	%rax, %rcx
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	movl	-56(%rbp), %eax
	subl	-28(%rbp), %eax
	subl	$1, %eax
	cltq
	imulq	%rdx, %rax
	addq	%rcx, %rax
	movq	%rax, -24(%rbp)
	movl	-52(%rbp), %eax
	cltq
	movl	-44(%rbp), %edx
	movslq	%edx, %rcx
	movl	-28(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	subq	%rdx, %rax
	movq	%rax, %rcx
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-56(%rbp), %eax
	subl	-28(%rbp), %eax
	subl	$1, %eax
	cltq
	imulq	%rdx, %rax
	addq	%rcx, %rax
	movq	%rax, -16(%rbp)
	movl	-48(%rbp), %eax
	cltq
	cmpq	%rax, -24(%rbp)
	jg	.L3
	movl	-48(%rbp), %eax
	cltq
	cmpq	%rax, -16(%rbp)
	jge	.L4
.L3:
	movl	-48(%rbp), %eax
	cltq
	cmpq	%rax, -24(%rbp)
	jle	.L5
	movl	-28(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -36(%rbp)
	jmp	.L2
.L5:
	movl	-28(%rbp), %eax
	movl	%eax, -32(%rbp)
.L2:
	movl	-36(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jl	.L6
.L4:
	movl	-36(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jge	.L7
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L8
.L7:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L8:
	movq	stdout(%rip), %rax
	movq	%rax, %rdi
	call	fflush@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
.LFE0:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d %d %d"
.LC1:
	.string	"YES"
.LC2:
	.string	"NO"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$32, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %r9
	leaq	16(%rsp), %r8
	leaq	12(%rsp), %rcx
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %ebx
	movslq	8(%rsp), %r11
	xorl	%edi, %edi
	movslq	20(%rsp), %r10
	movslq	16(%rsp), %r9
	movslq	12(%rsp), %r8
	leal	-1(%rbx), %ebp
.L5:
	cmpl	%ebp, %edi
	jge	.L14
.L6:
	leal	(%rdi,%rbp), %ecx
	movq	%r10, %r12
	movl	%ebx, %eax
	movq	%r11, %rdx
	sarl	%ecx
	movslq	%ecx, %rsi
	subl	%ecx, %eax
	imulq	%rsi, %r12
	subl	$1, %eax
	cltq
	subq	%r12, %rdx
	movq	%r9, %r12
	imulq	%rax, %r12
	addq	%r12, %rdx
	cmpq	%rdx, %r8
	jge	.L15
	leal	1(%rcx), %edi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L15:
	imulq	%r9, %rsi
	movq	%r11, %rdx
	imulq	%r10, %rax
	subq	%rsi, %rdx
	addq	%rdx, %rax
	cmpq	%rax, %r8
	jle	.L4
	movl	%ecx, %ebp
	cmpl	%ebp, %edi
	jl	.L6
.L14:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L8:
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L4:
	.cfi_restore_state
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L8
.L16:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d %d %d"
.LC1:
	.string	"YES"
.LC2:
	.string	"NO"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$32, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %r9
	leaq	16(%rsp), %r8
	leaq	12(%rsp), %rcx
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %ebx
	movslq	8(%rsp), %r11
	xorl	%edi, %edi
	movslq	20(%rsp), %r10
	movslq	16(%rsp), %r9
	movslq	12(%rsp), %r8
	leal	-1(%rbx), %ebp
.L5:
	cmpl	%ebp, %edi
	jge	.L14
.L6:
	leal	(%rdi,%rbp), %ecx
	movq	%r10, %r12
	movl	%ebx, %eax
	movq	%r11, %rdx
	sarl	%ecx
	movslq	%ecx, %rsi
	subl	%ecx, %eax
	imulq	%rsi, %r12
	subl	$1, %eax
	cltq
	subq	%r12, %rdx
	movq	%r9, %r12
	imulq	%rax, %r12
	addq	%r12, %rdx
	cmpq	%rdx, %r8
	jge	.L15
	leal	1(%rcx), %edi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L15:
	imulq	%r9, %rsi
	movq	%r11, %rdx
	imulq	%r10, %rax
	subq	%rsi, %rdx
	addq	%rdx, %rax
	cmpq	%rax, %r8
	jle	.L4
	movl	%ecx, %ebp
	cmpl	%ebp, %edi
	jl	.L6
.L14:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L8:
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L4:
	.cfi_restore_state
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L8
.L16:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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>

int main()
{
	int N, A, B, C, D;
	scanf("%d %d %d %d %d", &N, &A, &B, &C, &D);
	
	int i, j, k, l, r, m;
	long long L, R;
	l = 0;
	r = N - 1;
	while (l < r) {
		m = (l + r) / 2;
		L = A - (long long)D * m + (long long)C * (N - m - 1);
		R = A - (long long)C * m + (long long)D * (N - m - 1);
		if (B >= L && B <= R) break;
		else if (L > B) l = m + 1;
		else r = m;
	}
	
	if (l < r) printf("YES\n");
	else printf("NO\n");
	fflush(stdout);
	return 0;
}
1788 105960835 681218449 90629745 90632170
 4 7 11 4 5
 491995 412925347 465710940 59999126 59999339
 1788 122437383 681218449 90629745 90632170
 491995 412925347 465710940 59999126 4650906
 4 7 11 4 6
 1788 122437383 681218449 90629745 148553464
 801386 412925347 465710940 59999126 4650906
 4 7 9 4 6
 1788 122437383 541607279 90629745 148553464

NO
 YES
 NO
 NO
 NO
 YES
 YES
 NO
 YES
 YES

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>

int main()
{
	int N, A, B, C, D;
	scanf("%d %d %d %d %d", &N, &A, &B, &C, &D);
	
	int i, j, k, l, r, m;
	long long L, R;
	l = 0;
	r = N - 1;
	while (l < r) {
		m = (l + r) / 2;
		L = A - (long long)D * m + (long long)C * (N - m - 1);
		R = A - (long long)C * m + (long long)D * (N - m - 1);
		if (B >= L && B <= R) break;
		else if (L > B) l = m + 1;
		else r = m;
	}
	
	if (l < r) printf("YES\n");
	else printf("NO\n");
	fflush(stdout);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d %d %d %d"
.LC1:
	.string	"YES"
.LC2:
	.string	"NO"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-40(%rbp), %rdi
	leaq	-44(%rbp), %rsi
	leaq	-48(%rbp), %rcx
	leaq	-52(%rbp), %rdx
	leaq	-56(%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, -36(%rbp)
	movl	-56(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -32(%rbp)
	jmp	.L2
.L6:
	movl	-36(%rbp), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -28(%rbp)
	movl	-52(%rbp), %eax
	cltq
	movl	-40(%rbp), %edx
	movslq	%edx, %rcx
	movl	-28(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	subq	%rdx, %rax
	movq	%rax, %rcx
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	movl	-56(%rbp), %eax
	subl	-28(%rbp), %eax
	subl	$1, %eax
	cltq
	imulq	%rdx, %rax
	addq	%rcx, %rax
	movq	%rax, -24(%rbp)
	movl	-52(%rbp), %eax
	cltq
	movl	-44(%rbp), %edx
	movslq	%edx, %rcx
	movl	-28(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	subq	%rdx, %rax
	movq	%rax, %rcx
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-56(%rbp), %eax
	subl	-28(%rbp), %eax
	subl	$1, %eax
	cltq
	imulq	%rdx, %rax
	addq	%rcx, %rax
	movq	%rax, -16(%rbp)
	movl	-48(%rbp), %eax
	cltq
	cmpq	%rax, -24(%rbp)
	jg	.L3
	movl	-48(%rbp), %eax
	cltq
	cmpq	%rax, -16(%rbp)
	jge	.L4
.L3:
	movl	-48(%rbp), %eax
	cltq
	cmpq	%rax, -24(%rbp)
	jle	.L5
	movl	-28(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -36(%rbp)
	jmp	.L2
.L5:
	movl	-28(%rbp), %eax
	movl	%eax, -32(%rbp)
.L2:
	movl	-36(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jl	.L6
.L4:
	movl	-36(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jge	.L7
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L8
.L7:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L8:
	movq	stdout(%rip), %rax
	movq	%rax, %rdi
	call	fflush@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
.LFE0:
	.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
	.section	.rodata
.LC0:
	.string	"%d %d %d %d %d"
.LC1:
	.string	"YES"
.LC2:
	.string	"NO"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-40(%rbp), %rdi
	leaq	-44(%rbp), %rsi
	leaq	-48(%rbp), %rcx
	leaq	-52(%rbp), %rdx
	leaq	-56(%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, -36(%rbp)
	movl	-56(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -32(%rbp)
	jmp	.L2
.L6:
	movl	-36(%rbp), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -28(%rbp)
	movl	-52(%rbp), %eax
	cltq
	movl	-40(%rbp), %edx
	movslq	%edx, %rcx
	movl	-28(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	subq	%rdx, %rax
	movq	%rax, %rcx
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	movl	-56(%rbp), %eax
	subl	-28(%rbp), %eax
	subl	$1, %eax
	cltq
	imulq	%rdx, %rax
	addq	%rcx, %rax
	movq	%rax, -24(%rbp)
	movl	-52(%rbp), %eax
	cltq
	movl	-44(%rbp), %edx
	movslq	%edx, %rcx
	movl	-28(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	subq	%rdx, %rax
	movq	%rax, %rcx
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-56(%rbp), %eax
	subl	-28(%rbp), %eax
	subl	$1, %eax
	cltq
	imulq	%rdx, %rax
	addq	%rcx, %rax
	movq	%rax, -16(%rbp)
	movl	-48(%rbp), %eax
	cltq
	cmpq	%rax, -24(%rbp)
	jg	.L3
	movl	-48(%rbp), %eax
	cltq
	cmpq	%rax, -16(%rbp)
	jge	.L4
.L3:
	movl	-48(%rbp), %eax
	cltq
	cmpq	%rax, -24(%rbp)
	jle	.L5
	movl	-28(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -36(%rbp)
	jmp	.L2
.L5:
	movl	-28(%rbp), %eax
	movl	%eax, -32(%rbp)
.L2:
	movl	-36(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jl	.L6
.L4:
	movl	-36(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jge	.L7
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L8
.L7:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L8:
	movq	stdout(%rip), %rax
	movq	%rax, %rdi
	call	fflush@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
.LFE0:
	.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:
