// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: format_chooser
static s7_pointer format_chooser(s7_scheme *sc, s7_pointer f, int32_t args, s7_pointer expr, bool ops)
                {
                    if (args > 1)
                    {
                        s7_pointer port, str_arg;
                        port = cadr(expr);
                        str_arg = caddr(expr);
                        if (is_string(str_arg))
                        {
                            if ((ops) && ((args == 2) || (args == 3)))
                            {
                                s7_int len;
                                char *orig;
                                const char *p;

                                orig = string_value(str_arg);
                                p = strchr((const char *)orig, (int)'~');
                                if (!p)
                                {
                                    if (args == 2)
                                        return(sc->format_just_control_string);
                                    return(f);
                                }

                                len = string_length(str_arg);
                                if ((args == 2) &&
                                        (len > 1) &&
                                        (orig[len - 1] == '%') &&
                                        ((p - orig) == len - 2))
                                {
                                    orig[len - 2] = '\n';
                                    orig[len - 1] = '\0';
                                    string_length(str_arg) = len - 1;
                                    return(sc->format_just_control_string);
                                }

                                if ((args == 3) &&
                                        (len == 2) &&
                                        (port == sc->F) &&
                                        (orig[0] == '~') &&
                                        ((orig[1] == 'A') || (orig[1] == 'a')))
                                    return(sc->format_as_objstr);
                            }

                            /* this used to worry about optimized expr and particular cases -- why? I can't find a broken case */
                            if (!is_columnizing(string_value(str_arg)))
                                return(sc->format_allg_no_column);
                        }
                        if (port == sc->F)
                            return(sc->format_f);
                    }
                    return(f);
                }

// Assembly:
subq $0x58, %rsp
movb %r8b, %al
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movl %edx, 0x3c(%rsp)
movq %rcx, 0x30(%rsp)
andb $0x1, %al
movb %al, 0x2f(%rsp)
cmpl $0x1, 0x3c(%rsp)
jle 0x1d7122
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x13, %eax
jne 0x1d70fa
testb $0x1, 0x2f(%rsp)
je 0x1d70d3
cmpl $0x2, 0x3c(%rsp)
je 0x1d6f81
cmpl $0x3, 0x3c(%rsp)
jne 0x1d70d3
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rdi
movl $0x7e, %esi
callq 0x91d0
movq %rax, (%rsp)
cmpq $0x0, (%rsp)
jne 0x1d6fd5
cmpl $0x2, 0x3c(%rsp)
jne 0x1d6fc6
movq 0x48(%rsp), %rax
movq 0x1bc0(%rax), %rax
movq %rax, 0x50(%rsp)
jmp 0x1d712c
movq 0x40(%rsp), %rax
movq %rax, 0x50(%rsp)
jmp 0x1d712c
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
cmpl $0x2, 0x3c(%rsp)
jne 0x1d7073
cmpq $0x1, 0x10(%rsp)
jle 0x1d7073
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
subq $0x1, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x25, %eax
jne 0x1d7073
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
subq %rcx, %rax
movq 0x10(%rsp), %rcx
subq $0x2, %rcx
cmpq %rcx, %rax
jne 0x1d7073
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
subq $0x2, %rcx
movb $0xa, (%rax,%rcx)
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
subq $0x1, %rcx
movb $0x0, (%rax,%rcx)
movq 0x10(%rsp), %rcx
subq $0x1, %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x48(%rsp), %rax
movq 0x1bc0(%rax), %rax
movq %rax, 0x50(%rsp)
jmp 0x1d712c
cmpl $0x3, 0x3c(%rsp)
jne 0x1d70d1
cmpq $0x2, 0x10(%rsp)
jne 0x1d70d1
movq 0x20(%rsp), %rax
movq 0x48(%rsp), %rcx
cmpq 0x120(%rcx), %rax
jne 0x1d70d1
movq 0x8(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x7e, %eax
jne 0x1d70d1
movq 0x8(%rsp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x41, %eax
je 0x1d70be
movq 0x8(%rsp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x61, %eax
jne 0x1d70d1
movq 0x48(%rsp), %rax
movq 0x1bc8(%rax), %rax
movq %rax, 0x50(%rsp)
jmp 0x1d712c
jmp 0x1d70d3
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x1d9420
testb $0x1, %al
jne 0x1d70f8
movq 0x48(%rsp), %rax
movq 0x1bb8(%rax), %rax
movq %rax, 0x50(%rsp)
jmp 0x1d712c
jmp 0x1d70fa
movq 0x20(%rsp), %rax
movq 0x48(%rsp), %rcx
cmpq 0x120(%rcx), %rax
jne 0x1d7120
movq 0x48(%rsp), %rax
movq 0x1bb0(%rax), %rax
movq %rax, 0x50(%rsp)
jmp 0x1d712c
jmp 0x1d7122
movq 0x40(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)