// File: /workspace/github_cpp_makefile_star2_O3/kallaballa[P]PixelStencil/./CImg.h
// Function: cimg_library::cimg::temporary_path(char const*, bool)
inline const char* temporary_path(const char *const user_path=0, const bool reinit_path=false) {
#define _cimg_test_temporary_path(p) \
      if (!path_found) { \
        cimg_snprintf(st_path,1024,"%s",p); \
        cimg_snprintf(tmp,sizeof(tmp),"%s%c%s",st_path,cimg_file_separator,filetmp); \
        if ((file=std::fopen(tmp,"wb"))!=0) { cimg::fclose(file); std::remove(tmp); path_found = true; } \
      }
      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;
        char tmp[1024] = { 0 }, filetmp[512] = { 0 };
        std::FILE *file = 0;
        cimg_snprintf(filetmp,sizeof(filetmp),"%s.tmp",cimg::filenamerand());
        char *tmpPath = std::getenv("TMP");
        if (!tmpPath) { tmpPath = std::getenv("TEMP"); winformat_string(tmpPath); }
        if (tmpPath) _cimg_test_temporary_path(tmpPath);
#if cimg_OS==2
        _cimg_test_temporary_path("C:\\WINNT\\Temp");
        _cimg_test_temporary_path("C:\\WINDOWS\\Temp");
        _cimg_test_temporary_path("C:\\Temp");
        _cimg_test_temporary_path("C:");
        _cimg_test_temporary_path("D:\\WINNT\\Temp");
        _cimg_test_temporary_path("D:\\WINDOWS\\Temp");
        _cimg_test_temporary_path("D:\\Temp");
        _cimg_test_temporary_path("D:");
#else
        _cimg_test_temporary_path("/tmp");
        _cimg_test_temporary_path("/var/tmp");
#endif
        if (!path_found) {
          *st_path = 0;
          std::strncpy(tmp,filetmp,sizeof(tmp)-1);
          if ((file=std::fopen(tmp,"wb"))!=0) { cimg::fclose(file); std::remove(tmp); path_found = true; }
        }
        if (!path_found)
          throw CImgIOException("cimg::temporary_path(): Failed to locate path for writing temporary files.\n");
      }
      return st_path;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x618, %rsp            # imm = 0x618
movq %rdi, %rbx
testl %esi, %esi
je 0x99d7
movq 0x3094e(%rip), %rdi     # 0x3a310
testq %rdi, %rdi
je 0x99cc
callq 0x3380
movq $0x0, 0x30939(%rip) # 0x3a310
movq 0x30932(%rip), %r14     # 0x3a310
testq %rbx, %rbx
je 0x9a28
testq %r14, %r14
jne 0x99fc
movl $0x400, %edi            # imm = 0x400
callq 0x3040
movq %rax, %r14
movq %rax, 0x30914(%rip)     # 0x3a310
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
xorl %esi, %esi
callq 0x3150
movl $0x3ff, %edx            # imm = 0x3FF
movq %r14, %rdi
movq %rbx, %rsi
addq $0x618, %rsp            # imm = 0x618
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3120
testq %r14, %r14
jne 0x9cff
movl $0x400, %edi            # imm = 0x400
callq 0x3040
movq %rax, 0x308ce(%rip)     # 0x3a310
movl $0x400, %edx            # imm = 0x400
movq %rax, %rdi
xorl %esi, %esi
callq 0x3150
leaq 0x210(%rsp), %rdi
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x3150
leaq 0x10(%rsp), %rdi
movl $0x200, %edx            # imm = 0x200
xorl %esi, %esi
callq 0x3150
cmpb $0x1, 0x30853(%rip)     # 0x3a2d0
jne 0x9ac4
movq %rsp, %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3480
movabsq $0x20c49ba5e353f7cf, %rax # imm = 0x20C49BA5E353F7CF
imulq 0x8(%rbx)
movq %rdx, %rax
shrq $0x3f, %rax
shrq $0x7, %rdx
addl %edx, %eax
imull $0x3e8, (%rbx), %ebx    # imm = 0x3E8
addl %eax, %ebx
callq 0x33f0
addl %eax, %ebx
movl %ebx, %edi
callq 0x3280
movb $0x0, 0x3080c(%rip)     # 0x3a2d0
xorl %ebx, %ebx
leaq 0x3084b(%rip), %r14     # 0x3a318
callq 0x3080
movslq %eax, %r15
imulq $0x55555556, %r15, %rax # imm = 0x55555556
movq %rax, %rcx
shrq $0x3f, %rcx
shrq $0x20, %rax
addl %ecx, %eax
leal (%rax,%rax,2), %ebp
callq 0x3080
subl %ebp, %r15d
je 0x9b03
cmpl $0x1, %r15d
jne 0x9b0f
movl $0x61, %ecx
jmp 0x9b14
movl $0x30, %ecx
movl $0xa, %esi
jmp 0x9b19
movl $0x41, %ecx
movl $0x1a, %esi
cltd
idivl %esi
addl %ecx, %edx
movb %dl, (%rbx,%r14)
incq %rbx
cmpq $0x8, %rbx
jne 0x9acd
leaq 0x240ca(%rip), %rdx     # 0x2dbfc
leaq 0x307df(%rip), %rcx     # 0x3a318
leaq 0x10(%rsp), %rdi
movl $0x200, %esi            # imm = 0x200
xorl %eax, %eax
callq 0x3460
leaq 0x240b2(%rip), %rdi     # 0x2dc03
callq 0x3360
testq %rax, %rax
jne 0x9b6c
leaq 0x240a5(%rip), %rdi     # 0x2dc07
callq 0x3360
testq %rax, %rax
je 0x9bd1
movq 0x3079d(%rip), %rdi     # 0x3a310
leaq 0x25b87(%rip), %rdx     # 0x2f701
movl $0x400, %esi            # imm = 0x400
movq %rax, %rcx
xorl %eax, %eax
callq 0x3460
movq 0x30780(%rip), %rcx     # 0x3a310
leaq 0x24075(%rip), %rdx     # 0x2dc0c
leaq 0x210(%rsp), %rbx
leaq 0x10(%rsp), %r9
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdi
movl $0x2f, %r8d
xorl %eax, %eax
callq 0x3460
leaq 0x24053(%rip), %rsi     # 0x2dc13
movq %rbx, %rdi
callq 0x3350
testq %rax, %rax
jne 0x9cb7
movq 0x30738(%rip), %rax     # 0x3a310
movb $0x0, 0x4(%rax)
movl $0x706d742f, (%rax)     # imm = 0x706D742F
movq 0x30727(%rip), %rcx     # 0x3a310
leaq 0x2401c(%rip), %rdx     # 0x2dc0c
leaq 0x210(%rsp), %rbx
leaq 0x10(%rsp), %r9
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdi
movl $0x2f, %r8d
xorl %eax, %eax
callq 0x3460
leaq 0x23ffa(%rip), %rsi     # 0x2dc13
movq %rbx, %rdi
callq 0x3350
testq %rax, %rax
jne 0x9cb7
movq 0x306df(%rip), %rcx     # 0x3a310
movabsq $0x706d742f7261762f, %rax # imm = 0x706D742F7261762F
movq %rax, (%rcx)
movb $0x0, 0x8(%rcx)
leaq 0x23fc3(%rip), %rdx     # 0x2dc0c
leaq 0x210(%rsp), %rbx
leaq 0x10(%rsp), %r9
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdi
movl $0x2f, %r8d
xorl %eax, %eax
callq 0x3460
leaq 0x23fa1(%rip), %rsi     # 0x2dc13
movq %rbx, %rdi
callq 0x3350
testq %rax, %rax
jne 0x9cb7
movq 0x3068a(%rip), %rax     # 0x3a310
movb $0x0, (%rax)
leaq 0x210(%rsp), %rbx
leaq 0x10(%rsp), %rsi
movl $0x3ff, %edx            # imm = 0x3FF
movq %rbx, %rdi
callq 0x3120
leaq 0x23f69(%rip), %rsi     # 0x2dc13
movq %rbx, %rdi
callq 0x3350
testq %rax, %rax
je 0x9d10
movq 0x30302(%rip), %rcx     # 0x39fc0
cmpq %rax, (%rcx)
je 0x9ceb
movq 0x302ce(%rip), %rcx     # 0x39f98
cmpq %rax, (%rcx)
je 0x9ceb
movq %rax, %rdi
callq 0x32b0
testl %eax, %eax
je 0x9ceb
leaq 0x23eb2(%rip), %rdi     # 0x2db94
movl %eax, %esi
xorl %eax, %eax
callq 0x9db1
leaq 0x210(%rsp), %rdi
callq 0x34f0
movq 0x30611(%rip), %r14     # 0x3a310
movq %r14, %rax
addq $0x618, %rsp            # imm = 0x618
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x4008, %edi           # imm = 0x4008
callq 0x3110
movq %rax, %rbx
leaq 0x23efb(%rip), %rsi     # 0x2dc1f
movq %rax, %rdi
xorl %eax, %eax
callq 0x89a6
leaq 0x2ff9b(%rip), %rsi     # 0x39cd0
movq 0x3029c(%rip), %rdx     # 0x39fd8
movq %rbx, %rdi
callq 0x34b0
movq %rax, %r14
movq %rbx, %rdi
callq 0x31e0
movq %r14, %rdi
callq 0x34d0