// File: /workspace/github_cpp_makefile_star2_O1/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 0x85bd
movq %rbx, %rdi
movl $0x2b, %esi
callq 0x2110
testq %rax, %rax
je 0x862c
movq %rsp, %rdi
movb $0x0, (%rdi)
movl $0x1000, %esi           # imm = 0x1000
movq %r14, %rdx
callq 0x8c4d
testl %eax, %eax
je 0x86c9
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 0x8644
movl %ecx, %edi
andl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
movzbl (%rsp,%rdi), %edi
decl %eax
leal -0x2f(%rdi), %r8d
cmpl $0x2d, %r8d
ja 0x8622
btq %r8, %rsi
jb 0x8646
decq %rcx
cmpl $0x7e, %edi
jne 0x85fd
jmp 0x8646
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
movb $0x1, %r14b
cmpl $-0x1, %eax
je 0x86a6
movl %eax, %ebp
movl %eax, %edi
movq %rbx, %rsi
callq 0x22c0
testq %rax, %rax
je 0x86a8
movq %rax, %rbx
xorl %r14d, %r14d
jmp 0x86be
jmp 0x86be
leaq 0x1000(%rsp), %rdi
callq 0x2050
movl %ebp, %edi
callq 0x2190
xorl %ebx, %ebx
testq %rbx, %rbx
sete %al
orb %r14b, %al
je 0x86cd
xorl %ebx, %ebx
jmp 0x8733
movl $0x18, %edi
callq 0x2250
testq %rax, %rax
je 0x8744
movq %rax, %r14
cmpq $0x0, 0x15899(%rip)     # 0x1df80
jne 0x86f5
callq 0x6758
movq %rax, 0x1588b(%rip)     # 0x1df80
leaq 0x1000(%rsp), %rdi
callq 0x2390
movq %rax, (%r14)
movq %rsp, %rdi
callq 0x2390
movq %rax, 0x8(%r14)
movl $0x0, 0x10(%r14)
movq 0x15860(%rip), %rdi     # 0x1df80
movq %rbx, %rsi
movq %r14, %rdx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x698d
movq %rbx, %rax
addq $0x2018, %rsp           # imm = 0x2018
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa0db(%rip), %rdi      # 0x12826
leaq 0x9daf(%rip), %rsi      # 0x12501
leaq 0xa11d(%rip), %rcx      # 0x12876
movl $0x157d, %edx           # imm = 0x157D
callq 0x2140