// File: /workspace/github_cpp_makefile_star2_O2/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
pushq $0x8
popq %rdx
movq %r14, %rdi
callq 0x45a300
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x80(%rsp,%rax)
jne 0x40e18f
leaq 0x60(%rsp), %rdi
movq %rsp, %rsi
callq 0x486ad0
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
cmpb $0xd, -0x1(%rax,%rcx)
jne 0x40e17c
decq %rcx
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
xorl %edx, %edx
callq 0x486a40
movq %rsp, %rdi
leaq 0x20(%rsp), %r14
movq %r14, %rsi
callq 0x484260
movq %r14, %rdi
callq 0x484210
leaq 0x18e666(%rip), %rsi    # 0x59c7e9
movq %rsp, %rdi
callq 0x486420
testl %eax, %eax
je 0x40e1b7
xorl %ebx, %ebx
movq %rsp, %rdi
callq 0x484210
leaq 0x60(%rsp), %rdi
callq 0x45b030
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
pushq $-0x1
popq %rbp
leaq 0x40(%rsp), %r14
leaq 0x60(%rsp), %rdi
movq %r15, %rsi
callq 0x486ad0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x40e27a
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
cmpb $0xd, -0x1(%rax,%rcx)
jne 0x40e219
decq %rcx
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x486a40
movq %r15, %rdi
movq %r12, %rsi
callq 0x484260
movq %r12, %rdi
callq 0x484210
movq %r15, %rdi
leaq 0x18e5cf(%rip), %rsi    # 0x59c7f2
xorl %edx, %edx
callq 0x485d70
movq %rax, %r13
leaq 0x1(%rax), %rdx
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rcx
callq 0x486a40
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %r13, %rcx
callq 0x486a40
movq %rbx, %rdi
movq %r14, %rsi
callq 0x40e2c4
movq %rax, %rdi
movq %r12, %rsi
callq 0x484260
movq %r14, %rdi
callq 0x484210
movq %r12, %rdi
callq 0x484210
jmp 0x40e1c7
movb $0x1, %bl
jmp 0x40e191
jmp 0x40e2a7
jmp 0x40e2a7
jmp 0x40e2a7
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x484210
jmp 0x40e299
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x484210
jmp 0x40e2aa
jmp 0x40e2a7
movq %rax, %rbx
movq %rsp, %rdi
callq 0x484210
leaq 0x60(%rsp), %rdi
callq 0x45b030
movq %rbx, %rdi
callq 0x4b8e10