// File: kallaballa[P]PixelStencil/./CImg.h
// Function: cimg_library::cimg::medcon_path(char const*, bool)
inline const char* medcon_path(const char *const user_path=0, const bool reinit_path=false) {
      static char *st_path = 0;
      if (reinit_path) { delete[] st_path; st_path = 0; }
      if (user_path) {
        if (!st_path) st_path = new char[1024];
        std::memset(st_path,0,1024);
        std::strncpy(st_path,user_path,1023);
      } else if (!st_path) {
        st_path = new char[1024];
        std::memset(st_path,0,1024);
        bool path_found = false;
        std::FILE *file = 0;
#if cimg_OS==2
        const char *const pf_path = programfiles_path();
        if (!path_found) {
          std::strcpy(st_path,".\\medcon.exe");
          if ((file=std::fopen(st_path,"r"))!=0) { cimg::fclose(file); path_found = true; }
        }
        if (!path_found) {
          cimg_snprintf(st_path,sizeof(st_path),"%s\\XMedCon\\bin\\medcon.bat",pf_path);
          if ((file=std::fopen(st_path,"r"))!=0) { cimg::fclose(file); path_found = true; }
        }
        if (!path_found) {
          cimg_snprintf(st_path,sizeof(st_path),"%s\\XMedCon\\bin\\medcon.exe",pf_path);
          if ((file=std::fopen(st_path,"r"))!=0) { cimg::fclose(file); path_found = true; }
        }
        if (!path_found) std::strcpy(st_path,"medcon.exe");
#else
        if (!path_found) {
          std::strcpy(st_path,"./medcon");
          if ((file=std::fopen(st_path,"r"))!=0) { cimg::fclose(file); path_found = true; }
        }
        if (!path_found) std::strcpy(st_path,"medcon");
#endif
        winformat_string(st_path);
      }
      return st_path;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
andb $0x1, %al
movb %al, -0x9(%rbp)
testb $0x1, -0x9(%rbp)
je 0xcb5f
movq 0x43897(%rip), %rax     # 0x503d8
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0xcb54
movq -0x20(%rbp), %rdi
callq 0x4490
movq $0x0, 0x43879(%rip) # 0x503d8
cmpq $0x0, -0x8(%rbp)
je 0xcbae
cmpq $0x0, 0x4386a(%rip)     # 0x503d8
jne 0xcb81
movl $0x400, %edi            # imm = 0x400
callq 0x4040
movq %rax, 0x43857(%rip)     # 0x503d8
movq 0x43850(%rip), %rdi     # 0x503d8
xorl %esi, %esi
movl $0x400, %edx            # imm = 0x400
callq 0x41c0
movq 0x4383d(%rip), %rdi     # 0x503d8
movq -0x8(%rbp), %rsi
movl $0x3ff, %edx            # imm = 0x3FF
callq 0x41a0
jmp 0xcc58
cmpq $0x0, 0x43822(%rip)     # 0x503d8
jne 0xcc56
movl $0x400, %edi            # imm = 0x400
callq 0x4040
movq %rax, 0x4380b(%rip)     # 0x503d8
movq 0x43804(%rip), %rdi     # 0x503d8
xorl %esi, %esi
movl $0x400, %edx            # imm = 0x400
callq 0x41c0
movb $0x0, -0xa(%rbp)
movq $0x0, -0x18(%rbp)
testb $0x1, -0xa(%rbp)
jne 0xcc31
movq 0x437df(%rip), %rdi     # 0x503d8
leaq 0x36011(%rip), %rsi     # 0x42c11
callq 0x4320
movq 0x437cc(%rip), %rdi     # 0x503d8
leaq 0x35acd(%rip), %rsi     # 0x426e0
callq 0x4450
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0xcc2f
movq -0x18(%rbp), %rdi
callq 0xd0a0
movb $0x1, -0xa(%rbp)
jmp 0xcc31
testb $0x1, -0xa(%rbp)
jne 0xcc4a
movq 0x4379a(%rip), %rdi     # 0x503d8
leaq 0x35fce(%rip), %rsi     # 0x42c13
callq 0x4320
movq 0x43787(%rip), %rdi     # 0x503d8
callq 0xd130
jmp 0xcc58
movq 0x43779(%rip), %rax     # 0x503d8
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop