// File: /workspace/github_c_makefile_star2_O2/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, -0x30(%rbp)
leaq 0x10(%rbp), %rax
movq (%rax), %r14
leaq 0x48(%rsi), %r13
pushq $0x1
popq %rbx
pushq $0x33
popq %r12
testq %r15, %r15
je 0x1897b
movslq -0x4(%r15), %rax
leaq -0x3(%rax), %rcx
cmpq %rcx, %rbx
jge 0x18914
movq 0x10(%r13), %rax
movq %rax, 0x40(%rsp)
movups (%r13), %xmm0
movups %xmm0, 0x30(%rsp)
movq -0x8(%r13), %rax
movq %rax, 0x28(%rsp)
movups -0x18(%r13), %xmm0
movups %xmm0, 0x18(%rsp)
movq -0x20(%r13), %rax
movq %rax, 0x10(%rsp)
movups -0x30(%r13), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
movl %r12d, %esi
xorl %edx, %edx
callq 0x2010f
addq $0x3, %rbx
addq $0x48, %r13
jmp 0x188af
cmpl %ecx, %ebx
jne 0x18955
movl %ecx, %eax
imulq $0x18, %rax, %rax
movq 0x28(%r15,%rax), %rcx
movq %rcx, 0x28(%rsp)
movups 0x18(%r15,%rax), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x10(%r15,%rax), %rcx
movq %rcx, 0x10(%rsp)
movups (%r15,%rax), %xmm0
movups %xmm0, (%rsp)
pushq $0x32
popq %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x1fe89
jmp 0x1897b
addl $-0x2, %eax
cmpl %eax, %ebx
jne 0x1897b
movq -0x20(%r13), %rax
movq %rax, 0x10(%rsp)
movups -0x30(%r13), %xmm0
movups %xmm0, (%rsp)
pushq $0x31
popq %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x1fbb3
movslq -0x4(%r15), %rax
imulq $0x18, %rax, %rax
movq -0x8(%r15,%rax), %rcx
movq %rcx, 0x10(%rsp)
movups -0x18(%r15,%rax), %xmm0
movups %xmm0, (%rsp)
pushq $0x34
popq %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x1fbb3
leaq 0x10(%rbp), %rcx
testb $0x1, 0x22(%rcx)
jne 0x18a05
movq 0x20(%rcx), %rax
movq %rax, 0x20(%rsp)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
callq 0x1aa9e
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)
pushq $0x35
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rdi
callq 0x1fe89
jmp 0x18a45
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movups (%r15), %xmm0
movups %xmm0, (%rsp)
pushq $0x36
popq %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x1fbb3
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
callq 0x4b313
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x19f5c
orb $0x10, 0x12(%rbx)
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq