// File: /workspace/github_c_makefile_star2_O0/jsh58[P]Genrich/Genrich.c
// Function: copyAlns
void copyAlns(Aln* aln, int alnLen, float score,
    float asDiff, bool first, Aln** dest,
    uint8_t* destLen) {
  // adjust AS tolerance for secondary alns
  if (score != NOSCORE)
    score -= asDiff;

  // determine number of valid single alignments
  uint8_t count = 0;
  for (int i = 0; i < alnLen; i++) {
    Aln* a = aln + i;
    if (! a->paired && a->first == first
        && a->score >= score)
      count++;
  }
  *dest = (Aln*) memalloc(count * sizeof(Aln));
  *destLen = count;

  // copy alignment info for valid alignments
  uint8_t j = 0;  // index into r->aln
  for (int i = 0; i < alnLen; i++) {
    Aln* a = aln + i;
    if (! a->paired && a->first == first
        && a->score >= score) {
      Aln* b = *dest + j;
      b->paired = a->paired;
      b->first = a->first;
      b->strand = a->strand;
      b->score = a->score;
      b->chrom = a->chrom;
      b->pos[0] = a->pos[0];
      b->pos[1] = a->pos[1];
      j++;
    }
  }

}

// Assembly:
subq $0x58, %rsp
movb %dl, %al
movq %rdi, 0x50(%rsp)
movl %esi, 0x4c(%rsp)
movss %xmm0, 0x48(%rsp)
movss %xmm1, 0x44(%rsp)
andb $0x1, %al
movb %al, 0x43(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x30(%rsp)
movss 0x48(%rsp), %xmm0
movss 0x1153b(%rip), %xmm1    # 0x1e1b4
ucomiss %xmm1, %xmm0
jne 0xcc82
jp 0xcc82
jmp 0xcc98
movss 0x44(%rsp), %xmm1
movss 0x48(%rsp), %xmm0
subss %xmm1, %xmm0
movss %xmm0, 0x48(%rsp)
movb $0x0, 0x2f(%rsp)
movl $0x0, 0x28(%rsp)
movl 0x28(%rsp), %eax
cmpl 0x4c(%rsp), %eax
jge 0xcd15
movq 0x50(%rsp), %rax
movslq 0x28(%rsp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
testb $0x1, 0xd(%rax)
jne 0xcd06
movq 0x20(%rsp), %rax
movb 0xf(%rax), %al
andb $0x1, %al
movzbl %al, %eax
movb 0x43(%rsp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0xcd06
movq 0x20(%rsp), %rax
movss 0x8(%rax), %xmm0
ucomiss 0x48(%rsp), %xmm0
jb 0xcd06
movb 0x2f(%rsp), %al
addb $0x1, %al
movb %al, 0x2f(%rsp)
jmp 0xcd08
movl 0x28(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x28(%rsp)
jmp 0xcca5
movzbl 0x2f(%rsp), %eax
imulq $0x28, %rax, %rdi
callq 0x2890
movq %rax, %rcx
movq 0x38(%rsp), %rax
movq %rcx, (%rax)
movb 0x2f(%rsp), %cl
movq 0x30(%rsp), %rax
movb %cl, (%rax)
movb $0x0, 0x1f(%rsp)
movl $0x0, 0x18(%rsp)
movl 0x18(%rsp), %eax
cmpl 0x4c(%rsp), %eax
jge 0xce62
movq 0x50(%rsp), %rax
movslq 0x18(%rsp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
testb $0x1, 0xd(%rax)
jne 0xce50
movq 0x10(%rsp), %rax
movb 0xf(%rax), %al
andb $0x1, %al
movzbl %al, %eax
movb 0x43(%rsp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0xce50
movq 0x10(%rsp), %rax
movss 0x8(%rax), %xmm0
ucomiss 0x48(%rsp), %xmm0
jb 0xce50
movq 0x38(%rsp), %rax
movq (%rax), %rax
movzbl 0x1f(%rsp), %ecx
movslq %ecx, %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rax
movb 0xd(%rax), %cl
movq 0x8(%rsp), %rax
andb $0x1, %cl
movb %cl, 0xd(%rax)
movq 0x10(%rsp), %rax
movb 0xf(%rax), %cl
movq 0x8(%rsp), %rax
andb $0x1, %cl
movb %cl, 0xf(%rax)
movq 0x10(%rsp), %rax
movb 0x10(%rax), %cl
movq 0x8(%rsp), %rax
andb $0x1, %cl
movb %cl, 0x10(%rax)
movq 0x10(%rsp), %rax
movss 0x8(%rax), %xmm0
movq 0x8(%rsp), %rax
movss %xmm0, 0x8(%rax)
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x10(%rsp), %rax
movl (%rax), %ecx
movq 0x8(%rsp), %rax
movl %ecx, (%rax)
movq 0x10(%rsp), %rax
movl 0x4(%rax), %ecx
movq 0x8(%rsp), %rax
movl %ecx, 0x4(%rax)
movb 0x1f(%rsp), %al
addb $0x1, %al
movb %al, 0x1f(%rsp)
jmp 0xce52
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0xcd46
addq $0x58, %rsp
retq
nopw (%rax,%rax)