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 n, a, b, c, d;

int main(){
  int i;
  long long min0, max0, min1, max1;
  scanf("%d%d%d%d%d", &n, &a, &b, &c, &d);

  for(i=0;i<n;i++){
    min0 = (long long) (n-1-i) * c;
    max0 = (long long) (n-1-i) * d;
    min1 = (long long) i * c;
    max1 = (long long) i * d;
    if(b >= a + min0 - max1 && b <= a + max0 - min1){
      puts("YES");
      return 0;
    }
  }

  puts("NO");

  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	b
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	d
	.align 4
	.type	d, @object
	.size	d, 4
d:
	.zero	4
	.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	$48, %rsp
	leaq	d(%rip), %r9
	leaq	c(%rip), %r8
	leaq	b(%rip), %rax
	movq	%rax, %rcx
	leaq	a(%rip), %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, -36(%rbp)
	jmp	.L2
.L5:
	movl	n(%rip), %eax
	subl	$1, %eax
	subl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movl	c(%rip), %eax
	cltq
	imulq	%rdx, %rax
	movq	%rax, -32(%rbp)
	movl	n(%rip), %eax
	subl	$1, %eax
	subl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movl	d(%rip), %eax
	cltq
	imulq	%rdx, %rax
	movq	%rax, -24(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movl	c(%rip), %eax
	cltq
	imulq	%rdx, %rax
	movq	%rax, -16(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movl	d(%rip), %eax
	cltq
	imulq	%rdx, %rax
	movq	%rax, -8(%rbp)
	movl	b(%rip), %eax
	movslq	%eax, %rdx
	movl	a(%rip), %eax
	movslq	%eax, %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	subq	-8(%rbp), %rax
	cmpq	%rax, %rdx
	jl	.L3
	movl	b(%rip), %eax
	movslq	%eax, %rdx
	movl	a(%rip), %eax
	movslq	%eax, %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	subq	-16(%rbp), %rax
	cmpq	%rax, %rdx
	jg	.L3
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L4
.L3:
	addl	$1, -36(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L5
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
.L4:
	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
	leaq	c(%rip), %r8
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	leaq	d(%rip), %r9
	leaq	b(%rip), %rcx
	leaq	a(%rip), %rdx
	leaq	n(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	n(%rip), %r8d
	testl	%r8d, %r8d
	jle	.L2
	leal	-1(%r8), %edx
	movslq	d(%rip), %rcx
	movslq	c(%rip), %rdi
	movslq	%edx, %rdx
	movslq	a(%rip), %r10
	movslq	b(%rip), %rsi
	movq	%rdx, %rax
	imulq	%rcx, %rdx
	movq	%rdi, %r9
	imulq	%rdi, %rax
	negq	%r9
	addq	%rcx, %rdi
	subq	%rcx, %r9
	xorl	%ecx, %ecx
	addq	%r10, %rdx
	addq	%r10, %rax
	.p2align 4,,10
	.p2align 3
.L5:
	cmpq	%rax, %rsi
	jl	.L3
	cmpq	%rdx, %rsi
	jle	.L9
.L3:
	addl	$1, %ecx
	addq	%r9, %rax
	subq	%rdi, %rdx
	cmpl	%r8d, %ecx
	jne	.L5
.L2:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L4:
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L9:
	.cfi_restore_state
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L4
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	d
	.bss
	.align 4
	.type	d, @object
	.size	d, 4
d:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	b
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.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
	leaq	c(%rip), %r8
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	leaq	d(%rip), %r9
	leaq	b(%rip), %rcx
	leaq	a(%rip), %rdx
	leaq	n(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	n(%rip), %r8d
	testl	%r8d, %r8d
	jle	.L2
	leal	-1(%r8), %edx
	movslq	d(%rip), %rcx
	movslq	c(%rip), %rdi
	movslq	%edx, %rdx
	movslq	a(%rip), %r10
	movslq	b(%rip), %rsi
	movq	%rdx, %rax
	imulq	%rcx, %rdx
	movq	%rdi, %r9
	imulq	%rdi, %rax
	negq	%r9
	addq	%rcx, %rdi
	subq	%rcx, %r9
	xorl	%ecx, %ecx
	addq	%r10, %rdx
	addq	%r10, %rax
	.p2align 4,,10
	.p2align 3
.L5:
	cmpq	%rax, %rsi
	jl	.L3
	cmpq	%rdx, %rsi
	jle	.L9
.L3:
	addl	$1, %ecx
	addq	%r9, %rax
	subq	%rdi, %rdx
	cmpl	%r8d, %ecx
	jne	.L5
.L2:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L4:
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L9:
	.cfi_restore_state
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L4
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	d
	.bss
	.align 4
	.type	d, @object
	.size	d, 4
d:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	b
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.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 n, a, b, c, d;

int main(){
  int i;
  long long min0, max0, min1, max1;
  scanf("%d%d%d%d%d", &n, &a, &b, &c, &d);

  for(i=0;i<n;i++){
    min0 = (long long) (n-1-i) * c;
    max0 = (long long) (n-1-i) * d;
    min1 = (long long) i * c;
    max1 = (long long) i * d;
    if(b >= a + min0 - max1 && b <= a + max0 - min1){
      puts("YES");
      return 0;
    }
  }

  puts("NO");

  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 n, a, b, c, d;

int main(){
  int i;
  long long min0, max0, min1, max1;
  scanf("%d%d%d%d%d", &n, &a, &b, &c, &d);

  for(i=0;i<n;i++){
    min0 = (long long) (n-1-i) * c;
    max0 = (long long) (n-1-i) * d;
    min1 = (long long) i * c;
    max1 = (long long) i * d;
    if(b >= a + min0 - max1 && b <= a + max0 - min1){
      puts("YES");
      return 0;
    }
  }

  puts("NO");

  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	b
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	d
	.align 4
	.type	d, @object
	.size	d, 4
d:
	.zero	4
	.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	$48, %rsp
	leaq	d(%rip), %r9
	leaq	c(%rip), %r8
	leaq	b(%rip), %rax
	movq	%rax, %rcx
	leaq	a(%rip), %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, -36(%rbp)
	jmp	.L2
.L5:
	movl	n(%rip), %eax
	subl	$1, %eax
	subl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movl	c(%rip), %eax
	cltq
	imulq	%rdx, %rax
	movq	%rax, -32(%rbp)
	movl	n(%rip), %eax
	subl	$1, %eax
	subl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movl	d(%rip), %eax
	cltq
	imulq	%rdx, %rax
	movq	%rax, -24(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movl	c(%rip), %eax
	cltq
	imulq	%rdx, %rax
	movq	%rax, -16(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movl	d(%rip), %eax
	cltq
	imulq	%rdx, %rax
	movq	%rax, -8(%rbp)
	movl	b(%rip), %eax
	movslq	%eax, %rdx
	movl	a(%rip), %eax
	movslq	%eax, %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	subq	-8(%rbp), %rax
	cmpq	%rax, %rdx
	jl	.L3
	movl	b(%rip), %eax
	movslq	%eax, %rdx
	movl	a(%rip), %eax
	movslq	%eax, %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	subq	-16(%rbp), %rax
	cmpq	%rax, %rdx
	jg	.L3
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L4
.L3:
	addl	$1, -36(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L5
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
.L4:
	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
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	b
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	d
	.align 4
	.type	d, @object
	.size	d, 4
d:
	.zero	4
	.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	$48, %rsp
	leaq	d(%rip), %r9
	leaq	c(%rip), %r8
	leaq	b(%rip), %rax
	movq	%rax, %rcx
	leaq	a(%rip), %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, -36(%rbp)
	jmp	.L2
.L5:
	movl	n(%rip), %eax
	subl	$1, %eax
	subl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movl	c(%rip), %eax
	cltq
	imulq	%rdx, %rax
	movq	%rax, -32(%rbp)
	movl	n(%rip), %eax
	subl	$1, %eax
	subl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movl	d(%rip), %eax
	cltq
	imulq	%rdx, %rax
	movq	%rax, -24(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movl	c(%rip), %eax
	cltq
	imulq	%rdx, %rax
	movq	%rax, -16(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movl	d(%rip), %eax
	cltq
	imulq	%rdx, %rax
	movq	%rax, -8(%rbp)
	movl	b(%rip), %eax
	movslq	%eax, %rdx
	movl	a(%rip), %eax
	movslq	%eax, %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	subq	-8(%rbp), %rax
	cmpq	%rax, %rdx
	jl	.L3
	movl	b(%rip), %eax
	movslq	%eax, %rdx
	movl	a(%rip), %eax
	movslq	%eax, %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	subq	-16(%rbp), %rax
	cmpq	%rax, %rdx
	jg	.L3
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L4
.L3:
	addl	$1, -36(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L5
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
.L4:
	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:
