// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdx, %r15
movq %rsi, 0x40(%rsp)
movq %rdi, %rbx
cmpb $0x1, 0x4c(%rdi)
movq %rdx, 0x38(%rsp)
jne 0x120ba
leaq 0x60(%rsp), %rcx
movl $0x0, (%rcx)
xorl %eax, %eax
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
movq (%r15), %rax
movq 0x8(%r15), %rcx
movq %rcx, 0x48(%rsp)
cmpq %rcx, %rax
je 0x11dc8
leaq 0x18(%rsp), %rbp
leaq 0x8(%rsp), %r12
leaq 0x58(%rsp), %r13
movq (%rax), %r15
movq %rax, 0x28(%rsp)
movq 0x8(%rax), %r14
cmpq %r14, %r15
je 0x11db8
movslq (%r15), %rax
movq 0x30(%rbx), %rcx
shlq $0x5, %rax
movq %rbp, 0x8(%rsp)
movq -0x20(%rcx,%rax), %rsi
movq -0x18(%rcx,%rax), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x8714
movq %r13, %rdi
movq %r12, %rsi
callq 0x125a8
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x11db2
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
addq $0x4, %r15
jmp 0x11d66
movq 0x28(%rsp), %rax
addq $0x18, %rax
cmpq 0x48(%rsp), %rax
jne 0x11d5a
cmpl $0x0, 0x48(%rbx)
leaq 0x60(%rsp), %r14
jle 0x120ab
leaq 0x30(%rbx), %rax
movq %rax, 0x28(%rsp)
movq 0x38(%rsp), %rax
addq $0x18, %rax
movq %rax, 0x48(%rsp)
movl $0x1, %r13d
movl $0xd1b71759, %ebp       # imm = 0xD1B71759
movl $0x1, %r12d
cmpl $0xa, %r13d
jb 0x11e47
movl $0x4, %r12d
movl %r13d, %eax
cmpl $0x63, %eax
jbe 0x11e3e
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x11e44
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x11e47
movl %eax, %ecx
imulq %rbp, %rcx
shrq $0x2d, %rcx
addl $0x4, %r12d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x11e0e
addl $-0x3, %r12d
jmp 0x11e47
addl $-0x2, %r12d
jmp 0x11e47
decl %r12d
movl %r12d, %esi
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movl $0x2d, %edx
callq 0x2270
movq 0x8(%rsp), %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x12495
leaq 0x58(%rsp), %rdi
movq %r15, %rsi
callq 0x1273a
movq %rax, %r12
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x11ea2
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
cmpq %r14, %r12
jne 0x1209a
movl $0x1, %r12d
cmpl $0xa, %r13d
leaq 0x8(%rsp), %r14
jb 0x11efe
movl $0x4, %r12d
movl %r13d, %eax
cmpl $0x63, %eax
jbe 0x11ef5
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x11efb
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x11efe
movl %eax, %ecx
imulq %rbp, %rcx
shrq $0x2d, %rcx
addl $0x4, %r12d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x11ec5
addl $-0x3, %r12d
jmp 0x11efe
addl $-0x2, %r12d
jmp 0x11efe
decl %r12d
movl %r12d, %esi
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %r14, %rdi
movl $0x2d, %edx
callq 0x2270
movq 0x8(%rsp), %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x12495
movq 0x28(%rsp), %rdi
movq %r14, %rsi
callq 0x127c4
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x11f51
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x38(%rbx), %r14
subq 0x30(%rbx), %r14
movl $0x1, %r12d
cmpl $0xa, %r13d
jb 0x11fa7
movl $0x4, %r12d
movl %r13d, %eax
cmpl $0x63, %eax
jbe 0x11f9e
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x11fa4
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x11fa7
movl %eax, %ecx
imulq %rbp, %rcx
shrq $0x2d, %rcx
addl $0x4, %r12d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x11f6e
addl $-0x3, %r12d
jmp 0x11fa7
addl $-0x2, %r12d
jmp 0x11fa7
decl %r12d
movl %r12d, %esi
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movl $0x2d, %edx
callq 0x2270
movq 0x8(%rsp), %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x12495
movq %rbx, %rdi
movq %r15, %rsi
callq 0x123d4
shrq $0x5, %r14
movl %r14d, (%rax)
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x12004
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x38(%rbx), %rax
subq 0x30(%rbx), %rax
shrq $0x5, %rax
movl %eax, 0x54(%rsp)
movl $0x1, %edx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
leaq 0x54(%rsp), %rsi
leaq 0x37(%rsp), %rcx
callq 0x12450
leaq 0x60(%rsp), %r14
movq 0x38(%rsp), %rdi
movq %r15, %rsi
callq 0x12ab6
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x12059
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
movq 0x38(%rsp), %rcx
movq 0x8(%rcx), %rax
subq (%rcx), %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
cmpq $0x2, %rax
jb 0x1209a
decl %eax
movl $0x0, 0x8(%rsp)
movl %eax, 0xc(%rsp)
movq 0x48(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xb2ae
leal 0x1(%r13), %eax
cmpl 0x48(%rbx), %r13d
movl %eax, %r13d
jl 0x11df9
leaq 0x58(%rsp), %rdi
callq 0x12502
movq 0x38(%rsp), %r15
movq (%r15), %rax
movq 0x8(%r15), %rcx
cmpq %rcx, %rax
je 0x120e8
xorl %edx, %edx
movq 0x8(%rax), %r12
subq (%rax), %r12
shrq $0x2, %r12
cmpl %r12d, %edx
cmovgl %edx, %r12d
addq $0x18, %rax
movl %r12d, %edx
cmpq %rcx, %rax
jne 0x120c8
jmp 0x120eb
xorl %r12d, %r12d
movb 0x4c(%rbx), %al
movb %al, 0x28(%rsp)
leaq 0x17ade(%rip), %rsi     # 0x29bd7
movl $0x5, %edx
movq %rbx, %r14
movq 0x40(%rsp), %rbx
movq %rbx, %rdi
callq 0x2250
movq 0x8(%r15), %rsi
subq (%r15), %rsi
sarq $0x3, %rsi
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rsi
movq %rbx, %rdi
callq 0x2150
movq %rax, %r13
leaq 0x18bf4(%rip), %rbp     # 0x2ad2d
movl $0x1, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x2250
movq %r13, %rdi
movl %r12d, %esi
callq 0x2300
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x2250
cmpb $0x0, 0x28(%rsp)
je 0x1217f
movq %r14, %r13
movl 0x48(%r14), %esi
movq %r12, %rdi
callq 0x2300
jmp 0x12196
movq 0x38(%r14), %rsi
movq %r14, %r13
subq 0x30(%r14), %rsi
sarq $0x5, %rsi
movq %r12, %rdi
callq 0x2150
leaq 0x58(%rsp), %rsi
movb $0xa, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x2250
movq 0x38(%rsp), %r12
movq 0x8(%r12), %rax
subq (%r12), %rax
shrq $0x3, %rax
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
testl %eax, %eax
movq 0x40(%rsp), %rbx
jle 0x122c7
leaq 0x68(%rsp), %r14
xorl %r15d, %r15d
movq 0x40(%rsp), %rbp
movl $0x2, %edx
movq %rbx, %rdi
leaq 0x179f1(%rip), %rsi     # 0x29bdd
callq 0x2250
leaq 0x1(%r15), %rsi
movq %rbx, %rdi
movq %rsi, 0x28(%rsp)
callq 0x2300
movq (%r12), %rax
leaq (%r15,%r15,2), %rcx
movq (%rax,%rcx,8), %r12
movq 0x8(%rax,%rcx,8), %r15
cmpq %r15, %r12
je 0x12283
movslq (%r12), %rbx
movl $0x1, %edx
movq %rbp, %rdi
leaq 0x18b02(%rip), %rsi     # 0x2ad2d
callq 0x2250
movq 0x30(%r13), %rax
shlq $0x5, %rbx
movq %r14, 0x58(%rsp)
movq -0x20(%rax,%rbx), %rsi
movq -0x18(%rax,%rbx), %rdx
addq %rsi, %rdx
leaq 0x58(%rsp), %rdi
callq 0x8714
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
movq %rbp, %rdi
callq 0x2250
movq 0x58(%rsp), %rdi
cmpq %r14, %rdi
je 0x1227d
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x2210
addq $0x4, %r12
jmp 0x12213
movb $0xa, 0x58(%rsp)
movl $0x1, %edx
movq 0x40(%rsp), %rbx
movq %rbx, %rdi
leaq 0x58(%rsp), %rsi
callq 0x2250
movq 0x38(%rsp), %r12
movq 0x8(%r12), %rax
subq (%r12), %rax
shrq $0x3, %rax
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
cltq
movq 0x28(%rsp), %r15
cmpq %rax, %r15
jl 0x121dd
movq 0x18(%r12), %r13
movq 0x20(%r12), %r14
cmpq %r14, %r13
je 0x12333
leaq 0x58(%rsp), %r15
movl (%r13), %esi
movl 0x4(%r13), %ebp
incl %esi
movq %rbx, %rdi
callq 0x2300
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
leaq 0x18a2e(%rip), %rsi     # 0x2ad2d
callq 0x2250
incl %ebp
movq %r12, %rdi
movq 0x40(%rsp), %rbx
movl %ebp, %esi
callq 0x2300
movb $0xa, 0x58(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2250
addq $0x8, %r13
cmpq %r14, %r13
jne 0x122db
movq %rbx, %rdi
callq 0x2160
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x12386
jmp 0x12386
jmp 0x12386
jmp 0x12372
jmp 0x12386
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x123a5
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
jmp 0x123a0
jmp 0x12372
jmp 0x12386
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
jne 0x12398
jmp 0x123a5
movq %rax, %rbx
jmp 0x123a5
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x123a5
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
leaq 0x58(%rsp), %rdi
callq 0x12502
jmp 0x123cb
movq %rax, %rbx
movq 0x58(%rsp), %rdi
cmpq %r14, %rdi
je 0x123cb
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2310
nop