// File: 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
movq %rsp, %rbp
subq $0x340, %rsp            # imm = 0x340
movq %rsi, %rax
movq %rdi, %rsi
movq %rsi, -0x10(%rbp)
movq %rax, -0x18(%rbp)
leaq -0x220(%rbp), %rdi
movl $0x8, %edx
callq 0x4750c0
leaq -0x240(%rbp), %rdi
callq 0x49eec0
movq -0x220(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x220(%rbp,%rax), %rdi
callq 0x479530
movb %al, -0x2d9(%rbp)
jmp 0x41eba6
movb -0x2d9(%rbp), %al
testb $0x1, %al
jne 0x41ebb2
jmp 0x41ebdc
movb $0x0, -0x1(%rbp)
movl $0x1, -0x250(%rbp)
jmp 0x41ee93
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x248(%rbp)
movl %eax, -0x24c(%rbp)
jmp 0x41eeb9
leaq -0x220(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0x4a1890
jmp 0x41ebf1
leaq -0x240(%rbp), %rdi
movq %rdi, -0x2f0(%rbp)
callq 0x49f1f0
movq -0x2f0(%rbp), %rdi
movq %rax, %rsi
decq %rsi
callq 0x49f510
movq %rax, -0x2e8(%rbp)
jmp 0x41ec1f
movq -0x2e8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xd, %eax
jne 0x41ec7f
leaq -0x240(%rbp), %rdi
movq %rdi, -0x2f8(%rbp)
callq 0x49f1f0
movq -0x2f8(%rbp), %rsi
movq %rax, %rcx
decq %rcx
xorl %eax, %eax
movl %eax, %edx
leaq -0x270(%rbp), %rdi
callq 0x4a1800
jmp 0x41ec60
leaq -0x240(%rbp), %rdi
leaq -0x270(%rbp), %rsi
callq 0x49f020
leaq -0x270(%rbp), %rdi
callq 0x49efd0
leaq -0x240(%rbp), %rdi
leaq 0x197b3c(%rip), %rsi    # 0x5b67c9
callq 0x4a11e0
cmpl $0x0, %eax
je 0x41ecaa
movb $0x0, -0x1(%rbp)
movl $0x1, -0x250(%rbp)
jmp 0x41ee93
jmp 0x41ecac
leaq -0x220(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0x4a1890
movq %rax, -0x300(%rbp)
jmp 0x41ecc8
movq -0x300(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x479520
movb %al, -0x301(%rbp)
jmp 0x41ece6
movb -0x301(%rbp), %al
testb $0x1, %al
jne 0x41ecf5
jmp 0x41ee85
leaq -0x240(%rbp), %rdi
movq %rdi, -0x318(%rbp)
callq 0x49f1f0
movq -0x318(%rbp), %rdi
movq %rax, %rsi
decq %rsi
callq 0x49f510
movq %rax, -0x310(%rbp)
jmp 0x41ed23
movq -0x310(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xd, %eax
jne 0x41ed83
leaq -0x240(%rbp), %rdi
movq %rdi, -0x320(%rbp)
callq 0x49f1f0
movq -0x320(%rbp), %rsi
movq %rax, %rcx
decq %rcx
xorl %eax, %eax
movl %eax, %edx
leaq -0x290(%rbp), %rdi
callq 0x4a1800
jmp 0x41ed64
leaq -0x240(%rbp), %rdi
leaq -0x290(%rbp), %rsi
callq 0x49f020
leaq -0x290(%rbp), %rdi
callq 0x49efd0
leaq 0x197a48(%rip), %rsi    # 0x5b67d2
xorl %eax, %eax
movl %eax, %edx
leaq -0x240(%rbp), %rdi
movq %rdi, -0x328(%rbp)
callq 0x4a0b30
movq -0x328(%rbp), %rsi
movq %rax, -0x298(%rbp)
movq -0x298(%rbp), %rdx
incq %rdx
leaq -0x2b8(%rbp), %rdi
movq $-0x1, %rcx
callq 0x4a1800
jmp 0x41edce
movq -0x18(%rbp), %rax
movq %rax, -0x330(%rbp)
movq -0x298(%rbp), %rcx
xorl %eax, %eax
movl %eax, %edx
leaq -0x2d8(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0x4a1800
jmp 0x41edf9
movq -0x330(%rbp), %rdi
leaq -0x2d8(%rbp), %rsi
callq 0x41eee0
movq %rax, -0x338(%rbp)
jmp 0x41ee15
movq -0x338(%rbp), %rdi
leaq -0x2b8(%rbp), %rsi
callq 0x49f020
leaq -0x2d8(%rbp), %rdi
callq 0x49efd0
leaq -0x2b8(%rbp), %rdi
callq 0x49efd0
jmp 0x41ecac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x248(%rbp)
movl %eax, -0x24c(%rbp)
jmp 0x41ee77
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x248(%rbp)
movl %eax, -0x24c(%rbp)
leaq -0x2d8(%rbp), %rdi
callq 0x49efd0
leaq -0x2b8(%rbp), %rdi
callq 0x49efd0
jmp 0x41eeb9
movb $0x1, -0x1(%rbp)
movl $0x1, -0x250(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x49efd0
leaq -0x220(%rbp), %rdi
callq 0x475df0
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x340, %rsp            # imm = 0x340
popq %rbp
retq
leaq -0x240(%rbp), %rdi
callq 0x49efd0
leaq -0x220(%rbp), %rdi
callq 0x475df0
movq -0x248(%rbp), %rdi
callq 0x4d3c10
nopl (%rax)