// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/core/fa.c
// Function: fileopen_generic
static void* fileopen_generic(FA *fa, const char *path, const char *mode,
                              GtFileMode file_mode, bool x,
                              const char *src_file, int src_line, GtError *err)
{
  void  *fp = NULL;
  FAFileInfo *fileinfo;
  gt_error_check(err);
  gt_assert(fa && path && mode);
  fileinfo = gt_malloc(sizeof (FAFileInfo));
  fileinfo->src_file = src_file;
  fileinfo->src_line = src_line;
  switch (file_mode) {
    case GT_FILE_MODE_UNCOMPRESSED:
      fp = x ? gt_xfopen(path, mode) : gt_efopen(path, mode, err);
      break;
    case GT_FILE_MODE_GZIP:
      fp = x ? gt_xgzopen(path, mode) : gt_egzopen(path, mode, err);
      break;
    case GT_FILE_MODE_BZIP2:
      fp = x ? gt_xbzopen(path, mode) : gt_ebzopen(path, mode, err);
      break;
    default: gt_assert(0);
  }
  if (fp) {
    gt_mutex_lock(fa->file_mutex);
    gt_hashmap_add(fa->file_pointer, fp, fileinfo);
    gt_mutex_unlock(fa->file_mutex);
  }
  else
    gt_free(fileinfo);
  return fp;
}

// Assembly:
subq $0x58, %rsp
movb %r8b, %al
movq 0x68(%rsp), %r8
movl 0x60(%rsp), %r8d
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movl %ecx, 0x3c(%rsp)
andb $0x1, %al
movb %al, 0x3b(%rsp)
movq %r9, 0x30(%rsp)
movq $0x0, 0x28(%rsp)
cmpq $0x0, 0x68(%rsp)
je 0x7f798
movq 0x68(%rsp), %rdi
callq 0xc270
testb $0x1, %al
jne 0x7f760
jmp 0x7f798
movq 0x134871(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0xde8f5(%rip), %rsi     # 0x15e066
leaq 0xdeed0(%rip), %rdx     # 0x15e648
leaq 0xee8ee(%rip), %rcx     # 0x16e06d
leaq 0xee4e6(%rip), %r8      # 0x16dc6c
movl $0x69, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x7f79a
jmp 0x7f79c
cmpq $0x0, 0x50(%rsp)
je 0x7f7b4
cmpq $0x0, 0x48(%rsp)
je 0x7f7b4
cmpq $0x0, 0x40(%rsp)
jne 0x7f7ec
movq 0x13481d(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0xde8a1(%rip), %rsi     # 0x15e066
leaq 0xee8b2(%rip), %rdx     # 0x16e07e
leaq 0xee89a(%rip), %rcx     # 0x16e06d
leaq 0xee492(%rip), %r8      # 0x16dc6c
movl $0x6a, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x7f7ee
leaq 0xee477(%rip), %rsi     # 0x16dc6c
movl $0x10, %edi
movl $0x6b, %edx
callq 0xd2e0
movq %rax, 0x20(%rsp)
movq 0x30(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, (%rax)
movl 0x60(%rsp), %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x8(%rax)
movl 0x3c(%rsp), %eax
movl %eax, 0x1c(%rsp)
testl %eax, %eax
je 0x7f84d
jmp 0x7f830
movl 0x1c(%rsp), %eax
subl $0x1, %eax
je 0x7f892
jmp 0x7f83b
movl 0x1c(%rsp), %eax
subl $0x2, %eax
je 0x7f8d4
jmp 0x7f913
testb $0x1, 0x3b(%rsp)
je 0x7f86a
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x1c870
movq %rax, 0x10(%rsp)
jmp 0x7f883
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x68(%rsp), %rdx
callq 0xe1480
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x28(%rsp)
jmp 0x7f94d
testb $0x1, 0x3b(%rsp)
je 0x7f8af
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0xa3240
movq %rax, 0x8(%rsp)
jmp 0x7f8c8
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x68(%rsp), %rdx
callq 0xe1620
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x28(%rsp)
jmp 0x7f94d
testb $0x1, 0x3b(%rsp)
je 0x7f8f0
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0xa2830
movq %rax, (%rsp)
jmp 0x7f908
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x68(%rsp), %rdx
callq 0xe1550
movq %rax, (%rsp)
movq (%rsp), %rax
movq %rax, 0x28(%rsp)
jmp 0x7f94d
jmp 0x7f915
movq 0x1346bc(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0xde740(%rip), %rsi     # 0x15e066
leaq 0xf058e(%rip), %rdx     # 0x16febb
leaq 0xee739(%rip), %rcx     # 0x16e06d
leaq 0xee331(%rip), %r8      # 0x16dc6c
movl $0x78, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
cmpq $0x0, 0x28(%rsp)
je 0x7f989
movq 0x50(%rsp), %rax
movq (%rax), %rdi
callq 0x1c340
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rdx
callq 0x86510
movq 0x50(%rsp), %rax
movq (%rax), %rdi
callq 0x1c3e0
jmp 0x7f99f
movq 0x20(%rsp), %rdi
leaq 0xee2d7(%rip), %rsi     # 0x16dc6c
movl $0x80, %edx
callq 0xdab0
movq 0x28(%rsp), %rax
addq $0x58, %rsp
retq
nopl (%rax)