// File: /workspace/github_c_makefile_star2_O0/lh3[P]minigraph/gfa-base.c
// Function: gfa_check_multi
int32_t gfa_check_multi(const gfa_t *g)
{
	uint32_t v, n_vtx = gfa_n_vtx(g);
	int32_t max_nv = -1, n_multi = 0;
	uint64_t *buf; // actually, uint32_t is enough
	for (v = 0; v < n_vtx; ++v) {
		int32_t nv = gfa_arc_n(g, v);
		max_nv = max_nv > nv? max_nv : nv;
	}
	if (max_nv == 1 || max_nv < 0) return 0;
	GFA_MALLOC(buf, max_nv);
	for (v = 0; v < n_vtx; ++v) {
		int32_t i, s, nv = gfa_arc_n(g, v);
		const gfa_arc_t *av = gfa_arc_a(g, v);
		for (i = 0; i < nv; ++i) buf[i] = av[i].w;
		radix_sort_gfa64(buf, buf + nv);
		for (s = 0, i = 1; i <= nv; ++i)
			if (i == nv || buf[i] != buf[s])
				n_multi += i - s - 1, s = i;
	}
	free(buf);
	return n_multi;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
shll %eax
movl %eax, -0x18(%rbp)
movl $0xffffffff, -0x1c(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x20(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x18(%rbp), %eax
jae 0x6d7e
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movl -0x14(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x2c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jle 0x6d67
movl -0x1c(%rbp), %eax
movl %eax, -0x44(%rbp)
jmp 0x6d6d
movl -0x2c(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x6d3d
cmpl $0x1, -0x1c(%rbp)
je 0x6d8a
cmpl $0x0, -0x1c(%rbp)
jge 0x6d96
movl $0x0, -0x4(%rbp)
jmp 0x6ebd
movslq -0x1c(%rbp), %rdi
shlq $0x3, %rdi
callq 0x2280
movq %rax, -0x28(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x18(%rbp), %eax
jae 0x6eae
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movl -0x14(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x58(%rcx), %rcx
movl -0x14(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x38(%rbp), %eax
jge 0x6e2c
movq -0x40(%rbp), %rax
movslq -0x30(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, %edx
movq -0x28(%rbp), %rax
movslq -0x30(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x6df9
movq -0x28(%rbp), %rdi
movq -0x28(%rbp), %rsi
movslq -0x38(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x5440
movl $0x0, -0x34(%rbp)
movl $0x1, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x38(%rbp), %eax
jg 0x6e9e
movl -0x30(%rbp), %eax
cmpl -0x38(%rbp), %eax
je 0x6e7c
movq -0x28(%rbp), %rax
movslq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x28(%rbp), %rcx
movslq -0x34(%rbp), %rdx
cmpq (%rcx,%rdx,8), %rax
je 0x6e91
movl -0x30(%rbp), %eax
subl -0x34(%rbp), %eax
subl $0x1, %eax
addl -0x20(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x34(%rbp)
jmp 0x6e93
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x6e52
jmp 0x6ea0
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x6dae
movq -0x28(%rbp), %rdi
callq 0x2040
movl -0x20(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)