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

```c
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void){
	int n, k, i;
	scanf("%d%d", &n, &k);
	double ans;
	for(i=1; i<=n; i++){
		int j=i;
		int f=1;
		while(j<k){j<<=1; f<<=1;}
		ans += 1/((double)f);
	}
	printf("%.9lf\n", ans/n);
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC2:
	.string	"%.9lf\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -28(%rbp)
	jmp	.L2
.L5:
	movl	-28(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	$1, -20(%rbp)
	jmp	.L3
.L4:
	sall	-24(%rbp)
	sall	-20(%rbp)
.L3:
	movl	-32(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L4
	pxor	%xmm1, %xmm1
	cvtsi2sdl	-20(%rbp), %xmm1
	movsd	.LC1(%rip), %xmm0
	divsd	%xmm1, %xmm0
	movsd	-16(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -16(%rbp)
	addl	$1, -28(%rbp)
.L2:
	movl	-36(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jle	.L5
	movl	-36(%rbp), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movsd	-16(%rbp), %xmm0
	divsd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$1, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1072693248
	.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"
.LC2:
	.string	"%.9lf\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	leaq	.LC0(%rip), %rdi
	movsd	%xmm0, 8(%rsp)
	leaq	20(%rsp), %rdx
	leaq	16(%rsp), %rsi
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %edi
	movsd	8(%rsp), %xmm0
	testl	%edi, %edi
	jle	.L2
	movl	20(%rsp), %ecx
	cmpl	$1, %ecx
	jg	.L3
	movsd	.LC1(%rip), %xmm1
	movl	$1, %esi
	.p2align 4,,10
	.p2align 3
.L8:
	addl	$1, %esi
	addsd	%xmm1, %xmm0
	cmpl	%esi, %edi
	jge	.L8
.L2:
	pxor	%xmm1, %xmm1
	leaq	.LC2(%rip), %rsi
	movl	$1, %eax
	cvtsi2sdl	%edi, %xmm1
	movl	$1, %edi
	divsd	%xmm1, %xmm0
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	xorl	%eax, %eax
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	leal	1(%rdi), %r8d
	movsd	.LC1(%rip), %xmm1
	movl	$1, %esi
	cmpl	%ecx, %r8d
	cmovg	%ecx, %r8d
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%esi, %eax
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L5:
	addl	%eax, %eax
	addl	%edx, %edx
	cmpl	%ecx, %eax
	jl	.L5
	pxor	%xmm3, %xmm3
	movapd	%xmm1, %xmm2
	addl	$1, %esi
	cvtsi2sdl	%edx, %xmm3
	divsd	%xmm3, %xmm2
	addsd	%xmm2, %xmm0
	cmpl	%r8d, %esi
	jl	.L6
	cmpl	%esi, %edi
	jge	.L8
	jmp	.L2
.L17:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1072693248
	.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"
.LC2:
	.string	"%.9lf\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	leaq	.LC0(%rip), %rdi
	movsd	%xmm0, 8(%rsp)
	leaq	20(%rsp), %rdx
	leaq	16(%rsp), %rsi
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %edi
	movsd	8(%rsp), %xmm0
	testl	%edi, %edi
	jle	.L2
	movl	20(%rsp), %ecx
	cmpl	$1, %ecx
	jg	.L3
	movsd	.LC1(%rip), %xmm1
	movl	$1, %esi
	.p2align 4,,10
	.p2align 3
.L8:
	addl	$1, %esi
	addsd	%xmm1, %xmm0
	cmpl	%esi, %edi
	jge	.L8
.L2:
	pxor	%xmm1, %xmm1
	leaq	.LC2(%rip), %rsi
	movl	$1, %eax
	cvtsi2sdl	%edi, %xmm1
	movl	$1, %edi
	divsd	%xmm1, %xmm0
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	xorl	%eax, %eax
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	leal	1(%rdi), %r8d
	movsd	.LC1(%rip), %xmm1
	movl	$1, %esi
	cmpl	%ecx, %r8d
	cmovg	%ecx, %r8d
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%esi, %eax
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L5:
	addl	%eax, %eax
	addl	%edx, %edx
	cmpl	%ecx, %eax
	jl	.L5
	pxor	%xmm3, %xmm3
	movapd	%xmm1, %xmm2
	addl	$1, %esi
	cvtsi2sdl	%edx, %xmm3
	divsd	%xmm3, %xmm2
	addsd	%xmm2, %xmm0
	cmpl	%r8d, %esi
	jl	.L6
	cmpl	%esi, %edi
	jge	.L8
	jmp	.L2
.L17:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1072693248
	.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 <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void){
	int n, k, i;
	scanf("%d%d", &n, &k);
	double ans;
	for(i=1; i<=n; i++){
		int j=i;
		int f=1;
		while(j<k){j<<=1; f<<=1;}
		ans += 1/((double)f);
	}
	printf("%.9lf\n", ans/n);
}

3 4
 100000 8
 3 7
 100000 7
 6 7
 100100 7
 4 7
 100100 6
 110100 7
 111100 7

0.416666667
 0.999956250
 0.208333333
 0.999961250
 0.354166667
 0.999961289
 0.281250000
 0.999968781
 0.999964805
 0.999965122

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

```c
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void){
	int n, k, i;
	scanf("%d%d", &n, &k);
	double ans;
	for(i=1; i<=n; i++){
		int j=i;
		int f=1;
		while(j<k){j<<=1; f<<=1;}
		ans += 1/((double)f);
	}
	printf("%.9lf\n", ans/n);
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC2:
	.string	"%.9lf\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -28(%rbp)
	jmp	.L2
.L5:
	movl	-28(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	$1, -20(%rbp)
	jmp	.L3
.L4:
	sall	-24(%rbp)
	sall	-20(%rbp)
.L3:
	movl	-32(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L4
	pxor	%xmm1, %xmm1
	cvtsi2sdl	-20(%rbp), %xmm1
	movsd	.LC1(%rip), %xmm0
	divsd	%xmm1, %xmm0
	movsd	-16(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -16(%rbp)
	addl	$1, -28(%rbp)
.L2:
	movl	-36(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jle	.L5
	movl	-36(%rbp), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movsd	-16(%rbp), %xmm0
	divsd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$1, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1072693248
	.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
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC2:
	.string	"%.9lf\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -28(%rbp)
	jmp	.L2
.L5:
	movl	-28(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	$1, -20(%rbp)
	jmp	.L3
.L4:
	sall	-24(%rbp)
	sall	-20(%rbp)
.L3:
	movl	-32(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L4
	pxor	%xmm1, %xmm1
	cvtsi2sdl	-20(%rbp), %xmm1
	movsd	.LC1(%rip), %xmm0
	divsd	%xmm1, %xmm0
	movsd	-16(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -16(%rbp)
	addl	$1, -28(%rbp)
.L2:
	movl	-36(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jle	.L5
	movl	-36(%rbp), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movsd	-16(%rbp), %xmm0
	divsd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$1, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1072693248
	.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:
