// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/extended/tir_stream.c
// Function: gt_tir_stream_next
static int gt_tir_stream_next(GtNodeStream *ns, GT_UNUSED GtGenomeNode **gn,
                              GtError *err)
{
  GtTIRStream *tir_stream;
  int had_err = 0;
  gt_error_check(err);
  tir_stream = gt_node_stream_cast(gt_tir_stream_class(), ns);

  /* generate and check seeds */
   if (tir_stream->state == GT_TIR_STREAM_STATE_START) {
    if (!had_err && gt_enumeratemaxpairs(tir_stream->ssar,
                      (unsigned int) tir_stream->min_seed_length,
                      gt_tir_store_seeds,
                      &tir_stream->seedinfo,
                      err) != 0) {
      had_err = -1;
    }

    /* extend seeds to TIRs and check TIRs */
    if (!had_err && gt_tir_searchforTIRs(tir_stream,
                                         tir_stream->encseq, err) != 0) {
      had_err = -1;
    }

    GT_FREEARRAY(&tir_stream->seedinfo.seed, Seed);
    tir_stream->state = GT_TIR_STREAM_STATE_REGIONS;
  }

  /* stream out the region nodes */
  if (!had_err && tir_stream->state == GT_TIR_STREAM_STATE_REGIONS) {
    bool skip = false;

    /* check whether index is valid */
    if (tir_stream->cur_elem_index < tir_stream->num_of_tirs) {
      GtUword seqnum, seqlength;
      GtGenomeNode *rn;
      GtStr *seqid;
      seqnum = tir_stream->tir_pairs[tir_stream->cur_elem_index]->contignumber;

      /* if first time we do this */
      if (tir_stream->prev_seqnum == GT_UNDEF_UWORD) {
        /* use current seqnum */
        tir_stream->prev_seqnum = seqnum;
      } else {
        /* else get seqnum of next contig */
        while (tir_stream->prev_seqnum == seqnum) {
          tir_stream->cur_elem_index++;

          /* do not go on if index is out of bounds */
          if (tir_stream->cur_elem_index >= tir_stream->num_of_tirs) {
            skip = true;
            break;
          }
          seqnum =
                tir_stream->tir_pairs[tir_stream->cur_elem_index]->contignumber;
        }
      }

      /* create node */
      if (!skip) {
        tir_stream->prev_seqnum = seqnum;
        seqlength = gt_encseq_seqlength(tir_stream->encseq, seqnum);
        seqid = gt_str_new();

        if (gt_encseq_has_md5_support(tir_stream->encseq)
              && tir_stream->output_md5) {
          GtMD5Tab *md5_tab = NULL;
          md5_tab = gt_encseq_get_md5_tab(tir_stream->encseq, err);
          if (!md5_tab) {
            had_err = -1;
            gt_str_delete(seqid);
          }
          if (!had_err) {
            gt_str_append_cstr(seqid, GT_MD5_SEQID_PREFIX);
            gt_str_append_cstr(seqid, gt_md5_tab_get(md5_tab, seqnum));
            gt_str_append_char(seqid, GT_MD5_SEQID_SEPARATOR);
          }
          gt_md5_tab_delete(md5_tab);
        }

        if (!had_err) {
          if (gt_encseq_has_description_support(tir_stream->encseq)
                && tir_stream->output_seqids) {
            GtUword desclength = 0UL, i = 0UL;
            const char *desc;
            desc = gt_encseq_description(tir_stream->encseq,
                                         &desclength, seqnum);
            while (*(desc+i) != ' ' && i != desclength)
              i++;
            gt_str_append_cstr_nt(seqid, desc, i);
          } else {
            gt_str_append_cstr(seqid, "seq");
            gt_str_append_uword(seqid, seqnum);
          }
          rn = gt_region_node_new(seqid, 1, seqlength);
          gt_str_delete(seqid);
          *gn = rn;
          tir_stream->cur_elem_index++;
        }
      } else {
        /* skipping */
        tir_stream->cur_elem_index = 0;
        tir_stream->state = GT_TIR_STREAM_STATE_COMMENTS;
        *gn = NULL;
      }
    } else {
      /* no valid index */
      tir_stream->cur_elem_index = 0;
      tir_stream->state = GT_TIR_STREAM_STATE_COMMENTS;
      *gn = NULL;
    }
  }

  /* then stream out the comment nodes */
  if (!had_err && tir_stream->state == GT_TIR_STREAM_STATE_COMMENTS)
  {
    bool skip = false;
    if (tir_stream->cur_elem_index < tir_stream->num_of_tirs) {
      const char *description;
      GtUword description_len, seqnum;
      GtGenomeNode *cn;

      seqnum = tir_stream->tir_pairs[tir_stream->cur_elem_index]->contignumber;

      /* for the first time */
      if (tir_stream->prev_seqnum == GT_UNDEF_WORD) {
        /* use current seqnum */
        tir_stream->prev_seqnum = seqnum;
      } else {
        /* else get seqnum of next contig */
        while (tir_stream->prev_seqnum == seqnum) {
          tir_stream->cur_elem_index++;

          if (tir_stream->cur_elem_index >= tir_stream->num_of_tirs) {
            skip = true;
            break;
          }
          seqnum =
                tir_stream->tir_pairs[tir_stream->cur_elem_index]->contignumber;
        }
      }

      /* create a new comment node */
      if (!skip) {
        char description_string[BUFSIZ];
        tir_stream->prev_seqnum = seqnum;

        /* get description and descriptionlength of current contig */
        description = gt_encseq_description(tir_stream->encseq,
                                            &description_len, seqnum);

       (void) strncpy(description_string, description,
                      (size_t) (description_len * sizeof (char)));
        description_string[description_len] = '\0';

        /* make a new comment node */
        cn = gt_comment_node_new(description_string);

        *gn = cn;
        tir_stream->cur_elem_index++;
      } else {
        /* skipping */
        tir_stream->cur_elem_index = 0;
        tir_stream->state = GT_TIR_STREAM_STATE_FEATURES;
        *gn = NULL;
      }
    } else {
      /* no valid index */
      tir_stream->cur_elem_index = 0;
      tir_stream->state = GT_TIR_STREAM_STATE_FEATURES;
      *gn = NULL;
    }
  }

  /* finally stream out the features */
  if (!had_err && tir_stream->state == GT_TIR_STREAM_STATE_FEATURES) {
    if (tir_stream->cur_elem_index < tir_stream->num_of_tirs) {
      GtStr *seqid, *source;
      GtGenomeNode *node, GT_UNUSED *parent;
      const TIRPair *pair =
                tir_stream->tir_pairs[tir_stream->cur_elem_index];
      GtUword seqstartpos;
      char buf[BUFSIZ];

      gt_assert(!pair->skip);
      gt_assert(pair->tsd_length > 0);

      seqstartpos = gt_encseq_seqstartpos(tir_stream->encseq,
                                          pair->contignumber);
      seqid = gt_str_new();
      source = gt_str_new_cstr("TIRvish");

      if (gt_encseq_has_md5_support(tir_stream->encseq)
            && tir_stream->output_md5) {
        GtMD5Tab *md5_tab = NULL;
        md5_tab = gt_encseq_get_md5_tab(tir_stream->encseq, err);
        if (!md5_tab) {
          had_err = -1;
          gt_str_delete(seqid);
        }
        if (!had_err) {
          gt_str_append_cstr(seqid, GT_MD5_SEQID_PREFIX);
          gt_str_append_cstr(seqid, gt_md5_tab_get(md5_tab,
                                                   pair->contignumber));
          gt_str_append_char(seqid, GT_MD5_SEQID_SEPARATOR);
        }
        gt_md5_tab_delete(md5_tab);
      }

      if (!had_err && gt_encseq_has_description_support(tir_stream->encseq)
            && tir_stream->output_seqids) {
        GtUword desclength = 0UL, i = 0UL;
        const char *desc;
        desc = gt_encseq_description(tir_stream->encseq,
                                     &desclength, pair->contignumber);
        while (*(desc+i) != ' ' && i != desclength)
          i++;
        gt_str_append_cstr_nt(seqid, desc, i);
      } else {
        gt_str_append_cstr(seqid, "seq");
        gt_str_append_uword(seqid, pair->contignumber);
      }

      /* repeat region */
      node = gt_feature_node_new(seqid, gt_ft_repeat_region,
                                 pair->left_tir_start - seqstartpos -
                                   pair->tsd_length + 1,
                                 pair->right_transformed_end - seqstartpos
                                   + pair->tsd_length + 1,
                                 GT_STRAND_UNKNOWN);
      gt_feature_node_set_source((GtFeatureNode*) node, source);
      *gn = node;
      parent = node;

      /* target site duplication */

      if (tir_stream->min_TSD_length > 1U) {
        node = gt_feature_node_new(seqid,
                       gt_ft_target_site_duplication,
                       pair->left_tir_start - seqstartpos + 1
                         - pair->tsd_length,
                       pair->left_tir_start - seqstartpos,
                       GT_STRAND_UNKNOWN);
        gt_feature_node_set_source((GtFeatureNode*) node, source);
        gt_feature_node_add_child((GtFeatureNode*) parent,
                      (GtFeatureNode*) node);

        node = gt_feature_node_new(seqid,
                       gt_ft_target_site_duplication,
                       pair->right_transformed_end - seqstartpos + 2,
                       pair->right_transformed_end - seqstartpos + 1
                       + pair->tsd_length,
                       GT_STRAND_UNKNOWN);
        gt_feature_node_set_source((GtFeatureNode*) node, source);
        gt_feature_node_add_child((GtFeatureNode*) parent,
                      (GtFeatureNode*) node);
      }

      /* terminal inverted repeat element */

      node = gt_feature_node_new(seqid, gt_ft_terminal_inverted_repeat_element,
                                 pair->left_tir_start - seqstartpos + 1,
                                 pair->right_transformed_end - seqstartpos +1,
                                 GT_STRAND_UNKNOWN);
      gt_feature_node_set_source((GtFeatureNode*) node, source);
      gt_feature_node_add_child((GtFeatureNode*) parent, (GtFeatureNode*)node);
      (void) snprintf(buf, BUFSIZ-1, "%.2f", pair->similarity);
      gt_feature_node_set_attribute((GtFeatureNode*) node,
                                    "tir_similarity",
                                    buf);
      parent = node;

      /* left terminal inverted repeat */

      node = gt_feature_node_new(seqid, gt_ft_terminal_inverted_repeat,
                                 pair->left_tir_start - seqstartpos + 1,
                                 pair->left_tir_end - seqstartpos + 1,
                                 GT_STRAND_UNKNOWN);
      gt_feature_node_set_source((GtFeatureNode*)node, source);
      gt_feature_node_add_child((GtFeatureNode*)parent, (GtFeatureNode*)node);

      /* right terminal inverted repeat */

      node = gt_feature_node_new(seqid, gt_ft_terminal_inverted_repeat,
                                pair->right_transformed_start - seqstartpos + 1,
                                pair->right_transformed_end - seqstartpos + 1,
                                GT_STRAND_UNKNOWN);
      gt_feature_node_set_source((GtFeatureNode*)node, source);
      gt_feature_node_add_child((GtFeatureNode*)parent, (GtFeatureNode*)node);

      /* clean up and get next pair */
      gt_str_delete(seqid);
      gt_str_delete(source);
      tir_stream->cur_elem_index++;
    } else {
      *gn = NULL;
    }
  }
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20d8, %rsp           # imm = 0x20D8
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
testq %rdx, %rdx
je 0x181166
movq %r14, %rdi
callq 0xfcc32
testb %al, %al
jne 0x18236c
movq 0x33d77b(%rip), %rdi    # 0x4be8e8
testq %rdi, %rdi
jne 0x181194
leaq -0xf7(%rip), %rsi       # 0x181082
leaq -0x49(%rip), %rdx       # 0x181137
movl $0x120, %edi            # imm = 0x120
callq 0x162d34
movq %rax, %rdi
movq %rax, 0x33d754(%rip)    # 0x4be8e8
movq %rbx, %rsi
callq 0x162ff7
movq %rax, (%rsp)
movl 0x90(%rax), %ecx
cmpl $0x1, %ecx
movq %r14, 0x50(%rsp)
je 0x181cc8
testl %ecx, %ecx
movq (%rsp), %rbp
jne 0x181e7b
movq 0x18(%rbp), %rdi
movl 0xb8(%rbp), %esi
leaq 0x20(%rbp), %rbx
leaq 0x14b9(%rip), %rdx      # 0x18268e
movq %rbx, %rcx
movq %r14, %r8
callq 0x1a2e90
movl %eax, %r15d
testl %eax, %eax
jne 0x181c87
movl %r15d, 0x44(%rsp)
movq %rbx, 0x68(%rsp)
movq %r12, 0x20(%rsp)
movq 0x10(%rbp), %rbx
callq 0x1e279e
movq %rax, 0x38(%rsp)
callq 0x1e279e
movq %rax, 0x30(%rsp)
movl $0x64, %edi
callq 0x1b1a84
movq %rax, 0x60(%rsp)
testq %r14, %r14
je 0x181236
movq %r14, %rdi
callq 0xfcc32
testb %al, %al
jne 0x18239e
movq %rbp, %rdi
addq $0xe0, %rdi
callq 0x2033eb
movq %rax, 0x58(%rsp)
cmpq $0x0, 0x30(%rbp)
je 0x181991
xorl %r14d, %r14d
movq %rbx, 0x10(%rsp)
movq %rbx, %rdi
callq 0xe7b9c
movq %rax, %r13
movq %r14, 0x18(%rsp)
leaq (%r14,%r14,4), %rax
movq 0x20(%rbp), %rcx
movq 0x38(%rbp), %r12
movq 0x18(%rcx,%rax,8), %rbx
cmpq %rbx, %r12
jb 0x18235d
leaq (%rcx,%rax,8), %r15
movq 0x10(%rbp), %rdi
movq 0x20(%r15), %rsi
callq 0xeb6ee
movq %rbp, %rcx
movq %rax, %rbp
movq 0x10(%rcx), %rdi
movq 0x20(%r15), %rsi
callq 0xeb9d2
decq %r13
subq %rbx, %r12
jne 0x1812ce
xorpd %xmm0, %xmm0
movapd %xmm0, 0x70(%rsp)
movq $0x0, 0x80(%rsp)
jmp 0x181439
movq %rax, %r14
addq %rbp, %r14
movq (%r15), %r9
movq %r9, %rax
subq %rbp, %rax
jbe 0x18136b
movq %r13, %rdx
subq %r14, %rdx
movq 0x8(%r15), %rcx
subq %rdx, %rcx
jbe 0x18136b
cmpq %rcx, %rax
movq %rcx, %rdx
cmovbq %rax, %rdx
cmpq %rcx, %r12
movq %r12, %rbx
cmovaq %rdx, %rbx
cmpq %rax, %r12
cmovaq %rdx, %rbx
subq %rbx, %r9
xorl %edi, %edi
xorl %esi, %esi
movq 0x38(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq %rbx, %r8
callq 0x1e2956
movq 0x8(%r15), %r9
subq %rbx, %r9
xorl %edi, %edi
xorl %esi, %esi
movq 0x30(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq %rbx, %r8
callq 0x1e2956
movq (%rsp), %rax
movslq 0xf0(%rax), %r9
xorl %edi, %edi
leaq 0x70(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq 0x38(%rsp), %rcx
movq 0x30(%rsp), %r8
callq 0x203536
jmp 0x181381
xorpd %xmm0, %xmm0
movapd %xmm0, 0x70(%rsp)
movq $0x0, 0x80(%rsp)
movq 0x18(%r15), %rax
movq (%r15), %r9
addq %rax, %r9
subq %r9, %r14
jbe 0x181439
movq %r13, %rcx
subq %rbp, %rcx
addq 0x8(%r15), %rax
subq %rax, %rcx
jbe 0x181439
cmpq %rcx, %r14
movq %rcx, %rax
cmovbq %r14, %rax
cmpq %rcx, %r12
movq %r12, %rbx
cmovaq %rax, %rbx
cmpq %r14, %r12
cmovaq %rax, %rbx
movl $0x1, %edi
xorl %esi, %esi
movq 0x38(%rsp), %r14
movq %r14, %rdx
movq 0x10(%rsp), %rbp
movq %rbp, %rcx
movq %rbx, %r8
callq 0x1e2956
movq 0x18(%r15), %r9
addq 0x8(%r15), %r9
movl $0x1, %edi
xorl %esi, %esi
movq 0x30(%rsp), %r12
movq %r12, %rdx
movq %rbp, %rcx
movq %rbx, %r8
callq 0x1e2956
movq (%rsp), %rbp
movslq 0xf0(%rbp), %r9
movl $0x1, %edi
leaq 0xa0(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq %r14, %rcx
movq %r12, %r8
callq 0x203536
movq 0xa0(%rsp), %rax
addq $-0x2, %rax
jmp 0x18145d
xorpd %xmm0, %xmm0
movapd %xmm0, 0xa0(%rsp)
movq $0x0, 0xb0(%rsp)
movq $-0x2, %rax
movq (%rsp), %rbp
addq 0x18(%r15), %rax
addq 0x78(%rsp), %rax
cmpq 0xc0(%rbp), %rax
jb 0x18197a
cmpq 0xc8(%rbp), %rax
ja 0x18197a
movq 0x80(%rbp), %rax
cmpq %rax, 0x88(%rbp)
jae 0x181496
movq 0x78(%rbp), %r8
jmp 0x1814c7
addq $0x100, %rax            # imm = 0x100
movq %rax, 0x80(%rbp)
movq 0x78(%rbp), %rdi
shlq $0x4, %rax
leaq (%rax,%rax,4), %rsi
leaq 0x2153d4(%rip), %rdx    # 0x39688a
movl $0x244, %ecx            # imm = 0x244
callq 0x104461
movq %rax, %r8
movq %rax, 0x78(%rbp)
testq %r8, %r8
je 0x182380
movq 0x88(%rbp), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x88(%rbp)
leaq (%rax,%rax,4), %r14
shlq $0x4, %r14
movq 0x20(%r15), %rbx
movq %rbx, (%r8,%r14)
xorl %esi, %esi
movq %rsi, 0x38(%r8,%r14)
movq (%r15), %rax
movq %rax, %rcx
subq 0x70(%rsp), %rcx
movq %rcx, 0x8(%r8,%r14)
movq 0x18(%r15), %rcx
addq %rcx, %rax
decq %rax
addq 0xa0(%rsp), %rax
movq %rax, 0x10(%r8,%r14)
movq 0x8(%r15), %rax
movq %rax, %rdx
subq 0x78(%rsp), %rdx
addq %rcx, %rax
decq %rax
movq %rdx, 0x18(%r8,%r14)
addq 0xa8(%rsp), %rax
movq %rax, 0x20(%r8,%r14)
movq %r13, %rcx
subq %rax, %rcx
movq %rcx, 0x40(%r8,%r14)
subq %rdx, %r13
movq %r13, 0x48(%r8,%r14)
movq %rsi, 0x28(%r8,%r14)
movb $0x0, 0x30(%r8,%r14)
incq 0x98(%rbp)
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x181586
movq %r8, %r15
callq 0xfcc32
movq %r15, %r8
testb %al, %al
jne 0x182385
addq %r14, %r8
movq %r8, 0x8(%rsp)
movq 0x10(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0xeb6ee
movq %rax, %r12
movq %r14, %rdi
movq %rbx, %rsi
callq 0xeb9d2
movq 0x8(%rsp), %r8
movq 0x8(%r8), %rbp
movq %rbp, %rdx
subq %r12, %rdx
jb 0x18237b
movq 0x10(%r8), %rcx
cmpq %rcx, %rbp
ja 0x182376
movq 0x18(%r8), %rsi
cmpq 0x20(%r8), %rsi
ja 0x182371
movq (%rsp), %rdi
movq 0x118(%rdi), %rsi
movq %rbp, %r13
subq %rsi, %r13
cmpq %rsi, %rdx
cmovbq %r12, %r13
addq %rsi, %rbp
cmpq %rcx, %rbp
cmovaeq %rcx, %rbp
movq 0x40(%r8), %rcx
movq 0x48(%r8), %r15
movq %r15, %r14
subq %rsi, %r14
cmpq %r14, %rcx
cmovaq %rcx, %r14
addq %r12, %rax
decq %rax
addq %rsi, %r15
cmpq %rax, %r15
cmovaeq %rax, %r15
cmpq $0x2, 0x108(%rdi)
jb 0x181874
movq %rbp, %rbx
subq %r13, %rbx
incq %rbx
movq %r15, %r12
subq %r14, %r12
incq %r12
movl $0x1, %esi
movq %rbx, %rdi
leaq 0x215238(%rip), %rdx    # 0x39688a
movl $0x1a1, %ecx            # imm = 0x1A1
callq 0x10436a
movq %rax, 0x48(%rsp)
movl $0x1, %esi
movq %r12, %rdi
leaq 0x21521a(%rip), %rdx    # 0x39688a
movl $0x1a2, %ecx            # imm = 0x1A2
callq 0x10436a
movq %rax, 0x28(%rsp)
movq 0x10(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq %r13, %rdx
movq %rbp, %rcx
callq 0xe9127
movq 0x10(%rsp), %rdi
movq %rdi, %rbp
movq 0x28(%rsp), %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0xe9127
leaq 0xe0(%rsp), %rax
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movq $0x0, 0x10(%rax)
cmpq %r14, %r13
jae 0x18238a
movq %r13, 0xd0(%rsp)
movq %r14, 0xd8(%rsp)
movq %rbp, 0xf8(%rsp)
movq (%rsp), %rax
movl 0x108(%rax), %r13d
movq %rbp, %rdi
callq 0xebcd9
movq 0x48(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq 0x28(%rsp), %r15
movq %r15, %rdx
movq %r12, %rcx
movl %r13d, %r8d
movq %rax, %r9
pushq 0x50(%rsp)
pushq $0x0
leaq 0xe0(%rsp), %rax
pushq %rax
leaq 0x10e5(%rip), %rax      # 0x18280f
pushq %rax
callq 0x1a4168
addq $0x20, %rsp
movl %eax, %ebx
movq %r14, %rdi
leaq 0x21514a(%rip), %r14    # 0x39688a
movq %r14, %rsi
movl $0x1bb, %edx            # imm = 0x1BB
callq 0x1045eb
movq %r15, %rdi
movq %r14, %rsi
movl $0x1bc, %edx            # imm = 0x1BC
callq 0x1045eb
movq 0xe0(%rsp), %rdi
testl %ebx, %ebx
movq 0x8(%rsp), %r8
jne 0x181859
movq 0xf0(%rsp), %rdx
movq 0x8(%r8), %rax
testq %rdx, %rdx
je 0x18182b
movq 0x20(%r8), %rcx
movq (%rsp), %rbp
movq 0x108(%rbp), %r8
leaq 0x18(%rdi), %r9
movq $-0x1, %r10
movq %rax, %rsi
xorl %r11d, %r11d
movq (%r9), %rbx
cmpq %r8, %rbx
jb 0x18180f
cmpq 0x110(%rbp), %rbx
jae 0x18180f
movq -0x18(%r9), %r14
movq 0x8(%rsp), %r15
movq 0x48(%r15), %r13
movq -0x8(%r9), %r15
addq %r14, %r15
movq %r13, %rbp
subq %r15, %rbp
negq %rbp
subq %r15, %r13
leaq -0x1(%r14,%rbx), %r12
cmovbq %rbp, %r13
movq %r12, %rbp
subq %rax, %rbp
negq %rbp
subq %rax, %r12
cmovbq %rbp, %r12
movq (%rsp), %rbp
addq %r13, %r12
cmpq %r10, %r12
jae 0x18180f
addq %rbx, %r14
decq %r15
movq %r15, %rcx
movq %r12, %r10
movq %rbx, %r11
movq %r14, %rsi
addq $0x28, %r9
decq %rdx
jne 0x1817a7
movq 0x8(%rsp), %r8
movq %rsi, 0x8(%r8)
movq %rcx, 0x48(%r8)
movq %r11, 0x38(%r8)
jmp 0x181837
movb $0x1, 0x30(%r8)
movq 0x48(%r8), %rcx
movq %rax, %rsi
cmpq 0x40(%r8), %rcx
ja 0x181842
movb $0x1, 0x30(%r8)
cmpq %rsi, 0x10(%r8)
ja 0x18184d
movb $0x1, 0x30(%r8)
cmpq $0x0, 0x38(%r8)
jne 0x181859
movb $0x1, 0x30(%r8)
testq %rdi, %rdi
je 0x181874
leaq 0x215025(%rip), %rsi    # 0x39688a
movl $0x1c2, %edx            # imm = 0x1C2
callq 0x1045eb
movq 0x8(%rsp), %r8
cmpb $0x0, 0x30(%r8)
movq (%rsp), %rbp
jne 0x18197a
movq 0x8(%r8), %r9
movq 0x10(%r8), %rbx
subq %r9, %rbx
jbe 0x181975
movq 0x20(%r8), %r14
subq 0x18(%r8), %r14
jbe 0x181975
movl $0x1, %edi
xorl %esi, %esi
movq 0x38(%rsp), %r15
movq %r15, %rdx
movq 0x10(%rsp), %r13
movq %r13, %rcx
movq %rbx, %r8
callq 0x1e2956
movq 0x8(%rsp), %rax
movq 0x18(%rax), %r9
movl $0x1, %edi
xorl %esi, %esi
movq 0x30(%rsp), %r12
movq %r12, %rdx
movq %r13, %rcx
movq %r14, %r8
callq 0x1e2956
movq 0x60(%rsp), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x1b1b0c
movq %rax, %xmm0
movq 0x1c5fdf(%rip), %xmm2   # 0x3478e0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
movapd 0x1c5fe3(%rip), %xmm3   # 0x3478f0
subpd %xmm3, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
cmpq %r14, %rbx
cmovaq %rbx, %r14
movq %r14, %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
subpd %xmm3, %xmm0
movapd %xmm0, %xmm2
unpckhpd %xmm0, %xmm2            # xmm2 = xmm2[1],xmm0[1]
addsd %xmm0, %xmm2
divsd %xmm2, %xmm1
movsd 0x1c48df(%rip), %xmm0   # 0x346228
subsd %xmm1, %xmm0
mulsd 0x1c7e8b(%rip), %xmm0   # 0x3497e0
movq 0x8(%rsp), %rax
movsd %xmm0, 0x28(%rax)
movsd 0xf8(%rbp), %xmm1
callq 0x105c97
movq 0x8(%rsp), %r8
testb %al, %al
je 0x18197a
movb $0x1, 0x30(%r8)
movq 0x18(%rsp), %r14
incq %r14
cmpq 0x30(%rbp), %r14
movq 0x10(%rsp), %rbx
jb 0x18125d
movq 0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x1819b2
movq 0x88(%rbp), %rsi
leaq 0xe32(%rip), %rcx       # 0x1827da
movl $0x50, %edx
callq 0x17f60
movb 0x100(%rbp), %al
movb 0x101(%rbp), %dil
movl %edi, %ecx
orb %al, %cl
testb $0x1, %cl
je 0x1819d1
xorb $0x1, %dil
orb %al, %dil
jmp 0x1819e4
cmpb $0x1, 0x102(%rbp)
jne 0x181b8b
xorl %edi, %edi
movq (%rsp), %rbp
movq 0x78(%rbp), %r8
testq %r8, %r8
je 0x181b8b
movq (%rsp), %rax
movq 0x88(%rax), %rax
cmpq $0x2, %rax
jb 0x181b8b
movq (%rsp), %rcx
movb 0x102(%rcx), %cl
movb %cl, 0x48(%rsp)
movq 0x8(%r8), %rbp
movq 0x48(%r8), %r13
movl $0x1, %r14d
movl $0x50, %r12d
movq %r8, %r9
movq %r8, %r10
movl %edi, 0x8(%rsp)
movq (%rsp), %rcx
movq 0x78(%rcx), %rdx
cmpb $0x0, 0x30(%rdx,%r12)
jne 0x181b7b
leaq (%rdx,%r12), %rbx
movq 0x8(%rdx,%r12), %rcx
movq 0x48(%rdx,%r12), %rsi
cmpq %rbp, %rsi
jb 0x181a86
cmpq %r13, %rcx
ja 0x181a86
cmpq %rcx, %rbp
ja 0x182399
leaq (%rdx,%r12), %r15
addq $0x30, %r15
cmpq %r13, %rsi
cmovaq %rsi, %r13
testb $0x1, %dil
je 0x181a9a
movb $0x1, 0x30(%r10)
jmp 0x181b6c
movq %rsi, %r13
movq %rcx, %rbp
movq %rbx, %r10
movq %rbx, %r9
movq %rbx, %r8
jmp 0x181b7b
movq %r15, 0x10(%rsp)
cmpb $0x0, 0x48(%rsp)
movq %r10, 0x18(%rsp)
je 0x181b18
movq %r9, 0x28(%rsp)
movq 0x20(%r8), %rax
subq 0x8(%r8), %rax
movq %rax, %xmm1
movq 0x1c5e1b(%rip), %xmm3   # 0x3478e0
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
movapd 0x1c5e1f(%rip), %xmm4   # 0x3478f0
subpd %xmm4, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movq 0x20(%rdx,%r12), %rax
subq %rcx, %rax
movq %rax, %xmm2
punpckldq %xmm3, %xmm2    # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
subpd %xmm4, %xmm2
movapd %xmm2, %xmm1
unpckhpd %xmm2, %xmm1            # xmm1 = xmm1[1],xmm2[1]
addsd %xmm2, %xmm1
movq %r8, %r15
callq 0x105c97
testb %al, %al
jne 0x181b40
movq %r15, %r8
movq 0x10(%rsp), %r15
jmp 0x181b47
movq %r8, 0x28(%rsp)
movsd 0x28(%r9), %xmm0
movsd 0x28(%rdx,%r12), %xmm1
movq %r9, %r15
callq 0x105c97
testb %al, %al
jne 0x181b57
movq %r15, %r9
movq 0x10(%rsp), %r15
jmp 0x181b5e
addq $0x30, %r15
movq %rbx, %r8
movl 0x8(%rsp), %edi
movq 0x18(%rsp), %r10
movq 0x28(%rsp), %r9
jmp 0x181b6c
addq $0x30, %r15
movq %rbx, %r9
movl 0x8(%rsp), %edi
movq 0x28(%rsp), %r8
movq 0x18(%rsp), %r10
movb $0x1, (%r15)
movq (%rsp), %rax
movq 0x88(%rax), %rax
incq %r14
addq $0x50, %r12
cmpq %rax, %r14
jb 0x181a32
movq (%rsp), %rbp
movq 0x88(%rbp), %rcx
testq %rcx, %rcx
jle 0x181c3b
movq 0x78(%rbp), %rax
leaq (%rcx,%rcx,4), %rcx
shlq $0x4, %rcx
addq %rax, %rcx
xorl %ebx, %ebx
movq 0x20(%rsp), %r12
movl 0x44(%rsp), %r15d
testq %rax, %rax
je 0x182362
movzbl 0x30(%rax), %edx
xorq $0x1, %rdx
addq %rdx, %rbx
addq $0x50, %rax
cmpq %rcx, %rax
jb 0x181bba
testq %rbx, %rbx
je 0x181c4b
leaq (,%rbx,8), %rdi
leaq 0x214c9f(%rip), %rsi    # 0x39688a
movl $0x125, %edx            # imm = 0x125
callq 0x104226
movq 0x88(%rbp), %rdx
testq %rdx, %rdx
jle 0x181c4f
movq 0x78(%rbp), %rsi
xorl %ecx, %ecx
leaq (%rdx,%rdx,4), %rdx
shlq $0x4, %rdx
movq %rsi, %rdi
testq %rdi, %rdi
je 0x182367
cmpb $0x0, 0x30(%rdi)
jne 0x181c2c
movq %rdi, (%rax,%rcx,8)
incq %rcx
movq 0x78(%rbp), %rsi
addq $0x50, %rdi
leaq (%rsi,%rdx), %r8
cmpq %r8, %rdi
jb 0x181c12
jmp 0x181c4f
xorl %ebx, %ebx
xorl %eax, %eax
movq 0x20(%rsp), %r12
movl 0x44(%rsp), %r15d
jmp 0x181c4f
xorl %ebx, %ebx
xorl %eax, %eax
movq %rbx, 0x98(%rbp)
movq %rax, 0x70(%rbp)
movq 0x58(%rsp), %rdi
callq 0x2034b4
movq 0x38(%rsp), %rdi
callq 0x1e2a17
movq 0x30(%rsp), %rdi
callq 0x1e2a17
movq 0x60(%rsp), %rdi
callq 0x1b1ad0
movq 0x68(%rsp), %rbx
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x181cb0
leaq 0x214bf4(%rip), %rsi    # 0x39688a
movl $0x2a6, %edx            # imm = 0x2A6
callq 0x1045eb
xorpd %xmm0, %xmm0
movupd %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
movl $0x1, 0x90(%rbp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %r15d, %r15d
jne 0x182335
movq (%rsp), %rbp
movq 0x98(%rbp), %rax
movq 0xa0(%rbp), %rcx
cmpq %rax, %rcx
jae 0x181d23
movq 0x70(%rbp), %rdx
movq 0xa8(%rbp), %rdi
movq (%rdx,%rcx,8), %rsi
movq (%rsi), %rsi
cmpq $-0x1, %rdi
je 0x181d3f
cmpq %rsi, %rdi
jne 0x181d3f
leaq 0x1(%rcx), %rdi
cmpq %rax, %rdi
jae 0x181d23
movq 0x8(%rdx,%rcx,8), %rcx
movq (%rcx), %r13
movq %rdi, %rcx
cmpq %r13, %rsi
je 0x181cfc
movq %r12, 0x20(%rsp)
movq %rdi, 0xa0(%rbp)
jmp 0x181d47
xorl %ecx, %ecx
movq %rcx, 0xa0(%rbp)
movl $0x2, 0x90(%rbp)
movq %rcx, (%r12)
jmp 0x181e92
movq %r12, 0x20(%rsp)
movq %rsi, %r13
movq %r13, 0xa8(%rbp)
movq 0x10(%rbp), %rdi
movq %r13, %rsi
callq 0xeb9d2
movq %rax, %r12
callq 0x11ac6c
movq %rax, %r14
movq 0x10(%rbp), %rdi
callq 0xec8c4
testb %al, %al
je 0x181dcf
cmpb $0x1, 0x104(%rbp)
jne 0x181dcf
movq 0x10(%rbp), %rdi
movq 0x50(%rsp), %rsi
callq 0xec893
testq %rax, %rax
je 0x182347
movq %rax, %rbx
leaq 0x1ea45d(%rip), %rsi    # 0x36c1f9
movq %r14, %rdi
callq 0x11acf3
movq %rbx, %rdi
movq %r13, %rsi
callq 0x10702c
movq %r14, %rdi
movq %rax, %rsi
callq 0x11acf3
movq %r14, %rdi
movl $0x3a, %esi
callq 0x11af23
movq %rbx, %rdi
callq 0x106f84
movq 0x10(%rbp), %rdi
callq 0xec569
testb %al, %al
je 0x181e30
cmpb $0x1, 0x103(%rbp)
jne 0x181e30
xorl %r15d, %r15d
leaq 0xd0(%rsp), %rbx
movq %r15, (%rbx)
movq 0x10(%rbp), %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0xec19e
subq (%rbx), %r15
movq $-0x1, %rcx
leaq 0x1(%rcx), %rdx
cmpb $0x20, 0x1(%rax,%rcx)
je 0x181e23
addq %r15, %rcx
cmpq $-0x1, %rcx
movq %rdx, %rcx
jne 0x181e0c
movq %r14, %rdi
movq %rax, %rsi
callq 0x11ae1b
jmp 0x181e4a
leaq 0x1d12b3(%rip), %rsi    # 0x3530ea
movq %r14, %rdi
callq 0x11acf3
movq %r14, %rdi
movq %r13, %rsi
callq 0x11ae72
movl $0x1, %esi
movq %r14, %rdi
movq %r12, %rdx
callq 0x16e820
movq %rax, %rbx
movq %r14, %rdi
callq 0x11bdbf
movq 0x20(%rsp), %r12
movq %rbx, (%r12)
incq 0xa0(%rbp)
movl 0x90(%rbp), %ecx
cmpl $0x2, %ecx
jne 0x181f6d
movq 0x98(%rbp), %rax
movq 0xa0(%rbp), %rcx
cmpq %rax, %rcx
jae 0x181ede
movq 0x70(%rbp), %rax
movq 0xa8(%rbp), %rdx
movq (%rax,%rcx,8), %rsi
movq (%rsi), %rsi
movq %rdx, %rdi
negq %rdi
jo 0x181efa
cmpq %rsi, %rdx
jne 0x181efa
movq 0x98(%rbp), %rdi
incq %rcx
cmpq %rdi, %rcx
jae 0x181f51
movq (%rax,%rcx,8), %rdx
movq (%rdx), %rdx
cmpq %rdx, %rsi
je 0x181ebd
movq %rcx, 0xa0(%rbp)
jmp 0x181efd
xorl %ecx, %ecx
movq %rcx, 0xa0(%rbp)
movl $0x3, 0x90(%rbp)
movq %rcx, (%r12)
jmp 0x181f8a
movq %rsi, %rdx
movq %rdx, 0xa8(%rbp)
movq 0x10(%rbp), %rdi
leaq 0x70(%rsp), %rbx
movq %rbx, %rsi
callq 0xec19e
movq (%rbx), %rbx
leaq 0xd0(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x17370
movb $0x0, 0xd0(%rsp,%rbx)
movq %r14, %rdi
callq 0x2fcc50
movq %rax, (%r12)
incq 0xa0(%rbp)
movl 0x90(%rbp), %ecx
jmp 0x181f6d
xorl %eax, %eax
movq %rax, 0xa0(%rbp)
movl $0x3, 0x90(%rbp)
movq %rax, (%r12)
movl $0x3, %ecx
xorl %eax, %eax
cmpl $0x3, %ecx
jne 0x182335
movq (%rsp), %rbp
movq 0x98(%rbp), %rax
movq 0xa0(%rbp), %rcx
cmpq %rax, %rcx
jae 0x1820d7
movq 0x70(%rbp), %rax
movq (%rax,%rcx,8), %rbx
cmpb $0x1, 0x30(%rbx)
je 0x18238f
cmpq $0x0, 0x38(%rbx)
je 0x182394
movq 0x10(%rbp), %rdi
movq (%rbx), %rsi
callq 0xeb6ee
movq %rax, %r15
callq 0x11ac6c
movq %rax, %r13
leaq 0x1dbc6b(%rip), %rdi    # 0x35dc39
callq 0x11acc9
movq %rax, %r14
movq 0x10(%rbp), %rdi
callq 0xec8c4
testb %al, %al
movq %r14, 0x10(%rsp)
je 0x182055
cmpb $0x1, 0x104(%rbp)
jne 0x182055
movq %r15, 0x8(%rsp)
movq %r14, %r15
movq 0x10(%rbp), %rdi
movq 0x50(%rsp), %rsi
callq 0xec893
testq %rax, %rax
je 0x1820e6
movq %rax, %r14
leaq 0x1ea1df(%rip), %rsi    # 0x36c1f9
movq %r13, %rdi
callq 0x11acf3
movq (%rbx), %rsi
movq %r14, %rdi
callq 0x10702c
movq %r13, %rdi
movq %rax, %rsi
callq 0x11acf3
movq %r13, %rdi
movl $0x3a, %esi
callq 0x11af23
movq %r14, %rdi
callq 0x106f84
movq %r15, %r14
movq 0x8(%rsp), %r15
movq 0x10(%rbp), %rdi
callq 0xec569
xorl %edx, %edx
testb %al, %al
je 0x182102
cmpb $0x1, 0x103(%rbp)
jne 0x182102
movq %r15, %rbp
xorl %r15d, %r15d
leaq 0xd0(%rsp), %r14
movq %r15, (%r14)
movq (%rsp), %rax
movq 0x10(%rax), %rdi
movq (%rbx), %rdx
movq %r14, %rsi
callq 0xec19e
subq (%r14), %r15
movq $-0x1, %rcx
leaq 0x1(%rcx), %rdx
cmpb $0x20, 0x1(%rax,%rcx)
je 0x1820ba
addq %r15, %rcx
cmpq $-0x1, %rcx
movq %rdx, %rcx
jne 0x1820a3
movq %r13, %rdi
movq %rax, %rsi
callq 0x11ae1b
movl $0x0, 0x8(%rsp)
movq 0x10(%rsp), %r14
movq %rbp, %r15
jmp 0x182120
movq $0x0, (%r12)
xorl %eax, %eax
jmp 0x182335
movq %r13, %rdi
callq 0x11bdbf
xorl %edi, %edi
callq 0x106f84
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r15, %r14
movq 0x8(%rsp), %r15
movl %edx, 0x8(%rsp)
leaq 0x1d0fdd(%rip), %rsi    # 0x3530ea
movq %r13, %rdi
callq 0x11acf3
movq (%rbx), %rsi
movq %r13, %rdi
callq 0x11ae72
movq %r13, 0x18(%rsp)
movq 0x8(%rbx), %rax
movq 0x38(%rbx), %rcx
leaq (%r15,%rcx), %rdx
negq %rdx
addq %rax, %rdx
incq %rdx
movq 0x48(%rbx), %rax
subq %r15, %rcx
addq %rax, %rcx
incq %rcx
leaq 0x214817(%rip), %rsi    # 0x396965
movq %r13, %rdi
movl $0x3, %r8d
callq 0x1422f4
movq %r15, %rbp
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x141fb5
movq %r15, (%r12)
movq (%rsp), %rax
cmpq $0x2, 0x108(%rax)
jb 0x182211
movq 0x8(%rbx), %rcx
subq %rbp, %rcx
movq %rcx, %rdx
subq 0x38(%rbx), %rdx
incq %rdx
movq %r14, %r13
leaq 0x2147d5(%rip), %rsi    # 0x396973
movq 0x18(%rsp), %r14
movq %r14, %rdi
movl $0x3, %r8d
callq 0x1422f4
movq %rax, %r12
movq %rax, %rdi
movq %r13, %rsi
callq 0x141fb5
movq %r15, %rdi
movq %r12, %rsi
callq 0x14275f
movq 0x38(%rbx), %rax
movq 0x48(%rbx), %rdx
subq %rbp, %rdx
leaq (%rdx,%rax), %rcx
incq %rcx
addq $0x2, %rdx
movq %r14, %rdi
leaq 0x214789(%rip), %rsi    # 0x396973
movl $0x3, %r8d
callq 0x1422f4
movq %rax, %r14
movq %rax, %rdi
movq %r13, %rsi
callq 0x141fb5
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %r14
callq 0x14275f
movq 0x8(%rbx), %rdx
movq 0x48(%rbx), %rcx
subq %rbp, %rdx
incq %rdx
subq %rbp, %rcx
incq %rcx
leaq 0x1db9ec(%rip), %rsi    # 0x35dc18
movq 0x18(%rsp), %r13
movq %r13, %rdi
movl $0x3, %r8d
callq 0x1422f4
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
callq 0x141fb5
movq %r15, %rdi
movq %r12, %rsi
callq 0x14275f
movsd 0x28(%rbx), %xmm0
leaq 0x1f515d(%rip), %rdx    # 0x3773c1
leaq 0xd0(%rsp), %r14
movl $0x1fff, %esi           # imm = 0x1FFF
movq %r14, %rdi
movb $0x1, %al
callq 0x17c60
leaq 0x214709(%rip), %rsi    # 0x39698b
movq %r12, %rdi
movq %r14, %rdx
callq 0x142a0f
movq 0x8(%rbx), %rdx
movq 0x10(%rbx), %rcx
subq %rbp, %rdx
incq %rdx
subq %rbp, %rcx
incq %rcx
leaq 0x2146f2(%rip), %rsi    # 0x39699a
movq %r13, %rdi
movl $0x3, %r8d
callq 0x1422f4
movq %rax, %r15
movq %rax, %rdi
movq 0x10(%rsp), %r14
movq %r14, %rsi
callq 0x141fb5
movq %r12, %rdi
movq %r15, %rsi
callq 0x14275f
movq 0x40(%rbx), %rdx
movq 0x48(%rbx), %rcx
subq %rbp, %rdx
incq %rdx
subq %rbp, %rcx
incq %rcx
movq %r13, %rdi
leaq 0x2146a8(%rip), %rsi    # 0x39699a
movl $0x3, %r8d
callq 0x1422f4
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
callq 0x141fb5
movq %r12, %rdi
movq %rbx, %rsi
callq 0x14275f
movq %r13, %rdi
callq 0x11bdbf
movq %r14, %rdi
callq 0x11bdbf
movq (%rsp), %rax
incq 0xa0(%rax)
movl 0x8(%rsp), %eax
addq $0x20d8, %rsp           # imm = 0x20D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
callq 0x11bdbf
xorl %edi, %edi
callq 0x106f84
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x182335
callq 0x5822a
callq 0x582d5
callq 0x5829c
callq 0x58062
callq 0x58146
callq 0x5817f
callq 0x581b8
callq 0x581f1
callq 0x580d4
callq 0x5810d
callq 0x58347
callq 0x5830e
callq 0x58263
callq 0x5809b