// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/core/fa.c
// Function: gt_xtmpfp_generic_func
FILE* gt_xtmpfp_generic_func(GtStr *template_arg, enum tmpfp_flags flags,
                             const char *src_file, int src_line)
{
  FILE *fp;
  GtStr *template;
  gt_assert(fa);
  if (flags & GT_TMPFP_USETEMPLATE)
  {
    gt_assert(template_arg);
    template = template_arg;
  }
  else
  {
    if (template_arg)
      template = template_arg;
    else
      template = gt_str_new();
    {
      const char *tmpdir = NULL;
      if (!tmpdir)
        tmpdir = gt_fa_try_tmpdir(getenv("TMPDIR"));
      if (!tmpdir)
        tmpdir = gt_fa_try_tmpdir(getenv("TMP"));
      if (!tmpdir)
        tmpdir = gt_fa_try_tmpdir(P_tmpdir);
      if (!tmpdir)
        tmpdir = gt_fa_try_tmpdir("/tmp");
      if (!tmpdir)
        tmpdir = gt_fa_try_tmpdir("/var/tmp");
      if (!tmpdir)
        tmpdir = gt_fa_try_tmpdir("/usr/tmp");
      if (!tmpdir)
        tmpdir = gt_fa_try_tmpdir(".");
      gt_assert(tmpdir);
      gt_str_set(template, tmpdir);
    }
    gt_str_append_cstr(template, genometools_tmptemplate);
  }
  {
    int fd = gt_mkstemp(gt_str_get(template));
    char mode[] = { 'w', '+', flags & GT_TMPFP_OPENBINARY?'b':'\0', '\0' };
    fp = gt_xfdopen(fd, mode);
  }
  gt_assert(fp);
  if (flags & GT_TMPFP_AUTOREMOVE)
  {
    gt_xremove(gt_str_get(template));
  }
  {
    FAFileInfo *fileinfo;
    fileinfo = gt_malloc(sizeof (FAFileInfo));
    fileinfo->src_file = src_file;
    fileinfo->src_line = src_line;
    gt_mutex_lock(fa->file_mutex);
    gt_hashmap_add(fa->file_pointer, fp, fileinfo);
    gt_mutex_unlock(fa->file_mutex);
  }
  if (!template_arg)
    gt_str_delete(template);
  return fp;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpq $0x0, 0xde95f(%rip)     # 0x152bd0
je 0x74494
movl %ecx, %ebp
movq %rdx, %r15
movl %esi, %r12d
movq %rdi, %rbx
movq %rdi, %r14
testb $0x2, %r12b
jne 0x742c3
testq %rbx, %rbx
jne 0x74298
callq 0x3bfe0
movq %rax, %r14
leaq 0x7c77b(%rip), %rdi     # 0xf0a1a
callq 0xb7c0
testq %rax, %rax
je 0x742d1
movq %rax, %r13
movq %rax, %rdi
movl $0x7, %esi
callq 0xbab0
xorl %esi, %esi
testl %eax, %eax
cmoveq %r13, %rsi
jmp 0x742d3
testq %rbx, %rbx
jne 0x743ca
callq 0x1af72
xorl %esi, %esi
testq %rsi, %rsi
jne 0x74305
leaq 0x7c742(%rip), %rdi     # 0xf0a21
callq 0xb7c0
testq %rax, %rax
je 0x74303
movq %rax, %r13
movq %rax, %rdi
movl $0x7, %esi
callq 0xbab0
xorl %esi, %esi
testl %eax, %eax
cmoveq %r13, %rsi
jmp 0x74305
xorl %esi, %esi
testq %rsi, %rsi
jne 0x74326
leaq 0x7c718(%rip), %r13     # 0xf0a29
movq %r13, %rdi
movl $0x7, %esi
callq 0xbab0
xorl %esi, %esi
testl %eax, %eax
cmoveq %r13, %rsi
testq %rsi, %rsi
jne 0x74347
leaq 0x7c6f7(%rip), %r13     # 0xf0a29
movq %r13, %rdi
movl $0x7, %esi
callq 0xbab0
xorl %esi, %esi
testl %eax, %eax
cmoveq %r13, %rsi
testq %rsi, %rsi
jne 0x74368
leaq 0x7c6d2(%rip), %r13     # 0xf0a25
movq %r13, %rdi
movl $0x7, %esi
callq 0xbab0
xorl %esi, %esi
testl %eax, %eax
cmoveq %r13, %rsi
testq %rsi, %rsi
jne 0x74389
leaq 0x7c6ba(%rip), %r13     # 0xf0a2e
movq %r13, %rdi
movl $0x7, %esi
callq 0xbab0
xorl %esi, %esi
testl %eax, %eax
cmoveq %r13, %rsi
testq %rsi, %rsi
jne 0x743aa
leaq 0x760c9(%rip), %r13     # 0xea45e
movq %r13, %rdi
movl $0x7, %esi
callq 0xbab0
xorl %esi, %esi
testl %eax, %eax
cmoveq %r13, %rsi
testq %rsi, %rsi
je 0x7449e
movq %r14, %rdi
callq 0x3c0cc
leaq 0x7caee(%rip), %rsi     # 0xf0eb0
movq %r14, %rdi
callq 0x3c067
movq %r14, %rdi
callq 0x3c40b
movq %rax, %rdi
callq 0xa4394
leaq 0x4(%rsp), %rsi
movw $0x2b77, (%rsi)         # imm = 0x2B77
movl %r12d, %ecx
andl $0x4, %ecx
movl $0x62, %edx
cmovel %ecx, %edx
movb %dl, 0x2(%rsi)
movb $0x0, 0x3(%rsi)
movl %eax, %edi
callq 0x83605
testq %rax, %rax
je 0x74499
movq %rax, %r13
testb $0x1, %r12b
je 0x74422
movq %r14, %rdi
callq 0x3c40b
movq %rax, %rdi
callq 0x3dd48
leaq 0x7c4ac(%rip), %rsi     # 0xf08d5
movl $0x10, %edi
movl $0x173, %edx            # imm = 0x173
callq 0x35ee2
movq %rax, %r12
movq %r15, (%rax)
movl %ebp, 0x8(%rax)
movq 0xde788(%rip), %rax     # 0x152bd0
movq (%rax), %rdi
callq 0x3d9b7
movq 0xde779(%rip), %rax     # 0x152bd0
movq 0x10(%rax), %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x77144
movq 0xde763(%rip), %rax     # 0x152bd0
movq (%rax), %rdi
callq 0x3d9d2
testq %rbx, %rbx
jne 0x74482
movq %r14, %rdi
callq 0x3d1eb
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1b01d
callq 0x1afab
callq 0x1afe4