// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/compile.c
// Function: janetc_pushslots
int32_t janetc_pushslots(JanetCompiler *c, JanetSlot *slots) {
    int32_t i;
    int32_t count = janet_v_count(slots);
    int32_t min_arity = 0;
    int has_splice = 0;
    for (i = 0; i < count;) {
        if (slots[i].flags & JANET_SLOT_SPLICED) {
            janetc_emit_s(c, JOP_PUSH_ARRAY, slots[i], 0);
            i++;
            has_splice = 1;
        } else if (i + 1 == count) {
            janetc_emit_s(c, JOP_PUSH, slots[i], 0);
            i++;
            min_arity++;
        } else if (slots[i + 1].flags & JANET_SLOT_SPLICED) {
            janetc_emit_s(c, JOP_PUSH, slots[i], 0);
            janetc_emit_s(c, JOP_PUSH_ARRAY, slots[i + 1], 0);
            i += 2;
            min_arity++;
            has_splice = 1;
        } else if (i + 2 == count) {
            janetc_emit_ss(c, JOP_PUSH_2, slots[i], slots[i + 1], 0);
            i += 2;
            min_arity += 2;
        } else if (slots[i + 2].flags & JANET_SLOT_SPLICED) {
            janetc_emit_ss(c, JOP_PUSH_2, slots[i], slots[i + 1], 0);
            janetc_emit_s(c, JOP_PUSH_ARRAY, slots[i + 2], 0);
            i += 3;
            min_arity += 2;
            has_splice = 1;
        } else {
            janetc_emit_sss(c, JOP_PUSH_3, slots[i], slots[i + 1], slots[i + 2], 0);
            i += 3;
            min_arity += 3;
        }
    }
    return has_splice ? (-1 - min_arity) : min_arity;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, -0x38(%rbp)
xorl %eax, %eax
testq %rsi, %rsi
je 0x1d487
movq %rsi, %r14
movl -0x4(%rsi), %r12d
testl %r12d, %r12d
jle 0x1d487
xorl %edx, %edx
movl $0x0, -0x2c(%rbp)
xorl %r13d, %r13d
movslq %r13d, %rax
leaq (%rax,%rax,2), %rax
leaq (%r14,%rax,8), %rax
testb $0x1, 0x13(%rax)
jne 0x1d33b
leal 0x1(%r13), %ecx
cmpl %r12d, %ecx
je 0x1d41b
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%r14,%rcx,8), %r15
testb $0x1, 0x13(%r15)
jne 0x1d363
leal 0x2(%r13), %ecx
cmpl %r12d, %ecx
je 0x1d444
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%r14,%rcx,8), %rbx
testb $0x1, 0x13(%rbx)
jne 0x1d3af
movq 0x10(%rbx), %rcx
movq %rcx, 0x40(%rsp)
movups (%rbx), %xmm0
movups %xmm0, 0x30(%rsp)
movq 0x10(%r15), %rcx
movq %rcx, 0x28(%rsp)
movups (%r15), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movups (%rax), %xmm0
movups %xmm0, (%rsp)
movq -0x38(%rbp), %rdi
movl $0x33, %esi
movl %edx, %ebx
xorl %edx, %edx
callq 0x22063
movl %ebx, %edx
addl $0x3, %r13d
addl $0x3, -0x2c(%rbp)
jmp 0x1d410
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movups (%rax), %xmm0
movups %xmm0, (%rsp)
movq -0x38(%rbp), %rdi
movl $0x34, %esi
xorl %edx, %edx
callq 0x21ae6
incl %r13d
jmp 0x1d40b
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movups (%rax), %xmm0
movups %xmm0, (%rsp)
movq -0x38(%rbp), %rbx
movq %rbx, %rdi
movl $0x31, %esi
xorl %edx, %edx
callq 0x21ae6
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movups (%r15), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
movl $0x34, %esi
xorl %edx, %edx
callq 0x21ae6
addl $0x2, %r13d
incl -0x2c(%rbp)
jmp 0x1d40b
movq 0x10(%r15), %rcx
movq %rcx, 0x28(%rsp)
movups (%r15), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movups (%rax), %xmm0
movups %xmm0, (%rsp)
movq -0x38(%rbp), %r15
movq %r15, %rdi
movl $0x32, %esi
xorl %edx, %edx
callq 0x21da8
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
movq %r15, %rdi
movl $0x34, %esi
xorl %edx, %edx
callq 0x21ae6
addl $0x3, %r13d
addl $0x2, -0x2c(%rbp)
movl $0x1, %edx
cmpl %r12d, %r13d
jl 0x1d28d
jmp 0x1d47e
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movups (%rax), %xmm0
movups %xmm0, (%rsp)
movq -0x38(%rbp), %rdi
movl $0x31, %esi
movl %edx, %ebx
xorl %edx, %edx
callq 0x21ae6
movl %ebx, %edx
incl -0x2c(%rbp)
jmp 0x1d47e
movq 0x10(%r15), %rcx
movq %rcx, 0x28(%rsp)
movups (%r15), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movups (%rax), %xmm0
movups %xmm0, (%rsp)
movq -0x38(%rbp), %rdi
movl $0x32, %esi
movl %edx, %ebx
xorl %edx, %edx
callq 0x21da8
movl %ebx, %edx
addl $0x2, -0x2c(%rbp)
xorl %eax, %eax
negl %edx
sbbl %eax, %eax
xorl -0x2c(%rbp), %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq