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()
{
	double n ;

	while( 1 )
	{
		scanf( "%lf" ,&n ) ;


		if( n < 0 )
		{
			return 0 ;
		}


		n *= 2 * 2 * 2 * 2 ;


		int m = ( int )n ;


		if( n - ( double )m == 0 && ( m >> 12 ) == 0 )
		{
			int i = 0 ;
			for( ; i < 12 ; ++i )
			{
				if( i == 8 )
				{
					printf( "." ) ;
				}


				printf( "%d" ,( m >> ( 12 - i - 1 ) & 1 ) ) ;
			}


			puts( "" ) ;
		}

		else
		{
			puts( "NA" ) ;
		}
	}
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%lf"
.LC3:
	.string	"%d"
.LC4:
	.string	""
.LC5:
	.string	"NA"
	.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
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L11:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movsd	-16(%rbp), %xmm1
	pxor	%xmm0, %xmm0
	comisd	%xmm1, %xmm0
	jbe	.L15
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	jmp	.L16
.L15:
	movsd	-16(%rbp), %xmm1
	movsd	.LC2(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	movsd	%xmm0, -16(%rbp)
	movsd	-16(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -20(%rbp)
	movsd	-16(%rbp), %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdl	-20(%rbp), %xmm1
	subsd	%xmm1, %xmm0
	pxor	%xmm1, %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L5
	pxor	%xmm1, %xmm1
	ucomisd	%xmm1, %xmm0
	jne	.L5
	movl	-20(%rbp), %eax
	sarl	$12, %eax
	testl	%eax, %eax
	jne	.L5
	movl	$0, -24(%rbp)
	jmp	.L7
.L9:
	cmpl	$8, -24(%rbp)
	jne	.L8
	movl	$46, %edi
	call	putchar@PLT
.L8:
	movl	$11, %eax
	subl	-24(%rbp), %eax
	movl	-20(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -24(%rbp)
.L7:
	cmpl	$11, -24(%rbp)
	jle	.L9
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L10
.L5:
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L10:
	jmp	.L11
.L16:
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC2:
	.long	0
	.long	1076887552
	.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	"%lf"
.LC3:
	.string	"%d"
.LC4:
	.string	""
.LC5:
	.string	"NA"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC3(%rip), %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	movsd	16(%rsp), %xmm0
	pxor	%xmm2, %xmm2
	comisd	%xmm0, %xmm2
	ja	.L19
	mulsd	.LC2(%rip), %xmm0
	pxor	%xmm1, %xmm1
	cvttsd2sil	%xmm0, %r14d
	movsd	%xmm0, 16(%rsp)
	cvtsi2sdl	%r14d, %xmm1
	subsd	%xmm1, %xmm0
	ucomisd	%xmm2, %xmm0
	jp	.L5
	jne	.L5
	movl	%r14d, %eax
	sarl	$12, %eax
	je	.L20
.L5:
	leaq	.LC5(%rip), %rdi
	call	puts@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L20:
	movl	$11, %r15d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L7:
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	cmpl	$12, %r13d
	je	.L9
.L8:
	movl	%r13d, %eax
.L10:
	movl	%r15d, %ecx
	movl	%r14d, %edx
	leal	1(%rax), %r13d
	subl	%eax, %ecx
	sarl	%cl, %edx
	andl	$1, %edx
	cmpl	$8, %eax
	jne	.L7
	movl	$46, %edi
	movl	%edx, 12(%rsp)
	call	putchar@PLT
	movl	12(%rsp), %edx
	movq	%rbx, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L9:
	leaq	.LC4(%rip), %rdi
	call	puts@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L19:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L21:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC2:
	.long	0
	.long	1076887552
	.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	"%lf"
.LC3:
	.string	"%d"
.LC4:
	.string	""
.LC5:
	.string	"NA"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC3(%rip), %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	movsd	16(%rsp), %xmm0
	pxor	%xmm2, %xmm2
	comisd	%xmm0, %xmm2
	ja	.L19
	mulsd	.LC2(%rip), %xmm0
	pxor	%xmm1, %xmm1
	cvttsd2sil	%xmm0, %r14d
	movsd	%xmm0, 16(%rsp)
	cvtsi2sdl	%r14d, %xmm1
	subsd	%xmm1, %xmm0
	ucomisd	%xmm2, %xmm0
	jp	.L5
	jne	.L5
	movl	%r14d, %eax
	sarl	$12, %eax
	je	.L20
.L5:
	leaq	.LC5(%rip), %rdi
	call	puts@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L20:
	movl	$11, %r15d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L7:
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	cmpl	$12, %r13d
	je	.L9
.L8:
	movl	%r13d, %eax
.L10:
	movl	%r15d, %ecx
	movl	%r14d, %edx
	leal	1(%rax), %r13d
	subl	%eax, %ecx
	sarl	%cl, %edx
	andl	$1, %edx
	cmpl	$8, %eax
	jne	.L7
	movl	$46, %edi
	movl	%edx, 12(%rsp)
	call	putchar@PLT
	movl	12(%rsp), %edx
	movq	%rbx, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L9:
	leaq	.LC4(%rip), %rdi
	call	puts@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L19:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L21:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC2:
	.long	0
	.long	1076887552
	.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()
{
	double n ;

	while( 1 )
	{
		scanf( "%lf" ,&n ) ;


		if( n < 0 )
		{
			return 0 ;
		}


		n *= 2 * 2 * 2 * 2 ;


		int m = ( int )n ;


		if( n - ( double )m == 0 && ( m >> 12 ) == 0 )
		{
			int i = 0 ;
			for( ; i < 12 ; ++i )
			{
				if( i == 8 )
				{
					printf( "." ) ;
				}


				printf( "%d" ,( m >> ( 12 - i - 1 ) & 1 ) ) ;
			}


			puts( "" ) ;
		}

		else
		{
			puts( "NA" ) ;
		}
	}
}
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
#include<stdio.h>



int main()
{
	double n ;

	while( 1 )
	{
		scanf( "%lf" ,&n ) ;


		if( n < 0 )
		{
			return 0 ;
		}


		n *= 2 * 2 * 2 * 2 ;


		int m = ( int )n ;


		if( n - ( double )m == 0 && ( m >> 12 ) == 0 )
		{
			int i = 0 ;
			for( ; i < 12 ; ++i )
			{
				if( i == 8 )
				{
					printf( "." ) ;
				}


				printf( "%d" ,( m >> ( 12 - i - 1 ) & 1 ) ) ;
			}


			puts( "" ) ;
		}

		else
		{
			puts( "NA" ) ;
		}
	}
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%lf"
.LC3:
	.string	"%d"
.LC4:
	.string	""
.LC5:
	.string	"NA"
	.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
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L11:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movsd	-16(%rbp), %xmm1
	pxor	%xmm0, %xmm0
	comisd	%xmm1, %xmm0
	jbe	.L15
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	jmp	.L16
.L15:
	movsd	-16(%rbp), %xmm1
	movsd	.LC2(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	movsd	%xmm0, -16(%rbp)
	movsd	-16(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -20(%rbp)
	movsd	-16(%rbp), %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdl	-20(%rbp), %xmm1
	subsd	%xmm1, %xmm0
	pxor	%xmm1, %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L5
	pxor	%xmm1, %xmm1
	ucomisd	%xmm1, %xmm0
	jne	.L5
	movl	-20(%rbp), %eax
	sarl	$12, %eax
	testl	%eax, %eax
	jne	.L5
	movl	$0, -24(%rbp)
	jmp	.L7
.L9:
	cmpl	$8, -24(%rbp)
	jne	.L8
	movl	$46, %edi
	call	putchar@PLT
.L8:
	movl	$11, %eax
	subl	-24(%rbp), %eax
	movl	-20(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -24(%rbp)
.L7:
	cmpl	$11, -24(%rbp)
	jle	.L9
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L10
.L5:
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L10:
	jmp	.L11
.L16:
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC2:
	.long	0
	.long	1076887552
	.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	"%lf"
.LC3:
	.string	"%d"
.LC4:
	.string	""
.LC5:
	.string	"NA"
	.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
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L11:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movsd	-16(%rbp), %xmm1
	pxor	%xmm0, %xmm0
	comisd	%xmm1, %xmm0
	jbe	.L15
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	jmp	.L16
.L15:
	movsd	-16(%rbp), %xmm1
	movsd	.LC2(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	movsd	%xmm0, -16(%rbp)
	movsd	-16(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -20(%rbp)
	movsd	-16(%rbp), %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdl	-20(%rbp), %xmm1
	subsd	%xmm1, %xmm0
	pxor	%xmm1, %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L5
	pxor	%xmm1, %xmm1
	ucomisd	%xmm1, %xmm0
	jne	.L5
	movl	-20(%rbp), %eax
	sarl	$12, %eax
	testl	%eax, %eax
	jne	.L5
	movl	$0, -24(%rbp)
	jmp	.L7
.L9:
	cmpl	$8, -24(%rbp)
	jne	.L8
	movl	$46, %edi
	call	putchar@PLT
.L8:
	movl	$11, %eax
	subl	-24(%rbp), %eax
	movl	-20(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -24(%rbp)
.L7:
	cmpl	$11, -24(%rbp)
	jle	.L9
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L10
.L5:
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L10:
	jmp	.L11
.L16:
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC2:
	.long	0
	.long	1076887552
	.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:
