// File: /workspace/github_c_makefile_star2_O0/rikuu[P]kermit/miniasm/asg.c
// Function: asg_arc_del_trans
int asg_arc_del_trans(asg_t *g, int fuzz)
{
	uint8_t *mark;
	uint32_t v, n_vtx = g->n_seq * 2, n_reduced = 0;

	mark = (uint8_t*)calloc(n_vtx, 1);
	for (v = 0; v < n_vtx; ++v) {
		uint32_t L, i, nv = asg_arc_n(g, v);
		asg_arc_t *av = asg_arc_a(g, v);
		if (nv == 0) continue; // no hits
		if (g->seq[v>>1].del) {
			for (i = 0; i < nv; ++i) av[i].del = 1, ++n_reduced;
			continue;
		}
		for (i = 0; i < nv; ++i) mark[av[i].v] = 1;
		L = asg_arc_len(av[nv-1]) + fuzz;
		for (i = 0; i < nv; ++i) {
			uint32_t w = av[i].v;
			uint32_t j, nw = asg_arc_n(g, w);
			asg_arc_t *aw = asg_arc_a(g, w);
			if (mark[av[i].v] != 1) continue;
			for (j = 0; j < nw && asg_arc_len(aw[j]) + asg_arc_len(av[i]) <= L; ++j)
				if (mark[aw[j].v]) mark[aw[j].v] = 2;
		}
		#if 0
		for (i = 0; i < nv; ++i) {
			uint32_t w = av[i].v;
			uint32_t j, nw = asg_arc_n(g, w);
			asg_arc_t *aw = asg_arc_a(g, w);
			for (j = 0; j < nw && (j == 0 || asg_arc_len(aw[j]) < fuzz); ++j)
				if (mark[aw[j].v]) mark[aw[j].v] = 2;
		}
		#endif
		for (i = 0; i < nv; ++i) {
			if (mark[av[i].v] == 2) av[i].del = 1, ++n_reduced;
			mark[av[i].v] = 0;
		}
	}
	free(mark);
	fprintf(stderr, "[M::%s] transitively reduced %d arcs\n", __func__, n_reduced);
	if (n_reduced) {
		asg_cleanup(g);
		asg_symm(g);
	}
	return n_reduced;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
shll %eax
movl %eax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x20(%rbp), %eax
movl %eax, %edi
movl $0x1, %esi
callq 0x10e0
movq %rax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jae 0x3deb
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x20(%rcx), %rcx
movl -0x1c(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
cmpl $0x0, -0x30(%rbp)
jne 0x3b90
jmp 0x3ddd
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x1c(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x3bf2
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jae 0x3bed
movq -0x38(%rbp), %rax
movl -0x2c(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, 0xc(%rax)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x3bb1
jmp 0x3ddd
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jae 0x3c25
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
movl -0x2c(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
movb $0x1, (%rax,%rcx)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x3bf9
movq -0x38(%rbp), %rax
movl -0x30(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
addl -0xc(%rbp), %eax
movl %eax, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jae 0x3d61
movq -0x38(%rbp), %rax
movl -0x2c(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x3c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x44(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x20(%rcx), %rcx
movl -0x3c(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
movl -0x2c(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x1, %eax
je 0x3cc3
jmp 0x3d53
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %ecx
xorl %eax, %eax
cmpl -0x44(%rbp), %ecx
movb %al, -0x51(%rbp)
jae 0x3d04
movq -0x50(%rbp), %rax
movl -0x40(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq -0x38(%rbp), %rcx
movl -0x2c(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
addl %ecx, %eax
cmpl -0x28(%rbp), %eax
setbe %al
movb %al, -0x51(%rbp)
movb -0x51(%rbp), %al
testb $0x1, %al
jne 0x3d0d
jmp 0x3d51
movq -0x18(%rbp), %rax
movq -0x50(%rbp), %rcx
movl -0x40(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
cmpb $0x0, (%rax,%rcx)
je 0x3d41
movq -0x18(%rbp), %rax
movq -0x50(%rbp), %rcx
movl -0x40(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
movb $0x2, (%rax,%rcx)
jmp 0x3d43
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x3cca
jmp 0x3d53
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x3c48
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jae 0x3ddb
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
movl -0x2c(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x2, %eax
jne 0x3db7
movq -0x38(%rbp), %rax
movl -0x2c(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, 0xc(%rax)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
movl -0x2c(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
movb $0x0, (%rax,%rcx)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x3d68
jmp 0x3ddd
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x3b41
movq -0x18(%rbp), %rdi
callq 0x1040
movq 0xf1fd(%rip), %rax      # 0x12ff8
movq (%rax), %rdi
movl -0x24(%rbp), %ecx
leaq 0xb2d4(%rip), %rsi      # 0xf0dc
leaq 0xb2f3(%rip), %rdx      # 0xf102
movb $0x0, %al
callq 0x1110
cmpl $0x0, -0x24(%rbp)
je 0x3e2e
movq -0x8(%rbp), %rdi
callq 0x35d0
movq -0x8(%rbp), %rdi
callq 0x37d0
movl -0x24(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)