// File: /workspace/github_cpp_makefile_star2_O3/cssartori[P]ga-qap/src/datafile.cpp
// Function: DataFile::read(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
int DataFile::read(const std::string& filename){
	FILE *file = fopen(filename.c_str(), "rt");

	if(file == NULL)
		return -1;
	int temp;
	//reads the number of facilities
	temp = fscanf(file, "%li\n\n", &(this->n));
	
	this->flow.assign(this->n, std::vector<int>(this->n, 0));
	this->distance.assign(this->n, std::vector<int>(this->n, 0));

	//reads flow and distance matrix
	for(size_t i=0;i<this->n;i++)
		for(size_t j=0;j<this->n;j++)
			temp = fscanf(file, "%i", &(this->flow[i][j]));

	for(size_t i=0;i<this->n;i++)
		for(size_t j=0;j<this->n;j++)
			temp = fscanf(file, "%i", &(this->distance[i][j]));

	/*Just to avoid compilation warnings*/
	temp+=1;

	fclose(file);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %r15
movq (%rsi), %rdi
leaq 0x5d80(%rip), %rsi      # 0x82b7
callq 0x21c0
testq %rax, %rax
je 0x26d4
movq %rax, %rbx
leaq 0x30(%r15), %r14
leaq 0x5aed(%rip), %rsi      # 0x8040
movq %rax, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x22a0
movq 0x30(%r15), %r12
leaq 0x3c(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0x20(%rsp), %rdi
leaq 0xf(%rsp), %rcx
movq %r12, %rsi
callq 0x29c6
leaq 0x20(%rsp), %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0x2b6a
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x25a8
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x30(%r15), %r13
leaq 0x3c(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0x20(%rsp), %rdi
leaq 0xf(%rsp), %rcx
movq %r13, %rsi
callq 0x29c6
movq %rbx, 0x10(%rsp)
leaq 0x18(%r15), %r12
leaq 0x20(%rsp), %rdx
movq %r12, %rdi
movq %r13, %rsi
callq 0x2b6a
movq %r12, 0x40(%rsp)
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x25fe
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq %r14, 0x48(%rsp)
cmpq $0x0, (%r14)
je 0x26c6
leaq 0x5a32(%rip), %r13      # 0x8046
xorl %ecx, %ecx
movq 0x10(%rsp), %rbx
movq %rcx, 0x18(%rsp)
leaq (%rcx,%rcx,2), %r14
xorl %ebp, %ebp
xorl %r12d, %r12d
movq (%r15), %rax
movq (%rax,%r14,8), %rdx
addq %rbp, %rdx
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x22a0
incq %r12
movq 0x30(%r15), %rax
addq $0x4, %rbp
cmpq %rax, %r12
jb 0x2629
movq 0x18(%rsp), %rcx
incq %rcx
cmpq %rax, %rcx
jb 0x261b
testq %rax, %rax
je 0x26c6
leaq 0x59dd(%rip), %rbx      # 0x8046
xorl %ecx, %ecx
movq 0x48(%rsp), %r13
movq 0x40(%rsp), %r15
movq 0x10(%rsp), %r14
movq %rcx, 0x50(%rsp)
leaq (%rcx,%rcx,2), %rax
movq %rax, 0x18(%rsp)
xorl %ebp, %ebp
xorl %r12d, %r12d
movq (%r15), %rax
movq 0x18(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
addq %rbp, %rdx
movq %r14, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x22a0
incq %r12
movq (%r13), %rax
addq $0x4, %rbp
cmpq %rax, %r12
jb 0x268d
movq 0x50(%rsp), %rcx
incq %rcx
cmpq %rax, %rcx
jb 0x267a
movq 0x10(%rsp), %rdi
callq 0x2180
xorl %eax, %eax
jmp 0x26d9
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x26ec
jmp 0x2708
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x270b
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
jmp 0x270b
movq %rax, %rbx
movq %rbx, %rdi
callq 0x2280
nop