// File: /workspace/github_c_makefile_star2_O2/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 0x231fd
movq %rbx, %rdi
callq 0x27d86
testl %eax, %eax
je 0x2329c
leaq 0x10(%rbp), %rax
movl (%rax), %r15d
leal -0x1(%r15), %ecx
cmpl $0x7, %ecx
ja 0x23282
leaq 0x31e0c(%rip), %rdx     # 0x54fc0
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movq 0x8(%rax), %r14
movq %r14, %rdi
callq 0x411ea
movabsq $-0x6000000000000, %rsi # imm = 0xFFFA000000000000
movq %rax, %rdi
callq 0x4b366
movq %rbx, %rdi
movq %rax, %rsi
callq 0x209ca
cmpl $0x3, %r15d
jne 0x2329c
movq %r14, %rdi
callq 0x120b0
jmp 0x2329c
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rax), %rdi
callq 0x411ea
movabsq $-0x6000000000000, %rsi # imm = 0xFFFA000000000000
jmp 0x2326d
cvtsi2sdl 0x4(%rax), %xmm0
callq 0x4b471
jmp 0x23291
cmpl $0x1, 0x4(%rax)
movabsq $-0x7000000000000, %rdi # imm = 0xFFF9000000000000
sbbq $-0x1, %rdi
jmp 0x2328c
movq 0x8(%rax), %rdi
callq 0x439c6
movabsq $-0x5000000000000, %rsi # imm = 0xFFFB000000000000
movq %rax, %rdi
callq 0x4b366
jmp 0x23291
movq 0x8(%rax), %rdi
callq 0x439c6
movabsq $-0x5000000000000, %rsi # imm = 0xFFFB000000000000
movq %rax, %rdi
callq 0x4b366
movq %rbx, %rdi
movq %rax, %rsi
callq 0x209bb
jmp 0x2329c
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
callq 0x4b313
movq %rbx, %rdi
movq %rax, %rsi
callq 0x209ca
movabsq $-0x6800000000000, %rsi # imm = 0xFFF9800000000000
movq %rbx, %rdi
callq 0x4b3ab
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x293b5