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<stdlib.h>
#include <math.h>
int main(void) {
	int N,K,tmp,i;
	double ans;
	scanf("%d %d",&N,&K);
	int count[100000]={};
	for(i=0;i<N;i++){
		tmp=i+1;
		while(1){
			if(tmp>=K){
				break;
			}else{
				tmp=tmp*2;
				count[i]++;
			}
		}
	}
	for(i=0;i<N;i++){
		ans=ans+(1/(double)N)*pow(0.5,count[i]);
	}
	printf("%.12f",ans);
	
	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC3:
	.string	"%.12f"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	-397312(%rsp), %r11
	.cfi_def_cfa 11, 397336
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2744, %rsp
	.cfi_def_cfa_offset 400080
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 400040(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rdx
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	leaq	32(%rsp), %r10
	movl	$400000, %edx
	xorl	%esi, %esi
	movq	%r10, %rdi
	call	memset@PLT
	movl	24(%rsp), %r9d
	testl	%r9d, %r9d
	jle	.L2
	movl	28(%rsp), %ecx
	movq	%rax, %r10
	movq	%rax, %rbx
	movq	%rax, %r8
	xorl	%edi, %edi
	.p2align 4,,10
	.p2align 3
.L5:
	addl	$1, %edi
	cmpl	%ecx, %edi
	jge	.L3
	movl	(%r8), %eax
	movl	%edi, %edx
	addl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L4:
	addl	%edx, %edx
	movl	%eax, %esi
	addl	$1, %eax
	cmpl	%ecx, %edx
	jl	.L4
	movl	%esi, (%r8)
.L3:
	addq	$4, %r8
	cmpl	%r9d, %edi
	jne	.L5
	pxor	%xmm0, %xmm0
	movsd	.LC1(%rip), %xmm1
	leal	-1(%rdi), %eax
	cvtsi2sdl	%edi, %xmm0
	leaq	4(%r10,%rax,4), %rbp
	divsd	%xmm0, %xmm1
	movsd	%xmm1, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L6:
	pxor	%xmm1, %xmm1
	movq	.LC2(%rip), %rax
	addq	$4, %rbx
	cvtsi2sdl	-4(%rbx), %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	mulsd	8(%rsp), %xmm0
	addsd	(%rsp), %xmm0
	movsd	%xmm0, (%rsp)
	cmpq	%rbp, %rbx
	jne	.L6
.L2:
	movsd	(%rsp), %xmm0
	movl	$1, %edi
	movl	$1, %eax
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movq	400040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L13
	addq	$400056, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1072693248
	.align 8
.LC2:
	.long	0
	.long	1071644672
	.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	"%d %d"
.LC3:
	.string	"%.12f"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	-397312(%rsp), %r11
	.cfi_def_cfa 11, 397336
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2744, %rsp
	.cfi_def_cfa_offset 400080
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 400040(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rdx
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	leaq	32(%rsp), %r10
	movl	$400000, %edx
	xorl	%esi, %esi
	movq	%r10, %rdi
	call	memset@PLT
	movl	24(%rsp), %r9d
	testl	%r9d, %r9d
	jle	.L2
	movl	28(%rsp), %ecx
	movq	%rax, %r10
	movq	%rax, %rbx
	movq	%rax, %r8
	xorl	%edi, %edi
	.p2align 4,,10
	.p2align 3
.L5:
	addl	$1, %edi
	cmpl	%ecx, %edi
	jge	.L3
	movl	(%r8), %eax
	movl	%edi, %edx
	addl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L4:
	addl	%edx, %edx
	movl	%eax, %esi
	addl	$1, %eax
	cmpl	%ecx, %edx
	jl	.L4
	movl	%esi, (%r8)
.L3:
	addq	$4, %r8
	cmpl	%r9d, %edi
	jne	.L5
	pxor	%xmm0, %xmm0
	movsd	.LC1(%rip), %xmm1
	leal	-1(%rdi), %eax
	cvtsi2sdl	%edi, %xmm0
	leaq	4(%r10,%rax,4), %rbp
	divsd	%xmm0, %xmm1
	movsd	%xmm1, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L6:
	pxor	%xmm1, %xmm1
	movq	.LC2(%rip), %rax
	addq	$4, %rbx
	cvtsi2sdl	-4(%rbx), %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	mulsd	8(%rsp), %xmm0
	addsd	(%rsp), %xmm0
	movsd	%xmm0, (%rsp)
	cmpq	%rbp, %rbx
	jne	.L6
.L2:
	movsd	(%rsp), %xmm0
	movl	$1, %edi
	movl	$1, %eax
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movq	400040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L13
	addq	$400056, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1072693248
	.align 8
.LC2:
	.long	0
	.long	1071644672
	.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	"%d %d"
.LC3:
	.string	"%.12f"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	-397312(%rsp), %r11
	.cfi_def_cfa 11, 397336
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2744, %rsp
	.cfi_def_cfa_offset 400080
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 400040(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rdx
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	leaq	32(%rsp), %r10
	movl	$400000, %edx
	xorl	%esi, %esi
	movq	%r10, %rdi
	call	memset@PLT
	movl	24(%rsp), %r9d
	testl	%r9d, %r9d
	jle	.L2
	movl	28(%rsp), %ecx
	movq	%rax, %r10
	movq	%rax, %rbx
	movq	%rax, %r8
	xorl	%edi, %edi
	.p2align 4,,10
	.p2align 3
.L5:
	addl	$1, %edi
	cmpl	%ecx, %edi
	jge	.L3
	movl	(%r8), %eax
	movl	%edi, %edx
	addl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L4:
	addl	%edx, %edx
	movl	%eax, %esi
	addl	$1, %eax
	cmpl	%ecx, %edx
	jl	.L4
	movl	%esi, (%r8)
.L3:
	addq	$4, %r8
	cmpl	%r9d, %edi
	jne	.L5
	pxor	%xmm0, %xmm0
	movsd	.LC1(%rip), %xmm1
	leal	-1(%rdi), %eax
	cvtsi2sdl	%edi, %xmm0
	leaq	4(%r10,%rax,4), %rbp
	divsd	%xmm0, %xmm1
	movsd	%xmm1, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L6:
	pxor	%xmm1, %xmm1
	movq	.LC2(%rip), %rax
	addq	$4, %rbx
	cvtsi2sdl	-4(%rbx), %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	mulsd	8(%rsp), %xmm0
	addsd	(%rsp), %xmm0
	movsd	%xmm0, (%rsp)
	cmpq	%rbp, %rbx
	jne	.L6
.L2:
	movsd	(%rsp), %xmm0
	movl	$1, %edi
	movl	$1, %eax
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movq	400040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L13
	addq	$400056, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1072693248
	.align 8
.LC2:
	.long	0
	.long	1071644672
	.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<stdlib.h>
#include <math.h>
int main(void) {
	int N,K,tmp,i;
	double ans;
	scanf("%d %d",&N,&K);
	int count[100000]={};
	for(i=0;i<N;i++){
		tmp=i+1;
		while(1){
			if(tmp>=K){
				break;
			}else{
				tmp=tmp*2;
				count[i]++;
			}
		}
	}
	for(i=0;i<N;i++){
		ans=ans+(1/(double)N)*pow(0.5,count[i]);
	}
	printf("%.12f",ans);
	
	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<stdlib.h>
#include <math.h>
int main(void) {
	int N,K,tmp,i;
	double ans;
	scanf("%d %d",&N,&K);
	int count[100000]={};
	for(i=0;i<N;i++){
		tmp=i+1;
		while(1){
			if(tmp>=K){
				break;
			}else{
				tmp=tmp*2;
				count[i]++;
			}
		}
	}
	for(i=0;i<N;i++){
		ans=ans+(1/(double)N)*pow(0.5,count[i]);
	}
	printf("%.12f",ans);
	
	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:

3 4
 100000 8
 3 7
 100000 7
 6 7
 100100 7
 4 7
 100100 6

0.416666666667 0.999956249998 0.208333333333 0.999961249998 0.354166666667 inf 0.281250000000 inf
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<stdlib.h>
#include <math.h>
int main(void) {
	int N,K,tmp,i;
	double ans;
	scanf("%d %d",&N,&K);
	int count[100000]={};
	for(i=0;i<N;i++){
		tmp=i+1;
		while(1){
			if(tmp>=K){
				break;
			}else{
				tmp=tmp*2;
				count[i]++;
			}
		}
	}
	for(i=0;i<N;i++){
		ans=ans+(1/(double)N)*pow(0.5,count[i]);
	}
	printf("%.12f",ans);
	
	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC3:
	.string	"%.12f"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	-397312(%rsp), %r11
	.cfi_def_cfa 11, 397336
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2744, %rsp
	.cfi_def_cfa_offset 400080
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 400040(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rdx
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	leaq	32(%rsp), %r10
	movl	$400000, %edx
	xorl	%esi, %esi
	movq	%r10, %rdi
	call	memset@PLT
	movl	24(%rsp), %r9d
	testl	%r9d, %r9d
	jle	.L2
	movl	28(%rsp), %ecx
	movq	%rax, %r10
	movq	%rax, %rbx
	movq	%rax, %r8
	xorl	%edi, %edi
	.p2align 4,,10
	.p2align 3
.L5:
	addl	$1, %edi
	cmpl	%ecx, %edi
	jge	.L3
	movl	(%r8), %eax
	movl	%edi, %edx
	addl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L4:
	addl	%edx, %edx
	movl	%eax, %esi
	addl	$1, %eax
	cmpl	%ecx, %edx
	jl	.L4
	movl	%esi, (%r8)
.L3:
	addq	$4, %r8
	cmpl	%r9d, %edi
	jne	.L5
	pxor	%xmm0, %xmm0
	movsd	.LC1(%rip), %xmm1
	leal	-1(%rdi), %eax
	cvtsi2sdl	%edi, %xmm0
	leaq	4(%r10,%rax,4), %rbp
	divsd	%xmm0, %xmm1
	movsd	%xmm1, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L6:
	pxor	%xmm1, %xmm1
	movq	.LC2(%rip), %rax
	addq	$4, %rbx
	cvtsi2sdl	-4(%rbx), %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	mulsd	8(%rsp), %xmm0
	addsd	(%rsp), %xmm0
	movsd	%xmm0, (%rsp)
	cmpq	%rbp, %rbx
	jne	.L6
.L2:
	movsd	(%rsp), %xmm0
	movl	$1, %edi
	movl	$1, %eax
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movq	400040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L13
	addq	$400056, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1072693248
	.align 8
.LC2:
	.long	0
	.long	1071644672
	.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	"%d %d"
.LC3:
	.string	"%.12f"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	-397312(%rsp), %r11
	.cfi_def_cfa 11, 397336
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2744, %rsp
	.cfi_def_cfa_offset 400080
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 400040(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rdx
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	leaq	32(%rsp), %r10
	movl	$400000, %edx
	xorl	%esi, %esi
	movq	%r10, %rdi
	call	memset@PLT
	movl	24(%rsp), %r9d
	testl	%r9d, %r9d
	jle	.L2
	movl	28(%rsp), %ecx
	movq	%rax, %r10
	movq	%rax, %rbx
	movq	%rax, %r8
	xorl	%edi, %edi
	.p2align 4,,10
	.p2align 3
.L5:
	addl	$1, %edi
	cmpl	%ecx, %edi
	jge	.L3
	movl	(%r8), %eax
	movl	%edi, %edx
	addl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L4:
	addl	%edx, %edx
	movl	%eax, %esi
	addl	$1, %eax
	cmpl	%ecx, %edx
	jl	.L4
	movl	%esi, (%r8)
.L3:
	addq	$4, %r8
	cmpl	%r9d, %edi
	jne	.L5
	pxor	%xmm0, %xmm0
	movsd	.LC1(%rip), %xmm1
	leal	-1(%rdi), %eax
	cvtsi2sdl	%edi, %xmm0
	leaq	4(%r10,%rax,4), %rbp
	divsd	%xmm0, %xmm1
	movsd	%xmm1, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L6:
	pxor	%xmm1, %xmm1
	movq	.LC2(%rip), %rax
	addq	$4, %rbx
	cvtsi2sdl	-4(%rbx), %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	mulsd	8(%rsp), %xmm0
	addsd	(%rsp), %xmm0
	movsd	%xmm0, (%rsp)
	cmpq	%rbp, %rbx
	jne	.L6
.L2:
	movsd	(%rsp), %xmm0
	movl	$1, %edi
	movl	$1, %eax
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movq	400040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L13
	addq	$400056, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1072693248
	.align 8
.LC2:
	.long	0
	.long	1071644672
	.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:
```