// File: /workspace/github_cpp_makefile_star2_O3/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 0x461c60
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 0x413a06
leaq (%rsp,%rax), %rdi
addq $0x60, %rdi
movl $0xa, %esi
callq 0x4663c0
movsbl %al, %edx
leaq 0x60(%rsp), %r14
movq %rsp, %rsi
movq %r14, %rdi
callq 0x41d090
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
cmpb $0xd, -0x1(%rax,%rcx)
jne 0x4139f3
decq %rcx
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
xorl %edx, %edx
callq 0x48e3a0
movq %rsp, %rdi
leaq 0x20(%rsp), %r15
movq %r15, %rsi
callq 0x48bbc0
movq (%r15), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x4139f3
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x41ae90
leaq 0x18edef(%rip), %rsi    # 0x5a27e9
movq %rsp, %rdi
callq 0x48dd80
testl %eax, %eax
je 0x413a3c
xorl %ebx, %ebx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x413a1e
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x41ae90
leaq 0x60(%rsp), %rdi
callq 0x462990
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 0x4663c0
movsbl %al, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x41d090
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x413b5c
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
cmpb $0xd, -0x1(%rax,%rcx)
jne 0x413ac6
decq %rcx
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x48e3a0
movq %r15, %rdi
movq %r12, %rsi
callq 0x48bbc0
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x413ac6
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x41ae90
movl $0x1, %ecx
movq %r15, %rdi
leaq 0x18ed1d(%rip), %rsi    # 0x5a27f2
xorl %edx, %edx
callq 0x48d5e0
movq %rax, %r13
leaq 0x1(%rax), %rdx
movq %r12, %rdi
movq %r15, %rsi
movq $-0x1, %rcx
callq 0x48e3a0
movq %rbp, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %r13, %rcx
callq 0x48e3a0
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x413be2
movq %rax, %rdi
movq %r12, %rsi
callq 0x48bbc0
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x413b37
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x41ae90
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x413a49
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x41ae90
jmp 0x413a49
movb $0x1, %bl
leaq 0x10(%rsp), %r12
jmp 0x413a08
jmp 0x413bb2
jmp 0x413bb2
jmp 0x413bb2
movq %rax, %rbx
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x413b92
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x41ae90
jmp 0x413b92
movq %rax, %rbx
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x413bb5
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x41ae90
jmp 0x413bb5
jmp 0x413bb2
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x413bd0
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x41ae90
leaq 0x60(%rsp), %rdi
callq 0x462990
movq %rbx, %rdi
callq 0x4bfce0