// File: /workspace/github_cpp_makefile_star2_O1/jkunlin[P]maxclique/read_file.cpp
// Function: read_file(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool**&, unsigned long&)
void read_file(string name, bool ** &conn, size_t &size) {
	ifstream f(name.c_str());
	char buffer[80];
	assert(f.is_open());
	set<int> v;
	multimap<int, int> e;

	while(!f.eof()) {
		f.getline (buffer, 70);
		if(buffer[0] == 'e') {
			int vi, vj;
			sscanf(buffer, "%*c %d %d", &vi, &vj);
			v.insert(vi);
			v.insert(vj);
			e.insert(make_pair(vi, vj));
		}
	}
	size = v.size();

	conn = new bool *[size];
	for(size_t i = 0; i < size; i++) {
		conn[i] = new bool[size];
		memset(conn[i], 0, size * sizeof(bool));
	}
	for(multimap<int, int>::iterator it = e.begin(); it != e.end(); it++) {
		conn[it->first - 1][it->second -1] = true;
		conn[it->second - 1][it->first - 1] = true;
	}

	cout << "|E| = "<< e.size() << " |V| = " << v.size() << " p = " << (double) e.size() / (v.size() * (v.size() - 1) /2) <<endl;
	f.close();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2c8, %rsp            # imm = 0x2C8
movq %rdx, %r14
movq %rsi, %rbx
movq (%rdi), %rsi
leaq 0xc0(%rsp), %rdi
movl $0x8, %edx
callq 0x22b0
leaq 0x138(%rsp), %rdi
callq 0x2070
testb %al, %al
je 0x4726
leaq 0x48(%rsp), %rax
xorl %ecx, %ecx
movl %ecx, (%rax)
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
leaq 0x18(%rsp), %rax
movl %ecx, (%rax)
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
movq 0xc0(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x2, 0xe0(%rsp,%rax)
jne 0x4579
leaq (%rsp,%rax), %rdi
addq $0xc0, %rdi
leaq 0x70(%rsp), %r12
leaq 0x4(%rsp), %rbp
movq %rsp, %r13
leaq 0x40(%rsp), %r15
movl $0xa, %esi
callq 0x21b0
movsbl %al, %ecx
movl $0x46, %edx
leaq 0xc0(%rsp), %rdi
movq %r12, %rsi
callq 0x22c0
cmpb $0x65, 0x70(%rsp)
jne 0x4558
movq %r12, %rdi
leaq 0xd02(%rip), %rsi       # 0x5215
movq %rbp, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x21c0
movq %r15, %rdi
movq %rbp, %rsi
callq 0x481a
movq %r15, %rdi
movq %r13, %rsi
callq 0x481a
movl 0x4(%rsp), %eax
movl (%rsp), %ecx
shlq $0x20, %rcx
orq %rax, %rcx
movq %rcx, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x492a
movq 0xc0(%rsp), %rax
movq -0x18(%rax), %rax
leaq (%rsp,%rax), %rdi
addq $0xc0, %rdi
testb $0x2, 0x20(%rdi)
je 0x44e0
movq 0x68(%rsp), %rax
movq %rax, (%r14)
movq %rax, %rcx
shrq $0x3d, %rcx
shlq $0x3, %rax
xorl %edi, %edi
negq %rcx
sbbq %rdi, %rdi
orq %rax, %rdi
callq 0x2030
movq %rax, (%rbx)
movq (%r14), %r15
testq %r15, %r15
je 0x45d5
xorl %r12d, %r12d
movq %r15, %rdi
callq 0x2030
movq (%rbx), %rcx
movq %rax, (%rcx,%r12,8)
movq (%rbx), %rax
movq (%rax,%r12,8), %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x20f0
incq %r12
movq (%r14), %r15
cmpq %r15, %r12
jb 0x45aa
movq 0x28(%rsp), %rax
leaq 0x18(%rsp), %r14
cmpq %r14, %rax
je 0x4613
movq (%rbx), %rbx
movb $0x1, %bpl
movslq 0x20(%rax), %rcx
movq -0x8(%rbx,%rcx,8), %rdx
movslq 0x24(%rax), %rsi
movb %bpl, -0x1(%rdx,%rsi)
movq -0x8(%rbx,%rsi,8), %rdx
movb %bpl, -0x1(%rdx,%rcx)
movq %rax, %rdi
callq 0x2150
cmpq %r14, %rax
jne 0x45ea
movq 0x39be(%rip), %rdi      # 0x7fd8
leaq 0xbfe(%rip), %rsi       # 0x521f
movl $0x6, %edx
callq 0x2200
movq 0x38(%rsp), %rsi
movq 0x39a1(%rip), %rdi      # 0x7fd8
callq 0x2130
movq %rax, %rbx
leaq 0xbe0(%rip), %rsi       # 0x5226
movl $0x7, %edx
movq %rax, %rdi
callq 0x2200
movq 0x68(%rsp), %rsi
movq %rbx, %rdi
callq 0x2130
movq %rax, %rbx
leaq 0xbc4(%rip), %rsi       # 0x522e
movl $0x5, %edx
movq %rax, %rdi
callq 0x2200
movsd 0x38(%rsp), %xmm1
unpcklps 0xb2c(%rip), %xmm1      # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0xb34(%rip), %xmm1      # 0x51c0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movq 0x68(%rsp), %rax
leaq -0x1(%rax), %rcx
imulq %rax, %rcx
shrq %rcx
xorps %xmm1, %xmm1
cvtsi2sd %rcx, %xmm1
divsd %xmm1, %xmm0
movq %rbx, %rdi
callq 0x2230
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2140
leaq 0xc0(%rsp), %rdi
callq 0x2060
leaq 0x10(%rsp), %rdi
callq 0x477a
leaq 0x40(%rsp), %rdi
callq 0x47ca
leaq 0xc0(%rsp), %rdi
callq 0x2080
addq $0x2c8, %rsp            # imm = 0x2C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xaa3(%rip), %rdi       # 0x51d0
leaq 0xaa8(%rip), %rsi       # 0x51dc
leaq 0xaaf(%rip), %rcx       # 0x51ea
movl $0x7, %edx
callq 0x2110
jmp 0x474d
jmp 0x474d
jmp 0x474d
jmp 0x474d
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x477a
leaq 0x40(%rsp), %rdi
callq 0x47ca
leaq 0xc0(%rsp), %rdi
callq 0x2080
movq %rbx, %rdi
callq 0x2280
nop