// File: /workspace/github_c_makefile_star2_O2/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 %rbx
subq $0x18, %rsp
movapd %xmm0, %xmm4
xorpd %xmm0, %xmm0
ucomisd %xmm4, %xmm0
jbe 0x5161
pushq $0x2d
popq %rdi
movapd %xmm4, (%rsp)
callq 0x1080
movapd (%rsp), %xmm4
xorpd 0x325f(%rip), %xmm4     # 0x83c0
ucomisd %xmm4, %xmm4
jp 0x532d
movq %xmm4, %rax
btrq $0x3f, %rax
movabsq $0x7ff0000000000000, %rcx # imm = 0x7FF0000000000000
cmpq %rcx, %rax
jne 0x5199
leaq 0x3777(%rip), %rdi      # 0x8902
pushq $0x3
popq %rsi
addq $0x18, %rsp
popq %rbx
popq %rbp
jmp 0x4f86
movsd 0x365f(%rip), %xmm0     # 0x8800
ucomisd %xmm4, %xmm0
jb 0x51c3
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm4
jbe 0x51c3
leaq 0x38e6(%rip), %rdi      # 0x8a9e
addq $0x18, %rsp
popq %rbx
popq %rbp
jmp 0x4eb4
movsd 0x363d(%rip), %xmm0     # 0x8808
ucomisd %xmm4, %xmm0
jbe 0x5269
cvttsd2si %xmm4, %rax
movl %eax, %ecx
cvtsi2sd %rcx, %xmm1
movapd %xmm4, %xmm0
subsd %xmm1, %xmm0
mulsd 0x3637(%rip), %xmm0     # 0x8828
movsd 0x31e7(%rip), %xmm1     # 0x83e0
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %ecx
cvttpd2dq %xmm1, %xmm1
cvtdq2pd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jbe 0x523f
leal -0x1(%rcx), %edx
cvtsi2sd %edx, %xmm1
subsd %xmm1, %xmm0
movsd 0x31be(%rip), %xmm1     # 0x83e0
ucomisd %xmm0, %xmm1
jb 0x523f
testb $0x1, %cl
cmovel %ecx, %edx
movsd 0x35ea(%rip), %xmm0     # 0x8820
ucomisd %xmm4, %xmm0
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 0x5089
movl %ebx, %edi
movl $0x186a0, %esi          # imm = 0x186A0
addq $0x18, %rsp
popq %rbx
popq %rbp
jmp 0x5339
movsd 0x359f(%rip), %xmm0     # 0x8810
pushq $0x9
popq %rbx
movsd 0x359c(%rip), %xmm2     # 0x8818
movapd %xmm0, %xmm3
movapd %xmm4, %xmm1
divsd %xmm3, %xmm1
ucomisd %xmm2, %xmm1
jb 0x5297
mulsd %xmm0, %xmm3
incq %rbx
jmp 0x5280
movsd 0x3141(%rip), %xmm0     # 0x83e0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
cvttpd2dq %xmm0, %xmm0
cvtdq2pd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x52e4
leal -0x1(%rax), %ecx
cvtsi2sd %ecx, %xmm0
subsd %xmm0, %xmm1
movsd 0x3118(%rip), %xmm0     # 0x83e0
ucomisd %xmm1, %xmm0
jb 0x52e4
testb $0x1, %al
cmovel %eax, %ecx
movsd 0x3545(%rip), %xmm0     # 0x8820
ucomisd %xmm4, %xmm0
cmovbel %eax, %ecx
movl %ecx, %eax
movl $0x5f5e100, %ecx        # imm = 0x5F5E100
cltd
idivl %ecx
movl %edx, %ebp
leal 0x30(%rax), %edi
callq 0x1080
movl %ebp, %edi
movl $0x989680, %esi         # imm = 0x989680
callq 0x5339
pushq $0x65
popq %rdi
callq 0x1080
pushq $0x2b
popq %rdi
callq 0x1080
cmpl $0x9, %ebx
ja 0x531f
pushq $0x30
popq %rdi
callq 0x1080
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %rbp
jmp 0x506c
leaq 0x35ca(%rip), %rdi      # 0x88fe
jmp 0x51b8