// File: /workspace/github_cpp_makefile_star2_O3/WeiqiangZhou[P]BIRD/source/create_library_function.cpp
// Function: ReadMatrix_d(char*, double**)
int ReadMatrix_d(char *file, double **data)
{
	std::ifstream infile(file);
	std::string line_temp;
	std::string line_token;
	int m, k;
	m = 0;
	if (infile.is_open())
	{
		std::cout << "Reading " << file << "..." << std::endl;
		while (!infile.eof())
		{
			std::getline(infile, line_temp);
			if (line_temp.empty()){ break; }
			std::stringstream each_line(line_temp);
			k = 0;
			while (std::getline(each_line, line_token, '\t'))
			{
				data[k][m] = atof(line_token.c_str());
				k++;
			}
			m++;
		}

		infile.close();
	}
	else
	{
		std::cout << "Error! File " << file << " not found!" << std::endl;
		return 1;
	}

	return 0;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3d8, %rsp            # imm = 0x3D8
movq %rsi, -0x70(%rbp)
movq %rdi, %r14
leaq -0x278(%rbp), %rdi
movq %r14, %rsi
movl $0x8, %edx
callq 0x2200
leaq -0x58(%rbp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x38(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x200(%rbp), %rdi
callq 0x2060
testb %al, %al
je 0x4168
movq 0x2ea5(%rip), %r15      # 0x6fd8
leaq 0x12b6(%rip), %rsi      # 0x53f0
movl $0x8, %edx
movq %r15, %rdi
callq 0x2150
testq %r14, %r14
je 0x41ab
movq %r14, %rdi
callq 0x2090
movq 0x2e7d(%rip), %rdi      # 0x6fd8
movq %r14, %rsi
movq %rax, %rdx
callq 0x2150
jmp 0x41c3
movq 0x2e69(%rip), %rbx      # 0x6fd8
leaq 0x140f(%rip), %rsi      # 0x5585
movl $0xc, %edx
movq %rbx, %rdi
callq 0x2150
testq %r14, %r14
je 0x42fe
movq %r14, %rdi
callq 0x2090
movq 0x2e3d(%rip), %rdi      # 0x6fd8
movq %r14, %rsi
movq %rax, %rdx
callq 0x2150
jmp 0x4315
movq (%r15), %rax
movq -0x18(%rax), %rax
leaq (%r15,%rax), %rdi
movl 0x20(%r15,%rax), %esi
orl $0x1, %esi
callq 0x21d0
movq 0x2e0e(%rip), %r14      # 0x6fd8
leaq 0x1173(%rip), %rsi      # 0x5344
movl $0x3, %edx
movq %r14, %rdi
callq 0x2150
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq 0x2ddc(%rip), %rdi      # 0x6fd8
callq 0x2040
movq %rax, %rdi
callq 0x20d0
movq -0x278(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x2, -0x258(%rbp,%rax)
jne 0x42ee
leaq (%rax,%rbp), %rdi
addq $-0x278, %rdi           # imm = 0xFD88
xorl %r15d, %r15d
leaq -0x68(%rbp), %r12
leaq -0x400(%rbp), %r13
leaq -0x48(%rbp), %r14
movl $0xa, %esi
callq 0x2120
movsbl %al, %edx
leaq -0x278(%rbp), %rdi
movq %r12, %rsi
callq 0x2220
cmpq $0x0, -0x60(%rbp)
je 0x42ee
movq %r13, %rdi
movq %r12, %rsi
movl $0x18, %edx
callq 0x21c0
movq -0x70(%rbp), %rbx
movq %r13, %rdi
movq %r14, %rsi
movl $0x9, %edx
callq 0x2220
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x42b0
movq -0x48(%rbp), %rdi
callq 0x2170
movq (%rbx), %rax
movsd %xmm0, (%rax,%r15,8)
addq $0x8, %rbx
jmp 0x427a
incq %r15
movq %r13, %rdi
movq 0x2d03(%rip), %rsi      # 0x6fc0
callq 0x20e0
leaq -0x380(%rbp), %rdi
callq 0x2080
movq -0x278(%rbp), %rax
movq -0x18(%rax), %rax
leaq (%rax,%rbp), %rdi
addq $-0x278, %rdi           # imm = 0xFD88
testb $0x2, 0x20(%rdi)
je 0x423f
xorl %ebx, %ebx
leaq -0x278(%rbp), %rdi
callq 0x2050
jmp 0x4360
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x21d0
movq 0x2cbc(%rip), %rbx      # 0x6fd8
leaq 0x126f(%rip), %rsi      # 0x5592
movl $0xb, %edx
movq %rbx, %rdi
callq 0x2150
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq 0x2c8a(%rip), %rdi      # 0x6fd8
callq 0x2040
movl $0x1, %ebx
movq %rax, %rdi
callq 0x20d0
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x4379
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x4392
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2140
leaq -0x278(%rbp), %rdi
callq 0x2070
movl %ebx, %eax
addq $0x3d8, %rsp            # imm = 0x3D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x43b6
jmp 0x43b6
movq %rax, %rbx
jmp 0x43dd
movq %rax, %rbx
movq 0x2bfb(%rip), %rsi      # 0x6fc0
leaq -0x400(%rbp), %rdi
callq 0x20e0
leaq -0x380(%rbp), %rdi
callq 0x2080
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x43f6
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x440f
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2140
leaq -0x278(%rbp), %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x21f0