// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/specials.c
// Function: quasiquote
static JanetSlot quasiquote(JanetFopts opts, Janet x, int depth, int level) {
    if (depth == 0) {
        janetc_cerror(opts.compiler, "quasiquote too deeply nested");
        return janetc_cslot(janet_wrap_nil());
    }
    JanetSlot *slots = NULL;
    JanetFopts subopts = opts;
    subopts.flags &= ~JANET_FOPTS_HINT;
    switch (janet_type(x)) {
        default:
            return janetc_cslot(x);
        case JANET_TUPLE: {
            int32_t i, len;
            const Janet *tup = janet_unwrap_tuple(x);
            len = janet_tuple_length(tup);
            if (len > 1 && janet_checktype(tup[0], JANET_SYMBOL)) {
                const uint8_t *head = janet_unwrap_symbol(tup[0]);
                if (!janet_cstrcmp(head, "unquote")) {
                    if (level == 0) {
                        JanetFopts subopts = janetc_fopts_default(opts.compiler);
                        subopts.flags |= JANET_FOPTS_ACCEPT_SPLICE;
                        return janetc_value(subopts, tup[1]);
                    } else {
                        level--;
                    }
                } else if (!janet_cstrcmp(head, "quasiquote")) {
                    level++;
                }
            }
            for (i = 0; i < len; i++)
                janet_v_push(slots, quasiquote(subopts, tup[i], depth - 1, level));
            return qq_slots(opts, slots, (janet_tuple_flag(tup) & JANET_TUPLE_FLAG_BRACKETCTOR)
                            ? JOP_MAKE_BRACKET_TUPLE
                            : JOP_MAKE_TUPLE);
        }
        case JANET_ARRAY: {
            int32_t i;
            JanetArray *array = janet_unwrap_array(x);
            for (i = 0; i < array->count; i++)
                janet_v_push(slots, quasiquote(subopts, array->data[i], depth - 1, level));
            return qq_slots(opts, slots, JOP_MAKE_ARRAY);
        }
        case JANET_TABLE:
        case JANET_STRUCT: {
            const JanetKV *kv = NULL, *kvs = NULL;
            int32_t len, cap = 0;
            janet_dictionary_view(x, &kvs, &len, &cap);
            while ((kv = janet_dictionary_next(kvs, cap, kv))) {
                JanetSlot key = quasiquote(subopts, kv->key, depth - 1, level);
                JanetSlot value =  quasiquote(subopts, kv->value, depth - 1, level);
                key.flags &= ~JANET_SLOT_SPLICED;
                value.flags &= ~JANET_SLOT_SPLICED;
                janet_v_push(slots, key);
                janet_v_push(slots, value);
            }
            return qq_slots(opts, slots,
                            janet_checktype(x, JANET_TABLE) ? JOP_MAKE_TABLE : JOP_MAKE_STRUCT);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rdi, %r13
leaq 0x10(%rbp), %r15
testl %edx, %edx
je 0x4482c
movl %ecx, %r12d
movl %edx, %r14d
movq 0x20(%r15), %rax
movq %rax, -0x50(%rbp)
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movaps %xmm1, -0x60(%rbp)
movaps %xmm0, -0x70(%rbp)
andb $-0x3, -0x4e(%rbp)
movq %rsi, %xmm0
movq %rsi, %rdx
shrq $0x2f, %rdx
movl %edx, %ecx
andl $0xf, %ecx
xorl %eax, %eax
ucomisd %xmm0, %xmm0
cmovpl %ecx, %eax
leal -0x9(%rax), %ecx
cmpl $0x2, %ecx
jb 0x44855
cmpl $0x7, %eax
je 0x44a1d
cmpl $0x8, %eax
jne 0x44adc
movq %rsi, %rdi
callq 0x4f838
movslq -0x10(%rax), %rdx
movq %rdx, -0x78(%rbp)
cmpq $0x2, %rdx
movq %rax, -0x30(%rbp)
jl 0x44b38
movq (%rax), %rdi
movq %rdi, %rax
shrq $0x2f, %rax
cmpl $0x1fff5, %eax          # imm = 0x1FFF5
jne 0x44b38
movq %r13, %rbx
callq 0x4f838
movq %rax, %r13
leaq 0x23ef7(%rip), %rsi     # 0x686f8
movq %rax, %rdi
callq 0x4920e
testl %eax, %eax
je 0x44b1f
leaq 0x25371(%rip), %rsi     # 0x69b89
movq %r13, %rdi
callq 0x4920e
cmpl $0x1, %eax
adcl $0x0, %r12d
jmp 0x44b2b
movq (%r15), %rdi
leaq 0x2535e(%rip), %rsi     # 0x69b94
callq 0x1bc9e
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
callq 0x4f95a
movq %r13, %rdi
movq %rax, %rsi
jmp 0x44adf
movq %rdx, -0x30(%rbp)
movl %r12d, %ebx
movq %r13, -0x38(%rbp)
leaq -0xa8(%rbp), %r15
movq $0x0, (%r15)
leaq -0x3c(%rbp), %r12
movl $0x0, (%r12)
leaq -0xac(%rbp), %rdx
movq %rsi, %rdi
movq %r15, %rsi
movq %r12, %rcx
callq 0x4a377
movq (%r15), %rdi
movl (%r12), %esi
xorl %r12d, %r12d
xorl %edx, %edx
callq 0x491d1
testq %rax, %rax
je 0x449e0
movq %rax, %r13
decl %r14d
xorl %r12d, %r12d
movq (%r13), %rsi
movq -0x50(%rbp), %rax
movq %rax, 0x20(%rsp)
movaps -0x70(%rbp), %xmm0
movaps -0x60(%rbp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq -0xa0(%rbp), %rdi
movl %r14d, %edx
movl %ebx, %ecx
callq 0x4473e
movq 0x8(%r13), %rsi
movq -0x50(%rbp), %rax
movq %rax, 0x20(%rsp)
movaps -0x70(%rbp), %xmm0
movaps -0x60(%rbp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq -0xc8(%rbp), %rdi
movl %r14d, %edx
movl %ebx, %ecx
callq 0x4473e
andb $-0x2, -0x8d(%rbp)
andb $-0x2, -0xb5(%rbp)
testq %r12, %r12
je 0x44931
movl -0x4(%r12), %eax
incl %eax
cmpl -0x8(%r12), %eax
jl 0x44946
movq %r12, %rdi
movl $0x1, %esi
movl $0x18, %edx
callq 0x4c0b4
movq %rax, %r12
movslq -0x4(%r12), %rax
leal 0x1(%rax), %ecx
movl %ecx, -0x4(%r12)
leaq (%rax,%rax,2), %rax
movq -0x90(%rbp), %rcx
movq %rcx, 0x10(%r12,%rax,8)
movups -0xa0(%rbp), %xmm0
movups %xmm0, (%r12,%rax,8)
testq %r12, %r12
je 0x44982
movl -0x4(%r12), %eax
incl %eax
cmpl -0x8(%r12), %eax
jl 0x44997
movq %r12, %rdi
movl $0x1, %esi
movl $0x18, %edx
callq 0x4c0b4
movq %rax, %r12
movslq -0x4(%r12), %rax
leal 0x1(%rax), %ecx
movl %ecx, -0x4(%r12)
leaq (%rax,%rax,2), %rax
movq -0xb8(%rbp), %rcx
movq %rcx, 0x10(%r12,%rax,8)
movupd -0xc8(%rbp), %xmm0
movupd %xmm0, (%r12,%rax,8)
movq -0xa8(%rbp), %rdi
movl -0x3c(%rbp), %esi
movq %r13, %rdx
callq 0x491d1
movq %rax, %r13
testq %rax, %rax
jne 0x448b2
xorl %edx, %edx
cmpl $0x1fff9, -0x30(%rbp)   # imm = 0x1FFF9
sete %dl
addl $0x43, %edx
leaq 0x10(%rbp), %rcx
movq 0x20(%rcx), %rax
movq %rax, 0x20(%rsp)
movupd (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups %xmm1, 0x10(%rsp)
movupd %xmm0, (%rsp)
movq -0x38(%rbp), %r13
movq %r13, %rdi
movq %r12, %rsi
jmp 0x44c22
movq %r13, -0x38(%rbp)
movq %rsi, %rdi
callq 0x4f838
cmpl $0x0, 0x10(%rax)
jle 0x44ae9
movq %rax, %rbx
movl %r12d, -0x30(%rbp)
decl %r14d
xorl %r13d, %r13d
xorl %r12d, %r12d
testq %r12, %r12
je 0x44a56
movl -0x4(%r12), %eax
incl %eax
cmpl -0x8(%r12), %eax
jl 0x44a6b
movq %r12, %rdi
movl $0x1, %esi
movl $0x18, %edx
callq 0x4c0b4
movq %rax, %r12
movslq -0x4(%r12), %rax
leal 0x1(%rax), %ecx
movl %ecx, -0x4(%r12)
leaq (%rax,%rax,2), %r15
movq 0x18(%rbx), %rax
movq (%rax,%r13,8), %rsi
movq -0x50(%rbp), %rax
movq %rax, 0x20(%rsp)
movaps -0x70(%rbp), %xmm0
movaps -0x60(%rbp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq -0xa0(%rbp), %rdi
movl %r14d, %edx
movl -0x30(%rbp), %ecx
callq 0x4473e
movq -0x90(%rbp), %rax
movq %rax, 0x10(%r12,%r15,8)
movupd -0xa0(%rbp), %xmm0
movupd %xmm0, (%r12,%r15,8)
incq %r13
movslq 0x10(%rbx), %rax
cmpq %rax, %r13
jl 0x44a43
jmp 0x44aec
movq %r13, %rdi
callq 0x1bc4e
jmp 0x44c27
xorl %r12d, %r12d
leaq 0x10(%rbp), %rcx
movq 0x20(%rcx), %rax
movq %rax, 0x20(%rsp)
movupd (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups %xmm1, 0x10(%rsp)
movupd %xmm0, (%rsp)
movq -0x38(%rbp), %r13
movq %r13, %rdi
movq %r12, %rsi
movl $0x40, %edx
jmp 0x44c22
testl %r12d, %r12d
je 0x44c3c
decl %r12d
movb $0x1, %al
movq %rbx, %r13
testb %al, %al
je 0x44c27
movq %r13, -0x38(%rbp)
cmpl $0x0, -0x78(%rbp)
jle 0x44be5
movl %r12d, %r15d
decl %r14d
xorl %r12d, %r12d
xorl %r13d, %r13d
testq %r13, %r13
je 0x44b63
movl -0x4(%r13), %eax
incl %eax
cmpl -0x8(%r13), %eax
jl 0x44b78
movq %r13, %rdi
movl $0x1, %esi
movl $0x18, %edx
callq 0x4c0b4
movq %rax, %r13
movslq -0x4(%r13), %rax
leal 0x1(%rax), %ecx
movl %ecx, -0x4(%r13)
leaq (%rax,%rax,2), %rbx
movq -0x30(%rbp), %rax
movq (%rax,%r12,8), %rsi
movq -0x50(%rbp), %rax
movq %rax, 0x20(%rsp)
movaps -0x70(%rbp), %xmm0
movaps -0x60(%rbp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq -0xa0(%rbp), %rdi
movl %r14d, %edx
movl %r15d, %ecx
callq 0x4473e
movq -0x90(%rbp), %rax
movq %rax, 0x10(%r13,%rbx,8)
movupd -0xa0(%rbp), %xmm0
movupd %xmm0, (%r13,%rbx,8)
incq %r12
cmpq %r12, -0x78(%rbp)
jne 0x44b52
jmp 0x44be8
xorl %r13d, %r13d
movq -0x30(%rbp), %rax
btl $0x10, -0x20(%rax)
movl $0x0, %edx
adcl $0x45, %edx
leaq 0x10(%rbp), %rcx
movq 0x20(%rcx), %rax
movq %rax, 0x20(%rsp)
movupd (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups %xmm1, 0x10(%rsp)
movupd %xmm0, (%rsp)
movq -0x38(%rbp), %rdi
movq %r13, %rsi
movq %rdi, %r13
callq 0x44c8d
movq %r13, %rax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r15), %rsi
leaq -0xa0(%rbp), %r15
movq %r15, %rdi
callq 0x1bbf0
orb $0x8, 0x22(%r15)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rsi
movq 0x20(%r15), %rax
movq %rax, 0x20(%rsp)
movupd (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups %xmm1, 0x10(%rsp)
movupd %xmm0, (%rsp)
movq %rbx, %r13
movq %rbx, %rdi
callq 0x1ca05
xorl %eax, %eax
xorl %r12d, %r12d
jmp 0x44b30