// File: /workspace/github_cpp_makefile_star2_O2/Laakeri[P]Triangulator/src/MCS.cpp
// Function: MCS::getTreeDecomposition(Graph const&)
pair<vector<vector<int> >, vector<pair<int, int> > > getTreeDecomposition(const Graph& G) {
	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;
	}
	vector<vector<int> > bags(G.n);
	vector<pair<int, int> > edges;
	for (int i = 0; i < G.n; i++) {
		int x = order[i];
		assert(0<=x&&x<G.n);
		bags[i].push_back(x);
		int neB = -1;
		for (int nx : G.g[x]) {
			if (invOrd[nx] > i) {
				bags[i].push_back(nx);
				if (neB == -1 || invOrd[nx] < neB) {
					neB = invOrd[nx];
				}
			}
		}
		if (i < G.n-1) {
			if (neB != -1) {
				edges.push_back({i, neB});
			}
			else {
				edges.push_back({i, i+1});
			}
		}
	}
	assert((int)bags.size() == G.n);
	if (G.n > 0) assert((int)edges.size() == G.n-1);
	return {bags, edges};
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movslq 0x50(%rsi), %rsi
leaq 0x70(%rsp), %r15
leaq 0x40(%rsp), %r12
movq %r15, %rdi
movq %r12, %rdx
callq 0x8852
xorps %xmm0, %xmm0
andq $0x0, 0x10(%r12)
movaps %xmm0, (%r12)
xorl %edx, %edx
leaq 0x10(%rsp), %r13
leaq 0x28(%rsp), %rbp
movl %edx, 0x10(%rsp)
movl 0x50(%r14), %eax
cmpl %eax, %edx
jge 0xfc17
movslq %edx, %rax
movq 0x38(%r14), %rcx
imulq $0x18, %rax, %rsi
movq 0x8(%rcx,%rsi), %rdi
cmpq (%rcx,%rsi), %rdi
je 0xfbd9
movq 0x70(%rsp), %rcx
cmpl $0x0, (%rcx,%rax,4)
jne 0xfc0c
movq %rbp, %rdi
movq %r14, %rsi
movq %r15, %rcx
callq 0xebd1
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rcx
movq 0x70(%rsp), %rax
movq %rdx, %rsi
cmpq %rcx, %rsi
je 0xfbf7
movslq (%rsi), %rdi
cmpl $0x0, (%rax,%rdi,4)
jne 0xfdfe
movl $0x1, (%rax,%rdi,4)
addq $0x4, %rsi
jmp 0xfbba
movq %r12, %rdi
movq %r13, %rsi
callq 0x6402
movslq 0x10(%rsp), %rax
movq 0x70(%rsp), %rcx
movl $0x1, (%rcx,%rax,4)
jmp 0xfc0c
movq 0x48(%rsp), %rsi
movq %r12, %rdi
callq 0x107ac
movq %rbp, %rdi
callq 0x38e4
movl 0x10(%rsp), %edx
incl %edx
jmp 0xfb69
movq 0x40(%rsp), %rcx
movq 0x48(%rsp), %rdx
subq %rcx, %rdx
shrq $0x2, %rdx
cmpl %edx, %eax
jne 0xfe3c
xorl %edx, %edx
testl %eax, %eax
cmovlel %edx, %eax
leaq 0x4529a2(%rip), %rbp    # 0x4625e0
cmpq %rdx, %rax
je 0xfc50
movslq (%rcx,%rdx,4), %rsi
movl %edx, (%rbp,%rsi,4)
incq %rdx
jmp 0xfc3e
movq %rbx, 0x60(%rsp)
movslq 0x50(%r14), %rsi
leaq 0x28(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x107cc
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rax
movaps %xmm0, (%rax)
andq $0x0, 0x10(%rax)
xorl %ebx, %ebx
movq %r14, 0x68(%rsp)
movslq 0x50(%r14), %rcx
cmpq %rcx, %rbx
jge 0xfd74
movq 0x40(%rsp), %rax
movl (%rax,%rbx,4), %eax
movl %eax, 0xc(%rsp)
testl %eax, %eax
js 0xfe1d
cmpl %ecx, %eax
jge 0xfe1d
imulq $0x18, %rbx, %r12
movq 0x28(%rsp), %rdi
addq %r12, %rdi
leaq 0xc(%rsp), %rsi
callq 0x6402
movslq 0xc(%rsp), %rax
movq 0x38(%r14), %rcx
imulq $0x18, %rax, %rax
movq (%rcx,%rax), %r14
movq 0x8(%rcx,%rax), %r13
pushq $-0x1
popq %r15
cmpq %r13, %r14
je 0xfd21
movslq (%r14), %rax
movl %eax, 0x4(%rsp)
movslq (%rbp,%rax,4), %rax
cmpq %rax, %rbx
jge 0xfd1b
movq 0x28(%rsp), %rdi
addq %r12, %rdi
leaq 0x4(%rsp), %rsi
callq 0x6402
movslq 0x4(%rsp), %rax
movl (%rbp,%rax,4), %eax
cmpl $-0x1, %r15d
je 0xfd18
cmpl %r15d, %eax
cmovll %eax, %r15d
jmp 0xfd1b
movl %eax, %r15d
addq $0x4, %r14
jmp 0xfcd8
movq 0x68(%rsp), %r14
movslq 0x50(%r14), %rax
decq %rax
cmpq %rax, %rbx
jge 0xfd6c
cmpl $-0x1, %r15d
je 0xfd52
movl %ebx, 0x4(%rsp)
movl %r15d, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0x92ce
jmp 0xfd6c
movl %ebx, 0x4(%rsp)
leal 0x1(%rbx), %eax
movl %eax, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0x92ce
incq %rbx
jmp 0xfc7f
movq 0x30(%rsp), %rax
subq 0x28(%rsp), %rax
pushq $0x18
popq %rsi
cqto
idivq %rsi
cmpl %eax, %ecx
jne 0xfe5b
testl %ecx, %ecx
movq 0x60(%rsp), %rbx
jle 0xfdaf
movq 0x18(%rsp), %rax
subq 0x10(%rsp), %rax
shrq $0x3, %rax
decl %ecx
cmpl %eax, %ecx
jne 0xfe7a
leaq 0x28(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x1081e
leaq 0x10(%rsp), %rdi
callq 0x3bfe
leaq 0x28(%rsp), %rdi
callq 0x376e
leaq 0x40(%rsp), %rdi
callq 0x38e4
leaq 0x70(%rsp), %rdi
callq 0x38e4
movq %rbx, %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x11019(%rip), %rdi     # 0x20e1e
leaq 0x10ed3(%rip), %rsi     # 0x20cdf
leaq 0x11181(%rip), %rcx     # 0x20f94
movl $0x189, %edx            # imm = 0x189
callq 0x2150
leaq 0x11042(%rip), %rdi     # 0x20e66
leaq 0x10eb4(%rip), %rsi     # 0x20cdf
leaq 0x11162(%rip), %rcx     # 0x20f94
movl $0x197, %edx            # imm = 0x197
callq 0x2150
leaq 0x1100a(%rip), %rdi     # 0x20e4d
leaq 0x10e95(%rip), %rsi     # 0x20cdf
leaq 0x11143(%rip), %rcx     # 0x20f94
movl $0x18f, %edx            # imm = 0x18F
callq 0x2150
leaq 0x1118d(%rip), %rdi     # 0x20fef
leaq 0x10e76(%rip), %rsi     # 0x20cdf
leaq 0x11124(%rip), %rcx     # 0x20f94
movl $0x1ab, %edx            # imm = 0x1AB
callq 0x2150
leaq 0x11186(%rip), %rdi     # 0x21007
leaq 0x10e57(%rip), %rsi     # 0x20cdf
leaq 0x11105(%rip), %rcx     # 0x20f94
movl $0x1ac, %edx            # imm = 0x1AC
callq 0x2150
jmp 0xfeb9
jmp 0xfeb2
jmp 0xfeb9
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x38e4
jmp 0xfed0
jmp 0xfeb2
jmp 0xfeb9
movq %rax, %rbx
jmp 0xfed0
jmp 0xfeb9
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3bfe
leaq 0x28(%rsp), %rdi
callq 0x376e
leaq 0x40(%rsp), %rdi
callq 0x38e4
leaq 0x70(%rsp), %rdi
callq 0x38e4
movq %rbx, %rdi
callq 0x2340