// File: CK7[P]abawaca/src/abawaca-build.cpp
// Function: prepare_mer_indexes_recursive(int, 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>>, unsigned long, 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, unsigned long>>>&)
void prepare_mer_indexes_recursive(int k, string mer, map<string, size_t>& mer2index)
{
	if(k==0) {
		static int next_id = 0;
		auto it = mer2index.find(Bio::DNAString(mer).reverse_complement());
		if(it == mer2index.end()) {
			mer2index.insert(pair<string, size_t>(mer, next_id++));
			dimension_order.push_back(mer);
		}
		else {
			mer2index.insert(pair<string, size_t>(mer, it->second));
		}
		return;
	}

	static char acgt[] = {'A', 'C', 'G', 'T'};
	for(auto i=0; i<4; i++) {
		prepare_mer_indexes_recursive(k-1, mer+acgt[i], mer2index);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rsi, -0x140(%rbp)
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpl $0x0, -0x4(%rbp)
jne 0xb0d8
movq -0x140(%rbp), %rsi
movq -0x18(%rbp), %rax
movq %rax, -0x150(%rbp)
leaq -0x80(%rbp), %rdi
movq %rdi, -0x148(%rbp)
callq 0x1fbf0
movq -0x148(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x1ffd0
jmp 0xae9b
leaq -0x40(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0xffa0
jmp 0xaeaa
movq -0x150(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0xff70
movq %rax, -0x158(%rbp)
jmp 0xaec3
movq -0x158(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x41c0
leaq -0x60(%rbp), %rdi
callq 0x6590
leaq -0x80(%rbp), %rdi
callq 0x6590
movq -0x18(%rbp), %rdi
callq 0x10000
movq %rax, -0x98(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0xffd0
testb $0x1, %al
jne 0xaf12
jmp 0xb031
movq -0x140(%rbp), %rsi
movq -0x18(%rbp), %rax
movq %rax, -0x178(%rbp)
movl 0x274d6(%rip), %eax     # 0x32400
movl %eax, %ecx
incl %ecx
movl %ecx, 0x274cc(%rip)     # 0x32400
movl %eax, -0xc4(%rbp)
leaq -0xc0(%rbp), %rdi
movq %rdi, -0x170(%rbp)
leaq -0xc4(%rbp), %rdx
callq 0x10070
movq -0x178(%rbp), %rdi
movq -0x170(%rbp), %rsi
callq 0x10030
movb %dl, -0x161(%rbp)
movq %rax, -0x160(%rbp)
jmp 0xaf76
movb -0x161(%rbp), %al
movq -0x160(%rbp), %rcx
movq %rcx, -0xd8(%rbp)
movb %al, -0xd0(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x100b0
movq -0x140(%rbp), %rsi
leaq 0x27436(%rip), %rdi     # 0x323e0
callq 0x100d0
jmp 0xb0d3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0xb000
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0xaff7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x41c0
leaq -0x60(%rbp), %rdi
callq 0x6590
leaq -0x80(%rbp), %rdi
callq 0x6590
jmp 0xb184
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x100b0
jmp 0xb184
movq -0x18(%rbp), %rax
movq %rax, -0x198(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x10140
movq -0x140(%rbp), %rsi
movq %rax, %rdx
addq $0x20, %rdx
leaq -0x100(%rbp), %rdi
movq %rdi, -0x190(%rbp)
callq 0x10160
movq -0x198(%rbp), %rdi
movq -0x190(%rbp), %rsi
callq 0x10030
movb %dl, -0x181(%rbp)
movq %rax, -0x180(%rbp)
jmp 0xb088
movb -0x181(%rbp), %al
movq -0x180(%rbp), %rcx
movq %rcx, -0x110(%rbp)
movb %al, -0x108(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x100b0
jmp 0xb0d3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x100b0
jmp 0xb184
jmp 0xb17b
movl $0x0, -0x114(%rbp)
cmpl $0x4, -0x114(%rbp)
jge 0xb17b
movq -0x140(%rbp), %rsi
movl -0x4(%rbp), %eax
decl %eax
movl %eax, -0x1a4(%rbp)
movslq -0x114(%rbp), %rax
leaq 0x27271(%rip), %rcx     # 0x32380
movsbl (%rax,%rcx), %edx
leaq -0x138(%rbp), %rdi
movq %rdi, -0x1a0(%rbp)
callq 0x101a0
movl -0x1a4(%rbp), %edi
movq -0x1a0(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0xae40
jmp 0xb13e
leaq -0x138(%rbp), %rdi
callq 0x41c0
movl -0x114(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x114(%rbp)
jmp 0xb0e2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x138(%rbp), %rdi
callq 0x41c0
jmp 0xb184
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
movq -0x88(%rbp), %rdi
callq 0x45c0