// File: Laakeri[P]Triangulator/src/IO.cpp
// Function: IO::printTreeDecomposition(std::ostream&, std::pair<std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>>, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>)
void IO::printTreeDecomposition(ostream& out, pair<vector<vector<int> >, vector<pair<int, int> > > treeDecomposition) {
	if (paceTreeWidth) {
		set<string> hasVertices;
		for (auto& bag : treeDecomposition.F) {
			for (int x : bag) {
				hasVertices.insert(vertexId(x));
			}
		}
		for (int i = 1; i <= paceVertices; i++) {
			if (!hasVertices.count(to_string(i))) {
				verticeLabels.push_back(to_string(i));
				vertices[to_string(i)] = verticeLabels.size();
				treeDecomposition.F.push_back({(int)verticeLabels.size()});
				
				if (treeDecomposition.F.size() > 1) {
					treeDecomposition.S.push_back({0, (int)treeDecomposition.F.size()-1});
				}
			}
		}
	}
	int maxBag = 0;
	for (auto& bag : treeDecomposition.F) {
		maxBag = max(maxBag, (int)bag.size());
	}
	if (paceTreeWidth) {
		out<<"s td "<<treeDecomposition.F.size()<<" "<<maxBag<<" "<<paceVertices<<'\n';
	}
	else {
		out<<"s td "<<treeDecomposition.F.size()<<" "<<maxBag<<" "<<verticeLabels.size()<<'\n';
	}
	for (int i = 0; i < (int)treeDecomposition.F.size(); i++) {
		out<<"b "<<i+1;
		for (int x : treeDecomposition.F[i]) {
			out<<" "<<vertexId(x);
		}
		out<<'\n';
	}
	for (auto e : treeDecomposition.S) {
		out<<e.F+1<<" "<<e.S+1<<'\n';
	}
	out.flush();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2a0, %rsp            # imm = 0x2A0
movq %rdx, -0x210(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x208(%rbp)
testb $0x1, 0x4c(%rax)
je 0x2651b
leaq -0x48(%rbp), %rdi
callq 0x26a00
movq -0x210(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
callq 0x58e0
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rdi
callq 0x5910
movq %rax, -0x60(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x5940
testb $0x1, %al
jne 0x260e7
jmp 0x261f5
leaq -0x58(%rbp), %rdi
callq 0x5980
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
callq 0xe060
movq %rax, -0x78(%rbp)
movq -0x70(%rbp), %rdi
callq 0xe090
movq %rax, -0x80(%rbp)
leaq -0x78(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0xe0c0
testb $0x1, %al
jne 0x2612c
jmp 0x261e5
leaq -0x78(%rbp), %rdi
callq 0xe100
movq -0x208(%rbp), %rsi
movl (%rax), %eax
movl %eax, -0x84(%rbp)
movl -0x84(%rbp), %edx
leaq -0xa8(%rbp), %rdi
callq 0x25ea0
jmp 0x26158
leaq -0x48(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x26a20
movb %dl, -0x219(%rbp)
movq %rax, -0x218(%rbp)
jmp 0x26177
movb -0x219(%rbp), %al
movq -0x218(%rbp), %rcx
movq %rcx, -0xc8(%rbp)
movb %al, -0xc0(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x3190
leaq -0x78(%rbp), %rdi
callq 0xe120
jmp 0x26116
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0x2650d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x3190
jmp 0x2650d
jmp 0x261e7
leaq -0x58(%rbp), %rdi
callq 0x59c0
jmp 0x260d1
movl $0x1, -0xcc(%rbp)
movq -0x208(%rbp), %rcx
movl -0xcc(%rbp), %eax
cmpl 0x48(%rcx), %eax
jg 0x26502
movl -0xcc(%rbp), %esi
leaq -0xf0(%rbp), %rdi
callq 0x26ad0
jmp 0x26229
leaq -0x48(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x26a70
movq %rax, -0x228(%rbp)
jmp 0x26242
movq -0x228(%rbp), %rax
cmpq $0x0, %rax
setne %al
xorb $-0x1, %al
movb %al, -0x229(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x3190
movb -0x229(%rbp), %al
testb $0x1, %al
jne 0x26273
jmp 0x264ec
movq -0x208(%rbp), %rax
addq $0x30, %rax
movq %rax, -0x238(%rbp)
movl -0xcc(%rbp), %esi
leaq -0x110(%rbp), %rdi
callq 0x26ad0
jmp 0x26299
movq -0x238(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x26bf0
jmp 0x262ae
leaq -0x110(%rbp), %rdi
callq 0x3190
movq -0x208(%rbp), %rdi
addq $0x30, %rdi
callq 0x24860
movq %rax, %rcx
movq -0x208(%rbp), %rax
movl %ecx, -0x244(%rbp)
movq %rax, -0x240(%rbp)
movl -0xcc(%rbp), %esi
leaq -0x130(%rbp), %rdi
callq 0x26ad0
jmp 0x262f5
movq -0x240(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x26c20
movq %rax, -0x250(%rbp)
jmp 0x26311
movq -0x250(%rbp), %rax
movl -0x244(%rbp), %ecx
movl %ecx, (%rax)
leaq -0x130(%rbp), %rdi
callq 0x3190
movq -0x210(%rbp), %rax
movq -0x208(%rbp), %rdi
movq %rax, -0x260(%rbp)
addq $0x30, %rdi
callq 0x24860
movl %eax, -0x15c(%rbp)
leaq -0x15c(%rbp), %rax
movq %rax, -0x158(%rbp)
movq $0x1, -0x150(%rbp)
leaq -0x15d(%rbp), %rdi
movq %rdi, -0x258(%rbp)
callq 0x111b0
movq -0x258(%rbp), %rcx
movq -0x158(%rbp), %rsi
movq -0x150(%rbp), %rdx
leaq -0x148(%rbp), %rdi
callq 0x26d30
jmp 0x2639f
movq -0x260(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0x26d00
jmp 0x263b4
leaq -0x148(%rbp), %rdi
callq 0x6d30
leaq -0x15d(%rbp), %rdi
callq 0x6620
movq -0x210(%rbp), %rdi
callq 0x5e80
cmpq $0x1, %rax
jbe 0x264ea
movq -0x210(%rbp), %rdi
movq %rdi, %rax
addq $0x18, %rax
movq %rax, -0x268(%rbp)
movl $0x0, -0x16c(%rbp)
callq 0x5e80
decl %eax
movl %eax, -0x170(%rbp)
leaq -0x168(%rbp), %rdi
leaq -0x16c(%rbp), %rsi
leaq -0x170(%rbp), %rdx
callq 0x5380
jmp 0x2642a
movq -0x268(%rbp), %rdi
leaq -0x168(%rbp), %rsi
callq 0x179a0
jmp 0x2643f
jmp 0x264ea
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x3190
jmp 0x2650d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x3190
jmp 0x2650d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x3190
jmp 0x2650d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0x264dc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0x148(%rbp), %rdi
callq 0x6d30
leaq -0x15d(%rbp), %rdi
callq 0x6620
jmp 0x2650d
jmp 0x264ec
jmp 0x264ee
movl -0xcc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xcc(%rbp)
jmp 0x261ff
leaq -0x48(%rbp), %rdi
callq 0x26db0
jmp 0x2651b
leaq -0x48(%rbp), %rdi
callq 0x26db0
jmp 0x2691c
movq -0x210(%rbp), %rax
movl $0x0, -0x174(%rbp)
movq %rax, -0x180(%rbp)
movq -0x180(%rbp), %rdi
callq 0x58e0
movq %rax, -0x188(%rbp)
movq -0x180(%rbp), %rdi
callq 0x5910
movq %rax, -0x190(%rbp)
leaq -0x188(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0x5940
testb $0x1, %al
jne 0x26572
jmp 0x265c0
leaq -0x188(%rbp), %rdi
callq 0x5980
movq %rax, -0x198(%rbp)
movq -0x198(%rbp), %rdi
callq 0x59a0
movl %eax, -0x19c(%rbp)
leaq -0x174(%rbp), %rdi
leaq -0x19c(%rbp), %rsi
callq 0x23c80
movl (%rax), %eax
movl %eax, -0x174(%rbp)
leaq -0x188(%rbp), %rdi
callq 0x59c0
jmp 0x26559
movq -0x208(%rbp), %rax
testb $0x1, 0x4c(%rax)
je 0x26653
movq -0x10(%rbp), %rdi
leaq 0x335cb(%rip), %rsi     # 0x59ba7
callq 0x32b0
movq -0x210(%rbp), %rdi
movq %rax, -0x270(%rbp)
callq 0x5e80
movq -0x270(%rbp), %rdi
movq %rax, %rsi
callq 0x3080
movq %rax, %rdi
leaq 0x346d0(%rip), %rsi     # 0x5acdd
callq 0x32b0
movq %rax, %rdi
movl -0x174(%rbp), %esi
callq 0x3470
movq %rax, %rdi
leaq 0x346b3(%rip), %rsi     # 0x5acdd
callq 0x32b0
movq %rax, %rdi
movq -0x208(%rbp), %rax
movl 0x48(%rax), %esi
callq 0x3470
movq %rax, %rdi
movl $0xa, %esi
callq 0x3380
jmp 0x266e4
movq -0x10(%rbp), %rdi
leaq 0x33549(%rip), %rsi     # 0x59ba7
callq 0x32b0
movq -0x210(%rbp), %rdi
movq %rax, -0x280(%rbp)
callq 0x5e80
movq -0x280(%rbp), %rdi
movq %rax, %rsi
callq 0x3080
movq %rax, %rdi
leaq 0x3464e(%rip), %rsi     # 0x5acdd
callq 0x32b0
movq %rax, %rdi
movl -0x174(%rbp), %esi
callq 0x3470
movq %rax, %rdi
leaq 0x34631(%rip), %rsi     # 0x5acdd
callq 0x32b0
movq -0x208(%rbp), %rdi
movq %rax, -0x278(%rbp)
addq $0x30, %rdi
callq 0x24860
movq -0x278(%rbp), %rdi
movq %rax, %rsi
callq 0x3080
movq %rax, %rdi
movl $0xa, %esi
callq 0x3380
movl $0x0, -0x1a0(%rbp)
movq -0x210(%rbp), %rdi
movl -0x1a0(%rbp), %eax
movl %eax, -0x284(%rbp)
callq 0x5e80
movq %rax, %rcx
movl -0x284(%rbp), %eax
cmpl %ecx, %eax
jge 0x26856
movq -0x10(%rbp), %rdi
leaq 0x3348b(%rip), %rsi     # 0x59bad
callq 0x32b0
movq %rax, %rdi
movl -0x1a0(%rbp), %esi
addl $0x1, %esi
callq 0x3470
movq -0x210(%rbp), %rdi
movslq -0x1a0(%rbp), %rsi
callq 0x178a0
movq %rax, -0x1a8(%rbp)
movq -0x1a8(%rbp), %rdi
callq 0xe060
movq %rax, -0x1b0(%rbp)
movq -0x1a8(%rbp), %rdi
callq 0xe090
movq %rax, -0x1b8(%rbp)
leaq -0x1b0(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0xe0c0
testb $0x1, %al
jne 0x26794
jmp 0x26834
leaq -0x1b0(%rbp), %rdi
callq 0xe100
movl (%rax), %eax
movl %eax, -0x1bc(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x3452a(%rip), %rsi     # 0x5acdd
callq 0x32b0
movq -0x208(%rbp), %rsi
movq %rax, -0x298(%rbp)
movl -0x1bc(%rbp), %edx
leaq -0x1e0(%rbp), %rdi
movq %rdi, -0x290(%rbp)
callq 0x25ea0
movq -0x298(%rbp), %rdi
movq -0x290(%rbp), %rsi
callq 0x3290
jmp 0x267f4
leaq -0x1e0(%rbp), %rdi
callq 0x3190
leaq -0x1b0(%rbp), %rdi
callq 0xe120
jmp 0x26778
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0x1e0(%rbp), %rdi
callq 0x3190
jmp 0x2691c
movq -0x10(%rbp), %rdi
movl $0xa, %esi
callq 0x3380
movl -0x1a0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1a0(%rbp)
jmp 0x266ee
movq -0x210(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x1e8(%rbp)
movq -0x1e8(%rbp), %rdi
callq 0xc0b0
movq %rax, -0x1f0(%rbp)
movq -0x1e8(%rbp), %rdi
callq 0xc040
movq %rax, -0x1f8(%rbp)
leaq -0x1f0(%rbp), %rdi
leaq -0x1f8(%rbp), %rsi
callq 0x11310
testb $0x1, %al
jne 0x268a7
jmp 0x2690a
leaq -0x1f0(%rbp), %rdi
callq 0x11350
movq (%rax), %rax
movq %rax, -0x200(%rbp)
movq -0x10(%rbp), %rdi
movl -0x200(%rbp), %esi
addl $0x1, %esi
callq 0x3470
movq %rax, %rdi
leaq 0x34404(%rip), %rsi     # 0x5acdd
callq 0x32b0
movq %rax, %rdi
movl -0x1fc(%rbp), %esi
addl $0x1, %esi
callq 0x3470
movq %rax, %rdi
movl $0xa, %esi
callq 0x3380
leaq -0x1f0(%rbp), %rdi
callq 0x11370
jmp 0x2688e
movq -0x10(%rbp), %rdi
callq 0x31b0
addq $0x2a0, %rsp            # imm = 0x2A0
popq %rbp
retq
movq -0xb0(%rbp), %rdi
callq 0x3480
nopl (%rax,%rax)