// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movl %esi, 0x3c(%rsp)
movq %rdx, 0x30(%rsp)
movl %ecx, 0x2c(%rsp)
cmpq $0x0, 0x135e62(%rip)    # 0x1b64b0
jne 0x80688
movq 0x133981(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0xdda05(%rip), %rsi     # 0x15e066
leaq 0xeda33(%rip), %rdx     # 0x16e09b
leaq 0xed711(%rip), %rcx     # 0x16dd80
leaq 0xed5f6(%rip), %r8      # 0x16dc6c
movl $0x146, %r9d            # imm = 0x146
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x8068a
movl 0x3c(%rsp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x806e9
jmp 0x80698
cmpq $0x0, 0x40(%rsp)
jne 0x806d8
movq 0x133931(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0xdd9b5(%rip), %rsi     # 0x15e066
leaq 0xed6df(%rip), %rdx     # 0x16dd97
leaq 0xed6c1(%rip), %rcx     # 0x16dd80
leaq 0xed5a6(%rip), %r8      # 0x16dc6c
movl $0x149, %r9d            # imm = 0x149
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x806da
movq 0x40(%rsp), %rax
movq %rax, 0x18(%rsp)
jmp 0x80833
cmpq $0x0, 0x40(%rsp)
je 0x806fd
movq 0x40(%rsp), %rax
movq %rax, 0x18(%rsp)
jmp 0x80707
callq 0x18f00
movq %rax, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x80731
leaq 0xed685(%rip), %rdi     # 0x16dda4
callq 0xb790
movq %rax, %rdi
callq 0x80970
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x80752
leaq 0xed66b(%rip), %rdi     # 0x16ddab
callq 0xb790
movq %rax, %rdi
callq 0x80970
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x8076b
leaq 0xed652(%rip), %rdi     # 0x16ddb3
callq 0x80970
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x80784
leaq 0xed639(%rip), %rdi     # 0x16ddb3
callq 0x80970
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x8079d
leaq 0xed61c(%rip), %rdi     # 0x16ddaf
callq 0x80970
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x807b6
leaq 0xed60c(%rip), %rdi     # 0x16ddb8
callq 0x80970
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x807cf
leaq 0xe6e21(%rip), %rdi     # 0x1675e6
callq 0x80970
movq %rax, 0x10(%rsp)
jmp 0x807d1
cmpq $0x0, 0x10(%rsp)
jne 0x80811
movq 0x1337f8(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0xdd87c(%rip), %rsi     # 0x15e066
leaq 0xed5d0(%rip), %rdx     # 0x16ddc1
leaq 0xed588(%rip), %rcx     # 0x16dd80
leaq 0xed46d(%rip), %r8      # 0x16dc6c
movl $0x162, %r9d            # imm = 0x162
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x80813
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x190b0
movq 0x18(%rsp), %rdi
leaq 0xeda22(%rip), %rsi     # 0x16e250
callq 0x18fb0
movq 0x18(%rsp), %rdi
callq 0x19940
movq %rax, %rdi
callq 0xe04f0
movl %eax, 0xc(%rsp)
movb $0x77, 0x8(%rsp)
movb $0x2b, 0x9(%rsp)
movl 0x3c(%rsp), %edx
andl $0x4, %edx
xorl %eax, %eax
movl $0x62, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movb %al, 0xa(%rsp)
movb $0x0, 0xb(%rsp)
movl 0xc(%rsp), %edi
leaq 0x8(%rsp), %rsi
callq 0xa2bb0
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0x808c3
movq 0x133746(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0xdd7ca(%rip), %rsi     # 0x15e066
leaq 0xf824e(%rip), %rdx     # 0x178af1
leaq 0xed4d6(%rip), %rcx     # 0x16dd80
leaq 0xed3bb(%rip), %r8      # 0x16dc6c
movl $0x16c, %r9d            # imm = 0x16C
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x808c5
movl 0x3c(%rsp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x808e3
movq 0x18(%rsp), %rdi
callq 0x19940
movq %rax, %rdi
callq 0x1cc10
movl $0x10, %edi
leaq 0xed37d(%rip), %rsi     # 0x16dc6c
movl $0x173, %edx            # imm = 0x173
callq 0xd2e0
movq %rax, (%rsp)
movq 0x30(%rsp), %rcx
movq (%rsp), %rax
movq %rcx, (%rax)
movl 0x2c(%rsp), %ecx
movq (%rsp), %rax
movl %ecx, 0x8(%rax)
movq 0x135b95(%rip), %rax    # 0x1b64b0
movq (%rax), %rdi
callq 0x1c340
movq 0x135b86(%rip), %rax    # 0x1b64b0
movq 0x10(%rax), %rdi
movq 0x20(%rsp), %rsi
movq (%rsp), %rdx
callq 0x86510
movq 0x135b6d(%rip), %rax    # 0x1b64b0
movq (%rax), %rdi
callq 0x1c3e0
cmpq $0x0, 0x40(%rsp)
jne 0x8095d
movq 0x18(%rsp), %rdi
callq 0x1afc0
movq 0x20(%rsp), %rax
addq $0x48, %rsp
retq
nopw (%rax,%rax)