// File: /workspace/github_cpp_makefile_star2_O2/attractivechaos[P]udb2/stb/./stb.h
// Function: stb_fopen
FILE *  stb_fopen(char *filename, char *mode)
{
   FILE *f;
   char name_full[4096];
   char temp_full[sizeof(name_full) + 12];
   int p;
#ifdef _MSC_VER
   int j;
#endif
   if (mode[0] != 'w' && !strchr(mode, '+'))
      return stb__fopen(filename, mode);

   // save away the full path to the file so if the program
   // changes the cwd everything still works right! unix has
   // better ways to do this, but we have to work in windows
   name_full[0] = '\0'; // stb_fullpath reads name_full[0]
   if (stb_fullpath(name_full, sizeof(name_full), filename)==0)
      return 0;

   // try to generate a temporary file in the same directory
   p = strlen(name_full)-1;
   while (p > 0 && name_full[p] != '/' && name_full[p] != '\\'
                && name_full[p] != ':' && name_full[p] != '~')
      --p;
   ++p;

   memcpy(temp_full, name_full, p);

   #ifdef _MSC_VER
   // try multiple times to make a temp file... just in
   // case some other process makes the name first
   for (j=0; j < 32; ++j) {
      strcpy(temp_full+p, "stmpXXXXXX");
      if (stb_mktemp(temp_full) == NULL)
         return 0;

      f = fopen(temp_full, mode);
      if (f != NULL)
         break;
   }
   #else
   {
      strcpy(temp_full+p, "stmpXXXXXX");
      #ifdef __MINGW32__
         int fd = open(mktemp(temp_full), O_RDWR);
      #else
         int fd = mkstemp(temp_full);
      #endif
      if (fd == -1) return NULL;
      f = fdopen(fd, mode);
      if (f == NULL) {
         unlink(temp_full);
         close(fd);
         return NULL;
      }
   }
   #endif
   if (f != NULL) {
      stb__file_data *d = (stb__file_data *) malloc(sizeof(*d));
      if (!d) { assert(0);  /* NOTREACHED */fclose(f); return NULL; }
      if (stb__files == NULL) stb__files = stb_ptrmap_create();
      d->temp_name = strdup(temp_full);
      d->name      = strdup(name_full);
      d->errors    = 0;
      stb_ptrmap_add(stb__files, f, d);
      return f;
   }

   return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x2018, %rsp           # imm = 0x2018
movq %rsi, %rbx
movq %rdi, %r14
cmpb $0x77, (%rsi)
je 0x7742
pushq $0x2b
popq %rsi
movq %rbx, %rdi
callq 0x2110
testq %rax, %rax
je 0x7868
movq %rsp, %rdi
movb $0x0, (%rdi)
movl $0x1000, %esi           # imm = 0x1000
movq %r14, %rdx
callq 0x7d76
testl %eax, %eax
je 0x7894
movq %rsp, %rdi
callq 0x2100
movl %eax, %ecx
shlq $0x20, %rax
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
movabsq $0x200000000801, %rsi   # imm = 0x200000000801
movq %rax, %r14
decq %rcx
testl %ecx, %ecx
jle 0x77ab
movl %ecx, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movzbl (%rsp,%rax), %edi
leal -0x2f(%rdi), %eax
cmpl $0x2d, %eax
ja 0x77a2
btq %rax, %rsi
jb 0x77ab
leaq (%r14,%rdx), %rax
cmpl $0x7e, %edi
jne 0x777f
sarq $0x20, %r14
leaq 0x1000(%rsp), %r15
movq %rsp, %rsi
movq %r15, %rdi
movq %r14, %rdx
callq 0x2230
movabsq $0x58585858706d7473, %rax # imm = 0x58585858706D7473
movq %rax, 0x1000(%rsp,%r14)
movl $0x585858, 0x1007(%rsp,%r14) # imm = 0x585858
movq %r15, %rdi
callq 0x2290
cmpl $-0x1, %eax
je 0x7894
movl %eax, %ebp
movl %eax, %edi
movq %rbx, %rsi
callq 0x22c0
testq %rax, %rax
je 0x7880
movq %rax, %rbx
pushq $0x18
popq %rdi
callq 0x2250
testq %rax, %rax
je 0x78a7
movq %rax, %r14
movq 0x1474d(%rip), %r15     # 0x1bf70
testq %r15, %r15
jne 0x7837
callq 0x5f43
movq %rax, %r15
movq %rax, 0x14739(%rip)     # 0x1bf70
leaq 0x1000(%rsp), %rdi
callq 0x2380
movq %rax, (%r14)
movq %rsp, %rdi
callq 0x2380
movq %rax, 0x8(%r14)
andl $0x0, 0x10(%r14)
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x6234
jmp 0x7896
movq %r14, %rdi
movq %rbx, %rsi
addq $0x2018, %rsp           # imm = 0x2018
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x22f0
leaq 0x1000(%rsp), %rdi
callq 0x2050
movl %ebp, %edi
callq 0x2190
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x2018, %rsp           # imm = 0x2018
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8e98(%rip), %rdi      # 0x10746
leaq 0x8b6c(%rip), %rsi      # 0x10421
leaq 0x8eda(%rip), %rcx      # 0x10796
movl $0x157d, %edx           # imm = 0x157D
callq 0x2140