// File: /workspace/github_c_makefile_star2_O1/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 0x91a0
movq %rax, %r12
cmpb $0xa, (%r13)
jne 0xa2a83
cmpq %r13, 0x8(%r14)
je 0xa2a83
movq 0x8(%r13), %rax
movq 0x8(%rax), %rax
leaq (%r12,%rax), %rsi
addq $0xa, %rsi
movq %rbx, %rdi
callq 0xa305
movq %rax, %r14
movq (%rax), %rbp
movq 0x8(%r13), %rax
movq 0x10(%rax), %rsi
leaq 0x705c0(%rip), %rdx     # 0x113031
movq %rbp, %rdi
movq %r15, %rcx
xorl %r8d, %r8d
xorl %eax, %eax
callq 0xd1cb
jmp 0xa2ab9
leaq 0x8(%r12), %rsi
movq %rbx, %rdi
callq 0xa305
movq %rax, %r14
movq (%rax), %rbp
cmpq $0x3, %r12
jl 0xa2abe
cmpb $0x28, 0x2(%r15)
jne 0xa2abe
leaq 0x7d9e4(%rip), %rsi     # 0x12048e
movq %rbp, %rdi
movq %r15, %rdx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xd1cb
movq %rax, %r12
jmp 0xa2ad2
movq %rbp, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x93e0
movb $0x0, (%rbp,%r12)
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %r13
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xa2aeb
callq 0x91a0
jmp 0xa2aed
xorl %eax, %eax
addq %rax, %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0xa305
movq %rax, 0x10(%rsp)
movq (%rax), %r15
movq 0x8(%rsp), %rax
cmpq %rax, %r12
movq %rax, %r12
jge 0xa2b8a
leaq 0x7d97b(%rip), %rax     # 0x120492
leaq 0x828a0(%rip), %rsi     # 0x1253be
cmpb $0x0, 0x50(%rsp)
cmovneq %rax, %rsi
movq %r15, %rdi
movq %rbp, %rdx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xd1cb
movq (%rsp), %rdx
testq %rdx, %rdx
je 0xa2bce
movq %r12, %rcx
decq %r12
cmpq %r12, %rax
jge 0xa2b6c
leaq (%r15,%rax), %rdi
notq %rax
addq %rcx, %rax
movl $0x20, %esi
movq %rax, %rdx
callq 0x9270
movq (%rsp), %rdx
movq %r12, %rax
movb $0x0, (%r15,%rax)
leaq 0x82845(%rip), %rcx     # 0x1253bd
movq %r15, %rdi
movq %r13, %rsi
xorl %r8d, %r8d
xorl %eax, %eax
callq 0xa4d7
jmp 0xa2be4
leaq 0x7d901(%rip), %rsi     # 0x120492
leaq 0x82826(%rip), %rax     # 0x1253be
cmpb $0x0, 0x50(%rsp)
cmoveq %rax, %rsi
movq (%rsp), %rcx
testq %rcx, %rcx
movl $0x2e2e2e, -0x4(%r12,%rbp) # imm = 0x2E2E2E
cmoveq %rax, %rcx
leaq 0x82801(%rip), %r8      # 0x1253bd
movq %r15, %rdi
movq %rbp, %rdx
xorl %r9d, %r9d
xorl %eax, %eax
callq 0xd1cb
jmp 0xa2be4
leaq 0x827e8(%rip), %rdx     # 0x1253bd
movq %r15, %rdi
movq %r13, %rsi
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xa4d7
movslq 0x8(%r14), %rax
cmpq $0x11, %rax
jne 0xa2c13
movq (%r14), %rdi
testq %rdi, %rdi
je 0xa2c02
callq 0x9050
movq $0x0, (%r14)
movl $0x0, 0x8(%r14)
addq $0x838, %rbx            # imm = 0x838
jmp 0xa2c1e
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