// File: /workspace/github_c_makefile_star2_O1/jsh58[P]Genrich/Genrich.c
// Function: callPeaksLog
void callPeaksLog(File in, bool gz, File out, bool gzOut,
    char* line, int xcount, char** xchrList, int xBedLen,
    Bed* xBed, float minPQval, bool qvalOpt, int minLen,
    int maxGap, float minAUC, uint64_t genomeLen,
    bool verbose) {
  // determine index of fields ([pq]-value) to analyze
  int idxQ = -1;
  int idxP = getIdx(in, gz, line, qvalOpt, &idxQ);

  // initialize variables for genomic regions to be excluded
  uint32_t* bed = NULL;         // array of BED coordinates
  int bedLen = 0;               // length of bed array
  int bedIdx = 0;               // index into bed array
  uint32_t bedPos = UINT32_MAX; // next coordinate
  bool save = true;             // status of current interval
  bool warn = false;            // warn of new skipped regions?

  // initialize counting variables
  int count = 0;
  uint64_t peakBP = 0;
  bool genomeOpt = genomeLen == 0;

  // initialize peak variables
  float auc = 0.0f;                     // area under the curve (signif.)
  int64_t peakStart = -1, peakEnd = -1; // ends of potential peak
  float summitVal = -1.0f;              // summit p/q value
  uint32_t summitPos = 0;               // distance from peakStart to summit
  uint32_t summitLen = 0;               // length of summit interval
  float summitPval = -1.0f, summitQval = -1.0f; // summit p- and q-values

  // parse bedgraph records
  char prev[MAX_ALNS];              // previous chrom name
  prev[0] = '\0';
  bool skip = false;                // skip current chrom?
  char* chr, *stat, *pStat, *qStat; // chrom and stats/NA of current interval
  uint32_t start, end;              // coordinates of current interval
  float pqval;                      // [pq]-value of current interval
  while (getLine(line, MAX_SIZE, in, gz) != NULL) {

    // load fields from bedgraph record
    loadBDG(line, &chr, &start, &end, &pStat, idxP,
      &qStat, idxQ, qvalOpt);

    // new chromosome
    if (strcmp(prev, chr)) {
      // check if previous chrom's last peak is valid
      checkPeak(out, gzOut, prev, peakStart, peakEnd,
        &count, auc, summitPval, summitQval, summitPos,
        minAUC, minLen, &peakBP);

      // reset peak variables
      resetVars(&peakStart, &summitVal, &summitLen, &auc);

      // check if new chrom should be skipped
      skip = checkChrom(chr, xcount, xchrList);
      if (verbose && skip) {
        fprintf(stderr, "Warning! Skipping chromosome %s --\n  ", chr);
        fprintf(stderr, "Reads aligning to it were used in the background");
        fprintf(stderr, " pileup calculation,\n  and its length was included");
        fprintf(stderr, " in the genome length %scalculation\n",
          qvalOpt ? "(and q-value) " : "");
      }

      // check for regions to be skipped
      bedLen = 0;
      if (! skip) {
        // load regions from xBed
        // (note: cannot check validity of coordinates)
        saveXBed(chr, UINT32_MAX, &bedLen, &bed, xBedLen,
          xBed, verbose);

        // load next coordinate
        bedIdx = 0;
        bedPos = bedIdx < bedLen ? bed[bedIdx]
          : UINT32_MAX;
        save = true;
      }

      strcpy(prev, chr);  // update current chrom
    }
    if (skip)
      continue; // current chrom to be skipped

    // check stat for 'NA' (skipped region)
    stat = qvalOpt ? qStat : pStat;
    if (!strcmp(stat, NA)) {
      // check if previous peak is valid
      checkPeak(out, gzOut, chr, peakStart, peakEnd,
        &count, auc, summitPval, summitQval, summitPos,
        minAUC, minLen, &peakBP);

      // reset peak variables
      resetVars(&peakStart, &summitVal, &summitLen, &auc);
      continue;
    }
    pqval = getFloat(stat);

    // check if current interval starts at a position
    //   to be skipped (new -E)
    if (bedPos == start) {
      if (save) {
        // check if previous peak is valid
        checkPeak(out, gzOut, chr, peakStart, peakEnd,
          &count, auc, summitPval, summitQval, summitPos,
          minAUC, minLen, &peakBP);
        // reset peak variables
        resetVars(&peakStart, &summitVal, &summitLen, &auc);
      }

      // load next coordinate
      save = ! save;
      bedIdx++;
      bedPos = bedIdx < bedLen ? bed[bedIdx] : UINT32_MAX;
    }

    // check if current interval contains the next position
    //   to be skipped (new -E)
    uint32_t subStart = start;  // start of current subinterval
    while (bedPos > start && bedPos < end) {

      if (save) {
        // interval *not* to be skipped:
        //   update peak if necessary, then print if valid
        if (pqval > minPQval) {
          // interval reaches significance
          updatePeak(&peakStart, &peakEnd, subStart,
            bedPos, &auc, pqval, minPQval,
            qvalOpt ? getFloat(pStat) : pqval,
            qvalOpt ? pqval : SKIP,
            &summitVal, &summitPval, &summitQval,
            &summitPos, &summitLen);
        }
        // check if peak is valid
        checkPeak(out, gzOut, chr, peakStart, peakEnd,
          &count, auc, summitPval, summitQval, summitPos,
          minAUC, minLen, &peakBP);
        // reset peak variables
        resetVars(&peakStart, &summitVal, &summitLen, &auc);
        if (genomeOpt)
          genomeLen += bedPos - subStart; // update genome length
      } else
        warn = true;

      // load next coordinate
      subStart = bedPos;
      save = ! save;
      bedIdx++;
      bedPos = bedIdx < bedLen ? bed[bedIdx] : UINT32_MAX;
    }
    if (! save) {
      warn = true;
      continue;
    }
    start = subStart; // reset start coordinate

    // check [pq]-value for significance
    if (genomeOpt)
      genomeLen += end - start; // update genome length
    if (pqval > minPQval) {

      // interval reaches significance
      updatePeak(&peakStart, &peakEnd, start, end,
        &auc, pqval, minPQval,
        qvalOpt ? getFloat(pStat) : pqval,
        qvalOpt ? pqval : SKIP,
        &summitVal, &summitPval, &summitQval,
        &summitPos, &summitLen);

    } else {

      // interval does not reach significance --
      //   check if distance is beyond maxGap from peak
      if (end - peakEnd > maxGap) {
        // check if previous peak is valid
        checkPeak(out, gzOut, chr, peakStart, peakEnd,
          &count, auc, summitPval, summitQval, summitPos,
          minAUC, minLen, &peakBP);

        // reset peak variables
        resetVars(&peakStart, &summitVal, &summitLen, &auc);
      }
    }

  }

  // check if last peak is valid
  checkPeak(out, gzOut, chr, peakStart, peakEnd,
    &count, auc, summitPval, summitQval, summitPos,
    minAUC, minLen, &peakBP);

  if (verbose) {
    if (warn) {
      fprintf(stderr, "Warning! Skipping given BED regions --\n  ");
      fprintf(stderr, "Reads aligning to them were used in the background");
      fprintf(stderr, " pileup calculation,\n  and the lengths were included");
      fprintf(stderr, " in the genome length %scalculation\n",
        qvalOpt ? "(and q-value) " : "");
    }
    fprintf(stderr, "Peak-calling parameters:\n");
    fprintf(stderr, "  Genome length: %ldbp\n", genomeLen);
    fprintf(stderr, "  Significance threshold: -log(%c) > %.3f\n",
      qvalOpt ? 'q' : 'p', minPQval);
    fprintf(stderr, "  Min. AUC: %.3f\n", minAUC);
    if (minLen)
      fprintf(stderr, "  Min. peak length: %dbp\n", minLen);
    fprintf(stderr, "  Max. gap between sites: %dbp\n", maxGap);
    fprintf(stderr, "Peaks identified: %d (%ldbp)\n",
      count, peakBP);
  }

  free(bed);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
movss %xmm1, 0x48(%rsp)
movss %xmm0, 0x74(%rsp)
movl %r9d, %ebx
movl %ecx, 0x60(%rsp)
movq %rdx, 0x90(%rsp)
movq 0x220(%rsp), %r14
leaq 0x12c(%rsp), %r15
movl $0xffffffff, (%r15)     # imm = 0xFFFFFFFF
movzbl 0x208(%rsp), %ebp
movq %rdi, 0xf0(%rsp)
movl %esi, 0xe0(%rsp)
movq %r8, 0xc0(%rsp)
movq %r8, %rdx
movl %ebp, %ecx
movq %r15, %r8
callq 0x5fd3
movl %eax, 0xdc(%rsp)
leaq 0xa8(%rsp), %rax
movq $0x0, (%rax)
leaq 0x78(%rsp), %rax
movl $0x0, (%rax)
leaq 0x130(%rsp), %rax
movb $0x0, (%rax)
movl (%r15), %eax
movl %eax, 0xd8(%rsp)
movslq 0x210(%rsp), %rax
movq %rax, 0xa0(%rsp)
testl %ebx, %ebx
setg 0x4f(%rsp)
movl %ebx, 0xd4(%rsp)
movl %ebx, %ebx
leaq 0xd4d0(%rip), %rax      # 0x13760
leaq 0xd934(%rip), %rcx      # 0x13bcb
movl %ebp, 0x8c(%rsp)
testb %bpl, %bpl
cmovneq %rax, %rcx
movq %rcx, 0x110(%rsp)
movslq 0x218(%rsp), %rax
movq %rax, 0x108(%rsp)
movl $0xffffffff, 0x98(%rsp) # imm = 0xFFFFFFFF
movb $0x1, 0x27(%rsp)
movss 0xbe83(%rip), %xmm0     # 0x12158
movq $-0x1, %r12
xorps %xmm6, %xmm6
movq $0x0, 0x58(%rsp)
movaps %xmm0, %xmm3
movss %xmm0, 0x50(%rsp)
movss %xmm0, 0x2c(%rsp)
movq $0x0, 0x80(%rsp)
movq $-0x1, 0x38(%rsp)
movl $0x0, 0x34(%rsp)
xorl %ebp, %ebp
movq $0x0, 0x40(%rsp)
movq $0x0, 0xf8(%rsp)
movl $0x0, 0x64(%rsp)
movq %r14, 0x68(%rsp)
movss %xmm6, 0x28(%rsp)
movss %xmm3, 0x30(%rsp)
cmpb $0x0, 0xe0(%rsp)
je 0x636a
movq 0xf0(%rsp), %rdi
movq 0xc0(%rsp), %rsi
movl $0xfff0, %edx           # imm = 0xFFF0
callq 0x2090
jmp 0x6384
movq 0xc0(%rsp), %rdi
movl $0xfff0, %esi           # imm = 0xFFF0
movq 0xf0(%rsp), %rdx
callq 0x21a0
testq %rax, %rax
je 0x6d0b
movl 0x8c(%rsp), %eax
movl %eax, 0x10(%rsp)
movl 0xd8(%rsp), %eax
movl %eax, 0x8(%rsp)
leaq 0x118(%rsp), %rax
movq %rax, (%rsp)
movq 0xc0(%rsp), %rdi
leaq 0x100(%rsp), %rsi
leaq 0xb4(%rsp), %rdx
leaq 0xe4(%rsp), %rcx
leaq 0x120(%rsp), %r8
movl 0xdc(%rsp), %r9d
callq 0x60fe
movq 0x100(%rsp), %r15
leaq 0x130(%rsp), %rdi
movq %r15, %rsi
callq 0x21b0
testl %eax, %eax
je 0x64c7
movss 0x28(%rsp), %xmm0
ucomiss 0x48(%rsp), %xmm0
jb 0x6474
cmpq $-0x1, %r12
je 0x6474
movq 0x38(%rsp), %r8
movq %r8, %r14
subq %r12, %r14
cmpq 0xa0(%rsp), %r14
jl 0x6474
movl 0x34(%rsp), %eax
movl %eax, (%rsp)
movzbl 0x60(%rsp), %esi
movq 0x90(%rsp), %rdi
leaq 0x130(%rsp), %rdx
movq %r12, %rcx
movq 0x58(%rsp), %r12
movl %r12d, %r9d
movss 0x50(%rsp), %xmm1
movss 0x2c(%rsp), %xmm2
callq 0x536b
addq %r14, 0x80(%rsp)
incl %r12d
movq %r12, 0x58(%rsp)
movb 0x4f(%rsp), %al
movl %eax, %r14d
cmpl $0x0, 0xd4(%rsp)
movq 0x1f0(%rsp), %r12
jle 0x64e9
movq (%r12), %rdi
movq %r15, %rsi
callq 0x21b0
testl %eax, %eax
je 0x64e6
movl $0x1, %ecx
movq %rcx, %r14
cmpq %rcx, %rbx
je 0x64be
movq (%r12,%r14,8), %rdi
movq %r15, %rsi
callq 0x21b0
leaq 0x1(%r14), %rcx
testl %eax, %eax
jne 0x64a2
cmpq %rbx, %r14
setb %r14b
jmp 0x64e9
movss 0x28(%rsp), %xmm6
movaps %xmm6, %xmm1
movq %r12, %r13
movq 0xf8(%rsp), %r14
movss 0x30(%rsp), %xmm3
jmp 0x659a
movb $0x1, %r14b
movb 0x228(%rsp), %al
andb %r14b, %al
cmpb $0x1, %al
je 0x669c
movl $0x0, 0x78(%rsp)
testb $0x1, %r14b
jne 0x6570
movzbl 0x228(%rsp), %eax
movl %eax, (%rsp)
movq %r15, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
leaq 0x78(%rsp), %rdx
leaq 0xa8(%rsp), %rcx
movl 0x1f8(%rsp), %r8d
movq 0x200(%rsp), %r9
callq 0x5d5e
movl $0x0, 0x64(%rsp)
movb $0x1, 0x27(%rsp)
cmpl $0x0, 0x78(%rsp)
jle 0x6565
movq 0xa8(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x98(%rsp)
jmp 0x6570
movl $0xffffffff, 0x98(%rsp) # imm = 0xFFFFFFFF
leaq 0x130(%rsp), %rdi
movq %r15, %rsi
callq 0x2070
xorl %ebp, %ebp
movq $-0x1, %r13
xorps %xmm1, %xmm1
movss 0xbbc4(%rip), %xmm3     # 0x12158
movaps %xmm1, %xmm6
movq %r13, %r12
movq %r14, 0xf8(%rsp)
testb $0x1, %r14b
jne 0x6338
movss %xmm1, 0x28(%rsp)
movss %xmm3, 0x30(%rsp)
movq 0x120(%rsp), %r14
movq %r14, %r12
cmpb $0x0, 0x208(%rsp)
je 0x65d5
movq 0x118(%rsp), %r12
movq %r12, %rdi
leaq 0xced4(%rip), %rsi      # 0x134b3
callq 0x21b0
testl %eax, %eax
jne 0x66b1
xorl %ebp, %ebp
movss 0x28(%rsp), %xmm1
ucomiss 0x48(%rsp), %xmm1
movq $-0x1, %r12
xorps %xmm6, %xmm6
movss 0xbb4d(%rip), %xmm3     # 0x12158
jb 0x6338
movss 0xbb3f(%rip), %xmm3     # 0x12158
cmpq $-0x1, %r13
je 0x6338
movq 0x38(%rsp), %r14
subq %r13, %r14
movss 0xbb25(%rip), %xmm3     # 0x12158
cmpq 0xa0(%rsp), %r14
jl 0x6338
movl 0x34(%rsp), %eax
movl %eax, (%rsp)
movzbl 0x60(%rsp), %esi
movq 0x90(%rsp), %rdi
movq %r15, %rdx
movq %r13, %rcx
movq 0x38(%rsp), %r8
movq 0x58(%rsp), %r15
movl %r15d, %r9d
movaps %xmm1, %xmm0
movss 0x50(%rsp), %xmm1
movss 0x2c(%rsp), %xmm2
callq 0x536b
xorps %xmm6, %xmm6
addq %r14, 0x80(%rsp)
incl %r15d
movq %r15, 0x58(%rsp)
movss 0xbac1(%rip), %xmm3     # 0x12158
jmp 0x6338
movq %r15, %rdi
movq 0x110(%rsp), %rsi
callq 0x2b4a
jmp 0x64fb
movq %r12, %rdi
callq 0x3927
movaps %xmm0, %xmm4
movl 0xb4(%rsp), %r10d
movl 0x98(%rsp), %esi
cmpl %r10d, %esi
movss %xmm0, 0x7c(%rsp)
movl %r10d, 0x88(%rsp)
movq %r14, 0xe8(%rsp)
jne 0x67a6
testb $0x1, 0x27(%rsp)
movl 0x64(%rsp), %edx
movq 0x38(%rsp), %r8
movss 0x30(%rsp), %xmm3
movss 0x28(%rsp), %xmm0
je 0x67bb
xorl %ebp, %ebp
ucomiss 0x48(%rsp), %xmm0
movq $-0x1, %r9
xorps %xmm5, %xmm5
jb 0x67c3
cmpq $-0x1, %r13
je 0x67c3
movq %r8, %r14
subq %r13, %r14
cmpq 0xa0(%rsp), %r14
jl 0x679a
movl 0x34(%rsp), %eax
movl %eax, (%rsp)
movzbl 0x60(%rsp), %esi
movq 0x90(%rsp), %rdi
movq %r15, %rdx
movq %r13, %rcx
movq 0x58(%rsp), %r12
movl %r12d, %r9d
movss 0x50(%rsp), %xmm1
movss 0x2c(%rsp), %xmm2
callq 0x536b
movl 0x88(%rsp), %r10d
xorps %xmm5, %xmm5
movq $-0x1, %r9
movss 0x7c(%rsp), %xmm4
addq %r14, 0x80(%rsp)
incl %r12d
movq %r12, 0x58(%rsp)
movl 0x64(%rsp), %edx
movss 0xb9b6(%rip), %xmm3     # 0x12158
xorl %ebp, %ebp
jmp 0x67cb
movss 0x28(%rsp), %xmm5
movq %r13, %r9
movl 0x64(%rsp), %edx
movss 0x30(%rsp), %xmm3
jmp 0x67eb
movaps %xmm0, %xmm5
movq %r13, %r9
jmp 0x67cb
movss 0xb98d(%rip), %xmm3     # 0x12158
xorb $0x1, 0x27(%rsp)
incl %edx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
cmpl 0x78(%rsp), %edx
jge 0x67eb
movq 0xa8(%rsp), %rax
movslq %edx, %rcx
movl (%rax,%rcx,4), %esi
movl 0xe4(%rsp), %eax
movl %eax, %edi
cmpl %r10d, %esi
seta %cl
cmpl %eax, %esi
setb %al
andb %cl, %al
cmpb $0x1, %al
movq %rdi, 0xb8(%rsp)
movl %edx, 0x64(%rsp)
jne 0x6a7a
movaps %xmm4, %xmm0
subss 0x74(%rsp), %xmm0
movss %xmm0, 0xd0(%rsp)
movslq 0x78(%rsp), %r8
movq 0xa8(%rsp), %rax
movq %rax, 0x98(%rsp)
movslq %edx, %r12
incq %r12
movl %r10d, %r13d
movq 0x40(%rsp), %rax
movb %al, 0x28(%rsp)
movq %r8, 0x40(%rsp)
movl %esi, %r11d
testb $0x1, 0x27(%rsp)
je 0x6926
ucomiss 0x74(%rsp), %xmm4
jbe 0x6930
movss 0xb8e4(%rip), %xmm2     # 0x12158
movaps %xmm4, %xmm1
cmpb $0x0, 0x208(%rsp)
je 0x68e1
movq 0xe8(%rsp), %rdi
movss %xmm3, 0x30(%rsp)
movq %r9, %r14
movss %xmm5, 0x38(%rsp)
movl %ebp, 0xcc(%rsp)
movq %r11, %rbp
callq 0x3927
movq 0x40(%rsp), %r8
movq %rbp, %r11
movl 0xcc(%rsp), %ebp
movl 0x88(%rsp), %r10d
movq 0xb8(%rsp), %rdi
movss 0x38(%rsp), %xmm5
movq %r14, %r9
movss 0x7c(%rsp), %xmm4
movss 0x30(%rsp), %xmm3
movaps %xmm0, %xmm1
movaps %xmm4, %xmm2
movl %r11d, %eax
subl %r13d, %eax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
mulss 0xd0(%rsp), %xmm0
cmpq $-0x1, %r9
movl %r13d, %ecx
cmovneq %r9, %rcx
addss %xmm5, %xmm0
movl %r11d, %edx
movq %rdx, 0x38(%rsp)
ucomiss %xmm3, %xmm4
jbe 0x6a52
leal (%r11,%r13), %eax
shrl %eax
subl %ecx, %eax
movl %eax, 0x34(%rsp)
jmp 0x6942
movb $0x1, 0x28(%rsp)
jmp 0x6a1e
movaps %xmm5, %xmm0
movq %r9, %rcx
movss 0x50(%rsp), %xmm1
movss 0x2c(%rsp), %xmm2
ucomiss 0x48(%rsp), %xmm0
jb 0x69e8
cmpq $-0x1, %rcx
je 0x69e8
movq 0x38(%rsp), %r8
movq %r8, %r14
subq %rcx, %r14
cmpq 0xa0(%rsp), %r14
jl 0x69e3
movl 0x34(%rsp), %eax
movl %eax, (%rsp)
movzbl 0x60(%rsp), %esi
movq 0x90(%rsp), %rdi
movq %r15, %rdx
movq 0x58(%rsp), %rbp
movl %ebp, %r9d
movss %xmm1, 0x30(%rsp)
movss 0x30(%rsp), %xmm1
movss %xmm2, 0x2c(%rsp)
movss 0x2c(%rsp), %xmm2
movq %r11, 0x50(%rsp)
callq 0x536b
movss 0x2c(%rsp), %xmm2
movss 0x30(%rsp), %xmm1
movq 0x50(%rsp), %r11
movl 0x88(%rsp), %r10d
movq 0xb8(%rsp), %rdi
movss 0x7c(%rsp), %xmm4
addq %r14, 0x80(%rsp)
incl %ebp
movq %rbp, 0x58(%rsp)
movq 0x40(%rsp), %r8
xorl %ebp, %ebp
movq $-0x1, %r9
xorps %xmm5, %xmm5
cmpq $0x0, 0x220(%rsp)
jne 0x6a0a
movl %r11d, %eax
subl %r13d, %eax
addq %rax, 0x68(%rsp)
movss 0xb746(%rip), %xmm3     # 0x12158
movss %xmm1, 0x50(%rsp)
movss %xmm2, 0x2c(%rsp)
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
cmpq %r8, %r12
jge 0x6a34
movq 0x98(%rsp), %rax
movl (%rax,%r12,4), %esi
xorb $0x1, 0x27(%rsp)
incl 0x64(%rsp)
cmpl %r10d, %esi
jbe 0x6a86
incq %r12
movl %r11d, %r13d
cmpl %edi, %esi
jb 0x6853
jmp 0x6a86
ucomiss %xmm4, %xmm3
jne 0x6936
jp 0x6936
cmpl %ebp, %eax
jbe 0x6936
leal (%r11,%r13), %eax
shrl %eax
subl %ecx, %eax
movl %eax, 0x34(%rsp)
jmp 0x6936
movq 0x40(%rsp), %rax
movb %al, 0x28(%rsp)
movl %r10d, %r11d
movl %esi, 0x98(%rsp)
movb $0x1, %al
movq %rax, 0x40(%rsp)
movaps %xmm5, %xmm6
movq %r9, %r12
testb $0x1, 0x27(%rsp)
je 0x6338
movl %edi, %r13d
subl %r11d, %r13d
cmpq $0x0, 0x220(%rsp)
movl $0x0, %ecx
cmoveq %r13, %rcx
movl %r11d, 0xb4(%rsp)
addq 0x68(%rsp), %rcx
ucomiss 0x74(%rsp), %xmm4
jbe 0x6b8c
movss 0xb67b(%rip), %xmm1     # 0x12158
movaps %xmm4, %xmm0
cmpb $0x0, 0x208(%rsp)
je 0x6b32
movq 0xe8(%rsp), %rdi
movss %xmm3, 0x30(%rsp)
movq %r9, %r14
movss %xmm5, 0x38(%rsp)
movq %r11, %r15
movq %rcx, %r12
callq 0x3927
movq %r12, %rcx
movq %r15, %r11
movq 0xb8(%rsp), %rdi
movss 0x38(%rsp), %xmm5
movq %r14, %r9
movss 0x7c(%rsp), %xmm4
movss 0x30(%rsp), %xmm3
movaps %xmm4, %xmm1
movl %r13d, %eax
xorps %xmm2, %xmm2
cvtsi2ss %rax, %xmm2
movaps %xmm4, %xmm6
subss 0x74(%rsp), %xmm6
mulss %xmm2, %xmm6
addss %xmm5, %xmm6
cmpq $-0x1, %r9
movl %r11d, %r12d
cmovneq %r9, %r12
ucomiss %xmm3, %xmm4
jbe 0x6ca4
addl %edi, %r11d
shrl %r11d
subl %r12d, %r11d
movq %rdi, 0x38(%rsp)
movaps %xmm4, %xmm3
movl %r11d, 0x34(%rsp)
movl %r13d, %ebp
movss %xmm0, 0x50(%rsp)
movss %xmm1, 0x2c(%rsp)
jmp 0x6cf8
subq 0x38(%rsp), %rdi
movaps %xmm5, %xmm6
movq %r9, %r12
movb 0x28(%rsp), %al
movq %rax, 0x40(%rsp)
movq %rcx, 0x68(%rsp)
cmpq 0x108(%rsp), %rdi
jle 0x6338
ucomiss 0x48(%rsp), %xmm5
xorps %xmm6, %xmm6
movq $-0x1, %r12
movss 0xb58e(%rip), %xmm3     # 0x12158
movl $0x0, %ebp
movb 0x28(%rsp), %al
movq %rax, 0x40(%rsp)
movq %rcx, 0x68(%rsp)
jb 0x6338
movss 0xb56d(%rip), %xmm3     # 0x12158
movb 0x28(%rsp), %al
movq %rax, 0x40(%rsp)
movq %rcx, 0x68(%rsp)
cmpq $-0x1, %r9
je 0x6338
movq 0x38(%rsp), %r13
subq %r9, %r13
movss 0xb545(%rip), %xmm3     # 0x12158
movb 0x28(%rsp), %al
movq %rax, 0x40(%rsp)
movq %rcx, 0x68(%rsp)
cmpq 0xa0(%rsp), %r13
jl 0x6338
movl 0x34(%rsp), %eax
movl %eax, (%rsp)
movzbl 0x60(%rsp), %esi
movq 0x90(%rsp), %rdi
movq %r15, %rdx
movq %rcx, %r15
movq %r9, %rcx
movq 0x38(%rsp), %r8
movq 0x58(%rsp), %r14
movl %r14d, %r9d
movaps %xmm5, %xmm0
movss 0x50(%rsp), %xmm1
movss 0x2c(%rsp), %xmm2
callq 0x536b
addq %r13, 0x80(%rsp)
incl %r14d
movq %r14, 0x58(%rsp)
xorps %xmm6, %xmm6
movq $-0x1, %r12
movss 0xb4c9(%rip), %xmm3     # 0x12158
xorl %ebp, %ebp
movb 0x28(%rsp), %al
movq %rax, 0x40(%rsp)
movq %r15, 0x68(%rsp)
jmp 0x6338
ucomiss %xmm4, %xmm3
movq %rdi, 0x38(%rsp)
movb 0x28(%rsp), %al
movq %rax, 0x40(%rsp)
movq %rcx, 0x68(%rsp)
jne 0x6338
jp 0x6338
movq %rdi, 0x38(%rsp)
movb 0x28(%rsp), %al
movq %rax, 0x40(%rsp)
movq %rcx, 0x68(%rsp)
cmpl %ebp, %r13d
jbe 0x6338
addl %edi, %r11d
shrl %r11d
subl %r12d, %r11d
movq %rdi, 0x38(%rsp)
movl %r11d, 0x34(%rsp)
movl %r13d, %ebp
movb 0x28(%rsp), %al
movq %rax, 0x40(%rsp)
movq %rcx, 0x68(%rsp)
jmp 0x6338
movss 0x28(%rsp), %xmm0
ucomiss 0x48(%rsp), %xmm0
jb 0x6d7b
cmpq $-0x1, %r12
je 0x6d7b
movq 0x38(%rsp), %r8
movq %r8, %rbx
subq %r12, %rbx
cmpq 0xa0(%rsp), %rbx
jl 0x6d7b
movq 0x100(%rsp), %rdx
movl 0x34(%rsp), %eax
movl %eax, (%rsp)
movzbl 0x60(%rsp), %esi
movq 0x90(%rsp), %rdi
movq %r12, %rcx
movq 0x58(%rsp), %r14
movl %r14d, %r9d
movss 0x50(%rsp), %xmm1
movss 0x2c(%rsp), %xmm2
callq 0x536b
addq %rbx, 0x80(%rsp)
incl %r14d
movq %r14, 0x58(%rsp)
cmpb $0x0, 0x228(%rsp)
jne 0x6da4
movq 0xa8(%rsp), %rdi
callq 0x2040
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testb $0x1, 0x40(%rsp)
je 0x6db7
movl 0x8c(%rsp), %edi
callq 0x2bb5
movq 0x1323a(%rip), %rbx     # 0x19ff8
movq (%rbx), %rcx
leaq 0xc743(%rip), %rdi      # 0x1350b
movl $0x19, %esi
movl $0x1, %edx
callq 0x22b0
movq (%rbx), %rdi
leaq 0xc744(%rip), %rsi      # 0x13525
movq 0x68(%rsp), %rdx
xorl %eax, %eax
callq 0x21d0
movq (%rbx), %rdi
movl 0x8c(%rsp), %edx
orl $0x70, %edx
xorps %xmm0, %xmm0
cvtss2sd 0x74(%rsp), %xmm0
leaq 0xc733(%rip), %rsi      # 0x1353d
movb $0x1, %al
callq 0x21d0
movq (%rbx), %rdi
xorps %xmm0, %xmm0
cvtss2sd 0x48(%rsp), %xmm0
leaq 0xc744(%rip), %rsi      # 0x13568
movb $0x1, %al
callq 0x21d0
movl 0x210(%rsp), %edx
testl %edx, %edx
je 0x6e47
movq (%rbx), %rdi
leaq 0xc73a(%rip), %rsi      # 0x1357a
xorl %eax, %eax
callq 0x21d0
movq (%rbx), %rdi
leaq 0xc743(%rip), %rsi      # 0x13594
movl 0x218(%rsp), %edx
xorl %eax, %eax
callq 0x21d0
movq (%rbx), %rdi
leaq 0xc765(%rip), %rsi      # 0x135ce
movq 0x58(%rsp), %rdx
movq 0x80(%rsp), %rcx
xorl %eax, %eax
callq 0x21d0
jmp 0x6d85