// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce_app.c
// Function: user_config_init
bool user_config_init(CeUserConfig_t* user_config, const char* filepath){
#if defined(PLATFORM_WINDOWS)
     user_config->library_instance = LoadLibrary(filepath);
     if(user_config->library_instance == NULL){
          ce_log("LoadLibrary() failed\n");
          return false;
     }

     user_config->filepath = strdup(filepath);
     user_config->init_func = (CeUserConfigFunc*)(GetProcAddress(user_config->library_instance,
                                                                "ce_init"));
     if(user_config->init_func == NULL){
          ce_log("missing 'ce_init()' in %s\n", user_config->filepath);
          return false;
     }

     user_config->free_func = (CeUserConfigFunc*)(GetProcAddress(user_config->library_instance,
                                                                "ce_free"));
     if(user_config->free_func == NULL){
          ce_log("missing 'ce_init()' in %s\n", user_config->filepath);
          return false;
     }

     user_config->save_func = (CeOnSaveFunc*)(GetProcAddress(user_config->library_instance,
                                                             "ce_on_save_file"));
     if(user_config->save_func != NULL){
          ce_log("Detected 'ce_on_save_func()' in %s\n", user_config->filepath);
     }
#else
     user_config->handle = dlopen(filepath, RTLD_LAZY);
     if(!user_config->handle){
          ce_log("dlopen() failed: '%s'\n", dlerror());
          return false;
     }

     user_config->filepath = strdup(filepath);
     user_config->init_func = dlsym(user_config->handle, "ce_init");
     if(!user_config->init_func){
          ce_log("missing 'ce_init()' in %s\n", user_config->filepath);
          return false;
     }

     user_config->free_func = dlsym(user_config->handle, "ce_free");
     if(!user_config->free_func){
          ce_log("missing 'ce_init()' in %s\n", user_config->filepath);
          return false;
     }

     user_config->save_func = dlsym(user_config->handle, "ce_on_save_file");
     if(user_config->save_func){
          ce_log("detected 'ce_on_save_file()' in %s\n", user_config->filepath);
     }
#endif
     return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0xd390
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x155a1
callq 0xd080
movq %rax, %rsi
leaq 0x2d2e0(%rip), %rdi     # 0x42871
movb $0x0, %al
callq 0xd8f0
movb $0x0, -0x1(%rbp)
jmp 0x15685
movq -0x18(%rbp), %rdi
callq 0xd620
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0x2d2c5(%rip), %rsi     # 0x42888
callq 0xd5c0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x155fd
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
leaq 0x2d2a3(%rip), %rdi     # 0x42890
movb $0x0, %al
callq 0xd8f0
movb $0x0, -0x1(%rbp)
jmp 0x15685
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0x2d2a0(%rip), %rsi     # 0x428ab
callq 0xd5c0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x15642
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
leaq 0x2d25b(%rip), %rdi     # 0x42890
movb $0x0, %al
callq 0xd8f0
movb $0x0, -0x1(%rbp)
jmp 0x15685
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0x2d263(%rip), %rsi     # 0x428b3
callq 0xd5c0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x15681
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
leaq 0x2d249(%rip), %rdi     # 0x428c3
movb $0x0, %al
callq 0xd8f0
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq