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, K, A[200200];
int main(){
	scanf("%d%d", &N, &K);
	for(int i=0; i<N; i++){
		scanf("%d", A+i);
	}
	int l=0, r=1<<30;
	while(r-l > 1){
		int mid = (l+r)/2;
		int cnt = 0;
		for(int i=0; i<N; i++){
			cnt += (A[i]+mid-1)/mid-1;
		}
		if(cnt > K)l = mid;
		else r = mid;
	}
	printf("%d\n", r);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	K
	.align 4
	.type	K, @object
	.size	K, 4
K:
	.zero	4
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 800800
A:
	.zero	800800
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.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	$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, -24(%rbp)
	jmp	.L2
.L3:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -24(%rbp)
.L2:
	movl	N(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L3
	movl	$0, -20(%rbp)
	movl	$1073741824, -16(%rbp)
	jmp	.L4
.L8:
	movl	-20(%rbp), %edx
	movl	-16(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	$0, -12(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L5
.L6:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	subl	$1, %eax
	cltd
	idivl	-4(%rbp)
	subl	$1, %eax
	addl	%eax, -12(%rbp)
	addl	$1, -8(%rbp)
.L5:
	movl	N(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L6
	movl	K(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L7
	movl	-4(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L4
.L7:
	movl	-4(%rbp), %eax
	movl	%eax, -16(%rbp)
.L4:
	movl	-16(%rbp), %eax
	subl	-20(%rbp), %eax
	cmpl	$1, %eax
	jg	.L8
	movl	-16(%rbp), %eax
	movl	%eax, %esi
	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
.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"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	K(%rip), %rdx
	leaq	N(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	A(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	call	__isoc99_scanf@PLT
	movl	N(%rip), %r11d
	testl	%r11d, %r11d
	jle	.L2
	movq	%rbx, %r12
	xorl	%ebp, %ebp
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	N(%rip), %r11d
	addq	$4, %r12
	cmpl	%ebp, %r11d
	jg	.L3
.L2:
	leal	-1(%r11), %eax
	leaq	4+A(%rip), %rdx
	movl	$1073741824, %r8d
	xorl	%r9d, %r9d
	leaq	(%rdx,%rax,4), %rdi
	movl	%r8d, %eax
	movl	K(%rip), %r10d
	subl	%r9d, %eax
	cmpl	$1, %eax
	jle	.L16
	.p2align 4,,10
	.p2align 3
.L8:
	leal	(%r9,%r8), %eax
	movl	%eax, %esi
	shrl	$31, %esi
	addl	%eax, %esi
	sarl	%esi
	testl	%r11d, %r11d
	jle	.L9
	movq	%rbx, %rcx
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L6:
	movl	(%rcx), %eax
	addq	$4, %rcx
	addl	%esi, %eax
	subl	$1, %eax
	cltd
	idivl	%esi
	leal	-1(%rbp,%rax), %ebp
	cmpq	%rcx, %rdi
	jne	.L6
	cmpl	%ebp, %r10d
	cmovge	%esi, %r8d
	cmovl	%esi, %r9d
.L17:
	movl	%r8d, %eax
	subl	%r9d, %eax
	cmpl	$1, %eax
	jg	.L8
.L16:
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	xorl	%ebp, %ebp
	cmpl	%ebp, %r10d
	cmovge	%esi, %r8d
	cmovl	%esi, %r9d
	jmp	.L17
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	A
	.bss
	.align 32
	.type	A, @object
	.size	A, 800800
A:
	.zero	800800
	.globl	K
	.align 4
	.type	K, @object
	.size	K, 4
K:
	.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"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	K(%rip), %rdx
	leaq	N(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	A(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	call	__isoc99_scanf@PLT
	movl	N(%rip), %r11d
	testl	%r11d, %r11d
	jle	.L2
	movq	%rbx, %r12
	xorl	%ebp, %ebp
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	N(%rip), %r11d
	addq	$4, %r12
	cmpl	%ebp, %r11d
	jg	.L3
.L2:
	leal	-1(%r11), %eax
	leaq	4+A(%rip), %rdx
	movl	$1073741824, %r8d
	xorl	%r9d, %r9d
	leaq	(%rdx,%rax,4), %rdi
	movl	%r8d, %eax
	movl	K(%rip), %r10d
	subl	%r9d, %eax
	cmpl	$1, %eax
	jle	.L16
	.p2align 4,,10
	.p2align 3
.L8:
	leal	(%r9,%r8), %eax
	movl	%eax, %esi
	shrl	$31, %esi
	addl	%eax, %esi
	sarl	%esi
	testl	%r11d, %r11d
	jle	.L9
	movq	%rbx, %rcx
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L6:
	movl	(%rcx), %eax
	addq	$4, %rcx
	addl	%esi, %eax
	subl	$1, %eax
	cltd
	idivl	%esi
	leal	-1(%rbp,%rax), %ebp
	cmpq	%rcx, %rdi
	jne	.L6
	cmpl	%ebp, %r10d
	cmovge	%esi, %r8d
	cmovl	%esi, %r9d
.L17:
	movl	%r8d, %eax
	subl	%r9d, %eax
	cmpl	$1, %eax
	jg	.L8
.L16:
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	xorl	%ebp, %ebp
	cmpl	%ebp, %r10d
	cmovge	%esi, %r8d
	cmovl	%esi, %r9d
	jmp	.L17
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	A
	.bss
	.align 32
	.type	A, @object
	.size	A, 800800
A:
	.zero	800800
	.globl	K
	.align 4
	.type	K, @object
	.size	K, 4
K:
	.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, K, A[200200];
int main(){
	scanf("%d%d", &N, &K);
	for(int i=0; i<N; i++){
		scanf("%d", A+i);
	}
	int l=0, r=1<<30;
	while(r-l > 1){
		int mid = (l+r)/2;
		int cnt = 0;
		for(int i=0; i<N; i++){
			cnt += (A[i]+mid-1)/mid-1;
		}
		if(cnt > K)l = mid;
		else r = mid;
	}
	printf("%d\n", r);
}
2 6
7 9
 10 10
158260522 877914575 938084412 24979445 861648772 623690081 433933447 476190629 262703497 211047202
 2 6
1 9
 3 0
3 1 5
 10 10
158260522 877914575 602436426 24979445 861648772 623690081 433933447 476190629 262703497 180972685
 10 1
158260522 877914575 938084412 24979445 861648772 623690081 433933447 476190629 262703497 211047202
 3 2
1 11
 10 10
158260522 877914575 406320545 24979445 861648772 623690081 433933447 476190629 262703497 211047202
 2 6
1 6
 2 1
1 11

3
 311845041
 2
 5
 292638192
 877914575
 3
 287216258
 1
 6

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, K, A[200200];
int main(){
	scanf("%d%d", &N, &K);
	for(int i=0; i<N; i++){
		scanf("%d", A+i);
	}
	int l=0, r=1<<30;
	while(r-l > 1){
		int mid = (l+r)/2;
		int cnt = 0;
		for(int i=0; i<N; i++){
			cnt += (A[i]+mid-1)/mid-1;
		}
		if(cnt > K)l = mid;
		else r = mid;
	}
	printf("%d\n", r);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	K
	.align 4
	.type	K, @object
	.size	K, 4
K:
	.zero	4
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 800800
A:
	.zero	800800
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.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	$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, -24(%rbp)
	jmp	.L2
.L3:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -24(%rbp)
.L2:
	movl	N(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L3
	movl	$0, -20(%rbp)
	movl	$1073741824, -16(%rbp)
	jmp	.L4
.L8:
	movl	-20(%rbp), %edx
	movl	-16(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	$0, -12(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L5
.L6:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	subl	$1, %eax
	cltd
	idivl	-4(%rbp)
	subl	$1, %eax
	addl	%eax, -12(%rbp)
	addl	$1, -8(%rbp)
.L5:
	movl	N(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L6
	movl	K(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L7
	movl	-4(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L4
.L7:
	movl	-4(%rbp), %eax
	movl	%eax, -16(%rbp)
.L4:
	movl	-16(%rbp), %eax
	subl	-20(%rbp), %eax
	cmpl	$1, %eax
	jg	.L8
	movl	-16(%rbp), %eax
	movl	%eax, %esi
	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
.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	K
	.align 4
	.type	K, @object
	.size	K, 4
K:
	.zero	4
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 800800
A:
	.zero	800800
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.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	$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, -24(%rbp)
	jmp	.L2
.L3:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -24(%rbp)
.L2:
	movl	N(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L3
	movl	$0, -20(%rbp)
	movl	$1073741824, -16(%rbp)
	jmp	.L4
.L8:
	movl	-20(%rbp), %edx
	movl	-16(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	$0, -12(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L5
.L6:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	subl	$1, %eax
	cltd
	idivl	-4(%rbp)
	subl	$1, %eax
	addl	%eax, -12(%rbp)
	addl	$1, -8(%rbp)
.L5:
	movl	N(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L6
	movl	K(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L7
	movl	-4(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L4
.L7:
	movl	-4(%rbp), %eax
	movl	%eax, -16(%rbp)
.L4:
	movl	-16(%rbp), %eax
	subl	-20(%rbp), %eax
	cmpl	$1, %eax
	jg	.L8
	movl	-16(%rbp), %eax
	movl	%eax, %esi
	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
.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:
