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 main(void){
  int a,b;
  scanf("%d %d",&a,&b);
  double ret=0;
  for(int loop=1;loop<=a;loop++){
    double tmp=1.0/a;
    int now=loop;
    while(now<b){
      now*=2;
      tmp/=2;
    }
    ret+=tmp;
  }
  printf("%.12f\n",ret);
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC4:
	.string	"%.12f\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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-36(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -24(%rbp)
	movl	$1, -32(%rbp)
	jmp	.L2
.L5:
	movl	-40(%rbp), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movsd	.LC2(%rip), %xmm0
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -16(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -28(%rbp)
	jmp	.L3
.L4:
	sall	-28(%rbp)
	movsd	-16(%rbp), %xmm0
	movsd	.LC3(%rip), %xmm1
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -16(%rbp)
.L3:
	movl	-36(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L4
	movsd	-24(%rbp), %xmm0
	addsd	-16(%rbp), %xmm0
	movsd	%xmm0, -24(%rbp)
	addl	$1, -32(%rbp)
.L2:
	movl	-40(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jle	.L5
	movq	-24(%rbp), %rax
	movq	%rax, %xmm0
	leaq	.LC4(%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
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC2:
	.long	0
	.long	1072693248
	.align 8
.LC3:
	.long	0
	.long	1073741824
	.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
.LC1:
	.string	"%d %d"
.LC4:
	.string	"%.12f\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	leaq	.LC1(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	leaq	4(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movl	(%rsp), %esi
	testl	%esi, %esi
	jle	.L9
	pxor	%xmm0, %xmm0
	movsd	.LC2(%rip), %xmm3
	movl	4(%rsp), %edx
	cvtsi2sdl	%esi, %xmm0
	divsd	%xmm0, %xmm3
	cmpl	$1, %edx
	jle	.L10
	leal	1(%rsi), %edi
	movsd	.LC3(%rip), %xmm1
	movl	$1, %ecx
	pxor	%xmm2, %xmm2
	cmpl	%edx, %edi
	cmovg	%edx, %edi
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%ecx, %eax
	movapd	%xmm3, %xmm0
	.p2align 4,,10
	.p2align 3
.L4:
	mulsd	%xmm1, %xmm0
	addl	%eax, %eax
	cmpl	%edx, %eax
	jl	.L4
	addl	$1, %ecx
	addsd	%xmm0, %xmm2
	cmpl	%edi, %ecx
	jl	.L5
	cmpl	%esi, %ecx
	jg	.L2
	.p2align 4,,10
	.p2align 3
.L6:
	addl	$1, %ecx
	addsd	%xmm3, %xmm2
	cmpl	%ecx, %esi
	jge	.L6
.L2:
	movapd	%xmm2, %xmm0
	movl	$1, %edi
	movl	$1, %eax
	leaq	.LC4(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	movl	$1, %ecx
	pxor	%xmm2, %xmm2
	jmp	.L6
.L9:
	pxor	%xmm2, %xmm2
	jmp	.L2
.L16:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC2:
	.long	0
	.long	1072693248
	.align 8
.LC3:
	.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
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d %d"
.LC4:
	.string	"%.12f\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	leaq	.LC1(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	leaq	4(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movl	(%rsp), %esi
	testl	%esi, %esi
	jle	.L9
	pxor	%xmm0, %xmm0
	movsd	.LC2(%rip), %xmm3
	movl	4(%rsp), %edx
	cvtsi2sdl	%esi, %xmm0
	divsd	%xmm0, %xmm3
	cmpl	$1, %edx
	jle	.L10
	leal	1(%rsi), %edi
	movsd	.LC3(%rip), %xmm1
	movl	$1, %ecx
	pxor	%xmm2, %xmm2
	cmpl	%edx, %edi
	cmovg	%edx, %edi
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%ecx, %eax
	movapd	%xmm3, %xmm0
	.p2align 4,,10
	.p2align 3
.L4:
	mulsd	%xmm1, %xmm0
	addl	%eax, %eax
	cmpl	%edx, %eax
	jl	.L4
	addl	$1, %ecx
	addsd	%xmm0, %xmm2
	cmpl	%edi, %ecx
	jl	.L5
	cmpl	%esi, %ecx
	jg	.L2
	.p2align 4,,10
	.p2align 3
.L6:
	addl	$1, %ecx
	addsd	%xmm3, %xmm2
	cmpl	%ecx, %esi
	jge	.L6
.L2:
	movapd	%xmm2, %xmm0
	movl	$1, %edi
	movl	$1, %eax
	leaq	.LC4(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	movl	$1, %ecx
	pxor	%xmm2, %xmm2
	jmp	.L6
.L9:
	pxor	%xmm2, %xmm2
	jmp	.L2
.L16:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC2:
	.long	0
	.long	1072693248
	.align 8
.LC3:
	.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:

#include<stdio.h>
int main(void){
  int a,b;
  scanf("%d %d",&a,&b);
  double ret=0;
  for(int loop=1;loop<=a;loop++){
    double tmp=1.0/a;
    int now=loop;
    while(now<b){
      now*=2;
      tmp/=2;
    }
    ret+=tmp;
  }
  printf("%.12f\n",ret);
  return 0;
}
3 4
 100000 8
 3 7
 100000 7
 6 7
 100100 7
 4 7
 100100 6
 110100 7
 111100 7

0.416666666667
 0.999956249998
 0.208333333333
 0.999961249998
 0.354166666667
 0.999961288712
 0.281250000000
 0.999968781220
 0.999964804721
 0.999965121513

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 main(void){
  int a,b;
  scanf("%d %d",&a,&b);
  double ret=0;
  for(int loop=1;loop<=a;loop++){
    double tmp=1.0/a;
    int now=loop;
    while(now<b){
      now*=2;
      tmp/=2;
    }
    ret+=tmp;
  }
  printf("%.12f\n",ret);
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC4:
	.string	"%.12f\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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-36(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -24(%rbp)
	movl	$1, -32(%rbp)
	jmp	.L2
.L5:
	movl	-40(%rbp), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movsd	.LC2(%rip), %xmm0
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -16(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -28(%rbp)
	jmp	.L3
.L4:
	sall	-28(%rbp)
	movsd	-16(%rbp), %xmm0
	movsd	.LC3(%rip), %xmm1
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -16(%rbp)
.L3:
	movl	-36(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L4
	movsd	-24(%rbp), %xmm0
	addsd	-16(%rbp), %xmm0
	movsd	%xmm0, -24(%rbp)
	addl	$1, -32(%rbp)
.L2:
	movl	-40(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jle	.L5
	movq	-24(%rbp), %rax
	movq	%rax, %xmm0
	leaq	.LC4(%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
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC2:
	.long	0
	.long	1072693248
	.align 8
.LC3:
	.long	0
	.long	1073741824
	.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"
.LC4:
	.string	"%.12f\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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-36(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -24(%rbp)
	movl	$1, -32(%rbp)
	jmp	.L2
.L5:
	movl	-40(%rbp), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movsd	.LC2(%rip), %xmm0
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -16(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -28(%rbp)
	jmp	.L3
.L4:
	sall	-28(%rbp)
	movsd	-16(%rbp), %xmm0
	movsd	.LC3(%rip), %xmm1
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -16(%rbp)
.L3:
	movl	-36(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L4
	movsd	-24(%rbp), %xmm0
	addsd	-16(%rbp), %xmm0
	movsd	%xmm0, -24(%rbp)
	addl	$1, -32(%rbp)
.L2:
	movl	-40(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jle	.L5
	movq	-24(%rbp), %rax
	movq	%rax, %xmm0
	leaq	.LC4(%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
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC2:
	.long	0
	.long	1072693248
	.align 8
.LC3:
	.long	0
	.long	1073741824
	.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:
