// File: /workspace/github_c_makefile_star2_O3/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 0x10aeba
movq %r14, %rdi
callq 0xfcc32
testb %al, %al
jne 0x10b002
testq %rbx, %rbx
je 0x10affd
movq (%rbx), %rdi
callq 0x11b0ca
testq %rax, %rax
je 0x10aee7
movb 0x9(%rbx), %al
cmpb $0x1, 0x8(%rbx)
jne 0x10aef9
movl $0x1, %ebp
testb %al, %al
je 0x10af05
callq 0x335a1
movq 0x10(%rbx), %rax
movq $0x0, (%rax)
xorl %eax, %eax
jmp 0x10aff2
xorl %r15d, %r15d
movl $0x2, %ebp
testb %al, %al
je 0x10af81
movq (%rbx), %rdi
callq 0x11b0a1
movq %rax, %r15
movq (%rbx), %rdi
callq 0x11b0ca
addq %rax, %r15
movl %ebp, %edi
callq 0xfe9f9
movq %rax, %rdi
callq 0x172f0
subq %rax, %r15
movl %ebp, %edi
callq 0xfe9f9
movq %r15, %rdi
movq %rax, %rsi
callq 0x17a40
testl %eax, %eax
je 0x10af7e
movq (%rbx), %rdi
callq 0x11b0a1
movq %rax, %r15
movl %ebp, %edi
callq 0xfe9f9
leaq 0x262964(%rip), %rdi    # 0x36d8c0
movq %r15, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x11f68c
movq (%rbx), %r15
movl %ebp, %edi
callq 0xfe9f9
movq %r15, %rdi
movq %rax, %rsi
callq 0x11acf3
movl %ebp, %r15d
cmpb $0x0, 0xa(%rbx)
jne 0x10afc5
movq (%rbx), %rdi
callq 0x11b0a1
movq %rax, %rdi
callq 0xff28c
testb %al, %al
je 0x10afc5
movq (%rbx), %rdi
callq 0x11b0a1
leaq 0x2628b5(%rip), %rsi    # 0x36d85f
leaq 0x2606ea(%rip), %rcx    # 0x36b69b
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xfcb67
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x10aff2
movq (%rbx), %rdi
callq 0x11b0a1
leaq 0x2885e1(%rip), %rdx    # 0x3935b5
movl %r15d, %edi
movq %rax, %rsi
callq 0xfec63
movq 0x10(%rbx), %rcx
movq %rax, (%rcx)
movq 0x10(%rbx), %rcx
xorl %eax, %eax
cmpq $0x0, (%rcx)
je 0x10b007
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x335d8
callq 0x33533
callq 0x3356a