// File: /workspace/github_c_makefile_star2_O0/lh3[P]minigraph/ggsimple.c
// Function: gg_count_intv
static int32_t gg_count_intv(const gfa_t *g, const mg_gchains_t *gt, int32_t i)
{
	const mg_gchain_t *gc = &gt->gc[i];
	int32_t j, l = gc->off, x = gc->ps, n = 0;
	assert(gc->p);
	for (j = 0; j < gc->p->n_cigar; ++j) {
		int32_t op = gc->p->cigar[j]&0xf, len = gc->p->cigar[j]>>4, rl = len;
		assert(op == 1 || op == 2 || op == 7 || op == 8);
		if (op == 2 || op == 7 || op == 8) {
			while (x + rl > g->seg[gt->lc[l].v>>1].len) {
				rl -= g->seg[gt->lc[l].v>>1].len - x;
				++n, ++l, x = 0;
			}
			x += rl;
		}
		++n;
	}
	return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x68, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movl 0x24(%rax), %eax
movl %eax, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x37712
jmp 0x37731
leaq 0x6ce4(%rip), %rdi      # 0x3e3fd
leaq 0x68bc(%rip), %rsi      # 0x3dfdc
movl $0x143, %edx            # imm = 0x143
leaq 0x6cd7(%rip), %rcx      # 0x3e403
callq 0x2170
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x20(%rbp), %rcx
movq 0x48(%rcx), %rcx
cmpl (%rcx), %eax
jge 0x37879
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rax
movslq -0x24(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
andq $0xf, %rax
movl %eax, -0x34(%rbp)
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rax
movslq -0x24(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
shrq $0x4, %rax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
movl %eax, -0x3c(%rbp)
cmpl $0x1, -0x34(%rbp)
je 0x37799
cmpl $0x2, -0x34(%rbp)
je 0x37799
cmpl $0x7, -0x34(%rbp)
je 0x37799
cmpl $0x8, -0x34(%rbp)
jne 0x3779b
jmp 0x377ba
leaq 0x6ca5(%rip), %rdi      # 0x3e447
leaq 0x6833(%rip), %rsi      # 0x3dfdc
movl $0x146, %edx            # imm = 0x146
leaq 0x6c4e(%rip), %rcx      # 0x3e403
callq 0x2170
cmpl $0x2, -0x34(%rbp)
je 0x377d0
cmpl $0x7, -0x34(%rbp)
je 0x377d0
cmpl $0x8, -0x34(%rbp)
jne 0x37862
jmp 0x377d2
movl -0x2c(%rbp), %eax
addl -0x3c(%rbp), %eax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x10(%rbp), %rdx
movq 0x20(%rdx), %rdx
movslq -0x28(%rbp), %rsi
imulq $0x14, %rsi, %rsi
addq %rsi, %rdx
movl 0x8(%rdx), %edx
shrl %edx
movl %edx, %edx
shlq $0x6, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jle 0x37859
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x20(%rcx), %rcx
movslq -0x28(%rbp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
shrl %ecx
movl %ecx, %ecx
shlq $0x6, %rcx
addq %rcx, %rax
movl (%rax), %ecx
subl -0x2c(%rbp), %ecx
movl -0x3c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x3c(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
jmp 0x377d2
movl -0x3c(%rbp), %eax
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x37738
movl -0x30(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)