// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/core/output_file.c
// Function: determine_outfp
static int determine_outfp(void *data, GtError *err)
{
  GtOutputFileInfo *ofi = (GtOutputFileInfo*) data;
  GtFileMode file_mode;
  int had_err = 0;
  gt_error_check(err);
  gt_assert(ofi);
  if (!gt_str_length(ofi->output_filename))
    *ofi->outfp = NULL; /* no output file given -> use stdout */
  else { /* outputfile given -> create generic file pointer */
    gt_assert(!(ofi->gzip && ofi->bzip2));
    if (ofi->gzip)
      file_mode = GT_FILE_MODE_GZIP;
    else if (ofi->bzip2)
      file_mode = GT_FILE_MODE_BZIP2;
    else
      file_mode = GT_FILE_MODE_UNCOMPRESSED;
    if (file_mode != GT_FILE_MODE_UNCOMPRESSED &&
        strcmp(gt_str_get(ofi->output_filename) +
               gt_str_length(ofi->output_filename) -
               strlen(gt_file_mode_suffix(file_mode)),
               gt_file_mode_suffix(file_mode))) {
      gt_warning("output file '%s' doesn't have correct suffix '%s', appending "
                 "it", gt_str_get(ofi->output_filename),
                 gt_file_mode_suffix(file_mode));
      gt_str_append_cstr(ofi->output_filename, gt_file_mode_suffix(file_mode));
    }
    if (!ofi->force && gt_file_exists(gt_str_get(ofi->output_filename))) {
        gt_error_set(err, "file \"%s\" exists already, use option -%s to "
                     "overwrite", gt_str_get(ofi->output_filename),
                     GT_FORCE_OPT_CSTR);
        had_err = -1;
    }
    if (!had_err) {
      *ofi->outfp = gt_file_xopen_file_mode(file_mode,
                                            gt_str_get(ofi->output_filename),
                                            "w");
      gt_assert(*ofi->outfp);
    }
  }
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
testq %rsi, %rsi
je 0x9b83b
movq %r14, %rdi
callq 0x89eb7
testb %al, %al
jne 0x9b99a
testq %rbx, %rbx
je 0x9b970
movq (%rbx), %rdi
callq 0xad289
testq %rax, %rax
je 0x9b866
movb 0x9(%rbx), %al
cmpb $0x1, 0x8(%rbx)
jne 0x9b875
testb %al, %al
jne 0x9b9ee
pushq $0x1
jmp 0x9b87d
movq 0x10(%rbx), %rax
andq $0x0, (%rax)
xorl %eax, %eax
jmp 0x9b965
xorl %ebp, %ebp
testb %al, %al
je 0x9b8f7
pushq $0x2
popq %rbp
movq (%rbx), %rdi
callq 0xad1fa
movq %rax, %r15
movq (%rbx), %rdi
callq 0xad289
addq %rax, %r15
movl %ebp, %edi
callq 0x8cd14
movq %rax, %rdi
callq 0x172d0
subq %rax, %r15
movl %ebp, %edi
callq 0x8cd14
movq %r15, %rdi
movq %rax, %rsi
callq 0x179e0
testl %eax, %eax
je 0x9b8f7
movq (%rbx), %rdi
callq 0xad1fa
movq %rax, %r15
movl %ebp, %edi
callq 0x8cd14
leaq 0x27230f(%rip), %rdi    # 0x30dbe4
movq %r15, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb2cd0
movq (%rbx), %r15
movl %ebp, %edi
callq 0x8cd14
movq %r15, %rdi
movq %rax, %rsi
callq 0xacbfb
cmpb $0x0, 0xa(%rbx)
jne 0x9b939
movq (%rbx), %rdi
callq 0xad1fa
movq %rax, %rdi
callq 0x8da98
testb %al, %al
je 0x9b939
movq (%rbx), %rdi
callq 0xad1fa
leaq 0x272263(%rip), %rsi    # 0x30db83
leaq 0x26fcd4(%rip), %rcx    # 0x30b5fb
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %rax
jmp 0x9b965
movq (%rbx), %rdi
callq 0xad1fa
leaq 0x297fc6(%rip), %rdx    # 0x33390e
movl %ebp, %edi
movq %rax, %rsi
callq 0x8d0cd
movq 0x10(%rbx), %rcx
movq %rax, (%rcx)
movq 0x10(%rbx), %rcx
xorl %eax, %eax
cmpq $0x0, (%rcx)
je 0x9b9c4
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x39c5f1(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x249692(%rip), %rsi    # 0x2e5013
leaq 0x272140(%rip), %rdx    # 0x30dac8
leaq 0x27222a(%rip), %rcx    # 0x30dbb9
leaq 0x272112(%rip), %r8     # 0x30daa8
pushq $0x2e
jmp 0x9ba16
movq 0x39c5c7(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x249668(%rip), %rsi    # 0x2e5013
leaq 0x24980d(%rip), %rdx    # 0x2e51bf
leaq 0x272200(%rip), %rcx    # 0x30dbb9
leaq 0x2720e8(%rip), %r8     # 0x30daa8
pushq $0x2d
jmp 0x9ba16
movq 0x39c59d(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x24963e(%rip), %rsi    # 0x2e5013
leaq 0x272248(%rip), %rdx    # 0x30dc24
leaq 0x2721d6(%rip), %rcx    # 0x30dbb9
leaq 0x2720be(%rip), %r8     # 0x30daa8
pushq $0x4d
jmp 0x9ba16
movq 0x39c573(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x249614(%rip), %rsi    # 0x2e5013
leaq 0x2721c3(%rip), %rdx    # 0x30dbc9
leaq 0x2721ac(%rip), %rcx    # 0x30dbb9
leaq 0x272094(%rip), %r8     # 0x30daa8
pushq $0x32
popq %r9
xorl %eax, %eax
callq 0x17a50
callq 0x17390