// File: /workspace/github_c_makefile_star2_O3/aligusnet[P]morpheus/external/Unity/unity.c
// Function: UnityPrintFloat
void UnityPrintFloat(const UNITY_DOUBLE input_number)
{
    UNITY_DOUBLE number;

    if (input_number < 0)
    {
        UNITY_OUTPUT_CHAR('-');
        number = -input_number;
    } else
    {
        number = input_number;
    }

    if (isnan(number)) UnityPrint(UnityStrNaN);
    else if (isinf(number)) UnityPrintLen(UnityStrInf, 3);
    else if (number <= 0.0000005 && number > 0) UnityPrint("0.000000..."); /* Small number */
    else if (number < 4294967295.9999995) /* Rounded result fits in 32 bits, "%.6f" format */
    {
        const UNITY_INT32 divisor = 1000000/10;
        UNITY_UINT32 integer_part = (UNITY_UINT32)number;
        UNITY_INT32 fraction_part = (UNITY_INT32)((number - (UNITY_DOUBLE)integer_part)*1000000.0 + 0.5);
        /* Double precision calculation gives best performance for six rounded decimal places */
        ROUND_TIES_TO_EVEN(number, fraction_part, (number - (UNITY_DOUBLE)integer_part)*1000000.0);

        if (fraction_part == 1000000) /* Carry across the decimal point */
        {
            fraction_part = 0;
            integer_part += 1;
        }

        UnityPrintNumberUnsigned(integer_part);
        UnityPrintDecimalAndNumberWithLeadingZeros(fraction_part, divisor);
    }
    else /* Number is larger, use exponential format of 9 digits, "%.8e" */
    {
        const UNITY_INT32 divisor = 1000000000/10;
        UNITY_INT32 integer_part;
        UNITY_DOUBLE_TYPE divide = 10.0;
        int exponent = 9;

        while (number / divide >= 1000000000.0 - 0.5)
        {
            divide *= 10;
            exponent++;
        }
        integer_part = (UNITY_INT32)(number / divide + 0.5);
        /* Double precision calculation required for float, to produce 9 rounded digits */
        ROUND_TIES_TO_EVEN(number, integer_part, number / divide);

        UNITY_OUTPUT_CHAR('0' + integer_part / divisor);
        UnityPrintDecimalAndNumberWithLeadingZeros(integer_part % divisor, divisor / 10);
        UNITY_OUTPUT_CHAR('e');
        UNITY_OUTPUT_CHAR('+');
        if (exponent < 10) UNITY_OUTPUT_CHAR('0');
        UnityPrintNumber(exponent);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jbe 0x55d7
movl $0x2d, %edi
movapd %xmm0, (%rsp)
callq 0x1090
movapd (%rsp), %xmm0
xorpd 0x2de9(%rip), %xmm0     # 0x83c0
ucomisd %xmm0, %xmm0
jp 0x57f3
movq %xmm0, %rax
btrq $0x3f, %rax
movabsq $0x7ff0000000000000, %rcx # imm = 0x7FF0000000000000
cmpq %rcx, %rax
jne 0x5615
leaq 0x3301(%rip), %rdi      # 0x8902
movl $0x3, %esi
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x53d0
movsd 0x31e3(%rip), %xmm1     # 0x8800
ucomisd %xmm0, %xmm1
jb 0x5643
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x5643
leaq 0x346a(%rip), %rdi      # 0x8a9e
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5300
movsd 0x31bd(%rip), %xmm1     # 0x8808
ucomisd %xmm0, %xmm1
jbe 0x56f3
cvttsd2si %xmm0, %rax
movl %eax, %ecx
xorps %xmm1, %xmm1
cvtsi2sd %rcx, %xmm1
movapd %xmm0, %xmm2
subsd %xmm1, %xmm2
mulsd 0x31b4(%rip), %xmm2     # 0x8828
movsd 0x2d64(%rip), %xmm1     # 0x83e0
addsd %xmm2, %xmm1
cvttsd2si %xmm1, %ecx
cvttpd2dq %xmm1, %xmm1
cvtdq2pd %xmm1, %xmm1
ucomisd %xmm2, %xmm1
jbe 0x56c5
leal -0x1(%rcx), %edx
xorps %xmm1, %xmm1
cvtsi2sd %edx, %xmm1
subsd %xmm1, %xmm2
movsd 0x2d38(%rip), %xmm1     # 0x83e0
ucomisd %xmm2, %xmm1
jb 0x56c5
testb $0x1, %cl
cmovel %ecx, %edx
movsd 0x3164(%rip), %xmm1     # 0x8820
ucomisd %xmm0, %xmm1
cmovbel %ecx, %edx
movl %edx, %ecx
xorl %ebx, %ebx
xorl %edi, %edi
cmpl $0xf4240, %ecx          # imm = 0xF4240
sete %dil
cmovnel %ecx, %ebx
addl %eax, %edi
callq 0x54ed
movl %ebx, %edi
movl $0x186a0, %esi          # imm = 0x186A0
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x57ff
movapd %xmm0, %xmm4
divsd 0x3111(%rip), %xmm4     # 0x8810
movl $0x9, %ebp
ucomisd 0x310c(%rip), %xmm4     # 0x8818
jb 0x5736
movsd 0x30fa(%rip), %xmm1     # 0x8810
movsd 0x30fa(%rip), %xmm2     # 0x8818
movapd %xmm1, %xmm3
mulsd %xmm1, %xmm3
incl %ebp
movapd %xmm0, %xmm4
divsd %xmm3, %xmm4
ucomisd %xmm2, %xmm4
jae 0x5722
movsd 0x2ca2(%rip), %xmm1     # 0x83e0
addsd %xmm4, %xmm1
cvttsd2si %xmm1, %eax
cvttpd2dq %xmm1, %xmm1
cvtdq2pd %xmm1, %xmm1
ucomisd %xmm4, %xmm1
jbe 0x5786
leal -0x1(%rax), %ecx
xorps %xmm1, %xmm1
cvtsi2sd %ecx, %xmm1
subsd %xmm1, %xmm4
movsd 0x2c76(%rip), %xmm1     # 0x83e0
ucomisd %xmm4, %xmm1
jb 0x5786
testb $0x1, %al
cmovel %eax, %ecx
movsd 0x30a3(%rip), %xmm1     # 0x8820
ucomisd %xmm0, %xmm1
cmovbel %eax, %ecx
movl %ecx, %eax
movslq %eax, %rbx
imulq $0x55e63b89, %rbx, %r14 # imm = 0x55E63B89
movq %r14, %r15
shrq $0x3f, %r15
sarq $0x39, %r14
leal (%r14,%r15), %edi
addl $0x30, %edi
callq 0x1090
addl %r15d, %r14d
imull $0x5f5e100, %r14d, %eax # imm = 0x5F5E100
subl %eax, %ebx
movl %ebx, %edi
movl $0x989680, %esi         # imm = 0x989680
callq 0x57ff
movl $0x65, %edi
callq 0x1090
movl $0x2b, %edi
callq 0x1090
cmpl $0x9, %ebp
ja 0x57e2
movl $0x30, %edi
callq 0x1090
movl %ebp, %edi
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x54ce
leaq 0x3104(%rip), %rdi      # 0x88fe
jmp 0x5634