// File: /workspace/github_c_makefile_star2_O3/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, 0xde3cb(%rip)     # 0x152bd0
je 0x749e9
movl %ecx, %ebp
movq %rdx, %r15
movl %esi, %r12d
movq %rdi, %rbx
movq %rdi, %r14
testb $0x2, %r12b
jne 0x74916
testq %rbx, %rbx
jne 0x74830
callq 0x3b728
movq %rax, %r14
leaq 0x7c193(%rip), %rdi     # 0xf09ca
callq 0xb7c0
testq %rax, %rax
je 0x74859
movq %rax, %r13
movq %rax, %rdi
movl $0x7, %esi
callq 0xbab0
testl %eax, %eax
je 0x748fa
leaq 0x7c171(%rip), %rdi     # 0xf09d1
callq 0xb7c0
testq %rax, %rax
je 0x7487e
movq %rax, %r13
movq %rax, %rdi
movl $0x7, %esi
callq 0xbab0
testl %eax, %eax
je 0x748fa
leaq 0x7c154(%rip), %r13     # 0xf09d9
movq %r13, %rdi
movl $0x7, %esi
callq 0xbab0
testl %eax, %eax
je 0x748fa
leaq 0x7c13c(%rip), %r13     # 0xf09d9
movq %r13, %rdi
movl $0x7, %esi
callq 0xbab0
testl %eax, %eax
je 0x748fa
leaq 0x7c120(%rip), %r13     # 0xf09d5
movq %r13, %rdi
movl $0x7, %esi
callq 0xbab0
testl %eax, %eax
je 0x748fa
leaq 0x7c111(%rip), %r13     # 0xf09de
movq %r13, %rdi
movl $0x7, %esi
callq 0xbab0
testl %eax, %eax
je 0x748fa
leaq 0x75b29(%rip), %r13     # 0xea40e
movq %r13, %rdi
movl $0x7, %esi
callq 0xbab0
testl %eax, %eax
jne 0x749f8
movq %r14, %rdi
movq %r13, %rsi
callq 0x3b81e
leaq 0x7c554(%rip), %rsi     # 0xf0e60
movq %r14, %rdi
callq 0x3b7af
jmp 0x7491f
testq %rbx, %rbx
je 0x749f3
movq %r14, %rdi
callq 0x3bb5d
movq %rax, %rdi
callq 0xa3b80
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 0x831ed
testq %rax, %rax
je 0x749ee
movq %rax, %r13
testb $0x1, %r12b
je 0x74977
movq %r14, %rdi
callq 0x3bb5d
movq %rax, %rdi
callq 0x3d3d4
leaq 0x7bf07(%rip), %rsi     # 0xf0885
movl $0x10, %edi
movl $0x173, %edx            # imm = 0x173
callq 0x35862
movq %rax, %r12
movq %r15, (%rax)
movl %ebp, 0x8(%rax)
movq 0xde233(%rip), %rax     # 0x152bd0
movq (%rax), %rdi
callq 0x3d043
movq 0xde224(%rip), %rax     # 0x152bd0
movq 0x10(%rax), %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x77628
movq 0xde20e(%rip), %rax     # 0x152bd0
movq (%rax), %rdi
callq 0x3d05e
testq %rbx, %rbx
jne 0x749d7
movq %r14, %rdi
callq 0x3c87b
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1afc8
callq 0x1af8f
callq 0x1af1d
callq 0x1af56