// File: /workspace/github_c_makefile_star2_O2/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 $0x1a8, %rsp            # imm = 0x1A8
movss %xmm1, 0x14(%rsp)
movss %xmm0, 0x5c(%rsp)
movl %r9d, 0xa4(%rsp)
movq %r8, %rbx
movl %ecx, 0xb0(%rsp)
movq %rdx, 0x78(%rsp)
movq 0x210(%rsp), %r12
leaq 0x11c(%rsp), %r15
orl $-0x1, (%r15)
movzbl 0x1f8(%rsp), %r14d
movq %rdi, 0xf8(%rsp)
movl %esi, 0xac(%rsp)
movq %r8, %rdx
movl %r14d, %ecx
movq %r15, %r8
callq 0x4c62
leaq 0x80(%rsp), %rcx
andq $0x0, (%rcx)
leaq 0x74(%rsp), %rcx
andl $0x0, (%rcx)
leaq 0x34(%rsp), %rcx
andl $0x0, (%rcx)
leaq 0x68(%rsp), %rcx
andq $0x0, (%rcx)
movl %eax, 0xa8(%rsp)
leaq 0x120(%rsp), %rax
movb $0x0, (%rax)
leaq 0xc7bc(%rip), %rax      # 0x116b0
leaq 0xcc14(%rip), %rcx      # 0x11b0f
movq %r14, 0xe0(%rsp)
testb %r14b, %r14b
cmovneq %rax, %rcx
movq %rcx, 0xc0(%rsp)
movl (%r15), %eax
movq %rax, 0xf0(%rsp)
movslq 0x208(%rsp), %rax
movq %rax, 0xd8(%rsp)
pushq $-0x1
popq %rax
movb $0x1, %dl
movss 0xb22e(%rip), %xmm5     # 0x10168
pushq $-0x1
popq %rcx
xorps %xmm6, %xmm6
movaps %xmm5, %xmm7
movaps %xmm5, %xmm1
movl $0x0, 0x70(%rsp)
movq %rcx, %r9
movq %rcx, 0x28(%rsp)
movq $0x0, 0x50(%rsp)
xorl %r8d, %r8d
xorl %ecx, %ecx
movl %eax, %edi
xorl %esi, %esi
movq %r12, 0x60(%rsp)
movq %rcx, 0x38(%rsp)
movl %r8d, 0x20(%rsp)
movq %rdi, 0x48(%rsp)
movl %esi, 0x1c(%rsp)
movss %xmm5, 0xc(%rsp)
movss %xmm1, 0x10(%rsp)
movb %dl, 0xb(%rsp)
xorl %r12d, %r12d
movq %r9, %r14
movss %xmm7, 0x24(%rsp)
movss %xmm6, 0x18(%rsp)
movq 0xe0(%rsp), %r13
movzbl 0xac(%rsp), %ecx
movq %rbx, %rdi
movl $0xfff0, %esi           # imm = 0xFFF0
movq 0xf8(%rsp), %rdx
callq 0x283f
movzbl 0xb0(%rsp), %ebp
subq $0x8, %rsp
testq %rax, %rax
je 0x58bb
movq %rbx, %rdi
leaq 0x118(%rsp), %rsi
leaq 0x94(%rsp), %rdx
leaq 0xbc(%rsp), %rcx
leaq 0x110(%rsp), %r8
movl 0xb0(%rsp), %r9d
pushq %r13
pushq 0x100(%rsp)
leaq 0x118(%rsp), %rax
pushq %rax
callq 0x4d78
addq $0x20, %rsp
movq 0x110(%rsp), %r15
leaq 0x120(%rsp), %rdi
movq %r15, %rsi
callq 0x21a0
testl %eax, %eax
jne 0x5050
testb $0x1, %r12b
movb $0x1, %r12b
jne 0x4faa
jmp 0x51ed
subq $0x8, %rsp
movq 0x80(%rsp), %rdi
movl %ebp, %esi
leaq 0x128(%rsp), %rdx
movq %r14, %rcx
movq 0x30(%rsp), %r8
leaq 0x3c(%rsp), %r9
movss 0x20(%rsp), %xmm0
movss 0x18(%rsp), %xmm1
movss 0x14(%rsp), %xmm2
movss 0x1c(%rsp), %xmm3
leaq 0x70(%rsp), %rax
pushq %rax
movl 0x210(%rsp), %eax
pushq %rax
pushq 0x68(%rsp)
callq 0x4204
addq $0x20, %rsp
movq %r15, %rdi
movl 0xa4(%rsp), %esi
movq 0x1e0(%rsp), %rdx
callq 0x4c14
movl %eax, %r13d
movb 0x218(%rsp), %al
andb %r13b, %al
cmpb $0x1, %al
je 0x5182
andl $0x0, 0x74(%rsp)
movl $0x0, 0x20(%rsp)
movl $0x0, %ecx
testb $0x1, %r13b
jne 0x5150
subq $0x8, %rsp
movzbl 0x220(%rsp), %eax
movq %r15, %rdi
pushq $-0x1
popq %r14
movl %r14d, %esi
leaq 0x7c(%rsp), %rdx
leaq 0x88(%rsp), %rcx
movl 0x1f0(%rsp), %r8d
movq 0x1f8(%rsp), %r9
pushq %rax
callq 0x4a13
addq $0x10, %rsp
movl 0x74(%rsp), %ecx
movl $0x0, 0x1c(%rsp)
movb $0x1, 0xb(%rsp)
testl %ecx, %ecx
jle 0x5148
movq 0x80(%rsp), %rax
movl (%rax), %eax
jmp 0x514b
movl %r14d, %eax
movq %rax, 0x48(%rsp)
movl %ecx, 0x70(%rsp)
leaq 0x120(%rsp), %rdi
movq %r15, %rsi
callq 0x2070
movb $0x1, %r12b
xorps %xmm6, %xmm6
pushq $-0x1
popq %r9
movss 0xaff2(%rip), %xmm7     # 0x10168
testb $0x1, %r13b
jne 0x4f93
jmp 0x51fc
movq 0x11e6f(%rip), %r12     # 0x16ff8
movq (%r12), %rdi
leaq 0xc46d(%rip), %rsi      # 0x11601
movq %r15, %rdx
xorl %eax, %eax
callq 0x21c0
movq (%r12), %rcx
leaq 0xc47e(%rip), %rdi      # 0x11627
pushq $0x30
popq %rsi
pushq $0x1
popq %r14
movq %r14, %rdx
callq 0x22b0
movq (%r12), %rcx
leaq 0xc495(%rip), %rdi      # 0x11658
pushq $0x32
popq %rsi
movq %r14, %rdx
callq 0x22b0
movq (%r12), %rdi
leaq 0xc4b2(%rip), %rsi      # 0x1168b
movq 0xc0(%rsp), %rdx
xorl %eax, %eax
callq 0x21c0
jmp 0x50d2
movss 0x18(%rsp), %xmm6
movss 0x24(%rsp), %xmm7
movq %r14, %r9
movq 0x108(%rsp), %rax
movq %rax, %rdi
cmpb $0x0, 0x1f8(%rsp)
je 0x5219
movq 0x100(%rsp), %rdi
cmpb $0x4e, (%rdi)
movss 0x14(%rsp), %xmm3
movq 0x50(%rsp), %r12
movss 0x10(%rsp), %xmm1
movss 0xc(%rsp), %xmm2
jne 0x5297
cmpb $0x41, 0x1(%rdi)
jne 0x5297
cmpb $0x0, 0x2(%rdi)
jne 0x5297
subq $0x8, %rsp
movq 0x80(%rsp), %rdi
movl %ebp, %esi
movq %r15, %rdx
movq %r9, %rcx
movq 0x30(%rsp), %r8
leaq 0x3c(%rsp), %r9
movaps %xmm6, %xmm0
leaq 0x70(%rsp), %rax
pushq %rax
movl 0x210(%rsp), %eax
pushq %rax
pushq %r12
callq 0x4204
addq $0x20, %rsp
movl $0x0, 0x20(%rsp)
xorps %xmm6, %xmm6
pushq $-0x1
popq %r9
movss 0xaed6(%rip), %xmm7     # 0x10168
jmp 0x4f90
movq %rax, 0xb8(%rsp)
movq %r9, %r14
movss %xmm7, 0x24(%rsp)
movss %xmm6, 0x18(%rsp)
callq 0x279a
movaps %xmm0, %xmm8
movl 0x8c(%rsp), %ecx
movq 0x48(%rsp), %rax
movl %ecx, 0x90(%rsp)
cmpl %ecx, %eax
movss %xmm0, 0x44(%rsp)
jne 0x5365
movb 0xb(%rsp), %dl
testb $0x1, %dl
movl 0x20(%rsp), %r8d
movss 0x24(%rsp), %xmm7
je 0x53ad
subq $0x8, %rsp
movq 0x80(%rsp), %rdi
movl %ebp, %esi
movq %r15, %rdx
movq %r14, %rcx
movq 0x30(%rsp), %r8
leaq 0x3c(%rsp), %r9
movss 0x20(%rsp), %xmm0
movss 0x18(%rsp), %xmm1
movss 0x14(%rsp), %xmm2
movss 0x1c(%rsp), %xmm3
leaq 0x70(%rsp), %rax
pushq %rax
movl 0x210(%rsp), %eax
pushq %rax
pushq %r12
callq 0x4204
movss 0x64(%rsp), %xmm8
movb 0x2b(%rsp), %dl
addq $0x20, %rsp
xorl %r8d, %r8d
xorps %xmm6, %xmm6
pushq $-0x1
popq %r9
movss 0xae0c(%rip), %xmm7     # 0x10168
pushq $-0x1
popq %rcx
movl 0x1c(%rsp), %esi
jmp 0x53bd
movq 0x80(%rsp), %rcx
movq %rcx, 0xc8(%rsp)
movss 0x14(%rsp), %xmm3
pushq $-0x1
popq %rcx
movb 0xb(%rsp), %dl
movss 0x10(%rsp), %xmm1
movss 0xc(%rsp), %xmm5
movl 0x1c(%rsp), %esi
movl 0x20(%rsp), %r8d
movss 0x18(%rsp), %xmm6
movss 0x24(%rsp), %xmm7
movq %r14, %r9
movq 0x38(%rsp), %rdi
jmp 0x53fa
pushq $-0x1
popq %rcx
movl 0x1c(%rsp), %esi
movss 0x18(%rsp), %xmm6
movq %r14, %r9
movq 0x38(%rsp), %rdi
xorb $0x1, %dl
incl %esi
movq 0x80(%rsp), %r10
cmpl 0x70(%rsp), %esi
movq %r10, 0xc8(%rsp)
jge 0x53e6
movslq %esi, %rax
movl (%r10,%rax,4), %eax
jmp 0x53e8
movl %ecx, %eax
movss 0x14(%rsp), %xmm3
movss 0x10(%rsp), %xmm1
movss 0xc(%rsp), %xmm5
movl 0xb4(%rsp), %r10d
movaps %xmm8, %xmm0
subss 0x5c(%rsp), %xmm0
movss %xmm0, 0x88(%rsp)
movslq %esi, %r12
movslq 0x70(%rsp), %r11
movq %r11, 0xe8(%rsp)
incq %r12
movb %dil, 0x38(%rsp)
movl 0x90(%rsp), %edi
movl %edi, %r11d
movq %r10, 0x98(%rsp)
movl %eax, %edi
movl %r11d, %r13d
cmpl 0x90(%rsp), %eax
jbe 0x5687
cmpl %r10d, %edi
jae 0x5687
testb $0x1, %dl
je 0x556c
ucomiss 0x5c(%rsp), %xmm8
movb %dl, 0xb(%rsp)
movl %esi, 0x1c(%rsp)
movq %rdi, 0x48(%rsp)
jbe 0x5576
movss 0xace4(%rip), %xmm2     # 0x10168
movaps %xmm8, %xmm4
cmpb $0x0, 0x1f8(%rsp)
je 0x550c
movq 0xb8(%rsp), %rdi
movss %xmm1, 0x10(%rsp)
movss %xmm5, 0xc(%rsp)
movl %r8d, 0x20(%rsp)
movss %xmm6, 0x18(%rsp)
movss %xmm7, 0x24(%rsp)
movq %r9, 0xd0(%rsp)
movq %r11, 0x28(%rsp)
callq 0x279a
movq 0x28(%rsp), %r11
movss 0x44(%rsp), %xmm8
movq 0xd0(%rsp), %r9
movss 0x24(%rsp), %xmm7
movss 0x18(%rsp), %xmm6
movl 0x20(%rsp), %r8d
movq 0x48(%rsp), %rdi
movss 0xc(%rsp), %xmm5
movss 0x10(%rsp), %xmm1
movss 0x14(%rsp), %xmm3
movaps %xmm0, %xmm4
movaps %xmm8, %xmm2
movl %edi, %eax
subl %r11d, %eax
cvtsi2ss %rax, %xmm0
mulss 0x88(%rsp), %xmm0
cmpq $-0x1, %r9
cmovneq %r9, %r13
addss %xmm6, %xmm0
movl %edi, %ecx
movq %rcx, 0x28(%rsp)
ucomiss %xmm7, %xmm8
ja 0x5557
ucomiss %xmm8, %xmm7
jne 0x567f
jp 0x567f
movaps %xmm1, %xmm4
movaps %xmm5, %xmm2
cmpl %r8d, %eax
jbe 0x567f
movq %r11, %r14
leal (%r11,%rdi), %r10d
shrl %r10d
subl %r13d, %r10d
movaps %xmm4, %xmm1
movaps %xmm2, %xmm5
jmp 0x5584
movb $0x1, 0x38(%rsp)
jmp 0x5657
movq %r11, %r14
movaps %xmm6, %xmm0
movq %r9, %r13
movq 0x50(%rsp), %r10
subq $0x8, %rsp
movq 0x80(%rsp), %rdi
movl %ebp, %esi
movq %r15, %rdx
movq %r13, %rcx
movq 0x30(%rsp), %r8
leaq 0x3c(%rsp), %r9
movss %xmm1, 0x18(%rsp)
movss %xmm5, 0x14(%rsp)
movaps %xmm5, %xmm2
leaq 0x70(%rsp), %rax
pushq %rax
movl 0x210(%rsp), %eax
pushq %rax
movq %r10, 0x68(%rsp)
pushq %r10
callq 0x4204
addq $0x20, %rsp
xorl %r8d, %r8d
xorps %xmm6, %xmm6
cmpq $0x0, 0x210(%rsp)
je 0x5610
pushq $-0x1
popq %r9
movss 0xab7c(%rip), %xmm7     # 0x10168
movss 0x14(%rsp), %xmm3
pushq $-0x1
popq %rcx
movb 0xb(%rsp), %dl
movss 0x10(%rsp), %xmm1
movss 0xc(%rsp), %xmm5
movl 0x1c(%rsp), %esi
movq 0x48(%rsp), %rdi
jmp 0x5648
movq 0x48(%rsp), %rdi
movl %edi, %eax
subl %r14d, %eax
addq %rax, 0x60(%rsp)
pushq $-0x1
popq %r9
movss 0xab3d(%rip), %xmm7     # 0x10168
movss 0x14(%rsp), %xmm3
pushq $-0x1
popq %rcx
movb 0xb(%rsp), %dl
movss 0x10(%rsp), %xmm1
movss 0xc(%rsp), %xmm5
movl 0x1c(%rsp), %esi
movss 0x44(%rsp), %xmm8
movq 0x98(%rsp), %r10
movl %ecx, %eax
cmpq 0xe8(%rsp), %r12
jge 0x566f
movq 0xc8(%rsp), %rax
movl (%rax,%r12,4), %eax
xorb $0x1, %dl
incl %esi
incq %r12
movl %edi, %r11d
jmp 0x543f
movq %r11, %r14
jmp 0x557f
movb $0x1, %cl
testb $0x1, %dl
je 0x4f6d
movl %r10d, %r12d
subl %r11d, %r12d
cmpq $0x0, 0x210(%rsp)
movl $0x0, %r14d
cmoveq %r12, %r14
addq 0x60(%rsp), %r14
ucomiss 0x5c(%rsp), %xmm8
movl %r11d, 0x8c(%rsp)
jbe 0x580e
movss 0xaa9c(%rip), %xmm2     # 0x10168
movaps %xmm8, %xmm0
cmpb $0x0, 0x1f8(%rsp)
je 0x576e
movq %rdi, 0x48(%rsp)
movq 0xb8(%rsp), %rdi
movl %edx, %ebp
movss %xmm1, 0x10(%rsp)
movss %xmm5, 0xc(%rsp)
movl %esi, 0x1c(%rsp)
movl %r8d, 0x20(%rsp)
movss %xmm6, 0x18(%rsp)
movss %xmm7, 0x24(%rsp)
movq %r14, 0x90(%rsp)
movq %r9, %r14
movq %r11, 0x28(%rsp)
callq 0x279a
movq 0x28(%rsp), %r11
movq 0x98(%rsp), %r10
movss 0x44(%rsp), %xmm8
movq %r14, %r9
movq 0x90(%rsp), %r14
movss 0x24(%rsp), %xmm7
movss 0x18(%rsp), %xmm6
movl 0x20(%rsp), %r8d
movq 0x48(%rsp), %rdi
movl 0x1c(%rsp), %esi
movss 0xc(%rsp), %xmm5
movss 0x10(%rsp), %xmm1
movl %ebp, %edx
movaps %xmm8, %xmm2
movl %r12d, %eax
cvtsi2ss %rax, %xmm3
mulss 0x88(%rsp), %xmm3
addss %xmm6, %xmm3
cmpq $-0x1, %r9
cmovneq %r9, %r13
ucomiss %xmm7, %xmm8
ja 0x57e0
ucomiss %xmm8, %xmm7
movaps %xmm3, %xmm6
movq %r13, %r9
movq %r10, 0x28(%rsp)
movb 0x38(%rsp), %al
movl %eax, %ecx
movq %r14, 0x60(%rsp)
jne 0x4f6d
jp 0x4f6d
movaps %xmm3, %xmm6
movq %r13, %r9
movq %r10, 0x28(%rsp)
movb 0x38(%rsp), %al
movl %eax, %ecx
movq %r14, 0x60(%rsp)
movaps %xmm7, %xmm8
movaps %xmm1, %xmm0
movaps %xmm5, %xmm2
cmpl %r8d, %r12d
jbe 0x4f6d
addl %r10d, %r11d
shrl %r11d
subl %r13d, %r11d
movaps %xmm3, %xmm6
movq %r13, %r9
movq %r10, 0x28(%rsp)
movaps %xmm8, %xmm7
movl %r11d, %eax
movq %rax, 0x50(%rsp)
movl %r12d, %r8d
movaps %xmm0, %xmm1
movaps %xmm2, %xmm5
jmp 0x58ab
subq 0x28(%rsp), %r10
movb 0x38(%rsp), %al
movl %eax, %ecx
movq %r14, 0x60(%rsp)
cmpq 0xd8(%rsp), %r10
jle 0x4f6d
subq $0x8, %rsp
movq %rdi, %r13
movq 0x80(%rsp), %rdi
movl %esi, %r12d
movl %ebp, %esi
movl %edx, %ebp
movq %r15, %rdx
movq %r9, %rcx
movq 0x30(%rsp), %r8
leaq 0x3c(%rsp), %r9
movaps %xmm6, %xmm0
movaps %xmm5, %xmm2
movss 0x1c(%rsp), %xmm3
leaq 0x70(%rsp), %rax
pushq %rax
movl 0x210(%rsp), %eax
pushq %rax
pushq 0x68(%rsp)
movss %xmm1, 0x30(%rsp)
movss %xmm5, 0x2c(%rsp)
callq 0x4204
movq %r13, %rdi
movl %r12d, %esi
movss 0x2c(%rsp), %xmm5
movss 0x30(%rsp), %xmm1
movl %ebp, %edx
addq $0x20, %rsp
xorl %r8d, %r8d
xorps %xmm6, %xmm6
pushq $-0x1
popq %r9
movss 0xa8bd(%rip), %xmm7     # 0x10168
movb 0x38(%rsp), %al
movl %eax, %ecx
movq %r14, 0x60(%rsp)
jmp 0x4f6d
leaq 0x3c(%rsp), %r9
movq 0x80(%rsp), %rdi
movl %ebp, %esi
movq %r15, %rdx
movq %r14, %rcx
movq 0x30(%rsp), %r8
movss 0x20(%rsp), %xmm0
movss 0x18(%rsp), %xmm1
movss 0x14(%rsp), %xmm2
movss 0x1c(%rsp), %xmm3
leaq 0x70(%rsp), %rax
pushq %rax
movl 0x210(%rsp), %r14d
pushq %r14
pushq 0x68(%rsp)
callq 0x4204
addq $0x20, %rsp
cmpb $0x0, 0x218(%rsp)
jne 0x5933
movq 0x80(%rsp), %rdi
callq 0x2040
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testb $0x1, 0x38(%rsp)
movq 0x116b9(%rip), %r15     # 0x16ff8
je 0x599c
movq (%r15), %rcx
leaq 0xbd74(%rip), %rdi      # 0x116bf
pushq $0x29
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x22b0
movq (%r15), %rcx
leaq 0xbd86(%rip), %rdi      # 0x116e9
pushq $0x32
popq %rsi
movq %rbx, %rdx
callq 0x22b0
movq (%r15), %rcx
leaq 0xbda4(%rip), %rdi      # 0x1171c
pushq $0x34
popq %rsi
movq %rbx, %rdx
callq 0x22b0
movq (%r15), %rdi
leaq 0xbcfe(%rip), %rsi      # 0x1168b
movq 0xc0(%rsp), %rdx
xorl %eax, %eax
callq 0x21c0
movq (%r15), %rcx
leaq 0xbab5(%rip), %rdi      # 0x1145b
pushq $0x19
popq %rsi
pushq $0x1
popq %rdx
callq 0x22b0
movq (%r15), %rdi
leaq 0xbaba(%rip), %rsi      # 0x11475
movq 0x60(%rsp), %rdx
xorl %eax, %eax
callq 0x21c0
movq (%r15), %rdi
orl $0x70, %r13d
cvtss2sd 0x5c(%rsp), %xmm0
leaq 0xbab2(%rip), %rsi      # 0x1148d
movl %r13d, %edx
movb $0x1, %al
callq 0x21c0
movq (%r15), %rdi
cvtss2sd 0x14(%rsp), %xmm0
leaq 0xbac3(%rip), %rsi      # 0x114b8
movb $0x1, %al
callq 0x21c0
testl %r14d, %r14d
je 0x5a15
movq (%r15), %rdi
leaq 0xbabf(%rip), %rsi      # 0x114ca
movl %r14d, %edx
xorl %eax, %eax
callq 0x21c0
movq (%r15), %rdi
leaq 0xbac5(%rip), %rsi      # 0x114e4
movl 0x208(%rsp), %edx
xorl %eax, %eax
callq 0x21c0
movq (%r15), %rdi
movl 0x34(%rsp), %edx
movq 0x68(%rsp), %rcx
leaq 0xbade(%rip), %rsi      # 0x1151e
xorl %eax, %eax
callq 0x21c0
jmp 0x5914