// File: /workspace/github_c_makefile_star2_O3/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 $0x48, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x10(%rbp), %r12
movq (%r12), %r14
testq %rsi, %rsi
je 0x1a466
movl -0x4(%r15), %eax
cmpl $0x5, %eax
jl 0x1a3e8
leaq 0x48(%r15), %r12
movl $0x1, %r13d
movq 0x10(%r12), %rax
movq %rax, 0x40(%rsp)
movups (%r12), %xmm0
movups %xmm0, 0x30(%rsp)
movq -0x8(%r12), %rax
movq %rax, 0x28(%rsp)
movups -0x18(%r12), %xmm0
movups %xmm0, 0x18(%rsp)
movq -0x20(%r12), %rax
movq %rax, 0x10(%rsp)
movups -0x30(%r12), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
movl $0x33, %esi
xorl %edx, %edx
callq 0x22063
addq $0x3, %r13
movslq -0x4(%r15), %rax
leaq -0x3(%rax), %rcx
addq $0x48, %r12
cmpq %rcx, %r13
jl 0x1a381
leaq 0x10(%rbp), %r12
jmp 0x1a3f1
leal -0x3(%rax), %ecx
movl $0x1, %r13d
cmpl %r13d, %ecx
jne 0x1a435
movl %ecx, %eax
leaq (%rax,%rax,2), %rax
movq 0x28(%r15,%rax,8), %rcx
movq %rcx, 0x28(%rsp)
movups 0x18(%r15,%rax,8), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x10(%r15,%rax,8), %rcx
movq %rcx, 0x10(%rsp)
movups (%r15,%rax,8), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
movl $0x32, %esi
xorl %edx, %edx
callq 0x21da8
jmp 0x1a466
addl $-0x2, %eax
cmpl %r13d, %eax
jne 0x1a466
movl %r13d, %eax
leaq (%rax,%rax,2), %rax
movq 0x10(%r15,%rax,8), %rcx
movq %rcx, 0x10(%rsp)
movups (%r15,%rax,8), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
movl $0x31, %esi
xorl %edx, %edx
callq 0x21ae6
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 0x21ae6
testb $0x1, 0x22(%r12)
jne 0x1a4f5
movq 0x20(%r12), %rax
movq %rax, 0x20(%rsp)
movups (%r12), %xmm0
movups 0x10(%r12), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x1c64f
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 0x21da8
jmp 0x1a533
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movups (%r15), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
movl $0x36, %esi
xorl %edx, %edx
callq 0x21ae6
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
callq 0x4ece6
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1baf6
orb $0x10, 0x12(%rbx)
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq