// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/tools/gt_matchtool.c
// Function: gt_matchtool_runner
static int gt_matchtool_runner(GT_UNUSED int argc,
                               GT_UNUSED const char **argv,
                               GT_UNUSED int parsed_args,
                               void *tool_arguments, GtError *err)
{
  GtMatchtoolArguments *arguments = tool_arguments;
  GtMatchIterator *mp = NULL;
  GtMatch *match = NULL;
  GtBlastProcessCall *blast_call = NULL;

  int status, had_err = 0;

  gt_error_check(err);
  gt_assert(arguments);

  if (strcmp(gt_str_get(arguments->type), "OPENMATCH") == 0) {
    mp = gt_match_iterator_open_new(gt_str_get(arguments->matchfile), err);
    if (!mp)
      had_err = -1;
  } else if (strcmp(gt_str_get(arguments->type), "BLASTOUT") == 0) {
    mp = gt_match_iterator_blast_file_new(gt_str_get(arguments->matchfile),
                                          err);
    if (!mp)
      had_err = -1;
  } else if (strcmp(gt_str_get(arguments->type), "BLASTALLP") == 0) {
    blast_call = gt_blast_process_call_new_all_prot();
    gt_blast_process_call_set_query(blast_call, gt_str_get(arguments->query));
    gt_blast_process_call_set_db(blast_call, gt_str_get(arguments->db));
    mp = gt_match_iterator_blast_process_new(blast_call, err);
    if (!mp)
      had_err = -1;
  } else if (strcmp(gt_str_get(arguments->type), "BLASTALLN") == 0) {
    blast_call = gt_blast_process_call_new_all_nucl();
    gt_blast_process_call_set_query(blast_call, gt_str_get(arguments->query));
    gt_blast_process_call_set_db(blast_call, gt_str_get(arguments->db));
    mp = gt_match_iterator_blast_process_new(blast_call, err);
    if (!mp)
      had_err = -1;
  } else if (strcmp(gt_str_get(arguments->type), "BLASTP") == 0) {
    blast_call = gt_blast_process_call_new_all_prot();
    gt_blast_process_call_set_query(blast_call, gt_str_get(arguments->query));
    gt_blast_process_call_set_db(blast_call, gt_str_get(arguments->db));
    mp = gt_match_iterator_blast_process_new(blast_call, err);
    if (!mp)
      had_err = -1;
  } else if (strcmp(gt_str_get(arguments->type), "BLASTN") == 0) {
    blast_call = gt_blast_process_call_new_all_prot();
    gt_blast_process_call_set_query(blast_call, gt_str_get(arguments->query));
    gt_blast_process_call_set_db(blast_call, gt_str_get(arguments->db));
    mp =  gt_match_iterator_blast_process_new(blast_call, err);
    if (!mp)
      had_err = -1;
  } else if (strcmp(gt_str_get(arguments->type), "SW") == 0) {
    GtEncseqLoader *el = NULL;
    GtEncseq *es1 = NULL, *es2 = NULL;
    GtScoreMatrix *sm = NULL;
    GtScoreFunction *sf = NULL;
    el = gt_encseq_loader_new();
    es1 = gt_encseq_loader_load(el, gt_str_get(arguments->db), err);
    if (!es1)
      had_err = -1;
    if (!had_err) {
      es2 = gt_encseq_loader_load(el, gt_str_get(arguments->query), err);
      if (!es2)
        had_err = -1;
    }
    gt_encseq_loader_delete(el);
    if (!had_err) {
      GtUword i, j;
      GtAlphabet *a;
      gt_assert(es1 && es2);
      a = gt_encseq_alphabet(es1);
      sm = gt_score_matrix_new(a);
      for (i = 0; i < gt_alphabet_num_of_chars(a); i++)
        for (j = 0; j < gt_alphabet_num_of_chars(a); j++)
          gt_score_matrix_set_score(sm, i, j, (i == j) ? 1 : -1);
      sf = gt_score_function_new(sm, -1, -1);
      mp = gt_match_iterator_sw_new(es1, es2, sf, arguments->minlen,
                                    arguments->maxedist, err);
      if (!mp)
        had_err = -1;
    }
    gt_encseq_delete(es1);
    gt_encseq_delete(es2);
    gt_score_function_delete(sf);
  } else if (strcmp(gt_str_get(arguments->type), "LAST") == 0) {
    GtEncseqLoader *el = NULL;
    GtEncseq *es1 = NULL, *es2 = NULL;
    el = gt_encseq_loader_new();
    es1 = gt_encseq_loader_load(el, gt_str_get(arguments->db), err);
    if (!es1)
      had_err = -1;
    if (!had_err) {
      es2 = gt_encseq_loader_load(el, gt_str_get(arguments->query), err);
      if (!es2)
        had_err = -1;
    }
    gt_encseq_loader_delete(el);
    if (!had_err) {
      mp = gt_match_iterator_last_new(es1, es2,
                                      GT_UNDEF_INT,
                                      GT_UNDEF_INT,
                                      GT_UNDEF_INT,
                                      GT_UNDEF_INT,
                                      GT_UNDEF_INT,
                                      GT_UNDEF_INT,
                                      GT_UNDEF_INT,
                                      10,
                                      GT_UNDEF_INT,
                                      GT_UNDEF_INT,
                                      err);
      if (!mp)
        had_err = -1;
    }
    gt_encseq_delete(es1);
    gt_encseq_delete(es2);
  } else {
    exit(GT_EXIT_PROGRAMMING_ERROR);
  }

  if ((!had_err) && (strcmp(gt_str_get(arguments->type), "OPENMATCH") == 0)) {
    fprintf(stdout, "seqid1\tseqid2\tstartpos1\tstartpos2\tendpos1\tendpos2\t"
                    "weight\n");
    while ((status = gt_match_iterator_next(mp, &match, err))
                                                     != GT_MATCHER_STATUS_END) {
      if (status == GT_MATCHER_STATUS_OK) {
        GtMatchOpen *matcho = (GtMatchOpen*) match;
        GtRange range_seq1;
        GtRange range_seq2;
        gt_match_get_range_seq1(match, &range_seq1);
        gt_match_get_range_seq2(match, &range_seq2);
        fprintf(stdout, "%s\t%s\t"GT_WU"\t"GT_WU"\t"GT_WU"\t"GT_WU"\t"GT_WU"\n",
                gt_match_get_seqid1(match),
                gt_match_get_seqid2(match),
                range_seq1.start,
                range_seq2.start,
                range_seq1.end,
                range_seq2.end,
                gt_match_open_get_weight(matcho));
        gt_match_delete(match);
      } else if (status == GT_MATCHER_STATUS_ERROR) {
        had_err =-1;
        break;
      }
    }
    gt_match_iterator_delete(mp);
  } else if ((!had_err) && (strcmp(gt_str_get(arguments->type), "SW") == 0)) {
    fprintf(stdout, "seqid1\tseqid2\tstartpos1\tstartpos2\tendpos1\tendpos2\t"
                    "alilen\tedist\n");
    while ((status = gt_match_iterator_next(mp, &match, err))
                                                     != GT_MATCHER_STATUS_END) {
      if (status == GT_MATCHER_STATUS_OK) {
        GtMatchSW *matchs = gt_match_sw_cast(match);
        GtRange range_seq1;
        GtRange range_seq2;
        gt_match_get_range_seq1(match, &range_seq1);
        gt_match_get_range_seq2(match, &range_seq2);
        fprintf(stdout,
               "%s\t%s\t"GT_WU"\t"GT_WU"\t"GT_WU"\t"GT_WU"\t"GT_WU"\t"GT_WU"\n",
                gt_match_get_seqid1(match),
                gt_match_get_seqid2(match),
                range_seq1.start,
                range_seq2.start,
                range_seq1.end,
                range_seq2.end,
                gt_match_sw_get_alignment_length(matchs),
                gt_match_sw_get_edist(matchs));
        gt_match_delete(match);
      } else if (status == GT_MATCHER_STATUS_ERROR) {
        had_err =-1;
        break;
      }
    }
    gt_match_iterator_delete(mp);
  } else if ((!had_err) && (strcmp(gt_str_get(arguments->type), "LAST") == 0)) {
    fprintf(stdout, "seqid1\tseqid2\tstartpos1\tstartpos2\tendpos1\tendpos2\t"
                    "score\n");
    while ((status = gt_match_iterator_next(mp, &match, err))
                                                     != GT_MATCHER_STATUS_END) {
      if (status == GT_MATCHER_STATUS_OK) {
        GtMatchLAST *matchl = gt_match_last_cast(match);
        GtRange range_seq1;
        GtRange range_seq2;
        gt_match_get_range_seq1(match, &range_seq1);
        gt_match_get_range_seq2(match, &range_seq2);
        fprintf(stdout,
              ""GT_WU"\t"GT_WU"\t"GT_WU"\t"GT_WU"\t"GT_WU"\t"GT_WU"\t"GT_WU"\n",
                gt_match_last_get_seqno1(matchl),
                gt_match_last_get_seqno2(matchl),
                range_seq1.start,
                range_seq2.start,
                range_seq1.end,
                range_seq2.end,
                gt_match_last_get_score(matchl));
        gt_match_delete(match);
      } else if (status == GT_MATCHER_STATUS_ERROR) {
        had_err =-1;
        break;
      }
    }
    gt_match_iterator_delete(mp);
  } else if (!had_err) {
    fprintf(stdout, "query\tdbname2\tq.startpos\td.startpos\tq.endpos\t"
                    "d.endpos\tbit score\tevalue\tali length\n");
    while ((status = gt_match_iterator_next(mp, &match, err)) !=
                                          GT_MATCHER_STATUS_END) {
      if (status == GT_MATCHER_STATUS_OK) {
        GtMatchBlast *matchb = (GtMatchBlast*) match;
        GtRange range_seq1;
        GtRange range_seq2;
        gt_match_get_range_seq1(match, &range_seq1);
        gt_match_get_range_seq2(match, &range_seq2);
        fprintf(stdout,
              "%s\t%s\t"GT_WU"\t"GT_WU"\t"GT_WU"\t"GT_WU"\t%.3f\t%g\t"GT_WU"\n",
                gt_match_get_seqid1(match),
                gt_match_get_seqid2(match),
                range_seq1.start,
                range_seq2.start,
                range_seq1.end,
                range_seq2.end,
                gt_match_blast_get_bitscore(matchb),
                gt_match_blast_get_evalue(matchb),
                gt_match_blast_get_align_length(matchb));
        gt_match_delete(match);
      } else if (status == GT_MATCHER_STATUS_ERROR) {
        had_err =-1;
        break;
      }
    }
    gt_match_iterator_delete(mp);
  }

  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r8, %r13
movq %rcx, %r14
movq $0x0, (%rsp)
testq %r8, %r8
je 0xb19f9
movq %r13, %rdi
callq 0x101a9a
testb %al, %al
jne 0xb227e
testq %r14, %r14
je 0xb2279
movq (%r14), %rdi
callq 0x120d23
leaq 0x2a7ba1(%rip), %rsi    # 0x3595b2
movq %rax, %rdi
callq 0x17a40
testl %eax, %eax
movq %r13, 0x8(%rsp)
je 0xb1b4f
movq (%r14), %rdi
callq 0x120d23
leaq 0x2a7b87(%rip), %rsi    # 0x3595bc
movq %rax, %rdi
callq 0x17a40
testl %eax, %eax
je 0xb1b6c
movq (%r14), %rdi
callq 0x120d23
leaq 0x2a7b71(%rip), %rsi    # 0x3595c5
movq %rax, %rdi
callq 0x17a40
testl %eax, %eax
je 0xb1b65
movq (%r14), %rdi
callq 0x120d23
leaq 0x2a7b5c(%rip), %rsi    # 0x3595cf
movq %rax, %rdi
callq 0x17a40
testl %eax, %eax
je 0xb1b82
movq (%r14), %rdi
callq 0x120d23
leaq 0x2a7b47(%rip), %rsi    # 0x3595d9
movq %rax, %rdi
callq 0x17a40
testl %eax, %eax
je 0xb1b65
movq (%r14), %rdi
callq 0x120d23
leaq 0x2a7b2f(%rip), %rsi    # 0x3595e0
movq %rax, %rdi
callq 0x17a40
testl %eax, %eax
je 0xb1b65
movq (%r14), %rdi
callq 0x120d23
leaq 0x2bef83(%rip), %rsi    # 0x370a53
movq %rax, %rdi
callq 0x17a40
testl %eax, %eax
je 0xb20a4
movq (%r14), %rdi
callq 0x120d23
leaq 0x2a7af8(%rip), %rsi    # 0x3595e7
movq %rax, %rdi
callq 0x17a40
testl %eax, %eax
jne 0xb2283
callq 0xf36ef
movq %rax, %r15
movq 0x18(%r14), %rdi
callq 0x120d23
movq %r15, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0xf374b
movq %rax, %r12
testq %rax, %rax
je 0xb20f1
movq 0x10(%r14), %rdi
callq 0x120d23
movq %r15, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0xf374b
movq %rax, %r13
testq %rax, %rax
setne %bl
jmp 0xb20f6
movq 0x8(%r14), %rdi
callq 0x120d23
movq %rax, %rdi
movq %r13, %rsi
callq 0x167594
jmp 0xb1bbd
callq 0x12da28
jmp 0xb1b87
movq 0x8(%r14), %rdi
callq 0x120d23
movq %rax, %rdi
movq %r13, %rsi
callq 0x165bc0
jmp 0xb1bbd
callq 0x12d96c
movq %rax, %r15
movq 0x10(%r14), %rdi
callq 0x120d23
movq %r15, %rdi
movq %rax, %rsi
callq 0x12da6c
movq 0x18(%r14), %rdi
callq 0x120d23
movq %r15, %rdi
movq %rax, %rsi
callq 0x12dab6
movq %r15, %rdi
movq %r13, %rsi
callq 0x165cfc
movq %rax, %r15
xorl %ebx, %ebx
cmpq $0x1, %rax
sbbl %ebx, %ebx
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %ebx, %ebx
jne 0xb2093
movq (%r14), %rdi
callq 0x120d23
leaq 0x2a79ce(%rip), %rsi    # 0x3595b2
movq %rax, %rdi
callq 0x17a40
testl %eax, %eax
movq %r15, 0x20(%rsp)
je 0xb1d61
movq (%r14), %rdi
callq 0x120d23
leaq 0x2bee4b(%rip), %rsi    # 0x370a53
movq %rax, %rdi
callq 0x17a40
testl %eax, %eax
je 0xb1e5e
movq (%r14), %rdi
callq 0x120d23
leaq 0x2a79c0(%rip), %rsi    # 0x3595e7
movq %rax, %rdi
callq 0x17a40
movq 0x4122b2(%rip), %rcx    # 0x4c3ee8
movq (%rcx), %rcx
testl %eax, %eax
je 0xb1f81
leaq 0x2a7daa(%rip), %rdi    # 0x3599f2
movl $0x52, %esi
movl $0x1, %edx
callq 0x17fa0
movq %rsp, %rbx
movq %r15, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x165b56
testl %eax, %eax
je 0xb1c7f
cmpl $0x1, %eax
je 0xb2089
cmpl $0x2, %eax
jne 0xb1c5a
jmp 0xb2082
movq (%rsp), %r12
movq %r12, %rdi
leaq 0x40(%rsp), %rsi
callq 0x165773
movq (%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x16578b
movq 0x412243(%rip), %rax    # 0x4c3ee8
movq (%rax), %rax
movq %rax, 0x18(%rsp)
movq (%rsp), %rdi
callq 0x16574b
movq %rax, %rbx
movq (%rsp), %rdi
callq 0x16575f
movq %rax, %r15
movq 0x40(%rsp), %rbp
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x30(%rsp), %r14
movq 0x38(%rsp), %r13
movq %r12, %rdi
callq 0x165aaa
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x28(%rsp)
movq %r12, %rdi
callq 0x165a99
movsd %xmm0, 0x50(%rsp)
movq %r12, %rdi
callq 0x165abb
movq %rax, %r10
subq $0x8, %rsp
movq 0x20(%rsp), %rdi
leaq 0x2a7d2c(%rip), %rsi    # 0x359a45
movq %rbx, %rdx
leaq 0x8(%rsp), %rbx
movq %r15, %rcx
movq 0x28(%rsp), %r15
movq %rbp, %r8
movq %r14, %r9
movsd 0x30(%rsp), %xmm0
movsd 0x58(%rsp), %xmm1
movb $0x2, %al
pushq %r10
pushq %r13
movq 0x20(%rsp), %r13
pushq 0x28(%rsp)
callq 0x17ab0
addq $0x20, %rsp
movq (%rsp), %rdi
callq 0x1657f0
jmp 0xb1c5a
movq 0x412180(%rip), %rax    # 0x4c3ee8
movq (%rax), %rcx
leaq 0x2a7b76(%rip), %rdi    # 0x3598e8
movl $0x39, %esi
movl $0x1, %edx
callq 0x17fa0
movq %rsp, %rbp
movq %r15, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x165b56
testl %eax, %eax
je 0xb1da9
cmpl $0x1, %eax
je 0xb2089
cmpl $0x2, %eax
jne 0xb1d84
jmp 0xb2082
movq (%rsp), %r12
movq %r12, %rdi
leaq 0x40(%rsp), %rsi
callq 0x165773
movq (%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x16578b
movq 0x412119(%rip), %rax    # 0x4c3ee8
movq (%rax), %rax
movq %rax, 0x18(%rsp)
movq (%rsp), %rdi
callq 0x16574b
movq %rax, 0x28(%rsp)
movq (%rsp), %rdi
callq 0x16575f
movq %rax, %rbx
movq 0x40(%rsp), %r15
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x30(%rsp), %r14
movq 0x38(%rsp), %r13
movq %r12, %rdi
callq 0x1680dc
movq %rax, %r10
subq $0x8, %rsp
movq 0x20(%rsp), %rdi
leaq 0x2a7afd(%rip), %rsi    # 0x359922
movq 0x30(%rsp), %rdx
movq %rbx, %rcx
movq %r15, %r8
movq 0x28(%rsp), %r15
movq %r14, %r9
xorl %eax, %eax
pushq %r10
pushq %r13
movq 0x20(%rsp), %r13
pushq 0x28(%rsp)
callq 0x17ab0
addq $0x20, %rsp
movq (%rsp), %rdi
callq 0x1657f0
jmp 0xb1d84
movq 0x412083(%rip), %rax    # 0x4c3ee8
movq (%rax), %rcx
leaq 0x2a7ace(%rip), %rdi    # 0x35993d
movl $0x3f, %esi
movl $0x1, %edx
callq 0x17fa0
movq %rsp, %rbx
movq %r15, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x165b56
testl %eax, %eax
je 0xb1ea6
cmpl $0x1, %eax
je 0xb2089
cmpl $0x2, %eax
jne 0xb1e81
jmp 0xb2082
callq 0x1680ec
movq (%rsp), %rsi
movq %rax, %rdi
callq 0x1655e8
movq %rax, %r12
movq (%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x165773
movq (%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x16578b
movq 0x41200b(%rip), %rax    # 0x4c3ee8
movq (%rax), %rax
movq %rax, 0x18(%rsp)
movq (%rsp), %rdi
callq 0x16574b
movq %rax, 0x28(%rsp)
movq (%rsp), %rdi
callq 0x16575f
movq %rax, %r13
movq 0x40(%rsp), %rbp
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x30(%rsp), %r14
movq 0x38(%rsp), %rax
movq %rax, 0x50(%rsp)
movq %r12, %rdi
callq 0x1681c0
movq %rbx, %r15
movq %rax, %rbx
movq %r12, %rdi
callq 0x1681d0
movq %rax, %r10
movq 0x18(%rsp), %rdi
leaq 0x2a7a3b(%rip), %rsi    # 0x35997d
movq 0x28(%rsp), %rdx
movq %r13, %rcx
movq 0x8(%rsp), %r13
movq %rbp, %r8
movq %r14, %r9
xorl %eax, %eax
pushq %r10
pushq %rbx
movq %r15, %rbx
pushq 0x60(%rsp)
movq 0x38(%rsp), %r15
pushq 0x28(%rsp)
callq 0x17ab0
addq $0x20, %rsp
movq (%rsp), %rdi
callq 0x1657f0
jmp 0xb1e81
leaq 0x2a7a14(%rip), %rdi    # 0x35999c
movl $0x38, %esi
movl $0x1, %edx
callq 0x17fa0
movq %rsp, %rbx
movq %r15, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x165b56
testl %eax, %eax
je 0xb1fbf
cmpl $0x1, %eax
je 0xb2089
cmpl $0x2, %eax
jne 0xb1f9a
jmp 0xb2082
callq 0x167eec
movq (%rsp), %rsi
movq %rax, %rdi
callq 0x1655e8
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x165773
movq (%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x16578b
movq 0x411ef2(%rip), %rax    # 0x4c3ee8
movq (%rax), %rax
movq %rax, 0x18(%rsp)
movq %rbx, %rdi
callq 0x167f9a
movq %rax, %r12
movq %rbx, %rdi
callq 0x167faa
movq %rax, %r13
movq 0x40(%rsp), %rbp
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x30(%rsp), %r14
movq 0x38(%rsp), %r15
movq %rbx, %rdi
movq %rsp, %rbx
callq 0x167fba
movq %rax, %r10
subq $0x8, %rsp
movq 0x20(%rsp), %rdi
leaq 0x2a798a(%rip), %rsi    # 0x3599d5
movq %r12, %rdx
movq %r13, %rcx
movq 0x10(%rsp), %r13
movq %rbp, %r8
movq %r14, %r9
xorl %eax, %eax
pushq %r10
pushq %r15
movq 0x38(%rsp), %r15
pushq 0x28(%rsp)
callq 0x17ab0
addq $0x20, %rsp
movq (%rsp), %rdi
callq 0x1657f0
jmp 0xb1f9a
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0xb208b
xorl %ebp, %ebp
movq %r15, %rdi
callq 0x165b8e
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0xf36ef
movq %rax, %r15
movq 0x18(%r14), %rdi
callq 0x120d23
movq %r15, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0xf374b
movq %rax, %r12
testq %rax, %rax
je 0xb2167
movq 0x10(%r14), %rdi
callq 0x120d23
movq %r15, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0xf374b
movq %rax, %rbp
testq %rax, %rax
setne %bl
jmp 0xb216b
xorl %r13d, %r13d
xorl %ebx, %ebx
movq %r15, %rdi
callq 0xf424d
xorl %r15d, %r15d
testb %bl, %bl
je 0xb214d
subq $0x8, %rsp
movl $0x80000000, %eax       # imm = 0x80000000
movq %r12, %rdi
movq %r13, %rsi
movl $0x80000000, %edx       # imm = 0x80000000
movl $0x80000000, %ecx       # imm = 0x80000000
movl $0x80000000, %r8d       # imm = 0x80000000
movl $0x80000000, %r9d       # imm = 0x80000000
pushq 0x10(%rsp)
pushq %rax
pushq %rax
pushq $0xa
pushq %rax
pushq %rax
pushq %rax
callq 0x16663c
addq $0x40, %rsp
cmpq $0x1, %rax
sbbl %r15d, %r15d
movl %r15d, %ebx
movq %rax, %r15
jmp 0xb2152
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq %r12, %rdi
callq 0xee90c
movq %r13, %rdi
callq 0xee90c
jmp 0xb226f
xorl %ebp, %ebp
xorl %ebx, %ebx
movq %r15, %rdi
callq 0xf424d
testb %bl, %bl
je 0xb224c
testq %r12, %r12
je 0xb228d
testq %rbp, %rbp
je 0xb228d
movq %rbp, 0x20(%rsp)
movq %r12, %rbx
movq %r12, %rdi
callq 0xf02da
movq %rax, %r15
movq %rax, %rdi
callq 0x118a4c
movq %rax, %rbp
movq %r15, %rdi
callq 0xd3713
testl %eax, %eax
je 0xb2207
xorl %r13d, %r13d
movq %r15, %rdi
callq 0xd3713
testl %eax, %eax
je 0xb21f5
xorl %r12d, %r12d
xorl %eax, %eax
cmpq %r12, %r13
sete %al
leal -0x1(%rax,%rax), %ecx
movq %rbp, %rdi
movl %r13d, %esi
movl %r12d, %edx
callq 0x1191fa
incq %r12
movq %r15, %rdi
callq 0xd3713
movl %eax, %eax
cmpq %rax, %r12
jb 0xb21c9
incq %r13
movq %r15, %rdi
callq 0xd3713
movl %eax, %eax
cmpq %rax, %r13
jb 0xb21ba
movq %rbp, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x11897c
movq %rax, %r13
movq 0x20(%r14), %rcx
movq 0x28(%r14), %r8
movq %rbx, %r12
movq %rbx, %rdi
movq 0x20(%rsp), %rbp
movq %rbp, %rsi
movq %rax, %rdx
movq 0x8(%rsp), %r9
callq 0x1679bc
movq %rax, %r15
xorl %ebx, %ebx
cmpq $0x1, %rax
sbbl %ebx, %ebx
jmp 0xb2257
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
xorl %r13d, %r13d
xorl %r15d, %r15d
movq %r12, %rdi
callq 0xee90c
movq %rbp, %rdi
callq 0xee90c
movq %r13, %rdi
callq 0x118a11
movq 0x8(%rsp), %r13
jmp 0xb1bc8
callq 0x1c719
callq 0x1c6a7
movl $0x2, %edi
callq 0x17940
callq 0x1c6e0
nop