// File: /workspace/github_c_makefile_star2_O3/BernardTatin[P]s7sh/s7.c
// Function: g_symbol
static s7_pointer g_symbol(s7_scheme *sc, s7_pointer args)
    {
#define H_symbol "(symbol str ...) returns its string arguments concatenated and converted to a symbol"
#define Q_symbol s7_make_circular_signature(sc, 1, 2, sc->is_symbol_symbol, sc->is_string_symbol)

        s7_int len = 0, cur_len;
        s7_pointer p, sym;
        block_t *b;
        char *name;

        for (p = args; is_pair(p); p = cdr(p))
            if (is_string(car(p)))
                len += string_length(car(p));
            else break;

        if (is_pair(p))
        {
            if (is_null(cdr(args)))
                return(g_string_to_symbol_1(sc, car(args), sc->symbol_symbol));
            return(g_string_to_symbol_1(sc, g_string_append_1(sc, args, sc->symbol_symbol), sc->symbol_symbol));
        }
        if (len == 0)
            return(simple_wrong_type_argument_with_type(sc, sc->symbol_symbol, car(args), wrap_string(sc, "a non-null string", 17)));

        b = mallocate(sc, len + 1);
        name = (char *)block_data(b);
        /* can't use catstrs_direct here because it stops at embedded null */
        cur_len = 0;
        for (p = args; is_pair(p); p = cdr(p))
        {
            s7_pointer str;
            str = car(p);
            if (string_length(str) > 0)
            {
                memcpy((void *)(name + cur_len), (void *)string_value(str), string_length(str));
                cur_len += string_length(str);
            }
        }
        name[len] = '\0';
        sym = make_symbol_with_length(sc, name, len);
        liberate(sc, b);
        return(sym);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r13
movq %rdi, %rbx
cmpb $0x1, (%rsi)
jne 0x5f8a9
xorl %r15d, %r15d
movq %r13, %rax
movq 0x8(%rax), %rcx
cmpb $0x13, (%rcx)
jne 0x5f906
movq 0x10(%rax), %rax
addq 0x8(%rcx), %r15
cmpb $0x1, (%rax)
je 0x5f7b2
testq %r15, %r15
je 0x5f8a9
leaq 0x1(%r15), %rsi
movq %rbx, %rdi
callq 0x9357
movq %rax, (%rsp)
movq (%rax), %r12
cmpb $0x1, (%r13)
jne 0x5f81b
xorl %r14d, %r14d
movq 0x8(%r13), %rbp
movq 0x8(%rbp), %rdx
testq %rdx, %rdx
jle 0x5f810
leaq (%r12,%r14), %rdi
movq 0x10(%rbp), %rsi
callq 0x83e0
addq 0x8(%rbp), %r14
movq 0x10(%r13), %r13
cmpb $0x1, (%r13)
je 0x5f7f2
movb $0x0, (%r12,%r15)
movq $0x0, 0x8(%rsp)
cmpq $0x8, %r15
jg 0x5f955
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x83e0
movq (%r13), %r13
movabsq $-0x7fecfd2d94c4151b, %rcx # imm = 0x801302D26B3BEAE5
movq %r13, %rax
mulq %rcx
shrq $0xe, %rdx
imulq $0x7fed, %rdx, %rax     # imm = 0x7FED
movq %r13, %rbp
subq %rax, %rbp
movq 0x148(%rbx), %rax
movq 0x10(%rax), %rax
movl %ebp, %ecx
movq (%rax,%rcx,8), %rax
cmpb $0x1, (%rax)
jne 0x5f9e8
movq (%rsp), %r14
cmpq 0x18(%rax), %r13
jne 0x5f89b
movl 0x2c(%rax), %ecx
cmpq %rcx, %r15
je 0x5fa59
movq 0x10(%rax), %rax
cmpb $0x1, (%rax)
je 0x5f889
jmp 0x5f9ec
movq 0x15a8(%rbx), %rax
movq 0x8(%rax), %rsi
movq 0x8(%r13), %rdx
movq 0x140(%rbx), %rcx
movq 0x820(%rbx), %rax
movslq 0x7dc(%rbx), %rdi
movq (%rax,%rdi,8), %r8
leal 0x1(%rdi), %eax
andl $0x7, %eax
movl %eax, 0x7dc(%rbx)
leaq 0xbbc1c(%rip), %rax     # 0x11b500
movq %rax, 0x10(%r8)
movq $0x11, 0x8(%r8)
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xed2a
movq 0x10(%r13), %rax
cmpq 0x110(%rbx), %rax
je 0x5f934
movq 0x15a8(%rbx), %rdx
movq %rbx, %rdi
movq %r13, %rsi
callq 0xf9d68
movq 0x15a8(%rbx), %rdx
movq %rbx, %rdi
movq %rax, %rsi
jmp 0x5f942
movq 0x8(%r13), %rsi
movq 0x15a8(%rbx), %rdx
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf9b31
movq (%r12), %r13
leaq 0x10(%rsp), %rbp
movq $0x0, (%rbp)
leaq 0x8(%r12), %rsi
cmpq $0x10, %r15
movl $0x10, %edx
cmovbq %r15, %rdx
addq $-0x8, %rdx
movq %rbp, %rdi
callq 0x83e0
addq (%rbp), %r13
movabsq $-0x7fecfd2d94c4151b, %rcx # imm = 0x801302D26B3BEAE5
movq %r13, %rax
mulq %rcx
shrq $0xe, %rdx
imulq $0x7fed, %rdx, %rax     # imm = 0x7FED
movq %r13, %rbp
subq %rax, %rbp
movq 0x148(%rbx), %rax
movq 0x10(%rax), %rax
movl %ebp, %ecx
movq (%rax,%rcx,8), %r14
cmpb $0x1, (%r14)
jne 0x5f9e8
cmpq 0x18(%r14), %r13
jne 0x5f9e2
movl 0x2c(%r14), %eax
cmpq %rax, %r15
jne 0x5f9e2
movq 0x20(%r14), %rsi
movq %r12, %rdi
movq %r15, %rdx
callq 0x8c146
testb %al, %al
jne 0x5fa5f
movq 0x10(%r14), %r14
jmp 0x5f9ba
movq (%rsp), %r14
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r13, %rcx
movl %ebp, %r8d
callq 0x9632
movq %rax, %r15
movslq 0x8(%r14), %rax
cmpq $0x11, %rax
jne 0x5fa32
movq (%r14), %rdi
testq %rdi, %rdi
je 0x5fa21
callq 0x8050
movq $0x0, (%r14)
movl $0x0, 0x8(%r14)
addq $0x838, %rbx            # imm = 0x838
jmp 0x5fa3d
leaq (%rbx,%rax,8), %rbx
addq $0x838, %rbx            # imm = 0x838
movq (%rbx), %rax
movq %rax, 0x18(%r14)
movq %r14, (%rbx)
movq %r15, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rax), %r15
jmp 0x5fa03
movq 0x8(%r14), %r15
movq (%rsp), %r14
jmp 0x5fa03