// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: stacktrace_walker
static char *stacktrace_walker(s7_scheme *sc, s7_pointer code, s7_pointer e, char *notes,
                        s7_int code_cols, s7_int total_cols, s7_int notes_start_col,
                        bool as_comment, int32_t depth)
                {
                    if (is_symbol(code))
                    {
                        if ((!symbol_is_in_list(sc, code)) &&
                                (!is_slot(global_slot(code))))
                        {
                            s7_pointer val;

                            add_symbol_to_list(sc, code);
                            val = s7_symbol_local_value(sc, code, e);
                            if ((val) &&
                                    (val != sc->undefined) &&
                                    (!is_any_macro(val)))
                            {
                                int32_t typ;

                                typ = type(val);
                                if (typ < T_CONTINUATION)
                                {
                                    char *objstr, *str;
                                    s7_pointer objp;
                                    const char *spaces;
                                    s7_int new_note_len, notes_max, spaces_len;
                                    bool new_notes_line = false, old_short_print;
                                    s7_int old_len, objlen;

                                    spaces = "                                                                                ";
                                    spaces_len = 80;

                                    if (notes_start_col < 0) notes_start_col = 50;
                                    if (notes_start_col > total_cols) notes_start_col = 0;
                                    notes_max = total_cols - notes_start_col;

                                    old_short_print = sc->short_print;
                                    sc->short_print = true;
                                    old_len = sc->print_length;
                                    if (sc->print_length > 4) sc->print_length = 4;
                                    objp = s7_object_to_string(sc, val, false);
                                    objstr = string_value(objp);
                                    objlen = string_length(objp);
                                    if ((objlen > notes_max) &&
                                            (notes_max > 5))
                                    {
                                        objstr[notes_max - 4] = '.';
                                        objstr[notes_max - 3] = '.';
                                        objstr[notes_max - 2] = '.';
                                        objstr[notes_max - 1] = '\0';
                                        objlen = notes_max;
                                    }
                                    sc->short_print = old_short_print;
                                    sc->print_length = old_len;

                                    new_note_len = symbol_name_length(code) + 3 + objlen;
                                    /* we want to append this much info to the notes, but does it need a new line? */
                                    if (notes_start_col < code_cols)
                                        new_notes_line = true;
                                    else
                                    {
                                        if (notes)
                                        {
                                            char *last_newline;
                                            s7_int cur_line_len;
                                            last_newline = strrchr(notes, (int)'\n'); /* returns ptr to end if none = nil if not found? */
                                            if (last_newline)
                                                cur_line_len = strlen(notes) - strlen(last_newline);
                                            else cur_line_len = strlen(notes);
                                            new_notes_line = ((cur_line_len + new_note_len) > notes_max);
                                        }
                                    }

                                    if (new_notes_line)
                                    {
                                        new_note_len += (4 + notes_start_col + ((notes) ? strlen(notes) : 0));
                                        str = (char *)malloc(new_note_len);
                                        /* str[0] = '\0'; */
                                        catstrs_direct(str,
                                                (notes) ? notes : "",
                                                "\n",
                                                (as_comment) ? "; " : "",
                                                (spaces_len >= notes_start_col) ? (char *)(spaces + spaces_len - notes_start_col) : "",
                                                (as_comment) ? "" : " ; ",
                                                symbol_name(code),
                                                ": ",
                                                objstr, NULL);
                                    }
                                    else
                                    {
                                        new_note_len += ((notes) ? strlen(notes) : 0) + 4;
                                        str = (char *)malloc(new_note_len);
                                        /* str[0] = '\0'; */
                                        catstrs_direct(str,
                                                (notes) ? notes : "",
                                                (notes) ? ", " : " ; ",
                                                symbol_name(code),
                                                ": ",
                                                objstr, NULL);
                                    }
                                    if (notes) free(notes);
                                    return(str);
                                }
                            }
                        }
                        return(notes);
                    }
                    if ((is_pair(code)) &&
                            (s7_list_length(sc, code) > 0) &&
                            (depth < 32))
                    {
                        notes = stacktrace_walker(sc, car(code), e, notes, code_cols, total_cols, notes_start_col, as_comment, depth + 1);
                        return(stacktrace_walker(sc, cdr(code), e, notes, code_cols, total_cols, notes_start_col, as_comment, depth + 2));
                    }
                    return(notes);
                }

// Assembly:
pushq %rbx
subq $0x130, %rsp            # imm = 0x130
movl 0x150(%rsp), %eax
movb 0x148(%rsp), %al
movq 0x140(%rsp), %r10
movq %rdi, 0x120(%rsp)
movq %rsi, 0x118(%rsp)
movq %rdx, 0x110(%rsp)
movq %rcx, 0x108(%rsp)
movq %r8, 0x100(%rsp)
movq %r9, 0xf8(%rsp)
andb $0x1, %al
movb %al, 0xf7(%rsp)
movq 0x118(%rsp), %rax
movzbl (%rax), %eax
cmpl $0xa, %eax
jne 0xdd9f5
movq 0x118(%rsp), %rax
movl 0x2c(%rax), %eax
movq 0x120(%rsp), %rcx
cmpl 0xa88(%rcx), %eax
jne 0xdd3bd
movq 0x118(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x20(%rax), %rax
movl 0xc(%rax), %eax
movq 0x120(%rsp), %rcx
cmpl 0xa8c(%rcx), %eax
je 0xdd9e0
movq 0x118(%rsp), %rax
movq 0x10(%rax), %rax
movzbl (%rax), %eax
cmpl $0x20, %eax
je 0xdd9e0
movq 0x120(%rsp), %rdi
movq 0x118(%rsp), %rsi
callq 0xde160
movq 0x120(%rsp), %rdi
movq 0x118(%rsp), %rsi
movq 0x110(%rsp), %rdx
callq 0xfe00
movq %rax, 0xe8(%rsp)
cmpq $0x0, 0xe8(%rsp)
je 0xdd9de
movq 0xe8(%rsp), %rax
movq 0x120(%rsp), %rcx
cmpq 0x128(%rcx), %rax
je 0xdd9de
movq 0xe8(%rsp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x13ea51(%rip), %rax    # 0x21bea0
testb $0x1, (%rax,%rcx)
jne 0xdd9de
movq 0xe8(%rsp), %rax
movzbl (%rax), %eax
movl %eax, 0xe4(%rsp)
cmpl $0x25, 0xe4(%rsp)
jge 0xdd9dc
movb $0x0, 0xa7(%rsp)
leaq 0x111b88(%rip), %rax    # 0x1ef010
movq %rax, 0xc0(%rsp)
movq $0x50, 0xa8(%rsp)
cmpq $0x0, 0x140(%rsp)
jge 0xdd4b3
movq $0x32, 0x140(%rsp)
movq 0x140(%rsp), %rax
cmpq 0xf8(%rsp), %rax
jle 0xdd4d1
movq $0x0, 0x140(%rsp)
movq 0xf8(%rsp), %rax
subq 0x140(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq 0x120(%rsp), %rax
movb 0x248(%rax), %al
andb $0x1, %al
movb %al, 0xa6(%rsp)
movq 0x120(%rsp), %rax
movb $0x1, 0x248(%rax)
movq 0x120(%rsp), %rax
movq 0x280(%rax), %rax
movq %rax, 0x98(%rsp)
movq 0x120(%rsp), %rax
cmpq $0x4, 0x280(%rax)
jle 0xdd54b
movq 0x120(%rsp), %rax
movq $0x4, 0x280(%rax)
movq 0x120(%rsp), %rdi
movq 0xe8(%rsp), %rsi
xorl %edx, %edx
callq 0x2cd00
movq %rax, 0xc8(%rsp)
movq 0xc8(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0xd8(%rsp)
movq 0xc8(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rax
cmpq 0xb0(%rsp), %rax
jle 0xdd61f
cmpq $0x5, 0xb0(%rsp)
jle 0xdd61f
movq 0xd8(%rsp), %rax
movq 0xb0(%rsp), %rcx
subq $0x4, %rcx
movb $0x2e, (%rax,%rcx)
movq 0xd8(%rsp), %rax
movq 0xb0(%rsp), %rcx
subq $0x3, %rcx
movb $0x2e, (%rax,%rcx)
movq 0xd8(%rsp), %rax
movq 0xb0(%rsp), %rcx
subq $0x2, %rcx
movb $0x2e, (%rax,%rcx)
movq 0xd8(%rsp), %rax
movq 0xb0(%rsp), %rcx
subq $0x1, %rcx
movb $0x0, (%rax,%rcx)
movq 0xb0(%rsp), %rax
movq %rax, 0x90(%rsp)
movb 0xa6(%rsp), %cl
movq 0x120(%rsp), %rax
andb $0x1, %cl
movb %cl, 0x248(%rax)
movq 0x98(%rsp), %rcx
movq 0x120(%rsp), %rax
movq %rcx, 0x280(%rax)
movq 0x118(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
addq $0x3, %rax
addq 0x90(%rsp), %rax
movq %rax, 0xb8(%rsp)
movq 0x140(%rsp), %rax
cmpq 0x100(%rsp), %rax
jge 0xdd691
movb $0x1, 0xa7(%rsp)
jmp 0xdd734
cmpq $0x0, 0x108(%rsp)
je 0xdd732
movq 0x108(%rsp), %rdi
movl $0xa, %esi
callq 0x9220
movq %rax, 0x88(%rsp)
cmpq $0x0, 0x88(%rsp)
je 0xdd6f9
movq 0x108(%rsp), %rdi
callq 0x91a0
movq %rax, 0x78(%rsp)
movq 0x88(%rsp), %rdi
callq 0x91a0
movq %rax, %rcx
movq 0x78(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x80(%rsp)
jmp 0xdd70e
movq 0x108(%rsp), %rdi
callq 0x91a0
movq %rax, 0x80(%rsp)
movq 0x80(%rsp), %rax
addq 0xb8(%rsp), %rax
cmpq 0xb0(%rsp), %rax
setg %al
andb $0x1, %al
movb %al, 0xa7(%rsp)
jmp 0xdd734
testb $0x1, 0xa7(%rsp)
je 0xdd8cc
movq 0x140(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x70(%rsp)
cmpq $0x0, 0x108(%rsp)
je 0xdd772
movq 0x108(%rsp), %rdi
callq 0x91a0
movq %rax, 0x68(%rsp)
jmp 0xdd77b
xorl %eax, %eax
movq %rax, 0x68(%rsp)
jmp 0xdd77b
movq 0x70(%rsp), %rax
movq 0x68(%rsp), %rcx
addq %rcx, %rax
addq 0xb8(%rsp), %rax
movq %rax, 0xb8(%rsp)
movq 0xb8(%rsp), %rdi
callq 0x9480
movq %rax, 0xd0(%rsp)
movq 0xd0(%rsp), %rax
movq %rax, 0x60(%rsp)
cmpq $0x0, 0x108(%rsp)
je 0xdd7d4
movq 0x108(%rsp), %rax
movq %rax, 0x58(%rsp)
jmp 0xdd7e2
leaq 0x116cde(%rip), %rax    # 0x1f44b9
movq %rax, 0x58(%rsp)
jmp 0xdd7e2
movq 0x58(%rsp), %rax
movq %rax, 0x48(%rsp)
movb 0xf7(%rsp), %dl
leaq 0x116cbf(%rip), %rax    # 0x1f44b9
leaq 0x111861(%rip), %rcx    # 0x1ef062
testb $0x1, %dl
cmovneq %rcx, %rax
movq %rax, 0x50(%rsp)
movq 0xa8(%rsp), %rax
cmpq 0x140(%rsp), %rax
jl 0xdd843
movq 0xc0(%rsp), %rax
addq 0xa8(%rsp), %rax
xorl %ecx, %ecx
subq 0x140(%rsp), %rcx
addq %rcx, %rax
movq %rax, 0x40(%rsp)
jmp 0xdd851
leaq 0x116c6f(%rip), %rax    # 0x1f44b9
movq %rax, 0x40(%rsp)
jmp 0xdd851
movq 0x50(%rsp), %rcx
movq 0x48(%rsp), %rsi
movq 0x60(%rsp), %rdi
movq 0x40(%rsp), %r8
movb 0xf7(%rsp), %dl
leaq 0x1117ee(%rip), %r9     # 0x1ef061
leaq 0x116c3f(%rip), %rax    # 0x1f44b9
testb $0x1, %dl
cmovneq %rax, %r9
movq 0x118(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %r11
movq 0xd8(%rsp), %rax
leaq 0x116c18(%rip), %rdx    # 0x1f44b8
leaq 0x104382(%rip), %r10    # 0x1e1c29
xorl %ebx, %ebx
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movb $0x0, %al
callq 0x10540
jmp 0xdd9af
cmpq $0x0, 0x108(%rsp)
je 0xdd8eb
movq 0x108(%rsp), %rdi
callq 0x91a0
movq %rax, 0x38(%rsp)
jmp 0xdd8f4
xorl %eax, %eax
movq %rax, 0x38(%rsp)
jmp 0xdd8f4
movq 0x38(%rsp), %rax
addq $0x4, %rax
addq 0xb8(%rsp), %rax
movq %rax, 0xb8(%rsp)
movq 0xb8(%rsp), %rdi
callq 0x9480
movq %rax, 0xd0(%rsp)
movq 0xd0(%rsp), %rax
movq %rax, 0x30(%rsp)
cmpq $0x0, 0x108(%rsp)
je 0xdd949
movq 0x108(%rsp), %rax
movq %rax, 0x28(%rsp)
jmp 0xdd957
leaq 0x116b69(%rip), %rax    # 0x1f44b9
movq %rax, 0x28(%rsp)
jmp 0xdd957
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x108(%rsp), %rcx
leaq 0x1116f1(%rip), %rdx    # 0x1ef061
leaq 0x1116ee(%rip), %rax    # 0x1ef065
cmpq $0x0, %rcx
cmovneq %rax, %rdx
movq 0x118(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rcx
movq 0xd8(%rsp), %r9
leaq 0x10428b(%rip), %r8     # 0x1e1c29
xorl %eax, %eax
movq $0x0, (%rsp)
movb $0x0, %al
callq 0x10540
cmpq $0x0, 0x108(%rsp)
je 0xdd9c7
movq 0x108(%rsp), %rdi
callq 0x9050
movq 0xd0(%rsp), %rax
movq %rax, 0x128(%rsp)
jmp 0xddb28
jmp 0xdd9de
jmp 0xdd9e0
movq 0x108(%rsp), %rax
movq %rax, 0x128(%rsp)
jmp 0xddb28
movq 0x118(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0xddb18
movq 0x120(%rsp), %rdi
movq 0x118(%rsp), %rsi
callq 0x31900
cmpq $0x0, %rax
jle 0xddb18
cmpl $0x20, 0x150(%rsp)
jge 0xddb18
movq 0x120(%rsp), %rdi
movq 0x118(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x110(%rsp), %rdx
movq 0x108(%rsp), %rcx
movq 0x100(%rsp), %r8
movq 0xf8(%rsp), %r9
movq 0x140(%rsp), %r11
movb 0xf7(%rsp), %r10b
movl 0x150(%rsp), %eax
addl $0x1, %eax
andb $0x1, %r10b
movq %r11, (%rsp)
movzbl %r10b, %r10d
movl %r10d, 0x8(%rsp)
movl %eax, 0x10(%rsp)
callq 0xdd310
movq %rax, 0x108(%rsp)
movq 0x120(%rsp), %rdi
movq 0x118(%rsp), %rax
movq 0x10(%rax), %rsi
movq 0x110(%rsp), %rdx
movq 0x108(%rsp), %rcx
movq 0x100(%rsp), %r8
movq 0xf8(%rsp), %r9
movq 0x140(%rsp), %r11
movb 0xf7(%rsp), %r10b
movl 0x150(%rsp), %eax
addl $0x2, %eax
andb $0x1, %r10b
movq %r11, (%rsp)
movzbl %r10b, %r10d
movl %r10d, 0x8(%rsp)
movl %eax, 0x10(%rsp)
callq 0xdd310
movq %rax, 0x128(%rsp)
jmp 0xddb28
movq 0x108(%rsp), %rax
movq %rax, 0x128(%rsp)
movq 0x128(%rsp), %rax
addq $0x130, %rsp            # imm = 0x130
popq %rbx
retq
nopl (%rax)