// File: /workspace/github_c_makefile_star2_O1/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 0x55fe
movl $0x2d, %edi
movapd %xmm0, (%rsp)
callq 0x1090
movapd (%rsp), %xmm0
xorpd 0x2dd2(%rip), %xmm0     # 0x83d0
ucomisd %xmm0, %xmm0
jp 0x581a
movq %xmm0, %rax
btrq $0x3f, %rax
movabsq $0x7ff0000000000000, %rcx # imm = 0x7FF0000000000000
cmpq %rcx, %rax
jne 0x563c
leaq 0x32ea(%rip), %rdi      # 0x8912
movl $0x3, %esi
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x53f7
movsd 0x31cc(%rip), %xmm1     # 0x8810
ucomisd %xmm0, %xmm1
jb 0x566a
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x566a
leaq 0x3453(%rip), %rdi      # 0x8aae
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5324
movsd 0x31a6(%rip), %xmm1     # 0x8818
ucomisd %xmm0, %xmm1
jbe 0x571a
cvttsd2si %xmm0, %rax
movl %eax, %ecx
xorps %xmm1, %xmm1
cvtsi2sd %rcx, %xmm1
movapd %xmm0, %xmm2
subsd %xmm1, %xmm2
mulsd 0x319d(%rip), %xmm2     # 0x8838
movsd 0x2d4d(%rip), %xmm1     # 0x83f0
addsd %xmm2, %xmm1
cvttsd2si %xmm1, %ecx
cvttpd2dq %xmm1, %xmm1
cvtdq2pd %xmm1, %xmm1
ucomisd %xmm2, %xmm1
jbe 0x56ec
leal -0x1(%rcx), %edx
xorps %xmm1, %xmm1
cvtsi2sd %edx, %xmm1
subsd %xmm1, %xmm2
movsd 0x2d21(%rip), %xmm1     # 0x83f0
ucomisd %xmm2, %xmm1
jb 0x56ec
testb $0x1, %cl
cmovel %ecx, %edx
movsd 0x314d(%rip), %xmm1     # 0x8830
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 0x5514
movl %ebx, %edi
movl $0x186a0, %esi          # imm = 0x186A0
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5826
movapd %xmm0, %xmm4
divsd 0x30fa(%rip), %xmm4     # 0x8820
movl $0x9, %ebp
ucomisd 0x30f5(%rip), %xmm4     # 0x8828
jb 0x575d
movsd 0x30e3(%rip), %xmm1     # 0x8820
movsd 0x30e3(%rip), %xmm2     # 0x8828
movapd %xmm1, %xmm3
mulsd %xmm1, %xmm3
incl %ebp
movapd %xmm0, %xmm4
divsd %xmm3, %xmm4
ucomisd %xmm2, %xmm4
jae 0x5749
movsd 0x2c8b(%rip), %xmm1     # 0x83f0
addsd %xmm4, %xmm1
cvttsd2si %xmm1, %eax
cvttpd2dq %xmm1, %xmm1
cvtdq2pd %xmm1, %xmm1
ucomisd %xmm4, %xmm1
jbe 0x57ad
leal -0x1(%rax), %ecx
xorps %xmm1, %xmm1
cvtsi2sd %ecx, %xmm1
subsd %xmm1, %xmm4
movsd 0x2c5f(%rip), %xmm1     # 0x83f0
ucomisd %xmm4, %xmm1
jb 0x57ad
testb $0x1, %al
cmovel %eax, %ecx
movsd 0x308c(%rip), %xmm1     # 0x8830
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 0x5826
movl $0x65, %edi
callq 0x1090
movl $0x2b, %edi
callq 0x1090
cmpl $0x9, %ebp
ja 0x5809
movl $0x30, %edi
callq 0x1090
movl %ebp, %edi
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x54f5
leaq 0x30ed(%rip), %rdi      # 0x890e
jmp 0x565b