// File: Laakeri[P]Triangulator/src/MCS.cpp
// Function: MCS::getHyperTreeWidth(Graph const&, std::vector<int, std::allocator<int>> const&)
int getHyperTreeWidth(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;
	}
	int 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]);
			}
		}
		auto setCoverSol = SetCover::solve(nb, treeWidth, G.n);
		assert(setCoverSol.size() > 0);
		assert(setCoverSol[0] != -1);
		treeWidth = max(treeWidth, (int)setCoverSol.size());
	}
	return treeWidth;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x1, 0x50(%rax)
jg 0x2ad09
movl $0x0, -0x4(%rbp)
jmp 0x2b3a2
movq -0x10(%rbp), %rax
movslq 0x50(%rax), %rax
movq %rax, -0x170(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x168(%rbp)
callq 0x111b0
movq -0x170(%rbp), %rsi
movq -0x168(%rbp), %rdx
leaq -0x30(%rbp), %rdi
callq 0x17ab0
jmp 0x2ad41
leaq -0x31(%rbp), %rdi
callq 0x6620
leaq -0x60(%rbp), %rdi
callq 0xdf40
movl $0x0, -0x64(%rbp)
movl -0x64(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x50(%rcx), %eax
jge 0x2af85
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
movslq -0x64(%rbp), %rsi
callq 0xbba0
movq %rax, %rdi
callq 0x59a0
cmpq $0x0, %rax
jne 0x2addb
leaq -0x60(%rbp), %rdi
leaq -0x64(%rbp), %rsi
callq 0xdff0
jmp 0x2ad98
movslq -0x64(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x178f0
movl $0x1, (%rax)
jmp 0x2af75
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x31(%rbp), %rdi
callq 0x6620
jmp 0x2b3ae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2b38e
movslq -0x64(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x178f0
cmpl $0x0, (%rax)
jne 0x2af73
movq -0x10(%rbp), %rsi
movl -0x64(%rbp), %edx
leaq -0x80(%rbp), %rdi
leaq -0x30(%rbp), %rcx
callq 0x29a80
jmp 0x2ae07
leaq -0x80(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rdi
callq 0xe060
movq %rax, -0x90(%rbp)
movq -0x88(%rbp), %rdi
callq 0xe090
movq %rax, -0x98(%rbp)
leaq -0x90(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0xe0c0
testb $0x1, %al
jne 0x2ae51
jmp 0x2aec2
leaq -0x90(%rbp), %rdi
callq 0xe100
movl (%rax), %eax
movl %eax, -0x9c(%rbp)
movslq -0x9c(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x178f0
cmpl $0x0, (%rax)
jne 0x2ae7c
jmp 0x2ae9b
leaq 0x2ef6b(%rip), %rdi     # 0x59dee
leaq 0x2ee25(%rip), %rsi     # 0x59caf
movl $0x13b, %edx            # imm = 0x13B
leaq 0x2f011(%rip), %rcx     # 0x59ea7
callq 0x31a0
movslq -0x9c(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x178f0
movl $0x1, (%rax)
leaq -0x90(%rbp), %rdi
callq 0xe120
jmp 0x2ae38
leaq -0x60(%rbp), %rdi
movq %rdi, -0x180(%rbp)
callq 0xe090
movq %rax, -0xb0(%rbp)
leaq -0xa8(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x177f0
leaq -0x80(%rbp), %rdi
movq %rdi, -0x188(%rbp)
callq 0xe060
movq -0x188(%rbp), %rdi
movq %rax, -0xb8(%rbp)
callq 0xe090
movq -0x180(%rbp), %rdi
movq %rax, -0xc0(%rbp)
movq -0xa8(%rbp), %rsi
movq -0xb8(%rbp), %rdx
movq -0xc0(%rbp), %rcx
callq 0x2de00
movq %rax, -0x178(%rbp)
jmp 0x2af40
movq -0x178(%rbp), %rax
movq %rax, -0xc8(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x6d30
jmp 0x2af73
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x6d30
jmp 0x2b38e
jmp 0x2af75
jmp 0x2af77
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x2ad5a
leaq -0x60(%rbp), %rdi
callq 0x59a0
movq -0x10(%rbp), %rcx
cmpl 0x50(%rcx), %eax
jne 0x2af99
jmp 0x2afb8
leaq 0x2ee7d(%rip), %rdi     # 0x59e1d
leaq 0x2ed08(%rip), %rsi     # 0x59caf
movl $0x141, %edx            # imm = 0x141
leaq 0x2eef4(%rip), %rcx     # 0x59ea7
callq 0x31a0
movl $0x0, -0xcc(%rbp)
movl -0xcc(%rbp), %eax
movl %eax, -0x18c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x59a0
movq %rax, %rcx
movl -0x18c(%rbp), %eax
cmpl %ecx, %eax
jge 0x2b024
movl -0xcc(%rbp), %eax
movl %eax, -0x190(%rbp)
movslq -0xcc(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x178f0
movl -0x190(%rbp), %edx
movslq (%rax), %rcx
leaq 0x4816a0(%rip), %rax    # 0x4ac6b0
movl %edx, (%rax,%rcx,4)
movl -0xcc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xcc(%rbp)
jmp 0x2afc2
movl $0x0, -0xd0(%rbp)
movl $0x0, -0xd4(%rbp)
movl -0xd4(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x50(%rcx), %eax
jge 0x2b371
movslq -0xd4(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x178f0
movl (%rax), %eax
movl %eax, -0xd8(%rbp)
xorl %eax, %eax
xorl %ecx, %ecx
cmpl -0xd8(%rbp), %ecx
movb %al, -0x191(%rbp)
jg 0x2b08b
movl -0xd8(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x50(%rcx), %eax
setl %al
movb %al, -0x191(%rbp)
movb -0x191(%rbp), %al
testb $0x1, %al
jne 0x2b097
jmp 0x2b099
jmp 0x2b0b8
leaq 0x2ed96(%rip), %rdi     # 0x59e36
leaq 0x2ec08(%rip), %rsi     # 0x59caf
movl $0x148, %edx            # imm = 0x148
leaq 0x2edf4(%rip), %rcx     # 0x59ea7
callq 0x31a0
movq -0x18(%rbp), %rdi
movslq -0xd8(%rbp), %rsi
callq 0x17a50
movl (%rax), %eax
movl %eax, -0x104(%rbp)
leaq -0x104(%rbp), %rax
movq %rax, -0x100(%rbp)
movq $0x1, -0xf8(%rbp)
leaq -0x105(%rbp), %rdi
movq %rdi, -0x1a0(%rbp)
callq 0x111b0
movq -0x1a0(%rbp), %rcx
movq -0x100(%rbp), %rsi
movq -0xf8(%rbp), %rdx
leaq -0xf0(%rbp), %rdi
callq 0x26d30
jmp 0x2b11f
leaq -0x105(%rbp), %rdi
callq 0x6620
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
movslq -0xd8(%rbp), %rsi
callq 0xbba0
movq %rax, -0x110(%rbp)
movq -0x110(%rbp), %rdi
callq 0x6680
movq %rax, -0x118(%rbp)
movq -0x110(%rbp), %rdi
callq 0x66b0
movq %rax, -0x120(%rbp)
leaq -0x118(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0xbbc0
testb $0x1, %al
jne 0x2b188
jmp 0x2b219
leaq -0x118(%rbp), %rdi
callq 0xbc00
movl (%rax), %eax
movl %eax, -0x124(%rbp)
movslq -0x124(%rbp), %rcx
leaq 0x481506(%rip), %rax    # 0x4ac6b0
movl (%rax,%rcx,4), %eax
cmpl -0xd4(%rbp), %eax
jle 0x2b206
movq -0x18(%rbp), %rdi
movslq -0x124(%rbp), %rsi
callq 0x17a50
movq %rax, %rsi
leaq -0xf0(%rbp), %rdi
callq 0xdff0
jmp 0x2b1d6
jmp 0x2b206
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x105(%rbp), %rdi
callq 0x6620
jmp 0x2b38e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2b363
jmp 0x2b208
leaq -0x118(%rbp), %rdi
callq 0xbc80
jmp 0x2b16c
leaq -0x158(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x6490
jmp 0x2b22e
movl -0xd0(%rbp), %edx
movq -0x10(%rbp), %rax
movl 0x50(%rax), %ecx
leaq -0x140(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x4b820
jmp 0x2b250
leaq -0x158(%rbp), %rdi
callq 0x6d30
leaq -0x140(%rbp), %rdi
callq 0x59a0
cmpq $0x0, %rax
jbe 0x2b270
jmp 0x2b2ac
leaq 0x2ec6f(%rip), %rdi     # 0x59ee6
leaq 0x2ea31(%rip), %rsi     # 0x59caf
movl $0x150, %edx            # imm = 0x150
leaq 0x2ec1d(%rip), %rcx     # 0x59ea7
callq 0x31a0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x158(%rbp), %rdi
callq 0x6d30
jmp 0x2b363
leaq -0x140(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x178f0
cmpl $-0x1, (%rax)
je 0x2b2c3
jmp 0x2b2e2
leaq 0x2ec33(%rip), %rdi     # 0x59efd
leaq 0x2e9de(%rip), %rsi     # 0x59caf
movl $0x151, %edx            # imm = 0x151
leaq 0x2ebca(%rip), %rcx     # 0x59ea7
callq 0x31a0
leaq -0x140(%rbp), %rdi
callq 0x59a0
movl %eax, -0x15c(%rbp)
leaq -0xd0(%rbp), %rdi
leaq -0x15c(%rbp), %rsi
callq 0x23c80
movq %rax, -0x1a8(%rbp)
jmp 0x2b310
movq -0x1a8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0xd0(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x6d30
leaq -0xf0(%rbp), %rdi
callq 0x6d30
movl -0xd4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd4(%rbp)
jmp 0x2b038
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x6d30
leaq -0xf0(%rbp), %rdi
callq 0x6d30
jmp 0x2b38e
movl -0xd0(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x6d30
leaq -0x30(%rbp), %rdi
callq 0x6d30
jmp 0x2b3a2
leaq -0x60(%rbp), %rdi
callq 0x6d30
leaq -0x30(%rbp), %rdi
callq 0x6d30
jmp 0x2b3ae
movl -0x4(%rbp), %eax
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x3480
nopw (%rax,%rax)