// File: /workspace/github_c_makefile_star2_O3/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
movl %ecx, %r12d
movq %rdi, %r14
leaq 0x10(%rbp), %rcx
testl %edx, %edx
je 0x43f14
movl %edx, %r15d
movq 0x20(%rcx), %rax
movq %rax, -0x50(%rbp)
movups (%rcx), %xmm0
movups 0x10(%rcx), %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 0x43f3d
cmpl $0x7, %eax
je 0x440fd
cmpl $0x8, %eax
jne 0x441bd
movq %rsi, %rdi
callq 0x4ebc4
movl -0x10(%rax), %ecx
cmpl $0x2, %ecx
movq %r14, -0x38(%rbp)
movq %rax, -0x78(%rbp)
jl 0x441d6
movq %rax, %r13
movq (%rax), %rdi
movq %rdi, %rax
shrq $0x2f, %rax
cmpl $0x1fff5, %eax          # imm = 0x1FFF5
jne 0x44223
movq %rcx, -0x30(%rbp)
callq 0x4ebc4
movq %rax, %rbx
leaq 0x237ef(%rip), %rsi     # 0x676d8
movq %rax, %rdi
callq 0x4872e
testl %eax, %eax
je 0x44213
leaq 0x24c69(%rip), %rsi     # 0x68b69
movq %rbx, %rdi
callq 0x4872e
cmpl $0x1, %eax
adcl $0x0, %r12d
jmp 0x4421f
movq (%rcx), %rdi
leaq 0x24c56(%rip), %rsi     # 0x68b74
callq 0x1bb46
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
callq 0x4ece6
movq %r14, %rdi
movq %rax, %rsi
jmp 0x441c0
movq %rdx, -0x30(%rbp)
movl %r12d, %ebx
movq %r14, -0x38(%rbp)
leaq -0xa8(%rbp), %r14
movq $0x0, (%r14)
leaq -0x3c(%rbp), %r12
movl $0x0, (%r12)
leaq -0xac(%rbp), %rdx
movq %rsi, %rdi
movq %r14, %rsi
movq %r12, %rcx
callq 0x4985f
movq (%r14), %rdi
movl (%r12), %esi
xorl %r12d, %r12d
xorl %edx, %edx
callq 0x486f1
testq %rax, %rax
je 0x440c5
movq %rax, %r13
decl %r15d
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 %r15d, %edx
movl %ebx, %ecx
callq 0x43e26
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 %r15d, %edx
movl %ebx, %ecx
callq 0x43e26
andb $-0x2, -0x8d(%rbp)
andb $-0x2, -0xb5(%rbp)
testq %r12, %r12
je 0x4401a
movl -0x4(%r12), %eax
leal 0x1(%rax), %ecx
cmpl -0x8(%r12), %ecx
jl 0x44035
movq %r12, %rdi
movl $0x1, %esi
movl $0x18, %edx
callq 0x4b4e8
movq %rax, %r12
movl -0x4(%rax), %eax
leal 0x1(%rax), %ecx
movl %ecx, -0x4(%r12)
cltq
leaq (%rax,%rax,2), %rax
movq -0x90(%rbp), %rcx
movq %rcx, 0x10(%r12,%rax,8)
movups -0xa0(%rbp), %xmm0
movups %xmm0, (%r12,%rax,8)
movl -0x4(%r12), %eax
leal 0x1(%rax), %ecx
cmpl -0x8(%r12), %ecx
jl 0x44082
movq %r12, %rdi
movl $0x1, %esi
movl $0x18, %edx
callq 0x4b4e8
movq %rax, %r12
movl -0x4(%rax), %eax
leal 0x1(%rax), %ecx
movl %ecx, -0x4(%r12)
cltq
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 0x486f1
movq %rax, %r13
testq %rax, %rax
jne 0x43f9a
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)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq -0x38(%rbp), %rdi
movq %r12, %rsi
jmp 0x442f5
movq %r14, -0x38(%rbp)
movq %rsi, %rdi
callq 0x4ebc4
cmpl $0x0, 0x10(%rax)
jle 0x441e2
movq %rax, %rbx
movl %r12d, -0x30(%rbp)
decl %r15d
xorl %r13d, %r13d
xorl %r12d, %r12d
testq %r12, %r12
je 0x44137
movl -0x4(%r12), %eax
leal 0x1(%rax), %ecx
cmpl -0x8(%r12), %ecx
jl 0x44152
movq %r12, %rdi
movl $0x1, %esi
movl $0x18, %edx
callq 0x4b4e8
movq %rax, %r12
movl -0x4(%rax), %eax
leal 0x1(%rax), %ecx
movl %ecx, -0x4(%r12)
cltq
leaq (%rax,%rax,2), %r14
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 %r15d, %edx
movl -0x30(%rbp), %ecx
callq 0x43e26
movq -0x90(%rbp), %rax
movq %rax, 0x10(%r12,%r14,8)
movupd -0xa0(%rbp), %xmm0
movupd %xmm0, (%r12,%r14,8)
incq %r13
movslq 0x10(%rbx), %rax
cmpq %rax, %r13
jl 0x44123
jmp 0x441e5
movq %r14, %rdi
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1baf6
cmpl $0x1, %ecx
je 0x44223
xorl %ebx, %ebx
jmp 0x442c3
xorl %r12d, %r12d
leaq 0x10(%rbp), %rcx
movq 0x20(%rcx), %rax
movq %rax, 0x20(%rsp)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq -0x38(%rbp), %rdi
movq %r12, %rsi
movl $0x40, %edx
jmp 0x442f5
testl %r12d, %r12d
je 0x4430c
decl %r12d
movq -0x30(%rbp), %rcx
movl %r12d, -0x30(%rbp)
decl %r15d
xorl %r12d, %r12d
xorl %ebx, %ebx
movq %rcx, %r14
testq %rbx, %rbx
je 0x44242
movl -0x4(%rbx), %eax
leal 0x1(%rax), %ecx
cmpl -0x8(%rbx), %ecx
jl 0x4425d
movq %rbx, %rdi
movl $0x1, %esi
movl $0x18, %edx
callq 0x4b4e8
movq %rax, %rbx
movl -0x4(%rax), %eax
leal 0x1(%rax), %ecx
movl %ecx, -0x4(%rbx)
cltq
leaq (%rax,%rax,2), %r13
movq -0x78(%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 %r15d, %edx
movl -0x30(%rbp), %ecx
callq 0x43e26
movq -0x90(%rbp), %rax
movq %rax, 0x10(%rbx,%r13,8)
movupd -0xa0(%rbp), %xmm0
movupd %xmm0, (%rbx,%r13,8)
incq %r12
movq %r14, %rcx
cmpq %r12, %r14
jne 0x4422f
xorl %edx, %edx
movq -0x78(%rbp), %rax
btl $0x10, -0x20(%rax)
adcl $0x45, %edx
leaq 0x10(%rbp), %rcx
movq 0x20(%rcx), %rax
movq %rax, 0x20(%rsp)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq -0x38(%rbp), %rdi
movq %rbx, %rsi
callq 0x4434e
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10(%rbp), %rax
movq (%rax), %rsi
leaq -0xa0(%rbp), %rbx
movq %rbx, %rdi
callq 0x1ba98
orb $0x8, 0x22(%rbx)
movq 0x8(%r13), %rsi
movq 0x20(%rbx), %rax
movq %rax, 0x20(%rsp)
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq -0x38(%rbp), %rdi
callq 0x1c7be
jmp 0x442fa