// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rsi, %rbx
movslq 0x50(%rdi), %rsi
fldz
cmpq $0x2, %rsi
jl 0xfa47
movq %rdi, %r14
fstp %st(0)
leaq 0x58(%rsp), %r15
leaq 0x20(%rsp), %r12
movq %r15, %rdi
movq %r12, %rdx
callq 0x8852
xorps %xmm0, %xmm0
andq $0x0, 0x10(%r12)
movaps %xmm0, (%r12)
xorl %edx, %edx
leaq 0x4(%rsp), %r13
leaq 0x40(%rsp), %rbp
movl %edx, 0x4(%rsp)
movl 0x50(%r14), %eax
cmpl %eax, %edx
jge 0xf8ff
movslq %edx, %rax
movq 0x38(%r14), %rcx
imulq $0x18, %rax, %rsi
movq 0x8(%rcx,%rsi), %rdi
cmpq (%rcx,%rsi), %rdi
je 0xf8c1
movq 0x58(%rsp), %rcx
cmpl $0x0, (%rcx,%rax,4)
jne 0xf8f4
movq %rbp, %rdi
movq %r14, %rsi
movq %r15, %rcx
callq 0xebd1
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rcx
movq 0x58(%rsp), %rax
movq %rdx, %rsi
cmpq %rcx, %rsi
je 0xf8df
movslq (%rsi), %rdi
cmpl $0x0, (%rax,%rdi,4)
jne 0xfa59
movl $0x1, (%rax,%rdi,4)
addq $0x4, %rsi
jmp 0xf8a2
movq %r12, %rdi
movq %r13, %rsi
callq 0x6402
movslq 0x4(%rsp), %rax
movq 0x58(%rsp), %rcx
movl $0x1, (%rcx,%rax,4)
jmp 0xf8f4
movq 0x28(%rsp), %rsi
movq %r12, %rdi
callq 0x107ac
movq %rbp, %rdi
callq 0x38e4
movl 0x4(%rsp), %edx
incl %edx
jmp 0xf851
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %rdx
subq %rcx, %rdx
shrq $0x2, %rdx
cmpl %edx, %eax
jne 0xfab8
xorl %edx, %edx
testl %eax, %eax
cmovlel %edx, %eax
leaq 0x452cba(%rip), %r13    # 0x4625e0
cmpq %rdx, %rax
je 0xf939
movslq (%rcx,%rdx,4), %rsi
movl %edx, (%r13,%rsi,4)
incq %rdx
jmp 0xf926
fldz
xorl %ebp, %ebp
leaq 0x40(%rsp), %r15
fstpt 0xc(%rsp)
movq %r14, 0x18(%rsp)
movslq 0x50(%r14), %rax
cmpq %rax, %rbp
jge 0xfa2f
movq 0x20(%rsp), %rcx
movslq (%rcx,%rbp,4), %r14
testq %r14, %r14
js 0xfa78
cmpl %eax, %r14d
jge 0xfa78
movq (%rbx), %rax
movl (%rax,%r14,4), %eax
movl %eax, 0x4(%rsp)
movq %r15, %rdi
leaq 0x4(%rsp), %rsi
pushq $0x1
popq %rdx
leaq 0xb(%rsp), %rcx
callq 0xdbe8
movq 0x18(%rsp), %rax
movq 0x38(%rax), %rax
imulq $0x18, %r14, %rcx
movq (%rax,%rcx), %r12
movq 0x8(%rax,%rcx), %r14
cmpq %r14, %r12
je 0xf9d1
movslq (%r12), %rsi
movslq (%r13,%rsi,4), %rax
cmpq %rax, %rbp
jge 0xf9cb
shlq $0x2, %rsi
addq (%rbx), %rsi
movq %r15, %rdi
callq 0x6402
addq $0x4, %r12
jmp 0xf9a9
leaq 0x80(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x3896
movq %r12, %rdi
callq 0x1b9c2
fstpt 0x74(%rsp)
movq 0x18(%rsp), %r14
movq %r12, %rdi
callq 0x38e4
fldz
fldt 0x74(%rsp)
fucomi %st(1), %st
fstp %st(1)
jbe 0xfa97
fldt 0xc(%rsp)
fxch %st(1)
fucomi %st(1), %st
fxch %st(1)
fcmovnbe %st(1), %st
fstp %st(1)
fstpt 0xc(%rsp)
movq %r15, %rdi
callq 0x38e4
incq %rbp
jmp 0xf94b
leaq 0x20(%rsp), %rdi
callq 0x38e4
leaq 0x58(%rsp), %rdi
callq 0x38e4
fldt 0xc(%rsp)
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x113be(%rip), %rdi     # 0x20e1e
leaq 0x11278(%rip), %rsi     # 0x20cdf
leaq 0x114d4(%rip), %rcx     # 0x20f42
movl $0x163, %edx            # imm = 0x163
callq 0x2150
leaq 0x113e7(%rip), %rdi     # 0x20e66
leaq 0x11259(%rip), %rsi     # 0x20cdf
leaq 0x114b5(%rip), %rcx     # 0x20f42
movl $0x170, %edx            # imm = 0x170
callq 0x2150
fstp %st(0)
leaq 0x114e4(%rip), %rdi     # 0x20f84
leaq 0x11238(%rip), %rsi     # 0x20cdf
leaq 0x11494(%rip), %rcx     # 0x20f42
movl $0x178, %edx            # imm = 0x178
callq 0x2150
leaq 0x1138e(%rip), %rdi     # 0x20e4d
leaq 0x11219(%rip), %rsi     # 0x20cdf
leaq 0x11475(%rip), %rcx     # 0x20f42
movl $0x169, %edx            # imm = 0x169
callq 0x2150
jmp 0xfaf6
jmp 0xfaf1
jmp 0xfaf1
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x38e4
jmp 0xfaf9
jmp 0xfaf6
movq %rax, %rbx
jmp 0xfb03
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x38e4
leaq 0x20(%rsp), %rdi
callq 0x38e4
leaq 0x58(%rsp), %rdi
callq 0x38e4
movq %rbx, %rdi
callq 0x2340