// File: /workspace/github_c_makefile_star2_O3/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 $0x68, %rsp
movq %r8, %r12
movq %rcx, %r14
movq $0x0, 0x8(%rsp)
testq %r8, %r8
je 0xaf674
movq %r12, %rdi
callq 0xfcc32
testb %al, %al
jne 0xaff29
testq %r14, %r14
je 0xaff24
movq (%r14), %rdi
callq 0x11b0a1
leaq 0x2a0ef6(%rip), %rsi    # 0x350582
movq %rax, %rdi
callq 0x17a40
testl %eax, %eax
movq %r12, 0x30(%rsp)
je 0xaf81f
movq (%r14), %rdi
callq 0x11b0a1
leaq 0x2a0edc(%rip), %rsi    # 0x35058c
movq %rax, %rdi
callq 0x17a40
testl %eax, %eax
je 0xaf83c
movq (%r14), %rdi
callq 0x11b0a1
leaq 0x2a0ec6(%rip), %rsi    # 0x350595
movq %rax, %rdi
callq 0x17a40
testl %eax, %eax
je 0xaf835
movq (%r14), %rdi
callq 0x11b0a1
leaq 0x2a0eb1(%rip), %rsi    # 0x35059f
movq %rax, %rdi
callq 0x17a40
testl %eax, %eax
je 0xaf852
movq (%r14), %rdi
callq 0x11b0a1
leaq 0x2a0e9c(%rip), %rsi    # 0x3505a9
movq %rax, %rdi
callq 0x17a40
testl %eax, %eax
je 0xaf835
movq (%r14), %rdi
callq 0x11b0a1
leaq 0x2a0e84(%rip), %rsi    # 0x3505b0
movq %rax, %rdi
callq 0x17a40
testl %eax, %eax
je 0xaf835
movq (%r14), %rdi
callq 0x11b0a1
cmpb $0x53, (%rax)
jne 0xaf759
cmpb $0x57, 0x1(%rax)
jne 0xaf759
cmpb $0x0, 0x2(%rax)
je 0xafdcc
movq (%r14), %rdi
callq 0x11b0a1
leaq 0x2a0e4f(%rip), %rsi    # 0x3505b7
movq %rax, %rdi
callq 0x17a40
testl %eax, %eax
jne 0xaff2e
callq 0xef0cd
movq %rax, %r15
movq 0x18(%r14), %rdi
callq 0x11b0a1
movq %r15, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0xef129
movq %r12, %rbx
movq %rax, %r12
testq %rax, %rax
je 0xafd90
movq 0x10(%r14), %rdi
callq 0x11b0a1
movq %r15, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0xef129
movq %rax, %r13
movq %r15, %rdi
callq 0xefbe3
xorl %ebp, %ebp
testq %r13, %r13
je 0xafda1
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 %rbx
pushq %rax
pushq %rax
pushq $0xa
pushq %rax
pushq %rax
pushq %rax
callq 0x15e8f0
addq $0x40, %rsp
movq %rax, %r15
cmpq $0x1, %rax
movl $0x0, %ebx
sbbl %ebx, %ebx
movq %r13, %rbp
jmp 0xafda9
movq 0x8(%r14), %rdi
callq 0x11b0a1
movq %rax, %rdi
movq %r12, %rsi
callq 0x15f818
jmp 0xaf88d
callq 0x127b40
jmp 0xaf857
movq 0x8(%r14), %rdi
callq 0x11b0a1
movq %rax, %rdi
movq %r12, %rsi
callq 0x15de98
jmp 0xaf88d
callq 0x127a84
movq %rax, %r15
movq 0x10(%r14), %rdi
callq 0x11b0a1
movq %r15, %rdi
movq %rax, %rsi
callq 0x127b84
movq 0x18(%r14), %rdi
callq 0x11b0a1
movq %r15, %rdi
movq %rax, %rsi
callq 0x127bce
movq %r15, %rdi
movq %r12, %rsi
callq 0x15dfcf
testq %rax, %rax
je 0xafa29
movq %rax, %r15
movq (%r14), %rdi
callq 0x11b0a1
leaq 0x2a0cda(%rip), %rsi    # 0x350582
movq %rax, %rdi
callq 0x17a40
testl %eax, %eax
movq %r15, 0x20(%rsp)
je 0xafa33
movq (%r14), %rdi
callq 0x11b0a1
cmpb $0x53, (%rax)
jne 0xaf8da
cmpb $0x57, 0x1(%rax)
jne 0xaf8da
cmpb $0x0, 0x2(%rax)
je 0xafc43
movq (%r14), %rdi
callq 0x11b0a1
leaq 0x2a0cce(%rip), %rsi    # 0x3505b7
movq %rax, %rdi
callq 0x17a40
movq 0x4095e0(%rip), %rcx    # 0x4b8ed8
movq (%rcx), %rcx
testl %eax, %eax
je 0xafb37
leaq 0x2a10ad(%rip), %rdi    # 0x3509b7
movl $0x52, %esi
movl $0x1, %edx
callq 0x17fa0
leaq 0x8(%rsp), %rbx
movq %r15, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x15de2e
testl %eax, %eax
je 0xaf943
cmpl $0x1, %eax
je 0xafd75
cmpl $0x2, %eax
jne 0xaf91e
jmp 0xafd6e
movq 0x8(%rsp), %r12
movq %r12, %rdi
leaq 0x48(%rsp), %rsi
callq 0x15da49
movq 0x8(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x15da61
movq 0x40956d(%rip), %rax    # 0x4b8ed8
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x8(%rsp), %rdi
callq 0x15da21
movq %rax, 0x28(%rsp)
movq 0x8(%rsp), %rdi
callq 0x15da35
movq %rax, %r15
movq 0x48(%rsp), %rbp
movq 0x50(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x38(%rsp), %r14
movq 0x40(%rsp), %r13
movq %r12, %rdi
callq 0x15dd82
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x58(%rsp)
movq %r12, %rdi
callq 0x15dd71
movsd %xmm0, 0x60(%rsp)
movq %r12, %rdi
callq 0x15dd93
movq %rax, %r10
subq $0x8, %rsp
movq 0x18(%rsp), %rdi
leaq 0x2a1027(%rip), %rsi    # 0x350a0a
movq 0x30(%rsp), %rdx
movq 0x38(%rsp), %r12
movq %r15, %rcx
movq 0x28(%rsp), %r15
movq %rbp, %r8
movq %r14, %r9
movsd 0x60(%rsp), %xmm0
movsd 0x68(%rsp), %xmm1
movb $0x2, %al
pushq %r10
pushq %r13
pushq 0x30(%rsp)
callq 0x17ab0
addq $0x20, %rsp
movq 0x8(%rsp), %rdi
callq 0x15dac6
jmp 0xaf91e
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0xafd7f
movq 0x40949e(%rip), %rax    # 0x4b8ed8
movq (%rax), %rcx
leaq 0x2a0e69(%rip), %rdi    # 0x3508ad
movl $0x39, %esi
movl $0x1, %edx
callq 0x17fa0
leaq 0x8(%rsp), %rbp
movq %r15, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x15de2e
testl %eax, %eax
je 0xafa7d
cmpl $0x1, %eax
je 0xafd75
cmpl $0x2, %eax
jne 0xafa58
jmp 0xafd6e
movq 0x8(%rsp), %r12
movq %r12, %rdi
leaq 0x48(%rsp), %rsi
callq 0x15da49
movq 0x8(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x15da61
movq 0x409433(%rip), %rax    # 0x4b8ed8
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x8(%rsp), %rdi
callq 0x15da21
movq %rax, 0x28(%rsp)
movq 0x8(%rsp), %rdi
callq 0x15da35
movq %rax, %rbx
movq 0x48(%rsp), %r15
movq 0x50(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x38(%rsp), %r14
movq 0x40(%rsp), %r13
movq %r12, %rdi
callq 0x16031c
movq %rax, %r10
subq $0x8, %rsp
movq 0x18(%rsp), %rdi
leaq 0x2a0dea(%rip), %rsi    # 0x3508e7
movq 0x30(%rsp), %rdx
movq %rbx, %rcx
movq 0x38(%rsp), %r12
movq %r15, %r8
movq 0x28(%rsp), %r15
movq %r14, %r9
xorl %eax, %eax
pushq %r10
pushq %r13
pushq 0x30(%rsp)
callq 0x17ab0
addq $0x20, %rsp
movq 0x8(%rsp), %rdi
callq 0x15dac6
jmp 0xafa58
leaq 0x2a0e23(%rip), %rdi    # 0x350961
movl $0x38, %esi
movl $0x1, %edx
callq 0x17fa0
leaq 0x8(%rsp), %rbx
movq %r15, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x15de2e
testl %eax, %eax
je 0xafb77
cmpl $0x1, %eax
je 0xafd75
cmpl $0x2, %eax
jne 0xafb52
jmp 0xafd6e
callq 0x16012c
movq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x15d8b8
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x15da49
movq 0x8(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x15da61
movq 0x409327(%rip), %rax    # 0x4b8ed8
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movq %rbx, %rdi
callq 0x1601da
movq %rax, %r12
movq %rbx, %rdi
callq 0x1601ea
movq %rax, %r13
movq 0x48(%rsp), %rbp
movq 0x50(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x38(%rsp), %r14
movq 0x40(%rsp), %r15
movq %rbx, %rdi
movq 0x30(%rsp), %rbx
callq 0x1601fa
movq %rax, %r10
subq $0x8, %rsp
movq 0x18(%rsp), %rdi
leaq 0x2a0d92(%rip), %rsi    # 0x35099a
movq %r12, %rdx
movq %rbx, %r12
leaq 0x10(%rsp), %rbx
movq %r13, %rcx
movq %rbp, %r8
movq %r14, %r9
xorl %eax, %eax
pushq %r10
pushq %r15
movq 0x38(%rsp), %r15
pushq 0x30(%rsp)
callq 0x17ab0
addq $0x20, %rsp
movq 0x8(%rsp), %rdi
callq 0x15dac6
jmp 0xafb52
movq 0x40928e(%rip), %rax    # 0x4b8ed8
movq (%rax), %rcx
leaq 0x2a0cae(%rip), %rdi    # 0x350902
movl $0x3f, %esi
movl $0x1, %edx
callq 0x17fa0
leaq 0x8(%rsp), %r14
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x15de2e
testl %eax, %eax
je 0xafc8d
cmpl $0x1, %eax
je 0xafd75
cmpl $0x2, %eax
jne 0xafc68
jmp 0xafd6e
callq 0x16032c
movq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x15d8b8
movq %rax, %r12
movq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x15da49
movq 0x8(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x15da61
movq 0x409211(%rip), %rax    # 0x4b8ed8
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x8(%rsp), %rdi
callq 0x15da21
movq %rax, 0x28(%rsp)
movq 0x8(%rsp), %rdi
callq 0x15da35
movq %rax, %r13
movq 0x48(%rsp), %rbp
movq 0x50(%rsp), %rax
movq %rax, 0x18(%rsp)
movq %r14, %r15
movq 0x38(%rsp), %r14
movq 0x40(%rsp), %rax
movq %rax, 0x58(%rsp)
movq %r12, %rdi
callq 0x160400
movq %rax, %rbx
movq %r12, %rdi
callq 0x160410
movq %rax, %r10
movq 0x10(%rsp), %rdi
leaq 0x2a0c14(%rip), %rsi    # 0x350942
movq 0x28(%rsp), %rdx
movq %r13, %rcx
movq %rbp, %r8
movq %r14, %r9
movq %r15, %r14
xorl %eax, %eax
pushq %r10
pushq %rbx
movq 0x40(%rsp), %r12
pushq 0x68(%rsp)
movq 0x38(%rsp), %r15
pushq 0x30(%rsp)
callq 0x17ab0
addq $0x20, %rsp
movq 0x8(%rsp), %rdi
callq 0x15dac6
jmp 0xafc68
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0xafd77
xorl %ebp, %ebp
movq %r15, %rdi
callq 0x15de66
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
callq 0xefbe3
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
xorl %ebp, %ebp
jmp 0xafda6
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
xorl %r15d, %r15d
movq %r12, %rdi
callq 0xea375
movq %rbp, %rdi
callq 0xea375
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %ebx, %ebx
movq 0x30(%rsp), %r12
jne 0xafd7f
jmp 0xaf899
callq 0xef0cd
movq %rax, %r15
movq 0x18(%r14), %rdi
callq 0x11b0a1
movq %r15, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0xef129
movq %r12, %r13
movq %rax, %r12
testq %rax, %rax
je 0xafee9
movq 0x10(%r14), %rdi
callq 0x11b0a1
movq %r15, %rdi
movq %rax, %rsi
movq %r13, %rbx
movq %r13, %rdx
callq 0xef129
movq %rax, %r13
movq %r15, %rdi
callq 0xefbe3
testq %r13, %r13
je 0xafefa
movq %r13, 0x10(%rsp)
movq %r12, 0x20(%rsp)
movq %r12, %rdi
callq 0xebcd9
movq %rax, %r15
movq %rax, %rdi
callq 0x1133ac
movq %rax, %rbp
movq %r15, %rdi
callq 0xd11be
testl %eax, %eax
je 0xafea4
xorl %r13d, %r13d
movq %r15, %rdi
callq 0xd11be
testl %eax, %eax
je 0xafe92
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 0x113b22
incq %r12
movq %r15, %rdi
callq 0xd11be
movl %eax, %eax
cmpq %rax, %r12
jb 0xafe66
incq %r13
movq %r15, %rdi
callq 0xd11be
movl %eax, %eax
cmpq %rax, %r13
jb 0xafe57
movq %rbp, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1132e0
movq %rax, %r13
movq 0x20(%r14), %rcx
movq 0x28(%r14), %r8
movq 0x20(%rsp), %r12
movq %r12, %rdi
movq 0x10(%rsp), %rbp
movq %rbp, %rsi
movq %rax, %rdx
movq %rbx, %r9
callq 0x15fc04
movq %rax, %r15
xorl %ebx, %ebx
cmpq $0x1, %rax
sbbl %ebx, %ebx
jmp 0xaff07
movq %r15, %rdi
callq 0xefbe3
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
xorl %ebp, %ebp
jmp 0xaff01
xorl %ebp, %ebp
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
xorl %r13d, %r13d
xorl %r15d, %r15d
movq %r12, %rdi
callq 0xea375
movq %rbp, %rdi
callq 0xea375
movq %r13, %rdi
callq 0x113372
jmp 0xafdb9
callq 0x1c5e4
callq 0x1c5ab
movl $0x2, %edi
callq 0x17940