// File: /workspace/github_cpp_makefile_star2_O3/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 $0x2e8, %rsp            # imm = 0x2E8
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
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(%r15)
movl $0x0, 0x48(%r15)
movq %r14, 0x50(%rsp)
cmpq $0x0, 0x28(%r14)
jne 0x11921
leaq 0x48(%r15), %rax
movq %rax, 0x158(%rsp)
leaq 0x8(%r15), %rax
movq %rax, 0x90(%rsp)
movq %r15, 0x28(%rsp)
leaq 0x30(%r15), %rax
movq %rax, 0x88(%rsp)
leaq 0x160(%rsp), %r13
leaq 0x80(%r13), %rax
movq %rax, 0x58(%rsp)
leaq 0x8(%rsp), %rbp
xorl %ebx, %ebx
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %edx
movq %r12, %rdi
movq %rbp, %rsi
callq 0x2330
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x118e8
movq 0x8(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x23, %eax
je 0x110e6
cmpl $0x63, %eax
jne 0x1113d
testb $0x1, %bl
jne 0x110e6
movq 0x28(%rsp), %rax
cmpb $0x0, 0x4c(%rax)
jne 0x110e6
movq 0x10(%rsp), %rax
cmpq $0x7, %rax
jb 0x1120a
movl $0x7, %ecx
movq %r13, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0x2230
movq %r13, %rdi
leaq 0x18a45(%rip), %rsi     # 0x29bad
callq 0x2070
testl %eax, %eax
je 0x11176
xorl %r14d, %r14d
jmp 0x111d7
leaq 0x148(%rsp), %rax
movq %rax, 0x138(%rsp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0x138(%rsp), %r14
movq %r14, %rdi
callq 0x8714
movq %r14, %rsi
callq 0x10fac
cmpl $0x3, %eax
setge %r14b
movq 0x138(%rsp), %rdi
leaq 0x148(%rsp), %rax
cmpq %rax, %rdi
je 0x111d7
movq 0x148(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x160(%rsp), %rdi
leaq 0x170(%rsp), %rax
cmpq %rax, %rdi
je 0x111fc
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x2210
testb %r14b, %r14b
jne 0x118d7
movq 0x10(%rsp), %rax
cmpq $0x6, %rax
jb 0x112d2
movl $0x6, %ecx
movq %r13, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0x2230
movq %r13, %rdi
leaq 0x18985(%rip), %rsi     # 0x29bb5
callq 0x2070
testl %eax, %eax
je 0x1123e
xorl %r14d, %r14d
jmp 0x1129f
leaq 0x128(%rsp), %rax
movq %rax, 0x118(%rsp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0x118(%rsp), %r14
movq %r14, %rdi
callq 0x8714
movq %r14, %rsi
callq 0x10fac
cmpl $0x3, %eax
setge %r14b
movq 0x118(%rsp), %rdi
leaq 0x128(%rsp), %rax
cmpq %rax, %rdi
je 0x1129f
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x160(%rsp), %rdi
leaq 0x170(%rsp), %rax
cmpq %rax, %rdi
je 0x112c4
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x2210
testb %r14b, %r14b
jne 0x118d7
movq 0x10(%rsp), %rax
cmpq $0x5, %rax
jb 0x11448
movl $0x5, %ecx
movq %r13, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0x2230
movq %r13, %rdi
leaq 0x188c4(%rip), %rsi     # 0x29bbc
callq 0x2070
testl %eax, %eax
je 0x11306
xorl %r14d, %r14d
jmp 0x11367
leaq 0x108(%rsp), %rax
movq %rax, 0xf8(%rsp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0xf8(%rsp), %r14
movq %r14, %rdi
callq 0x8714
movq %r14, %rsi
callq 0x10fac
cmpl $0x3, %eax
setge %r14b
movq 0xf8(%rsp), %rdi
leaq 0x108(%rsp), %rax
cmpq %rax, %rdi
je 0x11367
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x160(%rsp), %rdi
leaq 0x170(%rsp), %rax
cmpq %rax, %rdi
je 0x1138c
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x2210
testb %r14b, %r14b
je 0x11443
movq 0x50(%rsp), %rdi
callq 0x1257a
movq %r13, %rdi
callq 0x2180
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x170(%rsp), %rdi
callq 0x2250
leaq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
movq $0x0, 0x38(%rsp)
movb $0x0, 0x40(%rsp)
movq %r13, %rdi
leaq 0x30(%rsp), %rsi
callq 0x2280
movq %r13, %rdi
leaq 0x30(%rsp), %rsi
callq 0x2280
movq %r13, %rdi
movq 0x158(%rsp), %rsi
callq 0x2130
movq 0x28(%rsp), %rax
movb $0x1, 0x4c(%rax)
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x11425
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x2210
movq %r13, %rdi
movq 0x23b81(%rip), %rsi     # 0x34fb0
callq 0x21a0
movq 0x58(%rsp), %rdi
callq 0x2080
jmp 0x110e6
movq 0x10(%rsp), %rax
cmpq $0x2, %rax
jb 0x1150b
movl $0x2, %ecx
movq %r13, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0x2230
movq %r13, %rdi
leaq 0x18754(%rip), %rsi     # 0x29bc2
callq 0x2070
testl %eax, %eax
je 0x1147c
xorl %r14d, %r14d
jmp 0x114dd
leaq 0xe8(%rsp), %rax
movq %rax, 0xd8(%rsp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0xd8(%rsp), %r14
movq %r14, %rdi
callq 0x8714
movq %r14, %rsi
callq 0x10fac
cmpl $0x3, %eax
setge %r14b
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0x114dd
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x160(%rsp), %rdi
leaq 0x170(%rsp), %rax
cmpq %rax, %rdi
je 0x11502
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x2210
testb %r14b, %r14b
jne 0x118d7
leaq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
xorl %ecx, %ecx
movq %rcx, 0x38(%rsp)
movb %cl, 0x40(%rsp)
leaq 0x70(%rsp), %rax
movq %rax, 0x60(%rsp)
movq %rcx, 0x68(%rsp)
movb %cl, 0x70(%rsp)
movq %r13, %rdi
callq 0x2180
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x170(%rsp), %rdi
callq 0x2250
movq 0x8(%rsp), %rsi
cmpb $0x65, (%rsi)
setne %al
movl %ebx, %ecx
notb %cl
orb %al, %cl
testb $0x1, %cl
jne 0x11669
leaq 0xc8(%rsp), %rax
movq %rax, 0xb8(%rsp)
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0xb8(%rsp), %rdi
callq 0x8714
leaq 0xb8(%rsp), %rsi
callq 0x10fac
movl %eax, %r14d
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x115c6
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x2210
cmpl $0x3, %r14d
jne 0x11669
movq %r13, %rdi
leaq 0x80(%rsp), %rsi
callq 0x2290
movq %rax, %rdi
leaq 0x30(%rsp), %rsi
callq 0x2280
movq %rax, %rdi
leaq 0x60(%rsp), %rsi
callq 0x2280
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
je 0x11768
movl $0x11, %edx
movq 0x239d8(%rip), %rdi     # 0x34ff0
leaq 0x185a6(%rip), %rsi     # 0x29bc5
callq 0x2250
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x239bb(%rip), %rdi     # 0x34ff0
callq 0x2250
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2160
jmp 0x11759
leaq 0xa8(%rsp), %rax
movq %rax, 0x98(%rsp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0x98(%rsp), %rdi
callq 0x8714
leaq 0x98(%rsp), %rsi
callq 0x10fac
cmpl $0x2, %eax
setne %r14b
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x116cc
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x2210
orb %bl, %r14b
testb $0x1, %r14b
jne 0x1187d
movq %r13, %rdi
leaq 0x30(%rsp), %rsi
callq 0x2280
movq %rax, %rdi
leaq 0x60(%rsp), %rsi
callq 0x2280
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
je 0x11768
movl $0x11, %edx
movq 0x238e3(%rip), %rdi     # 0x34ff0
leaq 0x184b1(%rip), %rsi     # 0x29bc5
callq 0x2250
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x238c6(%rip), %rdi     # 0x34ff0
callq 0x2250
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2160
movq 0x50(%rsp), %rdi
callq 0x1257a
jmp 0x1187d
movq 0x38(%rsp), %rdx
cmpq 0x68(%rsp), %rdx
jne 0x11794
testq %rdx, %rdx
je 0x1187d
movq 0x60(%rsp), %rsi
movq 0x30(%rsp), %rdi
callq 0x2220
testl %eax, %eax
je 0x1187d
movq 0x28(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x83c4
cmpq 0x90(%rsp), %rax
jne 0x117e0
movq 0x88(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x10d7c
movq 0x28(%rsp), %rdi
movq 0x30(%rdi), %r15
movq 0x38(%rdi), %r14
leaq 0x30(%rsp), %rsi
callq 0x8348
subq %r15, %r14
shrq $0x5, %r14
movl %r14d, (%rax)
movq 0x28(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x83c4
cmpq 0x90(%rsp), %rax
jne 0x1182c
movq 0x88(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x10d7c
movq 0x28(%rsp), %rdi
movq 0x30(%rdi), %r15
movq 0x38(%rdi), %r14
leaq 0x60(%rsp), %rsi
callq 0x8348
subq %r15, %r14
shrq $0x5, %r14
movl %r14d, (%rax)
movq 0x28(%rsp), %r15
movq %r15, %rdi
leaq 0x30(%rsp), %rsi
callq 0x8348
movl (%rax), %r14d
movq %r15, %rdi
leaq 0x60(%rsp), %rsi
callq 0x8348
movl (%rax), %eax
cmpl %eax, %r14d
movl %eax, %ecx
cmovll %r14d, %ecx
cmovgl %r14d, %eax
movl %ecx, 0x80(%rsp)
movl %eax, 0x84(%rsp)
movq 0x50(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x9126
movq %r13, %rdi
movq 0x23729(%rip), %rsi     # 0x34fb0
callq 0x21a0
movq 0x58(%rsp), %rdi
callq 0x2080
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x118b2
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x110e6
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x2210
jmp 0x110e6
movq 0x50(%rsp), %rdi
callq 0x1257a
movb $0x1, %bl
jmp 0x110e6
movq 0x28(%rsp), %rax
movq 0x28(%rax), %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1190d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
movl %ebx, %eax
addq $0x2e8, %rsp            # imm = 0x2E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x18238(%rip), %rdi     # 0x29b60
leaq 0x18243(%rip), %rsi     # 0x29b72
leaq 0x18243(%rip), %rcx     # 0x29b79
movl $0x20, %edx
callq 0x2140
jmp 0x11ac9
jmp 0x11ac9
jmp 0x11ac9
movq %rax, %r14
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0x119ec
movq 0xe8(%rsp), %rsi
jmp 0x119e4
jmp 0x119bf
jmp 0x119bf
movq %rax, %r14
movq 0xf8(%rsp), %rdi
leaq 0x108(%rsp), %rax
cmpq %rax, %rdi
je 0x119ec
movq 0x108(%rsp), %rsi
jmp 0x119e4
movq %rax, %r14
movq 0x118(%rsp), %rdi
leaq 0x128(%rsp), %rax
cmpq %rax, %rdi
je 0x119ec
movq 0x128(%rsp), %rsi
jmp 0x119e4
jmp 0x119bf
movq %rax, %r14
jmp 0x119ec
movq %rax, %r14
movq 0x138(%rsp), %rdi
leaq 0x148(%rsp), %rax
cmpq %rax, %rdi
je 0x119ec
movq 0x148(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x160(%rsp), %rdi
leaq 0x170(%rsp), %rax
cmpq %rax, %rdi
je 0x11b27
movq 0x170(%rsp), %rsi
jmp 0x11b1a
movq %rax, %r14
jmp 0x11aa7
jmp 0x11b24
movq %rax, %r14
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x11acc
movq 0xc8(%rsp), %rsi
jmp 0x11a79
jmp 0x11b24
jmp 0x11b24
jmp 0x11b24
jmp 0x11b24
movq %rax, %r14
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x11acc
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x2210
jmp 0x11acc
movq %rax, %r14
jmp 0x11aea
movq %rax, %r14
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x11aa7
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x23502(%rip), %rsi     # 0x34fb0
leaq 0x160(%rsp), %rdi
callq 0x21a0
movq 0x58(%rsp), %rdi
callq 0x2080
jmp 0x11b27
jmp 0x11ac9
movq %rax, %r14
movq 0x234dd(%rip), %rsi     # 0x34fb0
leaq 0x160(%rsp), %rdi
callq 0x21a0
movq 0x58(%rsp), %rdi
callq 0x2080
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x11b06
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x2210
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x11b27
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x2210
jmp 0x11b27
movq %rax, %r14
leaq 0x18(%rsp), %rax
movq 0x8(%rsp), %rdi
cmpq %rax, %rdi
je 0x11b43
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2210
movq %r14, %rdi
callq 0x2310
nop