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

```c
/*
AizuOnline A0220

*/
#include <stdio.h>
#include <float.h>
#include <math.h>
#define MAXVAL (255+0.5+0.25+0.125+0.0625)
char buf[20];
int bufptr;
int  value;
double v;


main()
{
  int d;
  while(EOF != scanf("%lf",&v) && v>0.0)
    {
      bufptr=19;
      buf[bufptr]='\0';
      if(floor(v*16) != v*16 || v > MAXVAL)
	{
	  printf("NA\n");
	  continue;
	}
      if(v == 0.0)
	{
	  printf("0.0\n");
	  continue;
	}
      value = v*16;
      while(value > 0)
	{
	  d = value & 1;
	  bufptr--;
	  if(bufptr==14)bufptr--;
	  buf[bufptr]='0'+d;
	  value >>= 1;	  
	}
      buf[14]='.';

      switch(bufptr){
      case 18:
	buf[17]='0';
      case 17:
	buf[16]='0';
      case 16:
	buf[15]='0';
      case 15:
	buf[13]='0';buf[14]='.';bufptr=13;
      }
      for(bufptr--;bufptr >5;bufptr--)
       buf[bufptr]='0';
      bufptr++;

      printf("%s\n",buf+bufptr);
      //printf("(%d)",bufptr);
    }

return(0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	buf
	.bss
	.align 16
	.type	buf, @object
	.size	buf, 20
buf:
	.zero	20
	.globl	bufptr
	.align 4
	.type	bufptr, @object
	.size	bufptr, 4
bufptr:
	.zero	4
	.globl	value
	.align 4
	.type	value, @object
	.size	value, 4
value:
	.zero	4
	.globl	v
	.align 8
	.type	v, @object
	.size	v, 8
v:
	.zero	8
	.section	.rodata
.LC2:
	.string	"NA"
.LC4:
	.string	"0.0"
.LC5:
	.string	"%lf"
	.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	$16, %rsp
	jmp	.L2
.L20:
	movl	$19, bufptr(%rip)
	movl	bufptr(%rip), %eax
	cltq
	leaq	buf(%rip), %rdx
	movb	$0, (%rax,%rdx)
	movsd	v(%rip), %xmm1
	movsd	.LC0(%rip), %xmm0
	mulsd	%xmm0, %xmm1
	movq	%xmm1, %rax
	movq	%rax, %xmm0
	call	floor@PLT
	movq	%xmm0, %rax
	movsd	v(%rip), %xmm1
	movsd	.LC0(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	movq	%rax, %xmm2
	ucomisd	%xmm0, %xmm2
	jp	.L3
	movq	%rax, %xmm3
	ucomisd	%xmm0, %xmm3
	jne	.L3
	movsd	v(%rip), %xmm0
	comisd	.LC1(%rip), %xmm0
	jbe	.L24
.L3:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L2
.L24:
	movsd	v(%rip), %xmm0
	pxor	%xmm1, %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L7
	pxor	%xmm1, %xmm1
	ucomisd	%xmm1, %xmm0
	jne	.L7
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L2
.L7:
	movsd	v(%rip), %xmm1
	movsd	.LC0(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, value(%rip)
	jmp	.L9
.L11:
	movl	value(%rip), %eax
	andl	$1, %eax
	movl	%eax, -4(%rbp)
	movl	bufptr(%rip), %eax
	subl	$1, %eax
	movl	%eax, bufptr(%rip)
	movl	bufptr(%rip), %eax
	cmpl	$14, %eax
	jne	.L10
	movl	bufptr(%rip), %eax
	subl	$1, %eax
	movl	%eax, bufptr(%rip)
.L10:
	movl	-4(%rbp), %eax
	leal	48(%rax), %edx
	movl	bufptr(%rip), %eax
	movl	%edx, %ecx
	cltq
	leaq	buf(%rip), %rdx
	movb	%cl, (%rax,%rdx)
	movl	value(%rip), %eax
	sarl	%eax
	movl	%eax, value(%rip)
.L9:
	movl	value(%rip), %eax
	testl	%eax, %eax
	jg	.L11
	movb	$46, 14+buf(%rip)
	movl	bufptr(%rip), %eax
	cmpl	$18, %eax
	je	.L12
	cmpl	$18, %eax
	jg	.L13
	cmpl	$17, %eax
	je	.L14
	cmpl	$17, %eax
	jg	.L13
	cmpl	$15, %eax
	je	.L15
	cmpl	$16, %eax
	je	.L16
	jmp	.L13
.L12:
	movb	$48, 17+buf(%rip)
.L14:
	movb	$48, 16+buf(%rip)
.L16:
	movb	$48, 15+buf(%rip)
.L15:
	movb	$48, 13+buf(%rip)
	movb	$46, 14+buf(%rip)
	movl	$13, bufptr(%rip)
.L13:
	movl	bufptr(%rip), %eax
	subl	$1, %eax
	movl	%eax, bufptr(%rip)
	jmp	.L17
.L18:
	movl	bufptr(%rip), %eax
	cltq
	leaq	buf(%rip), %rdx
	movb	$48, (%rax,%rdx)
	movl	bufptr(%rip), %eax
	subl	$1, %eax
	movl	%eax, bufptr(%rip)
.L17:
	movl	bufptr(%rip), %eax
	cmpl	$5, %eax
	jg	.L18
	movl	bufptr(%rip), %eax
	addl	$1, %eax
	movl	%eax, bufptr(%rip)
	movl	bufptr(%rip), %eax
	cltq
	leaq	buf(%rip), %rdx
	addq	%rdx, %rax
	movq	%rax, %rdi
	call	puts@PLT
.L2:
	leaq	v(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L19
	movsd	v(%rip), %xmm0
	pxor	%xmm1, %xmm1
	comisd	%xmm1, %xmm0
	ja	.L20
.L19:
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC0:
	.long	0
	.long	1076887552
	.align 8
.LC1:
	.long	0
	.long	1081081344
	.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
.LC5:
	.string	"NA"
.LC6:
	.string	"%lf"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	v(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	.LC6(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L38
	movsd	v(%rip), %xmm2
	pxor	%xmm6, %xmm6
	comisd	%xmm6, %xmm2
	jbe	.L38
	movsd	.LC0(%rip), %xmm0
	movsd	.LC2(%rip), %xmm3
	movl	$19, bufptr(%rip)
	movsd	.LC1(%rip), %xmm7
	movb	$0, 19+buf(%rip)
	mulsd	%xmm2, %xmm0
	movapd	%xmm0, %xmm1
	movapd	%xmm0, %xmm4
	andpd	%xmm3, %xmm1
	ucomisd	%xmm1, %xmm7
	jbe	.L3
	cvttsd2siq	%xmm0, %rax
	pxor	%xmm1, %xmm1
	movsd	.LC3(%rip), %xmm5
	andnpd	%xmm0, %xmm3
	cvtsi2sdq	%rax, %xmm1
	movapd	%xmm1, %xmm4
	cmpnlesd	%xmm0, %xmm4
	andpd	%xmm5, %xmm4
	subsd	%xmm4, %xmm1
	movapd	%xmm1, %xmm4
	orpd	%xmm3, %xmm4
.L3:
	ucomisd	%xmm4, %xmm0
	jp	.L4
	jne	.L4
	comisd	.LC4(%rip), %xmm2
	ja	.L4
	cvttsd2sil	%xmm0, %eax
	movl	%eax, value(%rip)
	testl	%eax, %eax
	jle	.L58
	movl	%eax, %edx
	leaq	buf(%rip), %rcx
	movl	$18, %edi
	andl	$1, %edx
	addl	$48, %edx
	sarl	%eax
	movb	%dl, 18+buf(%rip)
	je	.L59
	.p2align 4,,10
	.p2align 3
.L15:
	movl	%eax, %edx
	subl	$1, %edi
	andl	$1, %edx
	cmpl	$14, %edi
	je	.L11
	addl	$48, %edx
	movslq	%edi, %rsi
	sarl	%eax
	movb	%dl, (%rcx,%rsi)
	jne	.L15
	movl	$0, value(%rip)
	movb	$46, 14+buf(%rip)
	cmpl	$17, %edi
	je	.L16
	cmpl	$15, %edi
	je	.L17
	cmpl	$16, %edi
	jne	.L54
.L18:
	movb	$48, 15+buf(%rip)
.L17:
	movb	$48, 13+buf(%rip)
	movl	$12, %eax
.L20:
	movabsq	$3472328296227680304, %rdi
	leal	-6(%rax), %esi
	cltq
	subq	%rsi, %rax
	leaq	1(%rsi), %rdx
	addq	%rcx, %rax
	cmpl	$8, %edx
	jnb	.L21
	testb	$4, %dl
	jne	.L60
	testl	%edx, %edx
	je	.L22
	movb	$48, (%rax)
	testb	$2, %dl
	jne	.L61
.L22:
	movl	$6, %edi
.L19:
	movl	%edi, bufptr(%rip)
	movslq	%edi, %rdi
	addq	%rcx, %rdi
	call	puts@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L11:
	addl	$48, %edx
	sarl	%eax
	movb	%dl, 13+buf(%rip)
	je	.L14
	movl	$13, %edi
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L4:
	leaq	.LC5(%rip), %rdi
	call	puts@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L21:
	movl	%edx, %esi
	movq	%rdi, (%rax)
	movq	%rdi, -8(%rax,%rsi)
	leaq	8(%rax), %rsi
	andq	$-8, %rsi
	subq	%rsi, %rax
	addl	%eax, %edx
	andl	$-8, %edx
	cmpl	$8, %edx
	jb	.L22
	andl	$-8, %edx
	xorl	%eax, %eax
.L25:
	movl	%eax, %r8d
	addl	$8, %eax
	movq	%rdi, (%rsi,%r8)
	cmpl	%edx, %eax
	jb	.L25
	jmp	.L22
.L59:
	movl	$0, value(%rip)
	movb	$46, 14+buf(%rip)
	movb	$48, 17+buf(%rip)
.L16:
	movb	$48, 16+buf(%rip)
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L38:
	addq	$8, %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
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	movl	$0, value(%rip)
	movl	$13, %edi
	movb	$46, 14+buf(%rip)
.L54:
	leal	-1(%rdi), %eax
	cmpl	$5, %eax
	jle	.L19
	jmp	.L20
.L58:
	movb	$46, 14+buf(%rip)
	movl	$18, %eax
	leaq	buf(%rip), %rcx
	jmp	.L20
.L61:
	movl	%edx, %edx
	movw	$12336, -2(%rax,%rdx)
	jmp	.L22
.L60:
	movl	%edx, %edx
	movl	$808464432, (%rax)
	movl	$808464432, -4(%rax,%rdx)
	jmp	.L22
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	v
	.bss
	.align 8
	.type	v, @object
	.size	v, 8
v:
	.zero	8
	.globl	value
	.align 4
	.type	value, @object
	.size	value, 4
value:
	.zero	4
	.globl	bufptr
	.align 4
	.type	bufptr, @object
	.size	bufptr, 4
bufptr:
	.zero	4
	.globl	buf
	.align 16
	.type	buf, @object
	.size	buf, 20
buf:
	.zero	20
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	0
	.long	1076887552
	.align 8
.LC1:
	.long	0
	.long	1127219200
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.long	-1
	.long	2147483647
	.long	0
	.long	0
	.section	.rodata.cst8
	.align 8
.LC3:
	.long	0
	.long	1072693248
	.align 8
.LC4:
	.long	0
	.long	1081081344
	.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
.LC5:
	.string	"NA"
.LC6:
	.string	"%lf"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	v(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	.LC6(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L38
	movsd	v(%rip), %xmm2
	pxor	%xmm6, %xmm6
	comisd	%xmm6, %xmm2
	jbe	.L38
	movsd	.LC0(%rip), %xmm0
	movsd	.LC2(%rip), %xmm3
	movl	$19, bufptr(%rip)
	movsd	.LC1(%rip), %xmm7
	movb	$0, 19+buf(%rip)
	mulsd	%xmm2, %xmm0
	movapd	%xmm0, %xmm1
	movapd	%xmm0, %xmm4
	andpd	%xmm3, %xmm1
	ucomisd	%xmm1, %xmm7
	jbe	.L3
	cvttsd2siq	%xmm0, %rax
	pxor	%xmm1, %xmm1
	movsd	.LC3(%rip), %xmm5
	andnpd	%xmm0, %xmm3
	cvtsi2sdq	%rax, %xmm1
	movapd	%xmm1, %xmm4
	cmpnlesd	%xmm0, %xmm4
	andpd	%xmm5, %xmm4
	subsd	%xmm4, %xmm1
	movapd	%xmm1, %xmm4
	orpd	%xmm3, %xmm4
.L3:
	ucomisd	%xmm4, %xmm0
	jp	.L4
	jne	.L4
	comisd	.LC4(%rip), %xmm2
	ja	.L4
	cvttsd2sil	%xmm0, %eax
	movl	%eax, value(%rip)
	testl	%eax, %eax
	jle	.L58
	movl	%eax, %edx
	leaq	buf(%rip), %rcx
	movl	$18, %edi
	andl	$1, %edx
	addl	$48, %edx
	sarl	%eax
	movb	%dl, 18+buf(%rip)
	je	.L59
	.p2align 4,,10
	.p2align 3
.L15:
	movl	%eax, %edx
	subl	$1, %edi
	andl	$1, %edx
	cmpl	$14, %edi
	je	.L11
	addl	$48, %edx
	movslq	%edi, %rsi
	sarl	%eax
	movb	%dl, (%rcx,%rsi)
	jne	.L15
	movl	$0, value(%rip)
	movb	$46, 14+buf(%rip)
	cmpl	$17, %edi
	je	.L16
	cmpl	$15, %edi
	je	.L17
	cmpl	$16, %edi
	jne	.L54
.L18:
	movb	$48, 15+buf(%rip)
.L17:
	movb	$48, 13+buf(%rip)
	movl	$12, %eax
.L20:
	movabsq	$3472328296227680304, %rdi
	leal	-6(%rax), %esi
	cltq
	subq	%rsi, %rax
	leaq	1(%rsi), %rdx
	addq	%rcx, %rax
	cmpl	$8, %edx
	jnb	.L21
	testb	$4, %dl
	jne	.L60
	testl	%edx, %edx
	je	.L22
	movb	$48, (%rax)
	testb	$2, %dl
	jne	.L61
.L22:
	movl	$6, %edi
.L19:
	movl	%edi, bufptr(%rip)
	movslq	%edi, %rdi
	addq	%rcx, %rdi
	call	puts@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L11:
	addl	$48, %edx
	sarl	%eax
	movb	%dl, 13+buf(%rip)
	je	.L14
	movl	$13, %edi
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L4:
	leaq	.LC5(%rip), %rdi
	call	puts@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L21:
	movl	%edx, %esi
	movq	%rdi, (%rax)
	movq	%rdi, -8(%rax,%rsi)
	leaq	8(%rax), %rsi
	andq	$-8, %rsi
	subq	%rsi, %rax
	addl	%eax, %edx
	andl	$-8, %edx
	cmpl	$8, %edx
	jb	.L22
	andl	$-8, %edx
	xorl	%eax, %eax
.L25:
	movl	%eax, %r8d
	addl	$8, %eax
	movq	%rdi, (%rsi,%r8)
	cmpl	%edx, %eax
	jb	.L25
	jmp	.L22
.L59:
	movl	$0, value(%rip)
	movb	$46, 14+buf(%rip)
	movb	$48, 17+buf(%rip)
.L16:
	movb	$48, 16+buf(%rip)
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L38:
	addq	$8, %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
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	movl	$0, value(%rip)
	movl	$13, %edi
	movb	$46, 14+buf(%rip)
.L54:
	leal	-1(%rdi), %eax
	cmpl	$5, %eax
	jle	.L19
	jmp	.L20
.L58:
	movb	$46, 14+buf(%rip)
	movl	$18, %eax
	leaq	buf(%rip), %rcx
	jmp	.L20
.L61:
	movl	%edx, %edx
	movw	$12336, -2(%rax,%rdx)
	jmp	.L22
.L60:
	movl	%edx, %edx
	movl	$808464432, (%rax)
	movl	$808464432, -4(%rax,%rdx)
	jmp	.L22
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	v
	.bss
	.align 8
	.type	v, @object
	.size	v, 8
v:
	.zero	8
	.globl	value
	.align 4
	.type	value, @object
	.size	value, 4
value:
	.zero	4
	.globl	bufptr
	.align 4
	.type	bufptr, @object
	.size	bufptr, 4
bufptr:
	.zero	4
	.globl	buf
	.align 16
	.type	buf, @object
	.size	buf, 20
buf:
	.zero	20
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	0
	.long	1076887552
	.align 8
.LC1:
	.long	0
	.long	1127219200
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.long	-1
	.long	2147483647
	.long	0
	.long	0
	.section	.rodata.cst8
	.align 8
.LC3:
	.long	0
	.long	1072693248
	.align 8
.LC4:
	.long	0
	.long	1081081344
	.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:

/*
AizuOnline A0220

*/
#include <stdio.h>
#include <float.h>
#include <math.h>
#define MAXVAL (255+0.5+0.25+0.125+0.0625)
char buf[20];
int bufptr;
int  value;
double v;


main()
{
  int d;
  while(EOF != scanf("%lf",&v) && v>0.0)
    {
      bufptr=19;
      buf[bufptr]='\0';
      if(floor(v*16) != v*16 || v > MAXVAL)
	{
	  printf("NA\n");
	  continue;
	}
      if(v == 0.0)
	{
	  printf("0.0\n");
	  continue;
	}
      value = v*16;
      while(value > 0)
	{
	  d = value & 1;
	  bufptr--;
	  if(bufptr==14)bufptr--;
	  buf[bufptr]='0'+d;
	  value >>= 1;	  
	}
      buf[14]='.';

      switch(bufptr){
      case 18:
	buf[17]='0';
      case 17:
	buf[16]='0';
      case 16:
	buf[15]='0';
      case 15:
	buf[13]='0';buf[14]='.';bufptr=13;
      }
      for(bufptr--;bufptr >5;bufptr--)
       buf[bufptr]='0';
      bufptr++;

      printf("%s\n",buf+bufptr);
      //printf("(%d)",bufptr);
    }

return(0);
}
23.72975180461117
158.1
-1.0
 23.5
158.1
-0.5246083014985048
 23.72975180461117
158.1
-0.5449258499657357
 24.206542817215936
158.1
-1.0
 24.615346202775605
158.1
-1.0
 23.72975180461117
158.6852941341954
-0.5449258499657357
 25.190547978615548
158.1
-1.0
 24.615346202775605
158.4968814800713
-1.0
 23.860711200353357
158.6852941341954
-0.5449258499657357
 25.190547978615548
158.1
-0.8023788931052966

NA
NA
 00010111.1000
NA
 NA
NA
 NA
NA
 NA
NA
 NA
NA
 NA
NA
 NA
NA
 NA
NA
 NA
NA

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

```c
/*
AizuOnline A0220

*/
#include <stdio.h>
#include <float.h>
#include <math.h>
#define MAXVAL (255+0.5+0.25+0.125+0.0625)
char buf[20];
int bufptr;
int  value;
double v;


main()
{
  int d;
  while(EOF != scanf("%lf",&v) && v>0.0)
    {
      bufptr=19;
      buf[bufptr]='\0';
      if(floor(v*16) != v*16 || v > MAXVAL)
	{
	  printf("NA\n");
	  continue;
	}
      if(v == 0.0)
	{
	  printf("0.0\n");
	  continue;
	}
      value = v*16;
      while(value > 0)
	{
	  d = value & 1;
	  bufptr--;
	  if(bufptr==14)bufptr--;
	  buf[bufptr]='0'+d;
	  value >>= 1;	  
	}
      buf[14]='.';

      switch(bufptr){
      case 18:
	buf[17]='0';
      case 17:
	buf[16]='0';
      case 16:
	buf[15]='0';
      case 15:
	buf[13]='0';buf[14]='.';bufptr=13;
      }
      for(bufptr--;bufptr >5;bufptr--)
       buf[bufptr]='0';
      bufptr++;

      printf("%s\n",buf+bufptr);
      //printf("(%d)",bufptr);
    }

return(0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	buf
	.bss
	.align 16
	.type	buf, @object
	.size	buf, 20
buf:
	.zero	20
	.globl	bufptr
	.align 4
	.type	bufptr, @object
	.size	bufptr, 4
bufptr:
	.zero	4
	.globl	value
	.align 4
	.type	value, @object
	.size	value, 4
value:
	.zero	4
	.globl	v
	.align 8
	.type	v, @object
	.size	v, 8
v:
	.zero	8
	.section	.rodata
.LC2:
	.string	"NA"
.LC4:
	.string	"0.0"
.LC5:
	.string	"%lf"
	.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	$16, %rsp
	jmp	.L2
.L20:
	movl	$19, bufptr(%rip)
	movl	bufptr(%rip), %eax
	cltq
	leaq	buf(%rip), %rdx
	movb	$0, (%rax,%rdx)
	movsd	v(%rip), %xmm1
	movsd	.LC0(%rip), %xmm0
	mulsd	%xmm0, %xmm1
	movq	%xmm1, %rax
	movq	%rax, %xmm0
	call	floor@PLT
	movq	%xmm0, %rax
	movsd	v(%rip), %xmm1
	movsd	.LC0(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	movq	%rax, %xmm2
	ucomisd	%xmm0, %xmm2
	jp	.L3
	movq	%rax, %xmm3
	ucomisd	%xmm0, %xmm3
	jne	.L3
	movsd	v(%rip), %xmm0
	comisd	.LC1(%rip), %xmm0
	jbe	.L24
.L3:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L2
.L24:
	movsd	v(%rip), %xmm0
	pxor	%xmm1, %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L7
	pxor	%xmm1, %xmm1
	ucomisd	%xmm1, %xmm0
	jne	.L7
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L2
.L7:
	movsd	v(%rip), %xmm1
	movsd	.LC0(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, value(%rip)
	jmp	.L9
.L11:
	movl	value(%rip), %eax
	andl	$1, %eax
	movl	%eax, -4(%rbp)
	movl	bufptr(%rip), %eax
	subl	$1, %eax
	movl	%eax, bufptr(%rip)
	movl	bufptr(%rip), %eax
	cmpl	$14, %eax
	jne	.L10
	movl	bufptr(%rip), %eax
	subl	$1, %eax
	movl	%eax, bufptr(%rip)
.L10:
	movl	-4(%rbp), %eax
	leal	48(%rax), %edx
	movl	bufptr(%rip), %eax
	movl	%edx, %ecx
	cltq
	leaq	buf(%rip), %rdx
	movb	%cl, (%rax,%rdx)
	movl	value(%rip), %eax
	sarl	%eax
	movl	%eax, value(%rip)
.L9:
	movl	value(%rip), %eax
	testl	%eax, %eax
	jg	.L11
	movb	$46, 14+buf(%rip)
	movl	bufptr(%rip), %eax
	cmpl	$18, %eax
	je	.L12
	cmpl	$18, %eax
	jg	.L13
	cmpl	$17, %eax
	je	.L14
	cmpl	$17, %eax
	jg	.L13
	cmpl	$15, %eax
	je	.L15
	cmpl	$16, %eax
	je	.L16
	jmp	.L13
.L12:
	movb	$48, 17+buf(%rip)
.L14:
	movb	$48, 16+buf(%rip)
.L16:
	movb	$48, 15+buf(%rip)
.L15:
	movb	$48, 13+buf(%rip)
	movb	$46, 14+buf(%rip)
	movl	$13, bufptr(%rip)
.L13:
	movl	bufptr(%rip), %eax
	subl	$1, %eax
	movl	%eax, bufptr(%rip)
	jmp	.L17
.L18:
	movl	bufptr(%rip), %eax
	cltq
	leaq	buf(%rip), %rdx
	movb	$48, (%rax,%rdx)
	movl	bufptr(%rip), %eax
	subl	$1, %eax
	movl	%eax, bufptr(%rip)
.L17:
	movl	bufptr(%rip), %eax
	cmpl	$5, %eax
	jg	.L18
	movl	bufptr(%rip), %eax
	addl	$1, %eax
	movl	%eax, bufptr(%rip)
	movl	bufptr(%rip), %eax
	cltq
	leaq	buf(%rip), %rdx
	addq	%rdx, %rax
	movq	%rax, %rdi
	call	puts@PLT
.L2:
	leaq	v(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L19
	movsd	v(%rip), %xmm0
	pxor	%xmm1, %xmm1
	comisd	%xmm1, %xmm0
	ja	.L20
.L19:
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC0:
	.long	0
	.long	1076887552
	.align 8
.LC1:
	.long	0
	.long	1081081344
	.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	buf
	.bss
	.align 16
	.type	buf, @object
	.size	buf, 20
buf:
	.zero	20
	.globl	bufptr
	.align 4
	.type	bufptr, @object
	.size	bufptr, 4
bufptr:
	.zero	4
	.globl	value
	.align 4
	.type	value, @object
	.size	value, 4
value:
	.zero	4
	.globl	v
	.align 8
	.type	v, @object
	.size	v, 8
v:
	.zero	8
	.section	.rodata
.LC2:
	.string	"NA"
.LC4:
	.string	"0.0"
.LC5:
	.string	"%lf"
	.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	$16, %rsp
	jmp	.L2
.L20:
	movl	$19, bufptr(%rip)
	movl	bufptr(%rip), %eax
	cltq
	leaq	buf(%rip), %rdx
	movb	$0, (%rax,%rdx)
	movsd	v(%rip), %xmm1
	movsd	.LC0(%rip), %xmm0
	mulsd	%xmm0, %xmm1
	movq	%xmm1, %rax
	movq	%rax, %xmm0
	call	floor@PLT
	movq	%xmm0, %rax
	movsd	v(%rip), %xmm1
	movsd	.LC0(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	movq	%rax, %xmm2
	ucomisd	%xmm0, %xmm2
	jp	.L3
	movq	%rax, %xmm3
	ucomisd	%xmm0, %xmm3
	jne	.L3
	movsd	v(%rip), %xmm0
	comisd	.LC1(%rip), %xmm0
	jbe	.L24
.L3:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L2
.L24:
	movsd	v(%rip), %xmm0
	pxor	%xmm1, %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L7
	pxor	%xmm1, %xmm1
	ucomisd	%xmm1, %xmm0
	jne	.L7
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L2
.L7:
	movsd	v(%rip), %xmm1
	movsd	.LC0(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, value(%rip)
	jmp	.L9
.L11:
	movl	value(%rip), %eax
	andl	$1, %eax
	movl	%eax, -4(%rbp)
	movl	bufptr(%rip), %eax
	subl	$1, %eax
	movl	%eax, bufptr(%rip)
	movl	bufptr(%rip), %eax
	cmpl	$14, %eax
	jne	.L10
	movl	bufptr(%rip), %eax
	subl	$1, %eax
	movl	%eax, bufptr(%rip)
.L10:
	movl	-4(%rbp), %eax
	leal	48(%rax), %edx
	movl	bufptr(%rip), %eax
	movl	%edx, %ecx
	cltq
	leaq	buf(%rip), %rdx
	movb	%cl, (%rax,%rdx)
	movl	value(%rip), %eax
	sarl	%eax
	movl	%eax, value(%rip)
.L9:
	movl	value(%rip), %eax
	testl	%eax, %eax
	jg	.L11
	movb	$46, 14+buf(%rip)
	movl	bufptr(%rip), %eax
	cmpl	$18, %eax
	je	.L12
	cmpl	$18, %eax
	jg	.L13
	cmpl	$17, %eax
	je	.L14
	cmpl	$17, %eax
	jg	.L13
	cmpl	$15, %eax
	je	.L15
	cmpl	$16, %eax
	je	.L16
	jmp	.L13
.L12:
	movb	$48, 17+buf(%rip)
.L14:
	movb	$48, 16+buf(%rip)
.L16:
	movb	$48, 15+buf(%rip)
.L15:
	movb	$48, 13+buf(%rip)
	movb	$46, 14+buf(%rip)
	movl	$13, bufptr(%rip)
.L13:
	movl	bufptr(%rip), %eax
	subl	$1, %eax
	movl	%eax, bufptr(%rip)
	jmp	.L17
.L18:
	movl	bufptr(%rip), %eax
	cltq
	leaq	buf(%rip), %rdx
	movb	$48, (%rax,%rdx)
	movl	bufptr(%rip), %eax
	subl	$1, %eax
	movl	%eax, bufptr(%rip)
.L17:
	movl	bufptr(%rip), %eax
	cmpl	$5, %eax
	jg	.L18
	movl	bufptr(%rip), %eax
	addl	$1, %eax
	movl	%eax, bufptr(%rip)
	movl	bufptr(%rip), %eax
	cltq
	leaq	buf(%rip), %rdx
	addq	%rdx, %rax
	movq	%rax, %rdi
	call	puts@PLT
.L2:
	leaq	v(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L19
	movsd	v(%rip), %xmm0
	pxor	%xmm1, %xmm1
	comisd	%xmm1, %xmm0
	ja	.L20
.L19:
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC0:
	.long	0
	.long	1076887552
	.align 8
.LC1:
	.long	0
	.long	1081081344
	.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:
