// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/compile.c
// Function: janetc_maker
static JanetSlot janetc_maker(JanetFopts opts, JanetSlot *slots, int op) {
    JanetCompiler *c = opts.compiler;
    JanetSlot retslot;

    /* Check if this structure is composed entirely of constants */
    int can_inline = 1;
    for (int32_t i = 0; i < janet_v_count(slots); i++) {
        if (!(slots[i].flags & JANET_SLOT_CONSTANT) ||
                (slots[i].flags & JANET_SLOT_SPLICED)) {
            can_inline = 0;
            break;
        }
    }

    if (can_inline && (op == JOP_MAKE_STRUCT)) {
        JanetKV *st = janet_struct_begin(janet_v_count(slots) / 2);
        for (int32_t i = 0; i < janet_v_count(slots); i += 2) {
            Janet k = slots[i].constant;
            Janet v = slots[i + 1].constant;
            janet_struct_put(st, k, v);
        }
        retslot = janetc_cslot(janet_wrap_struct(janet_struct_end(st)));
        janetc_freeslots(c, slots);
    } else if (can_inline && (op == JOP_MAKE_TUPLE)) {
        Janet *tup = janet_tuple_begin(janet_v_count(slots));
        for (int32_t i = 0; i < janet_v_count(slots); i++) {
            tup[i] = slots[i].constant;
        }
        retslot = janetc_cslot(janet_wrap_tuple(janet_tuple_end(tup)));
        janetc_freeslots(c, slots);
    } else {
        janetc_pushslots(c, slots);
        janetc_freeslots(c, slots);
        retslot = janetc_gettarget(opts);
        janetc_emit_s(c, op, retslot, 1);
    }

    return retslot;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %edx, %r12d
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rbp), %r13
movq (%r13), %r15
leaq 0x10(%rsi), %rax
pushq $-0x1
popq %rcx
movl $0x1010000, %edx        # imm = 0x1010000
testq %r14, %r14
je 0x1c670
movslq -0x4(%r14), %rsi
jmp 0x1c672
xorl %esi, %esi
incq %rcx
cmpq %rsi, %rcx
jge 0x1c68c
movl (%rax), %esi
andl %edx, %esi
addq $0x18, %rax
cmpl $0x10000, %esi          # imm = 0x10000
je 0x1c665
jmp 0x1c6af
cmpl $0x45, %r12d
je 0x1c70d
cmpl $0x43, %r12d
jne 0x1c6af
testq %r14, %r14
movq %r15, -0x30(%rbp)
je 0x1c71f
movl -0x4(%r14), %eax
pushq $0x2
popq %rcx
cltd
idivl %ecx
movl %eax, %edi
jmp 0x1c721
movq %r15, %rdi
movq %r14, %rsi
callq 0x1b8a8
movq %r15, %rdi
movq %r14, %rsi
callq 0x1baef
movq 0x20(%r13), %rax
movq %rax, 0x20(%rsp)
movups (%r13), %xmm0
movups 0x10(%r13), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x1aa9e
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
movzbl %r12b, %esi
pushq $0x1
popq %rdx
movq %r15, %rdi
callq 0x1fbb3
jmp 0x1c829
testq %r14, %r14
je 0x1c7a8
movl -0x4(%r14), %edi
jmp 0x1c7aa
xorl %edi, %edi
callq 0x42cb8
movq %rax, %r12
xorl %r13d, %r13d
movq %r14, %r15
testq %r14, %r14
je 0x1c73a
movslq -0x4(%r14), %rax
jmp 0x1c73c
xorl %eax, %eax
cmpq %rax, %r13
jge 0x1c75a
movq (%r15), %rsi
movq 0x18(%r15), %rdx
movq %r12, %rdi
callq 0x4300f
addq $0x2, %r13
addq $0x30, %r15
jmp 0x1c72f
movq %r12, %rdi
callq 0x4301e
movabsq $-0x3000000000000, %rsi # imm = 0xFFFD000000000000
movq %rax, %rdi
callq 0x4b366
movq %rax, %xmm0
movq %rax, %rcx
shrq $0x2f, %rcx
andb $0xf, %cl
movl $0x10000, %edx          # imm = 0x10000
btsl %ecx, %edx
ucomisd %xmm0, %xmm0
movq %rax, (%rbx)
movl $0x10001, %eax          # imm = 0x10001
cmovpl %edx, %eax
orq $-0x1, 0x8(%rbx)
movl %eax, 0x10(%rbx)
movq -0x30(%rbp), %rdi
jmp 0x1c821
xorl %edi, %edi
callq 0x44648
xorl %ecx, %ecx
movq %r14, %rdx
testq %r14, %r14
je 0x1c7bf
movslq -0x4(%r14), %rsi
jmp 0x1c7c1
xorl %esi, %esi
cmpq %rsi, %rcx
jge 0x1c7d6
movq (%rdx), %rsi
movq %rsi, (%rax,%rcx,8)
incq %rcx
addq $0x18, %rdx
jmp 0x1c7b4
movq %rax, %rdi
callq 0x44674
movabsq $-0x4000000000000, %rsi # imm = 0xFFFC000000000000
movq %rax, %rdi
callq 0x4b366
movq %rax, %xmm0
movq %rax, %rcx
shrq $0x2f, %rcx
andb $0xf, %cl
movl $0x10000, %edx          # imm = 0x10000
btsl %ecx, %edx
ucomisd %xmm0, %xmm0
movq %rax, (%rbx)
movl $0x10001, %eax          # imm = 0x10001
cmovpl %edx, %eax
orq $-0x1, 0x8(%rbx)
movl %eax, 0x10(%rbx)
movq %r15, %rdi
movq %r14, %rsi
callq 0x1baef
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop