// File: Laakeri[P]Triangulator/src/MCS.cpp
// Function: MCS::getFracHyperTreeWidth(Graph const&, std::vector<int, std::allocator<int>> const&)
ld getFracHyperTreeWidth(const Graph& G, const vector<int>& vertMap) {
	if (G.n <= 1) return 0;
	vector<int> u(G.n);
	vector<int> order;
	for (int i = 0; i < G.n; i++) {
		if (G.g[i].size() == 0) {
			order.push_back(i);
			u[i] = 1;
		}
		else if (u[i] == 0) {
			auto ord = MCS_L(G, i, u);
			for (int x : ord) {
				assert(u[x] == 0);
				u[x] = 1;
			}
			order.insert(order.end(), ord.begin(), ord.end());
		}
	}
	assert((int)order.size() == G.n);
	for (int i = 0; i < (int)order.size(); i++) {
		invOrd[order[i]] = i;
	}
	ld treeWidth = 0;
	for (int i = 0; i < G.n; i++) {
		int x = order[i];
		assert(0<=x&&x<G.n);
		vector<int> nb = {vertMap[x]};
		for (int nx : G.g[x]) {
			if (invOrd[nx] > i) {
				nb.push_back(vertMap[nx]);
			}
		}
		ld setCoverSol = SetCover::solveFrac(nb);
		assert(setCoverSol > 0);
		treeWidth = max(treeWidth, setCoverSol);
	}
	return treeWidth;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x1, 0x50(%rax)
jg 0x2b3e7
fldz
fstpt -0x10(%rbp)
jmp 0x2ba1c
movq -0x18(%rbp), %rax
movslq 0x50(%rax), %rax
movq %rax, -0x188(%rbp)
leaq -0x39(%rbp), %rdi
movq %rdi, -0x180(%rbp)
callq 0x111b0
movq -0x188(%rbp), %rsi
movq -0x180(%rbp), %rdx
leaq -0x38(%rbp), %rdi
callq 0x17ab0
jmp 0x2b41f
leaq -0x39(%rbp), %rdi
callq 0x6620
leaq -0x68(%rbp), %rdi
callq 0xdf40
movl $0x0, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x50(%rcx), %eax
jge 0x2b672
movq -0x18(%rbp), %rdi
addq $0x38, %rdi
movslq -0x6c(%rbp), %rsi
callq 0xbba0
movq %rax, %rdi
callq 0x59a0
cmpq $0x0, %rax
jne 0x2b4b9
leaq -0x68(%rbp), %rdi
leaq -0x6c(%rbp), %rsi
callq 0xdff0
jmp 0x2b476
movslq -0x6c(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x178f0
movl $0x1, (%rax)
jmp 0x2b662
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x39(%rbp), %rdi
callq 0x6620
jmp 0x2ba28
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x2ba08
movslq -0x6c(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x178f0
cmpl $0x0, (%rax)
jne 0x2b660
movq -0x18(%rbp), %rsi
movl -0x6c(%rbp), %edx
leaq -0x88(%rbp), %rdi
leaq -0x38(%rbp), %rcx
callq 0x29a80
jmp 0x2b4e8
leaq -0x88(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rdi
callq 0xe060
movq %rax, -0x98(%rbp)
movq -0x90(%rbp), %rdi
callq 0xe090
movq %rax, -0xa0(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0xe0c0
testb $0x1, %al
jne 0x2b535
jmp 0x2b5a6
leaq -0x98(%rbp), %rdi
callq 0xe100
movl (%rax), %eax
movl %eax, -0xa4(%rbp)
movslq -0xa4(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x178f0
cmpl $0x0, (%rax)
jne 0x2b560
jmp 0x2b57f
leaq 0x2e887(%rip), %rdi     # 0x59dee
leaq 0x2e741(%rip), %rsi     # 0x59caf
movl $0x163, %edx            # imm = 0x163
leaq 0x2e998(%rip), %rcx     # 0x59f12
callq 0x31a0
movslq -0xa4(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x178f0
movl $0x1, (%rax)
leaq -0x98(%rbp), %rdi
callq 0xe120
jmp 0x2b51c
leaq -0x68(%rbp), %rdi
movq %rdi, -0x198(%rbp)
callq 0xe090
movq %rax, -0xb8(%rbp)
leaq -0xb0(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x177f0
leaq -0x88(%rbp), %rdi
movq %rdi, -0x1a0(%rbp)
callq 0xe060
movq -0x1a0(%rbp), %rdi
movq %rax, -0xc0(%rbp)
callq 0xe090
movq -0x198(%rbp), %rdi
movq %rax, -0xc8(%rbp)
movq -0xb0(%rbp), %rsi
movq -0xc0(%rbp), %rdx
movq -0xc8(%rbp), %rcx
callq 0x2de00
movq %rax, -0x190(%rbp)
jmp 0x2b627
movq -0x190(%rbp), %rax
movq %rax, -0xd0(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x6d30
jmp 0x2b660
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x6d30
jmp 0x2ba08
jmp 0x2b662
jmp 0x2b664
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x2b438
leaq -0x68(%rbp), %rdi
callq 0x59a0
movq -0x18(%rbp), %rcx
cmpl 0x50(%rcx), %eax
jne 0x2b686
jmp 0x2b6a5
leaq 0x2e790(%rip), %rdi     # 0x59e1d
leaq 0x2e61b(%rip), %rsi     # 0x59caf
movl $0x169, %edx            # imm = 0x169
leaq 0x2e872(%rip), %rcx     # 0x59f12
callq 0x31a0
movl $0x0, -0xd4(%rbp)
movl -0xd4(%rbp), %eax
movl %eax, -0x1a4(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x59a0
movq %rax, %rcx
movl -0x1a4(%rbp), %eax
cmpl %ecx, %eax
jge 0x2b711
movl -0xd4(%rbp), %eax
movl %eax, -0x1a8(%rbp)
movslq -0xd4(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x178f0
movl -0x1a8(%rbp), %edx
movslq (%rax), %rcx
leaq 0x480fb3(%rip), %rax    # 0x4ac6b0
movl %edx, (%rax,%rcx,4)
movl -0xd4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd4(%rbp)
jmp 0x2b6af
fldz
fstpt -0xf0(%rbp)
movl $0x0, -0xf4(%rbp)
movl -0xf4(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x50(%rcx), %eax
jge 0x2b9eb
movslq -0xf4(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x178f0
movl (%rax), %eax
movl %eax, -0xf8(%rbp)
xorl %eax, %eax
xorl %ecx, %ecx
cmpl -0xf8(%rbp), %ecx
movb %al, -0x1a9(%rbp)
jg 0x2b776
movl -0xf8(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x50(%rcx), %eax
setl %al
movb %al, -0x1a9(%rbp)
movb -0x1a9(%rbp), %al
testb $0x1, %al
jne 0x2b782
jmp 0x2b784
jmp 0x2b7a3
leaq 0x2e6ab(%rip), %rdi     # 0x59e36
leaq 0x2e51d(%rip), %rsi     # 0x59caf
movl $0x170, %edx            # imm = 0x170
leaq 0x2e774(%rip), %rcx     # 0x59f12
callq 0x31a0
movq -0x20(%rbp), %rdi
movslq -0xf8(%rbp), %rsi
callq 0x17a50
movl (%rax), %eax
movl %eax, -0x124(%rbp)
leaq -0x124(%rbp), %rax
movq %rax, -0x120(%rbp)
movq $0x1, -0x118(%rbp)
leaq -0x125(%rbp), %rdi
movq %rdi, -0x1b8(%rbp)
callq 0x111b0
movq -0x1b8(%rbp), %rcx
movq -0x120(%rbp), %rsi
movq -0x118(%rbp), %rdx
leaq -0x110(%rbp), %rdi
callq 0x26d30
jmp 0x2b80a
leaq -0x125(%rbp), %rdi
callq 0x6620
movq -0x18(%rbp), %rdi
addq $0x38, %rdi
movslq -0xf8(%rbp), %rsi
callq 0xbba0
movq %rax, -0x130(%rbp)
movq -0x130(%rbp), %rdi
callq 0x6680
movq %rax, -0x138(%rbp)
movq -0x130(%rbp), %rdi
callq 0x66b0
movq %rax, -0x140(%rbp)
leaq -0x138(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0xbbc0
testb $0x1, %al
jne 0x2b873
jmp 0x2b904
leaq -0x138(%rbp), %rdi
callq 0xbc00
movl (%rax), %eax
movl %eax, -0x144(%rbp)
movslq -0x144(%rbp), %rcx
leaq 0x480e1b(%rip), %rax    # 0x4ac6b0
movl (%rax,%rcx,4), %eax
cmpl -0xf4(%rbp), %eax
jle 0x2b8f1
movq -0x20(%rbp), %rdi
movslq -0x144(%rbp), %rsi
callq 0x17a50
movq %rax, %rsi
leaq -0x110(%rbp), %rdi
callq 0xdff0
jmp 0x2b8c1
jmp 0x2b8f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x125(%rbp), %rdi
callq 0x6620
jmp 0x2ba08
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x2b9dd
jmp 0x2b8f3
leaq -0x138(%rbp), %rdi
callq 0xbc80
jmp 0x2b857
leaq -0x178(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x6490
jmp 0x2b919
leaq -0x178(%rbp), %rdi
callq 0x4c830
fstpt -0x1c4(%rbp)
jmp 0x2b92d
leaq -0x178(%rbp), %rdi
callq 0x6d30
fldt -0x1c4(%rbp)
fstpt -0x160(%rbp)
fldt -0x160(%rbp)
fldz
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
jbe 0x2b959
jmp 0x2b957
jmp 0x2b992
leaq 0x2e5f4(%rip), %rdi     # 0x59f54
leaq 0x2e348(%rip), %rsi     # 0x59caf
movl $0x178, %edx            # imm = 0x178
leaq 0x2e59f(%rip), %rcx     # 0x59f12
callq 0x31a0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x178(%rbp), %rdi
callq 0x6d30
jmp 0x2b9dd
leaq -0xf0(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0x23d40
movq %rax, -0x1d0(%rbp)
jmp 0x2b9ae
movq -0x1d0(%rbp), %rax
fldt (%rax)
fstpt -0xf0(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x6d30
movl -0xf4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf4(%rbp)
jmp 0x2b723
leaq -0x110(%rbp), %rdi
callq 0x6d30
jmp 0x2ba08
fldt -0xf0(%rbp)
fstpt -0x10(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x6d30
leaq -0x38(%rbp), %rdi
callq 0x6d30
jmp 0x2ba1c
leaq -0x68(%rbp), %rdi
callq 0x6d30
leaq -0x38(%rbp), %rdi
callq 0x6d30
jmp 0x2ba28
fldt -0x10(%rbp)
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x3480
nopw %cs:(%rax,%rax)