LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/tsfn[P]doc2txt/src/Storage.cpp
// Function: Storage::~Storage()
Storage::~Storage() {
  for (uint i = 0; i < stream_num; ++i) {
    if (stream_name != NULL && stream_name[i] != NULL) {
      free(stream_name[i]);
      stream_name[i] = NULL;
    }
    if (stream_table != NULL && stream_table[i] != NULL) {
      free(stream_table[i]);
      stream_table[i] = NULL;
    }
  }
  stream_num = 0;
  if (stream_name != NULL) {
    free(stream_name);
    stream_name = NULL;
  }
  if (stream_table != NULL) {
    free(stream_table);
    stream_table = NULL;
  }
  if (stream_sizes != NULL) {
    free(stream_sizes);
    stream_sizes = NULL;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
movl (%rbx), %eax
cmpq %rax, %r14
jae 0x138b
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x1366
movq (%rax,%r14,8), %rdi
testq %rdi, %rdi
je 0x1366
callq 0x1160
movq 0x8(%rbx), %rax
andq $0x0, (%rax,%r14,8)
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x1386
movq (%rax,%r14,8), %rdi
testq %rdi, %rdi
je 0x1386
callq 0x1160
movq 0x10(%rbx), %rax
andq $0x0, (%rax,%r14,8)
incq %r14
jmp 0x133f
andl $0x0, (%rbx)
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x13a1
callq 0x1160
andq $0x0, 0x8(%rbx)
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x13b4
callq 0x1160
andq $0x0, 0x10(%rbx)
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x13c7
callq 0x1160
andq $0x0, 0x18(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tsfn[P]doc2txt/src/Storage.cpp
// Function: read_stream(unsigned int, unsigned int, unsigned char*, unsigned int, unsigned char*, unsigned int, unsigned char**, unsigned int*)
static bool read_stream(uint start, uint sec_sz, uchar *sat, uint sat_size,
    uchar *buf, uint buf_size, uchar **stream, uint *sz) {
  uint sec_num = 0;
  set<uint> vis;
  for (uint id = start; id < buf_size / sec_sz; id = *(uint *)(sat + id * 4)) {
    if (vis.count(id)) return false;
    vis.insert(id);
    ++sec_num;
  }
  *sz = sec_num * sec_sz;
  *stream = (uchar *)malloc(*sz);
  sec_num = 0;
  for (uint id = start; id < buf_size / sec_sz; id = *(uint *)(sat + id * 4)) {
    memcpy(*stream + sec_num++ * sec_sz, buf + id * sec_sz, sec_sz);
  }
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r9, -0x38(%rbp)
movl %r8d, %eax
movq %rcx, -0x50(%rbp)
movq %rdx, -0x40(%rbp)
movl %esi, %r12d
movl %edi, %r13d
leaq -0x78(%rbp), %rcx
andl $0x0, (%rcx)
andq $0x0, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
andq $0x0, 0x20(%rcx)
xorl %ebx, %ebx
xorl %edx, %edx
divl %esi
movl %eax, %r14d
movl %edi, %r15d
movl %r15d, -0x2c(%rbp)
cmpl %r14d, %r15d
jae 0x1914
leaq -0x80(%rbp), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x1a02
testq %rax, %rax
jne 0x1963
leaq -0x80(%rbp), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x1a8c
movl -0x2c(%rbp), %eax
shll $0x2, %eax
movq -0x40(%rbp), %rcx
movl (%rcx,%rax), %r15d
addl %r12d, %ebx
jmp 0x18d9
movq 0x10(%rbp), %rax
movl %ebx, (%rax)
movl %ebx, %edi
callq 0x1180
movq -0x38(%rbp), %rcx
movq %rax, (%rcx)
movl %r12d, %eax
movq %rax, -0x48(%rbp)
xorl %ebx, %ebx
cmpl %r14d, %r13d
jae 0x1963
movl %ebx, %edi
movq -0x38(%rbp), %rax
addq (%rax), %rdi
movl %r13d, %esi
imull %r12d, %esi
addq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
callq 0x10e0
movl %r13d, %eax
movq -0x40(%rbp), %rcx
movl (%rcx,%rax,4), %r13d
addl %r12d, %ebx
jmp 0x1931
cmpl %r14d, %r15d
setae %bl
leaq -0x80(%rbp), %rdi
callq 0x1c1c
movl %ebx, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x1c1c
movq %rbx, %rdi
callq 0x11c0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tsfn[P]doc2txt/src/Storage.cpp
// Function: Storage::stream(char const*, unsigned char const**, unsigned int*) const
bool Storage::stream(const char *name, const uchar **stream, uint *size) const {
  for (uint i = 0; i < stream_num; ++i) {
    bool match = true;
    for (uint j = 0; name[j] != '\0'; ++j) {
      if (name[j] != stream_name[i][j * 2]) {
        match = false;
        break;
      }
    }
    if (match) {
      *stream = stream_table[i];
      *size = stream_sizes[i];
      return true;
    }
  }
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
movl (%rdi), %eax
movq 0x8(%rdi), %r9
xorl %r8d, %r8d
cmpq %rax, %r8
je 0x19f5
xorl %r10d, %r10d
xorl %r11d, %r11d
movl %r11d, %ebx
movsbl (%rsi,%rbx), %ebx
testl %ebx, %ebx
je 0x19dd
movq (%r9,%r8,8), %r14
movl %r10d, %r15d
movzbl (%r14,%r15), %r14d
incl %r11d
addl $0x2, %r10d
cmpl %r14d, %ebx
je 0x19b5
incq %r8
jmp 0x19aa
movq 0x10(%rdi), %rsi
movl %r8d, %r9d
movq (%rsi,%r9,8), %rsi
movq %rsi, (%rdx)
movq 0x18(%rdi), %rdx
movl (%rdx,%r9,4), %edx
movl %edx, (%rcx)
cmpq %rax, %r8
setb %al
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tsfn[P]doc2txt/src/parse_doc.cpp
// Function: parse_doc(char const*, char const*, char const*)
bool parse_doc(const char *doc_file_path, const char *text_file_path, const char *image_dir_path) {
  FILE *doc_file = fopen(doc_file_path, "rb");
  if (doc_file == NULL) {
    return false;
  }

  /* 初始化流 */
  Storage storage;
  if (!storage.init(doc_file)) {
    fclose(doc_file);
    return false;
  }
  fclose(doc_file);

  /* 提取文本 */
  FILE *text_file = fopen(text_file_path, "wb");
  if (text_file == NULL) {
    return false;
  }
  doc_text_file(storage, text_file);
  fclose(text_file);

  /* 提取图片 */
  doc_image(storage, image_dir_path);

  /* 分析格式 */
  doc_format(storage);

  /* 标题、作者等信息 */
  doc_property(storage);
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x13aa(%rip), %rsi      # 0x303e
callq 0x1150
testq %rax, %rax
je 0x1d26
movq %rax, %r15
leaq -0x40(%rbp), %r12
movq %r12, %rdi
callq 0x131c
movq %r12, %rdi
movq %r15, %rsi
callq 0x13cc
movl %eax, %r12d
movq %r15, %rdi
callq 0x10f0
testb %r12b, %r12b
je 0x1d19
leaq 0x136e(%rip), %rsi      # 0x3041
movq %r14, %rdi
callq 0x1150
testq %rax, %rax
je 0x1d19
movq %rax, %r14
leaq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0x1f2c
movq %r14, %rdi
callq 0x10f0
leaq -0x40(%rbp), %rdi
movq %rbx, %rsi
callq 0x2098
leaq -0x40(%rbp), %rdi
callq 0x269c
movb $0x1, %bl
leaq -0x40(%rbp), %rdi
callq 0x2ed4
jmp 0x1d1b
xorl %ebx, %ebx
leaq -0x40(%rbp), %rdi
callq 0x1332
jmp 0x1d28
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1d39
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x1332
movq %rbx, %rdi
callq 0x11c0
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/tsfn[P]doc2txt/src/doc_text.cpp
// Function: get_piece_table(Storage const&)
static const uchar *get_piece_table(const Storage &storage) {
  const uchar *wds, *ts;
  uint wds_size, ts_size;
  if (!storage.stream("WordDocument", &wds, &wds_size)) {
    return NULL;
  }
  ushort flag1 = *(const ushort *)(wds + 0x0A);
  bool is1Table = (flag1 & 0x0200) == 0x0200;
  if (!storage.stream(is1Table ? "1Table" : "0Table", &ts, &ts_size)) {
    return NULL;
  }

  uint fcClx = *(const uint *)(wds + 0x01A2);
  uint lcbClx = *(const uint *)(wds + 0x01A6);
  const uchar *clx = ts + fcClx;
  for (uint pos = 0; clx + pos < ts + ts_size && pos < lcbClx;) {
    uchar type = clx[pos];
    if (type == 2) {
      return clx + pos;
    } else if (type == 1) {
      pos += 3 + *(const ushort *)(clx + pos + 1);
    } else {
      return NULL;
    }
  }
  return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x11b8(%rip), %rsi      # 0x3044
leaq -0x18(%rbp), %rdx
leaq -0x24(%rbp), %rcx
callq 0x1998
testb %al, %al
je 0x1f18
movq -0x18(%rbp), %rax
movzwl 0xa(%rax), %eax
btl $0x9, %eax
leaq 0x11a8(%rip), %rax      # 0x3058
leaq 0x119a(%rip), %rsi      # 0x3051
cmovaeq %rax, %rsi
leaq -0x20(%rbp), %rdx
leaq -0xc(%rbp), %rcx
movq %rbx, %rdi
callq 0x1998
movl %eax, %ecx
xorl %eax, %eax
testb %cl, %cl
je 0x1f1a
movq -0x18(%rbp), %rdx
movl 0x1a2(%rdx), %ecx
movl 0x1a6(%rdx), %edx
movq -0x20(%rbp), %rdi
addq %rdi, %rcx
movl -0xc(%rbp), %esi
addq %rdi, %rsi
xorl %edi, %edi
movl %edi, %r8d
addq %rcx, %r8
cmpq %rsi, %r8
jae 0x1f1a
cmpl %edx, %edi
jae 0x1f1a
movzbl (%r8), %r9d
cmpl $0x1, %r9d
jne 0x1f21
movzwl 0x1(%r8), %r8d
addl %r8d, %edi
addl $0x3, %edi
jmp 0x1ef2
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %rbp
retq
cmpl $0x2, %r9d
jne 0x1f1a
movq %r8, %rax
jmp 0x1f1a
// File: /workspace/github_cpp_makefile_star2_O2/Matheus-Aguilar[P]Huffman/main.cpp
// Function: splitByte(unsigned char, std::vector<bool, std::allocator<bool>>&)
void splitByte(const unsigned char byte, vector<bool> &bits){
	//Auxiliar usado para retirar o bit mais significativo
	unsigned char pos = 1 << 7;
	while(pos){ 
		bits.push_back(((byte & pos) ? 1 : 0)); //Get the Least Significant Digit
		pos >>= 1; //Shift to the right
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movl %edi, %ebp
movb $-0x80, %r14b
testb %r14b, %r14b
je 0x16bd
xorl %esi, %esi
testb %bpl, %r14b
setne %sil
movq %rbx, %rdi
callq 0x196c
shrb %r14b
jmp 0x16a2
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Matheus-Aguilar[P]Huffman/main.cpp
// Function: main
int main(int argc, char **argv) {

	//c to compress, d to decompress
	if(argv[1][0] == 'c'){
		compressFile(argv[2], argv[3]);
	}
	else if(argv[1][0] == 'd'){
		descompressFile(argv[2], argv[3]);
	}
	else{
		throw("Invalid Flag!");
	}
}

// Assembly:
pushq %rax
movq 0x8(%rsi), %rax
movzbl (%rax), %eax
cmpl $0x64, %eax
je 0x1937
cmpl $0x63, %eax
jne 0x1948
movq 0x10(%rsi), %rdi
movq 0x18(%rsi), %rsi
callq 0x130c
jmp 0x1944
movq 0x10(%rsi), %rdi
movq 0x18(%rsi), %rsi
callq 0x16c2
xorl %eax, %eax
popq %rcx
retq
pushq $0x8
popq %rdi
callq 0x10a0
leaq 0x16ad(%rip), %rcx      # 0x3004
movq %rcx, (%rax)
movq 0x466f(%rip), %rsi      # 0x5fd0
movq %rax, %rdi
xorl %edx, %edx
callq 0x11a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/Matheus-Aguilar[P]Huffman/Huffman.cpp
// Function: HuffmanTree::destroy(Node*)
void HuffmanTree::destroy(Node *node){
    if(node == NULL) return; //Leaf node
    destroy(node->left); //Destroys left child
    destroy(node->right); //Destroys right child
    delete node; //Free memory
}

// Assembly:
testq %rsi, %rsi
je 0x233d
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %rsi
callq 0x2308
movq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x2308
pushq $0x20
popq %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1110
retq
// File: /workspace/github_cpp_makefile_star2_O2/Matheus-Aguilar[P]Huffman/Huffman.cpp
// Function: HuffmanTree::buildCodes(Node*, std::vector<bool, std::allocator<bool>>&)
void HuffmanTree::buildCodes(Node *node, vector<bool> &codeString){
    
    //Reached a leaf node
    if(node->left == NULL && node->right == NULL){
        code[node->character] = codeString; //Copy the code to codes array
        return; //End recursion
    }

    //If there is a left child
    if(node->left != NULL){
        codeString.push_back(0); //Adds a left move to the code, represented by a 0
        buildCodes(node->left, codeString); //Recursively call to left child
        codeString.pop_back(); //Remove the last move (backtracking)
    }

    if(node->right != NULL){
        codeString.push_back(1); //Adds a right move to the code, represented by a 1
        buildCodes(node->right, codeString); //Recursively call to right child
        codeString.pop_back(); //Remove the last move (backtracking)
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
cmpq $0x0, (%rsi)
je 0x2380
movq %rbx, %rdi
xorl %esi, %esi
callq 0x196c
movq (%r15), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x233e
leaq 0x10(%rbx), %rdi
callq 0x2a8a
cmpq $0x0, 0x8(%r15)
jne 0x2387
popq %rbx
popq %r14
popq %r15
retq
cmpq $0x0, 0x8(%r15)
je 0x23b2
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x196c
movq 0x8(%r15), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x233e
addq $0x10, %rbx
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2a8a
movzbl 0x18(%r15), %eax
imulq $0x28, %rax, %rax
leaq (%r14,%rax), %rdi
addq $0x408, %rdi            # imm = 0x408
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x2570
nop
// File: /workspace/github_cpp_makefile_star2_O2/Matheus-Aguilar[P]Huffman/Huffman.cpp
// Function: HuffmanTree::compress(std::vector<bool, std::allocator<bool>>&, std::vector<char, std::allocator<char>> const&) const
void HuffmanTree::compress(vector<bool> &out, const vector<char> &in) const{
    
    if(!out.empty()) out.clear(); //Clear the vector if not empty

    //Copying the codes to the vector
    for(int i = 0; i < in.size(); ++i){
        size_t pos = (unsigned char) in[i];
        for(int j = 0; j < code[pos].size(); j++)
            out.push_back(code[pos][j]);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq (%rsi), %rax
cmpq 0x10(%rsi), %rax
jne 0x242c
cmpl $0x0, 0x18(%r14)
je 0x2435
movq %rax, 0x10(%r14)
andl $0x0, 0x18(%r14)
addq $0x408, %r15            # imm = 0x408
xorl %ebp, %ebp
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
cmpq %rbp, %rcx
jbe 0x2492
movzbl (%rax,%rbp), %eax
imulq $0x28, %rax, %r12
addq %r15, %r12
xorl %r13d, %r13d
movq 0x10(%r12), %rax
movl 0x18(%r12), %ecx
subq (%r12), %rax
leaq (%rcx,%rax,8), %rax
cmpq %r13, %rax
jbe 0x248d
movq %r12, %rdi
movq %r13, %rsi
callq 0x2606
movzbl %al, %esi
movq %r14, %rdi
callq 0x196c
incq %r13
jmp 0x245b
incq %rbp
jmp 0x243e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Matheus-Aguilar[P]Huffman/Huffman.cpp
// Function: HuffmanTree::descompress(std::vector<char, std::allocator<char>>&, std::vector<bool, std::allocator<bool>> const&) const
void HuffmanTree::descompress(vector<char> &out, const vector<bool> &in) const{
    
    if(!out.empty()) out.clear(); //Clear if not empty
    
    Node *node = root; //Start in the root node
    for(int i = 0; i < in.size(); ++i){
        if(!in[i]) //Left move (code 0)
            node = node->left;
        else //Right move (code 1)
            node = node->right;

        //Reached a leaf
        if(node->left == NULL && node->right == NULL){
            out.push_back(node->character); //Copy the caracther of the leaf
            node = root; //Return to the root
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq (%rsi), %rax
cmpq 0x8(%rsi), %rax
je 0x24c3
movq %rax, 0x8(%r14)
movq (%r15), %rbp
xorl %r12d, %r12d
leaq 0x7(%rsp), %r13
movq 0x10(%rbx), %rax
movl 0x18(%rbx), %ecx
subq (%rbx), %rax
leaq (%rcx,%rax,8), %rax
cmpq %r12, %rax
jbe 0x251c
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2606
movzbl %al, %eax
movq (%rbp,%rax,8), %rbp
cmpq $0x0, (%rbp)
jne 0x2517
cmpq $0x0, 0x8(%rbp)
jne 0x2517
movb 0x18(%rbp), %al
movb %al, 0x7(%rsp)
movq %r14, %rdi
movq %r13, %rsi
callq 0x1a40
movq (%r15), %rbp
incq %r12
jmp 0x24ce
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/attractivechaos[P]udb2/bkthomps-hashmap/test-1a.c
// Function: test_int
uint32_t test_int(uint32_t n, uint32_t x0)
{
	uint32_t i, x, z = 0;
	unordered_map h;
	h = unordered_map_init(sizeof(uint32_t), sizeof(uint32_t), hash_int, compare_int);
	for (i = 0, x = x0; i < n; ++i) {
		uint32_t key, v = 1;
		x = hash32(x);
		key = get_key(n, x);
		unordered_map_put(h, &key, &v);
		z += v;
	}
	fprintf(stderr, "# unique keys: %d; checksum: %u\n", unordered_map_size(h), z);
	x = unordered_map_size(h);
	unordered_map_destroy(h);
	return x;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r15d
movl %edi, %r12d
leaq 0xa2(%rip), %rdx        # 0x1535
leaq 0x9e(%rip), %rcx        # 0x1538
pushq $0x4
popq %rdi
movq %rdi, %rsi
callq 0x1540
movq %rax, %rbx
xorl %ebp, %ebp
movq %rsp, %r13
movl %r12d, %r14d
subl $0x1, %r14d
jb 0x14eb
movl $0x1, (%rsp)
movl %r15d, %edi
callq 0x120c
movl %eax, %r15d
movl %r12d, %edi
movl %eax, %esi
callq 0x1237
movl %eax, 0x4(%rsp)
movq %rbx, %rdi
leaq 0x4(%rsp), %rsi
movq %r13, %rdx
callq 0x167c
addl (%rsp), %ebp
jmp 0x14b0
movq 0x2b06(%rip), %rax      # 0x3ff8
movq (%rax), %r14
movq %rbx, %rdi
callq 0x1670
leaq 0xb71(%rip), %rsi       # 0x2075
movq %r14, %rdi
movl %eax, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x1670
movl %eax, %ebp
movq %rbx, %rdi
callq 0x1aad
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/auton1[P]motiflocation/motiflocation.cpp
// Function: print_help()
void print_help() {

	printf("\nmotifhunter %0.1f\n", version);
	printf("Returns every location of a motif in a given file.\n\n");
	printf("*** Positions are zero based! ***.\n\n");
	
	printf("Options :\n");
	printf("-file1 <file>                Sequence data file 1 (required)\n");
	printf("-out <file>                  Output file (required)\n");
	printf("-startstr <string>           Starting Motif\n");
	printf("-chrom <string>              Output string used for chromosome\n");
	printf("-mutations <int>             Number of allowed mutations\n");
	printf("-outputseqlen                Output the chromosome length as well\n");
	printf("-uppercase_only              Only output results in uppercase sequence\n");
	printf("-lowercase_only              Only output results in lowercase sequence\n");
	printf("-1000G_ref                   FASTA headers are in 1000G format\n");
	printf("\n");
}

// Assembly:
pushq %rax
movsd 0x7fbe(%rip), %xmm0     # 0xc290
leaq 0x3e8d(%rip), %rdi      # 0x8166
movb $0x1, %al
callq 0x3040
leaq 0x3f06(%rip), %rdi      # 0x81ed
callq 0x33b0
leaq 0x3f2e(%rip), %rdi      # 0x8221
callq 0x33b0
leaq 0x3f46(%rip), %rdi      # 0x8245
callq 0x33b0
leaq 0x3f44(%rip), %rdi      # 0x824f
callq 0x33b0
leaq 0x3f75(%rip), %rdi      # 0x828c
callq 0x33b0
leaq 0x3f9d(%rip), %rdi      # 0x82c0
callq 0x33b0
leaq 0x3fbd(%rip), %rdi      # 0x82ec
callq 0x33b0
leaq 0x3ff0(%rip), %rdi      # 0x832b
callq 0x33b0
leaq 0x401d(%rip), %rdi      # 0x8364
callq 0x33b0
leaq 0x4053(%rip), %rdi      # 0x83a6
callq 0x33b0
leaq 0x408e(%rip), %rdi      # 0x83ed
callq 0x33b0
leaq 0x40c9(%rip), %rdi      # 0x8434
callq 0x33b0
pushq $0xa
popq %rdi
popq %rax
jmp 0x3320
nop
// File: /workspace/github_cpp_makefile_star2_O2/auton1[P]motiflocation/motif.cpp
// Function: motif::motif(bool)
motif::motif(bool is_nondegenerate)
{
	// Generate a random motif.
	int i;
    int maxlength=6;
	int length;
	string out;
	ExpVal = 0.0;

	length = ran2(2, maxlength+1);
	sequence.resize(length);
	for (i=0; i<length; i++)
	{
		sequence[i] = GetRandomBase(is_nondegenerate);
	}
	doComplement();

	CalcDegeneracy();
	get_max_length();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
leaq 0x6d18(%rip), %rax      # 0xbab0
movq %rax, (%rdi)
leaq 0x18(%rdi), %rax
movq %rax, 0x8(%rdi)
andq $0x0, 0x10(%rdi)
xorl %eax, %eax
movb %al, 0x18(%rdi)
leaq 0x38(%rdi), %rcx
movq %rcx, 0x28(%rdi)
andq $0x0, 0x30(%rdi)
movl %esi, %ebp
leaq 0x8(%rdi), %r14
movb %al, 0x38(%rdi)
leaq 0x10(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb %al, (%rcx)
andq $0x0, 0x78(%rdi)
pushq $0x2
popq %rdi
pushq $0x7
popq %rsi
callq 0x6b3f
movl %eax, %r15d
movslq %eax, %rsi
movq %r14, %rdi
callq 0x3310
xorl %r12d, %r12d
testl %r15d, %r15d
cmovlel %r12d, %r15d
movzbl %bpl, %ebp
cmpq %r12, %r15
je 0x4e17
movl %ebp, %esi
callq 0x4e6e
movq (%r14), %rcx
movb %al, (%rcx,%r12)
incq %r12
jmp 0x4dff
movq %rbx, %rdi
callq 0x4f0a
movq %rbx, %rdi
callq 0x4f60
movq %rbx, %rdi
callq 0x5052
movq %rsp, %rdi
callq 0x3110
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4e46
movq %rax, %r15
addq $0x28, %rbx
movq %rsp, %rdi
callq 0x3110
movq %rbx, %rdi
callq 0x3110
movq %r14, %rdi
callq 0x3110
movq %r15, %rdi
callq 0x3470
nop
// File: /workspace/github_cpp_makefile_star2_O2/auton1[P]motiflocation/motif.cpp
// Function: motif::GetRandomBase(bool)
char motif::GetRandomBase(bool is_nondegenerate)
{
	int letter;
	if (is_nondegenerate == true)
	{
		letter = ran2(0,6);
		if (letter == 4) letter = 14;
		if (letter == 5) letter = 15;
	}
	else
		letter = ran2(0, 16);
	switch(letter)
	{
	case 0:	return 'a'; break;
	case 1:	return 'c'; break;
	case 2:	return 'g'; break;
	case 3:	return 't'; break;
	case 4:	return 'r'; break;
	case 5:	return 'y'; break;
	case 6:	return 'k'; break;
	case 7:	return 'm'; break;
	case 8:	return 's'; break;
	case 9:	return 'w'; break;
	case 10: return 'b'; break;
	case 11: return 'd'; break;
	case 12: return 'h'; break;
	case 13: return 'v'; break;
	case 14: return 'n'; break;
	case 15: 
		{	// insert a gap of size 1 to 9.
			int i; char out;
			i=ran2(1, 10);
			out = '0' + i;
			return out;
			break;
		}

	default:
		printf("error - illegal nucleotide\n");
		abort();
		return '-';
	}
}

// Assembly:
pushq %rax
testl %esi, %esi
je 0x4e9c
pushq $0x6
popq %rsi
xorl %edi, %edi
callq 0x6b3f
movl %eax, %ecx
cmpl $0x4, %eax
pushq $0xe
popq %rax
cmovnel %ecx, %eax
cmpl $0x5, %eax
jne 0x4ea6
pushq $0x1
popq %rdi
pushq $0xa
popq %rsi
callq 0x6b3f
addb $0x30, %al
popq %rcx
retq
pushq $0x10
popq %rsi
xorl %edi, %edi
callq 0x6b3f
cmpl $0xf, %eax
ja 0x4ef9
movl %eax, %eax
leaq 0x35c0(%rip), %rcx      # 0x8474
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $0x61, %al
jmp 0x4e9a
movb $0x76, %al
jmp 0x4e9a
movb $0x62, %al
jmp 0x4e9a
movb $0x74, %al
jmp 0x4e9a
movb $0x64, %al
jmp 0x4e9a
movb $0x73, %al
jmp 0x4e9a
movb $0x63, %al
jmp 0x4e9a
movb $0x6e, %al
jmp 0x4e9a
movb $0x67, %al
jmp 0x4e9a
movb $0x6b, %al
jmp 0x4e9a
movb $0x72, %al
jmp 0x4e9a
movb $0x68, %al
jmp 0x4e9a
movb $0x79, %al
jmp 0x4e9a
movb $0x77, %al
jmp 0x4e9a
movb $0x6d, %al
jmp 0x4e9a
leaq 0x372f(%rip), %rdi      # 0x862f
callq 0x33b0
callq 0x3170
// File: /workspace/github_cpp_makefile_star2_O2/auton1[P]motiflocation/motif.cpp
// Function: motif::doComplement()
void motif::doComplement()
{
	unsigned int i;
	char base;
	unsigned int seqlen;
	seqlen = (unsigned int)sequence.length();
	complement.resize(seqlen);
	for (i=0; i<seqlen; i++)
	{
		base = sequence[i];
		complement[seqlen-i-1] = getComplement(base);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %r15
addq $0x28, %rdi
movl %r15d, %r14d
movq %r14, %rsi
callq 0x3310
decq %r15
xorl %r12d, %r12d
cmpq %r12, %r14
je 0x4f53
movq 0x8(%rbx), %rax
movsbl (%rax,%r12), %esi
callq 0x5144
movl %r15d, %ecx
movq 0x28(%rbx), %rdx
movb %al, (%rdx,%rcx)
incq %r12
decq %r15
jmp 0x4f2e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/auton1[P]motiflocation/motif.cpp
// Function: motif::CalcDegeneracy()
void motif::CalcDegeneracy()
{
	unsigned int i;
	char base;
	degeneracy= 0.0;
	for (i=0; i<sequence.length(); i++)
	{
		base = sequence[i];
		switch (base)
		{
			case 'a': case 't': case 'g': case 'c':
				degeneracy++;
				break;
			case 'r': case 'y': case 'k': case 'm': case 's': case 'w':
				degeneracy += 2;
				break;
			case 'b': case 'd': case 'h': case 'v':
				degeneracy += 3;
				break;
			case 'n':
				degeneracy += 4;
				break;
			case '1': case '2': case '3': case '4': case '5': case '6': case '7':case '8': case '9':
				degeneracy += (4 * (base - '0' + 1));
				break;
			default:
				printf("Non-standard base in motif\n");
				cout << base << endl;
				cout << sequence << endl;
				abort();
		}
	}
	degeneracy /= (double)sequence.length();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
andq $0x0, 0x60(%rdi)
leaq 0x8(%rdi), %rbx
movq 0x8(%rdi), %rcx
movq 0x10(%rdi), %rax
xorl %edx, %edx
xorpd %xmm0, %xmm0
movsd 0x3625(%rip), %xmm1     # 0x85a8
leaq 0x352a(%rip), %rsi      # 0x84b4
movsd 0x3626(%rip), %xmm2     # 0x85b8
movsd 0x3626(%rip), %xmm3     # 0x85c0
movsd 0x360e(%rip), %xmm4     # 0x85b0
movl %edx, %edx
cmpq %rdx, %rax
jbe 0x4ffc
movzbl (%rcx,%rdx), %r14d
leal -0x61(%r14), %r8d
cmpl $0x18, %r8d
ja 0x4fcc
movslq (%rsi,%r8,4), %r8
addq %rsi, %r8
movapd %xmm1, %xmm5
jmpq *%r8
movapd %xmm3, %xmm5
jmp 0x4fe9
leal -0x31(%r14), %r8d
cmpl $0x9, %r8d
jae 0x5012
leal -0xbc(,%r14,4), %r8d
cvtsi2sd %r8d, %xmm5
jmp 0x4fe9
movapd %xmm2, %xmm5
addsd %xmm5, %xmm0
movsd %xmm0, 0x60(%rdi)
incl %edx
jmp 0x4fa2
movapd %xmm4, %xmm5
jmp 0x4fe9
cvtsi2sd %rax, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x60(%rdi)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x3631(%rip), %rdi      # 0x864a
callq 0x33b0
movsbl %r14b, %esi
movq 0x6faf(%rip), %r14      # 0xbfd8
movq %r14, %rdi
callq 0x3290
movq %rax, %rdi
callq 0x3120
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3220
movq %rax, %rdi
callq 0x3120
callq 0x3170
nop
// File: /workspace/github_cpp_makefile_star2_O2/auton1[P]motiflocation/motif.cpp
// Function: motif::motif(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
motif::motif(string input)
{
	// Set motif to input sting.
	ExpVal = 0.0;
	sequence = input;
	CalcDegeneracy();
	get_max_length();
	doComplement();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
leaq 0x6a1b(%rip), %rax      # 0xbab0
movq %rax, (%rdi)
leaq 0x8(%rdi), %rbx
leaq 0x18(%rdi), %rax
movq %rax, 0x8(%rdi)
andq $0x0, 0x10(%rdi)
xorl %eax, %eax
movb %al, 0x18(%rdi)
leaq 0x28(%rdi), %r15
leaq 0x38(%rdi), %rcx
movq %rcx, 0x28(%rdi)
andq $0x0, 0x30(%rdi)
movb %al, 0x38(%rdi)
andq $0x0, 0x78(%rdi)
movq %rbx, %rdi
callq 0x3160
movq %r14, %rdi
callq 0x4f60
movq %r14, %rdi
callq 0x5052
movq %r14, %rdi
callq 0x4f0a
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movq %r15, %rdi
callq 0x3110
movq %rbx, %rdi
callq 0x3110
movq %r14, %rdi
callq 0x3470
// File: /workspace/github_cpp_makefile_star2_O2/auton1[P]motiflocation/motif.cpp
// Function: motif::getComplement(char)
char motif::getComplement(char base)
{
	switch (base)
	{
	case 'a': return 't';
	case 'c': return 'g';
	case 'g': return 'c';
	case 't': return 'a';
	case 'r': return 'y';
	case 'y': return 'r';
	case 'k': return 'm';
	case 'm': return 'k';
	case 's': return 's';
	case 'w': return 'w';
	case 'b': return 'v';
	case 'd': return 'h';
	case 'h': return 'd';
	case 'v': return 'b';
	case 'n': return 'n';
	case '1': return '1';
	case '2': return '2';
	case '3': return '3';
	case '4': return '4';
	case '5': return '5';
	case '6': return '6';
	case '7': return '7';
	case '8': return '8';
	case '9': return '9';
	default:
		cout << "Cannot find base complement of : " << base << endl;
		abort();
		return base;
	}
}

// Assembly:
pushq %rbx
movl %esi, %ebx
leal -0x61(%rsi), %eax
cmpl $0x18, %eax
ja 0x5163
leaq 0x33e6(%rip), %rcx      # 0x853c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $0x74, %bl
jmp 0x517b
addl $-0x31, %esi
cmpl $0x8, %esi
ja 0x51ab
leaq 0x33a6(%rip), %rax      # 0x8518
movslq (%rax,%rsi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movl %ebx, %eax
popq %rbx
retq
movb $0x6d, %bl
jmp 0x517b
movb $0x72, %bl
jmp 0x517b
movb $0x67, %bl
jmp 0x517b
movb $0x62, %bl
jmp 0x517b
movb $0x6b, %bl
jmp 0x517b
movb $0x63, %bl
jmp 0x517b
movb $0x76, %bl
jmp 0x517b
movb $0x61, %bl
jmp 0x517b
movb $0x68, %bl
jmp 0x517b
movb $0x79, %bl
jmp 0x517b
movb $0x64, %bl
jmp 0x517b
movq 0x6e26(%rip), %rdi      # 0xbfd8
leaq 0x340f(%rip), %rsi      # 0x85c8
callq 0x3250
movsbl %bl, %esi
movq %rax, %rdi
callq 0x3290
movq %rax, %rdi
callq 0x3120
callq 0x3170
// File: /workspace/github_cpp_makefile_star2_O2/auton1[P]motiflocation/motif.cpp
// Function: motif::IsMotifInSequence(char const*, char const*, int)
bool motif::IsMotifInSequence(const char* inputseq, const char* wild, int allowed_mutations)
{
	const char *cp = inputseq;
	const char *mp = wild;
	bool match;
	int max_gap_size;
	int max_gap_size_plus_one;
	char *buffer;
	size_t sizeof_char = sizeof( char ); 
	char null_char = (char)NULL;
	int mutations = 0;

	while ((*inputseq) && (*wild))
	{
		if (basematch(*inputseq, *wild))	// Compare degenerate bases
		{
			wild++;		// Move to next character
			inputseq++;
		} 
		else if ((*wild > '0') && (*wild <= '9'))	// This bit allows for gaps in the motif.
		{
			max_gap_size = (*wild - '0') + max_length;
			max_gap_size_plus_one = max_gap_size+1;
			while ((*wild) && (*wild > '0') && (*wild <= '9'))		// Remove all prefixed numbers
				wild++;
			buffer = new char[max_gap_size_plus_one];
			strncpy(buffer, inputseq, sizeof_char * max_gap_size_plus_one);
			buffer[max_gap_size] = null_char;
			match = IsMotifInSequence(buffer, wild, allowed_mutations - mutations);
			delete [] buffer;
			if (match)
				return true;	// The call to the recursion returned true, so we should return true.
			else
			{
				wild = mp;	// We do not have a match,
				cp++;		// so reset the wild string, and goto the next char on the inputsequence.
				inputseq = cp;
				mutations = 0;
			}
		}
		else if (mutations < allowed_mutations)
		{
			wild++;		// Move to next character
			inputseq++;
			mutations++;
		}
		else 
		{
			wild = mp;	// We do not have a match,
			cp++;		// so reset the wild string, and goto the next char on the inputsequence.
			inputseq = cp;
			mutations = 0;
		}
	}

	return (bool)!*wild;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, 0xc(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq %rdx, 0x20(%rsp)
xorl %ebx, %ebx
movq %r15, %r13
leaq -0x1(%r14), %rbp
movb (%r13), %cl
movb (%r14), %al
testb %cl, %cl
je 0x52c6
testb %al, %al
je 0x52c6
movsbl %cl, %esi
movsbl %al, %edx
movq %r12, %rdi
callq 0x545c
testb %al, %al
je 0x5233
incq %r14
incq %r13
incq %rbp
jmp 0x51ff
movb (%r14), %al
leal -0x31(%rax), %ecx
cmpb $0x8, %cl
jbe 0x524e
cmpl %ebx, 0xc(%rsp)
jle 0x52b9
incq %r14
incq %r13
incl %ebx
jmp 0x51fb
addb $-0x30, %al
movzbl %al, %ecx
addl 0x70(%r12), %ecx
movb 0x1(%rbp), %al
incq %rbp
addb $-0x31, %al
cmpb $0x9, %al
jb 0x5258
leal 0x1(%rcx), %eax
movslq %eax, %rdi
movq %rdi, 0x10(%rsp)
movq %rcx, 0x18(%rsp)
callq 0x3030
movq %rax, %r14
movq %rax, %rdi
movq %r13, %rsi
movq 0x10(%rsp), %rdx
callq 0x3140
movslq 0x18(%rsp), %rax
movb $0x0, (%r14,%rax)
movl 0xc(%rsp), %ecx
subl %ebx, %ecx
movq %r12, %rdi
movq %r14, %rsi
movq %rbp, %rdx
callq 0x51d6
movl %eax, %ebp
movq %r14, %rdi
callq 0x32c0
testb %bpl, %bpl
jne 0x52da
incq %r15
movq 0x20(%rsp), %r14
jmp 0x51f6
testb %al, %al
sete %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %al
jmp 0x52cb
// File: /workspace/github_cpp_makefile_star2_O2/auton1[P]motiflocation/DNA.cpp
// Function: DNA::DNA(char*)
DNA::DNA(char *seq)
{
	string seqstring = seq;
	std::transform (seqstring.begin(), seqstring.end(), seqstring.begin(), ToLower());
	Trim(seqstring);
	sequence.resize(1);
	sequence[0].append(seqstring);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %r14
leaq 0x64b5(%rip), %rax      # 0xbae0
movq %rax, (%rdi)
leaq 0x8(%rdi), %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
movups %xmm0, 0x18(%rdi)
movups %xmm0, 0x28(%rdi)
movups %xmm0, 0x38(%rdi)
andq $0x0, 0x48(%rdi)
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x437a
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
addq %rdi, %rsi
movq %rdi, %rdx
callq 0x635f
leaq 0x10(%rsp), %rsi
callq 0x56dc
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x638e
movq (%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq 0x34d0
leaq 0x10(%rsp), %rdi
callq 0x3110
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r15
jmp 0x56b6
movq %rax, %r15
leaq 0x10(%rsp), %rdi
callq 0x3110
leaq 0x38(%r14), %rdi
addq $0x20, %r14
callq 0x6618
movq %r14, %rdi
callq 0x44d0
movq %rbx, %rdi
callq 0x44d0
movq %r15, %rdi
callq 0x3470
nop
// File: /workspace/github_cpp_makefile_star2_O2/auton1[P]motiflocation/DNA.cpp
// Function: DNA::Trim(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void DNA::Trim(string &str)
{
		// trim leading whitespace
		string::size_type  notwhite = str.find_first_not_of(" \t\n\v\b\r\f\a\\\?\'\"\0");
		str.erase(0,notwhite);

		// trim trailing whitespace
		notwhite = str.find_last_not_of(" \t\n\v\b\r\f\a\\\?\'\"\0"); 
		str.erase(notwhite+1); 
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
leaq 0x3031(%rip), %r14      # 0x871c
movq %rsi, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x3190
movq %rbx, %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0x3070
pushq $-0x1
popq %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x34a0
leaq 0x1(%rax), %rsi
movq %rbx, %rdi
movq %r15, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x3070
nop
// File: /workspace/github_cpp_makefile_star2_O2/auton1[P]motiflocation/DNA.cpp
// Function: DNA::remove_upper_or_lowercase(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, bool, bool)
void DNA::remove_upper_or_lowercase(string &string1, bool uppercase_only, bool lowercase_only)
{
	if (uppercase_only == true)
	{
		size_t position = string1.find_first_of("acgt");
		while ( position != string::npos )
		{
			string1.replace( position, 1, "N" );
			position = string1.find_first_of("acgt", position + 1 );
		}
	}
	else if (lowercase_only == true)
	{
		size_t position = string1.find_first_of("ACGT");
		while ( position != string::npos )
		{
			string1.replace( position, 1, "N" );
			position = string1.find_first_of("ACGT", position + 1 );
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
testl %edx, %edx
je 0x5c32
xorl %r12d, %r12d
leaq 0x2afc(%rip), %r14      # 0x86f6
leaq 0x2afa(%rip), %r15      # 0x86fb
pushq $0x1
popq %r13
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x3130
cmpq $-0x1, %rax
je 0x5c78
movq %rax, %r12
movq %rbx, %rdi
movq %rax, %rsi
movq %r13, %rdx
movq %r15, %rcx
callq 0x31a0
incq %r12
jmp 0x5c05
testb %cl, %cl
je 0x5c78
xorl %r12d, %r12d
leaq 0x2abd(%rip), %r14      # 0x86fd
leaq 0x2ab4(%rip), %r15      # 0x86fb
pushq $0x1
popq %r13
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x3130
cmpq $-0x1, %rax
je 0x5c78
movq %rax, %r12
movq %rbx, %rdi
movq %rax, %rsi
movq %r13, %rdx
movq %r15, %rcx
callq 0x31a0
incq %r12
jmp 0x5c4b
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/auton1[P]motiflocation/DNA.cpp
// Function: DNA::CountMotifOccurances(motif&)
int DNA::CountMotifOccurances(motif &Motif)
{
	int i;
	int count = 0;
	bool match;

	for (i=NSeqs; i--;)
	{
		match = Motif.IsMotifInSequence(sequence[i].c_str(), Motif.sequence.c_str(), 0);
		if (match)
		{
			// have found motif so we're done
			count++;
		}
		else
		{
			// we didn't find the motif, so we need to test the complement
			match = Motif.IsMotifInSequence(sequence[i].c_str(), Motif.complement.c_str() ,0 );
			if (match)
			{
				count++;
			}
		}
	}
	return count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movslq 0x50(%rdi), %r15
movq %r15, %r12
shlq $0x5, %r12
addq $-0x20, %r12
xorl %ebp, %ebp
pushq $0x1
popq %r13
subq $0x1, %r15
jb 0x634e
movq 0x8(%r14), %rax
movq (%rax,%r12), %rsi
movq 0x8(%rbx), %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x51d6
movl %r13d, %ecx
testb %al, %al
jne 0x6346
movq 0x8(%r14), %rax
movq (%rax,%r12), %rsi
movq 0x28(%rbx), %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x51d6
movzbl %al, %ecx
addl %ecx, %ebp
addq $-0x20, %r12
jmp 0x630a
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/auton1[P]motiflocation/random.cpp
// Function: ran2()
double ran2(void) {
	int j;
	long k;
	extern long *idum;
	static long idum2=123456789;
	static long iy=0;
	static long iv[NTAB];
	double temp;

	if (*idum <= 0) {
		if (-(*idum) < 1) *idum=1;
		else *idum = -(*idum);
		idum2=(*idum);
		for (j=NTAB+7; j>=0; j--) {
			k=(*idum)/IQ1;
			*idum=IA1*(*idum-k*IQ1)-k*IR1;
			if (*idum < 0) *idum += IM1;
			if (j < NTAB) iv[j] = *idum;
			
		}
		iy=iv[0];
	}
	k=(*idum)/IQ1;
	*idum=IA1*(*idum-k*IQ1)-k*IR1;
	if (*idum < 0) *idum += IM1;
	k=idum2/IQ2;
	idum2=IA2*(idum2-k*IQ2)-k*IR2;
	if (idum2 < 0) idum2 += IM2;
	j=iy/NDIV;
	iy=iv[j]-idum2;
	iv[j]=*idum;
	if (iy < 1) iy += IMM1;
	if ((temp=AM*iy) > RNMX) return RNMX;
	else return temp;
}

// Assembly:
leaq 0x591a(%rip), %rax      # 0xc2d0
movq (%rax), %r8
movq (%r8), %rsi
testq %rsi, %rsi
jle 0x6aa2
leaq 0x5914(%rip), %rdi      # 0xc2e0
movq 0x58cd(%rip), %rcx      # 0xc2a0
movq (%rdi), %rdi
movl $0xd1a4, %r9d           # imm = 0xD1A4
movq %rsi, %rax
cqto
idivq %r9
imulq $-0xd1a4, %rax, %rdx    # imm = 0xFFFF2E5C
addq %rsi, %rdx
imulq $0x9c4e, %rdx, %rdx     # imm = 0x9C4E
imulq $-0x2fb3, %rax, %rax    # imm = 0xD04D
leaq (%rdx,%rax), %rsi
addq $0x7fffffab, %rsi       # imm = 0x7FFFFFAB
addq %rax, %rdx
cmovnsq %rdx, %rsi
movq %rsi, (%r8)
movl $0xce26, %r8d           # imm = 0xCE26
movq %rcx, %rax
cqto
idivq %r8
imulq $-0xce26, %rax, %rdx    # imm = 0xFFFF31DA
addq %rcx, %rdx
imulq $0x9ef4, %rdx, %rcx     # imm = 0x9EF4
imulq $-0xecf, %rax, %rax     # imm = 0xF131
leaq (%rcx,%rax), %r8
addq $0x7fffff07, %r8        # imm = 0x7FFFFF07
addq %rax, %rcx
cmovnsq %rcx, %r8
movq %r8, 0x5850(%rip)       # 0xc2a0
movl $0x3fffffe, %ecx        # imm = 0x3FFFFFE
movq %rdi, %rax
cqto
idivq %rcx
movslq %eax, %rcx
leaq 0x5889(%rip), %rdx      # 0xc2f0
movq (%rdx,%rcx,8), %rax
movq %rsi, (%rdx,%rcx,8)
subq %r8, %rax
movq %rax, 0x5867(%rip)      # 0xc2e0
jg 0x6a88
addq $0x7fffffaa, %rax       # imm = 0x7FFFFFAA
movq %rax, 0x5858(%rip)      # 0xc2e0
cvtsi2sd %rax, %xmm1
mulsd 0x1cab(%rip), %xmm1     # 0x8740
movsd 0x1cab(%rip), %xmm0     # 0x8748
minsd %xmm1, %xmm0
retq
negq %rsi
pushq $0x1
popq %rcx
cmovbq %rsi, %rcx
pushq $0x27
popq %r9
leaq 0x5839(%rip), %rdi      # 0xc2f0
movl $0xd1a4, %r10d          # imm = 0xD1A4
movq %rcx, %rsi
testl %r9d, %r9d
js 0x69d3
movq %rsi, %rax
cqto
idivq %r10
imulq $-0xd1a4, %rax, %rdx    # imm = 0xFFFF2E5C
addq %rsi, %rdx
imulq $0x9c4e, %rdx, %rdx     # imm = 0x9C4E
imulq $-0x2fb3, %rax, %rax    # imm = 0xD04D
leaq (%rdx,%rax), %rsi
addq $0x7fffffab, %rsi       # imm = 0x7FFFFFAB
addq %rax, %rdx
cmovnsq %rdx, %rsi
cmpl $0x1f, %r9d
ja 0x6b08
movl %r9d, %eax
movq %rsi, (%rdi,%rax,8)
decl %r9d
jmp 0x6ac0
// File: /workspace/github_cpp_makefile_star2_O2/auton1[P]motiflocation/random.cpp
// Function: ran2(double, double)
double ran2(double min, double max)
{
	double r = ran2();
	r *= (max - min);
	r += min;
	return r;
}

// Assembly:
subq $0x18, %rsp
movsd %xmm1, 0x10(%rsp)
movsd %xmm0, 0x8(%rsp)
callq 0x69af
movsd 0x8(%rsp), %xmm1
movsd 0x10(%rsp), %xmm2
subsd %xmm1, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/auton1[P]motiflocation/random.cpp
// Function: ran2(int, int)
int ran2(int min, int max)
{
	double r = ran2();
	r *= (double)(max - min);
	r += min;
	return (int)r;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %ebp
callq 0x69af
subl %ebp, %ebx
cvtsi2sd %ebx, %xmm1
mulsd %xmm0, %xmm1
cvtsi2sd %ebp, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/auton1[P]motiflocation/random.cpp
// Function: gammln(double)
double gammln(double xx)
{
	double x,y,tmp,ser;
	static double cof[6]={76.18009172947146,-86.50532032941677,
	24.01409824083091,-1.231739572450155,
	0.1208650973866179e-2,-0.5395239384953e-5};
	int j;
	y=x=xx;
	tmp=x+5.5;
	tmp -= (x+0.5)*log(tmp);
	ser=1.000000000190015;
	for (j=0;j<=5;j++) ser += cof[j]/++y;
	return -tmp+log(2.5066282746310005*ser/x);
}

// Assembly:
subq $0x18, %rsp
movapd %xmm0, %xmm1
movsd %xmm0, 0x10(%rsp)
movsd 0x1bbc(%rip), %xmm0     # 0x8750
addsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
callq 0x31f0
movsd 0x10(%rsp), %xmm5
movapd %xmm0, %xmm1
movsd 0x1ba3(%rip), %xmm0     # 0x8758
xorl %eax, %eax
leaq 0x1c12(%rip), %rcx      # 0x87d0
movsd 0x19e2(%rip), %xmm2     # 0x85a8
movapd %xmm5, %xmm3
cmpq $0x30, %rax
je 0x6be7
movsd (%rax,%rcx), %xmm4
addsd %xmm2, %xmm3
divsd %xmm3, %xmm4
addsd %xmm4, %xmm0
addq $0x8, %rax
jmp 0x6bca
movsd 0x1b71(%rip), %xmm2     # 0x8760
addsd %xmm5, %xmm2
mulsd %xmm1, %xmm2
movsd 0x8(%rsp), %xmm1
subsd %xmm2, %xmm1
movsd %xmm1, 0x8(%rsp)
mulsd 0x1b59(%rip), %xmm0     # 0x8768
divsd %xmm5, %xmm0
callq 0x31f0
subsd 0x8(%rsp), %xmm0
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/auton1[P]motiflocation/random.cpp
// Function: normrnd()
double normrnd(void)
{
	extern long *idum;
	static int iset=0;
	static double gset;
	double fac, r, v1, v2;

	if (iset == 0)
	{
		do
		{
			v1 = 2.0 * ran2() - 1.0;
			v2 = 2.0 * ran2() - 1.0;
			r = v1 * v1 + v2 * v2;
		} while (r >= 1.0);
		
		fac = sqrt(-2.0*log(r) / r);
		gset = v1 * fac;
		iset = 1;
		return v2*fac;
	} 
	else
	{
		iset = 0;
		return gset;
	}
}

// Assembly:
cmpb $0x0, 0x57c6(%rip)      # 0xc3f0
je 0x6c40
movb $0x0, 0x57bd(%rip)      # 0xc3f0
movsd 0x57bd(%rip), %xmm1     # 0xc3f8
jmp 0x6cf0
subq $0x18, %rsp
callq 0x69af
movapd %xmm0, %xmm1
addsd %xmm0, %xmm1
movsd 0x1b17(%rip), %xmm0     # 0x8770
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
callq 0x69af
movsd (%rsp), %xmm3
addsd %xmm0, %xmm0
addsd 0x1af8(%rip), %xmm0     # 0x8770
movapd %xmm0, %xmm1
mulsd %xmm0, %xmm1
mulsd %xmm3, %xmm3
addsd %xmm1, %xmm3
ucomisd 0x1918(%rip), %xmm3     # 0x85a8
jae 0x6c44
movsd %xmm0, 0x10(%rsp)
movapd %xmm3, %xmm0
movsd %xmm3, 0x8(%rsp)
callq 0x31f0
mulsd 0x1ac9(%rip), %xmm0     # 0x8778
divsd 0x8(%rsp), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x6cc5
sqrtsd %xmm0, %xmm0
jmp 0x6cca
callq 0x31e0
movsd (%rsp), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, 0x571d(%rip)     # 0xc3f8
movb $0x1, 0x570e(%rip)      # 0xc3f0
movsd 0x10(%rsp), %xmm1
mulsd %xmm0, %xmm1
addq $0x18, %rsp
movapd %xmm1, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O2/auton1[P]motiflocation/random.cpp
// Function: poissrnd(double)
int poissrnd(double xm)
{
	//float gammln(float xx);
	static double sq, alxm, g, oldm=(-1.0);
	double em,t,y;
	
	if (xm < 12.0) { 
		if (xm != oldm) {
			oldm=xm;
			g=exp(-xm); 
		}
		em = -1;
		t=1.0;
		do {
			++em;
			t *= ran2();
		} while (t > g);
	} else { 
		if (xm != oldm) { 
			oldm=xm;
			sq=sqrt(2.0*xm);
			alxm=log(xm);
			g = xm*alxm - gammln(xm + 1.0);
		}
		do {
			do { 
				y=tan(PI * ran2());
				em=sq*y+xm; 
			} while (em < 0.0); 
			em=floor(em); 
			t=0.9*(1.0+y*y)*exp(em*alxm-gammln(em+1.0)-g);
		} while (ran2() > t);
	}
	return (int)em;
}

// Assembly:
subq $0x28, %rsp
movapd %xmm0, %xmm2
movsd 0x1812(%rip), %xmm0     # 0x87a0
ucomisd %xmm2, %xmm0
movsd 0x530e(%rip), %xmm0     # 0xc2a8
jbe 0x6fcb
ucomisd %xmm2, %xmm0
jne 0x6fa4
jnp 0x6ffd
movsd %xmm2, 0x52fc(%rip)     # 0xc2a8
xorpd 0x180c(%rip), %xmm2     # 0x87c0
movapd %xmm2, %xmm0
callq 0x3480
movapd %xmm0, %xmm1
movsd %xmm0, 0x5447(%rip)     # 0xc410
jmp 0x7005
ucomisd %xmm2, %xmm0
movapd %xmm2, 0x10(%rsp)
jne 0x6fdd
jnp 0x70a6
movsd %xmm2, 0x52c3(%rip)     # 0xc2a8
movapd %xmm2, %xmm0
addsd %xmm2, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x7053
sqrtsd %xmm0, %xmm0
jmp 0x705e
movsd 0x540b(%rip), %xmm1     # 0xc410
movsd 0x1763(%rip), %xmm0     # 0x8770
movsd 0x1593(%rip), %xmm2     # 0x85a8
movsd %xmm1, 0x10(%rsp)
movsd %xmm2, (%rsp)
addsd 0x1580(%rip), %xmm0     # 0x85a8
movsd %xmm0, 0x8(%rsp)
callq 0x69af
movsd (%rsp), %xmm2
movsd 0x10(%rsp), %xmm1
mulsd %xmm0, %xmm2
movsd 0x8(%rsp), %xmm0
ucomisd %xmm1, %xmm2
ja 0x701b
jmp 0x7164
callq 0x31e0
movapd 0x10(%rsp), %xmm2
movsd %xmm0, 0x539a(%rip)     # 0xc400
movapd %xmm2, %xmm0
callq 0x31f0
movsd %xmm0, (%rsp)
movsd %xmm0, 0x538c(%rip)     # 0xc408
movsd 0x1524(%rip), %xmm0     # 0x85a8
addsd 0x10(%rsp), %xmm0
callq 0x6b7e
movsd (%rsp), %xmm1
mulsd 0x10(%rsp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, 0x536a(%rip)     # 0xc410
callq 0x69af
mulsd 0x16f5(%rip), %xmm0     # 0x87a8
callq 0x3180
movapd %xmm0, %xmm2
movsd 0x533c(%rip), %xmm0     # 0xc400
mulsd %xmm2, %xmm0
addsd 0x10(%rsp), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
ja 0x70a6
movsd %xmm2, (%rsp)
callq 0x3400
movapd %xmm0, %xmm2
movsd (%rsp), %xmm3
mulsd %xmm3, %xmm3
movsd 0x14b1(%rip), %xmm1     # 0x85a8
addsd %xmm1, %xmm3
mulsd 0x16ad(%rip), %xmm3     # 0x87b0
movsd %xmm3, (%rsp)
addsd %xmm1, %xmm0
movsd 0x52f4(%rip), %xmm1     # 0xc408
movsd %xmm2, 0x8(%rsp)
mulsd %xmm2, %xmm1
movsd %xmm1, 0x20(%rsp)
callq 0x6b7e
movsd 0x20(%rsp), %xmm1
subsd %xmm0, %xmm1
subsd 0x52d5(%rip), %xmm1     # 0xc410
movapd %xmm1, %xmm0
callq 0x3480
mulsd (%rsp), %xmm0
movsd %xmm0, (%rsp)
callq 0x69af
ucomisd (%rsp), %xmm0
ja 0x70a6
movsd 0x8(%rsp), %xmm0
cvttsd2si %xmm0, %eax
addq $0x28, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/roberty65[P]bServer/frame/testServer/src/mtServer.cpp
// Function: main
int main(int argc, char **argv)
{
	if (argc < 2) {
		fprintf(stderr, "Usage: %s host\n", argv[0]);
		exit(1);
	}
	
	const char *host = argv[1];
	int cfd, fd = beyondy::XbsServer(host, 1024);

	if (fd < 0) {
		fprintf(stderr, "listen at %s failed: %m\n", host);
		exit(2);
	}

	while (true) {
		if ((cfd = ::accept(fd, NULL, NULL)) < 0)
			continue;
		pthread_t tid;
		errno = pthread_create(&tid, NULL, worker, (void *)(long)cfd);
		if (errno) {
			fprintf(stderr, "pthread-create failed: %m\n");
			close(cfd);
		}
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x1, %edi
jle 0x1386
movq 0x8(%rsi), %r14
pushq $0x3
popq %rcx
movq %r14, %rdi
movl $0x400, %esi            # imm = 0x400
xorl %edx, %edx
callq 0x1822
testl %eax, %eax
js 0x13a5
movl %eax, %ebx
leaq 0x99(%rip), %r14        # 0x13c8
movq %rsp, %r15
leaq 0x1cf4(%rip), %r12      # 0x302d
movl %ebx, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1060
testl %eax, %eax
js 0x1339
movl %eax, %ebp
movl %eax, %ecx
movq %r15, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x11e0
movl %eax, %r13d
callq 0x1030
movl %r13d, (%rax)
testl %r13d, %r13d
je 0x1339
movq 0x3c70(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x1180
movl %ebp, %edi
callq 0x11f0
jmp 0x1339
movq 0x3c53(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movq (%rsi), %rdx
leaq 0x1c6a(%rip), %rsi      # 0x3004
xorl %eax, %eax
callq 0x1180
pushq $0x1
jmp 0x13c2
movq 0x3c34(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
leaq 0x1c5e(%rip), %rsi      # 0x3014
movq %r14, %rdx
xorl %eax, %eax
callq 0x1180
pushq $0x2
popq %rdi
callq 0x1150
// File: /workspace/github_cpp_makefile_star2_O2/roberty65[P]bServer/frame/testServer/src/mtServer.cpp
// Function: worker(void*)
static void *worker(void *p)
{
	int fd = (int)(long)p;
	char buf[8192];

	while (true) {
		ssize_t rlen = ::read(fd, buf, sizeof buf);
		if (rlen < 0) {
			if (errno == EAGAIN) continue;
			fprintf(stderr, "socket %d read failed: %m\n", fd);
			break;
		}
		else if (rlen == 0) {
			fprintf(stderr, "socket %d is closed by peer\n", fd);
			break;
		}	

		ssize_t wlen = ::write(fd, buf, rlen);
		if (wlen != rlen) {
			fprintf(stderr, "socket %d write failed: %m\n", fd);
			break;
		}
	}

	close(fd);
	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2008, %rsp           # imm = 0x2008
movq %rdi, %rbx
movq %rsp, %r15
leaq 0x1c62(%rip), %r13      # 0x3048
leaq 0x1c76(%rip), %r14      # 0x3063
leaq 0x1c8c(%rip), %rbp      # 0x3080
movl $0x2000, %edx           # imm = 0x2000
movl %ebx, %edi
movq %r15, %rsi
callq 0x1190
testq %rax, %rax
js 0x1421
je 0x1433
movq %rax, %r12
movl %ebx, %edi
movq %r15, %rsi
movq %rax, %rdx
callq 0x1070
cmpq %r12, %rax
je 0x13f4
jmp 0x1430
callq 0x1030
cmpl $0xb, (%rax)
je 0x13f4
movq %r13, %r14
jmp 0x1433
movq %rbp, %r14
movq 0x3ba6(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movq %r14, %rsi
movl %ebx, %edx
xorl %eax, %eax
callq 0x1180
movl %ebx, %edi
callq 0x11f0
xorl %eax, %eax
addq $0x2008, %rsp           # imm = 0x2008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq