// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x78, %rsp
movq %rdi, 0x68(%rsp)
movq %rsi, 0x60(%rsp)
movq $0x0, 0x58(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0x66bdc
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rax
movzbl (%rax), %eax
cmpl $0x13, %eax
jne 0x66bc8
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
addq 0x58(%rsp), %rax
movq %rax, 0x58(%rsp)
jmp 0x66bca
jmp 0x66bdc
jmp 0x66bcc
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x48(%rsp)
jmp 0x66b91
movq 0x48(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0x66c75
movq 0x60(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x68(%rsp), %rcx
cmpq 0x110(%rcx), %rax
jne 0x66c2d
movq 0x68(%rsp), %rdi
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x68(%rsp), %rax
movq 0x15a8(%rax), %rdx
callq 0x1b9da0
movq %rax, 0x70(%rsp)
jmp 0x66dda
movq 0x68(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x68(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rax
movq 0x15a8(%rax), %rdx
callq 0x1b9f50
movq 0x20(%rsp), %rdi
movq %rax, %rsi
movq 0x68(%rsp), %rax
movq 0x15a8(%rax), %rdx
callq 0x1b9da0
movq %rax, 0x70(%rsp)
jmp 0x66dda
cmpq $0x0, 0x58(%rsp)
jne 0x66cf5
movq 0x68(%rsp), %rax
movq %rax, (%rsp)
movq 0x68(%rsp), %rax
movq 0x15a8(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x68(%rsp), %rax
movq 0x140(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x68(%rsp), %rdi
leaq 0x18c795(%rip), %rsi    # 0x1f345b
movl $0x11, %edx
callq 0xb880
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq %rax, %r8
callq 0x14a60
movq %rax, 0x70(%rsp)
jmp 0x66dda
movq 0x68(%rsp), %rdi
movq 0x58(%rsp), %rsi
addq $0x1, %rsi
callq 0xaa80
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x30(%rsp)
movq $0x0, 0x50(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0x66d9a
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
cmpq $0x0, 0x8(%rax)
jle 0x66d88
movq 0x30(%rsp), %rdi
addq 0x50(%rsp), %rdi
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rsi
movq 0x28(%rsp), %rax
movq 0x8(%rax), %rdx
callq 0x93e0
movq 0x28(%rsp), %rax
movq 0x8(%rax), %rax
addq 0x50(%rsp), %rax
movq %rax, 0x50(%rsp)
jmp 0x66d8a
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x48(%rsp)
jmp 0x66d2d
movq 0x30(%rsp), %rax
movq 0x58(%rsp), %rcx
movb $0x0, (%rax,%rcx)
movq 0x68(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x58(%rsp), %rdx
callq 0xa2b0
movq %rax, 0x40(%rsp)
movq 0x68(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0xb230
movq 0x40(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x70(%rsp), %rax
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)