// File: /workspace/github_cpp_makefile_star2_O3/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 0x4816
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), %r13
movl %ecx, (%r13)
movq %rcx, 0x8(%r13)
movq %r13, 0x10(%r13)
movq %r13, 0x18(%r13)
movq %rcx, 0x20(%r13)
movq 0xc0(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x2, 0xe0(%rsp,%rax)
jne 0x4683
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 0x463a
movq %r12, %rdi
leaq 0xc50(%rip), %rsi       # 0x5245
movq %rbp, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x21c0
movq %r15, %rdi
movq %rbp, %rsi
callq 0x490a
movq %r15, %rdi
movq %r13, %rsi
callq 0x490a
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 0x4a18
movq 0xc0(%rsp), %rax
movq -0x18(%rax), %rax
leaq (%rsp,%rax), %rdi
addq $0xc0, %rdi
testb $0x2, 0x20(%rdi)
je 0x45c2
movq 0x68(%rsp), %r15
movq %r15, (%r14)
movq %r15, %rax
shrq $0x3d, %rax
movq %r15, %rcx
shlq $0x3, %rcx
xorl %edi, %edi
negq %rax
sbbq %rdi, %rdi
orq %rcx, %rdi
leaq 0x18(%rsp), %r13
jmp 0x468f
movq $0x0, (%r14)
xorl %r15d, %r15d
xorl %edi, %edi
callq 0x2030
movq %rax, (%rbx)
testq %r15, %r15
je 0x46ca
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 0x469f
movq 0x28(%rsp), %rax
cmpq %r13, %rax
je 0x4703
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 %r13, %rax
jne 0x46da
movq 0x38ce(%rip), %rdi      # 0x7fd8
leaq 0xb3e(%rip), %rsi       # 0x524f
movl $0x6, %edx
callq 0x2200
movq 0x38(%rsp), %rsi
movq 0x38b1(%rip), %rdi      # 0x7fd8
callq 0x2130
movq %rax, %rbx
leaq 0xb20(%rip), %rsi       # 0x5256
movl $0x7, %edx
movq %rax, %rdi
callq 0x2200
movq 0x68(%rsp), %rsi
movq %rbx, %rdi
callq 0x2130
movq %rax, %rbx
leaq 0xb04(%rip), %rsi       # 0x525e
movl $0x5, %edx
movq %rax, %rdi
callq 0x2200
movsd 0x38(%rsp), %xmm1
unpcklps 0xa6c(%rip), %xmm1      # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0xa74(%rip), %xmm1      # 0x51f0
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 0x486a
leaq 0x40(%rsp), %rdi
callq 0x48ba
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 0x9e3(%rip), %rdi       # 0x5200
leaq 0x9e8(%rip), %rsi       # 0x520c
leaq 0x9ef(%rip), %rcx       # 0x521a
movl $0x7, %edx
callq 0x2110
jmp 0x483d
jmp 0x483d
jmp 0x483d
jmp 0x483d
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x486a
leaq 0x40(%rsp), %rdi
callq 0x48ba
leaq 0xc0(%rsp), %rdi
callq 0x2080
movq %rbx, %rdi
callq 0x2280
nop