// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ev.c
// Function: janet_ev_default_threaded_callback
void janet_ev_default_threaded_callback(JanetEVGenericMessage return_value) {
    if (return_value.fiber == NULL) {
        return;
    }
    if (janet_fiber_can_resume(return_value.fiber)) {
        switch (return_value.tag) {
            default:
            case JANET_EV_TCTAG_NIL:
                janet_schedule(return_value.fiber, janet_wrap_nil());
                break;
            case JANET_EV_TCTAG_INTEGER:
                janet_schedule(return_value.fiber, janet_wrap_integer(return_value.argi));
                break;
            case JANET_EV_TCTAG_STRING:
            case JANET_EV_TCTAG_STRINGF:
                janet_schedule(return_value.fiber, janet_cstringv((const char *) return_value.argp));
                if (return_value.tag == JANET_EV_TCTAG_STRINGF) janet_free(return_value.argp);
                break;
            case JANET_EV_TCTAG_KEYWORD:
                janet_schedule(return_value.fiber, janet_ckeywordv((const char *) return_value.argp));
                break;
            case JANET_EV_TCTAG_ERR_STRING:
            case JANET_EV_TCTAG_ERR_STRINGF:
                janet_cancel(return_value.fiber, janet_cstringv((const char *) return_value.argp));
                if (return_value.tag == JANET_EV_TCTAG_STRINGF) janet_free(return_value.argp);
                break;
            case JANET_EV_TCTAG_ERR_KEYWORD:
                janet_cancel(return_value.fiber, janet_ckeywordv((const char *) return_value.argp));
                break;
            case JANET_EV_TCTAG_BOOLEAN:
                janet_schedule(return_value.fiber, janet_wrap_boolean(return_value.argi));
                break;
        }
    }
    janet_gcunroot(janet_wrap_fiber(return_value.fiber));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x28(%rbp), %rbx
testq %rbx, %rbx
je 0x2576d
movq %rbx, %rdi
callq 0x2a67c
testl %eax, %eax
je 0x25842
leaq 0x10(%rbp), %rax
movl (%rax), %r15d
leal -0x1(%r15), %ecx
cmpl $0x7, %ecx
ja 0x25824
leaq 0x34884(%rip), %rdx     # 0x59fc0
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movq 0x8(%rax), %r14
movq %r14, %rdi
callq 0x4516c
movabsq $-0x6000000000000, %rsi # imm = 0xFFFA000000000000
movq %rax, %rdi
callq 0x4f9ad
movq %rbx, %rdi
movq %rax, %rsi
xorl %edx, %edx
jmp 0x257a1
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rax), %r14
movq %r14, %rdi
callq 0x4516c
movabsq $-0x6000000000000, %rsi # imm = 0xFFFA000000000000
movq %rax, %rdi
callq 0x4f9ad
movq %rbx, %rdi
movq %rax, %rsi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x22b9f
cmpl $0x3, %r15d
jne 0x25842
movq %r14, %rdi
callq 0x120b0
jmp 0x25842
cvtsi2sdl 0x4(%rax), %xmm0
callq 0x4fab8
jmp 0x25833
cmpl $0x1, 0x4(%rax)
movabsq $-0x7000000000000, %rdi # imm = 0xFFF9000000000000
sbbq $-0x1, %rdi
jmp 0x2582e
movq 0x8(%rax), %rdi
callq 0x47cd3
movabsq $-0x5000000000000, %rsi # imm = 0xFFFB000000000000
movq %rax, %rdi
callq 0x4f9ad
jmp 0x25833
movq 0x8(%rax), %rdi
callq 0x47cd3
movabsq $-0x5000000000000, %rsi # imm = 0xFFFB000000000000
movq %rax, %rdi
callq 0x4f9ad
movq %rbx, %rdi
movq %rax, %rsi
movl $0x1, %edx
jmp 0x2583b
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
callq 0x4f95a
movq %rbx, %rdi
movq %rax, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x22b9f
movabsq $-0x6800000000000, %rsi # imm = 0xFFF9800000000000
movq %rbx, %rdi
callq 0x4f9f2
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2bd0b