// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/samtools-0.1.18/bam_pileup.c
// Function: bam_plp_push
int bam_plp_push(bam_plp_t iter, const bam1_t *b)
{
	if (iter->error) return -1;
	if (b) {
		if (b->core.tid < 0) return 0;
		if (b->core.flag & iter->flag_mask) return 0;
		if (iter->tid == b->core.tid && iter->pos == b->core.pos && iter->mp->cnt > iter->maxcnt) return 0;
		bam_copy1(&iter->tail->b, b);
		iter->tail->beg = b->core.pos; iter->tail->end = bam_calend(&b->core, bam1_cigar(b));
		iter->tail->s = g_cstate_null; iter->tail->s.end = iter->tail->end - 1; // initialize cstate_t
		if (b->core.tid < iter->max_tid) {
			fprintf(stderr, "[bam_pileup_core] the input is not sorted (chromosomes out of order)\n");
			iter->error = 1;
			return -1;
		}
		if ((b->core.tid == iter->max_tid) && (iter->tail->beg < iter->max_pos)) {
			fprintf(stderr, "[bam_pileup_core] the input is not sorted (reads out of order)\n");
			iter->error = 1;
			return -1;
		}
		iter->max_tid = b->core.tid; iter->max_pos = iter->tail->beg;
		if (iter->tail->end > iter->pos || iter->tail->b.core.tid > iter->tid) {
			iter->tail->next = mp_alloc(iter->mp);
			iter->tail = iter->tail->next;
		}
	} else iter->is_eof = 1;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
pushq $-0x1
popq %r12
cmpl $0x0, 0x3c(%rdi)
je 0x1f89cb
movl %r12d, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, %r14
movq %rdi, %rbx
testq %rsi, %rsi
je 0x1f8b10
movl (%r14), %eax
xorl %ebp, %ebp
testl %eax, %eax
js 0x1f89ba
movl 0xc(%r14), %ecx
movl 0x34(%rbx), %edx
testw %cx, %dx
jne 0x1f89ba
cmpl %eax, 0x20(%rbx)
jne 0x1f8a07
movl 0x24(%rbx), %eax
cmpl 0x4(%r14), %eax
jne 0x1f8a07
movq (%rbx), %rax
movl (%rax), %eax
cmpl 0x40(%rbx), %eax
jg 0x1f89ba
movq 0x10(%rbx), %r13
movq 0x30(%r13), %rdi
movl 0x28(%r13), %r15d
movl 0x24(%r14), %eax
cmpl %eax, %r15d
jge 0x1f8a51
decl %eax
movl %eax, %ecx
sarl %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x2, %eax
orl %ecx, %eax
movl %eax, %ecx
sarl $0x4, %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x8, %eax
orl %ecx, %eax
movl %eax, %r15d
sarl $0x10, %r15d
orl %eax, %r15d
incl %r15d
movslq %r15d, %rsi
callq 0x17f58
movq %rax, %rdi
testq %rdi, %rdi
je 0x1f8b5b
movq 0x30(%r14), %rsi
movslq 0x24(%r14), %rdx
movq %rdi, (%rsp)
callq 0x17630
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups %xmm2, 0x20(%r13)
movups %xmm0, (%r13)
movups %xmm1, 0x10(%r13)
movl %r15d, 0x28(%r13)
movq (%rsp), %rax
movq %rax, 0x30(%r13)
movl 0x4(%r14), %eax
movq 0x10(%rbx), %rcx
movl %eax, 0x38(%rcx)
movzbl 0xb(%r14), %esi
addq 0x30(%r14), %rsi
movq %r14, %rdi
callq 0x1f49c4
movq 0x10(%rbx), %rcx
movl %eax, 0x3c(%rcx)
movups 0x172062(%rip), %xmm0   # 0x36ab20
movups %xmm0, 0x40(%rcx)
movq 0x10(%rbx), %rax
movl 0x3c(%rax), %ecx
leal -0x1(%rcx), %edx
movl %edx, 0x4c(%rax)
movl (%r14), %edx
cmpl 0x28(%rbx), %edx
jl 0x1f8b1e
movl 0x38(%rax), %esi
jne 0x1f8ae1
cmpl 0x2c(%rbx), %esi
jb 0x1f8b33
movl %edx, 0x28(%rbx)
movl %esi, 0x2c(%rbx)
cmpl 0x24(%rbx), %ecx
ja 0x1f8af7
movl (%rax), %eax
cmpl 0x20(%rbx), %eax
jle 0x1f89ba
movq (%rbx), %rdi
callq 0x1f8343
movq 0x10(%rbx), %rcx
movq %rax, 0x50(%rcx)
movq %rax, 0x10(%rbx)
jmp 0x1f89ba
movl $0x1, 0x30(%rbx)
xorl %ebp, %ebp
jmp 0x1f89ba
movq 0x23f443(%rip), %rax    # 0x437f68
movq (%rax), %rcx
leaq 0x172068(%rip), %rdi    # 0x36ab97
pushq $0x45
jmp 0x1f8b46
movq 0x23f42e(%rip), %rax    # 0x437f68
movq (%rax), %rcx
leaq 0x172099(%rip), %rdi    # 0x36abdd
pushq $0x3f
popq %rsi
pushq $0x1
popq %rdx
callq 0x17f00
movl $0x1, 0x3c(%rbx)
jmp 0x1f89b7
leaq 0x124031(%rip), %rdi    # 0x31cb93
leaq 0x17212a(%rip), %rsi    # 0x36ac93
leaq 0x139112(%rip), %rcx    # 0x331c82
movl $0x2dc, %edx            # imm = 0x2DC
callq 0x174b0