// File: /workspace/github_cpp_makefile_star2_O1/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 $0x48, %rsp
movq %rdi, %r15
movq (%rsi), %rdi
leaq 0x4d70(%rip), %rsi      # 0x7277
callq 0x21c0
testq %rax, %rax
je 0x26ab
movq %rax, %rbx
leaq 0x30(%r15), %rdx
leaq 0x4ae1(%rip), %rsi      # 0x7004
movq %rax, %rdi
movq %rdx, 0x18(%rsp)
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 0x29aa
leaq 0x20(%rsp), %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0x2a4e
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x257a
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 0x29aa
leaq 0x18(%r15), %r14
leaq 0x20(%rsp), %rdx
movq %r14, %rdi
movq %r13, %rsi
callq 0x2a4e
movq %r14, 0x40(%rsp)
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x25cb
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x18(%rsp), %rax
cmpq $0x0, (%rax)
je 0x2635
leaq 0x4a2d(%rip), %r13      # 0x700a
movq $0x0, 0x10(%rsp)
cmpq $0x0, (%rax)
je 0x261e
movq 0x10(%rsp), %rax
leaq (%rax,%rax,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
addq $0x4, %rbp
cmpq 0x30(%r15), %r12
jb 0x25fa
movq 0x10(%rsp), %rdx
incq %rdx
movq 0x18(%rsp), %rax
movq %rdx, 0x10(%rsp)
cmpq (%rax), %rdx
jb 0x25e6
cmpq $0x0, (%rax)
je 0x269f
leaq 0x49c8(%rip), %r15      # 0x700a
movq $0x0, 0x10(%rsp)
movq 0x40(%rsp), %r13
cmpq $0x0, (%rax)
je 0x268d
movq 0x10(%rsp), %rax
leaq (%rax,%rax,2), %r14
xorl %ebp, %ebp
xorl %r12d, %r12d
movq (%r13), %rax
movq (%rax,%r14,8), %rdx
addq %rbp, %rdx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x22a0
movq 0x18(%rsp), %rax
incq %r12
addq $0x4, %rbp
cmpq (%rax), %r12
jb 0x2664
movq 0x10(%rsp), %rdx
incq %rdx
movq %rdx, 0x10(%rsp)
cmpq (%rax), %rdx
jb 0x2650
movq %rbx, %rdi
callq 0x2180
xorl %eax, %eax
jmp 0x26b0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x26c3
jmp 0x26df
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x26e2
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
jmp 0x26e2
movq %rax, %rbx
movq %rbx, %rdi
callq 0x2280