// File: 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
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x58(%rbp)
leaq -0x14(%rbp), %rsi
callq 0xad30
cmpq $0x0, %rax
je 0xa3bc
movq -0x58(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0xad30
cmpq $0x0, %rax
jne 0xa3c5
movb $0x0, -0x1(%rbp)
jmp 0xa726
movq -0x58(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
callq 0xa1f0
movl %eax, -0x1c(%rbp)
cmpl $-0x1, -0x1c(%rbp)
jne 0xa3e6
movb $0x0, -0x1(%rbp)
jmp 0xa726
movq -0x58(%rbp), %rdi
addq $0x30, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xaad0
movq %rax, %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
callq 0x3140
testb $0x1, %al
jne 0xa427
movq -0x58(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
movl -0x1c(%rbp), %ecx
xorl %r8d, %r8d
callq 0x9f50
movb $0x1, -0x1(%rbp)
jmp 0xa726
movq -0x58(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
movl -0x1c(%rbp), %ecx
movl $0x1, %r8d
callq 0x9f50
movl -0x1c(%rbp), %eax
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
jl 0xa722
movq -0x58(%rbp), %rdi
addq $0x30, %rdi
movslq -0x20(%rbp), %rsi
callq 0xaad0
movq %rax, %rdi
movl -0x14(%rbp), %esi
callq 0x3270
movq -0x58(%rbp), %rdi
movl %eax, -0x5c(%rbp)
addq $0x30, %rdi
movslq -0x20(%rbp), %rsi
callq 0xaad0
movq %rax, %rdi
movl -0x18(%rbp), %esi
callq 0x3270
movl %eax, %ecx
movl -0x5c(%rbp), %eax
cmpl %ecx, %eax
jle 0xa4a0
leaq -0x14(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0xa9b0
jmp 0xa4a2
movq -0x58(%rbp), %rdi
addq $0x30, %rdi
movslq -0x20(%rbp), %rsi
callq 0xaad0
movq %rax, %rdi
movl -0x14(%rbp), %esi
movl $0x1, %edx
callq 0x32d0
movl %eax, -0x24(%rbp)
cmpl $-0x1, -0x24(%rbp)
jne 0xa4d1
jmp 0xa59b
jmp 0xa4d3
movq -0x58(%rbp), %rdi
addq $0x60, %rdi
movslq -0x20(%rbp), %rsi
callq 0xaa50
movq %rax, %rdi
leaq -0x24(%rbp), %rsi
callq 0xaa70
movq %rax, %rdi
callq 0xad90
xorb $-0x1, %al
testb $0x1, %al
jne 0xa503
jmp 0xa596
movq -0x58(%rbp), %rdi
addq $0x60, %rdi
movslq -0x20(%rbp), %rsi
callq 0xaa50
movq %rax, %rdi
leaq -0x24(%rbp), %rsi
callq 0xaa70
movq %rax, %rdi
callq 0xadb0
movq %rax, -0x30(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xade0
movq -0x58(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %esi
movl -0x28(%rbp), %edx
movl -0x20(%rbp), %ecx
movl $0x1, %r8d
callq 0x9f50
movq -0x58(%rbp), %rdi
movl -0x24(%rbp), %esi
movl -0x28(%rbp), %edx
movl -0x20(%rbp), %ecx
addl $0x1, %ecx
movl $0x1, %r8d
callq 0x9dc0
movq -0x58(%rbp), %rdi
addq $0x30, %rdi
movl -0x20(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0xaad0
movq %rax, %rdi
movl -0x24(%rbp), %esi
movl -0x28(%rbp), %edx
callq 0x2f30
jmp 0xa4d3
jmp 0xa4a2
movb $0x0, -0x31(%rbp)
movb -0x31(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xa5ad
jmp 0xa70a
movq -0x58(%rbp), %rdi
addq $0x30, %rdi
movslq -0x20(%rbp), %rsi
callq 0xaad0
movq %rax, %rdi
movl -0x14(%rbp), %esi
xorl %edx, %edx
callq 0x32d0
movl %eax, -0x38(%rbp)
cmpl $-0x1, -0x38(%rbp)
jne 0xa5d9
jmp 0xa70a
jmp 0xa5db
movq -0x58(%rbp), %rdi
addq $0x48, %rdi
movslq -0x20(%rbp), %rsi
callq 0xaa50
movq %rax, %rdi
leaq -0x38(%rbp), %rsi
callq 0xaa70
movq %rax, %rdi
callq 0xad90
xorb $-0x1, %al
testb $0x1, %al
jne 0xa60b
jmp 0xa705
movq -0x58(%rbp), %rdi
addq $0x48, %rdi
movslq -0x20(%rbp), %rsi
callq 0xaa50
movq %rax, %rdi
leaq -0x38(%rbp), %rsi
callq 0xaa70
movq %rax, %rdi
callq 0xadb0
movq %rax, -0x48(%rbp)
leaq -0x48(%rbp), %rdi
callq 0xade0
movq -0x58(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x3c(%rbp)
addq $0x30, %rdi
movslq -0x20(%rbp), %rsi
callq 0xaad0
movq %rax, %rdi
movl -0x3c(%rbp), %esi
movl -0x18(%rbp), %edx
callq 0x3070
testb $0x1, %al
jne 0xa667
jmp 0xa6d3
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jg 0xa6a0
movq -0x58(%rbp), %rdi
addq $0x30, %rdi
movslq -0x4c(%rbp), %rsi
callq 0xaad0
movq %rax, %rdi
movl -0x38(%rbp), %esi
movl -0x3c(%rbp), %edx
callq 0x2f30
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0xa66e
movq -0x58(%rbp), %rdi
movb $0x1, -0x31(%rbp)
movl -0x38(%rbp), %esi
movl -0x3c(%rbp), %edx
movl -0x20(%rbp), %ecx
xorl %r8d, %r8d
callq 0x9f50
movq -0x58(%rbp), %rdi
movl -0x38(%rbp), %esi
movl -0x3c(%rbp), %edx
movl -0x20(%rbp), %ecx
movl $0x1, %r8d
callq 0x9dc0
jmp 0xa705
movq -0x58(%rbp), %rdi
movl -0x38(%rbp), %esi
movl -0x3c(%rbp), %edx
movl -0x20(%rbp), %ecx
xorl %r8d, %r8d
callq 0x9f50
movq -0x58(%rbp), %rdi
movl -0x38(%rbp), %esi
movl -0x3c(%rbp), %edx
movl -0x20(%rbp), %ecx
addl $0x1, %ecx
xorl %r8d, %r8d
callq 0x9dc0
jmp 0xa5db
jmp 0xa59f
testb $0x1, -0x31(%rbp)
je 0xa712
jmp 0xa722
jmp 0xa714
movl -0x20(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xa445
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)