// File: /workspace/github_c_makefile_star2_O2/BernardTatin[P]s7sh/s7.c
// Function: format_number
static void format_number(s7_scheme *sc, format_data *fdat, int32_t radix, s7_int width, s7_int precision, char float_choice, char pad, s7_pointer port)
    {
        char *tmp;
        block_t *b;
        s7_int nlen = 0;
        if (width < 0) width = 0;

        /* precision choice depends on float_choice if it's -1 */
        if (precision < 0)
        {
            if ((float_choice == 'e') ||
                    (float_choice == 'f') ||
                    (float_choice == 'g'))
                precision = 6;
            else
            {
                /* in the "int" cases, precision depends on the arg type */
                switch (type(car(fdat->args)))
                {
                    case T_INTEGER:
                    case T_RATIO:
                        precision = 0;
                        break;

                    default:
                        precision = 6;
                        break;
                }
            }
        }
        /* should (format #f "~F" 1/3) return "1/3"?? in CL it's "0.33333334" */

        if (pad != ' ')
        {
            char *padtmp;
#if (!WITH_GMP)
            if (radix == 10)
                tmp = number_to_string_base_10(sc, car(fdat->args), width, precision, float_choice, &nlen, P_WRITE);
            else
#endif
            {
                b = number_to_string_with_radix(sc, car(fdat->args), radix, width, precision, float_choice, &nlen);
                tmp = (char *)block_data(b);
            }
            padtmp = tmp;
            while (*padtmp == ' ') (*(padtmp++)) = pad;
            format_append_string(sc, fdat, tmp, nlen, port);
            if ((WITH_GMP) || (radix != 10)) liberate(sc, b);
        }
        else
        {
#if (!WITH_GMP)
            if (radix == 10)
                tmp = number_to_string_base_10(sc, car(fdat->args), width, precision, float_choice, &nlen, P_WRITE);
            else
#endif
            {
                b = number_to_string_with_radix(sc, car(fdat->args), radix, width, precision, float_choice, &nlen);
                tmp = (char *)block_data(b);
            }
            format_append_string(sc, fdat, tmp, nlen, port);
            if ((WITH_GMP) || (radix != 10)) liberate(sc, b);
        }
        fdat->args = cdr(fdat->args);
        fdat->ctr++;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rax
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
movb 0x50(%rsp), %r13b
andq $0x0, 0x10(%rsp)
xorl %ecx, %ecx
testq %rax, %rax
cmovgq %rax, %rcx
testq %r8, %r8
jns 0x7a9ea
leal -0x65(%r9), %eax
cmpb $0x3, %al
jae 0x7a9d2
pushq $0x6
popq %r8
jmp 0x7a9ea
movq 0x20(%rbx), %rax
movq 0x8(%rax), %rax
movb (%rax), %al
addb $-0xb, %al
xorl %edx, %edx
cmpb $0x2, %al
pushq $0x6
popq %r8
cmovbq %rdx, %r8
movq 0x58(%rsp), %r15
movq 0x20(%rbx), %rax
movq 0x8(%rax), %rsi
cmpb $0x20, %r13b
jne 0x7aa21
cmpl $0xa, %ebp
jne 0x7aa45
movsbl %r9b, %eax
leaq 0x10(%rsp), %r9
movq %r14, %rdi
movq %rcx, %rdx
movq %r8, %rcx
movl %eax, %r8d
callq 0x730a4
movq %rax, %rdx
jmp 0x7aa62
cmpl $0xa, %ebp
jne 0x7aaa4
movsbl %r9b, %eax
leaq 0x10(%rsp), %r9
movq %r14, %rdi
movq %rcx, %rdx
movq %r8, %rcx
movl %eax, %r8d
callq 0x730a4
movq %rax, %rdx
jmp 0x7aac1
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movsbl %r9b, %r9d
movq %r14, %rdi
movl %ebp, %edx
callq 0xc49c
movq %rax, %r12
movq (%rax), %rdx
movq 0x10(%rsp), %rcx
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %r8
callq 0x79ea9
cmpl $0xa, %ebp
je 0x7aa85
movq %r14, %rdi
movq %r12, %rsi
callq 0x9439
movq 0x20(%rbx), %rax
movq 0x10(%rax), %rax
movq %rax, 0x20(%rbx)
incq 0x10(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movsbl %r9b, %r9d
movq %r14, %rdi
movl %ebp, %edx
callq 0xc49c
movq %rax, %r12
movq (%rax), %rdx
movq %rdx, %rax
cmpb $0x20, (%rax)
jne 0x7aa62
movb %r13b, (%rax)
incq %rax
jmp 0x7aac4