// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x40(%rsp)
movl $0x0, 0x38(%rsp)
cmpq $0x0, 0x48(%rsp)
je 0xf7f50
movq 0x48(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0xf7f18
jmp 0xf7f50
movq 0x544081(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x41e0ea(%rip), %rsi    # 0x516013
leaq 0x41e28f(%rip), %rdx    # 0x5161bf
leaq 0x44765f(%rip), %rcx    # 0x53f596
leaq 0x447547(%rip), %r8     # 0x53f485
movl $0x2d, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0xf7f52
jmp 0xf7f54
cmpq $0x0, 0x40(%rsp)
jne 0xf7f94
movq 0x54403d(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x41e0a6(%rip), %rsi    # 0x516013
leaq 0x447531(%rip), %rdx    # 0x53f4a5
leaq 0x44761b(%rip), %rcx    # 0x53f596
leaq 0x447503(%rip), %r8     # 0x53f485
movl $0x2e, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0xf7f96
movq 0x40(%rsp), %rax
movq (%rax), %rdi
callq 0x11dfa0
cmpq $0x0, %rax
jne 0xf7fbe
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
movq $0x0, (%rax)
jmp 0xf8204
jmp 0xf7fc0
movq 0x40(%rsp), %rax
testb $0x1, 0x8(%rax)
je 0xf800e
movq 0x40(%rsp), %rax
testb $0x1, 0x9(%rax)
je 0xf800e
movq 0x543fc3(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x41e02c(%rip), %rsi    # 0x516013
leaq 0x4475b8(%rip), %rdx    # 0x53f5a6
leaq 0x4475a1(%rip), %rcx    # 0x53f596
leaq 0x447489(%rip), %r8     # 0x53f485
movl $0x32, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0xf8010
movq 0x40(%rsp), %rax
testb $0x1, 0x8(%rax)
je 0xf8025
movl $0x1, 0x3c(%rsp)
jmp 0xf8044
movq 0x40(%rsp), %rax
testb $0x1, 0x9(%rax)
je 0xf803a
movl $0x2, 0x3c(%rsp)
jmp 0xf8042
movl $0x0, 0x3c(%rsp)
jmp 0xf8044
cmpl $0x0, 0x3c(%rsp)
je 0xf8113
movq 0x40(%rsp), %rax
movq (%rax), %rdi
callq 0x11dee0
movq %rax, 0x20(%rsp)
movq 0x40(%rsp), %rax
movq (%rax), %rdi
callq 0x11dfa0
movq %rax, %rcx
movq 0x20(%rsp), %rax
addq %rcx, %rax
movq %rax, 0x28(%rsp)
movl 0x3c(%rsp), %edi
callq 0xdd1a0
movq %rax, %rdi
callq 0x192b0
movq %rax, %rdx
movq 0x28(%rsp), %rax
xorl %ecx, %ecx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, 0x30(%rsp)
movl 0x3c(%rsp), %edi
callq 0xdd1a0
movq 0x30(%rsp), %rdi
movq %rax, %rsi
callq 0x19980
cmpl $0x0, %eax
je 0xf8113
movq 0x40(%rsp), %rax
movq (%rax), %rdi
callq 0x11dee0
movq %rax, 0x10(%rsp)
movl 0x3c(%rsp), %edi
callq 0xdd1a0
movq 0x10(%rsp), %rsi
movq %rax, %rdx
leaq 0x4474d8(%rip), %rdi    # 0x53f5c1
movb $0x0, %al
callq 0x1267d0
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x18(%rsp)
movl 0x3c(%rsp), %edi
callq 0xdd1a0
movq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0x11d550
movq 0x40(%rsp), %rax
testb $0x1, 0xa(%rax)
jne 0xf8175
movq 0x40(%rsp), %rax
movq (%rax), %rdi
callq 0x11dee0
movq %rax, %rdi
callq 0xde820
testb $0x1, %al
jne 0xf8139
jmp 0xf8175
movq 0x48(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x40(%rsp), %rax
movq (%rax), %rdi
callq 0x11dee0
movq 0x8(%rsp), %rdi
movq %rax, %rdx
leaq 0x447401(%rip), %rsi    # 0x53f560
leaq 0x444b75(%rip), %rcx    # 0x53ccdb
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x38(%rsp) # imm = 0xFFFFFFFF
cmpl $0x0, 0x38(%rsp)
jne 0xf8202
movl 0x3c(%rsp), %eax
movl %eax, 0x4(%rsp)
movq 0x40(%rsp), %rax
movq (%rax), %rdi
callq 0x11dee0
movl 0x4(%rsp), %edi
movq %rax, %rsi
leaq 0x46dd22(%rip), %rdx    # 0x565ec5
callq 0xdd790
movq %rax, %rcx
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
movq %rcx, (%rax)
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
cmpq $0x0, (%rax)
jne 0xf81fe
movq 0x543dd3(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x41de3c(%rip), %rsi    # 0x516013
leaq 0x447423(%rip), %rdx    # 0x53f601
leaq 0x4473b1(%rip), %rcx    # 0x53f596
leaq 0x447299(%rip), %r8     # 0x53f485
movl $0x4d, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0xf8200
jmp 0xf8202
jmp 0xf8204
movl 0x38(%rsp), %eax
addq $0x58, %rsp
retq
nopl (%rax)