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>
#include <time.h>
#include <math.h>
#include <limits.h>
#include <assert.h>
#define FOR(i,a,n) for(i=(a);i<(n);i++)
#define swap(type,a,b) do{type t=a;a=b;b=t;}while(0)
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define ll long long
#define INF 100000000
#define MOD 1000000007
#define SIZE 100005
#define LOCAL
#ifdef LOCAL
    #define DEBUG(...) printf(" "__VA_ARGS__)
#else
    #define DEBUG(...)
#endif /* LOCAL */
int comp(const void* a,const void* b){
	return *(int*)a-*(int*)b;
}
ll w[100000],d[100000];
int n,k;
int check(ll x){
	int i;
	ll cnt=0;
	FOR(i,0,n){
		if(x<w[i]) continue;
		cnt+=((x-w[i])/d[i]+1LL);
		if(cnt>=k) return 1;
	}
	return 0;
}
int main(void)
{
	int i;
	ll left,right,mid;
	scanf("%d%d",&n,&k);
	FOR(i,0,n) scanf("%lld%lld",w+i,d+i);
	left=0,right=1000000000000000000000LL;
	while(right-left>1){
		mid=(right+left)/2;
		if(check(mid)) right=mid;
		else left=mid;
	}
	printf("%lld\n",right);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	comp
	.type	comp, @function
comp:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	comp, .-comp
	.globl	w
	.bss
	.align 32
	.type	w, @object
	.size	w, 800000
w:
	.zero	800000
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 800000
d:
	.zero	800000
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.text
	.globl	check
	.type	check, @function
check:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	$0, -8(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L4
.L8:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w(%rip), %rax
	movq	(%rdx,%rax), %rax
	cmpq	%rax, -24(%rbp)
	jl	.L9
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-24(%rbp), %rax
	subq	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	d(%rip), %rdx
	movq	(%rcx,%rdx), %rsi
	cqto
	idivq	%rsi
	addq	$1, %rax
	addq	%rax, -8(%rbp)
	movl	k(%rip), %eax
	cltq
	cmpq	%rax, -8(%rbp)
	jl	.L6
	movl	$1, %eax
	jmp	.L7
.L9:
	nop
.L6:
	addl	$1, -12(%rbp)
.L4:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L8
	movl	$0, %eax
.L7:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	check, .-check
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%lld%lld"
.LC2:
	.string	"%lld\n"
	.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	$32, %rsp
	leaq	k(%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, -28(%rbp)
	jmp	.L11
.L12:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	d(%rip), %rax
	addq	%rax, %rdx
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	w(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -28(%rbp)
.L11:
	movl	n(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L12
	movq	$0, -24(%rbp)
	movabsq	$3875820019684212736, %rax
	movq	%rax, -16(%rbp)
	jmp	.L13
.L15:
	movq	-16(%rbp), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	%rax, %rdi
	call	check
	testl	%eax, %eax
	je	.L14
	movq	-8(%rbp), %rax
	movq	%rax, -16(%rbp)
	jmp	.L13
.L14:
	movq	-8(%rbp), %rax
	movq	%rax, -24(%rbp)
.L13:
	movq	-16(%rbp), %rax
	subq	-24(%rbp), %rax
	cmpq	$1, %rax
	jg	.L15
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	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	comp
	.type	comp, @function
comp:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	comp, .-comp
	.p2align 4
	.globl	check
	.type	check, @function
check:
.LFB52:
	.cfi_startproc
	endbr64
	movslq	n(%rip), %r9
	testl	%r9d, %r9d
	jle	.L7
	movslq	k(%rip), %r11
	xorl	%ecx, %ecx
	xorl	%esi, %esi
	leaq	w(%rip), %r10
	leaq	d(%rip), %r8
	.p2align 4,,10
	.p2align 3
.L6:
	movq	(%r10,%rcx,8), %rdx
	cmpq	%rdi, %rdx
	jg	.L5
	movq	%rdi, %rax
	subq	%rdx, %rax
	cqto
	idivq	(%r8,%rcx,8)
	leaq	1(%rsi,%rax), %rsi
	cmpq	%rsi, %r11
	jle	.L8
.L5:
	addq	$1, %rcx
	cmpq	%rcx, %r9
	jne	.L6
.L7:
	xorl	%eax, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	movl	$1, %eax
	ret
	.cfi_endproc
.LFE52:
	.size	check, .-check
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%lld%lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	k(%rip), %rdx
	leaq	n(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	__isoc99_scanf@PLT
	movl	n(%rip), %ebp
	testl	%ebp, %ebp
	jle	.L11
	leaq	w(%rip), %r12
	xorl	%ebx, %ebx
	leaq	d(%rip), %r14
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L12:
	leaq	(%r14,%rbx,8), %rdx
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %ebp
	addq	$1, %rbx
	addq	$8, %r12
	cmpl	%ebx, %ebp
	jg	.L12
.L11:
	movslq	k(%rip), %r11
	xorl	%ebx, %ebx
	movslq	%ebp, %r10
	leaq	w(%rip), %r9
	movabsq	$3875820019684212736, %r12
	leaq	d(%rip), %r8
	.p2align 4,,10
	.p2align 3
.L13:
	leaq	(%rbx,%r12), %rax
	movq	%rax, %rsi
	shrq	$63, %rsi
	addq	%rax, %rsi
	sarq	%rsi
	testl	%ebp, %ebp
	jle	.L14
	xorl	%ecx, %ecx
	xorl	%edi, %edi
	.p2align 4,,10
	.p2align 3
.L17:
	movq	(%r9,%rcx,8), %rdx
	cmpq	%rdx, %rsi
	jl	.L15
	movq	%rsi, %rax
	subq	%rdx, %rax
	cqto
	idivq	(%r8,%rcx,8)
	leaq	1(%rdi,%rax), %rdi
	cmpq	%r11, %rdi
	jge	.L16
.L15:
	addq	$1, %rcx
	cmpq	%rcx, %r10
	jne	.L17
.L14:
	movq	%r12, %rax
	subq	%rsi, %rax
	cmpq	$1, %rax
	jle	.L19
	movq	%rsi, %rbx
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L16:
	movq	%rsi, %rax
	movq	%rsi, %r12
	subq	%rbx, %rax
	cmpq	$1, %rax
	jg	.L13
.L19:
	movq	%r12, %rdx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	popq	%rbx
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE53:
	.size	main, .-main
	.globl	k
	.bss
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 800000
d:
	.zero	800000
	.globl	w
	.align 32
	.type	w, @object
	.size	w, 800000
w:
	.zero	800000
	.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	comp
	.type	comp, @function
comp:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	comp, .-comp
	.p2align 4
	.globl	check
	.type	check, @function
check:
.LFB52:
	.cfi_startproc
	endbr64
	movslq	n(%rip), %r9
	testl	%r9d, %r9d
	jle	.L7
	movslq	k(%rip), %r11
	xorl	%ecx, %ecx
	xorl	%esi, %esi
	leaq	w(%rip), %r10
	leaq	d(%rip), %r8
	.p2align 4,,10
	.p2align 3
.L6:
	movq	(%r10,%rcx,8), %rdx
	cmpq	%rdi, %rdx
	jg	.L5
	movq	%rdi, %rax
	subq	%rdx, %rax
	cqto
	idivq	(%r8,%rcx,8)
	leaq	1(%rsi,%rax), %rsi
	cmpq	%rsi, %r11
	jle	.L8
.L5:
	addq	$1, %rcx
	cmpq	%rcx, %r9
	jne	.L6
.L7:
	xorl	%eax, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	movl	$1, %eax
	ret
	.cfi_endproc
.LFE52:
	.size	check, .-check
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%lld%lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	k(%rip), %rdx
	leaq	n(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	__isoc99_scanf@PLT
	movl	n(%rip), %ebp
	testl	%ebp, %ebp
	jle	.L11
	leaq	w(%rip), %r12
	xorl	%ebx, %ebx
	leaq	d(%rip), %r14
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L12:
	leaq	(%r14,%rbx,8), %rdx
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %ebp
	addq	$1, %rbx
	addq	$8, %r12
	cmpl	%ebx, %ebp
	jg	.L12
.L11:
	movslq	k(%rip), %r11
	xorl	%ebx, %ebx
	movslq	%ebp, %r10
	leaq	w(%rip), %r9
	movabsq	$3875820019684212736, %r12
	leaq	d(%rip), %r8
	.p2align 4,,10
	.p2align 3
.L13:
	leaq	(%rbx,%r12), %rax
	movq	%rax, %rsi
	shrq	$63, %rsi
	addq	%rax, %rsi
	sarq	%rsi
	testl	%ebp, %ebp
	jle	.L14
	xorl	%ecx, %ecx
	xorl	%edi, %edi
	.p2align 4,,10
	.p2align 3
.L17:
	movq	(%r9,%rcx,8), %rdx
	cmpq	%rdx, %rsi
	jl	.L15
	movq	%rsi, %rax
	subq	%rdx, %rax
	cqto
	idivq	(%r8,%rcx,8)
	leaq	1(%rdi,%rax), %rdi
	cmpq	%r11, %rdi
	jge	.L16
.L15:
	addq	$1, %rcx
	cmpq	%rcx, %r10
	jne	.L17
.L14:
	movq	%r12, %rax
	subq	%rsi, %rax
	cmpq	$1, %rax
	jle	.L19
	movq	%rsi, %rbx
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L16:
	movq	%rsi, %rax
	movq	%rsi, %r12
	subq	%rbx, %rax
	cmpq	$1, %rax
	jg	.L13
.L19:
	movq	%r12, %rdx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	popq	%rbx
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE53:
	.size	main, .-main
	.globl	k
	.bss
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 800000
d:
	.zero	800000
	.globl	w
	.align 32
	.type	w, @object
	.size	w, 800000
w:
	.zero	800000
	.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>
#include <time.h>
#include <math.h>
#include <limits.h>
#include <assert.h>
#define FOR(i,a,n) for(i=(a);i<(n);i++)
#define swap(type,a,b) do{type t=a;a=b;b=t;}while(0)
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define ll long long
#define INF 100000000
#define MOD 1000000007
#define SIZE 100005
#define LOCAL
#ifdef LOCAL
    #define DEBUG(...) printf(" "__VA_ARGS__)
#else
    #define DEBUG(...)
#endif /* LOCAL */
int comp(const void* a,const void* b){
	return *(int*)a-*(int*)b;
}
ll w[100000],d[100000];
int n,k;
int check(ll x){
	int i;
	ll cnt=0;
	FOR(i,0,n){
		if(x<w[i]) continue;
		cnt+=((x-w[i])/d[i]+1LL);
		if(cnt>=k) return 1;
	}
	return 0;
}
int main(void)
{
	int i;
	ll left,right,mid;
	scanf("%d%d",&n,&k);
	FOR(i,0,n) scanf("%lld%lld",w+i,d+i);
	left=0,right=1000000000000000000000LL;
	while(right-left>1){
		mid=(right+left)/2;
		if(check(mid)) right=mid;
		else left=mid;
	}
	printf("%lld\n",right);
	return 0;
}
2 5
20 10
25 15
 3 9
16 10
10 10
10 10
 2 5
20 16
25 15
 2 5
20 13
25 15
 2 6
20 10
43 15
 3 9
10 10
7 10
10 10
 3 9
10 10
7 10
10 18
 2 5
20 11
25 10
 3 9
7 10
13 10
10 10
 2 5
38 9
25 15

40
 36
 52
 46
 58
 30
 37
 42
 33
 55

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>
#include <time.h>
#include <math.h>
#include <limits.h>
#include <assert.h>
#define FOR(i,a,n) for(i=(a);i<(n);i++)
#define swap(type,a,b) do{type t=a;a=b;b=t;}while(0)
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define ll long long
#define INF 100000000
#define MOD 1000000007
#define SIZE 100005
#define LOCAL
#ifdef LOCAL
    #define DEBUG(...) printf(" "__VA_ARGS__)
#else
    #define DEBUG(...)
#endif /* LOCAL */
int comp(const void* a,const void* b){
	return *(int*)a-*(int*)b;
}
ll w[100000],d[100000];
int n,k;
int check(ll x){
	int i;
	ll cnt=0;
	FOR(i,0,n){
		if(x<w[i]) continue;
		cnt+=((x-w[i])/d[i]+1LL);
		if(cnt>=k) return 1;
	}
	return 0;
}
int main(void)
{
	int i;
	ll left,right,mid;
	scanf("%d%d",&n,&k);
	FOR(i,0,n) scanf("%lld%lld",w+i,d+i);
	left=0,right=1000000000000000000000LL;
	while(right-left>1){
		mid=(right+left)/2;
		if(check(mid)) right=mid;
		else left=mid;
	}
	printf("%lld\n",right);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	comp
	.type	comp, @function
comp:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	comp, .-comp
	.globl	w
	.bss
	.align 32
	.type	w, @object
	.size	w, 800000
w:
	.zero	800000
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 800000
d:
	.zero	800000
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.text
	.globl	check
	.type	check, @function
check:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	$0, -8(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L4
.L8:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w(%rip), %rax
	movq	(%rdx,%rax), %rax
	cmpq	%rax, -24(%rbp)
	jl	.L9
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-24(%rbp), %rax
	subq	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	d(%rip), %rdx
	movq	(%rcx,%rdx), %rsi
	cqto
	idivq	%rsi
	addq	$1, %rax
	addq	%rax, -8(%rbp)
	movl	k(%rip), %eax
	cltq
	cmpq	%rax, -8(%rbp)
	jl	.L6
	movl	$1, %eax
	jmp	.L7
.L9:
	nop
.L6:
	addl	$1, -12(%rbp)
.L4:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L8
	movl	$0, %eax
.L7:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	check, .-check
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%lld%lld"
.LC2:
	.string	"%lld\n"
	.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	$32, %rsp
	leaq	k(%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, -28(%rbp)
	jmp	.L11
.L12:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	d(%rip), %rax
	addq	%rax, %rdx
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	w(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -28(%rbp)
.L11:
	movl	n(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L12
	movq	$0, -24(%rbp)
	movabsq	$3875820019684212736, %rax
	movq	%rax, -16(%rbp)
	jmp	.L13
.L15:
	movq	-16(%rbp), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	%rax, %rdi
	call	check
	testl	%eax, %eax
	je	.L14
	movq	-8(%rbp), %rax
	movq	%rax, -16(%rbp)
	jmp	.L13
.L14:
	movq	-8(%rbp), %rax
	movq	%rax, -24(%rbp)
.L13:
	movq	-16(%rbp), %rax
	subq	-24(%rbp), %rax
	cmpq	$1, %rax
	jg	.L15
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	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	comp
	.type	comp, @function
comp:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	comp, .-comp
	.globl	w
	.bss
	.align 32
	.type	w, @object
	.size	w, 800000
w:
	.zero	800000
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 800000
d:
	.zero	800000
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.text
	.globl	check
	.type	check, @function
check:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	$0, -8(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L4
.L8:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w(%rip), %rax
	movq	(%rdx,%rax), %rax
	cmpq	%rax, -24(%rbp)
	jl	.L9
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-24(%rbp), %rax
	subq	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	d(%rip), %rdx
	movq	(%rcx,%rdx), %rsi
	cqto
	idivq	%rsi
	addq	$1, %rax
	addq	%rax, -8(%rbp)
	movl	k(%rip), %eax
	cltq
	cmpq	%rax, -8(%rbp)
	jl	.L6
	movl	$1, %eax
	jmp	.L7
.L9:
	nop
.L6:
	addl	$1, -12(%rbp)
.L4:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L8
	movl	$0, %eax
.L7:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	check, .-check
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%lld%lld"
.LC2:
	.string	"%lld\n"
	.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	$32, %rsp
	leaq	k(%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, -28(%rbp)
	jmp	.L11
.L12:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	d(%rip), %rax
	addq	%rax, %rdx
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	w(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -28(%rbp)
.L11:
	movl	n(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L12
	movq	$0, -24(%rbp)
	movabsq	$3875820019684212736, %rax
	movq	%rax, -16(%rbp)
	jmp	.L13
.L15:
	movq	-16(%rbp), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	%rax, %rdi
	call	check
	testl	%eax, %eax
	je	.L14
	movq	-8(%rbp), %rax
	movq	%rax, -16(%rbp)
	jmp	.L13
.L14:
	movq	-8(%rbp), %rax
	movq	%rax, -24(%rbp)
.L13:
	movq	-16(%rbp), %rax
	subq	-24(%rbp), %rax
	cmpq	$1, %rax
	jg	.L15
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	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:
