// File: /workspace/github_c_makefile_star2_O3/sc932[P]ALE/src/ALElike.c
// Function: setAlignment
void _setAlignment(alignSet_t *thisAlignment, bam1_t *read1, bam1_t *read2) {
      assert(read1 != NULL);
      if ((read1->core.flag & BAM_FUNMAP) == BAM_FUNMAP) {
        thisAlignment->start1 = -1;
        thisAlignment->end1   = -1;
        thisAlignment->contigId1 = -1;
      } else {

        thisAlignment->start1 = read1->core.pos;
        thisAlignment->end1   = bam_calend(&read1->core, bam1_cigar(read1));
        assert(thisAlignment->start1 <= thisAlignment->end1);
        thisAlignment->contigId1 = read1->core.tid;
      }

      if (read2 == NULL) {
          _setAlignmentForMate(thisAlignment, read1);
      } else if ((read2->core.flag & BAM_FUNMAP) == BAM_FUNMAP) {
        thisAlignment->start2 = -1;
        thisAlignment->end2   = -1;
        thisAlignment->contigId2 = -1;
      } else {
        thisAlignment->start2 = read2->core.pos;
        thisAlignment->end2   = bam_calend(&read2->core, bam1_cigar(read2));
        assert(thisAlignment->start2 <= thisAlignment->end2);
        thisAlignment->contigId2 = read2->core.tid;
      }

      if (thisAlignment->name != NULL){
          free(thisAlignment->name);
      }
      thisAlignment->name = strdup(bam1_qname(read1));
      thisAlignment->nextAlignment = NULL;
      thisAlignment->likelihood = 1.0;
      thisAlignment->likelihoodInsert = 1.0;
      thisAlignment->bamOfAlignment1 = read1;
      thisAlignment->bamOfAlignment2 = read2;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rsi, %rsi
je 0x9576
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
testb $0x4, 0xc(%rsi)
jne 0x948d
movl 0x4(%r15), %eax
movl %eax, 0x10(%r14)
movzbl 0xb(%r15), %esi
addq 0x30(%r15), %rsi
movq %r15, %rdi
callq 0xf6d8
movl %eax, 0x18(%r14)
cmpl %eax, 0x10(%r14)
jg 0x9595
movl (%r15), %eax
jmp 0x949a
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x10(%r14)
movl %eax, 0x18(%r14)
movl %eax, 0x20(%r14)
testq %rbx, %rbx
je 0x94dc
movabsq $0x400000000, %rax      # imm = 0x400000000
testq %rax, 0x8(%rbx)
jne 0x9529
movl 0x4(%rbx), %eax
movl %eax, 0x14(%r14)
movzbl 0xb(%rbx), %esi
addq 0x30(%rbx), %rsi
movq %rbx, %rdi
callq 0xf6d8
movl %eax, 0x1c(%r14)
cmpl %eax, 0x14(%r14)
jg 0x95b4
movl (%rbx), %eax
jmp 0x9536
movabsq $0x900000000, %rdx      # imm = 0x900000000
andq 0x8(%r15), %rdx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movabsq $0x100000000, %rsi      # imm = 0x100000000
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rsi, %rdx
jne 0x950b
movl 0x14(%r15), %ecx
movl 0x18(%r15), %eax
movl %eax, 0x14(%r14)
movl $0xffffffff, 0x1c(%r14) # imm = 0xFFFFFFFF
movl %ecx, 0x24(%r14)
movq %r15, 0x30(%r14)
movq $0x0, 0x38(%r14)
jmp 0x953a
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x14(%r14)
movl %eax, 0x1c(%r14)
movl %eax, 0x24(%r14)
movq 0x28(%r14), %rdi
testq %rdi, %rdi
je 0x9548
callq 0x3070
movq 0x30(%r15), %rdi
callq 0x3630
movq %rax, 0x28(%r14)
movq $0x0, 0x48(%r14)
movaps 0x1454c(%rip), %xmm0    # 0x1dab0
movups %xmm0, (%r14)
movq %r15, 0x30(%r14)
movq %rbx, 0x38(%r14)
popq %rbx
popq %r14
popq %r15
retq
leaq 0x187da(%rip), %rdi     # 0x21d57
leaq 0x187e1(%rip), %rsi     # 0x21d65
leaq 0x19541(%rip), %rcx     # 0x22acc
movl $0x784, %edx            # imm = 0x784
callq 0x3230
leaq 0x194d6(%rip), %rdi     # 0x22a72
leaq 0x187c2(%rip), %rsi     # 0x21d65
leaq 0x19522(%rip), %rcx     # 0x22acc
movl $0x78d, %edx            # imm = 0x78D
callq 0x3230
leaq 0x194e4(%rip), %rdi     # 0x22a9f
leaq 0x187a3(%rip), %rsi     # 0x21d65
leaq 0x19503(%rip), %rcx     # 0x22acc
movl $0x79a, %edx            # imm = 0x79A
callq 0x3230