// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x97fd
jmp 0x981c
leaq 0x265b3(%rip), %rdi     # 0x2fdb7
leaq 0x265ba(%rip), %rsi     # 0x2fdc5
movl $0x784, %edx            # imm = 0x784
leaq 0x27342(%rip), %rcx     # 0x30b59
callq 0x3220
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
shrq $0x20, %rax
andq $0xffff, %rax           # imm = 0xFFFF
andl $0x4, %eax
cmpl $0x4, %eax
jne 0x9859
movq -0x8(%rbp), %rax
movl $0xffffffff, 0x10(%rax) # imm = 0xFFFFFFFF
movq -0x8(%rbp), %rax
movl $0xffffffff, 0x18(%rax) # imm = 0xFFFFFFFF
movq -0x8(%rbp), %rax
movl $0xffffffff, 0x20(%rax) # imm = 0xFFFFFFFF
jmp 0x98d6
movq -0x10(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
shrq $0x18, %rax
andq $0xff, %rax
cltq
addq %rax, %rsi
callq 0x15e60
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x8(%rbp), %rax
movl 0x10(%rax), %eax
movq -0x8(%rbp), %rcx
cmpl 0x18(%rcx), %eax
jg 0x98aa
jmp 0x98c9
leaq 0x2724e(%rip), %rdi     # 0x30aff
leaq 0x2650d(%rip), %rsi     # 0x2fdc5
movl $0x78d, %edx            # imm = 0x78D
leaq 0x27295(%rip), %rcx     # 0x30b59
callq 0x3220
movq -0x10(%rbp), %rax
movl (%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x20(%rax)
cmpq $0x0, -0x18(%rbp)
jne 0x98ef
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x9730
jmp 0x99ab
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
shrq $0x20, %rax
andq $0xffff, %rax           # imm = 0xFFFF
andl $0x4, %eax
cmpl $0x4, %eax
jne 0x992c
movq -0x8(%rbp), %rax
movl $0xffffffff, 0x14(%rax) # imm = 0xFFFFFFFF
movq -0x8(%rbp), %rax
movl $0xffffffff, 0x1c(%rax) # imm = 0xFFFFFFFF
movq -0x8(%rbp), %rax
movl $0xffffffff, 0x24(%rax) # imm = 0xFFFFFFFF
jmp 0x99a9
movq -0x18(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x18(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rsi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
shrq $0x18, %rax
andq $0xff, %rax
cltq
addq %rax, %rsi
callq 0x15e60
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x1c(%rax)
movq -0x8(%rbp), %rax
movl 0x14(%rax), %eax
movq -0x8(%rbp), %rcx
cmpl 0x1c(%rcx), %eax
jg 0x997d
jmp 0x999c
leaq 0x271a8(%rip), %rdi     # 0x30b2c
leaq 0x2643a(%rip), %rsi     # 0x2fdc5
movl $0x79a, %edx            # imm = 0x79A
leaq 0x271c2(%rip), %rcx     # 0x30b59
callq 0x3220
movq -0x18(%rbp), %rax
movl (%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x24(%rax)
jmp 0x99ab
movq -0x8(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x99c3
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x3050
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x3620
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x48(%rax)
movq -0x8(%rbp), %rax
movsd 0x2204d(%rip), %xmm0    # 0x2ba40
movsd %xmm0, (%rax)
movq -0x8(%rbp), %rax
movsd 0x2203d(%rip), %xmm0    # 0x2ba40
movsd %xmm0, 0x8(%rax)
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x38(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)