// File: /workspace/github_c_makefile_star2_O1/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 0x7f36e
movq %rsi, %rbx
movq %rdi, %r14
testq %rsi, %rsi
je 0x7f24d
movq %rbx, %rdi
callq 0x3566a
testb %al, %al
jne 0x7f373
movq %r14, %rdi
callq 0x3d560
testq %rax, %rax
je 0x7f2df
movq %rsp, %rdi
xorl %r15d, %r15d
movl $0x2000, %edx           # imm = 0x2000
xorl %esi, %esi
callq 0xb2f0
movq %r14, %rdi
xorl %esi, %esi
callq 0x3d3e2
movq %rax, %rdi
callq 0x752e8
movl %eax, %ebp
movq %r14, %rdi
xorl %esi, %esi
callq 0x3d3e2
leaq 0x6e9a9(%rip), %rdx     # 0xedc3e
movl %ebp, %edi
movq %rax, %rsi
movq %rbx, %rcx
callq 0x75422
testq %rax, %rax
je 0x7f345
movq %rax, %r12
movq %rsp, %r15
movl $0x1fff, %edx           # imm = 0x1FFF
movq %rax, %rdi
movq %r15, %rsi
callq 0x75a89
movq %r12, %rdi
callq 0x75b7c
movq %r15, %rdi
callq 0x80fc0
testb %al, %al
je 0x7f302
movq %r14, %rdi
callq 0x80fd9
jmp 0x7f342
xorl %r15d, %r15d
movq %r14, %rdi
xorl %esi, %esi
callq 0x3d3e2
leaq 0x73b24(%rip), %rsi     # 0xf2e17
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x3559f
jmp 0x7f345
movq %rsp, %rdi
callq 0x81050
testb %al, %al
je 0x7f318
movq %r14, %rdi
callq 0x81417
jmp 0x7f342
movq %rsp, %rdi
callq 0x82df8
testb %al, %al
je 0x7f32e
movq %r14, %rdi
callq 0x82e23
jmp 0x7f342
movq %rsp, %rdi
callq 0x81999
testb %al, %al
je 0x7f358
movq %r14, %rdi
callq 0x819a0
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 0x3d3e2
leaq 0x73ae8(%rip), %rsi     # 0xf2e54
jmp 0x7f2f3
callq 0x1db40
callq 0x1db09