// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x58, %rsp
movb %r9b, %al
movq 0x68(%rsp), %r9
movb 0x60(%rsp), %r9b
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movl %edx, 0x44(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x30(%rsp)
movb %al, 0x2f(%rsp)
movq $0x0, 0x10(%rsp)
cmpq $0x0, 0x38(%rsp)
jge 0xd6ee7
movq $0x0, 0x38(%rsp)
cmpq $0x0, 0x30(%rsp)
jge 0xd6f4a
movsbl 0x2f(%rsp), %eax
cmpl $0x65, %eax
je 0xd6f0d
movsbl 0x2f(%rsp), %eax
cmpl $0x66, %eax
je 0xd6f0d
movsbl 0x2f(%rsp), %eax
cmpl $0x67, %eax
jne 0xd6f18
movq $0x6, 0x30(%rsp)
jmp 0xd6f48
movq 0x48(%rsp), %rax
movq 0x20(%rax), %rax
movq 0x8(%rax), %rax
movzbl (%rax), %eax
addl $-0xb, %eax
subl $0x1, %eax
ja 0xd6f3d
jmp 0xd6f32
movq $0x0, 0x30(%rsp)
jmp 0xd6f46
movq $0x6, 0x30(%rsp)
jmp 0xd6f48
jmp 0xd6f4a
movsbl 0x60(%rsp), %eax
cmpl $0x20, %eax
je 0xd7048
cmpl $0xa, 0x44(%rsp)
jne 0xd6f99
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %rax
movq 0x20(%rax), %rax
movq 0x8(%rax), %rsi
movq 0x38(%rsp), %rdx
movq 0x30(%rsp), %rcx
leaq 0x10(%rsp), %r9
movsbl 0x2f(%rsp), %r8d
movl $0x1, (%rsp)
callq 0xc66e0
movq %rax, 0x20(%rsp)
jmp 0xd6fdf
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %rax
movq 0x20(%rax), %rax
movq 0x8(%rax), %rsi
movl 0x44(%rsp), %edx
movq 0x38(%rsp), %rcx
movq 0x30(%rsp), %r8
leaq 0x10(%rsp), %rax
movsbl 0x2f(%rsp), %r9d
movq %rax, (%rsp)
callq 0x129b0
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
jne 0xd700f
movb 0x60(%rsp), %cl
movq 0x8(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x8(%rsp)
movb %cl, (%rax)
jmp 0xd6fe9
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq 0x68(%rsp), %r8
callq 0xd5800
cmpl $0xa, 0x44(%rsp)
je 0xd7043
movq 0x50(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0xb230
jmp 0xd7105
cmpl $0xa, 0x44(%rsp)
jne 0xd7089
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %rax
movq 0x20(%rax), %rax
movq 0x8(%rax), %rsi
movq 0x38(%rsp), %rdx
movq 0x30(%rsp), %rcx
leaq 0x10(%rsp), %r9
movsbl 0x2f(%rsp), %r8d
movl $0x1, (%rsp)
callq 0xc66e0
movq %rax, 0x20(%rsp)
jmp 0xd70cf
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %rax
movq 0x20(%rax), %rax
movq 0x8(%rax), %rsi
movl 0x44(%rsp), %edx
movq 0x38(%rsp), %rcx
movq 0x30(%rsp), %r8
leaq 0x10(%rsp), %rax
movsbl 0x2f(%rsp), %r9d
movq %rax, (%rsp)
callq 0x129b0
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq 0x68(%rsp), %r8
callq 0xd5800
cmpl $0xa, 0x44(%rsp)
je 0xd7103
movq 0x50(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0xb230
jmp 0xd7105
movq 0x48(%rsp), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rax)
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)