// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/cfuns.c
// Function: do_apply
static JanetSlot do_apply(JanetFopts opts, JanetSlot *args) {
    /* Push phase */
    JanetCompiler *c = opts.compiler;
    int32_t i;
    for (i = 1; i < janet_v_count(args) - 3; i += 3)
        janetc_emit_sss(c, JOP_PUSH_3, args[i], args[i + 1], args[i + 2], 0);
    if (i == janet_v_count(args) - 3)
        janetc_emit_ss(c, JOP_PUSH_2, args[i], args[i + 1], 0);
    else if (i == janet_v_count(args) - 2)
        janetc_emit_s(c, JOP_PUSH, args[i], 0);
    /* Push array phase */
    janetc_emit_s(c, JOP_PUSH_ARRAY, janet_v_last(args), 0);
    /* Call phase */
    JanetSlot target;
    if (opts.flags & JANET_FOPTS_TAIL) {
        janetc_emit_s(c, JOP_TAILCALL, args[0], 0);
        target = janetc_cslot(janet_wrap_nil());
        target.flags |= JANET_SLOT_RETURNED;
    } else {
        target = janetc_gettarget(opts);
        janetc_emit_ss(c, JOP_CALL, target, args[0], 1);
    }
    return target;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r15
movq %rdi, -0x38(%rbp)
leaq 0x10(%rbp), %rax
movl $0x1, %r12d
movl $0x30, %ebx
movl $0x18, %r13d
movl $0x48, %r14d
movq (%rax), %rax
movq %rax, -0x30(%rbp)
testq %r15, %r15
je 0x1a466
movslq -0x4(%r15), %rax
addq $-0x3, %rax
jmp 0x1a46d
movq $-0x3, %rax
cmpq %rax, %r12
jge 0x1a4cf
movq 0x10(%r15,%r14), %rax
movq %rax, 0x40(%rsp)
movups (%r15,%r14), %xmm0
movups %xmm0, 0x30(%rsp)
movq 0x10(%r15,%rbx), %rax
movq %rax, 0x28(%rsp)
movups (%r15,%rbx), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x10(%r15,%r13), %rax
movq %rax, 0x10(%rsp)
movups (%r15,%r13), %xmm0
movups %xmm0, (%rsp)
movq -0x30(%rbp), %rdi
movl $0x33, %esi
xorl %edx, %edx
callq 0x223bf
addq $0x3, %r12
addq $0x48, %rbx
addq $0x48, %r13
addq $0x48, %r14
jmp 0x1a457
testq %r15, %r15
je 0x1a4dd
movl -0x4(%r15), %eax
addl $-0x3, %eax
jmp 0x1a4e2
movl $0xfffffffd, %eax       # imm = 0xFFFFFFFD
movq -0x30(%rbp), %r14
cmpl %r12d, %eax
jne 0x1a527
movq 0x10(%r15,%rbx), %rax
movq %rax, 0x28(%rsp)
movups (%r15,%rbx), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x10(%r15,%r13), %rax
movq %rax, 0x10(%rsp)
movups (%r15,%r13), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
movl $0x32, %esi
xorl %edx, %edx
callq 0x22104
leaq 0x10(%rbp), %rbx
jmp 0x1a565
testq %r15, %r15
je 0x1a535
movl -0x4(%r15), %eax
addl $-0x2, %eax
jmp 0x1a53a
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
leaq 0x10(%rbp), %rbx
cmpl %r12d, %eax
jne 0x1a565
movq 0x10(%r15,%r13), %rax
movq %rax, 0x10(%rsp)
movups (%r15,%r13), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
movl $0x31, %esi
xorl %edx, %edx
callq 0x21e42
movslq -0x4(%r15), %rax
leaq (%rax,%rax,2), %rax
movq -0x8(%r15,%rax,8), %rcx
movq %rcx, 0x10(%rsp)
movups -0x18(%r15,%rax,8), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
movl $0x34, %esi
xorl %edx, %edx
callq 0x21e42
testb $0x1, 0x22(%rbx)
jne 0x1a5f1
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), %rbx
movq %rbx, %rdi
callq 0x1c898
movq 0x10(%r15), %rax
movq %rax, 0x28(%rsp)
movups (%r15), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
movl $0x35, %esi
movl $0x1, %edx
callq 0x22104
jmp 0x1a633
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movups (%r15), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
movl $0x36, %esi
xorl %edx, %edx
callq 0x21e42
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
callq 0x4f95a
movq -0x38(%rbp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1bc4e
orb $0x10, 0x12(%rbx)
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq