// File: /workspace/github_c_makefile_star2_O1/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 0x1100d6
movq %r14, %rdi
callq 0x101a9a
testb %al, %al
jne 0x110227
testq %rbx, %rbx
je 0x110222
movq (%rbx), %rdi
callq 0x120d4c
testq %rax, %rax
je 0x11020a
movb 0x8(%rbx), %al
cmpb $0x1, %al
jne 0x11010e
cmpb $0x1, 0x9(%rbx)
je 0x11022c
testb %al, %al
je 0x11010e
movl $0x1, %ebp
xorl %eax, %eax
jmp 0x110118
movzbl 0x9(%rbx), %ebp
movl %ebp, %eax
xorb $0x1, %al
addl %ebp, %ebp
testb %al, %al
jne 0x110195
movq (%rbx), %rdi
callq 0x120d23
movq %rax, %r15
movq (%rbx), %rdi
callq 0x120d4c
addq %rax, %r15
movl %ebp, %edi
callq 0x1038cf
movq %rax, %rdi
callq 0x172f0
subq %rax, %r15
movl %ebp, %edi
callq 0x1038cf
movq %r15, %rdi
movq %rax, %rsi
callq 0x17a40
testl %eax, %eax
je 0x110195
movq (%rbx), %rdi
callq 0x120d23
movq %rax, %r15
movl %ebp, %edi
callq 0x1038cf
leaq 0x26699d(%rip), %rdi    # 0x376b10
movq %r15, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x125448
movq (%rbx), %r15
movl %ebp, %edi
callq 0x1038cf
movq %r15, %rdi
movq %rax, %rsi
callq 0x12097f
cmpb $0x0, 0xa(%rbx)
jne 0x1101d9
movq (%rbx), %rdi
callq 0x120d23
movq %rax, %rdi
callq 0x10415c
testb %al, %al
je 0x1101d9
movq (%rbx), %rdi
callq 0x120d23
leaq 0x2668f1(%rip), %rsi    # 0x376aaf
leaq 0x264726(%rip), %rcx    # 0x3748eb
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x110217
movq (%rbx), %rdi
callq 0x120d23
leaq 0x28c849(%rip), %rdx    # 0x39ca31
movl %ebp, %edi
movq %rax, %rsi
callq 0x103b33
movq 0x10(%rbx), %rcx
movq %rax, (%rcx)
movq 0x10(%rbx), %rcx
xorl %eax, %eax
cmpq $0x0, (%rcx)
jne 0x110217
callq 0x33e96
movq 0x10(%rbx), %rax
movq $0x0, (%rax)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x33f04
callq 0x33e5f
callq 0x33ecd