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

```c
#include<stdio.h>
long int x, N, f, A, B;
int main(){
  scanf("%ld%ld%ld",&A, &B, &N);
  if(N<B-1){
    f=A*N/B;
  }else{
    f=A*(B-1)/B;
  }
  printf("%ld",f);
  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld%ld%ld"
.LC1:
	.string	"%ld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	leaq	N(%rip), %rcx
	leaq	B(%rip), %rdx
	xorl	%eax, %eax
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	leaq	A(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movq	B(%rip), %rcx
	movq	N(%rip), %rdx
	leaq	-1(%rcx), %rax
	cmpq	%rdx, %rax
	jle	.L2
	movq	A(%rip), %rax
	imulq	%rdx, %rax
	cqto
	idivq	%rcx
.L3:
	movq	%rax, f(%rip)
	movq	%rax, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	imulq	A(%rip), %rax
	cqto
	idivq	%rcx
	jmp	.L3
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	B
	.bss
	.align 8
	.type	B, @object
	.size	B, 8
B:
	.zero	8
	.globl	A
	.align 8
	.type	A, @object
	.size	A, 8
A:
	.zero	8
	.globl	f
	.align 8
	.type	f, @object
	.size	f, 8
f:
	.zero	8
	.globl	N
	.align 8
	.type	N, @object
	.size	N, 8
N:
	.zero	8
	.globl	x
	.align 8
	.type	x, @object
	.size	x, 8
x:
	.zero	8
	.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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld%ld%ld"
.LC1:
	.string	"%ld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	leaq	N(%rip), %rcx
	leaq	B(%rip), %rdx
	xorl	%eax, %eax
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	leaq	A(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movq	B(%rip), %rcx
	movq	N(%rip), %rdx
	leaq	-1(%rcx), %rax
	cmpq	%rdx, %rax
	jle	.L2
	movq	A(%rip), %rax
	imulq	%rdx, %rax
	cqto
	idivq	%rcx
.L3:
	movq	%rax, f(%rip)
	movq	%rax, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	imulq	A(%rip), %rax
	cqto
	idivq	%rcx
	jmp	.L3
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	B
	.bss
	.align 8
	.type	B, @object
	.size	B, 8
B:
	.zero	8
	.globl	A
	.align 8
	.type	A, @object
	.size	A, 8
A:
	.zero	8
	.globl	f
	.align 8
	.type	f, @object
	.size	f, 8
f:
	.zero	8
	.globl	N
	.align 8
	.type	N, @object
	.size	N, 8
N:
	.zero	8
	.globl	x
	.align 8
	.type	x, @object
	.size	x, 8
x:
	.zero	8
	.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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld%ld%ld"
.LC1:
	.string	"%ld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	leaq	N(%rip), %rcx
	leaq	B(%rip), %rdx
	xorl	%eax, %eax
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	leaq	A(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movq	B(%rip), %rcx
	movq	N(%rip), %rdx
	leaq	-1(%rcx), %rax
	cmpq	%rdx, %rax
	jle	.L2
	movq	A(%rip), %rax
	imulq	%rdx, %rax
	cqto
	idivq	%rcx
.L3:
	movq	%rax, f(%rip)
	movq	%rax, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	imulq	A(%rip), %rax
	cqto
	idivq	%rcx
	jmp	.L3
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	B
	.bss
	.align 8
	.type	B, @object
	.size	B, 8
B:
	.zero	8
	.globl	A
	.align 8
	.type	A, @object
	.size	A, 8
A:
	.zero	8
	.globl	f
	.align 8
	.type	f, @object
	.size	f, 8
f:
	.zero	8
	.globl	N
	.align 8
	.type	N, @object
	.size	N, 8
N:
	.zero	8
	.globl	x
	.align 8
	.type	x, @object
	.size	x, 8
x:
	.zero	8
	.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:
```
```c
#include<stdio.h>
long int x, N, f, A, B;
int main(){
  scanf("%ld%ld%ld",&A, &B, &N);
  if(N<B-1){
    f=A*N/B;
  }else{
    f=A*(B-1)/B;
  }
  printf("%ld",f);
  return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
long int x, N, f, A, B;
int main(){
  scanf("%ld%ld%ld",&A, &B, &N);
  if(N<B-1){
    f=A*N/B;
  }else{
    f=A*(B-1)/B;
  }
  printf("%ld",f);
  return 0;
}```

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.
Optimized Assembly Code:

4 7 4
 1 7 4
 5 7 5
 2 7 4
 7 7 5
 20 10 3
 35 10 3
 9 6 5
 56 12 1
 11 4 4

2 0 3 1 5 6 10 7 4 8
Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
long int x, N, f, A, B;
int main(){
  scanf("%ld%ld%ld",&A, &B, &N);
  if(N<B-1){
    f=A*N/B;
  }else{
    f=A*(B-1)/B;
  }
  printf("%ld",f);
  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld%ld%ld"
.LC1:
	.string	"%ld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	leaq	N(%rip), %rcx
	leaq	B(%rip), %rdx
	xorl	%eax, %eax
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	leaq	A(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movq	B(%rip), %rcx
	movq	N(%rip), %rdx
	leaq	-1(%rcx), %rax
	cmpq	%rdx, %rax
	jle	.L2
	movq	A(%rip), %rax
	imulq	%rdx, %rax
	cqto
	idivq	%rcx
.L3:
	movq	%rax, f(%rip)
	movq	%rax, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	imulq	A(%rip), %rax
	cqto
	idivq	%rcx
	jmp	.L3
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	B
	.bss
	.align 8
	.type	B, @object
	.size	B, 8
B:
	.zero	8
	.globl	A
	.align 8
	.type	A, @object
	.size	A, 8
A:
	.zero	8
	.globl	f
	.align 8
	.type	f, @object
	.size	f, 8
f:
	.zero	8
	.globl	N
	.align 8
	.type	N, @object
	.size	N, 8
N:
	.zero	8
	.globl	x
	.align 8
	.type	x, @object
	.size	x, 8
x:
	.zero	8
	.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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld%ld%ld"
.LC1:
	.string	"%ld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	leaq	N(%rip), %rcx
	leaq	B(%rip), %rdx
	xorl	%eax, %eax
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	leaq	A(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movq	B(%rip), %rcx
	movq	N(%rip), %rdx
	leaq	-1(%rcx), %rax
	cmpq	%rdx, %rax
	jle	.L2
	movq	A(%rip), %rax
	imulq	%rdx, %rax
	cqto
	idivq	%rcx
.L3:
	movq	%rax, f(%rip)
	movq	%rax, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	imulq	A(%rip), %rax
	cqto
	idivq	%rcx
	jmp	.L3
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	B
	.bss
	.align 8
	.type	B, @object
	.size	B, 8
B:
	.zero	8
	.globl	A
	.align 8
	.type	A, @object
	.size	A, 8
A:
	.zero	8
	.globl	f
	.align 8
	.type	f, @object
	.size	f, 8
f:
	.zero	8
	.globl	N
	.align 8
	.type	N, @object
	.size	N, 8
N:
	.zero	8
	.globl	x
	.align 8
	.type	x, @object
	.size	x, 8
x:
	.zero	8
	.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:
```