// File: /workspace/github_c_makefile_star2_O0/lh3[P]minigraph/gfa-ed.c
// Function: gfa_ed_step
void gfa_ed_step(void *z_, uint32_t v1, int32_t off1, int32_t s_term, gfa_edrst_t *r)
{
	gfa_edbuf_t *z = (gfa_edbuf_t*)z_;
	const gfa_edopt_t *opt = z->opt;
	if (s_term < 0 && z->opt->s_term >= 0) s_term = z->opt->s_term;
	r->n_end = 0, r->n_iter = 0;
	while (z->n_a > 0) {
		z->a = gwf_ed_extend(&z->buf, opt, z->g, z->es, z->s, z->ql, z->q, v1, off1, &z->end_tb, &z->n_a, z->a, r);
		r->n_iter += z->n_a; // + z->buf.intv.n;
		if (r->end_off >= 0 || z->n_a == 0) break;
		if (r->n_end > 0) break;
		if (s_term >= 0 && z->s >= s_term) break;
		if (z->opt->i_term > 0 && r->n_iter > z->opt->i_term) break;
		++z->s;
		if (gfa_ed_dbg >= 1) {
			printf("[%s] dist=%d, n=%d, n_intv=%ld, n_tb=%ld\n", __func__, z->s, z->n_a, z->buf.intv.n, z->buf.t.n);
			if (gfa_ed_dbg == 2) gwf_ed_print_diag(z->g, z->n_a, z->a);
			if (gfa_ed_dbg == 3) gwf_ed_print_intv(z->buf.intv.n, z->buf.intv.a);
		}
	}
	if (opt->traceback && r->end_off >= 0)
		gwf_traceback(&z->buf, r->end_v, z->end_tb, r);
	r->s = r->end_v != (uint32_t)-1? z->s : -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x70, %rsp
movq %rdi, -0x28(%rbp)
movl %esi, -0x2c(%rbp)
movl %edx, -0x30(%rbp)
movl %ecx, -0x34(%rbp)
movq %r8, -0x40(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x50(%rbp)
cmpl $0x0, -0x34(%rbp)
jge 0x10916
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
cmpl $0x0, 0x10(%rax)
jl 0x10916
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x10(%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x40(%rbp), %rax
movl $0x0, 0x10(%rax)
movq -0x40(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x48(%rbp), %rax
cmpl $0x0, 0xbc(%rax)
jle 0x10b08
movq -0x48(%rbp), %rdi
addq $0x28, %rdi
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rax
movq (%rax), %rdx
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x48(%rbp), %rax
movl 0xb8(%rax), %r8d
movq -0x48(%rbp), %rax
movl 0x18(%rax), %r9d
movq -0x48(%rbp), %rax
movq 0x20(%rax), %r12
movl -0x2c(%rbp), %r15d
movl -0x30(%rbp), %r14d
movq -0x48(%rbp), %rbx
addq $0xc8, %rbx
movq -0x48(%rbp), %r11
addq $0xbc, %r11
movq -0x48(%rbp), %rax
movq 0xc0(%rax), %r10
movq -0x40(%rbp), %rax
movq %r12, (%rsp)
movl %r15d, 0x8(%rsp)
movl %r14d, 0x10(%rsp)
movq %rbx, 0x18(%rsp)
movq %r11, 0x20(%rsp)
movq %r10, 0x28(%rsp)
movq %rax, 0x30(%rsp)
callq 0x10b80
movq %rax, %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0xc0(%rax)
movq -0x48(%rbp), %rax
movslq 0xbc(%rax), %rcx
movq -0x40(%rbp), %rax
addq 0x18(%rax), %rcx
movq %rcx, 0x18(%rax)
movq -0x40(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jge 0x10a04
movq -0x48(%rbp), %rax
cmpl $0x0, 0xbc(%rax)
jne 0x10a09
jmp 0x10b08
movq -0x40(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jle 0x10a18
jmp 0x10b08
cmpl $0x0, -0x34(%rbp)
jl 0x10a32
movq -0x48(%rbp), %rax
movl 0xb8(%rax), %eax
cmpl -0x34(%rbp), %eax
jl 0x10a32
jmp 0x10b08
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
cmpq $0x0, 0x18(%rax)
jle 0x10a5c
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x48(%rbp), %rcx
movq 0x10(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jle 0x10a5c
jmp 0x10b08
movq -0x48(%rbp), %rax
movl 0xb8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xb8(%rax)
cmpl $0x1, 0x34c0e(%rip)     # 0x45684
jl 0x10b03
movq -0x48(%rbp), %rax
movl 0xb8(%rax), %edx
movq -0x48(%rbp), %rax
movl 0xbc(%rax), %ecx
movq -0x48(%rbp), %rax
movq 0x40(%rax), %r8
movq -0x48(%rbp), %rax
movq 0xa0(%rax), %r9
leaq 0x2bdbf(%rip), %rdi     # 0x3c869
leaq 0x2bde2(%rip), %rsi     # 0x3c893
movb $0x0, %al
callq 0x2130
cmpl $0x2, 0x34bc5(%rip)     # 0x45684
jne 0x10ae3
movq -0x48(%rbp), %rax
movq (%rax), %rdi
movq -0x48(%rbp), %rax
movslq 0xbc(%rax), %rsi
movq -0x48(%rbp), %rax
movq 0xc0(%rax), %rdx
callq 0x11760
cmpl $0x3, 0x34b9a(%rip)     # 0x45684
jne 0x10b01
movq -0x48(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x48(%rbp), %rax
movq 0x50(%rax), %rsi
callq 0x11830
jmp 0x10b03
jmp 0x1092d
movq -0x50(%rbp), %rax
cmpl $0x0, (%rax)
je 0x10b3d
movq -0x40(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jl 0x10b3d
movq -0x48(%rbp), %rdi
addq $0x28, %rdi
movq -0x40(%rbp), %rax
movl 0x4(%rax), %esi
movq -0x48(%rbp), %rax
movl 0xc8(%rax), %edx
movq -0x40(%rbp), %rcx
callq 0x118d0
movq -0x40(%rbp), %rax
cmpl $-0x1, 0x4(%rax)
je 0x10b56
movq -0x48(%rbp), %rax
movl 0xb8(%rax), %eax
movl %eax, -0x54(%rbp)
jmp 0x10b60
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x54(%rbp)
jmp 0x10b60
movl -0x54(%rbp), %ecx
movq -0x40(%rbp), %rax
movl %ecx, (%rax)
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)