// File: /workspace/github_c_makefile_star2_O3/BernardTatin[P]s7sh/s7.c
// Function: stacktrace_add_func
static block_t *stacktrace_add_func(s7_scheme *sc, s7_pointer f, s7_pointer code, char *errstr, char *notes, s7_int code_max, bool as_comment)
                {
                    s7_int newlen, errlen;
                    char *newstr, *str;
                    block_t *newp, *b;

                    errlen = strlen(errstr);
                    if ((is_symbol(f)) &&
                            (f != car(code)))
                    {
                        newlen = symbol_name_length(f) + errlen + 10;
                        newp = mallocate(sc, newlen);
                        newstr = (char *)block_data(newp);
                        /* newstr[0] = '\0'; */
                        errlen = catstrs_direct(newstr, symbol_name(f), ": ", errstr, NULL);
                    }
                    else
                    {
                        newlen = errlen + 8;
                        newp = mallocate(sc, newlen);
                        newstr = (char *)block_data(newp);
                        /* newstr[0] = '\0'; */
                        if ((errlen > 2) && (errstr[2] == '('))
                            errlen = catstrs_direct(newstr, "  ", errstr, NULL);
                        else
                        {
                            memcpy((void *)newstr, (void *)errstr, errlen);
                            newstr[errlen] = '\0';
                        }
                    }

                    newlen = code_max + 8 + ((notes) ? strlen(notes) : 0);
                    b = mallocate(sc, newlen);
                    str = (char *)block_data(b);
                    /* str[0] = '\0'; */

                    if (errlen >= code_max)
                    {
                        newstr[code_max - 4] = '.';
                        newstr[code_max - 3] = '.';
                        newstr[code_max - 2] = '.';
                        newstr[code_max - 1] = '\0';
                        catstrs_direct(str, (as_comment) ? "; " : "", newstr, (notes) ? notes : "", "\n", NULL);
                    }
                    else
                    {
                        /* send out newstr, pad with spaces to code_max, then notes */
                        s7_int len;
                        len = catstrs_direct(str, (as_comment) ? "; " : "", newstr, NULL);
                        if (notes)
                        {
                            s7_int i;
                            for (i = len; i < code_max - 1; i++)
                                str[i] = ' ';
                            str[i] = '\0';
                            catstrs(str, newlen, notes, "\n", NULL);
                        }
                        else catstrs(str, newlen, "\n", NULL);
                    }
                    liberate(sc, newp);
                    return(b);
                }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, 0x8(%rsp)
movq %r8, (%rsp)
movq %rcx, %r15
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %rbx
movq %rcx, %rdi
callq 0x81a0
movq %rax, %r12
cmpb $0xa, (%r13)
jne 0x9c080
cmpq %r13, 0x8(%r14)
je 0x9c080
movq 0x8(%r13), %rax
movq 0x8(%rax), %rax
leaq (%r12,%rax), %rsi
addq $0xa, %rsi
movq %rbx, %rdi
callq 0x9357
movq %rax, %r14
movq (%rax), %rbp
movq 0x8(%r13), %rax
movq 0x10(%rax), %rsi
leaq 0x6e0d3(%rip), %rdx     # 0x10a141
movq %rbp, %rdi
movq %r15, %rcx
xorl %r8d, %r8d
xorl %eax, %eax
callq 0xc442
jmp 0x9c0b6
leaq 0x8(%r12), %rsi
movq %rbx, %rdi
callq 0x9357
movq %rax, %r14
movq (%rax), %rbp
cmpq $0x3, %r12
jl 0x9c0bb
cmpb $0x28, 0x2(%r15)
jne 0x9c0bb
leaq 0x7b4f7(%rip), %rsi     # 0x11759e
movq %rbp, %rdi
movq %r15, %rdx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xc442
movq %rax, %r12
jmp 0x9c0cf
movq %rbp, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x83e0
movb $0x0, (%rbp,%r12)
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %r13
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x9c0e8
callq 0x81a0
jmp 0x9c0ea
xorl %eax, %eax
addq %rax, %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x9357
movq %rax, 0x10(%rsp)
movq (%rax), %r15
movq 0x8(%rsp), %rax
cmpq %rax, %r12
movq %rax, %r12
jge 0x9c183
leaq 0x7b48e(%rip), %rax     # 0x1175a2
leaq 0x803b3(%rip), %rsi     # 0x11c4ce
cmpb $0x0, 0x50(%rsp)
cmovneq %rax, %rsi
movq %r15, %rdi
movq %rbp, %rdx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xc442
movq (%rsp), %r8
testq %r8, %r8
je 0x9c1c7
decq %r12
movq %r12, %rdx
subq %rax, %rdx
jle 0x9c162
addq %r15, %rax
movq %rax, %rdi
movl $0x20, %esi
callq 0x8270
movq (%rsp), %r8
movq %r12, %rax
movb $0x0, (%r15,%rax)
leaq 0x8035f(%rip), %rcx     # 0x11c4cd
movq %r15, %rdi
movq %r13, %rsi
movq %r8, %rdx
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x9517
jmp 0x9c1dd
leaq 0x7b418(%rip), %rsi     # 0x1175a2
leaq 0x8033d(%rip), %rax     # 0x11c4ce
cmpb $0x0, 0x50(%rsp)
cmoveq %rax, %rsi
movq (%rsp), %rcx
testq %rcx, %rcx
movl $0x2e2e2e, -0x4(%r12,%rbp) # imm = 0x2E2E2E
cmoveq %rax, %rcx
leaq 0x80318(%rip), %r8      # 0x11c4cd
movq %r15, %rdi
movq %rbp, %rdx
xorl %r9d, %r9d
xorl %eax, %eax
callq 0xc442
jmp 0x9c1dd
leaq 0x802ff(%rip), %rdx     # 0x11c4cd
movq %r15, %rdi
movq %r13, %rsi
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x9517
movslq 0x8(%r14), %rax
cmpq $0x11, %rax
jne 0x9c20c
movq (%r14), %rdi
testq %rdi, %rdi
je 0x9c1fb
callq 0x8050
movq $0x0, (%r14)
movl $0x0, 0x8(%r14)
addq $0x838, %rbx            # imm = 0x838
jmp 0x9c217
leaq (%rbx,%rax,8), %rbx
addq $0x838, %rbx            # imm = 0x838
movq (%rbx), %rax
movq %rax, 0x18(%r14)
movq %r14, (%rbx)
movq 0x10(%rsp), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq