// File: /workspace/github_c_makefile_star2_O2/jsh58[P]Genrich/Genrich.c
// Function: findPeaksOnly
void findPeaksOnly(char* logFile, char* outFile,
    bool gzOut, int xcount, char** xchrList, char* xFile,
    float pqvalue, bool qvalOpt, int minLen, int maxGap,
    float minAUC, uint64_t genomeLen, bool verbose) {

  // save genomic regions to exclude
  char* line = (char*) memalloc(MAX_SIZE);
  Bed* xBed = NULL;
  int xBedLen = 0;
  if (xFile != NULL)
    xBedLen = loadBED(xFile, line, &xBed);

  // open files
  File in, out;
  bool gz = openRead(logFile, &in);
  openWrite(outFile, &out, gzOut);
  if (verbose)
    fprintf(stderr, "Peak-calling from log file: %s\n",
      logFile);

  // call peaks
  callPeaksLog(in, gz, out, gzOut, line, xcount, xchrList,
    xBedLen, xBed, pqvalue, qvalOpt, minLen, maxGap,
    minAUC, genomeLen, verbose);

  // free memory
  if (xcount) {
    for (int i = 0; i < xcount; i++)
      free(xchrList[i]);
    free(xchrList);
  }
  if (xBedLen) {
    for (int i = 0; i < xBedLen; i++)
      free(xBed[i].name);
    free(xBed);
  }
  free(line);

  // close files
  if ( ( gz && gzclose(in.gzf) != Z_OK )
      || ( ! gz && fclose(in.f) ) )
    exit(error(logFile, ERRCLOSE));
  if ( ( gzOut && gzclose(out.gzf) != Z_OK )
      || ( ! gzOut && fclose(out.f) ) )
    exit(error(outFile, ERRCLOSE));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movss %xmm1, 0xc(%rsp)
movss %xmm0, 0x8(%rsp)
movq %r9, %rbx
movq %r8, %r14
movl %ecx, %ebp
movl %edx, 0x4(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdi, %r15
movl $0xfff0, %edi           # imm = 0xFFF0
callq 0x2752
andq $0x0, 0x30(%rsp)
testq %rbx, %rbx
movq %rax, 0x28(%rsp)
je 0xd91b
leaq 0x30(%rsp), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0xd6cd
movl %eax, %r12d
jmp 0xd91e
xorl %r12d, %r12d
leaq 0x40(%rsp), %rsi
movq %r15, 0x10(%rsp)
movq %r15, %rdi
callq 0xd585
movl %eax, %r13d
movzbl 0x4(%rsp), %r15d
leaq 0x38(%rsp), %rsi
movq 0x20(%rsp), %rdi
movl %r15d, %edx
callq 0xd384
movb 0xa0(%rsp), %al
testb %al, %al
jne 0xda77
movq 0x30(%rsp), %rbx
movq 0x40(%rsp), %rcx
movq 0x38(%rsp), %rdx
movzbl %al, %eax
movzbl 0x80(%rsp), %r10d
movb %r13b, 0x3(%rsp)
movzbl %r13b, %esi
movq %rcx, %r13
movq %rcx, %rdi
movq %rdx, 0x18(%rsp)
movl %r15d, %ecx
movq 0x28(%rsp), %r8
movl %ebp, %r9d
movss 0x8(%rsp), %xmm0
movss 0xc(%rsp), %xmm1
pushq %rax
pushq 0xa0(%rsp)
movl 0xa0(%rsp), %eax
pushq %rax
movl 0xa0(%rsp), %eax
pushq %rax
pushq %r10
pushq %rbx
pushq %r12
pushq %r14
callq 0x4e48
addq $0x40, %rsp
testl %ebp, %ebp
je 0xd9f0
xorl %r15d, %r15d
testl %ebp, %ebp
cmovlel %r15d, %ebp
cmpq %r15, %rbp
je 0xd9e8
movq (%r14,%r15,8), %rdi
callq 0x2040
incq %r15
jmp 0xd9d5
movq %r14, %rdi
callq 0x2040
testl %r12d, %r12d
movb 0x3(%rsp), %bpl
je 0xda25
xorl %r14d, %r14d
testl %r12d, %r12d
cmovlel %r14d, %r12d
shlq $0x4, %r12
cmpq %r14, %r12
je 0xda1d
movq 0x8(%rbx,%r14), %rdi
callq 0x2040
addq $0x10, %r14
jmp 0xda08
movq %rbx, %rdi
callq 0x2040
movq 0x28(%rsp), %rdi
callq 0x2040
movq %r13, %rdi
testb %bpl, %bpl
je 0xda3e
callq 0x2030
jmp 0xda43
callq 0x20d0
testl %eax, %eax
jne 0xdaa0
cmpb $0x0, 0x4(%rsp)
je 0xda5a
movq 0x18(%rsp), %rdi
callq 0x2030
jmp 0xda64
movq 0x18(%rsp), %rdi
callq 0x20d0
testl %eax, %eax
jne 0xdaaa
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x957a(%rip), %rax      # 0x16ff8
movq (%rax), %rdi
leaq 0x409f(%rip), %rsi      # 0x11b27
movq 0x10(%rsp), %rdx
xorl %eax, %eax
callq 0x21c0
movb 0xa0(%rsp), %al
jmp 0xd95a
pushq $0x3
popq %rsi
movq 0x10(%rsp), %rdi
jmp 0xdab2
pushq $0x3
popq %rsi
movq 0x20(%rsp), %rdi
callq 0x2724
pushq $0x1
popq %rdi
callq 0x22a0