// File: /workspace/github_cpp_makefile_star2_O1/ChnMasterOG[P]KmerGO2/kmergo/csv_lib.cpp
// Function: Read_CSV(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>&)
bool Read_CSV(std::string csv_path, std::map<std::string, std::string>& stringMap)
{
	std::ifstream input_file(csv_path);
	std::string line;

	if (!input_file)
	{
		return false;
	}

	std::getline(input_file, line);	// check head text
	if (line[line.size() - 1] == '\r')
	{
		line = line.substr(0, line.size() - 1);
	}
	if (line.compare("id,trait") != 0)
	{
		return false;
	}

	while (std::getline(input_file, line))
	{
		if (line[line.size() - 1] == '\r')
		{
			line = line.substr(0, line.size() - 1);
		}
		auto pos = line.find(",");
		stringMap[line.substr(0, pos)] = line.substr(pos + 1);
	}

	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x268, %rsp            # imm = 0x268
movq %rsi, %rbx
movq %rdi, %rsi
leaq 0x60(%rsp), %r14
movq %r14, %rdi
movl $0x8, %edx
callq 0x462170
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x80(%rsp,%rax)
jne 0x413d7e
leaq (%rsp,%rax), %rdi
addq $0x60, %rdi
movl $0xa, %esi
callq 0x4668d0
movsbl %al, %edx
leaq 0x60(%rsp), %r14
movq %rsp, %rsi
movq %r14, %rdi
callq 0x41d5a0
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
cmpb $0xd, -0x1(%rax,%rcx)
jne 0x413d6b
decq %rcx
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
xorl %edx, %edx
callq 0x48e8b0
movq %rsp, %rdi
leaq 0x20(%rsp), %r15
movq %r15, %rsi
callq 0x48c0d0
movq (%r15), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x413d6b
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x41b3a0
leaq 0x18fa67(%rip), %rsi    # 0x5a37d9
movq %rsp, %rdi
callq 0x48e290
testl %eax, %eax
je 0x413db4
xorl %ebx, %ebx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x413d96
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x41b3a0
leaq 0x60(%rsp), %rdi
callq 0x462ea0
movl %ebx, %eax
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsp, %r15
leaq 0x20(%rsp), %r12
leaq 0x40(%rsp), %rbp
movq 0x60(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4668d0
movsbl %al, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x41d5a0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x413ed4
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
cmpb $0xd, -0x1(%rax,%rcx)
jne 0x413e3e
decq %rcx
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x48e8b0
movq %r15, %rdi
movq %r12, %rsi
callq 0x48c0d0
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x413e3e
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movl $0x1, %ecx
movq %r15, %rdi
leaq 0x18f995(%rip), %rsi    # 0x5a37e2
xorl %edx, %edx
callq 0x48daf0
movq %rax, %r13
leaq 0x1(%rax), %rdx
movq %r12, %rdi
movq %r15, %rsi
movq $-0x1, %rcx
callq 0x48e8b0
movq %rbp, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %r13, %rcx
callq 0x48e8b0
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x413f5a
movq %rax, %rdi
movq %r12, %rsi
callq 0x48c0d0
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x413eaf
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x413dc1
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x41b3a0
jmp 0x413dc1
movb $0x1, %bl
leaq 0x10(%rsp), %r12
jmp 0x413d80
jmp 0x413f2a
jmp 0x413f2a
jmp 0x413f2a
movq %rax, %rbx
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x413f0a
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x41b3a0
jmp 0x413f0a
movq %rax, %rbx
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x413f2d
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x41b3a0
jmp 0x413f2d
jmp 0x413f2a
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x413f48
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x41b3a0
leaq 0x60(%rsp), %rdi
callq 0x462ea0
movq %rbx, %rdi
callq 0x4c0230