// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/core/sequence_buffer.c
// Function: gt_sequence_buffer_new_guess_type
GtSequenceBuffer* gt_sequence_buffer_new_guess_type(const GtStrArray *seqs,
                                                    GtError *err)
{
  GtFile *file;
  GtSequenceBuffer *sb;
  char firstcontents[BUFSIZ];
  gt_assert(seqs);
  gt_error_check(err);

  if (gt_str_array_size(seqs) == 0) {
    gt_error_set(err, "cannot guess file type of file %s -- no sequence files "
                      "given",
                      gt_str_array_get(seqs, 0));
    return NULL;
  }

  memset(firstcontents, 0, BUFSIZ);
  file = gt_file_open(gt_file_mode_determine(gt_str_array_get(seqs, 0)),
                      gt_str_array_get(seqs, 0),
                      "rb", err);
  if (!file)
    return NULL;
  gt_file_xread(file, &firstcontents, BUFSIZ-1);
  gt_file_delete(file);

  if (gt_sequence_buffer_embl_guess(firstcontents)) {
    sb = gt_sequence_buffer_embl_new(seqs);
  } else if (gt_sequence_buffer_fasta_guess(firstcontents)) {
    sb = gt_sequence_buffer_fasta_new(seqs);
  } else if (gt_sequence_buffer_gb_guess(firstcontents)) {
    sb = gt_sequence_buffer_gb_new(seqs);
    } else if (gt_sequence_buffer_fastq_guess(firstcontents)) {
    sb = gt_sequence_buffer_fastq_new(seqs);
  } else {
    gt_error_set(err, "cannot guess file type of file %s -- unknown file "
                      "contents",
                      gt_str_array_get(seqs, 0));
    return NULL;
  }
  return sb;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x2000, %rsp           # imm = 0x2000
testq %rdi, %rdi
je 0x7f3f6
movq %rsi, %rbx
movq %rdi, %r14
testq %rsi, %rsi
je 0x7f2d5
movq %rbx, %rdi
callq 0x34fea
testb %al, %al
jne 0x7f3fb
movq %r14, %rdi
callq 0x3cbed
testq %rax, %rax
je 0x7f367
movq %rsp, %rdi
xorl %r15d, %r15d
movl $0x2000, %edx           # imm = 0x2000
xorl %esi, %esi
callq 0xb2f0
movq %r14, %rdi
xorl %esi, %esi
callq 0x3ca6f
movq %rax, %rdi
callq 0x75824
movl %eax, %ebp
movq %r14, %rdi
xorl %esi, %esi
callq 0x3ca6f
leaq 0x6e8d9(%rip), %rdx     # 0xedbf6
movl %ebp, %edi
movq %rax, %rsi
movq %rbx, %rcx
callq 0x75969
testq %rax, %rax
je 0x7f3cd
movq %rax, %r12
movq %rsp, %r15
movl $0x1fff, %edx           # imm = 0x1FFF
movq %rax, %rdi
movq %r15, %rsi
callq 0x75fcd
movq %r12, %rdi
callq 0x760c0
movq %r15, %rdi
callq 0x80f34
testb %al, %al
je 0x7f38a
movq %r14, %rdi
callq 0x80f44
jmp 0x7f3ca
xorl %r15d, %r15d
movq %r14, %rdi
xorl %esi, %esi
callq 0x3ca6f
leaq 0x73a4c(%rip), %rsi     # 0xf2dc7
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x34f1f
jmp 0x7f3cd
movq %rsp, %rdi
callq 0x80fbc
testb %al, %al
je 0x7f3a0
movq %r14, %rdi
callq 0x8134f
jmp 0x7f3ca
movq %rsp, %rdi
callq 0x82a83
testb %al, %al
je 0x7f3b6
movq %r14, %rdi
callq 0x82aae
jmp 0x7f3ca
movq %rsp, %rdi
callq 0x818b4
testb %al, %al
je 0x7f3e0
movq %r14, %rdi
callq 0x818bb
movq %rax, %r15
movq %r15, %rax
addq $0x2000, %rsp           # imm = 0x2000
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorl %r15d, %r15d
movq %r14, %rdi
xorl %esi, %esi
callq 0x3ca6f
leaq 0x73a10(%rip), %rsi     # 0xf2e04
jmp 0x7f37b
callq 0x1db11
callq 0x1dada