LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/IlyaSamoylov45[P]MapReduce-Project/main.cpp
// Function: map_function_thread(void*)
void *map_function_thread(void* thread) {
	struct ThreadData *curr_thread_data;
	curr_thread_data = (struct ThreadData *) thread;

	std::vector<std::string> words = split_string_by_space(curr_thread_data->line_array);
	std::map<std::string, int> counterMap;

	for(int i = 0; i < words.size(); i++){
	  if(counterMap.count(words[i])){
	    counterMap[words[i]] = counterMap[words[i]] + 1;
	  } else {
	    counterMap[words[i]] = 1;
	  }
	}

	//test output
	curr_thread_data->counter = counterMap;
	std::map<std::string, int> testMap = curr_thread_data->counter;
	for(auto it = testMap.begin(); it != testMap.end(); it++){
	  //std::cout << it->first << " " << it->second << std::endl;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdi, %rbx
leaq -0x58(%rbp), %r15
movq %r15, -0x10(%r15)
movq 0x8(%rdi), %rsi
movq 0x10(%rdi), %rdx
addq %rsi, %rdx
leaq -0x68(%rbp), %r14
movq %r14, %rdi
callq 0x7a0c
leaq -0x40(%rbp), %rdi
movq %r14, %rsi
callq 0x5c82
movq %rbx, -0x48(%rbp)
movq -0x68(%rbp), %rdi
cmpq %r15, %rdi
je 0x5865
callq 0x32f0
leaq -0x90(%rbp), %r15
movl $0x0, (%r15)
xorl %eax, %eax
movq %rax, 0x8(%r15)
movq %r15, 0x10(%r15)
movq %r15, 0x18(%r15)
movq %rax, 0x20(%r15)
movq -0x40(%rbp), %rsi
cmpq %rsi, -0x38(%rbp)
je 0x58fb
xorl %r12d, %r12d
leaq -0x98(%rbp), %r14
xorl %r13d, %r13d
addq %r12, %rsi
movq %r14, %rdi
callq 0x8644
movq -0x40(%rbp), %rsi
addq %r12, %rsi
cmpq %r15, %rax
je 0x58d2
movq %r14, %rdi
callq 0x70aa
movl (%rax), %ebx
movq -0x40(%rbp), %rsi
addq %r12, %rsi
movq %r14, %rdi
callq 0x70aa
incl %ebx
movl %ebx, (%rax)
jmp 0x58e0
movq %r14, %rdi
callq 0x70aa
movl $0x1, (%rax)
incq %r13
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rax
subq %rsi, %rax
sarq $0x5, %rax
addq $0x20, %r12
cmpq %r13, %rax
ja 0x589c
movq -0x48(%rbp), %rbx
addq $0x28, %rbx
leaq -0x98(%rbp), %rsi
movq %rbx, %rdi
callq 0x76da
leaq -0xc8(%rbp), %rdi
movq %rbx, %rsi
callq 0x7422
jmp 0x5925
jmp 0x5925
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
callq 0x76c2
leaq -0x40(%rbp), %rdi
callq 0x6e22
jmp 0x5950
movq %rax, %rbx
movq -0x68(%rbp), %rdi
cmpq %r15, %rdi
je 0x5950
callq 0x32f0
movq %rbx, %rdi
callq 0x3560
// File: /workspace/github_cpp_makefile_star2_O3/IlyaSamoylov45[P]MapReduce-Project/main.cpp
// Function: assignJobs(int, int)
std::vector<std::vector<int>> assignJobs(int reduces, int maps){
  std::vector<std::vector<int>> result;
  int amount = maps / reduces;
  int leftOver = maps % reduces;
  int counter = 0;

  for(int i = 0; i < reduces; i++){
    std::vector<int> currentReduce;
    for(int j = 0; j < amount; j++){
      currentReduce.push_back(counter);
      counter++;
    }
    result.push_back(currentReduce);
  }
  for(int i = 0; i < leftOver; i++){
    result[i].push_back(counter);
    counter++;
  }
  return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %edx, %eax
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq %rdi, -0x38(%rbp)
movq $0x0, 0x10(%rdi)
cltd
idivl %esi
movl %edx, -0x3c(%rbp)
movl $0x0, -0x2c(%rbp)
movl %esi, -0x40(%rbp)
testl %esi, %esi
jle 0x5a08
movl %eax, %ebx
xorl %r14d, %r14d
leaq -0x60(%rbp), %r13
leaq -0x2c(%rbp), %r15
xorps %xmm0, %xmm0
movaps %xmm0, -0x60(%rbp)
movq $0x0, -0x50(%rbp)
movl %ebx, %r12d
testl %ebx, %ebx
jle 0x59e5
movq -0x58(%rbp), %rsi
cmpq -0x50(%rbp), %rsi
je 0x59cd
movl -0x2c(%rbp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, -0x58(%rbp)
jmp 0x59db
movq %r13, %rdi
movq %r15, %rdx
callq 0x82a2
movl -0x2c(%rbp), %eax
incl %eax
movl %eax, -0x2c(%rbp)
decl %r12d
jne 0x59b4
movq -0x38(%rbp), %rdi
movq %r13, %rsi
callq 0x706e
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x59ff
callq 0x32f0
incl %r14d
cmpl -0x40(%rbp), %r14d
jne 0x599e
movl -0x3c(%rbp), %eax
testl %eax, %eax
jle 0x5a5f
movl %eax, %eax
shlq $0x3, %rax
leaq (%rax,%rax,2), %r15
xorl %r12d, %r12d
leaq -0x2c(%rbp), %r14
movq -0x38(%rbp), %rax
movq (%rax), %rax
leaq (%rax,%r12), %rdi
movq 0x8(%rax,%r12), %rsi
cmpq 0x10(%rax,%r12), %rsi
je 0x5a46
movl -0x2c(%rbp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x5a51
movq %r14, %rdx
callq 0x82a2
movl -0x2c(%rbp), %eax
incl %eax
movl %eax, -0x2c(%rbp)
addq $0x18, %r12
cmpq %r12, %r15
jne 0x5a20
movq -0x38(%rbp), %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x5a8a
jmp 0x5a79
movq %rax, %r14
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x5a8a
callq 0x32f0
movq -0x38(%rbp), %rdi
callq 0x701a
movq %r14, %rdi
callq 0x3560
// File: /workspace/github_cpp_makefile_star2_O3/IlyaSamoylov45[P]MapReduce-Project/main.cpp
// Function: split_string_by_space(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
std::vector<std::string> split_string_by_space(std::string input){
  std::string buf;
  std::stringstream ss(input);

  std::vector<std::string> words;
  while(ss >> buf)
    words.push_back(buf);

  return words;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, %rbx
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
leaq -0x1c8(%rbp), %rdi
movl $0x18, %edx
callq 0x34c0
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
leaq -0x1c8(%rbp), %r14
leaq -0x40(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x33a0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x5cfe
movq %rbx, %rdi
movq %r15, %rsi
callq 0x736e
jmp 0x5cd8
movq 0x192ab(%rip), %rsi     # 0x1efb0
leaq -0x1c8(%rbp), %rdi
callq 0x3250
leaq -0x148(%rbp), %rdi
callq 0x30e0
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x5d2b
callq 0x32f0
movq %rbx, %rax
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x5d6d
movq %rax, %r14
movq %rbx, %rdi
callq 0x6e22
movq 0x1925b(%rip), %rsi     # 0x1efb0
leaq -0x1c8(%rbp), %rdi
callq 0x3250
leaq -0x148(%rbp), %rdi
callq 0x30e0
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x5d7b
callq 0x32f0
movq %r14, %rdi
callq 0x3560
// File: /workspace/github_cpp_makefile_star2_O3/IlyaSamoylov45[P]MapReduce-Project/main.cpp
// Function: check_values(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void check_values(std::string value, std::string correct){
  if(value.compare(correct) != 0){
    std::cout << "\n" << "Usage is: --app [wordcount, sort] --impl [procs, threads] --maps num_maps --reduces num_reduces --input infile --output outfile" << std::endl;
    std::cout << "Error was in the argument " << correct << std::endl;
    std::cout << "You wrote: " << value << "\n" << std::endl;
    exit(EXIT_FAILURE);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
callq 0x3040
testl %eax, %eax
jne 0x6902
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x186c7(%rip), %r12     # 0x1efd0
leaq 0xe710(%rip), %r14      # 0x15020
movq %r12, %rdi
movq %r14, %rsi
callq 0x3310
leaq 0xe8b6(%rip), %rsi      # 0x151d8
movq %rax, %rdi
callq 0x3310
movq %rax, %rdi
callq 0x3170
leaq 0xe91f(%rip), %rsi      # 0x15258
movq %r12, %rdi
callq 0x3310
movq %rax, %rdi
movq %r15, %rsi
callq 0x32b0
movq %rax, %rdi
callq 0x3170
leaq 0xe940(%rip), %rsi      # 0x1529b
movq %r12, %rdi
callq 0x3310
movq %rax, %rdi
movq %rbx, %rsi
callq 0x32b0
movq %rax, %rdi
movq %r14, %rsi
callq 0x3310
movq %rax, %rdi
callq 0x3170
movl $0x1, %edi
callq 0x3370
// File: /workspace/github_cpp_makefile_star2_O3/IlyaSamoylov45[P]MapReduce-Project/main.cpp
// Function: check_file(char*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void check_file(char* filename, std::string correct){
  struct stat test;
  if (stat(filename, &test) != 0) {
    std::cout << "\n" << "Usage is: --app [wordcount, sort] --impl [procs, threads] --maps num_maps --reduces num_reduces --input infile --output outfile" << std::endl;
    std::cout << "Error was in the argument " << correct << std::endl;
    std::cout << "Error was:" << strerror(errno) << std::endl;
    std::cout << "You wrote: " << filename << "\n" << std::endl;
    exit(EXIT_FAILURE);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x90, %rsp
movq %rsi, %r12
movq %rdi, %rbx
leaq -0xb0(%rbp), %rsi
callq 0x32d0
testl %eax, %eax
jne 0x6c50
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x18379(%rip), %r15     # 0x1efd0
leaq 0xe3c2(%rip), %r14      # 0x15020
movq %r15, %rdi
movq %r14, %rsi
callq 0x3310
leaq 0xe568(%rip), %rsi      # 0x151d8
movq %rax, %rdi
callq 0x3310
movq %rax, %rdi
callq 0x3170
leaq 0xe5d1(%rip), %rsi      # 0x15258
movq %r15, %rdi
callq 0x3310
movq %rax, %rdi
movq %r12, %rsi
callq 0x32b0
movq %rax, %rdi
callq 0x3170
leaq 0xe6fc(%rip), %rsi      # 0x153a5
movq %r15, %rdi
callq 0x3310
movq %rax, %r12
callq 0x3050
movl (%rax), %edi
callq 0x30f0
movq %r12, %rdi
movq %rax, %rsi
callq 0x3310
movq %rax, %rdi
callq 0x3170
leaq 0xe5c1(%rip), %rsi      # 0x1529b
movq %r15, %rdi
callq 0x3310
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3310
movq %rax, %rdi
movq %r14, %rsi
callq 0x3310
movq %rax, %rdi
callq 0x3170
movl $0x1, %edi
callq 0x3370
// File: /workspace/github_cpp_makefile_star2_O3/aman-agrawal[P]Terminal-based-file-explorer/cursor_handle.cpp
// Function: cursor_handle(int&, int&)
int cursor_handle(int &x, int &y)
{
	printf("\033[%d;%dH",x,y) ; // going to x row y column
	char c;
	while(1)
{		c=getchar();
	if(c==65 && x>1) {
		//cursorup
		x--;
		mov(x,y);
	}

	else if(c==66) {
		//cursordown
		x++;
		mov(x,y);
	}		
		
	else if(c==68) {
		//cursorbackward
		return 3;
	}
	else if(c==67) {
		//cursorforward
		return 4;
	}
	else if(c==10) {
		//enter key is tapped
		return 1;
	}
	else if(c=='h'|| c=='H') {
		//home key is pressed
		return 2;
	}
	else if(c==127) {
		//backspace key is pressed
		return 5;
	}
	else if(c==':') {
		//colon is pressed
		return 6;
	}

	return -1;
		
}

}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl (%rdi), %esi
movl (%rbx), %edx
leaq 0x3ee4(%rip), %rdi      # 0x807b
xorl %eax, %eax
callq 0x3040
callq 0x32b0
movl %eax, %edx
shll $0x18, %edx
cmpl $0x41ffffff, %edx       # imm = 0x41FFFFFF
jle 0x41cf
cmpl $0x42000000, %edx       # imm = 0x42000000
je 0x421a
cmpl $0x43000000, %edx       # imm = 0x43000000
je 0x4239
movl $0x3, %ecx
cmpl $0x44000000, %edx       # imm = 0x44000000
je 0x4245
jmp 0x41eb
cmpl $0xa000000, %edx        # imm = 0xA000000
je 0x4240
cmpl $0x41000000, %edx       # imm = 0x41000000
jne 0x41eb
movl (%r14), %esi
cmpl $0x2, %esi
jl 0x41eb
decl %esi
jmp 0x421f
andl $0xdf, %eax
movl $0x2, %ecx
cmpl $0x48, %eax
je 0x4245
xorl %eax, %eax
cmpl $0x3a000000, %edx       # imm = 0x3A000000
setne %al
negl %eax
orl $0x6, %eax
cmpl $0x7f000000, %edx       # imm = 0x7F000000
movl $0x5, %ecx
cmovnel %eax, %ecx
jmp 0x4245
movl (%r14), %esi
incl %esi
movl %esi, (%r14)
movl (%rbx), %edx
leaq 0x3e50(%rip), %rdi      # 0x807b
xorl %eax, %eax
callq 0x3040
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
jmp 0x4245
movl $0x4, %ecx
jmp 0x4245
movl $0x1, %ecx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/aman-agrawal[P]Terminal-based-file-explorer/keyboard.cpp
// Function: off_keyboard()
void off_keyboard()
{
tcgetattr(0,&initial_settings);
new_settings = initial_settings;
new_settings.c_lflag &= ~ICANON;
new_settings.c_lflag &= ~ECHO;
tcsetattr(0, TCSANOW, &new_settings);
}

// Assembly:
pushq %rax
leaq 0x6fe0(%rip), %rsi      # 0xb238
xorl %edi, %edi
callq 0x3250
movups 0x6fd2(%rip), %xmm0     # 0xb238
movups %xmm0, 0x7007(%rip)     # 0xb274
movups 0x6fd4(%rip), %xmm0     # 0xb248
movups %xmm0, 0x7009(%rip)     # 0xb284
movups 0x6fd6(%rip), %xmm0     # 0xb258
movups %xmm0, 0x700b(%rip)     # 0xb294
movups 0x6fd4(%rip), %xmm0     # 0xb264
movups %xmm0, 0x7009(%rip)     # 0xb2a0
andb $-0xb, 0x6fe2(%rip)     # 0xb280
leaq 0x6fcf(%rip), %rdx      # 0xb274
xorl %edi, %edi
xorl %esi, %esi
popq %rax
jmp 0x32a0
// File: /workspace/github_cpp_makefile_star2_O3/aman-agrawal[P]Terminal-based-file-explorer/aman.cpp
// Function: mycwd[abi:cxx11]()
string mycwd() {

    char cwd[1000];
   if (getcwd(cwd, sizeof(cwd)) != NULL)
   {
        string ans=cwd;
       return ans;
   }
   else
    return "error";
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x3e8, %rsp            # imm = 0x3E8
movq %rdi, %rbx
movq %rsp, %rdi
movl $0x3e8, %esi            # imm = 0x3E8
callq 0x3130
leaq 0x10(%rbx), %rcx
movq %rcx, (%rbx)
testq %rax, %rax
je 0x4331
movq %rsp, %r14
movq %r14, %rdi
callq 0x3100
leaq (%rsp,%rax), %rdx
movq %rbx, %rdi
movq %r14, %rsi
jmp 0x4342
leaq 0x3d82(%rip), %rsi      # 0x80ba
leaq 0x3d80(%rip), %rdx      # 0x80bf
movq %rbx, %rdi
callq 0x3e0a
movq %rbx, %rax
addq $0x3e8, %rsp            # imm = 0x3E8
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/aman-agrawal[P]Terminal-based-file-explorer/aman.cpp
// Function: copyfile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void copyfile(string a,string b){       //copy files

    ifstream f1;
    f1.open(a);

    if(!f1){
        cout<<"error in read file";
        return;
    }
    ofstream f2;
    f2.open(b);


    if(!f2){
        cout<<"error";
        return;
    }

    char line[80];

    while(f1.good()) {
        f1.getline(line, 80);
        f2 << line;
        f2 << endl;
    }
    f1.close();
    f2.close();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x460, %rsp            # imm = 0x460
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x208(%rsp), %r15
movq %r15, %rdi
callq 0x3260
movq %r15, %rdi
movq %rbx, %rsi
movl $0x8, %edx
callq 0x31c0
movq 0x208(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x228(%rsp,%rax)
je 0x43ba
movq 0x6c2c(%rip), %rdi      # 0xafd0
leaq 0x3d15(%rip), %rsi      # 0x80c0
movl $0x12, %edx
callq 0x3270
jmp 0x44de
leaq 0x8(%rsp), %rdi
callq 0x3390
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
movl $0x10, %edx
callq 0x3120
movq 0x8(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x28(%rsp,%rax)
je 0x4406
movq 0x6be0(%rip), %rdi      # 0xafd0
leaq 0x3cc3(%rip), %rsi      # 0x80ba
movl $0x5, %edx
callq 0x3270
jmp 0x44ac
leaq 0x208(%rsp), %r14
leaq 0x410(%rsp), %r15
movq 0x208(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x228(%rsp,%rax)
jne 0x4495
leaq (%rsp,%rax), %rdi
addq $0x208, %rdi            # imm = 0x208
movl $0xa, %esi
callq 0x3200
movsbl %al, %ecx
movl $0x50, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x33f0
movq %r15, %rdi
callq 0x3100
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x3270
movq 0x8(%rsp), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3200
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3160
jmp 0x4416
leaq 0x208(%rsp), %rdi
callq 0x3070
leaq 0x8(%rsp), %rdi
callq 0x32c0
movq 0x6b0d(%rip), %rax      # 0xafc0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x10(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x8(%rsp,%rcx)
callq 0x31a0
leaq 0x100(%rsp), %rdi
callq 0x30c0
leaq 0x208(%rsp), %rdi
callq 0x3080
addq $0x460, %rsp            # imm = 0x460
popq %rbx
popq %r14
popq %r15
retq
jmp 0x4503
jmp 0x44fe
jmp 0x4503
movq %rax, %rbx
jmp 0x4510
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x32e0
leaq 0x208(%rsp), %rdi
callq 0x3080
movq %rbx, %rdi
callq 0x33a0
// File: /workspace/github_cpp_makefile_star2_O3/ashlall[P]StreamStats/ChiSquareExperiments/./DataGenerator.cpp
// Function: DataGenerator::get_stat_one_sample(int, double*, double*)
double DataGenerator::get_stat_one_sample(int num_buckets, double *upper_intervals, double *lower_intervals)
{
  if (num_buckets <= 0)
    throw ParameterError();
  double expected = (double)stream_size / num_buckets;
  double chi_squared = 0;
  for (int i = 1; i <= num_buckets; i++)
  { 
    double observed = 0;
    for (int j = 0; j < stream_size; j++)
    {
      if (stream[j] <= upper_intervals[i] && stream[j] > lower_intervals[i])
	observed++;
    }
    chi_squared += (observed - expected) * (observed - expected) / expected;
  }
  return chi_squared;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testl %esi, %esi
jle 0x27b1
movl 0x8(%rdi), %eax
cvtsi2sd %eax, %xmm1
cvtsi2sd %esi, %xmm0
divsd %xmm0, %xmm1
movq (%rdi), %rdi
incl %esi
xorpd %xmm0, %xmm0
movl $0x1, %r8d
movsd 0x68a2(%rip), %xmm2     # 0x9008
xorpd %xmm3, %xmm3
testl %eax, %eax
jle 0x2797
movsd (%rdx,%r8,8), %xmm4
xorl %r9d, %r9d
movsd (%rdi,%r9,8), %xmm5
ucomisd %xmm5, %xmm4
jb 0x278f
ucomisd (%rcx,%r8,8), %xmm5
jbe 0x278f
addsd %xmm2, %xmm3
incq %r9
cmpq %r9, %rax
jne 0x2777
subsd %xmm1, %xmm3
mulsd %xmm3, %xmm3
divsd %xmm1, %xmm3
addsd %xmm3, %xmm0
incq %r8
cmpq %rsi, %r8
jne 0x2766
popq %rbp
retq
movl $0x1, %edi
callq 0x2100
leaq 0xa4b6(%rip), %rsi      # 0xcc78
movq %rax, %rdi
xorl %edx, %edx
callq 0x2330
// File: /workspace/github_cpp_makefile_star2_O3/ashlall[P]StreamStats/ChiSquareExperiments/./DataGenerator.cpp
// Function: DataGenerator::get_stat_two_sample(DataGenerator const&, int, double*, double*)
double DataGenerator::get_stat_two_sample(const DataGenerator& other, int num_buckets, double *upper_intervals, double *lower_intervals)
{
  if (num_buckets <= 0)
    throw ParameterError();
  double *stream2 = other.stream;
  int stream2_size = other.stream_size;
  double constant_1 = sqrt((double)stream2_size/stream_size);
  double constant_2 = sqrt((double)stream_size/stream2_size);
  double chi_squared = 0;
  for (int i = 0; i < num_buckets; i++)
  {
    double frequency1 = 0, frequency2 = 0;
    for (int j = 0; j < stream_size; j++)
    {
      if (stream[j] <= upper_intervals[i+1] && stream[j] > lower_intervals[i+1])
	frequency1++;
    }
    for (int j = 0; j < stream2_size; j++)
    {
      if (stream2[j] <= upper_intervals[i+1] && stream2[j] > lower_intervals[i+1])
	frequency2++;
    }
    double lambda = frequency1 * constant_1 - frequency2 * constant_2;
    chi_squared += (lambda * lambda) / (frequency1 + frequency2);
  }
  return chi_squared;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testl %edx, %edx
jle 0x291f
movq %r8, %rbx
movq %rcx, %r14
movq %rdi, %r12
movl 0x8(%rsi), %r13d
cvtsi2sd %r13d, %xmm2
movq (%rsi), %r15
cvtsi2sdl 0x8(%rdi), %xmm1
movapd %xmm2, %xmm0
divsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
movl %edx, -0x2c(%rbp)
jb 0x281a
sqrtsd %xmm0, %xmm7
jmp 0x2831
movsd %xmm2, -0x38(%rbp)
callq 0x2190
xorpd %xmm1, %xmm1
movsd -0x38(%rbp), %xmm2
movapd %xmm0, %xmm7
xorps %xmm0, %xmm0
cvtsi2sdl 0x8(%r12), %xmm0
divsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jb 0x284b
sqrtsd %xmm0, %xmm0
jmp 0x285a
movsd %xmm7, -0x38(%rbp)
callq 0x2190
movsd -0x38(%rbp), %xmm7
movl -0x2c(%rbp), %edx
movl 0x8(%r12), %eax
movq (%r12), %rcx
movl %edx, %edx
xorpd %xmm1, %xmm1
xorl %esi, %esi
movsd 0x6792(%rip), %xmm2     # 0x9008
xorpd %xmm3, %xmm3
testl %eax, %eax
jle 0x28a6
movsd 0x8(%r14,%rsi,8), %xmm4
xorl %edi, %edi
movsd (%rcx,%rdi,8), %xmm5
ucomisd %xmm5, %xmm4
jb 0x289e
ucomisd 0x8(%rbx,%rsi,8), %xmm5
jbe 0x289e
addsd %xmm2, %xmm3
incq %rdi
cmpq %rdi, %rax
jne 0x2887
incq %rsi
testl %r13d, %r13d
jle 0x28db
movsd (%r14,%rsi,8), %xmm5
xorpd %xmm4, %xmm4
xorl %edi, %edi
movsd (%r15,%rdi,8), %xmm6
ucomisd %xmm6, %xmm5
jb 0x28d1
ucomisd (%rbx,%rsi,8), %xmm6
jbe 0x28d1
addsd %xmm2, %xmm4
incq %rdi
cmpq %rdi, %r13
jne 0x28ba
jmp 0x28df
xorpd %xmm4, %xmm4
movapd %xmm0, %xmm5
mulsd %xmm4, %xmm5
movapd %xmm3, %xmm6
mulsd %xmm7, %xmm6
subsd %xmm5, %xmm6
mulsd %xmm6, %xmm6
addsd %xmm4, %xmm3
divsd %xmm3, %xmm6
addsd %xmm6, %xmm1
cmpq %rdx, %rsi
jne 0x2876
movapd %xmm1, %xmm0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %edi
callq 0x2100
leaq 0xa348(%rip), %rsi      # 0xcc78
movq %rax, %rdi
xorl %edx, %edx
callq 0x2330
// File: /workspace/github_cpp_makefile_star2_O3/ashlall[P]StreamStats/ChiSquareExperiments/./../SourceCode/ChiSquare/../Quantiles/QuantileSketch.h
// Function: QuantileSketch::reverseQuantile(double, int)
double QuantileSketch::reverseQuantile(double r, int n)
{
  int lo=0, hi= n;
  while (lo < hi)
  {
    int mid = (lo+hi)/2;
    double value = getQuantile(((double)mid)/n);
    if (value < r)
      lo = mid+1;
    else
      hi = mid;
  }
  return lo;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movsd %xmm0, -0x30(%rbp)
testl %esi, %esi
jle 0x29a8
movl %esi, %ebx
movq %rdi, %r14
xorps %xmm0, %xmm0
cvtsi2sd %esi, %xmm0
movsd %xmm0, -0x28(%rbp)
xorl %r15d, %r15d
leal (%r15,%rbx), %r12d
shrl %r12d
xorps %xmm0, %xmm0
cvtsi2sd %r12d, %xmm0
divsd -0x28(%rbp), %xmm0
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
movsd -0x30(%rbp), %xmm1
ucomisd %xmm0, %xmm1
ja 0x2993
movl %r12d, %ebx
jmp 0x2999
incl %r12d
movl %r12d, %r15d
cmpl %ebx, %r15d
jl 0x2966
xorps %xmm0, %xmm0
cvtsi2sd %r15d, %xmm0
jmp 0x29ac
xorpd %xmm0, %xmm0
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/ashlall[P]StreamStats/ChiSquareExperiments/./../SourceCode/ChiSquare/../Quantiles/GK.cpp
// Function: GK::GK(int)
GK::GK(int maxTuples)
{
	num_tuples=0;
	num_observations=0;
	max=maxTuples;
	summary=new Tuple*[maxTuples];
	for (int i = 0; i < max; i++)
		summary[i] = NULL;
	stream_size =0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
leaq 0xa2c7(%rip), %rax      # 0xcc98
movq %rax, (%rdi)
movl $0x0, 0x18(%rdi)
movq $0x0, 0x20(%rdi)
movl %esi, 0x8(%rdi)
movl %esi, %r15d
leaq (,%r15,8), %rax
testl %esi, %esi
movq $-0x1, %rdi
cmovnsq %rax, %rdi
callq 0x2030
movq %rax, 0x10(%rbx)
testl %r14d, %r14d
jle 0x2a22
xorl %eax, %eax
movq 0x10(%rbx), %rcx
movq $0x0, (%rcx,%rax,8)
incq %rax
cmpq %rax, %r15
jne 0x2a0e
movq $0x0, 0x28(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/ashlall[P]StreamStats/ChiSquareExperiments/./../SourceCode/ChiSquare/../Quantiles/GK.cpp
// Function: GK::insert(double)
void GK::insert(double val)
{ 
	stream_size +=1; 
	int index= find_index(val);
	if(summary[index]==NULL)
	{
		insert_tuple(new Tuple(val),index); 
	}
	else
	{
		double store=summary[index]->g+summary[index]->delta-1; 
		insert_tuple(new Tuple(val,1.0,store),index);
	}
	if(num_tuples==max)
		delete_merge();
	num_observations++;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
incq 0x28(%rdi)
movl 0x18(%rdi), %r12d
movq 0x10(%rdi), %rax
movl %r12d, %ecx
testl %r12d, %r12d
jle 0x2ae0
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl %r12d, %ecx
leal (%rdx,%rcx), %edi
movl %edi, %esi
shrl $0x1f, %esi
addl %edi, %esi
sarl %esi
movslq %esi, %rdi
movq (%rax,%rdi,8), %rdi
movsd (%rdi), %xmm1
ucomisd %xmm0, %xmm1
ja 0x2ad5
movl %esi, %edx
jmp 0x2ad7
movl %esi, %ecx
movl %ecx, %esi
subl %edx, %esi
cmpl $0x1, %esi
jg 0x2ab4
movslq %ecx, %r13
leaq (%rax,%r13,8), %r14
movq (%r14), %rax
testq %rax, %rax
movsd %xmm0, -0x38(%rbp)
je 0x2b08
movsd 0x8(%rax), %xmm0
addsd 0x10(%rax), %xmm0
addsd 0x6512(%rip), %xmm0     # 0x9018
jmp 0x2b0c
xorpd %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
movl $0x18, %edi
callq 0x2220
movq %rax, %r15
movsd -0x38(%rbp), %xmm0
movsd %xmm0, (%rax)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x8(%r15)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, 0x10(%r15)
subl %r13d, %r12d
shll $0x3, %r12d
leaq 0x8(%r14), %rdi
movslq %r12d, %rdx
movq %r14, %rsi
callq 0x22e0
movq 0x10(%rbx), %rax
movq %r15, (%rax,%r13,8)
movl 0x18(%rbx), %eax
incl %eax
movl %eax, 0x18(%rbx)
cmpl 0x8(%rbx), %eax
jne 0x2b73
movq %rbx, %rdi
callq 0x2c16
incq 0x20(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/ashlall[P]StreamStats/ChiSquareExperiments/./../SourceCode/ChiSquare/../Quantiles/GK.cpp
// Function: GK::find_index(double)
int GK::find_index(double val)
{
	int high= num_tuples;int low=-1,mid;
	while(high-low >1)
	{
		mid=(high+low)/2;
		if(summary[mid]->v >val)
			high=mid;
		else
			low=mid;
	}
	return high;
}

// Assembly:
movl 0x18(%rdi), %eax
testl %eax, %eax
jle 0x2bc7
pushq %rbp
movq %rsp, %rbp
movq 0x10(%rdi), %rcx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
leal (%rax,%rdx), %edi
movl %edi, %esi
shrl $0x1f, %esi
addl %edi, %esi
sarl %esi
movslq %esi, %rdi
movq (%rcx,%rdi,8), %rdi
movsd (%rdi), %xmm1
ucomisd %xmm0, %xmm1
ja 0x2bbb
movl %esi, %edx
jmp 0x2bbd
movl %esi, %eax
movl %eax, %esi
subl %edx, %esi
cmpl $0x1, %esi
jg 0x2b9a
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/ashlall[P]StreamStats/ChiSquareExperiments/./../SourceCode/ChiSquare/../Quantiles/GK.cpp
// Function: GK::delete_merge()
void GK::delete_merge()
{	
	int leastIndex = 0;
	long leastFull= LLONG_MAX;
        for (int i = 1; i <num_tuples - 1; i++) 
        {
            long f = summary[i]->g + summary[i + 1]->g+summary[i + 1]->delta;   
            if ((summary[i]->delta >=summary[i + 1]->delta)
                    && (f < leastFull)) 
            {
                leastFull = f;
                leastIndex = i;
            }
        }
        if (leastIndex > 0) 
            delete_tuple(leastIndex);
}

// Assembly:
movl 0x18(%rdi), %eax
cmpl $0x3, %eax
jl 0x2c9d
pushq %rbp
movq %rsp, %rbp
decl %eax
movq 0x10(%rdi), %rcx
movq 0x8(%rcx), %rdx
movsd 0x8(%rdx), %xmm1
movsd 0x10(%rdx), %xmm0
movabsq $0x7fffffffffffffff, %rdx # imm = 0x7FFFFFFFFFFFFFFF
xorl %esi, %esi
movl $0x1, %r8d
movq 0x8(%rcx,%r8,8), %r9
movsd 0x8(%r9), %xmm2
movsd 0x10(%r9), %xmm3
addsd %xmm2, %xmm1
addsd %xmm3, %xmm1
cvttsd2si %xmm1, %r9
ucomisd %xmm3, %xmm0
setae %r10b
cmpq %r9, %rdx
setg %r11b
testb %r11b, %r10b
cmovnel %r8d, %esi
leaq 0x1(%r8), %r10
cmovneq %r9, %rdx
movapd %xmm3, %xmm0
movapd %xmm2, %xmm1
movq %r10, %r8
cmpq %r10, %rax
jne 0x2c48
testl %esi, %esi
popq %rbp
jg 0x2c9e
retq
// File: /workspace/github_cpp_makefile_star2_O3/ashlall[P]StreamStats/ChiSquareExperiments/./../SourceCode/ChiSquare/../Quantiles/GK.cpp
// Function: GK::delete_tuple(int)
void GK::delete_tuple(int index)
{	
        Tuple *hold  = summary[index];
	summary[index] = new Tuple(summary[index + 1]->v,
                summary[index]->g + summary[index + 1]->g,
                summary[index + 1]->delta);
        delete hold;
	delete summary[index+1];
        int size_of_pointer= sizeof(summary[0]);
        int total_size=size_of_pointer * (num_tuples-index-2);
        memmove(&(summary[index+1]),&(summary[index+2]),total_size);
	summary[num_tuples-1]=NULL;
	num_tuples--;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %r12
movslq %esi, %r15
movq (%r12,%r15,8), %r14
movl $0x18, %edi
callq 0x2220
movq 0x8(%r12,%r15,8), %rcx
movsd 0x8(%r14), %xmm0
addsd 0x8(%rcx), %xmm0
movsd (%rcx), %xmm1
movsd 0x10(%rcx), %xmm2
movsd %xmm1, (%rax)
movsd %xmm0, 0x8(%rax)
movsd %xmm2, 0x10(%rax)
movq %rax, (%r12,%r15,8)
movq %r14, %rdi
callq 0x21f0
movq 0x10(%rbx), %rax
movq 0x8(%rax,%r15,8), %rdi
callq 0x21f0
movl 0x18(%rbx), %eax
subl %r15d, %eax
leal -0x10(,%rax,8), %eax
movq 0x10(%rbx), %rcx
leaq (%rcx,%r15,8), %rdi
addq $0x8, %rdi
leaq (%rcx,%r15,8), %rsi
addq $0x10, %rsi
movslq %eax, %rdx
callq 0x22e0
movq 0x10(%rbx), %rax
movslq 0x18(%rbx), %rcx
movq $0x0, -0x8(%rax,%rcx,8)
leal -0x1(%rcx), %eax
movl %eax, 0x18(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/ashlall[P]StreamStats/ChiSquareExperiments/./../SourceCode/ChiSquare/../Quantiles/GK.cpp
// Function: GK::getQuantile(double)
double GK::getQuantile(double quant)
{
	long rank= (long) ceil(quant* num_observations);
	long current_rank=0;
	for (int i = 0; i < num_tuples - 1; i++)
	{
		current_rank +=summary[i]->g;
		if ((current_rank +summary[i + 1]->g) > rank)
            	    return summary[i]->v;
        }
        return summary[num_tuples - 1]->v;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cvtsi2sdq 0x20(%rdi), %xmm1
mulsd %xmm1, %xmm0
callq 0x2080
cvttsd2si %xmm0, %rcx
movslq 0x18(%rbx), %rax
xorps %xmm0, %xmm0
cvtsi2sd %rcx, %xmm0
cmpl $0x2, %eax
movl $0x1, %ecx
cmovgel %eax, %ecx
movq 0x10(%rbx), %rdx
decl %ecx
xorl %esi, %esi
xorl %edi, %edi
cmpq %rsi, %rcx
je 0x2dc4
movq (%rdx,%rsi,8), %r8
xorps %xmm1, %xmm1
cvtsi2sd %rdi, %xmm1
addsd 0x8(%r8), %xmm1
cvttsd2si %xmm1, %rdi
movq 0x8(%rdx,%rsi,8), %r9
xorps %xmm1, %xmm1
cvtsi2sd %rdi, %xmm1
incq %rsi
addsd 0x8(%r9), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x2d8a
jmp 0x2dc9
movq -0x8(%rdx,%rax,8), %r8
movsd (%r8), %xmm0
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/ashlall[P]StreamStats/ChiSquareExperiments/./../SourceCode/ChiSquare/../Quantiles/ReservoirSampling.cpp
// Function: ReservoirSampling::insert(double)
void ReservoirSampling::insert(double value)
{
  stream_size += 1; //incrementing the size of the stream as a new element is inserted
  if (stream_size <= sample_size) //Checking if stream size is less than random sample size
    array[stream_size - 1] = value;
  else if ((rand() % stream_size + 1) <= sample_size)
    array[(rand() % sample_size)] = value;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl 0x8(%rdi), %edx
leal 0x1(%rdx), %eax
movl %eax, 0x8(%rdi)
cmpl 0xc(%rdi), %edx
jge 0x2f00
movq 0x10(%rbx), %r14
jmp 0x2f25
movsd %xmm0, -0x18(%rbp)
callq 0x2090
cltd
idivl 0x8(%rbx)
cmpl 0xc(%rbx), %edx
jge 0x2f2e
movq 0x10(%rbx), %r14
callq 0x2090
cltd
idivl 0xc(%rbx)
movsd -0x18(%rbp), %xmm0
movslq %edx, %rax
movsd %xmm0, (%r14,%rax,8)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/ashlall[P]StreamStats/ChiSquareExperiments/./../SourceCode/ChiSquare/../Quantiles/ReservoirSampling.cpp
// Function: ReservoirSampling::getQuantile(double)
double ReservoirSampling::getQuantile(double fraction)
{
  sort(array, array + sample_size); // sorting from range s to s+k
  if (fraction >= 1) 
    return array[sample_size - 1];// if f is greater than one
  else if (fraction < 0) 
    return array[0];//if f is less than 1
  else
    return array[(int)(fraction * sample_size)]; //if f is between 0 and 1. 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq 0xc(%rdi), %rax
testq %rax, %rax
je 0x2f83
movq 0x10(%rbx), %r14
leaq (%r14,%rax,8), %r15
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r14, %rdi
movq %r15, %rsi
movsd %xmm0, -0x20(%rbp)
callq 0x6f48
movq %r14, %rdi
movq %r15, %rsi
callq 0x7032
movsd -0x20(%rbp), %xmm0
ucomisd 0x607d(%rip), %xmm0     # 0x9008
jae 0x2fb4
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
movq 0x10(%rbx), %rax
ja 0x2fc4
xorps %xmm1, %xmm1
cvtsi2sdl 0xc(%rbx), %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %ecx
movslq %ecx, %rcx
leaq (%rax,%rcx,8), %rax
jmp 0x2fc4
movq 0x10(%rbx), %rax
movslq 0xc(%rbx), %rcx
leaq (%rax,%rcx,8), %rax
addq $-0x8, %rax
movsd (%rax), %xmm0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/ashlall[P]StreamStats/ChiSquareExperiments/./../SourceCode/ChiSquare/../Quantiles/Q-Digest.cpp
// Function: QDigest::QDigest(double)
QDigest::QDigest(double compression)
{
  compression_factor = compression; 
  capacity = 1;
  size = 0;
  stream_size = 0;
  min = MAX_VALUE;
  max = -MAX_VALUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x9d09(%rip), %rax      # 0xcce8
movq %rax, (%rdi)
leaq 0x38(%rdi), %rax
movq %rax, 0x8(%rdi)
movl $0x1, %eax
movq %rax, 0x10(%rdi)
xorps %xmm1, %xmm1
movups %xmm1, 0x18(%rdi)
movl $0x3f800000, 0x28(%rdi) # imm = 0x3F800000
movups %xmm1, 0x30(%rdi)
movsd %xmm0, 0x60(%rdi)
movq %rax, 0x48(%rdi)
xorl %eax, %eax
movq %rax, 0x40(%rdi)
movq %rax, 0x68(%rdi)
movq $0x3b9aca00, 0x50(%rdi) # imm = 0x3B9ACA00
movq $-0x3b9aca00, 0x58(%rdi) # imm = 0xC4653600
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/ashlall[P]StreamStats/ChiSquareExperiments/./../SourceCode/ChiSquare/../Quantiles/Q-Digest.cpp
// Function: QDigest::copy(QDigest const&)
void QDigest::copy(const QDigest& other)
{
  node2count = other.node2count;
  compression_factor = other.compression_factor;
  capacity = other.capacity;
  size = other.size;
  min = other.min;
  max = other.max;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
cmpq %rdi, %rsi
je 0x309d
leaq 0x8(%rbx), %rdi
leaq 0x8(%r14), %rsi
callq 0x693e
movsd 0x60(%r14), %xmm0
movsd %xmm0, 0x60(%rbx)
movq 0x48(%r14), %rax
movq %rax, 0x48(%rbx)
movq 0x40(%r14), %rax
movq %rax, 0x40(%rbx)
movq 0x50(%r14), %rax
movq %rax, 0x50(%rbx)
movq 0x58(%r14), %rax
movq %rax, 0x58(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/ashlall[P]StreamStats/ChiSquareExperiments/./../SourceCode/ChiSquare/../Quantiles/Q-Digest.cpp
// Function: QDigest::insert(double)
void QDigest::insert(double value)
{
  stream_size += 1;
  if (value < min)
    min = value;
  if (value > max)
    max = value;
  offer(value);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
incq 0x68(%rdi)
cvtsi2sdq 0x50(%rdi), %xmm1
ucomisd %xmm0, %xmm1
cvttsd2si %xmm0, %rsi
jbe 0x3103
movq %rsi, 0x50(%rdi)
xorps %xmm1, %xmm1
cvtsi2sdq 0x58(%rdi), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x3116
movq %rsi, 0x58(%rdi)
popq %rbp
jmp 0x311c
// File: /workspace/github_cpp_makefile_star2_O3/ashlall[P]StreamStats/ChiSquareExperiments/./../SourceCode/ChiSquare/../Quantiles/Q-Digest.cpp
// Function: QDigest::offer(long)
void QDigest::offer(long value)
{
  if (value < 0 || value == MAX_VALUE)
  {
    try 
    {
      throw value;
    }
    catch (long value)
    {
      cout << "Can only accept values in the range 0.. " <<  MAX_VALUE - 1 << endl;
    }  
  }
	
  // Rebuild if the value is too large for the current tree height
  if (value >= capacity)
    rebuildToCapacity(highestOneBit(value) << 1);   
		
 long leaf = value2leaf(value);
 if (node2count.find(leaf) == node2count.end())
   node2count.insert(std::make_pair (leaf, get(leaf)+1));
 else
   node2count[leaf] += 1;   
 size++;

 //Always compress at the inserted node, and recompress fully
 //if the tree becomes too large.
 compressUpward(leaf);
 if (node2count.size() > 3 * compression_factor) 
   compressFully();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
testq %rsi, %rsi
js 0x324a
cmpq $0x3b9aca00, %r14       # imm = 0x3B9ACA00
je 0x324a
movq 0x48(%rbx), %rax
cmpq %r14, %rax
jg 0x318b
movq %r14, %rsi
testq %r14, %r14
je 0x317f
cmpq $0x1, %r14
jne 0x3163
movl $0x2, %esi
jmp 0x317f
movl $0x1, %edx
movq %r14, %rcx
movl %edx, %eax
sarq %rcx
leal (%rax,%rax), %edx
cmpq $0x2, %rcx
jae 0x316b
shll $0x2, %eax
movslq %eax, %rsi
movq %rbx, %rdi
callq 0x358e
movq 0x48(%rbx), %rax
addq %r14, %rax
leaq -0x20(%rbp), %rsi
movq %rax, (%rsi)
leaq 0x8(%rbx), %r14
movq %r14, %rdi
callq 0x7330
testq %rax, %rax
je 0x31b7
leaq -0x20(%rbp), %rsi
movq %r14, %rdi
callq 0x7630
incq (%rax)
jmp 0x31f4
movq -0x20(%rbp), %rax
leaq -0x30(%rbp), %rsi
movq %rax, (%rsi)
movq %r14, %rdi
callq 0x7330
testq %rax, %rax
je 0x31d8
movq 0x10(%rax), %rax
incq %rax
jmp 0x31dd
movl $0x1, %eax
movq -0x20(%rbp), %rcx
leaq -0x30(%rbp), %rsi
movq %rcx, (%rsi)
movq %rax, 0x8(%rsi)
movq %r14, %rdi
callq 0x7392
incq 0x40(%rbx)
movq -0x20(%rbp), %rsi
movq %rbx, %rdi
callq 0x37c0
movsd 0x20(%rbx), %xmm0
unpcklps 0x5f90(%rip), %xmm0     # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x5f98(%rip), %xmm0     # 0x91b0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movsd 0x60(%rbx), %xmm0
mulsd 0x5def(%rip), %xmm0     # 0x9020
ucomisd %xmm0, %xmm1
jbe 0x323f
movq %rbx, %rdi
callq 0x3956
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x8, %edi
callq 0x2100
movq %r14, (%rax)
movq 0x9d82(%rip), %rsi      # 0xcfe0
movq %rax, %rdi
xorl %edx, %edx
callq 0x2330
movq %rax, %r15
cmpl $0x1, %edx
jne 0x32bb
movq %r15, %rdi
callq 0x20d0
movq 0x9d51(%rip), %rdi      # 0xcfd0
leaq 0x5ff7(%rip), %rsi      # 0x927d
movl $0x28, %edx
callq 0x2230
movq 0x9d39(%rip), %rdi      # 0xcfd0
movl $0x3b9ac9ff, %esi       # imm = 0x3B9AC9FF
callq 0x2340
movq %rax, %rdi
callq 0x20f0
callq 0x2300
jmp 0x3145
movq %rax, %r15
callq 0x2300
movq %r15, %rdi
callq 0x2360
nop
// File: /workspace/github_cpp_makefile_star2_O3/ashlall[P]StreamStats/ChiSquareExperiments/./../SourceCode/ChiSquare/../Quantiles/Q-Digest.cpp
// Function: QDigest::getQuantile(double)
double QDigest::getQuantile(double fraction)
{
  // throw exception if fraction < 0 || fraction > 1 ??
  std::vector<long*> ranges = toAscRanges();
  long sum = 0;
  for (int i = 0; i < ranges.size(); i++)
  {
    if (sum > fraction * size)
      return clamp(ranges[i][1]);
    sum += ranges[i][2];
  }
  double value = ranges[ranges.size() - 1][1];
  delete_ranges(ranges);
  return clamp(value);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
movsd %xmm0, -0x20(%rbp)
movq %rdi, %rbx
leaq -0x50(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3416
movq (%r14), %rdi
movq 0x8(%r14), %rax
subq %rdi, %rax
je 0x3337
movq %rax, %rcx
sarq $0x3, %rcx
xorps %xmm0, %xmm0
cvtsi2sdq 0x40(%rbx), %xmm0
mulsd -0x20(%rbp), %xmm0
cmpq $0x1, %rcx
adcq $0x0, %rcx
xorl %edx, %edx
xorl %esi, %esi
xorps %xmm1, %xmm1
cvtsi2sd %rsi, %xmm1
ucomisd %xmm0, %xmm1
movq (%rdi,%rdx,8), %r8
ja 0x33ca
addq 0x10(%r8), %rsi
incq %rdx
cmpq %rdx, %rcx
jne 0x3315
movq -0x8(%rdi,%rax), %rax
movq 0x8(%rax), %r14
leaq -0x38(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x6780
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rcx
cmpq %rdi, %rcx
je 0x3388
xorl %r15d, %r15d
movq (%rdi,%r15,8), %rax
testq %rax, %rax
je 0x3376
movq %rax, %rdi
callq 0x2260
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rcx
incq %r15
movq %rcx, %rax
subq %rdi, %rax
sarq $0x3, %rax
cmpq %r15, %rax
ja 0x335d
xorps %xmm0, %xmm0
cvtsi2sd %r14, %xmm0
testq %rdi, %rdi
je 0x33a4
movsd %xmm0, -0x20(%rbp)
callq 0x21f0
movsd -0x20(%rbp), %xmm0
cvttsd2si %xmm0, %rax
movq 0x50(%rbx), %rcx
movq 0x58(%rbx), %r14
cmpq %rax, %r14
cmovgeq %rax, %r14
cmpq %rax, %rcx
cmovgq %rcx, %r14
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
jne 0x33e4
jmp 0x33e9
movq 0x8(%r8), %rax
movq 0x58(%rbx), %r14
cmpq %rax, %r14
cmovgeq %rax, %r14
movq 0x50(%rbx), %rcx
cmpq %rax, %rcx
cmovgq %rcx, %r14
callq 0x21f0
xorps %xmm0, %xmm0
cvtsi2sd %r14, %xmm0
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x340d
callq 0x21f0
movq %rbx, %rdi
callq 0x2360
nop
// File: /workspace/github_cpp_makefile_star2_O3/ashlall[P]StreamStats/ChiSquareExperiments/./../SourceCode/ChiSquare/../Quantiles/Q-Digest.cpp
// Function: QDigest::toAscRanges()
std::vector<long*> QDigest::toAscRanges()
{
  std::vector<long*> ranges;
  for (std::unordered_map<long, long>::const_iterator i = node2count.begin(); i != node2count.end(); i++)
  {
    long *next_range = new long[3];
    next_range[0] = rangeLeft(i->first);
    next_range[1] = rangeRight(i->first);
    next_range[2] = i->second;
    ranges.push_back(next_range);
  }
 std::sort(ranges.begin(), ranges.end(), compare_ranges);
 return ranges;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq 0x18(%rsi), %r12
testq %r12, %r12
je 0x3502
movq %rsi, %r14
leaq -0x28(%rbp), %r15
movl $0x18, %edi
callq 0x2030
movq %rax, -0x28(%rbp)
movq 0x8(%r12), %rdx
movq 0x48(%r14), %rcx
movq %rdx, %rsi
addq %rdx, %rdx
subq %rcx, %rsi
jl 0x3461
movq %rsi, (%rax)
movq 0x8(%r12), %rdx
cmpq %rdx, %rcx
jle 0x3483
leaq 0x1(,%rdx,2), %rdx
jmp 0x3474
subq %rcx, %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%r12), %rcx
movq %rcx, 0x10(%rax)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x34a7
movq %rax, (%rsi)
addq $0x8, 0x8(%rbx)
jmp 0x34b2
movq %rbx, %rdi
movq %r15, %rdx
callq 0x7c92
movq (%r12), %r12
testq %r12, %r12
jne 0x344a
movq (%rbx), %r14
movq 0x8(%rbx), %r15
cmpq %r15, %r14
je 0x3502
movq %r15, %rax
subq %r14, %rax
sarq $0x3, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
leaq 0x7c5(%rip), %rcx       # 0x3caa
movq %r14, %rdi
movq %r15, %rsi
callq 0x7dae
leaq 0x7b3(%rip), %rdx       # 0x3caa
movq %r14, %rdi
movq %r15, %rsi
callq 0x7ed9
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3514
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x3524
callq 0x21f0
movq %r14, %rdi
callq 0x2360
// File: /workspace/github_cpp_makefile_star2_O3/ashlall[P]StreamStats/ChiSquareExperiments/./../SourceCode/ChiSquare/../Quantiles/Q-Digest.cpp
// Function: QDigest::highestOneBit(long)
int QDigest::highestOneBit(long value)
{
  if (!value)
    return 0;
  int ret = 1;
  while (value >>= 1)
    ret <<= 1;
  return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rsi, %rsi
je 0x378d
movl $0x1, %eax
cmpq $0x1, %rsi
je 0x378f
sarq %rsi
addl %eax, %eax
cmpq $0x2, %rsi
jae 0x3780
jmp 0x378f
xorl %eax, %eax
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/ashlall[P]StreamStats/ChiSquareExperiments/./../SourceCode/ChiSquare/../Quantiles/Q-Digest.cpp
// Function: QDigest::compressUpward(long)
void QDigest::compressUpward(long node)
{
  double threshold = std::floor(size / compression_factor);
  long atNode = get(node);
  while (!isRoot(node))
  {
    if (atNode > threshold)
      break;
    long atSibling = get(sibling(node));
    if (atNode + atSibling > threshold)
      break;
    long parent_ = parent(node);
    long atParent = get(parent_);
    if (atNode + atSibling + atParent > threshold)
      break;

    // restores property 2
    if (node2count.find(parent_) == node2count.end())
	node2count.insert(std::make_pair (parent_, atParent + atNode + atSibling));
    else
      {
	long hold = node2count[parent_];
	node2count[parent_] += 1;
      }
    node2count.erase(node);
    if (atSibling > 0)
      node2count.erase(sibling(node));
    node = parent_;
    atNode = atParent + atNode + atSibling;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r13
movq %rdi, %rbx
movq %rsi, -0x30(%rbp)
cvtsi2sdq 0x40(%rdi), %xmm0
divsd 0x60(%rdi), %xmm0
callq 0x2310
movsd %xmm0, -0x38(%rbp)
leaq -0x50(%rbp), %rsi
movq %r13, (%rsi)
addq $0x8, %rbx
movq %rbx, %rdi
callq 0x7330
testq %rax, %rax
je 0x380e
movq 0x10(%rax), %r12
jmp 0x3811
xorl %r12d, %r12d
cmpq $0x1, %r13
je 0x3947
xorps %xmm0, %xmm0
cvtsi2sd %r12, %xmm0
ucomisd -0x38(%rbp), %xmm0
ja 0x3947
leaq -0x50(%rbp), %r14
leaq -0x40(%rbp), %r15
movl %r13d, %eax
andl $0x1, %eax
negq %rax
orq $0x1, %rax
addq %r13, %rax
movq %rax, -0x50(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7330
testq %rax, %rax
je 0x3860
movq 0x10(%rax), %r13
jmp 0x3863
xorl %r13d, %r13d
addq %r13, %r12
xorps %xmm0, %xmm0
cvtsi2sd %r12, %xmm0
ucomisd -0x38(%rbp), %xmm0
ja 0x3947
movq -0x30(%rbp), %rax
movq %rax, %rcx
shrq $0x3f, %rcx
addq %rax, %rcx
sarq %rcx
movq %rcx, -0x40(%rbp)
movq %rcx, -0x50(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7330
testq %rax, %rax
je 0x38a8
movq 0x10(%rax), %rax
jmp 0x38aa
xorl %eax, %eax
addq %rax, %r12
xorps %xmm0, %xmm0
cvtsi2sd %r12, %xmm0
ucomisd -0x38(%rbp), %xmm0
ja 0x3947
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7330
testq %rax, %rax
je 0x38eb
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7630
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7630
incq (%rax)
jmp 0x3902
movq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
movq %r12, -0x48(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7392
movq %rbx, %rdi
leaq -0x30(%rbp), %rsi
callq 0x7b9e
testq %r13, %r13
jle 0x3935
movq -0x30(%rbp), %rax
movl %eax, %ecx
andl $0x1, %ecx
negq %rcx
orq $0x1, %rcx
addq %rax, %rcx
movq %rcx, -0x50(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7b9e
movq -0x40(%rbp), %r13
movq %r13, -0x30(%rbp)
cmpq $0x1, %r13
jne 0x3836
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/ashlall[P]StreamStats/ChiSquareExperiments/./../SourceCode/ChiSquare/../Quantiles/Q-Digest.cpp
// Function: QDigest::compressFully()
void QDigest::compressFully()
{
  std::vector<long> keys;
  keys.reserve(node2count.size());
  for (std::unordered_map<long, long>::const_iterator i = node2count.begin(); i != node2count.end(); i++)
    keys.push_back(i->first);

  for (std::vector<long>::const_iterator i = keys.begin(); i != keys.end(); i++)
  {
    if (!isRoot(*i))
      compressDownward(*i);  
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq -0x30(%rbp), %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq 0x20(%rbx), %rsi
callq 0x6800
movq 0x18(%rbx), %r15
testq %r15, %r15
je 0x39bc
leaq -0x30(%rbp), %r14
leaq 0x8(%r15), %rdx
movq -0x28(%rbp), %rsi
cmpq -0x20(%rbp), %rsi
je 0x39ac
movq (%rdx), %rax
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, -0x28(%rbp)
jmp 0x39b4
movq %r14, %rdi
callq 0x770c
movq (%r15), %r15
testq %r15, %r15
jne 0x398e
movq -0x30(%rbp), %r14
movq -0x28(%rbp), %rax
cmpq %rax, %r14
je 0x39eb
movq (%r14), %rsi
cmpq $0x1, %rsi
je 0x39de
movq %rbx, %rdi
callq 0x3a20
movq -0x28(%rbp), %rax
addq $0x8, %r14
cmpq %rax, %r14
jne 0x39c9
movq -0x30(%rbp), %r14
testq %r14, %r14
je 0x39f8
movq %r14, %rdi
callq 0x21f0
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3a07
jmp 0x3a07
movq %rax, %rbx
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x3a18
callq 0x21f0
movq %rbx, %rdi
callq 0x2360
// File: /workspace/github_cpp_makefile_star2_O3/ashlall[P]StreamStats/ChiSquareExperiments/./../SourceCode/ChiSquare/../Quantiles/Q-Digest.cpp
// Function: QDigest::compare_ranges(long*, long*)
bool QDigest::compare_ranges(long a[3], long b[3])
{
  long rightA = a[1], rightB = b[1], sizeA = a[1] - a[0], sizeB = b[1] - b[0];
  if (rightA < rightB)
    return 1;
  else if (rightA > rightB)
    return 0;
  else if (sizeA < sizeB)
    return 1;
  else if (sizeA > sizeB)
    return 0;
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x8(%rdi), %rcx
movq 0x8(%rsi), %rdx
movb $0x1, %al
cmpq %rdx, %rcx
jl 0x3cd7
movq %rdx, %rax
subq (%rsi), %rax
movq %rcx, %rsi
subq (%rdi), %rsi
cmpq %rdx, %rcx
setle %cl
cmpq %rax, %rsi
setl %al
andb %cl, %al
popq %rbp
retq