// File: /workspace/github_cpp_makefile_star2_O3/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 0x84c5
movq %rbx, %rdi
movl $0x2b, %esi
callq 0x2110
testq %rax, %rax
je 0x8534
movq %rsp, %rdi
movb $0x0, (%rdi)
movl $0x1000, %esi           # imm = 0x1000
movq %r14, %rdx
callq 0x8b46
testl %eax, %eax
je 0x862b
movq %rsp, %rdi
callq 0x2100
movl %eax, %ecx
leal -0x1(%rax), %esi
movl %esi, %edx
sarl $0x1f, %edx
andl %esi, %edx
incl %edx
incl %eax
decq %rcx
movabsq $0x200000000801, %rsi   # imm = 0x200000000801
leal -0x2(%rax), %edi
testl %edi, %edi
jle 0x854c
movl %ecx, %edi
andl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
movzbl (%rsp,%rdi), %edi
decl %eax
leal -0x2f(%rdi), %r8d
cmpl $0x2d, %r8d
ja 0x852a
btq %r8, %rsi
jb 0x854e
decq %rcx
cmpl $0x7e, %edi
jne 0x8505
jmp 0x854e
movq %r14, %rdi
movq %rbx, %rsi
addq $0x2018, %rsp           # imm = 0x2018
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x22f0
movl %edx, %eax
movslq %eax, %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 0x862b
movl %eax, %ebp
movl %eax, %edi
movq %rbx, %rsi
callq 0x22c0
testq %rax, %rax
je 0x8617
movq %rax, %rbx
movl $0x18, %edi
callq 0x2250
testq %rax, %rax
je 0x863e
movq %rax, %r14
movq 0x159a9(%rip), %r15     # 0x1df70
testq %r15, %r15
jne 0x85db
callq 0x66e4
movq %rax, %r15
movq %rax, 0x15995(%rip)     # 0x1df70
leaq 0x1000(%rsp), %rdi
callq 0x2380
movq %rax, (%r14)
movq %rsp, %rdi
callq 0x2380
movq %rax, 0x8(%r14)
movl $0x0, 0x10(%r14)
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x6916
jmp 0x862d
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 0xa191(%rip), %rdi      # 0x127d6
leaq 0x9e65(%rip), %rsi      # 0x124b1
leaq 0xa1d3(%rip), %rcx      # 0x12826
movl $0x157d, %edx           # imm = 0x157D
callq 0x2140