// File: /workspace/github_cpp_makefile_star2_O1/yogesh1q2w[P]Dynamic-Graph-Algorithms/connectivity.cpp
// Function: connectivity::delete_edge(int, int)
bool connectivity::delete_edge(int u, int v) {
	if(!vertices.count(u) || !vertices.count(v))
		return false;		//if u or v are absent in graph
	int lvl = level(u, v);
	if(lvl == -1)
		return false;
	if(!spf[0].cut(u, v)) {		//if not a tree edge
		remove_edge_level(u, v, lvl, false);
		return true;
	}
	//in case of tree edge, find a replacement edge in the tree
	remove_edge_level(u, v, lvl, true);

	for(int i = lvl; i >= 0; i--) {
		if(spf[i].size(u) > spf[i].size(v))
			swap(u, v);
		while(1) {
			int x = spf[i].get_adjacent(u, true);
			if(x == -1)
				break;
			while(!treeadj[i][x].empty()) {
				int y = *treeadj[i][x].begin();
				remove_edge_level(x, y, i, true);
				add_edge_level(x, y, i + 1, true);
				spf[i + 1].link(x, y);
			}
		}

		bool ff = false;

		while(!ff) {
			int x = spf[i].get_adjacent(u, false);
			if(x == -1) 
				break;
			while(!adj[i][x].empty()) {
				int y = *adj[i][x].begin();
				if(spf[i].is_connected(y, v)) {
					for(int j = 0; j <= i; j++)
						spf[j].link(x, y);
					ff = true;
					remove_edge_level(x, y, i, false);
					add_edge_level(x, y, i, true);
					break;
				}
				else {
					remove_edge_level(x, y, i, false);
					add_edge_level(x, y, i + 1, false);
				}
			}
		}
		if(ff)
			break;
	}
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %edx, %r13d
movl %esi, %r14d
movq %rdi, %r15
movq 0x10(%rdi), %rcx
leaq 0x8(%rdi), %rax
movq %rax, %rdx
testq %rcx, %rcx
je 0x49ac
movq %rcx, %rsi
movq %rax, %rdx
xorl %edi, %edi
cmpl %r14d, 0x20(%rsi)
setl %dil
cmovgeq %rsi, %rdx
movq 0x10(%rsi,%rdi,8), %rsi
testq %rsi, %rsi
jne 0x4994
movq %rax, %rsi
cmpq %rax, %rdx
je 0x49bf
cmpl %r14d, 0x20(%rdx)
cmovgq %rax, %rdx
movq %rdx, %rsi
cmpq %rax, %rsi
je 0x4cbd
movq %rax, %rdx
testq %rcx, %rcx
je 0x49eb
movq %rax, %rdx
xorl %esi, %esi
cmpl %r13d, 0x20(%rcx)
setl %sil
cmovgeq %rcx, %rdx
movq 0x10(%rcx,%rsi,8), %rcx
testq %rcx, %rcx
jne 0x49d3
movq %rax, %rcx
cmpq %rax, %rdx
je 0x49fe
cmpl %r13d, 0x20(%rdx)
cmovgq %rax, %rdx
movq %rdx, %rcx
cmpq %rax, %rcx
je 0x4cbd
movq %r15, %rdi
movl %r14d, %esi
movl %r13d, %edx
callq 0x483e
movl %eax, %ebx
cmpl $-0x1, %eax
setne %al
je 0x4cbf
movq 0x30(%r15), %rdi
movl %r14d, %esi
movl %r13d, %edx
callq 0x2d82
testb %al, %al
je 0x4cce
movq %r15, %rdi
movl %r14d, %esi
movl %r13d, %edx
movl %ebx, %ecx
movl $0x1, %r8d
callq 0x44ca
movb $0x1, %al
testl %ebx, %ebx
js 0x4cbf
movl %r14d, -0x3c(%rbp)
leal 0x1(%rbx), %r14d
movl %ebx, %ecx
movq %rcx, -0x48(%rbp)
movl %r13d, -0x34(%rbp)
imulq $0x118, %rcx, %rbx      # imm = 0x118
movq 0x30(%r15), %rdi
addq %rbx, %rdi
movl -0x3c(%rbp), %r12d
movl %r12d, %esi
callq 0x2ee8
movl %eax, -0x30(%rbp)
movq 0x30(%r15), %rdi
movq %rbx, -0x58(%rbp)
addq %rbx, %rdi
movl -0x34(%rbp), %ebx
movl %ebx, %esi
callq 0x2ee8
cmpl %eax, -0x30(%rbp)
cmovgl %r12d, %r13d
cmovgl %ebx, %r12d
movl %r12d, -0x3c(%rbp)
leaq -0x38(%rbp), %r12
movq -0x48(%rbp), %rax
leaq 0x1(%rax), %rbx
movl %r13d, -0x4c(%rbp)
movq 0x30(%r15), %rdi
addq -0x58(%rbp), %rdi
movl -0x3c(%rbp), %esi
movl $0x1, %edx
callq 0x2f20
movl %eax, -0x38(%rbp)
cmpl $-0x1, %eax
je 0x4b6b
movl %eax, -0x34(%rbp)
imulq $0x38, -0x48(%rbp), %r13
movq 0x60(%r15), %rdi
addq %r13, %rdi
movq %r12, %rsi
callq 0x5cb8
cmpq $0x0, 0x18(%rax)
je 0x4b5d
movq 0x60(%r15), %rdi
addq %r13, %rdi
movq %r12, %rsi
callq 0x5cb8
movq 0x10(%rax), %rax
movl 0x8(%rax), %r12d
movl -0x38(%rbp), %esi
movq %r15, %rdi
movl %r12d, %edx
movq -0x48(%rbp), %rcx
movl $0x1, %r8d
callq 0x44ca
movl -0x38(%rbp), %esi
movq %r15, %rdi
movl %r12d, %edx
movl %ebx, %ecx
movl $0x1, %r8d
callq 0x4388
imulq $0x118, %rbx, %rdi      # imm = 0x118
addq 0x30(%r15), %rdi
movl -0x38(%rbp), %esi
movl %r12d, %edx
leaq -0x38(%rbp), %r12
callq 0x2be4
jmp 0x4ae6
cmpl $-0x1, -0x34(%rbp)
movl -0x4c(%rbp), %r13d
jne 0x4abd
movq -0x48(%rbp), %rbx
leal 0x1(%rbx), %eax
movl %eax, -0x60(%rbp)
movl $0x0, -0x30(%rbp)
movb $0x1, %al
leaq -0x2c(%rbp), %r12
testb $0x1, -0x30(%rbp)
jne 0x4ca5
movq 0x30(%r15), %rdi
addq -0x58(%rbp), %rdi
movl -0x3c(%rbp), %esi
xorl %edx, %edx
callq 0x2f20
movl %eax, -0x2c(%rbp)
movl %eax, -0x5c(%rbp)
cmpl $-0x1, %eax
je 0x4c99
imulq $0x38, %rbx, %rbx
movq 0x48(%r15), %rdi
addq %rbx, %rdi
movq %r12, %rsi
callq 0x5cb8
cmpq $0x0, 0x18(%rax)
je 0x4c95
addq 0x48(%r15), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5cb8
movq 0x10(%rax), %rax
movl 0x8(%rax), %r12d
movq 0x30(%r15), %rdi
addq -0x58(%rbp), %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x2cf2
movb %al, -0x34(%rbp)
testb %al, %al
je 0x4c5a
xorl %r13d, %r13d
xorl %ebx, %ebx
movq 0x30(%r15), %rdi
addq %r13, %rdi
movl -0x2c(%rbp), %esi
movl %r12d, %edx
callq 0x2be4
incq %rbx
addq $0x118, %r13            # imm = 0x118
cmpq %rbx, %r14
jne 0x4c01
movl -0x2c(%rbp), %esi
movq %r15, %rdi
movl %r12d, %edx
movq -0x48(%rbp), %rbx
movl %ebx, %ecx
xorl %r8d, %r8d
callq 0x44ca
movl -0x2c(%rbp), %esi
movq %r15, %rdi
movl %r12d, %edx
movl %ebx, %ecx
movl $0x1, %r8d
callq 0x4388
movb $0x1, %al
movl %eax, -0x30(%rbp)
movl -0x4c(%rbp), %r13d
jmp 0x4c85
movl -0x2c(%rbp), %esi
movq %r15, %rdi
movl %r12d, %edx
movq -0x48(%rbp), %rbx
movl %ebx, %ecx
xorl %r8d, %r8d
callq 0x44ca
movl -0x2c(%rbp), %esi
movq %r15, %rdi
movl %r12d, %edx
movl -0x60(%rbp), %ecx
xorl %r8d, %r8d
callq 0x4388
cmpb $0x0, -0x34(%rbp)
leaq -0x2c(%rbp), %r12
je 0x4bad
jmp 0x4c99
movq -0x48(%rbp), %rbx
cmpl $-0x1, -0x5c(%rbp)
movb $0x1, %al
jne 0x4b82
testb $0x1, -0x30(%rbp)
jne 0x4cbf
leaq -0x1(%rbx), %rcx
decq %r14
testq %rbx, %rbx
jg 0x4a64
jmp 0x4cbf
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
movl %r14d, %esi
movl %r13d, %edx
movl %ebx, %ecx
xorl %r8d, %r8d
callq 0x44ca
movb $0x1, %al
jmp 0x4cbf
nop