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

typedef int32_t i32;
typedef int64_t i64;

void run (void) {
  i32 n, k;
  scanf ("%" SCNi32 "%" SCNi32, &n, &k);
  i64 l = 0;
  i64 r = 1000000000000000000LL + 1;
  while (r - l > 1) {
    i64 m = (l + r) / 2;
    for (i32 i = 0; i < n && m >= 0; ++i) {
      m--;
      m -= m / k;
    }
    if (m < 0) {
      l = (l + r) / 2;
    } else {
      r = (l + r) / 2;
    }
  }
  printf ("%" PRIi64 "\n", l);
}

int main (void) {
  run();
  return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%i%i"
.LC1:
	.string	"%li\n"
	.text
	.p2align 4
	.globl	run
	.type	run, @function
run:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %r8d
	movslq	4(%rsp), %rdi
	xorl	%r10d, %r10d
	movabsq	$1000000000000000001, %r11
	.p2align 4,,10
	.p2align 3
.L2:
	leaq	(%r11,%r10), %rax
	movq	%rax, %r9
	shrq	$63, %r9
	addq	%rax, %r9
	sarq	%r9
	movq	%r9, %r12
	testl	%r8d, %r8d
	jle	.L9
	cmpq	$-1, %rax
	jl	.L4
	movq	%r9, %rcx
	xorl	%esi, %esi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L14:
	testq	%rcx, %rcx
	js	.L4
.L5:
	subq	$1, %rcx
	addl	$1, %esi
	movq	%rcx, %rax
	cqto
	idivq	%rdi
	subq	%rax, %rcx
	cmpl	%r8d, %esi
	jne	.L14
	testq	%rcx, %rcx
	jns	.L15
.L4:
	movq	%r11, %rax
	subq	%r9, %rax
	cmpq	$1, %rax
	jle	.L7
.L6:
	movq	%r12, %r10
	jmp	.L2
.L17:
	movq	%r10, %r12
.L7:
	xorl	%eax, %eax
	movq	%r12, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L9:
	.cfi_restore_state
	movq	%r9, %rcx
	testq	%rcx, %rcx
	js	.L4
.L15:
	movq	%r9, %rax
	subq	%r10, %rax
	cmpq	$1, %rax
	jle	.L17
	movq	%r9, %r11
	movq	%r10, %r12
	jmp	.L6
.L16:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	run, .-run
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	call	run
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.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:
```

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	"%i%i"
.LC1:
	.string	"%li\n"
	.text
	.p2align 4
	.globl	run
	.type	run, @function
run:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %r8d
	movslq	4(%rsp), %rdi
	xorl	%r10d, %r10d
	movabsq	$1000000000000000001, %r11
	.p2align 4,,10
	.p2align 3
.L2:
	leaq	(%r11,%r10), %rax
	movq	%rax, %r9
	shrq	$63, %r9
	addq	%rax, %r9
	sarq	%r9
	movq	%r9, %r12
	testl	%r8d, %r8d
	jle	.L9
	cmpq	$-1, %rax
	jl	.L4
	movq	%r9, %rcx
	xorl	%esi, %esi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L14:
	testq	%rcx, %rcx
	js	.L4
.L5:
	subq	$1, %rcx
	addl	$1, %esi
	movq	%rcx, %rax
	cqto
	idivq	%rdi
	subq	%rax, %rcx
	cmpl	%r8d, %esi
	jne	.L14
	testq	%rcx, %rcx
	jns	.L15
.L4:
	movq	%r11, %rax
	subq	%r9, %rax
	cmpq	$1, %rax
	jle	.L7
.L6:
	movq	%r12, %r10
	jmp	.L2
.L17:
	movq	%r10, %r12
.L7:
	xorl	%eax, %eax
	movq	%r12, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L9:
	.cfi_restore_state
	movq	%r9, %rcx
	testq	%rcx, %rcx
	js	.L4
.L15:
	movq	%r9, %rax
	subq	%r10, %rax
	cmpq	$1, %rax
	jle	.L17
	movq	%r9, %r11
	movq	%r10, %r12
	jmp	.L6
.L16:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	run, .-run
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	call	run
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%i%i"
.LC1:
	.string	"%li\n"
	.text
	.p2align 4
	.globl	run
	.type	run, @function
run:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %r8d
	movslq	4(%rsp), %rdi
	xorl	%r10d, %r10d
	movabsq	$1000000000000000001, %r11
	.p2align 4,,10
	.p2align 3
.L2:
	leaq	(%r11,%r10), %rax
	movq	%rax, %r9
	shrq	$63, %r9
	addq	%rax, %r9
	sarq	%r9
	movq	%r9, %r12
	testl	%r8d, %r8d
	jle	.L9
	cmpq	$-1, %rax
	jl	.L4
	movq	%r9, %rcx
	xorl	%esi, %esi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L14:
	testq	%rcx, %rcx
	js	.L4
.L5:
	subq	$1, %rcx
	addl	$1, %esi
	movq	%rcx, %rax
	cqto
	idivq	%rdi
	subq	%rax, %rcx
	cmpl	%r8d, %esi
	jne	.L14
	testq	%rcx, %rcx
	jns	.L15
.L4:
	movq	%r11, %rax
	subq	%r9, %rax
	cmpq	$1, %rax
	jle	.L7
.L6:
	movq	%r12, %r10
	jmp	.L2
.L17:
	movq	%r10, %r12
.L7:
	xorl	%eax, %eax
	movq	%r12, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L9:
	.cfi_restore_state
	movq	%r9, %rcx
	testq	%rcx, %rcx
	js	.L4
.L15:
	movq	%r9, %rax
	subq	%r10, %rax
	cmpq	$1, %rax
	jle	.L17
	movq	%r9, %r11
	movq	%r10, %r12
	jmp	.L6
.L16:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	run, .-run
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	call	run
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.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:
```
```c
#include<stdio.h>
#include<stdint.h>
#include<inttypes.h>

typedef int32_t i32;
typedef int64_t i64;

void run (void) {
  i32 n, k;
  scanf ("%" SCNi32 "%" SCNi32, &n, &k);
  i64 l = 0;
  i64 r = 1000000000000000000LL + 1;
  while (r - l > 1) {
    i64 m = (l + r) / 2;
    for (i32 i = 0; i < n && m >= 0; ++i) {
      m--;
      m -= m / k;
    }
    if (m < 0) {
      l = (l + r) / 2;
    } else {
      r = (l + r) / 2;
    }
  }
  printf ("%" PRIi64 "\n", l);
}

int main (void) {
  run();
  return 0;
}
```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
#include<stdint.h>
#include<inttypes.h>

typedef int32_t i32;
typedef int64_t i64;

void run (void) {
  i32 n, k;
  scanf ("%" SCNi32 "%" SCNi32, &n, &k);
  i64 l = 0;
  i64 r = 1000000000000000000LL + 1;
  while (r - l > 1) {
    i64 m = (l + r) / 2;
    for (i32 i = 0; i < n && m >= 0; ++i) {
      m--;
      m -= m / k;
    }
    if (m < 0) {
      l = (l + r) / 2;
    } else {
      r = (l + r) / 2;
    }
  }
  printf ("%" PRIi64 "\n", l);
}

int main (void) {
  run();
  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:

5 2
 7 2
 10 2
 2 2
 1 2
 4 3
 8 2
 6 2
 7 4
 3 3

15
 63
 511
 1
 0
 4
 127
 31
 10
 2

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

typedef int32_t i32;
typedef int64_t i64;

void run (void) {
  i32 n, k;
  scanf ("%" SCNi32 "%" SCNi32, &n, &k);
  i64 l = 0;
  i64 r = 1000000000000000000LL + 1;
  while (r - l > 1) {
    i64 m = (l + r) / 2;
    for (i32 i = 0; i < n && m >= 0; ++i) {
      m--;
      m -= m / k;
    }
    if (m < 0) {
      l = (l + r) / 2;
    } else {
      r = (l + r) / 2;
    }
  }
  printf ("%" PRIi64 "\n", l);
}

int main (void) {
  run();
  return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%i%i"
.LC1:
	.string	"%li\n"
	.text
	.p2align 4
	.globl	run
	.type	run, @function
run:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %r8d
	movslq	4(%rsp), %rdi
	xorl	%r10d, %r10d
	movabsq	$1000000000000000001, %r11
	.p2align 4,,10
	.p2align 3
.L2:
	leaq	(%r11,%r10), %rax
	movq	%rax, %r9
	shrq	$63, %r9
	addq	%rax, %r9
	sarq	%r9
	movq	%r9, %r12
	testl	%r8d, %r8d
	jle	.L9
	cmpq	$-1, %rax
	jl	.L4
	movq	%r9, %rcx
	xorl	%esi, %esi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L14:
	testq	%rcx, %rcx
	js	.L4
.L5:
	subq	$1, %rcx
	addl	$1, %esi
	movq	%rcx, %rax
	cqto
	idivq	%rdi
	subq	%rax, %rcx
	cmpl	%r8d, %esi
	jne	.L14
	testq	%rcx, %rcx
	jns	.L15
.L4:
	movq	%r11, %rax
	subq	%r9, %rax
	cmpq	$1, %rax
	jle	.L7
.L6:
	movq	%r12, %r10
	jmp	.L2
.L17:
	movq	%r10, %r12
.L7:
	xorl	%eax, %eax
	movq	%r12, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L9:
	.cfi_restore_state
	movq	%r9, %rcx
	testq	%rcx, %rcx
	js	.L4
.L15:
	movq	%r9, %rax
	subq	%r10, %rax
	cmpq	$1, %rax
	jle	.L17
	movq	%r9, %r11
	movq	%r10, %r12
	jmp	.L6
.L16:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	run, .-run
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	call	run
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.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:
```

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	"%i%i"
.LC1:
	.string	"%li\n"
	.text
	.p2align 4
	.globl	run
	.type	run, @function
run:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %r8d
	movslq	4(%rsp), %rdi
	xorl	%r10d, %r10d
	movabsq	$1000000000000000001, %r11
	.p2align 4,,10
	.p2align 3
.L2:
	leaq	(%r11,%r10), %rax
	movq	%rax, %r9
	shrq	$63, %r9
	addq	%rax, %r9
	sarq	%r9
	movq	%r9, %r12
	testl	%r8d, %r8d
	jle	.L9
	cmpq	$-1, %rax
	jl	.L4
	movq	%r9, %rcx
	xorl	%esi, %esi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L14:
	testq	%rcx, %rcx
	js	.L4
.L5:
	subq	$1, %rcx
	addl	$1, %esi
	movq	%rcx, %rax
	cqto
	idivq	%rdi
	subq	%rax, %rcx
	cmpl	%r8d, %esi
	jne	.L14
	testq	%rcx, %rcx
	jns	.L15
.L4:
	movq	%r11, %rax
	subq	%r9, %rax
	cmpq	$1, %rax
	jle	.L7
.L6:
	movq	%r12, %r10
	jmp	.L2
.L17:
	movq	%r10, %r12
.L7:
	xorl	%eax, %eax
	movq	%r12, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L9:
	.cfi_restore_state
	movq	%r9, %rcx
	testq	%rcx, %rcx
	js	.L4
.L15:
	movq	%r9, %rax
	subq	%r10, %rax
	cmpq	$1, %rax
	jle	.L17
	movq	%r9, %r11
	movq	%r10, %r12
	jmp	.L6
.L16:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	run, .-run
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	call	run
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.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:
```