// File: /workspace/github_c_makefile_star2_O0/lh3[P]minigraph/ggsimple.c
// Function: gg_write_intv
static void gg_write_intv(const gfa_t *g, const mg_gchains_t *gt, int32_t i, ed_intv_t *intv)
{
	const mg_gchain_t *gc = &gt->gc[i];
	int32_t j, l = gc->off, pl = 0, x = gc->ps, y = gc->qs, n = 0;
	ed_intv_t *p;
	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;
		if (op == 2 || op == 7 || op == 8) {
			while (x + rl > g->seg[gt->lc[l].v>>1].len) {
				p = &intv[n++];
				p->lc = l, p->vo = x, p->qo = y, p->po = pl, p->len = g->seg[gt->lc[l].v>>1].len - x, p->op = op;
				if (op == 7 || op == 8) y += p->len;
				rl -= p->len, pl += p->len, ++l, x = 0;
			}
		}
		p = &intv[n++];
		p->lc = l, p->vo = x, p->qo = y, p->po = pl, p->len = rl, p->op = op;
		if (op == 7 || op == 8) x += rl, y += rl, pl += rl;
		else if (op == 1) y += rl;
		else if (op == 2) x += rl, pl += rl;
	}
	assert(y == gc->qe && pl == gc->pe - gc->ps);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x68, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movq -0x28(%rbp), %rax
movl 0x24(%rax), %eax
movl %eax, -0x38(%rbp)
movq -0x28(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x3c(%rbp)
movl $0x0, -0x40(%rbp)
movq -0x28(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x378f7
jmp 0x37916
leaq 0x6aff(%rip), %rdi      # 0x3e3fd
leaq 0x66d7(%rip), %rsi      # 0x3dfdc
movl $0x158, %edx            # imm = 0x158
leaq 0x6b5f(%rip), %rcx      # 0x3e470
callq 0x2170
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x28(%rbp), %rcx
movq 0x48(%rcx), %rcx
cmpl (%rcx), %eax
jge 0x37b42
movq -0x28(%rbp), %rax
movq 0x48(%rax), %rax
movslq -0x2c(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
andq $0xf, %rax
movl %eax, -0x4c(%rbp)
movq -0x28(%rbp), %rax
movq 0x48(%rax), %rax
movslq -0x2c(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
shrq $0x4, %rax
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %eax
movl %eax, -0x54(%rbp)
cmpl $0x2, -0x4c(%rbp)
je 0x3797c
cmpl $0x7, -0x4c(%rbp)
je 0x3797c
cmpl $0x8, -0x4c(%rbp)
jne 0x37a84
jmp 0x3797e
movl -0x38(%rbp), %eax
addl -0x54(%rbp), %eax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x10(%rbp), %rdx
movq 0x20(%rdx), %rdx
movslq -0x30(%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 0x37a82
movq -0x20(%rbp), %rax
movl -0x40(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x40(%rbp)
movslq %ecx, %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movl -0x30(%rbp), %ecx
movq -0x48(%rbp), %rax
movl %ecx, (%rax)
movl -0x38(%rbp), %ecx
movq -0x48(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0x3c(%rbp), %ecx
movq -0x48(%rbp), %rax
movl %ecx, 0x8(%rax)
movl -0x34(%rbp), %ecx
movq -0x48(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x20(%rcx), %rcx
movslq -0x30(%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 -0x38(%rbp), %ecx
movq -0x48(%rbp), %rax
movl %ecx, 0x10(%rax)
movl -0x4c(%rbp), %ecx
movq -0x48(%rbp), %rax
movl %ecx, 0x14(%rax)
cmpl $0x7, -0x4c(%rbp)
je 0x37a44
cmpl $0x8, -0x4c(%rbp)
jne 0x37a51
movq -0x48(%rbp), %rax
movl 0x10(%rax), %eax
addl -0x3c(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x48(%rbp), %rax
movl 0x10(%rax), %ecx
movl -0x54(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x54(%rbp)
movq -0x48(%rbp), %rax
movl 0x10(%rax), %eax
addl -0x34(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movl $0x0, -0x38(%rbp)
jmp 0x3797e
jmp 0x37a84
movq -0x20(%rbp), %rax
movl -0x40(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x40(%rbp)
movslq %ecx, %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movl -0x30(%rbp), %ecx
movq -0x48(%rbp), %rax
movl %ecx, (%rax)
movl -0x38(%rbp), %ecx
movq -0x48(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0x3c(%rbp), %ecx
movq -0x48(%rbp), %rax
movl %ecx, 0x8(%rax)
movl -0x34(%rbp), %ecx
movq -0x48(%rbp), %rax
movl %ecx, 0xc(%rax)
movl -0x54(%rbp), %ecx
movq -0x48(%rbp), %rax
movl %ecx, 0x10(%rax)
movl -0x4c(%rbp), %ecx
movq -0x48(%rbp), %rax
movl %ecx, 0x14(%rax)
cmpl $0x7, -0x4c(%rbp)
je 0x37ae8
cmpl $0x8, -0x4c(%rbp)
jne 0x37b05
movl -0x54(%rbp), %eax
addl -0x38(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x54(%rbp), %eax
addl -0x3c(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x54(%rbp), %eax
addl -0x34(%rbp), %eax
movl %eax, -0x34(%rbp)
jmp 0x37b32
cmpl $0x1, -0x4c(%rbp)
jne 0x37b16
movl -0x54(%rbp), %eax
addl -0x3c(%rbp), %eax
movl %eax, -0x3c(%rbp)
jmp 0x37b30
cmpl $0x2, -0x4c(%rbp)
jne 0x37b2e
movl -0x54(%rbp), %eax
addl -0x38(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x54(%rbp), %eax
addl -0x34(%rbp), %eax
movl %eax, -0x34(%rbp)
jmp 0x37b30
jmp 0x37b32
jmp 0x37b34
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x3791d
movl -0x3c(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0x1c(%rcx), %eax
jne 0x37b65
movl -0x34(%rbp), %eax
movq -0x28(%rbp), %rcx
movl 0x28(%rcx), %ecx
movq -0x28(%rbp), %rdx
subl 0x24(%rdx), %ecx
cmpl %ecx, %eax
jne 0x37b65
jmp 0x37b84
leaq 0x6952(%rip), %rdi      # 0x3e4be
leaq 0x6469(%rip), %rsi      # 0x3dfdc
movl $0x169, %edx            # imm = 0x169
leaq 0x68f1(%rip), %rcx      # 0x3e470
callq 0x2170
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)