// File: /workspace/github_cpp_makefile_star2_O2/ChnMasterOG[P]KmerGO2/kmergo/../kmc_api/kmer_api.h
// Function: void CKmerAPI::to_string_impl<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>(__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>)
inline void to_string_impl(RandomAccessIterator iter)
	{
		uchar *byte_ptr;
		uchar c;
		uchar temp_byte_alignment = byte_alignment;
		uint32 cur_string_size = 0;
		for (uint32 row_counter = 0; row_counter < no_of_rows; row_counter++)
		{
			byte_ptr = reinterpret_cast<uchar*>(&kmer_data[row_counter]);

			byte_ptr += 7;					// shift a pointer towards a MSB

			for (uint32 i = 0; (i < kmer_length) && (i < 32); i += 4)		// 32 symbols of any "row" in kmer_data
			{
				if ((i == 0) && temp_byte_alignment)				// check if a byte_alignment placed before a prefix is to be skipped
					temp_byte_alignment--;
				else
				{
					c = 0xc0 & *byte_ptr;			//11000000
					c = c >> 6;
					*(iter + cur_string_size++) = char_codes[c];
					if (cur_string_size == kmer_length) break;
				}

				if ((i == 0) && temp_byte_alignment)				// check if a  byte_alignment placed before a prefix is to be skipped
					temp_byte_alignment--;
				else
				{
					c = 0x30 & *byte_ptr;			//00110000
					c = c >> 4;
					*(iter + cur_string_size++) = char_codes[c];
					if (cur_string_size == kmer_length) break;
				}

				if ((i == 0) && temp_byte_alignment)				// check if a  byte_alignment placed before a prefix is to be skipped
					temp_byte_alignment--;
				else
				{
					c = 0x0c & *byte_ptr;			//00001100
					c = c >> 2;
					*(iter + cur_string_size++) = char_codes[c];
					if (cur_string_size == kmer_length) break;
				}
				// no need to check byte alignment as its length is at most 3 
				c = 0x03 & *byte_ptr;			//00000011
				*(iter + cur_string_size++) = char_codes[c];
				if (cur_string_size == kmer_length) break;

				byte_ptr--;
			}
		}
	}

// Assembly:
pushq %rbx
movb 0xc(%rdi), %al
xorl %ecx, %ecx
movq $0x59cef0, %rdx         # imm = 0x59CEF0
xorl %r8d, %r8d
movl 0x10(%rdi), %r9d
cmpq %r9, %rcx
jae 0x40870e
movq (%rdi), %r9
leaq (%r9,%rcx,8), %r9
addq $0x7, %r9
movl 0x8(%rdi), %r11d
xorl %r10d, %r10d
cmpl $0x1f, %r10d
ja 0x408706
cmpl %r11d, %r10d
jae 0x408706
testl %r10d, %r10d
jne 0x408661
testb %al, %al
je 0x408661
decb %al
jmp 0x408681
movzbl (%r9), %r11d
shrl $0x6, %r11d
movb (%rdx,%r11), %r11b
movl %r8d, %ebx
incl %r8d
movb %r11b, (%rsi,%rbx)
cmpl 0x8(%rdi), %r8d
je 0x408706
testl %r10d, %r10d
jne 0x40868e
testb %al, %al
je 0x40868e
decb %al
jmp 0x4086ae
movzbl (%r9), %r11d
shrl $0x4, %r11d
andl $0x3, %r11d
movb (%rdx,%r11), %r11b
movl %r8d, %ebx
incl %r8d
movb %r11b, (%rsi,%rbx)
cmpl 0x8(%rdi), %r8d
je 0x408706
testl %r10d, %r10d
jne 0x4086bb
testb %al, %al
je 0x4086bb
decb %al
jmp 0x4086db
movzbl (%r9), %r11d
shrl $0x2, %r11d
andl $0x3, %r11d
movb (%rdx,%r11), %r11b
movl %r8d, %ebx
incl %r8d
movb %r11b, (%rsi,%rbx)
cmpl 0x8(%rdi), %r8d
je 0x408706
movzbl (%r9), %r11d
andl $0x3, %r11d
movb (%rdx,%r11), %r11b
movl %r8d, %ebx
incl %r8d
movb %r11b, (%rsi,%rbx)
movl 0x8(%rdi), %r11d
cmpl %r11d, %r8d
je 0x408706
decq %r9
addl $0x4, %r10d
jmp 0x408641
incq %rcx
jmp 0x408622
popq %rbx
retq