// File: /workspace/github_c_makefile_star2_O0/janet-lang[P]janet/src/core/corelib.c
// Function: janet_native
JanetModule janet_native(const char *name, const uint8_t **error) {
    janet_sandbox_assert(JANET_SANDBOX_DYNAMIC_MODULES);
    char *processed_name = get_processed_name(name);
    Clib lib = load_clib(processed_name);
    JanetModule init;
    JanetModconf getter;
    if (name != processed_name) janet_free(processed_name);
    if (!lib) {
        *error = janet_cstring(error_clib());
        return NULL;
    }
    init = (JanetModule) symbol_clib(lib, "_janet_init");
    if (!init) {
        *error = janet_cstring("could not find the _janet_init symbol");
        return NULL;
    }
    getter = (JanetModconf) symbol_clib(lib, "_janet_mod_config");
    if (!getter) {
        *error = janet_cstring("could not find the _janet_mod_config symbol");
        return NULL;
    }
    JanetBuildConfig modconf = getter();
    JanetBuildConfig host = janet_config_current();
    if (host.major != modconf.major ||
            host.minor < modconf.minor ||
            host.bits != modconf.bits) {
        char errbuf[128];
        snprintf(errbuf, sizeof(errbuf), "config mismatch - host %d.%.d.%d(%.4x) vs. module %d.%d.%d(%.4x)",
                 host.major,
                 host.minor,
                 host.patch,
                 host.bits,
                 modconf.major,
                 modconf.minor,
                 modconf.patch,
                 modconf.bits);
        *error = janet_cstring(errbuf);
        return NULL;
    }
    return init;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x20(%rbp)
movq %rsi, -0x28(%rbp)
movl $0x200, %edi            # imm = 0x200
callq 0x7ab10
movq -0x20(%rbp), %rdi
callq 0x6dec0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movl $0x2, %esi
callq 0x125d0
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x30(%rbp), %rax
je 0x24952
movq -0x30(%rbp), %rdi
callq 0x120b0
cmpq $0x0, -0x38(%rbp)
jne 0x2497d
callq 0x12090
movq %rax, %rdi
callq 0x64a70
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq $0x0, -0x18(%rbp)
jmp 0x24aa7
movq -0x38(%rbp), %rdi
leaq 0x5cf28(%rip), %rsi     # 0x818b0
callq 0x129c0
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x249bb
leaq 0x5cf1d(%rip), %rdi     # 0x818bc
callq 0x64a70
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq $0x0, -0x18(%rbp)
jmp 0x24aa7
movq -0x38(%rbp), %rdi
leaq 0x5cf1c(%rip), %rsi     # 0x818e2
callq 0x129c0
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x249f9
leaq 0x5cf17(%rip), %rdi     # 0x818f4
callq 0x64a70
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq $0x0, -0x18(%rbp)
jmp 0x24aa7
callq *-0x48(%rbp)
movq %rax, -0x58(%rbp)
movq %rdx, -0x50(%rbp)
movq 0x5ce95(%rip), %rax     # 0x818a0
movq %rax, -0x68(%rbp)
movq 0x5ce92(%rip), %rax     # 0x818a8
movq %rax, -0x60(%rbp)
movl -0x68(%rbp), %eax
cmpl -0x58(%rbp), %eax
jne 0x24a32
movl -0x64(%rbp), %eax
cmpl -0x54(%rbp), %eax
jb 0x24a32
movl -0x5c(%rbp), %eax
cmpl -0x4c(%rbp), %eax
je 0x24a9f
leaq -0xf0(%rbp), %rdi
movl -0x68(%rbp), %ecx
movl -0x64(%rbp), %r8d
movl -0x60(%rbp), %r9d
movl -0x5c(%rbp), %r14d
movl -0x58(%rbp), %ebx
movl -0x54(%rbp), %r11d
movl -0x50(%rbp), %r10d
movl -0x4c(%rbp), %eax
movl $0x80, %esi
leaq 0x5cebe(%rip), %rdx     # 0x81920
movl %r14d, (%rsp)
movl %ebx, 0x8(%rsp)
movl %r11d, 0x10(%rsp)
movl %r10d, 0x18(%rsp)
movl %eax, 0x20(%rsp)
movb $0x0, %al
callq 0x12390
leaq -0xf0(%rbp), %rdi
callq 0x64a70
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq $0x0, -0x18(%rbp)
jmp 0x24aa7
movq -0x40(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $0x110, %rsp            # imm = 0x110
popq %rbx
popq %r14
popq %rbp
retq
nopw (%rax,%rax)