// File: /workspace/github_c_makefile_star2_O1/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 %rsi, %r14
movq %rdi, -0x38(%rbp)
xorl %r15d, %r15d
movl $0x0, %r12d
testq %rsi, %rsi
je 0x1d4c6
movl -0x4(%r14), %r12d
testl %r12d, %r12d
jle 0x1d6e3
xorl %edx, %edx
xorl %r15d, %r15d
xorl %r13d, %r13d
movslq %r13d, %rax
leaq (%rax,%rax,2), %rax
leaq (%r14,%rax,8), %rax
testb $0x1, 0x13(%rax)
jne 0x1d51c
leal 0x1(%r13), %ebx
cmpl %r12d, %ebx
jne 0x1d554
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movups (%rax), %xmm0
movups %xmm0, (%rsp)
movq -0x38(%rbp), %rdi
movl $0x31, %esi
movl %edx, %r13d
xorl %edx, %edx
callq 0x21e42
movl %r13d, %edx
incl %r15d
jmp 0x1d547
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 0x21e42
incl %r13d
movl $0x1, %edx
movl %r13d, %ebx
movl %ebx, %r13d
cmpl %r12d, %ebx
jl 0x1d4d7
jmp 0x1d6da
movl %r15d, -0x2c(%rbp)
movslq %ebx, %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%r14,%rcx,8), %r15
testb $0x1, 0x13(%r15)
jne 0x1d5b9
leal 0x2(%r13), %ebx
cmpl %r12d, %ebx
jne 0x1d60c
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, %r15d
xorl %edx, %edx
callq 0x22104
movl %r15d, %edx
movl -0x2c(%rbp), %r15d
addl $0x2, %r15d
jmp 0x1d547
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 0x21e42
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movups (%r15), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
movl $0x34, %esi
xorl %edx, %edx
callq 0x21e42
addl $0x2, %r13d
movl -0x2c(%rbp), %r15d
incl %r15d
jmp 0x1d53f
movslq %ebx, %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%r14,%rcx,8), %rbx
testb $0x1, 0x13(%rbx)
jne 0x1d675
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 0x223bf
movl %ebx, %edx
addl $0x3, %r13d
movl -0x2c(%rbp), %r15d
addl $0x3, %r15d
jmp 0x1d544
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 0x22104
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
movq %r15, %rdi
movl $0x34, %esi
xorl %edx, %edx
callq 0x21e42
addl $0x3, %r13d
movl -0x2c(%rbp), %r15d
addl $0x2, %r15d
jmp 0x1d53f
xorl %eax, %eax
negl %edx
sbbl %eax, %eax
xorl %eax, %r15d
movl %r15d, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq