LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/flastest[P]HeterogeneousParallelDijkstra/BGL_Dijkstra.cc
// Function: print_thread_debug(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::ostream&)
void print_thread_debug(int thread_id, std::string debug_message, ostream& output_stream)
{
	//first lock the mutex
	std::lock_guard<std::mutex> guard(print_mutex);
	//then print
	output_stream<< "thread: " << thread_id << ": " << debug_message <<std::endl;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %rbx
movl %edi, %ebp
leaq 0xd72d(%rip), %rdi      # 0x18280
callq 0x3330
testl %eax, %eax
jne 0xabda
leaq 0x79d0(%rip), %rsi      # 0x12533
movl $0x8, %edx
movq %r14, %rdi
callq 0x32a0
movq %r14, %rdi
movl %ebp, %esi
callq 0x33e0
movq %rax, %r14
leaq 0x79b5(%rip), %rsi      # 0x12539
movl $0x2, %edx
movq %rax, %rdi
callq 0x32a0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x32a0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3230
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31a0
leaq 0xd6af(%rip), %rdi      # 0x18280
popq %rbx
popq %r14
popq %rbp
jmp 0x31e0
movl %eax, %edi
callq 0x3180
movq %rax, %rbx
leaq 0xd695(%rip), %rdi      # 0x18280
callq 0x31e0
movq %rbx, %rdi
callq 0x3400
// File: /workspace/github_cpp_makefile_star2_O3/flastest[P]HeterogeneousParallelDijkstra/BGL_Dijkstra.cc
// Function: initialize_distances_from_source(boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, boost::property<boost::edge_weight_t, int, boost::no_property>, boost::no_property, boost::listS> const&)
distance_map_t initialize_distances_from_source(
								const graph_t &graph)
{
	map<vertex_descriptor, float> distances;
	
	int num_nodes = num_vertices(graph);

	for (int i = 0; i < num_nodes; ++i)
	{
		distances[vertex(i,graph)] = INFINITY;
	}

	return distances;

}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x8(%rdi), %rax
movl $0x0, 0x8(%rdi)
xorl %ecx, %ecx
movq %rcx, 0x10(%rdi)
movq %rax, 0x18(%rdi)
movq %rax, 0x20(%rdi)
movq %rcx, 0x28(%rdi)
movq 0x20(%rsi), %r15
subq 0x18(%rsi), %r15
shrq $0x5, %r15
testl %r15d, %r15d
jle 0xac5b
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
xorl %r12d, %r12d
movq %rsp, %r14
movq %r12, (%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x850e
movl $0x7f800000, (%rax)     # imm = 0x7F800000
incq %r12
cmpq %r12, %r15
jne 0xac3e
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x8b50
movq %r14, %rdi
callq 0x3400
// File: /workspace/github_cpp_makefile_star2_O3/flastest[P]HeterogeneousParallelDijkstra/BGL_Dijkstra.cc
// Function: initialize_distances_from_source_and_mutex_maps(boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, boost::property<boost::edge_weight_t, int, boost::no_property>, boost::no_property, boost::listS> const&, std::map<unsigned long, std::shared_ptr<std::mutex>, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, std::shared_ptr<std::mutex>>>>&, std::map<unsigned long, std::shared_ptr<std::mutex>, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, std::shared_ptr<std::mutex>>>>&)
distance_map_t initialize_distances_from_source_and_mutex_maps(
								const graph_t &graph,
								mutex_map_t &distance_mutexes,
								mutex_map_t &predecessor_mutexes)
{
	map<vertex_descriptor, float> distances;
	
	int num_nodes = num_vertices(graph);

	for (int i = 0; i < num_nodes; ++i)
	{
		vertex_descriptor current_vertex = vertex(i,graph);
		distances[current_vertex] = INFINITY;
		//if (DEBUG) std::cout<<"i bet that infinity is a really big negative. it is "<< INFINITY <<std::endl;
		distance_mutexes[current_vertex] = mutex_ptr(new std::mutex);
		predecessor_mutexes[current_vertex] = mutex_ptr(new std::mutex);
	}

	return distances;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r14
movq %rdi, %rbx
leaq 0x8(%rdi), %rax
movl $0x0, 0x8(%rdi)
xorl %ecx, %ecx
movq %rcx, 0x10(%rdi)
movq %rax, 0x18(%rdi)
movq %rax, 0x20(%rdi)
movq %rcx, 0x28(%rdi)
movq 0x20(%rsi), %r12
subq 0x18(%rsi), %r12
shrq $0x5, %r12
testl %r12d, %r12d
jle 0xb970
movq %rdx, %r15
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
xorl %r13d, %r13d
leaq 0x10(%rsp), %rbp
movq %r13, 0x10(%rsp)
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xd966
movl $0x7f800000, (%rax)     # imm = 0x7F800000
movl $0x28, %edi
callq 0x3240
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq $0x0, 0x20(%rax)
movq %rax, (%rsp)
leaq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0xeba6
movq %r15, %rdi
movq %rbp, %rsi
callq 0xdb94
movaps (%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%rsp)
movq 0x8(%rax), %rdi
movups %xmm0, (%rax)
testq %rdi, %rdi
je 0xb8f2
callq 0xdf50
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xb901
callq 0xdf50
movl $0x28, %edi
callq 0x3240
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq $0x0, 0x20(%rax)
movq %rax, (%rsp)
leaq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0xeba6
movq %r14, %rdi
movq %rbp, %rsi
callq 0xdb94
movaps (%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%rsp)
movq 0x8(%rax), %rdi
movups %xmm0, (%rax)
testq %rdi, %rdi
je 0xb955
callq 0xdf50
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xb964
callq 0xdf50
incq %r13
cmpq %r13, %r12
jne 0xb888
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xb99c
jmp 0xb986
movq %rax, %r14
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xb99f
callq 0xdf50
jmp 0xb99f
jmp 0xb99c
movq %rax, %r14
movq %rbx, %rdi
callq 0x8b50
movq %r14, %rdi
callq 0x3400
// File: /workspace/github_cpp_makefile_star2_O3/narula[P]skiplists/skiplist-extra.cc
// Function: SkipList::~SkipList()
SkipList::~SkipList() {
  node* ptr = head;
  while (ptr != NULL && ptr != tail) {
	node* tmp = ptr;
	ptr = ptr->nexts[0][0].nxt;
	delete tmp;
  }
  if (head) delete head;
  if (tail) delete tail;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %r14
movq 0x8(%rdi), %rdi
testq %r14, %r14
sete %al
cmpq %rdi, %r14
sete %cl
orb %al, %cl
jne 0x133c
movq %r14, %rdi
movq 0x10(%r14), %r14
movl $0x348, %esi            # imm = 0x348
callq 0x10e0
movq 0x8(%rbx), %rdi
testq %r14, %r14
je 0x1339
cmpq %rdi, %r14
jne 0x131a
movq (%rbx), %r14
testq %r14, %r14
je 0x1352
movl $0x348, %esi            # imm = 0x348
movq %r14, %rdi
callq 0x10e0
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x1368
movl $0x348, %esi            # imm = 0x348
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x10e0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/narula[P]skiplists/skiplist-extra.cc
// Function: SkipList::fastFindNode(int)
int SkipList::fastFindNode(int key) {
  node* pred = head;
  int lFound = -1;
  for (int level = pred->topLevel-1; level >= 0; level--) {
	node* curr = pred->nexts[level][FANOUT-1].nxt;
	while (key > pred->nexts[level][FANOUT-1].prefix) {
	  pred = curr;
	  curr = pred->nexts[level][FANOUT-1].nxt;
	  inc();
	}
	int extra = 0;
	while (key > pred->nexts[level][extra].prefix) extra++;
	if (lFound == -1 && key == pred->nexts[level][extra].prefix) {
	  return level;
	}
	curr = pred->nexts[level][extra].nxt;
	if (extra > 0) {
	  pred = pred->nexts[level][extra-1].nxt;
	  inc();
	}
  }
  return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq (%rdi), %r11
movslq 0x4(%r11), %rcx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %rcx, %rcx
jle 0x143e
movl 0x28(%rdi), %edx
movl 0x2c(%rdi), %r8d
movq %rcx, %r9
shlq $0x6, %r9
addq $-0x40, %r9
movq %rcx, %r10
decq %rcx
leaq 0x8(%r11), %r14
movq %rcx, %rbx
shlq $0x6, %rbx
cmpl %esi, 0x38(%r11,%rbx)
jge 0x13ec
movq 0x38(%r14,%rbx), %r15
movq 0x40(%r15,%rbx), %r12
cmpl $0x1, %r8d
jne 0x13db
incl %edx
movl %edx, 0x28(%rdi)
leaq 0x8(%r15), %r14
movq %r15, %r11
movq %r12, %r15
cmpl %esi, 0x30(%r14,%rbx)
jl 0x13cb
leaq (%r14,%r9), %r12
xorl %r15d, %r15d
decq %r15
leaq 0x10(%r12), %r13
cmpl %esi, (%r12)
movq %r13, %r12
jl 0x13f3
je 0x143c
cmpq $-0x1, %r15
je 0x142c
movl $0xfffffffe, %r11d      # imm = 0xFFFFFFFE
subl %r15d, %r11d
addq %rbx, %r14
shlq $0x4, %r11
movq 0x8(%r11,%r14), %r11
cmpl $0x1, %r8d
jne 0x142c
incl %edx
movl %edx, 0x28(%rdi)
addq $-0x40, %r9
cmpq $0x2, %r10
jge 0x13ae
jmp 0x143e
movl %ecx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/narula[P]skiplists/skiplist-extra.cc
// Function: SkipList::init_list(int, int, int)
SkipList* SkipList::init_list(int sz, int high, int max_level) {
  SkipList* skip = new SkipList(max_level);
  int count = 0;
  while (count < sz) {
	if (skip->insert(rand() % high) > 0) {
	  count++;
	}
  }
  return skip;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r15d
movl %esi, %ebp
movl %edi, %r14d
movl $0x30, %edi
callq 0x10d0
movq %rax, %rbx
movq %rax, %rdi
movl %r15d, %esi
callq 0x1246
testl %r14d, %r14d
jle 0x1b89
xorl %r15d, %r15d
callq 0x1050
cltd
idivl %ebp
movq %rbx, %rdi
movl %edx, %esi
callq 0x1992
addl %eax, %r15d
cmpl %r14d, %r15d
jl 0x1b6f
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movl $0x30, %esi
movq %rbx, %rdi
callq 0x10e0
movq %r14, %rdi
callq 0x1130
// File: /workspace/github_cpp_makefile_star2_O3/narula[P]skiplists/skiplist-extra.cc
// Function: SkipList::detailed_print()
void SkipList::detailed_print() {
  node* ptr = head;
  while (ptr != tail) {
	printf("[K:%02d ", ptr->key);
	for (int level = 0; level < ptr->topLevel; level++) {
	  printf("N: ");
	  for (int k = 0; k < FANOUT; k++) {
		if (ptr->nexts[level][k].prefix == INT_MAX) {
		  printf("ND ");
		} else {		
		  printf("%02d ", ptr->nexts[level][k].nxt->key);
		}
	  }
	}
	printf("]\n");
	ptr = ptr->nexts[0][0].nxt;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq (%rdi), %r14
movq %rdi, (%rsp)
cmpq 0x8(%rdi), %r14
je 0x2049
leaq 0x1072(%rip), %r12      # 0x3025
leaq 0x1061(%rip), %r13      # 0x301b
movl (%r14), %esi
leaq 0x1054(%rip), %rdi      # 0x3018
xorl %eax, %eax
callq 0x1040
cmpl $0x0, 0x4(%r14)
jle 0x202b
leaq 0x10(%r14), %rbp
xorl %ebx, %ebx
leaq 0x1042(%rip), %rdi      # 0x3021
xorl %eax, %eax
callq 0x1040
xorl %r15d, %r15d
cmpl $0x7fffffff, -0x8(%rbp,%r15) # imm = 0x7FFFFFFF
jne 0x2000
movq %r12, %rdi
xorl %eax, %eax
callq 0x1040
jmp 0x2011
movq (%rbp,%r15), %rax
movl (%rax), %esi
movq %r13, %rdi
xorl %eax, %eax
callq 0x1040
addq $0x10, %r15
cmpq $0x40, %r15
jne 0x1fe9
incq %rbx
movslq 0x4(%r14), %rax
addq $0x40, %rbp
cmpq %rax, %rbx
jl 0x1fd8
leaq 0x147f(%rip), %rdi      # 0x34b1
callq 0x1100
movq 0x10(%r14), %r14
movq (%rsp), %rax
cmpq 0x8(%rax), %r14
jne 0x1fba
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/narula[P]skiplists/skiplist-extra.cc
// Function: fillRandom(SkipList*, int)
void fillRandom(SkipList* skip, int sz) {
  int count = 0;
  while (count < sz) {
	int rnd = rand() % sz;
	if (skip->insert(rnd) > 0) {
	  printf("%d ", rnd);
	  count++;
	}
  }
  skip->pretty_print();
  //  skip->detailed_print();
  printf("\nInserted %d keys randomly\n", count);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
testl %esi, %esi
jle 0x22d5
movl %esi, %r14d
leaq 0xde5(%rip), %r15       # 0x3088
xorl %ebp, %ebp
callq 0x1050
cltd
idivl %r14d
movl %edx, %r12d
movq %rbx, %rdi
movl %edx, %esi
callq 0x1992
testl %eax, %eax
je 0x22ce
movq %r15, %rdi
movl %r12d, %esi
xorl %eax, %eax
callq 0x1040
incl %ebp
cmpl %r14d, %ebp
jl 0x22a5
jmp 0x22d7
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x2058
leaq 0xda6(%rip), %rdi       # 0x308c
movl %ebp, %esi
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1040
// File: /workspace/github_cpp_makefile_star2_O3/narula[P]skiplists/skiplist-extra.cc
// Function: fillForward(SkipList*, int)
void fillForward(SkipList* skip, int sz) {
  int count = 0;
  while (count < sz) {
	if (skip->insert(count) > 0) {
	  count++;
	}
  }
  printf("Inserted %d keys forwards\n", count);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
testl %esi, %esi
jle 0x2318
movl %esi, %ebp
movq %rdi, %r14
xorl %ebx, %ebx
movq %r14, %rdi
movl %ebx, %esi
callq 0x1992
addl %eax, %ebx
cmpl %ebp, %ebx
jl 0x2306
jmp 0x231a
xorl %ebx, %ebx
leaq 0xd87(%rip), %rdi       # 0x30a8
movl %ebx, %esi
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x1040
// File: /workspace/github_cpp_makefile_star2_O3/narula[P]skiplists/skiplist-extra.cc
// Function: fillBackward(SkipList*, int)
void fillBackward(SkipList* skip, int sz) {
  int count = 0;
  while (count < sz) {
	if (skip->insert(sz-count-1) > 0) {
	  count++;
	}
  }
  printf("Inserted %d keys backwards\n", count);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
testl %esi, %esi
jle 0x2353
movl %esi, %ebp
movq %rdi, %r14
xorl %ebx, %ebx
movl %ebx, %esi
notl %esi
addl %ebp, %esi
movq %r14, %rdi
callq 0x1992
addl %eax, %ebx
cmpl %ebp, %ebx
jl 0x233d
jmp 0x2355
xorl %ebx, %ebx
leaq 0xd67(%rip), %rdi       # 0x30c3
movl %ebx, %esi
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x1040
// File: /workspace/github_cpp_makefile_star2_O3/narula[P]skiplists/skiplist-extra.cc
// Function: empty_fill(int, void (*)(SkipList*, int))
SkipList* empty_fill(int sz, void (*fill)(SkipList*, int)) {
  int maxl = floor(log(sz)/log(FANOUT)) + 1;
  SkipList* skip = new SkipList(maxl);
  fill(skip, sz);
  return skip;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
cvtsi2sd %edi, %xmm0
callq 0x1080
divsd 0xc82(%rip), %xmm0      # 0x3008
callq 0x1120
addsd 0xc7d(%rip), %xmm0      # 0x3010
cvttsd2si %xmm0, %r15d
movl $0x30, %edi
callq 0x10d0
movq %rax, %r14
movq %rax, %rdi
movl %r15d, %esi
callq 0x1246
movq %r14, %rdi
movl %ebp, %esi
callq *%rbx
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x30, %esi
movq %r14, %rdi
callq 0x10e0
movq %rbx, %rdi
callq 0x1130
// File: /workspace/github_cpp_makefile_star2_O3/narula[P]skiplists/skiplist-extra.cc
// Function: perfect_test(int)
int perfect_test(int sz) {
  printf("Testing perfect skiplist lookups... ");
  int maxl = floor(log(sz)/log(FANOUT)) + 1;
  SkipList* sk = perfect_list(sz, maxl);
  for (int i = 0; i < sz; i++) {
	assert (sk->lookup(i) > 0);
  }
  assert (sk->lookup(99) <= 0);
  printf("PASSED\n");
  printf("Testing perfect skiplist inserts... ");
  perfect_insert_test(sk);
  printf("PASSED\n");
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
leaq 0x8af(%rip), %rdi       # 0x338d
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x1040
cvtsi2sd %ebx, %xmm0
callq 0x1080
divsd 0x510(%rip), %xmm0      # 0x3008
callq 0x1120
addsd 0x50b(%rip), %xmm0      # 0x3010
cvttsd2si %xmm0, %esi
movl %ebx, %edi
callq 0x1baf
movq %rax, %r14
testl %ebx, %ebx
jle 0x2b2b
movq %r14, %rdi
movl %ebp, %esi
callq 0x137e
testl %eax, %eax
js 0x2b7d
incl %ebp
cmpl %ebp, %ebx
jne 0x2b17
movq %r14, %rdi
movl $0x63, %esi
callq 0x137e
testl %eax, %eax
jns 0x2b5e
leaq 0x98d(%rip), %rdi       # 0x34d0
callq 0x1100
leaq 0x88b(%rip), %rdi       # 0x33da
xorl %eax, %eax
callq 0x1040
movq %r14, %rdi
callq 0x23dd
leaq 0x57a(%rip), %rdi       # 0x30df
leaq 0x587(%rip), %rsi       # 0x30f3
leaq 0x851(%rip), %rcx       # 0x33c4
movl $0x223, %edx            # imm = 0x223
callq 0x1070
leaq 0x82e(%rip), %rdi       # 0x33b2
leaq 0x568(%rip), %rsi       # 0x30f3
leaq 0x832(%rip), %rcx       # 0x33c4
movl $0x221, %edx            # imm = 0x221
callq 0x1070
// File: /workspace/github_cpp_makefile_star2_O3/ChnMasterOG[P]KmerGO2/kmergo/KmerGO_io.h
// Function: joinPath(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
inline std::string joinPath(std::string path1, std::string path2)
{
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
	/* replace / to \ */
	while (1)
	{
		std::string::size_type position;
		position = path1.find("/");
		if (position == path1.npos) break;
		path1 = path1.replace(position, 1, "\\");
	}
	while (1)
	{
		std::string::size_type position;
		position = path2.find("/");
		if (position == path2.npos) break;
		path2 = path2.replace(position, 1, "\\");
	}
	/* join two paths */
	std::string::iterator it = path1.end();
	--it;
	if (*it != '\\') path1.insert(path1.end(), '\\');
#elif defined(__linux__) || defined(linux)
	/* replace \ to / */
	while (1)
	{
		std::string::size_type position;
		position = path1.find("\\");
		if (position == path1.npos) break;
		path1 = path1.replace(position, 1, "/");
	}
	while (1)
	{
		std::string::size_type position;
		position = path2.find("\\");
		if (position == path2.npos) break;
		path2 = path2.replace(position, 1, "/");
	}
	/* join two paths */
	std::string::iterator it = path1.end();
	--it;
	if (*it != '/') path1.insert(path1.end(), '/');
#endif
	path1.insert(path1.size(), path2);
	return path1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x19a63e(%rip), %rsi    # 0x5a2121
movl $0x1, %ecx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x48d5e0
cmpq $-0x1, %rax
je 0x407b42
leaq 0x1a50bd(%rip), %r12    # 0x5acbbc
leaq 0x19a61b(%rip), %r13    # 0x5a2121
movl $0x1, %edx
movl $0x1, %r8d
movq %rbx, %rdi
movq %rax, %rsi
movq %r12, %rcx
callq 0x48cb60
movq %rbx, %rdi
movq %rax, %rsi
callq 0x48b7a0
movl $0x1, %ecx
movq %rbx, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x48d5e0
cmpq $-0x1, %rax
jne 0x407b06
leaq 0x19a5d8(%rip), %rsi    # 0x5a2121
movl $0x1, %ecx
movq %r15, %rdi
xorl %edx, %edx
callq 0x48d5e0
cmpq $-0x1, %rax
je 0x407ba8
leaq 0x1a5057(%rip), %r12    # 0x5acbbc
leaq 0x19a5b5(%rip), %r13    # 0x5a2121
movl $0x1, %edx
movl $0x1, %r8d
movq %r15, %rdi
movq %rax, %rsi
movq %r12, %rcx
callq 0x48cb60
movq %r15, %rdi
movq %rax, %rsi
callq 0x48b7a0
movl $0x1, %ecx
movq %r15, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x48d5e0
cmpq $-0x1, %rax
jne 0x407b6c
movq (%rbx), %rax
movq 0x8(%rbx), %rsi
cmpb $0x2f, -0x1(%rax,%rsi)
je 0x407bcf
movl $0x1, %ecx
movq %rbx, %rdi
xorl %edx, %edx
movl $0x2f, %r8d
callq 0x48c4b0
movq 0x8(%rbx), %rsi
movq (%r15), %rcx
movq 0x8(%r15), %r8
movq %rbx, %rdi
xorl %edx, %edx
callq 0x48cb60
leaq 0x10(%r14), %rcx
movq %rcx, (%r14)
movq (%rbx), %rdx
leaq 0x10(%rbx), %rax
cmpq %rax, %rdx
je 0x407bff
movq %rdx, (%r14)
movq (%rax), %rcx
movq %rcx, 0x10(%r14)
jmp 0x407c05
movups (%rax), %xmm0
movups %xmm0, (%rcx)
movq 0x8(%rbx), %rcx
movq %rcx, 0x8(%r14)
movq %rax, (%rbx)
movq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/ChnMasterOG[P]KmerGO2/kmergo/kmer_union.cpp
// Function: distribute_kmer_nonuniformly(unsigned char, unsigned int, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void distribute_kmer_nonuniformly(uint8_t step, uint32_t num, uint32_t maxnum, std::string& out_kmer)
{
	if (step == 4) return;
	if (num < 4 * maxnum / 10) {
		out_kmer += "A"; distribute_kmer_nonuniformly(step + 1, num, 4 * maxnum / 10, out_kmer);
	}
	else if (num < 7 * maxnum / 10) {
		out_kmer += "C"; distribute_kmer_nonuniformly(step + 1, num - 4 * maxnum / 10, 3 * maxnum / 10, out_kmer);
	}
	else if (num < 9 * maxnum / 10) {
		out_kmer += "G"; distribute_kmer_nonuniformly(step + 1, num - 7 * maxnum / 10, 2 * maxnum / 10, out_kmer);
	}
	else {
		out_kmer += "T"; distribute_kmer_nonuniformly(step + 1, num - 9 * maxnum / 10, maxnum / 10, out_kmer);
	}
}

// Assembly:
cmpl $0x4, %edi
je 0x409ca4
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %r14d
movl %esi, %ebp
movl $0xcccccccd, %r13d      # imm = 0xCCCCCCCD
notb %dil
movl %edi, %r15d
leal (,%r14,4), %r12d
imulq %r13, %r12
shrq $0x23, %r12
cmpl %ebp, %r12d
jbe 0x409c0c
movq %rbx, %rdi
leaq 0x1af257(%rip), %rsi    # 0x5b8e4d
callq 0x48d320
decb %r15b
movl %r12d, %r14d
cmpb $-0x5, %r15b
jne 0x409bd7
jmp 0x409c96
movl $0xcccccccd, %eax       # imm = 0xCCCCCCCD
leal (,%r14,8), %r13d
subl %r14d, %r13d
imulq %rax, %r13
shrq $0x23, %r13
cmpl %ebp, %r13d
jbe 0x409c3e
movq %rbx, %rdi
leaq 0x1af27b(%rip), %rsi    # 0x5b8eae
callq 0x48d320
leal (%r14,%r14,2), %r14d
jmp 0x409c72
leal (%r14,%r14,8), %r12d
imulq %rax, %r12
shrq $0x23, %r12
movq %rbx, %rdi
cmpl %ebp, %r12d
jbe 0x409c66
leaq 0x1ad8b1(%rip), %rsi    # 0x5b750a
callq 0x48d320
addl %r14d, %r14d
movl %r13d, %r12d
jmp 0x409c72
leaq 0x1af1e8(%rip), %rsi    # 0x5b8e55
callq 0x48d320
movl %r14d, %r14d
movl $0xcccccccd, %r13d      # imm = 0xCCCCCCCD
imulq %r13, %r14
shrq $0x23, %r14
subl %r12d, %ebp
movl %r15d, %edi
negb %dil
cmpb $-0x4, %r15b
jne 0x409bd1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/ChnMasterOG[P]KmerGO2/kmergo/kmer_union.cpp
// Function: distribute_kmer_uniformly(unsigned char, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void distribute_kmer_uniformly(uint8_t step, uint32_t num, std::string& out_kmer)
{
	if (step == 4) return;
	if (num % 4 == 0) out_kmer = "A" + out_kmer;
	else if (num % 4 == 1) out_kmer = "C" + out_kmer;
	else if (num % 4 == 2) out_kmer = "G" + out_kmer;
	else out_kmer = "T" + out_kmer;
	distribute_kmer_uniformly(step + 1, num / 4, out_kmer);
}

// Assembly:
cmpl $0x4, %edi
je 0x409d4a
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movl %esi, %ebp
movl %edi, %r14d
movl %esi, %eax
andl $0x3, %eax
leaq 0x19859c(%rip), %rcx    # 0x5a2268
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x1af171(%rip), %rsi    # 0x5b8e4d
jmp 0x409cf7
leaq 0x1ad825(%rip), %rsi    # 0x5b750a
jmp 0x409cf7
leaq 0x1af167(%rip), %rsi    # 0x5b8e55
jmp 0x409cf7
leaq 0x1af1b7(%rip), %rsi    # 0x5b8eae
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rdx
callq 0x40ae58
movq %rbx, %rdi
movq %r15, %rsi
callq 0x48bbc0
movq (%r15), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x409d2c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x41ae90
incb %r14b
shrl $0x2, %ebp
movzbl %r14b, %edi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x409ca5
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/ChnMasterOG[P]KmerGO2/kmergo/kmer_union.cpp
// Function: show_Progress(unsigned long long)
static void show_Progress(uint64 allkmernumber)
{
	printf("STEP k-mer union start!\n");
	while (progress < allkmernumber && union_err_number == 0)
	{
		printf("\rTotal: %.2f%%  ", (double)progress * 100 / allkmernumber);
	}
	if (union_err_number == 0)
	{
		printf("\rTotal: 100.00%%\n");
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x197976(%rip), %rdi    # 0x5a23c9
callq 0x4ee4d0
movq 0x210c81(%rip), %rax    # 0x61b6e0
cmpq %rbx, %rax
jae 0x40aae1
movq %rbx, %xmm0
punpckldq 0x19780f(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x197817(%rip), %xmm0   # 0x5a2290
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, (%rsp)
leaq 0x197915(%rip), %r14    # 0x5a23a6
cmpw $0x0, 0x210c41(%rip)    # 0x61b6da
jne 0x40aae1
movsd 0x210c3d(%rip), %xmm1   # 0x61b6e0
unpcklps 0x1977d6(%rip), %xmm1   # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1977de(%rip), %xmm1   # 0x5a2290
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd 0x19779a(%rip), %xmm0   # 0x5a2260
divsd (%rsp), %xmm0
movq %r14, %rdi
movb $0x1, %al
callq 0x4e6d70
movq 0x210c04(%rip), %rax    # 0x61b6e0
cmpq %rbx, %rax
jb 0x40aa91
cmpw $0x0, 0x210bf1(%rip)    # 0x61b6da
je 0x40aaf3
addq $0x18, %rsp
popq %rbx
popq %r14
retq
leaq 0x1978bd(%rip), %rdi    # 0x5a23b7
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0x4e6d70
// File: /workspace/github_cpp_makefile_star2_O3/ChnMasterOG[P]KmerGO2/kmergo/kmer_filtering.cpp
// Function: show_Progress(unsigned long long)
static void show_Progress(uint64 allfilesize)
{
	printf("STEP k-mer filtering start!\n");
	while (progress < allfilesize)
	{
		printf("\rTotal: %.2f%%  ", (double)progress * 100 / allfilesize);
	}
	printf("\rTotal: 100.00%%\n");
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x192890(%rip), %rdi    # 0x5a2584
callq 0x4ee4d0
movq 0x20ba18(%rip), %rax    # 0x61b718
cmpq %rbx, %rax
jae 0x40fd78
movq %rbx, %xmm0
punpckldq 0x19256e(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x192576(%rip), %xmm0   # 0x5a2290
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, (%rsp)
leaq 0x192674(%rip), %r14    # 0x5a23a6
movsd 0x20b9de(%rip), %xmm1   # 0x61b718
unpcklps 0x19253f(%rip), %xmm1   # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x192547(%rip), %xmm1   # 0x5a2290
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd 0x192503(%rip), %xmm0   # 0x5a2260
divsd (%rsp), %xmm0
movq %r14, %rdi
movb $0x1, %al
callq 0x4e6d70
movq 0x20b9a5(%rip), %rax    # 0x61b718
cmpq %rbx, %rax
jb 0x40fd32
leaq 0x192638(%rip), %rdi    # 0x5a23b7
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0x4e6d70
nop
// File: /workspace/github_cpp_makefile_star2_O3/ChnMasterOG[P]KmerGO2/kmergo/kmer_losertree.cpp
// Function: KmerLoserTree::KmerLoserTree(unsigned int, unsigned int)
KmerLoserTree::KmerLoserTree(uint32 c, uint32 k)
{
	capacity = c;
	CKmerAPI kmer_obj(k);
	for (uint32 i = 0; i < c; i++)
	{
		kmer_list.push_back(kmer_obj);
		counter_list.push_back(0);
	}
	kmer_list.push_back(kmer_obj);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %r12d
movl %esi, %ebp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
leaq 0x20(%rdi), %r14
leaq 0x38(%rdi), %r15
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x30(%rdi)
movups %xmm0, 0x40(%rdi)
movl %esi, 0x18(%rdi)
testl %edx, %edx
je 0x413e06
movl %r12d, %eax
andl $0x3, %eax
movb $0x4, %cl
subb %al, %cl
testl %eax, %eax
movzbl %cl, %ecx
cmovel %eax, %ecx
movb %cl, 0x1c(%rsp)
movzbl %cl, %r13d
addl %r12d, %r13d
movl %r13d, %eax
andl $0x1f, %eax
shrl $0x5, %r13d
cmpl $0x1, %eax
sbbl $-0x1, %r13d
movl %r13d, 0x20(%rsp)
shll $0x3, %r13d
movq %r13, %rdi
callq 0x41bd90
movq %rax, 0x10(%rsp)
movq %rax, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x401098
jmp 0x413e1c
movq $0x0, 0x10(%rsp)
movl $0x0, 0x20(%rsp)
movb $0x0, 0x1c(%rsp)
movl %r12d, 0x18(%rsp)
testl %ebp, %ebp
je 0x413e6b
leaq 0x10(%rsp), %r12
leaq 0xc(%rsp), %r13
movq %r14, %rdi
movq %r12, %rsi
callq 0x41406e
movl $0x0, 0xc(%rsp)
movq 0x40(%rbx), %rsi
cmpq 0x48(%rbx), %rsi
je 0x413e5c
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x40(%rbx)
jmp 0x413e67
movq %r15, %rdi
movq %r13, %rdx
callq 0x414422
decl %ebp
jne 0x413e2f
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x41406e
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x413e87
callq 0x41aea0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r12
jmp 0x413eb1
jmp 0x413e9f
jmp 0x413e9f
movq %rax, %r12
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x413eb1
callq 0x41aea0
movq (%r15), %rdi
testq %rdi, %rdi
je 0x413ec5
movq 0x48(%rbx), %rsi
subq %rdi, %rsi
callq 0x41ae90
movq %r14, %rdi
callq 0x414098
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x413ee1
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x41ae90
movq %r12, %rdi
callq 0x4bfce0
nop
// File: /workspace/github_cpp_makefile_star2_O3/ChnMasterOG[P]KmerGO2/kmergo/kmer_losertree.cpp
// Function: KmerLoserTree::adjust(unsigned int)
void KmerLoserTree::adjust(uint32 s)
{
	int t = (s + capacity) / 2;		//get the father node of s
	while (t > 0) {					//compare with the parent node until the root node of the loser tree
		if (!kmer_list[s].operator<(kmer_list[ls[t]]) && !kmer_list[s].operator==(kmer_list[ls[t]]))
		{
			swap(&s, &ls[t]);		//swap s and ls[t]
		}
		t /= 2;
	}
	ls[0] = s;						//the last winner is in ls[0]
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl 0x18(%rdi), %ecx
addl %esi, %ecx
movq (%rdi), %rax
cmpl $0x2, %ecx
jae 0x413f52
movl %esi, (%rax)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x20(%rdi), %rdx
movl %ecx, %edi
shrl %ecx
movl %esi, %r8d
leaq (%r8,%r8,2), %r9
movl (%rax,%rcx,4), %r8d
leaq (%r8,%r8,2), %r11
movl 0x8(%rdx,%r9,8), %r10d
cmpl %r10d, 0x8(%rdx,%r11,8)
jne 0x413fce
leaq (%rdx,%r9,8), %r10
movl 0x10(%r10), %r9d
testq %r9, %r9
je 0x413fd6
leaq (%rdx,%r11,8), %r11
movq (%r11), %rbx
movq (%r10), %r14
movq (%rbx), %r13
movq (%r14), %rbp
cmpq %rbp, %r13
ja 0x413fd6
leaq -0x1(%r9), %r15
xorl %r12d, %r12d
cmpq %rbp, %r13
jb 0x413fe4
cmpq %r12, %r15
je 0x413fe4
movq 0x8(%rbx,%r12,8), %r13
movq 0x8(%r14,%r12,8), %rbp
incq %r12
cmpq %rbp, %r13
jbe 0x413f9e
testq %r9, %r9
sete %bl
cmpq %r9, %r12
setb %bpl
orb %bl, %bpl
jne 0x413fd6
jmp 0x413fe9
ja 0x413fd6
movl %esi, (%rax,%rcx,4)
movl %r8d, %esi
cmpl $0x3, %edi
ja 0x413f56
jmp 0x413f45
testq %r9, %r9
je 0x413fd6
movq (%r11), %r11
movq (%r10), %r10
xorl %ebx, %ebx
movq (%r11,%rbx,8), %r14
cmpq (%r10,%rbx,8), %r14
jne 0x413fd0
incq %rbx
cmpq %rbx, %r9
jne 0x413ff1
jmp 0x413fd6
nop
// File: /workspace/github_cpp_makefile_star2_O3/ChnMasterOG[P]KmerGO2/kmergo/KmerGO.cpp
// Function: help_or_version(int, char**)
bool help_or_version(int argc, char** argv)
{
	const std::string version = "--version";
	const std::string help = "--help";
	for (int i = 1; i < argc; ++i)
	{
		if (argv[i] == version || argv[i] == help)
			return true;
	}
	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x18e1c5(%rip), %rsi    # 0x5a2824
leaq 0x18e1c7(%rip), %rdx    # 0x5a282d
leaq 0x8(%rsp), %rdi
callq 0x408096
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x18e1ae(%rip), %rsi    # 0x5a282e
leaq 0x18e1ad(%rip), %rdx    # 0x5a2834
leaq 0x28(%rsp), %rdi
callq 0x408096
cmpl $0x2, %ebp
jl 0x4146ed
movq 0x8(%rbx), %rsi
leaq 0x8(%rsp), %rdi
callq 0x48dd80
testl %eax, %eax
je 0x4146f1
movl %ebp, %r12d
movb $0x1, %bpl
movl $0x2, %r13d
leaq 0x28(%rsp), %r14
leaq 0x8(%rsp), %r15
movq -0x8(%rbx,%r13,8), %rsi
movq %r14, %rdi
callq 0x48dd80
testl %eax, %eax
je 0x4146f4
cmpq %r12, %r13
setb %bpl
je 0x4146f4
movq (%rbx,%r13,8), %rsi
movq %r15, %rdi
callq 0x48dd80
incq %r13
testl %eax, %eax
jne 0x4146be
jmp 0x4146f4
xorl %ebp, %ebp
jmp 0x4146f4
movb $0x1, %bpl
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x414710
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x41ae90
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x41472c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x41ae90
andb $0x1, %bpl
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x41475b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x41ae90
movq %rbx, %rdi
callq 0x4bfce0
// File: /workspace/github_cpp_makefile_star2_O3/ChnMasterOG[P]KmerGO2/kmc_api/../kmc_api/mmer.h
// Function: CMmer::_si::_si()
_si()
		{
			init_norm(norm5, 5);
			init_norm(norm6, 6);
			init_norm(norm7, 7);
			init_norm(norm8, 8);
			init_norm(norm9, 9);
			init_norm(norm10, 10);
			init_norm(norm11, 11);
		}

// Assembly:
pushq %rax
leaq 0x205ae4(%rip), %rdi    # 0x61b920
movl $0x5, %esi
callq 0x415eae
leaq 0x206ad3(%rip), %rdi    # 0x61c920
movl $0x6, %esi
callq 0x415eae
leaq 0x20aac2(%rip), %rdi    # 0x620920
movl $0x7, %esi
callq 0x415eae
leaq 0x21aab1(%rip), %rdi    # 0x630920
movl $0x8, %esi
callq 0x415eae
leaq 0x25aaa0(%rip), %rdi    # 0x670920
movl $0x9, %esi
callq 0x415eae
leaq 0x35aa8f(%rip), %rdi    # 0x770920
movl $0xa, %esi
callq 0x415eae
leaq 0x75aa7e(%rip), %rdi    # 0xb70920
movl $0xb, %esi
popq %rax
jmp 0x415eae
nop
// File: /workspace/github_cpp_makefile_star2_O3/ChnMasterOG[P]KmerGO2/kmc_api/../kmc_api/mmer.h
// Function: CMmer::_si::init_norm(unsigned int*, unsigned int)
static void init_norm(uint32* norm, uint32 len)
		{
			uint32 special = 1 << len * 2;
			for(uint32 i = 0 ; i < special ; ++i)
			{				
				uint32 rev = get_rev(i, len);
				uint32 str_val = is_allowed(i, len) ? i : special;
				uint32 rev_val = is_allowed(rev, len) ? rev : special;
				norm[i] = MIN(str_val, rev_val);				
			}
		}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
leal (%rbx,%rbx), %ecx
movl $0x1, %r12d
shll %cl, %r12d
movq %rdi, %r14
leal -0x2(,%rbx,2), %eax
movl %eax, 0x4(%rsp)
xorl %r15d, %r15d
movl $0x0, %ebp
testl %ebx, %ebx
je 0x415f01
xorl %ebp, %ebp
movl 0x4(%rsp), %ecx
movl %ebx, %eax
movl %r15d, %edx
movl %edx, %esi
notl %esi
andl $0x3, %esi
shll %cl, %esi
addl %esi, %ebp
shrl $0x2, %edx
addl $-0x2, %ecx
decl %eax
jne 0x415eec
movl %r15d, %edi
movl %ebx, %esi
callq 0x415f46
testb %al, %al
movl %r12d, %r13d
cmovnel %r15d, %r13d
movl %ebp, %edi
movl %ebx, %esi
callq 0x415f46
testb %al, %al
cmovel %r12d, %ebp
cmpl %ebp, %r13d
cmovbl %r13d, %ebp
movl %ebp, (%r14,%r15,4)
incq %r15
cmpq %r12, %r15
jne 0x415ed8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/ChnMasterOG[P]KmerGO2/kmc_api/kmc_file.cpp
// Function: CKMCFile::OpenForRA(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool CKMCFile::OpenForRA(const std::string &file_name)
{
	uint64 size;
	size_t result;

	if (file_pre || file_suf)
		return false;

	if (!OpenASingleFile(file_name + ".kmc_pre", file_pre, size, (char *)"KMCP"))
		return false;

	ReadParamsFrom_prefix_file_buf(size);

	fclose(file_pre);
	file_pre = NULL;
		
	if (!OpenASingleFile(file_name + ".kmc_suf", file_suf, size, (char *)"KMCS"))
		return false;

	sufix_file_buf = new uchar[size];
	result = fread(sufix_file_buf, 1, size, file_suf);
	if (result != size)
		return false;

	fclose(file_suf);
	file_suf = NULL;

	is_opened = opened_for_RA;
	prefix_index = 0;
	sufix_number = 0;
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
cmpq $0x0, 0x20(%rdi)
jne 0x4160df
movq %rdi, %rbx
cmpq $0x0, 0x28(%rdi)
jne 0x4160df
movq %rsi, %r14
leaq 0x20(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rsi), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x408000
leaq 0x18c136(%rip), %rsi    # 0x5a20fe
movq %r15, %rdi
callq 0x48d320
leaq 0x20(%rbx), %rdx
leaq 0x18cec1(%rip), %r8     # 0x5a2e9c
leaq 0x10(%rsp), %r15
leaq 0x8(%rsp), %rcx
movq %r15, %rsi
callq 0x416112
movl %eax, %ebp
movq (%r15), %rdi
cmpq %r12, %rdi
je 0x416004
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x41ae90
testb %bpl, %bpl
je 0x4160df
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x416208
movq 0x20(%rbx), %rdi
callq 0x4ed390
movq $0x0, 0x20(%rbx)
leaq 0x20(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x408000
leaq 0x18c076(%rip), %rsi    # 0x5a20c9
movq %r14, %rdi
callq 0x48d320
leaq 0x28(%rbx), %rdx
leaq 0x18ce3b(%rip), %r8     # 0x5a2ea1
leaq 0x10(%rsp), %r14
leaq 0x8(%rsp), %rcx
movq %r14, %rsi
callq 0x416112
movl %eax, %ebp
movq (%r14), %rdi
cmpq %r12, %rdi
je 0x41608f
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x41ae90
testb %bpl, %bpl
je 0x4160df
movq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x41bd90
movq %rax, 0x60(%rbx)
movq 0x28(%rbx), %rcx
movl $0x1, %esi
movq %rax, %rdi
movq %r14, %rdx
callq 0x4edcf0
cmpq %r14, %rax
jne 0x4160df
movq 0x28(%rbx), %rdi
callq 0x4ed390
xorl %eax, %eax
movq %rax, 0x28(%rbx)
movl $0x1, (%rbx)
movq %rax, 0x40(%rbx)
movq %rax, 0x68(%rbx)
movb $0x1, %al
jmp 0x4160e1
xorl %eax, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4160f0
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x416109
movq (%r12), %rsi
incq %rsi
callq 0x41ae90
movq %rbx, %rdi
callq 0x4bfce0
nop
// File: /workspace/github_cpp_makefile_star2_O3/ChnMasterOG[P]KmerGO2/kmc_api/kmc_file.cpp
// Function: CKMCFile::OpenASingleFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, _IO_FILE*&, unsigned long long&, char*)
bool CKMCFile::OpenASingleFile(const std::string &file_name, FILE *&file_handler, uint64 &size, char marker[])
{
	char _marker[4];
	size_t result;

	if ((file_handler = my_fopen(file_name.c_str(), "rb")) == NULL)
		return false;

	my_fseek(file_handler, 0, SEEK_END);
	size = my_ftell(file_handler);					//the size of a whole file

	my_fseek(file_handler, -4, SEEK_CUR);
	result = fread(_marker, 1, 4, file_handler);
	if (result == 0)
		return false;

	size = size - 4;							//the size of the file without the terminal marker
	if (strncmp(marker, _marker, 4) != 0)
	{
		fclose(file_handler);
		file_handler = NULL;
		return false;
	}

	rewind(file_handler);
	result = fread(_marker, 1, 4, file_handler);
	if (result == 0)
		return false;

	size = size - 4;							//the size of the file without initial and terminal markers 

	if (strncmp(marker, _marker, 4) != 0)
	{
		fclose(file_handler);
		file_handler = NULL;
		return false;
	}

	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %rbx
movq (%rsi), %rdi
leaq 0x18cda6(%rip), %rsi    # 0x5a2ed3
callq 0x4edac0
movq %rax, (%rbx)
testq %rax, %rax
je 0x4161b0
xorl %r12d, %r12d
movq %rax, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x4f25e0
movq (%rbx), %rdi
callq 0x4eddf0
movq %rax, (%r15)
movq (%rbx), %rdi
movq $-0x4, %rsi
movl $0x1, %edx
callq 0x4f25e0
movq (%rbx), %rcx
leaq 0x4(%rsp), %rdi
movl $0x1, %esi
movl $0x4, %edx
callq 0x4edcf0
testq %rax, %rax
je 0x4161b3
addq $-0x4, (%r15)
leaq 0x4(%rsp), %rsi
movl $0x4, %edx
movq %r14, %rdi
callq 0x401048
movq (%rbx), %rdi
testl %eax, %eax
je 0x4161c2
callq 0x4ed390
movq $0x0, (%rbx)
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
callq 0x4f2920
movq (%rbx), %rcx
leaq 0x4(%rsp), %rdi
movl $0x1, %esi
movl $0x4, %edx
callq 0x4edcf0
testq %rax, %rax
je 0x4161b0
addq $-0x4, (%r15)
leaq 0x4(%rsp), %rsi
movl $0x4, %edx
movq %r14, %rdi
callq 0x401048
testl %eax, %eax
je 0x416202
movq (%rbx), %rdi
jmp 0x4161a4
movb $0x1, %r12b
jmp 0x4161b3
nop
// File: /workspace/github_cpp_makefile_star2_O3/ChnMasterOG[P]KmerGO2/kmc_api/kmc_file.cpp
// Function: CKMCFile::~CKMCFile()
CKMCFile::~CKMCFile()
{
	if (file_pre)
		fclose(file_pre);
	if (file_suf)
		fclose(file_suf);
	if (prefix_file_buf)
		delete[] prefix_file_buf;
	if (sufix_file_buf)
		delete[] sufix_file_buf;
	if (signature_map)
		delete[] signature_map;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
testq %rdi, %rdi
je 0x41680c
callq 0x4ed390
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x41681a
callq 0x4ed390
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x416828
callq 0x41aea0
movq 0x60(%rbx), %rdi
testq %rdi, %rdi
je 0x416836
callq 0x41aea0
movq 0x50(%rbx), %rdi
testq %rdi, %rdi
je 0x416845
popq %rbx
jmp 0x41aea0
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/ChnMasterOG[P]KmerGO2/kmc_api/kmc_file.cpp
// Function: CKMCFile::CheckKmer(CKmerAPI&, float&)
bool CKMCFile::CheckKmer(CKmerAPI &kmer, float &count)
{
	uint32 int_counter;
	if (CheckKmer(kmer, int_counter))
	{
		if (mode == 0)
			count = (float)int_counter;
		else
			memcpy(&count, &int_counter, counter_size);
		return true;
	}
	return false;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rdi, %r14
leaq 0xc(%rsp), %rdx
callq 0x41689c
movl %eax, %ebp
testb %al, %al
je 0x416890
cmpl $0x0, 0x7c(%r14)
je 0x416883
movl 0x80(%r14), %edx
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0x401080
jmp 0x416890
movl 0xc(%rsp), %eax
cvtsi2ss %rax, %xmm0
movss %xmm0, (%rbx)
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/ChnMasterOG[P]KmerGO2/kmc_api/kmc_file.cpp
// Function: CKMCFile::CheckKmer(CKmerAPI&, unsigned int&)
bool CKMCFile::CheckKmer(CKmerAPI &kmer, uint32 &count)
{
	if(is_opened != opened_for_RA)
		return false;
	if(end_of_file)
		return false;
	
	//recognize a prefix:
	uint64 pattern_prefix_value = kmer.kmer_data[0];

	uint32 pattern_offset = (sizeof(pattern_prefix_value)* 8) - (lut_prefix_length * 2) - (kmer.byte_alignment * 2);
	int64 index_start = 0, index_stop = 0;

	pattern_prefix_value = pattern_prefix_value >> pattern_offset;  //complements with 0
	if (pattern_prefix_value >= prefix_file_buf_size)
		return false;

	if (kmc_version == 0x200)
	{
		uint32 signature = kmer.get_signature(signature_len);
		uint32 bin_start_pos = signature_map[signature];
		bin_start_pos *= single_LUT_size;				
		//look into the array with data
		index_start = *(prefix_file_buf + bin_start_pos + pattern_prefix_value);
		index_stop = *(prefix_file_buf + bin_start_pos + pattern_prefix_value + 1) - 1;
	}
	else if (kmc_version == 0)
	{
		//look into the array with data
		index_start = prefix_file_buf[pattern_prefix_value];
		index_stop = prefix_file_buf[pattern_prefix_value + 1] - 1;
	}
	uint64 tmp_count ;
	bool res = BinarySearch(index_start, index_stop, kmer, tmp_count, pattern_offset);
	count = (uint32)tmp_count;
	return res;
}

// Assembly:
cmpl $0x1, (%rdi)
jne 0x41690e
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
cmpb $0x0, 0x18(%rdi)
jne 0x416911
movq %rsi, %r14
movq (%rsi), %rax
movq (%rax), %r12
movl 0x84(%r15), %ecx
addl 0xc(%rsi), %ecx
addl %ecx, %ecx
negb %cl
shrq %cl, %r12
cmpq 0x38(%r15), %r12
jae 0x416911
movq %rdx, %rbx
movl 0xa4(%r15), %eax
testl %eax, %eax
je 0x416915
cmpl $0x200, %eax            # imm = 0x200
jne 0x416927
movl 0x88(%r15), %esi
movq %r14, %rdi
callq 0x419286
movq 0x50(%r15), %rcx
movl %eax, %edx
movl 0x48(%r15), %eax
imull (%rcx,%rdx,4), %eax
shlq $0x3, %rax
addq 0x30(%r15), %rax
jmp 0x416919
xorl %eax, %eax
retq
xorl %eax, %eax
jmp 0x416942
movq 0x30(%r15), %rax
movq (%rax,%r12,8), %rsi
movq 0x8(%rax,%r12,8), %rdx
decq %rdx
jmp 0x41692b
xorl %edx, %edx
xorl %esi, %esi
movq %rsp, %r12
movq %r15, %rdi
movq %r14, %rcx
movq %r12, %r8
callq 0x41694e
movl (%r12), %ecx
movl %ecx, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/ChnMasterOG[P]KmerGO2/kmc_api/kmc_file.cpp
// Function: CKMCFile::CheckKmer(CKmerAPI&, unsigned long long&)
bool CKMCFile::CheckKmer(CKmerAPI &kmer, uint64 &count)
{
	if (is_opened != opened_for_RA)
		return false;
	if (end_of_file)
		return false;

	//recognize a prefix:
	uint64 pattern_prefix_value = kmer.kmer_data[0];

	uint32 pattern_offset = (sizeof(pattern_prefix_value)* 8) - (lut_prefix_length * 2) - (kmer.byte_alignment * 2);
	int64 index_start = 0, index_stop = 0;

	pattern_prefix_value = pattern_prefix_value >> pattern_offset;  //complements with 0
	if (pattern_prefix_value >= prefix_file_buf_size)
		return false;

	if (kmc_version == 0x200)
	{
		uint32 signature = kmer.get_signature(signature_len);
		uint32 bin_start_pos = signature_map[signature];
		bin_start_pos *= single_LUT_size;
		//look into the array with data
		index_start = *(prefix_file_buf + bin_start_pos + pattern_prefix_value);
		index_stop = *(prefix_file_buf + bin_start_pos + pattern_prefix_value + 1) - 1;
	}
	else if (kmc_version == 0)
	{
		//look into the array with data
		index_start = prefix_file_buf[pattern_prefix_value];
		index_stop = prefix_file_buf[pattern_prefix_value + 1] - 1;
	}
	return BinarySearch(index_start, index_stop, kmer, count, pattern_offset);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x1, (%rdi)
jne 0x416ba2
movq %rdi, %r15
cmpb $0x0, 0x18(%rdi)
jne 0x416ba2
movq %rsi, %r14
movq (%rsi), %rax
movq (%rax), %r12
movl 0x84(%r15), %ecx
addl 0xc(%rsi), %ecx
addl %ecx, %ecx
negb %cl
shrq %cl, %r12
cmpq 0x38(%r15), %r12
jae 0x416ba2
movq %rdx, %rbx
movl 0xa4(%r15), %eax
testl %eax, %eax
je 0x416bb0
cmpl $0x200, %eax            # imm = 0x200
jne 0x416bc2
movl 0x88(%r15), %esi
movq %r14, %rdi
callq 0x419286
movq 0x50(%r15), %rcx
movl %eax, %edx
movl 0x48(%r15), %eax
imull (%rcx,%rdx,4), %eax
shlq $0x3, %rax
addq 0x30(%r15), %rax
jmp 0x416bb4
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x30(%r15), %rax
movq (%rax,%r12,8), %rsi
movq 0x8(%rax,%r12,8), %rdx
decq %rdx
jmp 0x416bc6
xorl %esi, %esi
xorl %edx, %edx
movq %r15, %rdi
movq %r14, %rcx
movq %rbx, %r8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x41694e
nop
// File: /workspace/github_cpp_makefile_star2_O3/ChnMasterOG[P]KmerGO2/kmc_api/kmc_file.cpp
// Function: CKMCFile::ReadNextKmer(CKmerAPI&, float&)
bool CKMCFile::ReadNextKmer(CKmerAPI &kmer, float &count)
{
	uint32 int_counter;
	if (ReadNextKmer(kmer, int_counter))
	{
		if (mode == 0)
			count = (float)int_counter;
		else
			memcpy(&count, &int_counter, counter_size);
		return true;
	}
	return false;

}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rdi, %r14
leaq 0xc(%rsp), %rdx
callq 0x416c38
movl %eax, %ebp
testb %al, %al
je 0x416c2c
cmpl $0x0, 0x7c(%r14)
je 0x416c1f
movl 0x80(%r14), %edx
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0x401080
jmp 0x416c2c
movl 0xc(%rsp), %eax
cvtsi2ss %rax, %xmm0
movss %xmm0, (%rbx)
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/ChnMasterOG[P]KmerGO2/kmc_api/kmc_file.cpp
// Function: CKMCFile::Reload_sufix_file_buf()
void CKMCFile::Reload_sufix_file_buf()
{
	auto to_read = MIN(suf_file_left_to_read, part_size);
	auto readed = fread(sufix_file_buf, 1, (size_t)to_read, file_suf);
	suf_file_left_to_read -= readed;
	if (readed != to_read)
	{
		std::cerr << "Error: some error while reading suffix file\n";
		exit(1);
	}
	index_in_partial_buf = 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x2022aa(%rip), %r14    # 0x619178
movq 0x8(%rdi), %rax
movq 0x28(%rdi), %rcx
cmpq %r14, %rax
cmovbq %rax, %r14
movq 0x60(%rdi), %rdi
movl $0x1, %esi
movq %r14, %rdx
callq 0x4edcf0
subq %rax, 0x8(%rbx)
cmpq %r14, %rax
jne 0x416f07
movq $0x0, 0x70(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq $0x1b71840, %rdi        # imm = 0x1B71840
leaq 0x18bf91(%rip), %rsi    # 0x5a2ea6
callq 0x4857a0
movl $0x1, %edi
callq 0x4db5c0
// File: /workspace/github_cpp_makefile_star2_O3/ChnMasterOG[P]KmerGO2/kmc_api/kmc_file.cpp
// Function: CKMCFile::Close()
bool CKMCFile::Close()
{
	if(is_opened)
	{
		if(file_pre)
		{
			fclose(file_pre);	
			file_pre = NULL;
		}
		if(file_suf)
		{
			fclose(file_suf);
			file_suf = NULL;
		}
	
		is_opened = closed;
		end_of_file = false;
		delete [] prefix_file_buf;
		prefix_file_buf = NULL;
		delete [] sufix_file_buf;
		sufix_file_buf = NULL;
		delete[] signature_map;
		signature_map = NULL;

		return true;
	}
	else
		return false;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl (%rdi), %ebp
testl %ebp, %ebp
je 0x4171be
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
testq %rdi, %rdi
je 0x41715c
callq 0x4ed390
movq $0x0, 0x20(%rbx)
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x417172
callq 0x4ed390
movq $0x0, 0x28(%rbx)
movl $0x0, (%rbx)
movb $0x0, 0x18(%rbx)
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x41718a
callq 0x41aea0
movq $0x0, 0x30(%rbx)
movq 0x60(%rbx), %rdi
testq %rdi, %rdi
je 0x4171a0
callq 0x41aea0
movq $0x0, 0x60(%rbx)
movq 0x50(%rbx), %rdi
testq %rdi, %rdi
je 0x4171b6
callq 0x41aea0
movq $0x0, 0x50(%rbx)
testl %ebp, %ebp
setne %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq