// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/misc/number.cpp
// Function: smooth::Number::ToFloatString() const
S::String S::Number::ToFloatString() const
{
	Int	 digits = 10;
	Int64	 fract	= (Int64) (Math::Fract(Math::Abs(floatValue)) * Math::Pow(10, digits));
	Int	 lead	= digits - Math::Floor((fract > 0 ? Math::Log10(fract) : -1) + 1.000000001);

	Int	 nOfNull = 0;

	for (Int i = 0; i < digits; i++)
	{
		if (Int64(fract / Math::Pow(10, i)) % 10 == 0)	nOfNull++;
		else						break;
	}

	Int	 nOfNine = 0;

	for (Int i = 0; i < digits; i++)
	{
		if (Int64(fract / Math::Pow(10, i)) % 10 == 9)	nOfNine++;
		else						break;
	}

	if	(nOfNull > 0) fract = (Int64) (fract / Math::Pow(10, nOfNull));
	else if (nOfNine > 0) fract = (Int64) (fract / Math::Pow(10, nOfNine)) + 1;

	String	 string = Number(Math::Floor(Math::Abs(floatValue))).ToIntString();

	if (nOfNine == digits)
	{
		string = Number(Math::Floor(Math::Abs(floatValue)) + 1).ToIntString();
	}
	else if (fract > 0)
	{
		string.Append(kPoint);

		for (Int i = 0; i < lead; i++) string.Append(kZero);

		string.Append(Number(fract).ToIntString());
	}

	if (floatValue < 0) string = String(kMinus).Append(string);

	return string;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0xf0(%rbp)
movq %rdi, %rax
movq %rax, -0xe8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xe0(%rbp)
movl $0xa, -0x14(%rbp)
movsd 0x8(%rax), %xmm0
callq 0x597d0
callq 0x5ba20
movsd %xmm0, -0xd8(%rbp)
movl -0x14(%rbp), %esi
movl $0xa, %edi
callq 0x5a330
movaps %xmm0, %xmm1
movsd -0xd8(%rbp), %xmm0
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movq %rax, -0x20(%rbp)
movslq -0x14(%rbp), %rax
movq %rax, -0xd0(%rbp)
cmpq $0x0, -0x20(%rbp)
jle 0xf1b79
cvtsi2sdq -0x20(%rbp), %xmm0
callq 0x5a800
movsd %xmm0, -0xf8(%rbp)
jmp 0xf1b8b
movsd 0x95b8f(%rip), %xmm0    # 0x187710
movsd %xmm0, -0xf8(%rbp)
jmp 0xf1b8b
movsd -0xf8(%rbp), %xmm0
movsd 0xb3e75(%rip), %xmm1    # 0x1a5a10
addsd %xmm1, %xmm0
callq 0x5d2c0
movq %rax, %rcx
movq -0xd0(%rbp), %rax
subq %rcx, %rax
movl %eax, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0xf1c23
cvtsi2sdq -0x20(%rbp), %xmm0
movsd %xmm0, -0x100(%rbp)
movl -0x2c(%rbp), %esi
movl $0xa, %edi
callq 0x5a330
movaps %xmm0, %xmm1
movsd -0x100(%rbp), %xmm0
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movl $0xa, %ecx
cqto
idivq %rcx
cmpq $0x0, %rdx
jne 0xf1c14
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0xf1c16
jmp 0xf1c23
jmp 0xf1c18
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xf1bc2
movl $0x0, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0xf1c92
cvtsi2sdq -0x20(%rbp), %xmm0
movsd %xmm0, -0x108(%rbp)
movl -0x34(%rbp), %esi
movl $0xa, %edi
callq 0x5a330
movaps %xmm0, %xmm1
movsd -0x108(%rbp), %xmm0
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movl $0xa, %ecx
cqto
idivq %rcx
cmpq $0x9, %rdx
jne 0xf1c83
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0xf1c85
jmp 0xf1c92
jmp 0xf1c87
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xf1c31
cmpl $0x0, -0x28(%rbp)
jle 0xf1ccd
cvtsi2sdq -0x20(%rbp), %xmm0
movsd %xmm0, -0x110(%rbp)
movl -0x28(%rbp), %esi
movl $0xa, %edi
callq 0x5a330
movaps %xmm0, %xmm1
movsd -0x110(%rbp), %xmm0
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movq %rax, -0x20(%rbp)
jmp 0xf1d0c
cmpl $0x0, -0x30(%rbp)
jle 0xf1d0a
cvtsi2sdq -0x20(%rbp), %xmm0
movsd %xmm0, -0x118(%rbp)
movl -0x30(%rbp), %esi
movl $0xa, %edi
callq 0x5a330
movaps %xmm0, %xmm1
movsd -0x118(%rbp), %xmm0
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0xf1d0c
movq -0xe0(%rbp), %rax
movb $0x0, -0x35(%rbp)
movsd 0x8(%rax), %xmm0
callq 0x597d0
callq 0x5d2c0
movq %rax, %rsi
leaq -0x48(%rbp), %rdi
movq %rdi, -0x120(%rbp)
callq 0x5dd30
movq -0xf0(%rbp), %rdi
movq -0x120(%rbp), %rsi
callq 0x5be30
jmp 0xf1d4e
leaq -0x48(%rbp), %rdi
callq 0x5d990
movl -0x30(%rbp), %eax
cmpl -0x14(%rbp), %eax
jne 0xf1e3d
movq -0xe0(%rbp), %rax
movsd 0x8(%rax), %xmm0
callq 0x597d0
movsd %xmm0, -0x128(%rbp)
jmp 0xf1d7e
movsd -0x128(%rbp), %xmm0
callq 0x5d2c0
movq %rax, -0x130(%rbp)
jmp 0xf1d94
movq -0x130(%rbp), %rsi
incq %rsi
leaq -0x80(%rbp), %rdi
callq 0x5dd30
jmp 0xf1da9
leaq -0x70(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x5be30
jmp 0xf1db8
movq -0xf0(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x59760
jmp 0xf1dca
leaq -0x70(%rbp), %rdi
callq 0x5df00
leaq -0x80(%rbp), %rdi
callq 0x5d990
jmp 0xf1f29
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x5d990
jmp 0xf1fda
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xf1fce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xf1e2f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x5df00
leaq -0x80(%rbp), %rdi
callq 0x5d990
jmp 0xf1fce
cmpq $0x0, -0x20(%rbp)
jle 0xf1f27
movq -0xf0(%rbp), %rdi
leaq 0x11abf2(%rip), %rsi    # 0x20ca48
callq 0x5a710
jmp 0xf1e5d
movl $0x0, -0x84(%rbp)
movl -0x84(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0xf1e9a
movq -0xf0(%rbp), %rdi
leaq 0x11ab98(%rip), %rsi    # 0x20ca18
callq 0x5a710
jmp 0xf1e87
jmp 0xf1e89
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0xf1e67
movq -0x20(%rbp), %rsi
leaq -0xb0(%rbp), %rdi
callq 0x5dd30
jmp 0xf1eac
leaq -0xa0(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x5be30
jmp 0xf1ec1
movq -0xf0(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x5a710
jmp 0xf1ed6
leaq -0xa0(%rbp), %rdi
callq 0x5df00
leaq -0xb0(%rbp), %rdi
callq 0x5d990
jmp 0xf1f27
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xf1f16
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x5df00
leaq -0xb0(%rbp), %rdi
callq 0x5d990
jmp 0xf1fce
jmp 0xf1f29
movq -0xe0(%rbp), %rax
xorps %xmm0, %xmm0
ucomisd 0x8(%rax), %xmm0
jbe 0xf1fa8
leaq 0x11aaef(%rip), %rsi    # 0x20ca30
leaq -0xc8(%rbp), %rdi
callq 0x5b6d0
jmp 0xf1f4f
movq -0xf0(%rbp), %rsi
leaq -0xc8(%rbp), %rdi
callq 0x5a710
movq %rax, -0x138(%rbp)
jmp 0xf1f6b
movq -0x138(%rbp), %rsi
movq -0xf0(%rbp), %rdi
callq 0x59760
jmp 0xf1f80
leaq -0xc8(%rbp), %rdi
callq 0x5df00
jmp 0xf1fa8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x5df00
jmp 0xf1fce
movb $0x1, -0x35(%rbp)
testb $0x1, -0x35(%rbp)
jne 0xf1fbe
movq -0xf0(%rbp), %rdi
callq 0x5df00
movq -0xe8(%rbp), %rax
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
movq -0xf0(%rbp), %rdi
callq 0x5df00
movq -0x50(%rbp), %rdi
callq 0x5b6b0
nopw %cs:(%rax,%rax)