// File: /workspace/github_cpp_makefile_star2_O1/Laakeri[P]Triangulator/src/IO.cpp
// Function: IO::readInput(std::istream&, std::set<std::pair<int, int>, std::less<std::pair<int, int>>, std::allocator<std::pair<int, int>>>&)
int IO::readInput(istream& in, set<pair<int, int> >& edges) {
	ios_base::sync_with_stdio(0);
	string inputLine;
	bool dimacs = false;
	paceTreeWidth = false;
	paceVertices = 0;
	assert(edges.size() == 0);
	while (getline(in, inputLine)) {
		if (inputLine[0] == '#') continue;
		if (inputLine[0] == 'c' && (dimacs || paceTreeWidth) ) continue;
		if (inputLine.size() >= 7 && inputLine.substr(0, 7) == "p edge " && nTokens(inputLine) >= 3) {
			dimacs = true;
			edges.clear();
			continue;
		}
		if (inputLine.size() >= 6 && inputLine.substr(0, 6) == "p col " && nTokens(inputLine) >= 3) {
			dimacs = true;
			edges.clear();
			continue;
		}
		if (inputLine.size() >= 5 && inputLine.substr(0, 5) == "p tw " && nTokens(inputLine) >= 3) {
			edges.clear();
			stringstream ss;
			ss<<inputLine;
			string temp;
			ss>>temp;
			ss>>temp;
			ss>>paceVertices;
			paceTreeWidth = true;
			continue;
		}
		if (inputLine.size() >= 2 && inputLine.substr(0, 2) == "p " && nTokens(inputLine) >= 3) {
			edges.clear();
			dimacs = true;
			continue;
		}
		string vA,vB;
		stringstream ss;
		ss<<inputLine;
		if (inputLine[0] == 'e' && dimacs && nTokens(inputLine) == 3) {
			char e;
			if (!(ss>>e>>vA>>vB)) {
				cerr<<"Unexpected input "<<inputLine<<endl;
				edges.clear();
				continue;
			}
		}
		else if (nTokens(inputLine) == 2 && !dimacs) {
			if (!(ss>>vA>>vB)) {
				cerr<<"Unexpected input "<<inputLine<<endl;
				edges.clear();
				continue;
			}
		}
		else {
			continue;
		}
		if (vA == vB) continue;
		if (vertices.count(vA) == 0) {
			verticeLabels.push_back(vA);
			vertices[vA] = verticeLabels.size();
		}
		if (vertices.count(vB) == 0) {
			verticeLabels.push_back(vB);
			vertices[vB] = verticeLabels.size();
		}
		int a = vertices[vA];
		int b = vertices[vB];
		if (a > b) swap(a, b);
		edges.insert({a, b});
	}
	return vertices.size();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x368, %rsp            # imm = 0x368
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r14
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x20b0
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb %bl, (%rax)
movb %bl, 0x4c(%r14)
movl $0x0, 0x48(%r14)
movq %r12, 0x48(%rsp)
cmpq $0x0, 0x28(%r12)
jne 0x1161a
leaq 0x48(%r14), %rax
movq %rax, 0x178(%rsp)
leaq 0x8(%r14), %rax
movq %rax, 0xa8(%rsp)
leaq 0x30(%r14), %rax
movq %rax, 0xa0(%rsp)
leaq 0x1e0(%rsp), %rbp
leaq 0x80(%rbp), %rax
movq %rax, 0xb0(%rsp)
leaq 0x8(%rsp), %r12
leaq 0x80(%rsp), %r13
movq $0x0, 0x50(%rsp)
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x2330
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x115e6
movq 0x8(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x23, %eax
je 0x10d58
cmpl $0x63, %eax
jne 0x10dac
testb $0x1, 0x50(%rsp)
jne 0x10d58
cmpb $0x0, 0x4c(%r14)
jne 0x10d58
movq 0x10(%rsp), %rbx
cmpq $0x7, %rbx
jb 0x10de0
movl $0x7, %ecx
movq %r13, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x2230
movq %r13, %rdi
leaq 0x19dca(%rip), %rsi     # 0x2ab9d
callq 0x2070
testl %eax, %eax
je 0x1135e
xorl %eax, %eax
xorl %r13d, %r13d
testb %al, %al
je 0x10e0e
movq 0x158(%rsp), %rdi
leaq 0x168(%rsp), %rax
cmpq %rax, %rdi
je 0x10e0e
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x2210
cmpq $0x7, %rbx
jb 0x10e39
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x10e39
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x2210
testb %r13b, %r13b
jne 0x115c8
movq 0x10(%rsp), %rbx
cmpq $0x6, %rbx
jb 0x10e7e
movl $0x6, %ecx
leaq 0x1c0(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x2230
movq %r13, %rdi
leaq 0x19d34(%rip), %rsi     # 0x2aba5
callq 0x2070
testl %eax, %eax
je 0x113a1
xorl %eax, %eax
xorl %r13d, %r13d
testb %al, %al
je 0x10eac
movq 0x138(%rsp), %rdi
leaq 0x148(%rsp), %rax
cmpq %rax, %rdi
je 0x10eac
movq 0x148(%rsp), %rsi
incq %rsi
callq 0x2210
cmpq $0x6, %rbx
jb 0x10ed7
movq 0x1c0(%rsp), %rdi
leaq 0x1d0(%rsp), %rax
cmpq %rax, %rdi
je 0x10ed7
movq 0x1d0(%rsp), %rsi
incq %rsi
callq 0x2210
testb %r13b, %r13b
jne 0x115c8
movq 0x10(%rsp), %rbx
cmpq $0x5, %rbx
jb 0x10f1c
movl $0x5, %ecx
leaq 0x1a0(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x2230
movq %r13, %rdi
leaq 0x19c9d(%rip), %rsi     # 0x2abac
callq 0x2070
testl %eax, %eax
je 0x113e4
xorl %eax, %eax
xorl %r13d, %r13d
testb %al, %al
je 0x10f4a
movq 0x118(%rsp), %rdi
leaq 0x128(%rsp), %rax
cmpq %rax, %rdi
je 0x10f4a
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x2210
cmpq $0x5, %rbx
jb 0x10f75
movq 0x1a0(%rsp), %rdi
leaq 0x1b0(%rsp), %rax
cmpq %rax, %rdi
je 0x10f75
movq 0x1b0(%rsp), %rsi
incq %rsi
callq 0x2210
testb %r13b, %r13b
je 0x11033
movq 0x48(%rsp), %rdi
callq 0x12302
movq %rbp, %rdi
callq 0x2180
leaq 0x80(%rsp), %r13
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x1f0(%rsp), %rdi
callq 0x2250
leaq 0x38(%rsp), %rax
movq %rax, 0x28(%rsp)
movq $0x0, 0x30(%rsp)
movb $0x0, 0x38(%rsp)
movq %rbp, %rdi
leaq 0x28(%rsp), %rsi
callq 0x2280
movq %rbp, %rdi
leaq 0x28(%rsp), %rsi
callq 0x2280
movq %rbp, %rdi
movq 0x178(%rsp), %rsi
callq 0x2130
movb $0x1, 0x4c(%r14)
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x11012
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbp, %rdi
movq 0x24f94(%rip), %rsi     # 0x35fb0
callq 0x21a0
movq 0xb0(%rsp), %rdi
callq 0x2080
jmp 0x10d58
movq 0x10(%rsp), %rbx
cmpq $0x2, %rbx
jb 0x1106f
movl $0x2, %ecx
leaq 0x180(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x2230
movq %r13, %rdi
leaq 0x19b50(%rip), %rsi     # 0x2abb2
callq 0x2070
testl %eax, %eax
je 0x11585
xorl %eax, %eax
xorl %r13d, %r13d
testb %al, %al
je 0x1109d
movq 0xf8(%rsp), %rdi
leaq 0x108(%rsp), %rax
cmpq %rax, %rdi
je 0x1109d
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x2210
cmpq $0x2, %rbx
jb 0x110c8
movq 0x180(%rsp), %rdi
leaq 0x190(%rsp), %rax
cmpq %rax, %rdi
je 0x110c8
movq 0x190(%rsp), %rsi
incq %rsi
callq 0x2210
testb %r13b, %r13b
jne 0x115c8
leaq 0x38(%rsp), %rax
movq %rax, 0x28(%rsp)
xorl %ecx, %ecx
movq %rcx, 0x30(%rsp)
movb %cl, 0x38(%rsp)
leaq 0x68(%rsp), %rax
movq %rax, 0x58(%rsp)
movq %rcx, 0x60(%rsp)
movb %cl, 0x68(%rsp)
movq %rbp, %rdi
callq 0x2180
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x1f0(%rsp), %rdi
callq 0x2250
movq 0x8(%rsp), %rsi
cmpb $0x65, (%rsi)
sete %bl
andb 0x50(%rsp), %bl
cmpb $0x1, %bl
jne 0x11167
leaq 0xe8(%rsp), %rax
movq %rax, 0xd8(%rsp)
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0xd8(%rsp), %rdi
callq 0x83f0
leaq 0xd8(%rsp), %rsi
callq 0x10c10
cmpl $0x3, %eax
sete %r13b
jmp 0x1116a
xorl %r13d, %r13d
testb %bl, %bl
je 0x11193
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0x11193
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x2210
testb %r13b, %r13b
je 0x11244
movq %rbp, %rdi
leaq 0x78(%rsp), %rsi
callq 0x2290
leaq 0x80(%rsp), %r13
movq %rax, %rdi
leaq 0x28(%rsp), %rsi
callq 0x2280
movq %rax, %rdi
leaq 0x58(%rsp), %rsi
callq 0x2280
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
je 0x11427
movl $0x11, %edx
movq 0x24e07(%rip), %rdi     # 0x35ff0
leaq 0x199c5(%rip), %rsi     # 0x2abb5
callq 0x2250
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x24dea(%rip), %rdi     # 0x35ff0
callq 0x2250
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2160
movq 0x48(%rsp), %rdi
callq 0x12302
jmp 0x11528
leaq 0xc8(%rsp), %rax
movq %rax, 0xb8(%rsp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0xb8(%rsp), %rdi
callq 0x83f0
leaq 0xb8(%rsp), %rsi
callq 0x10c10
cmpl $0x2, %eax
setne %bl
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
leaq 0x80(%rsp), %r13
je 0x112ae
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x2210
orb 0x50(%rsp), %bl
testb $0x1, %bl
jne 0x11528
movq %rbp, %rdi
leaq 0x28(%rsp), %rsi
callq 0x2280
movq %rax, %rdi
leaq 0x58(%rsp), %rsi
callq 0x2280
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
leaq 0x80(%rsp), %r13
je 0x11427
movl $0x11, %edx
movq 0x24cf5(%rip), %rdi     # 0x35ff0
leaq 0x198b3(%rip), %rsi     # 0x2abb5
callq 0x2250
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x24cd8(%rip), %rdi     # 0x35ff0
callq 0x2250
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2160
movq 0x48(%rsp), %rdi
callq 0x12302
leaq 0x80(%rsp), %r13
jmp 0x11528
leaq 0x168(%rsp), %rax
movq %rax, 0x158(%rsp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0x158(%rsp), %r13
movq %r13, %rdi
callq 0x83f0
movq %r13, %rsi
callq 0x10c10
cmpl $0x3, %eax
setge %r13b
movb $0x1, %al
jmp 0x10de5
leaq 0x148(%rsp), %rax
movq %rax, 0x138(%rsp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0x138(%rsp), %r13
movq %r13, %rdi
callq 0x83f0
movq %r13, %rsi
callq 0x10c10
cmpl $0x3, %eax
setge %r13b
movb $0x1, %al
jmp 0x10e83
leaq 0x128(%rsp), %rax
movq %rax, 0x118(%rsp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0x118(%rsp), %r13
movq %r13, %rdi
callq 0x83f0
movq %r13, %rsi
callq 0x10c10
cmpl $0x3, %eax
setge %r13b
movb $0x1, %al
jmp 0x10f21
movq 0x30(%rsp), %rdx
cmpq 0x60(%rsp), %rdx
jne 0x11453
testq %rdx, %rdx
je 0x11528
movq 0x58(%rsp), %rsi
movq 0x28(%rsp), %rdi
callq 0x2220
testl %eax, %eax
je 0x11528
movq %r14, %rdi
leaq 0x28(%rsp), %rsi
callq 0x80a0
cmpq 0xa8(%rsp), %rax
jne 0x1149a
movq 0xa0(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x109aa
movq 0x30(%r14), %r13
movq 0x38(%r14), %rbx
movq %r14, %rdi
leaq 0x28(%rsp), %rsi
callq 0x8024
subq %r13, %rbx
shrq $0x5, %rbx
movl %ebx, (%rax)
movq %r14, %rdi
leaq 0x58(%rsp), %rsi
callq 0x80a0
cmpq 0xa8(%rsp), %rax
jne 0x114e1
movq 0xa0(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x109aa
movq 0x30(%r14), %r13
movq 0x38(%r14), %rbx
movq %r14, %rdi
leaq 0x58(%rsp), %rsi
callq 0x8024
subq %r13, %rbx
shrq $0x5, %rbx
movl %ebx, (%rax)
movq %r14, %rdi
leaq 0x28(%rsp), %rsi
callq 0x8024
movl (%rax), %ebx
movq %r14, %rdi
leaq 0x58(%rsp), %rsi
callq 0x8024
leaq 0x80(%rsp), %r13
movl (%rax), %eax
cmpl %eax, %ebx
movl %eax, %ecx
cmovll %ebx, %ecx
cmovgl %ebx, %eax
movl %ecx, 0x78(%rsp)
movl %eax, 0x7c(%rsp)
movq 0x48(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x8e22
movq %rbp, %rdi
movq 0x24a7e(%rip), %rsi     # 0x35fb0
callq 0x21a0
movq 0xb0(%rsp), %rdi
callq 0x2080
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x11560
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x10d58
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2210
jmp 0x10d58
leaq 0x108(%rsp), %rax
movq %rax, 0xf8(%rsp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0xf8(%rsp), %r13
movq %r13, %rdi
callq 0x83f0
movq %r13, %rsi
callq 0x10c10
cmpl $0x3, %eax
setge %r13b
movb $0x1, %al
jmp 0x11074
movq 0x48(%rsp), %rdi
callq 0x12302
movb $0x1, %al
movq %rax, 0x50(%rsp)
leaq 0x80(%rsp), %r13
jmp 0x10d58
movq 0x28(%r14), %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x11606
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
movl %ebx, %eax
addq $0x368, %rsp            # imm = 0x368
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1952f(%rip), %rdi     # 0x2ab50
leaq 0x1953a(%rip), %rsi     # 0x2ab62
leaq 0x1953a(%rip), %rcx     # 0x2ab69
movl $0x20, %edx
callq 0x2140
movq %rax, %rbx
movq 0xf8(%rsp), %rdi
leaq 0x108(%rsp), %rax
cmpq %rax, %rdi
je 0x11666
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x2210
jmp 0x11666
movq %rax, %rbx
movq 0x180(%rsp), %rdi
leaq 0x190(%rsp), %rax
cmpq %rax, %rdi
je 0x118af
movq 0x190(%rsp), %rsi
jmp 0x118a2
jmp 0x1184e
jmp 0x1184e
jmp 0x1184e
movq %rax, %rbx
movq 0x118(%rsp), %rdi
leaq 0x128(%rsp), %rax
cmpq %rax, %rdi
je 0x116c8
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x2210
jmp 0x116c8
movq %rax, %rbx
movq 0x1a0(%rsp), %rdi
leaq 0x1b0(%rsp), %rax
cmpq %rax, %rdi
je 0x118af
movq 0x1b0(%rsp), %rsi
jmp 0x118a2
movq %rax, %rbx
jmp 0x1171b
movq %rax, %rbx
movq 0x138(%rsp), %rdi
leaq 0x148(%rsp), %rax
cmpq %rax, %rdi
je 0x1171b
movq 0x148(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x1c0(%rsp), %rdi
leaq 0x1d0(%rsp), %rax
cmpq %rax, %rdi
je 0x118af
movq 0x1d0(%rsp), %rsi
jmp 0x118a2
movq %rax, %rbx
jmp 0x1176e
movq %rax, %rbx
movq 0x158(%rsp), %rdi
leaq 0x168(%rsp), %rax
cmpq %rax, %rdi
je 0x1176e
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x118af
movq 0x90(%rsp), %rsi
jmp 0x118a2
movq %rax, %rbx
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x11851
movq 0xc8(%rsp), %rsi
jmp 0x117da
movq %rax, %rbx
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0x11851
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x2210
jmp 0x11851
jmp 0x118ac
movq %rax, %rbx
jmp 0x11872
jmp 0x118ac
movq %rax, %rbx
jmp 0x1182b
jmp 0x118ac
jmp 0x118ac
jmp 0x118ac
jmp 0x1184e
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x1182b
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x2477e(%rip), %rsi     # 0x35fb0
leaq 0x1e0(%rsp), %rdi
callq 0x21a0
leaq 0x260(%rsp), %rdi
callq 0x2080
jmp 0x118af
movq %rax, %rbx
movq 0x24758(%rip), %rsi     # 0x35fb0
leaq 0x1e0(%rsp), %rdi
callq 0x21a0
leaq 0x260(%rsp), %rdi
callq 0x2080
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x1188e
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x118af
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2210
jmp 0x118af
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq 0x8(%rsp), %rdi
cmpq %rax, %rdi
je 0x118cb
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2310
nop