// File: /workspace/github_cpp_makefile_star2_O1/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, 0x50(%rsp)
movslq 0x50(%rdi), %rsi
fldz
cmpq $0x2, %rsi
jl 0x14769
movq %rdi, %r14
fstp %st(0)
leaq 0x58(%rsp), %rdi
leaq 0x20(%rsp), %r15
movq %r15, %rdx
callq 0xa6ba
xorps %xmm0, %xmm0
movaps %xmm0, (%r15)
movq $0x0, 0x10(%r15)
movl $0x0, (%rsp)
movl 0x50(%r14), %esi
testl %esi, %esi
jle 0x145af
xorl %edx, %edx
leaq 0x20(%rsp), %r15
movq %rsp, %r12
leaq 0x8(%rsp), %r13
leaq 0x58(%rsp), %rbp
movslq %edx, %rax
movq 0x38(%r14), %rcx
leaq (%rax,%rax,2), %rsi
movq 0x8(%rcx,%rsi,8), %rdi
cmpq (%rcx,%rsi,8), %rdi
je 0x14567
movq 0x58(%rsp), %rcx
cmpl $0x0, (%rcx,%rax,4)
jne 0x1459b
movq %r13, %rdi
movq %r14, %rsi
movq %rbp, %rcx
callq 0x134fd
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
cmpq %rcx, %rdx
je 0x14541
movq 0x58(%rsp), %rax
movq %rdx, %rsi
movslq (%rsi), %rdi
cmpl $0x0, (%rax,%rdi,4)
jne 0x1477b
movl $0x1, (%rax,%rdi,4)
addq $0x4, %rsi
cmpq %rcx, %rsi
jne 0x14524
movq 0x28(%rsp), %rsi
movq %r15, %rdi
callq 0x15cde
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1459b
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
jmp 0x1459b
movq 0x28(%rsp), %rsi
cmpq 0x30(%rsp), %rsi
je 0x14580
movl %edx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x28(%rsp)
jmp 0x1458b
movq %r15, %rdi
movq %r12, %rdx
callq 0x8fde
movslq (%rsp), %rax
movq 0x58(%rsp), %rcx
movl $0x1, (%rcx,%rax,4)
movl (%rsp), %edx
incl %edx
movl %edx, (%rsp)
movl 0x50(%r14), %esi
cmpl %esi, %edx
jl 0x144da
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
subq %rax, %rcx
shrq $0x2, %rcx
cmpl %ecx, %esi
jne 0x147da
testl %ecx, %ecx
jle 0x145ea
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
xorl %edx, %edx
leaq 0x453ff5(%rip), %rsi    # 0x4685d0
movslq (%rax,%rdx,4), %rdi
movl %edx, (%rsi,%rdi,4)
incq %rdx
cmpq %rdx, %rcx
jne 0x145db
movl 0x50(%r14), %eax
fldz
fstpt 0x44(%rsp)
testl %eax, %eax
jle 0x14737
fldz
xorl %r12d, %r12d
leaq 0x70(%rsp), %rbx
leaq 0x453fc3(%rip), %r13    # 0x4685d0
fstpt 0x44(%rsp)
movq %r14, %r15
movq 0x20(%rsp), %rcx
movslq (%rcx,%r12,4), %r14
testq %r14, %r14
js 0x147bb
cmpl %eax, %r14d
jge 0x147bb
movq 0x50(%rsp), %rax
movq (%rax), %rax
movl (%rax,%r14,4), %eax
movl %eax, (%rsp)
movl $0x1, %edx
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
leaq 0x7(%rsp), %rcx
callq 0x121d8
movq 0x38(%r15), %rax
leaq (%r14,%r14,2), %rcx
movq (%rax,%rcx,8), %rbp
movq 0x8(%rax,%rcx,8), %r14
cmpq %r14, %rbp
je 0x146b0
movslq (%rbp), %rdx
movslq (%r13,%rdx,4), %rax
cmpq %rax, %r12
jge 0x146aa
shlq $0x2, %rdx
movq 0x50(%rsp), %rax
addq (%rax), %rdx
movq 0x10(%rsp), %rsi
cmpq 0x18(%rsp), %rsi
je 0x146a0
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x10(%rsp)
jmp 0x146aa
leaq 0x8(%rsp), %rdi
callq 0x8fde
addq $0x4, %rbp
jmp 0x14666
movq %rbx, %rdi
leaq 0x8(%rsp), %rsi
callq 0x431c
movq %rbx, %rdi
callq 0x2398f
movq %r15, %r14
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x146f0
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
fstpt 0x8c(%rsp)
callq 0x2210
fldt 0x8c(%rsp)
fldz
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
jbe 0x1479a
fldt 0x44(%rsp)
fxch %st(1)
fucomi %st(1), %st
fxch %st(1)
fcmovnbe %st(1), %st
fstp %st(1)
fstpt 0x44(%rsp)
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x14727
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
incq %r12
movslq 0x50(%r14), %rax
cmpq %rax, %r12
jl 0x14611
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1474e
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x14765
movq 0x68(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
fldt 0x44(%rsp)
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1668c(%rip), %rdi     # 0x2ae0e
leaq 0x16546(%rip), %rsi     # 0x2accf
leaq 0x167a2(%rip), %rcx     # 0x2af32
movl $0x163, %edx            # imm = 0x163
callq 0x2140
fstp %st(0)
leaq 0x167d1(%rip), %rdi     # 0x2af74
leaq 0x16525(%rip), %rsi     # 0x2accf
leaq 0x16781(%rip), %rcx     # 0x2af32
movl $0x178, %edx            # imm = 0x178
callq 0x2140
leaq 0x16694(%rip), %rdi     # 0x2ae56
leaq 0x16506(%rip), %rsi     # 0x2accf
leaq 0x16762(%rip), %rcx     # 0x2af32
movl $0x170, %edx            # imm = 0x170
callq 0x2140
leaq 0x1665c(%rip), %rdi     # 0x2ae3d
leaq 0x164e7(%rip), %rsi     # 0x2accf
leaq 0x16743(%rip), %rcx     # 0x2af32
movl $0x169, %edx            # imm = 0x169
callq 0x2140
jmp 0x147ff
jmp 0x14827
jmp 0x147ff
movq %rax, %rbx
jmp 0x14841
jmp 0x14827
fstp %st(0)
movq %rax, %rbx
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x1482a
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
jmp 0x1482a
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x14841
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x14858
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x1486f
movq 0x68(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2310