// File: /workspace/github_c_makefile_star2_O3/BernardTatin[P]s7sh/s7.c
// Function: g_stacktrace
static s7_pointer g_stacktrace(s7_scheme *sc, s7_pointer args)
                {
#define H_stacktrace "(stacktrace (max-frames 30) (code-cols 50) (total-cols 80) (note-col 50) as-comment) returns \
                    a stacktrace as a string.  Each line has two portions, the code being evaluated and a note giving \
                    the value of local variables in that code.  The first argument sets how many lines are displayed. \
                    The next three arguments set the length and layout of those lines.  'as-comment' if #t causes each \
                    line to be preceded by a semicolon."
#define Q_stacktrace s7_make_signature(sc, 6, sc->is_string_symbol, sc->is_integer_symbol, sc->is_integer_symbol, sc->is_integer_symbol, sc->is_integer_symbol, sc->is_boolean_symbol)

                    s7_int max_frames = 30, code_cols = 50, total_cols = 80, notes_start_col = 50;
                    bool as_comment = false;

                    if (!is_null(args))
                    {
                        if (!s7_is_integer(car(args)))
                            return(method_or_bust(sc, car(args), sc->stacktrace_symbol, args, T_INTEGER, 1));
                        max_frames = s7_integer(car(args));
                        if ((max_frames <= 0) || (max_frames > s7_int32_max))
                            max_frames = 30;
                        args = cdr(args);
                        if (!is_null(args))
                        {
                            if (!s7_is_integer(car(args)))
                                return(wrong_type_argument(sc, sc->stacktrace_symbol, 2, car(args), T_INTEGER));
                            code_cols = s7_integer(car(args));
                            if ((code_cols <= 8) || (code_cols > 1024))
                                code_cols = 50;
                            args = cdr(args);
                            if (!is_null(args))
                            {
                                if (!s7_is_integer(car(args)))
                                    return(wrong_type_argument(sc, sc->stacktrace_symbol, 3, car(args), T_INTEGER));
                                total_cols = s7_integer(car(args));
                                if ((total_cols <= code_cols) || (total_cols > s7_int32_max))
                                    total_cols = 80;
                                args = cdr(args);
                                if (!is_null(args))
                                {
                                    if (!s7_is_integer(car(args)))
                                        return(wrong_type_argument(sc, sc->stacktrace_symbol, 4, car(args), T_INTEGER));
                                    notes_start_col = s7_integer(car(args));
                                    if ((notes_start_col <= 0) || (notes_start_col > s7_int32_max))
                                        notes_start_col = 50;
                                    args = cdr(args);
                                    if (!is_null(args))
                                    {
                                        if (!s7_is_boolean(car(args)))
                                            return(wrong_type_argument(sc, sc->stacktrace_symbol, 5, car(args), T_BOOLEAN));
                                        as_comment = s7_boolean(sc, car(args));
                                    }
                                }
                            }
                        }
                    }
                    return(stacktrace_1(sc, max_frames, code_cols, total_cols, notes_start_col, as_comment));
                }

// Assembly:
movq 0x110(%rdi), %r9
movl $0x50, %ecx
movl $0x32, %r8d
cmpq %rsi, %r9
je 0x7ead2
movq %rsi, %rax
movq 0x8(%rsi), %rsi
cmpb $0xb, (%rsi)
jne 0x7eae7
movq 0x8(%rsi), %rsi
testq %rsi, %rsi
jle 0x7e9fa
xorl %edx, %edx
cmpb $0x0, 0xd69f9(%rip)     # 0x1553e4
movl $0x7fffffff, %r10d      # imm = 0x7FFFFFFF
cmoveq %rdx, %r10
cmpq %r10, %rsi
jbe 0x7e9ff
movl $0x1e, %esi
movq 0x10(%rax), %r10
cmpq %r9, %r10
je 0x7ead7
movq 0x8(%r10), %rax
cmpb $0xb, (%rax)
jne 0x7eb02
movq 0x8(%rax), %rdx
leaq -0x401(%rdx), %rax
cmpq $-0x3f8, %rax           # imm = 0xFC08
cmovbq %r8, %rdx
movq 0x10(%r10), %rax
cmpq %r9, %rax
je 0x7eb2a
movq 0x8(%rax), %rcx
cmpb $0xb, (%rcx)
jne 0x7eb2e
movq 0x8(%rcx), %rcx
cmpq %rdx, %rcx
jle 0x7ea6a
xorl %r10d, %r10d
cmpb $0x0, 0xd6989(%rip)     # 0x1553e4
movl $0x7fffffff, %r11d      # imm = 0x7FFFFFFF
cmoveq %r10, %r11
cmpq %r11, %rcx
jle 0x7ea6f
movl $0x50, %ecx
movq 0x10(%rax), %r10
cmpq %r9, %r10
je 0x7eb2a
movq 0x8(%r10), %rax
cmpb $0xb, (%rax)
jne 0x7eb53
movq 0x8(%rax), %r8
testq %r8, %r8
jle 0x7eaaa
xorl %eax, %eax
cmpb $0x0, 0xd6949(%rip)     # 0x1553e4
movl $0x7fffffff, %r11d      # imm = 0x7FFFFFFF
cmoveq %rax, %r11
cmpq %r11, %r8
jbe 0x7eab0
movl $0x32, %r8d
movq 0x10(%r10), %rax
cmpq %r9, %rax
je 0x7eb2a
movq 0x8(%rax), %rax
cmpb $0x7, (%rax)
jne 0x7eb67
cmpq %rax, 0x120(%rdi)
setne %al
jmp 0x7eade
movl $0x1e, %esi
xorl %eax, %eax
movl $0x32, %edx
movzbl %al, %r9d
jmp 0x4308a
movq 0x14f8(%rdi), %rdx
movq %rax, %rcx
movl $0xb, %r8d
movl $0x1, %r9d
jmp 0xe42d
movq 0x14f8(%rdi), %rcx
movq 0x8(%rcx), %rsi
movq 0xc7e4c(%rip), %rdx     # 0x146960
movq 0x140(%rdi), %r8
movq 0xcbf96(%rip), %r9      # 0x14aab8
movq %rax, %rcx
jmp 0xa4e4
xorl %eax, %eax
jmp 0x7eade
movq 0x14f8(%rdi), %rax
movq 0x8(%rax), %rsi
movq 0xc7e28(%rip), %rdx     # 0x146968
movq 0x140(%rdi), %r8
movq 0xcbf6a(%rip), %r9      # 0x14aab8
jmp 0xa4e4
movq 0x14f8(%rdi), %rcx
movq 0x8(%rcx), %rsi
movq 0xc7e0b(%rip), %rdx     # 0x146970
jmp 0x7eb14
movq 0x14f8(%rdi), %rcx
movq 0x8(%rcx), %rsi
movq 0xc7dff(%rip), %rdx     # 0x146978
movq 0x140(%rdi), %r8
movq 0xcbf11(%rip), %r9      # 0x14aa98
jmp 0x7eb22