// File: /workspace/github_c_makefile_star2_O1/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 0x92a5
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
testb $0x4, 0xc(%rsi)
jne 0x91b1
movl 0x4(%r15), %eax
movl %eax, 0x10(%r14)
movzbl 0xb(%r15), %esi
addq 0x30(%r15), %rsi
movq %r15, %rdi
callq 0xf2c0
movl %eax, 0x18(%r14)
cmpl %eax, 0x10(%r14)
jg 0x92c4
movl (%r15), %eax
jmp 0x91be
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x10(%r14)
movl %eax, 0x18(%r14)
movl %eax, 0x20(%r14)
testq %rbx, %rbx
je 0x9200
movabsq $0x400000000, %rax      # imm = 0x400000000
testq %rax, 0x8(%rbx)
jne 0x9233
movl 0x4(%rbx), %eax
movl %eax, 0x14(%r14)
movzbl 0xb(%rbx), %esi
addq 0x30(%rbx), %rsi
movq %rbx, %rdi
callq 0xf2c0
movl %eax, 0x1c(%r14)
cmpl %eax, 0x14(%r14)
jg 0x92e3
movl (%rbx), %eax
jmp 0x9240
movabsq $0x900000000, %rax      # imm = 0x900000000
andq 0x8(%r15), %rax
movabsq $0x100000000, %rcx      # imm = 0x100000000
cmpq %rcx, %rax
jne 0x9246
movl 0x18(%r15), %eax
movl %eax, 0x14(%r14)
movl $0xffffffff, 0x1c(%r14) # imm = 0xFFFFFFFF
movl 0x14(%r15), %eax
jmp 0x9253
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x14(%r14)
movl %eax, 0x1c(%r14)
movl %eax, 0x24(%r14)
jmp 0x9263
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x14(%r14)
movl %eax, 0x1c(%r14)
movl %eax, 0x24(%r14)
movq %r15, 0x30(%r14)
movq $0x0, 0x38(%r14)
movq 0x28(%r14), %rdi
testq %rdi, %rdi
je 0x9271
callq 0x3070
movq 0x30(%r15), %rdi
callq 0x3630
movq %rax, 0x28(%r14)
movq $0x0, 0x48(%r14)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, (%r14)
movq %rax, 0x8(%r14)
movq %r15, 0x30(%r14)
movq %rbx, 0x38(%r14)
popq %rbx
popq %r14
popq %r15
retq
leaq 0x18a4b(%rip), %rdi     # 0x21cf7
leaq 0x18a52(%rip), %rsi     # 0x21d05
leaq 0x197b2(%rip), %rcx     # 0x22a6c
movl $0x784, %edx            # imm = 0x784
callq 0x3230
leaq 0x19747(%rip), %rdi     # 0x22a12
leaq 0x18a33(%rip), %rsi     # 0x21d05
leaq 0x19793(%rip), %rcx     # 0x22a6c
movl $0x78d, %edx            # imm = 0x78D
callq 0x3230
leaq 0x19755(%rip), %rdi     # 0x22a3f
leaq 0x18a14(%rip), %rsi     # 0x21d05
leaq 0x19774(%rip), %rcx     # 0x22a6c
movl $0x79a, %edx            # imm = 0x79A
callq 0x3230