// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/rdj-spmlist.c
// Function: gt_spmlist_parse
int gt_spmlist_parse(const char* filename, GtUword min_length,
    GtSpmproc processoverlap, void *data, GtError *err)
{
  int c, retval = 0;
  FILE *file;
  GtFile *infp;

  file = gt_fa_fopen(filename, "rb", err);
  if (file == NULL)
    return -1;
  infp = gt_file_new_from_fileptr(file);
  if (infp == NULL)
    return -1;

  c = gt_file_xfgetc(infp);
  switch (c)
  {
    case EOF:
      gt_error_set(err, "%s: file is empty", filename);
      retval = -1;
      break;
    case GT_SPMLIST_BIN32:
      gt_log_log("Spm file %s format: readjoiner-bin32", filename);
      retval = gt_spmlist_parse_bin32(file, min_length, processoverlap, data,
          err);
      break;
    case GT_SPMLIST_BIN64:
      gt_log_log("Spm file %s format: readjoiner-bin64", filename);
      retval = gt_spmlist_parse_bin64(file, min_length, processoverlap, data,
          err);
      break;
    default:
      gt_file_unget_char(infp, c);
      gt_log_log("Spm file %s format: readjoiner-text", filename);
      retval = gt_spmlist_parse_ascii(infp, min_length, processoverlap, data,
          err);
  }
  gt_file_delete(infp);
  return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %rbx
movq %rcx, (%rsp)
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r15
leaq 0x1c8270(%rip), %rsi    # 0x345a9d
leaq 0x1d13b5(%rip), %rdx    # 0x34ebe9
movl $0x102, %ecx            # imm = 0x102
callq 0x8a156
pushq $-0x1
popq %r14
testq %rax, %rax
je 0x17da9e
movq %rax, %rbp
movq %rax, %rdi
callq 0x8d2a4
testq %rax, %rax
je 0x17da9e
movq %rax, 0x8(%rsp)
movq %rax, %rdi
callq 0x8d34b
cmpl $0x3, %eax
je 0x17d978
cmpl $0x2, %eax
je 0x17d8a0
cmpl $-0x1, %eax
jne 0x17da59
leaq 0x1d1415(%rip), %rsi    # 0x34ec9f
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %r14
jmp 0x17da94
leaq 0x1d140a(%rip), %rdi    # 0x34ecb1
movq %r15, %rsi
xorl %eax, %eax
callq 0x92a82
xorl %r14d, %r14d
movq %rbp, %rdi
callq 0x17b70
testl %eax, %eax
jne 0x17da94
leaq 0x10(%rsp), %rdi
pushq $0x4
popq %rsi
pushq $0x3
popq %rdx
movq %rbp, %rcx
callq 0x17ad0
cmpq $0x3, %rax
je 0x17d93d
movq %rax, %r15
testq %rax, %rax
jne 0x17d8f5
movq %rbp, %rdi
callq 0x17b70
testl %eax, %eax
jne 0x17da94
leaq 0x1d14c6(%rip), %rdi    # 0x34edc2
movq %r15, %rsi
xorl %eax, %eax
callq 0x92a82
movq %rbp, %rdi
callq 0x17b70
leaq 0x1d14d3(%rip), %rdx    # 0x34ede8
testl %eax, %eax
jne 0x17d928
callq 0x17060
movl (%rax), %edi
callq 0x17220
movq %rax, %rdx
movq %rbx, %rdi
leaq 0x1d149c(%rip), %rsi    # 0x34edce
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %r14
testl %r14d, %r14d
jne 0x17d8b4
movl 0x18(%rsp), %ecx
movl %ecx, %edx
shrl $0x2, %edx
cmpq %r13, %rdx
jb 0x17d8b4
movl %ecx, %r8d
andl $0x1, %r8d
andl $0x2, %ecx
shrl %ecx
movl 0x10(%rsp), %edi
movl 0x14(%rsp), %esi
movq (%rsp), %r9
callq *%r12
jmp 0x17d8b4
leaq 0x1d1357(%rip), %rdi    # 0x34ecd6
movq %r15, %rsi
xorl %eax, %eax
callq 0x92a82
xorl %r14d, %r14d
movq %rbp, %rdi
callq 0x17b70
testl %eax, %eax
jne 0x17da94
leaq 0x10(%rsp), %rdi
pushq $0x8
popq %rsi
pushq $0x3
popq %rdx
movq %rbp, %rcx
callq 0x17ad0
cmpq $0x3, %rax
je 0x17da15
movq %rax, %r15
testq %rax, %rax
jne 0x17d9cd
movq %rbp, %rdi
callq 0x17b70
testl %eax, %eax
jne 0x17da94
leaq 0x1d13ee(%rip), %rdi    # 0x34edc2
movq %r15, %rsi
xorl %eax, %eax
callq 0x92a82
movq %rbp, %rdi
callq 0x17b70
leaq 0x1d13fb(%rip), %rdx    # 0x34ede8
testl %eax, %eax
jne 0x17da00
callq 0x17060
movl (%rax), %edi
callq 0x17220
movq %rax, %rdx
movq %rbx, %rdi
leaq 0x1d13c4(%rip), %rsi    # 0x34edce
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %r14
movq 0x20(%rsp), %rcx
movq %rcx, %rdx
shrq $0x2, %rdx
testl %r14d, %r14d
setne %al
cmpq %r13, %rdx
setb %sil
orb %al, %sil
jne 0x17d98c
movl %ecx, %r8d
andl $0x1, %r8d
andl $0x2, %ecx
shrl %ecx
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq (%rsp), %r9
callq *%r12
jmp 0x17d98c
movsbl %al, %esi
movq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x8d3d2
leaq 0x1d128b(%rip), %rdi    # 0x34ecfb
movq %r15, %rsi
xorl %eax, %eax
callq 0x92a82
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
movq (%rsp), %r8
movq %rbx, %r9
callq 0x17d739
movl %eax, %r14d
movq 0x8(%rsp), %rdi
callq 0x8da06
movl %r14d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq