LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x40, %rsp
movsd %xmm0, -0x18(%rbp)
movq %rdi, %rbx
leaq -0x30(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3224
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
movq %rcx, %rdx
cvtsi2sdq 0x40(%rbx), %xmm0
sarq $0x3, %rdx
mulsd -0x18(%rbp), %xmm0
xorl %esi, %esi
xorl %edi, %edi
cmpq %rsi, %rdx
je 0x3199
cvtsi2sd %rdi, %xmm1
ucomisd %xmm0, %xmm1
movq (%rax,%rsi,8), %r8
ja 0x31d5
addq 0x10(%r8), %rdi
incq %rsi
jmp 0x317c
movq -0x8(%rax,%rcx), %rax
movq 0x8(%rax), %r14
leaq -0x48(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x5c16
cvtsi2sd %r14, %xmm0
movsd %xmm0, -0x18(%rbp)
leaq -0x48(%rbp), %r14
movq %r14, %rsi
callq 0x32ee
movq %r14, %rdi
callq 0x69ae
cvttsd2si -0x18(%rbp), %rax
jmp 0x31d9
movq 0x8(%r8), %rax
movq 0x50(%rbx), %rcx
movq 0x58(%rbx), %rdx
cmpq %rax, %rdx
cmovgeq %rax, %rdx
cmpq %rax, %rcx
cmovgq %rcx, %rdx
cvtsi2sd %rdx, %xmm0
movsd %xmm0, -0x18(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x69ae
movsd -0x18(%rbp), %xmm0
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x69ae
movq %rbx, %rdi
callq 0x2320
// File: /workspace/github_cpp_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
andq $0x0, 0x10(%rdi)
movups %xmm0, (%rdi)
leaq 0x18(%rsi), %r15
leaq -0x30(%rbp), %r12
movq (%r15), %r15
testq %r15, %r15
je 0x3297
pushq $0x18
popq %rdi
callq 0x2030
movq %rax, %r13
movq %rax, -0x30(%rbp)
movq 0x8(%r15), %rsi
movq %r14, %rdi
callq 0x3892
movq %rax, (%r13)
movq 0x8(%r15), %rsi
movq %r14, %rdi
callq 0x38a8
movq %rax, 0x8(%r13)
movq 0x10(%r15), %rax
movq %rax, 0x10(%r13)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5d30
jmp 0x324b
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
leaq 0x61f(%rip), %rdx       # 0x38c4
callq 0x77a4
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x32be
movq %rax, %r14
movq %rbx, %rdi
callq 0x69ae
movq %r14, %rdi
callq 0x2320
nop
// File: /workspace/github_cpp_makefile_star2_O2/ashlall[P]StreamStats/ChiSquareExperiments/./../SourceCode/ChiSquare/../Quantiles/Q-Digest.cpp
// Function: QDigest::rebuildToCapacity(long)
void QDigest::rebuildToCapacity(long newCapacity) 
{
  std::unordered_map<long, long> newNode2count;
  long scaleR = newCapacity / capacity - 1;  
  long scaleL = 1;
  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);
	
  std::sort(keys.begin(), keys.end());
    
  // adjusts and adds the values from the old tree into the new tree
  for (std::vector<long>::const_iterator i = keys.begin(); i != keys.end(); i++)
  {
    while (scaleL <= *i / 2)
      scaleL <<= 1;
    newNode2count.insert(std::make_pair (*i + scaleL * scaleR, get(*i))); 
   }
  node2count = newNode2count;
  capacity = newCapacity;
  compressFully();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r13
movq %rdi, %rbx
leaq -0x68(%rbp), %rax
movq %rax, -0x30(%rax)
movq $0x1, -0x28(%rax)
xorps %xmm0, %xmm0
movups %xmm0, -0x20(%rax)
movl $0x3f800000, -0x10(%rax) # imm = 0x3F800000
movups %xmm0, -0x8(%rax)
movq %rsi, %rax
cqto
idivq 0x48(%rdi)
movq %rax, %r15
leaq -0x40(%rbp), %rdi
andq $0x0, 0x10(%rdi)
movaps %xmm0, (%rdi)
movq 0x20(%rbx), %rsi
callq 0x5c6e
decq %r15
leaq 0x8(%rbx), %rax
movq %rax, -0x50(%rbp)
leaq 0x18(%rbx), %r12
leaq -0x40(%rbp), %r14
movq (%r12), %r12
testq %r12, %r12
je 0x33ab
leaq 0x8(%r12), %rsi
movq %r14, %rdi
callq 0x5d08
jmp 0x3393
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x6f82
movq %r13, -0x48(%rbp)
pushq $0x1
popq %rcx
movq -0x40(%rbp), %r13
cmpq -0x38(%rbp), %r13
je 0x3419
movq (%r13), %r14
movq %r14, %rax
cqto
pushq $0x2
popq %rsi
idivq %rsi
movq %rcx, %r12
addq %rcx, %rcx
cmpq %rax, %r12
jle 0x33d8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x34a2
movq %r12, %rcx
imulq %r15, %rcx
addq %rcx, %r14
movq %r14, -0x60(%rbp)
movq %rax, -0x58(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x6abc
addq $0x8, %r13
movq %r12, %rcx
jmp 0x33c3
leaq -0x98(%rbp), %rsi
movq -0x50(%rbp), %rdi
callq 0x5e72
movq -0x48(%rbp), %rax
movq %rax, 0x48(%rbx)
movq %rbx, %rdi
callq 0x3626
leaq -0x40(%rbp), %rdi
callq 0x6e1c
leaq -0x98(%rbp), %rdi
callq 0x5dc2
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3461
jmp 0x3461
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x6e1c
leaq -0x98(%rbp), %rdi
callq 0x5dc2
movq %rbx, %rdi
callq 0x2320
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x349d
movl $0x1, %eax
cmpq $0x2, %rsi
jb 0x349f
sarq %rsi
addl %eax, %eax
jmp 0x3490
xorl %eax, %eax
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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, %r14
movq %rdi, %rbx
leaq -0x30(%rbp), %rax
movq %rsi, (%rax)
cvtsi2sdq 0x40(%rdi), %xmm0
divsd 0x60(%rdi), %xmm0
callq 0x22d0
movsd %xmm0, -0x38(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x34a2
movq %rax, %r15
leaq 0x8(%rbx), %r12
leaq -0x40(%rbp), %r13
cmpq $0x1, %r14
movsd -0x38(%rbp), %xmm1
je 0x3617
cvtsi2sd %r15, %xmm0
ucomisd %xmm1, %xmm0
ja 0x3617
movl %r14d, %esi
andl $0x1, %esi
negq %rsi
orq $0x1, %rsi
addq %r14, %rsi
movq %rbx, %rdi
callq 0x34a2
addq %rax, %r15
cvtsi2sd %r15, %xmm0
ucomisd -0x38(%rbp), %xmm0
ja 0x3617
movq %rax, %r14
movq -0x30(%rbp), %rax
cqto
pushq $0x2
popq %rcx
idivq %rcx
movq %rax, -0x40(%rbp)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x34a2
addq %rax, %r15
cvtsi2sd %r15, %xmm0
ucomisd -0x38(%rbp), %xmm0
ja 0x3617
movq %r12, %rdi
movq %r13, %rsi
callq 0x6a32
testq %rax, %rax
je 0x35be
movq %r12, %rdi
movq %r13, %rsi
callq 0x6d42
movq %r12, %rdi
movq %r13, %rsi
callq 0x6d42
incq (%rax)
jmp 0x35d6
movq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
movq %r15, -0x48(%rbp)
movq %r12, %rdi
leaq -0x50(%rbp), %rsi
callq 0x6abc
movq %r12, %rdi
leaq -0x30(%rbp), %rsi
callq 0x73f6
testq %r14, %r14
jle 0x360a
movq -0x30(%rbp), %rax
movl %eax, %ecx
andl $0x1, %ecx
negq %rcx
orq $0x1, %rcx
addq %rax, %rcx
movq %rcx, -0x50(%rbp)
movq %r12, %rdi
leaq -0x50(%rbp), %rsi
callq 0x73f6
movq -0x40(%rbp), %r14
movq %r14, -0x30(%rbp)
jmp 0x3519
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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)
andq $0x0, 0x10(%rdi)
movq 0x20(%rbx), %rsi
callq 0x5c6e
leaq 0x18(%rbx), %r15
leaq -0x30(%rbp), %r14
movq (%r15), %r15
testq %r15, %r15
je 0x366c
leaq 0x8(%r15), %rsi
movq %r14, %rdi
callq 0x5d08
jmp 0x3656
movq -0x30(%rbp), %r14
cmpq -0x28(%rbp), %r14
je 0x368d
movq (%r14), %rsi
cmpq $0x1, %rsi
je 0x3687
movq %rbx, %rdi
callq 0x36ba
addq $0x8, %r14
jmp 0x3670
leaq -0x30(%rbp), %rdi
callq 0x6e1c
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x36a5
jmp 0x36a5
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x6e1c
movq %rbx, %rdi
callq 0x2320
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x38f1
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
// File: /workspace/github_cpp_makefile_star2_O2/ashlall[P]StreamStats/ChiSquareExperiments/./../SourceCode/ChiSquare/Chi_Square_Distribution.cpp
// Function: gser(double, double)
void gser(  double a, double x )
{
	int n, ITMAX=100;
	double sum, del, ap, eps = 3.0e-7;
	gln = gammln( a );
	if( x <= 0.0 )
	{
		if( x < 0.0 )
		{
			printf( "x less than 0 in routine gser" );
			exit( 1 );
		}
		gamser = 0.0;
		return;
	}
	else
	{
		ap = a;
		del = sum = 1.0 / a;

		for( n = 1; n <= ITMAX; n++ )
		{
			++ap;
			del *= x / ap;
			sum += del;
			if( fabs( del ) < fabs( sum ) * eps)
			{
				gamser = sum * exp( -x + a * log( x ) - gln );
				return;
			}
		}
		printf( "Error:a too large, ITMAX too small in routine gser" );
		exit( 1 );
	}
	return;
//	returns the incomplete gamma function P(a,x) evaluated by its series reprentation
//  as gamser, also returns ln(gamma(a) as gln;
//  the incomplete gamma function P(a,x) is efined:
//		P(a,x) = 1/gamma(a)* integral(0,x) exp(-t)t^(a-1) dt (a>0);
//	it has the limiting values P(a,0)=0 and P(a,infinity)=1;
//  it relates many cumulative probability functions, such as chi-square;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movsd %xmm1, -0x10(%rbp)
movsd %xmm0, -0x8(%rbp)
callq 0x39e6
movsd -0x10(%rbp), %xmm8
movsd %xmm0, 0x98e0(%rip)     # 0xd1f8
xorpd %xmm1, %xmm1
ucomisd %xmm8, %xmm1
jae 0x39b7
movsd 0x46d9(%rip), %xmm0     # 0x8008
movapd %xmm0, %xmm7
movsd -0x8(%rbp), %xmm4
divsd %xmm4, %xmm7
pushq $0x65
popq %rax
movapd 0x4879(%rip), %xmm1     # 0x81c0
movsd 0x46d1(%rip), %xmm2     # 0x8020
movapd %xmm7, %xmm3
decl %eax
je 0x39c7
addsd %xmm0, %xmm4
movapd %xmm8, %xmm5
divsd %xmm4, %xmm5
mulsd %xmm5, %xmm3
addsd %xmm3, %xmm7
movapd %xmm3, %xmm5
andpd %xmm1, %xmm5
movapd %xmm7, %xmm6
andpd %xmm1, %xmm6
mulsd %xmm2, %xmm6
ucomisd %xmm5, %xmm6
jbe 0x3953
movapd %xmm8, %xmm0
movapd %xmm7, -0x20(%rbp)
callq 0x2170
mulsd -0x8(%rbp), %xmm0
subsd -0x10(%rbp), %xmm0
subsd 0x9851(%rip), %xmm0     # 0xd1f8
callq 0x2340
movapd -0x20(%rbp), %xmm1
mulsd %xmm0, %xmm1
jmp 0x39b9
ja 0x39dd
movsd %xmm1, 0x983f(%rip)     # 0xd200
addq $0x20, %rsp
popq %rbp
retq
leaq 0x48f6(%rip), %rdi      # 0x82c4
xorl %eax, %eax
callq 0x2040
pushq $0x1
popq %rdi
callq 0x21f0
leaq 0x48c2(%rip), %rdi      # 0x82a6
jmp 0x39ce
// File: /workspace/github_cpp_makefile_star2_O2/ashlall[P]StreamStats/ChiSquareExperiments/./../SourceCode/ChiSquare/Chi_Square_Distribution.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 < 6; j++ )
		ser += cof[ j ] / ++y;
	return( -tmp + log( 2.5066282746310005 * ser / x ) );
//	Returns the logarithmic value of gamma function of xx for xx>0;
//  the gamma function is defined by the intergral:
// 		gamma(z)=inter(0,infinity) t^(z-1)epx(-t)dt;
//  n!=gamma(n+1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movapd %xmm0, %xmm1
movsd %xmm0, -0x10(%rbp)
movsd 0x4629(%rip), %xmm0     # 0x8028
addsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rbp)
callq 0x2170
movsd -0x10(%rbp), %xmm5
movapd %xmm0, %xmm1
movsd 0x4612(%rip), %xmm0     # 0x8030
xorl %eax, %eax
leaq 0x47e9(%rip), %rcx      # 0x8210
movsd 0x45d9(%rip), %xmm2     # 0x8008
movapd %xmm5, %xmm3
cmpq $0x30, %rax
je 0x3a50
movsd (%rax,%rcx), %xmm4
addsd %xmm2, %xmm3
divsd %xmm3, %xmm4
addsd %xmm4, %xmm0
addq $0x8, %rax
jmp 0x3a33
movsd 0x45e0(%rip), %xmm2     # 0x8038
addsd %xmm5, %xmm2
mulsd %xmm1, %xmm2
movsd -0x8(%rbp), %xmm1
subsd %xmm2, %xmm1
movsd %xmm1, -0x8(%rbp)
mulsd 0x45ca(%rip), %xmm0     # 0x8040
divsd %xmm5, %xmm0
callq 0x2170
subsd -0x8(%rbp), %xmm0
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ashlall[P]StreamStats/ChiSquareExperiments/./../SourceCode/ChiSquare/Chi_Square_Distribution.cpp
// Function: gammp(double, double)
double gammp( double a, double x )
{

	// x = chisquare, a = df/2
	if( x < 0.0 || a <= 0.0 )
	{
		printf( "error: invalid arguments in routine gammp" );
		exit( 1 );
	}
	if( x < ( a + 1.0 ) )
	{
		gser( a, x );
		return( gamser );
	}
	else
	{
		gcf( a, x );
		return( 1.0 - gammcf );
	}
//	returns the incomplete gamma function P(a,x);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorpd %xmm2, %xmm2
ucomisd %xmm0, %xmm2
jae 0x3ad6
ucomisd %xmm1, %xmm2
ja 0x3ad6
movsd 0x4562(%rip), %xmm2     # 0x8008
addsd %xmm0, %xmm2
ucomisd %xmm1, %xmm2
jbe 0x3abf
callq 0x38f3
movsd 0x9743(%rip), %xmm0     # 0xd200
jmp 0x3ad4
callq 0x3aec
movsd 0x453c(%rip), %xmm0     # 0x8008
subsd 0x9734(%rip), %xmm0     # 0xd208
popq %rbp
retq
leaq 0x481a(%rip), %rdi      # 0x82f7
xorl %eax, %eax
callq 0x2040
pushq $0x1
popq %rdi
callq 0x21f0
// File: /workspace/github_cpp_makefile_star2_O2/ashlall[P]StreamStats/ChiSquareExperiments/./../SourceCode/ChiSquare/Chi_Square_Distribution.cpp
// Function: gcf(double, double)
void gcf(  double a, double x )
{
	int i, ITMAX=100;
	double an, b, c, d, del, h, eps = 3.0e-7, fpmin = 1.0e-30;
	gln = gammln( a );
	b = x + 1.0 - a;
	c = 1.0 / fpmin;
	d = 1.0 / b;
	h = d;
	for( i = 1; i < ITMAX; i++ )
	{
		
		an = -i * ( i-a );
		b += 2.0;
		d = an * d + b;
		if( fabs( d ) < fpmin )
			d = fpmin;
		c = b + an / c;
		if( fabs( c ) < fpmin )
			c = fpmin;
		d = 1.0 / d;
		del = d * c;
		h *= del;
		if( fabs( del-1.0 ) < eps )
			break;
	}
	if( i > ITMAX )
	{
		printf( "Error:a too large, ITMAX too small in routine gser" );
		exit( 1 );
	}
	gammcf = exp( -x + a * log( x ) - gln ) * h;
//	returns the incomplete gamma function P(a,x) evaluated by its continued fraction
//	reprentation as gammcf, also returns ln(gamma(a) as gln;
//  the definition of incomplete function P(a,x) can see routine gser();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movsd %xmm1, -0x10(%rbp)
movsd %xmm0, -0x8(%rbp)
callq 0x39e6
movsd -0x8(%rbp), %xmm14
movsd %xmm0, 0x96e7(%rip)     # 0xd1f8
movsd 0x44ef(%rip), %xmm0     # 0x8008
movsd -0x10(%rbp), %xmm1
movapd %xmm1, %xmm13
addsd %xmm0, %xmm1
subsd %xmm14, %xmm1
movapd %xmm0, %xmm2
divsd %xmm1, %xmm2
pushq $0x1
popq %rax
movsd 0x4509(%rip), %xmm5     # 0x8048
pushq $-0x1
popq %rcx
movsd 0x4506(%rip), %xmm3     # 0x8050
movapd 0x466e(%rip), %xmm4     # 0x81c0
movsd 0x44fe(%rip), %xmm6     # 0x8058
movsd 0x44e6(%rip), %xmm7     # 0x8048
movsd 0x44a5(%rip), %xmm8     # 0x8010
movsd 0x44ac(%rip), %xmm9     # 0x8020
movapd %xmm2, %xmm15
cmpl $-0x64, %ecx
je 0x3c1c
cvtsi2sd %ecx, %xmm10
cvtsi2sd %eax, %xmm11
subsd %xmm14, %xmm11
mulsd %xmm10, %xmm11
addsd %xmm3, %xmm1
mulsd %xmm11, %xmm2
addsd %xmm1, %xmm2
movapd %xmm0, %xmm10
divsd %xmm2, %xmm10
andpd %xmm4, %xmm2
divsd %xmm5, %xmm11
addsd %xmm1, %xmm11
movapd %xmm11, %xmm5
andpd %xmm4, %xmm5
cmpltsd %xmm6, %xmm5
movapd %xmm5, %xmm12
andnpd %xmm11, %xmm12
andpd %xmm6, %xmm5
orpd %xmm12, %xmm5
cmpltsd %xmm6, %xmm2
movapd %xmm2, %xmm11
andnpd %xmm10, %xmm11
andpd %xmm7, %xmm2
orpd %xmm11, %xmm2
movapd %xmm2, %xmm10
mulsd %xmm5, %xmm10
mulsd %xmm10, %xmm15
addsd %xmm8, %xmm10
andpd %xmm4, %xmm10
incl %eax
decl %ecx
ucomisd %xmm10, %xmm9
jbe 0x3b79
movsd %xmm15, -0x18(%rbp)
movapd %xmm13, %xmm0
callq 0x2170
mulsd -0x8(%rbp), %xmm0
subsd -0x10(%rbp), %xmm0
subsd 0x95ba(%rip), %xmm0     # 0xd1f8
callq 0x2340
mulsd -0x18(%rbp), %xmm0
movsd %xmm0, 0x95b8(%rip)     # 0xd208
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ashlall[P]StreamStats/ChiSquareExperiments/./../SourceCode/ChiSquare/ChiSquareContinuous.cpp
// Function: ChiSquareContinuous::ChiSquareContinuous(double, int)
ChiSquareContinuous::ChiSquareContinuous(double memory_,int num)
{
  chi_squared = 0;
  upper_bins = new double;
  lower_bins = new double;
  memory = memory_;
  switch(num)
  {
  case 1: 
    memory = memory_/3;
    quantile_sketch = new GK(memory);
    break;
  case 2:
    quantile_sketch = new QDigestDouble(memory);
    break;
  case 3: 
    quantile_sketch = new ReservoirSampling((int)memory);
    break;
  default:
    throw IndexError();
  }	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movsd %xmm0, -0x20(%rbp)
movq %rdi, %rbx
andq $0x0, (%rdi)
pushq $0x8
popq %r15
movq %r15, %rdi
callq 0x21d0
movq %rax, 0x10(%rbx)
movq %r15, %rdi
callq 0x21d0
movq %rax, 0x18(%rbx)
movsd -0x20(%rbp), %xmm0
movsd %xmm0, 0x8(%rbx)
cmpl $0x3, %r14d
je 0x4132
cmpl $0x2, %r14d
je 0x4116
cmpl $0x1, %r14d
jne 0x4159
movsd -0x20(%rbp), %xmm0
divsd 0x3f26(%rip), %xmm0     # 0x8018
movsd %xmm0, -0x20(%rbp)
movsd %xmm0, 0x8(%rbx)
pushq $0x30
popq %rdi
callq 0x21d0
movq %rax, %r14
cvttsd2si -0x20(%rbp), %esi
movq %rax, %rdi
callq 0x2942
jmp 0x414a
movl $0x80, %edi
callq 0x21d0
movq %rax, %r14
movq %rax, %rdi
movsd -0x20(%rbp), %xmm0
callq 0x5d54
jmp 0x414a
pushq $0x18
popq %rdi
callq 0x21d0
movq %rax, %r14
cvttsd2si -0x20(%rbp), %esi
movq %rax, %rdi
callq 0x2cc4
movq %r14, 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x1
popq %rdi
callq 0x20e0
leaq 0x8be8(%rip), %rsi      # 0xcd50
movq %rax, %rdi
xorl %edx, %edx
callq 0x22f0
jmp 0x4176
jmp 0x4176
movq %rax, %rbx
movq %r14, %rdi
callq 0x21b0
movq %rbx, %rdi
callq 0x2320
nop
// File: /workspace/github_cpp_makefile_star2_O2/ashlall[P]StreamStats/ChiSquareExperiments/./../SourceCode/ChiSquare/ChiSquareContinuous.cpp
// Function: ChiSquareContinuous::normal_cdf_inverse(double, double, double)
double ChiSquareContinuous::normal_cdf_inverse(double p, double mean, double SD){
  if (p < 0.0 || p > 1.0)
  {
    //throw an exception
  }

  if(p==0)
    return -99999999;
    
  if(p==1)
    return 99999999;
    
  if (p < 0.5)
  {
    // F^-1(p) = - G^-1(p)
    return -rational_approximation( sqrt(-2.0*log(p)))*SD + mean;
  }
  else
  {
    // F^-1(p) = G^-1(1-p)
    return rational_approximation( sqrt(-2.0*log(1-p)))*SD + mean;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
xorpd %xmm3, %xmm3
ucomisd %xmm3, %xmm0
jne 0x4353
jp 0x4353
movsd 0x3dda(%rip), %xmm0     # 0x8128
jmp 0x44a6
ucomisd 0x3cad(%rip), %xmm0     # 0x8008
jne 0x436c
jp 0x436c
movsd 0x3dc9(%rip), %xmm0     # 0x8130
jmp 0x44a6
movsd %xmm2, -0x8(%rbp)
movsd %xmm1, -0x10(%rbp)
movsd 0x3cba(%rip), %xmm1     # 0x8038
ucomisd %xmm0, %xmm1
jbe 0x43a1
callq 0x2170
mulsd 0x3ccf(%rip), %xmm0     # 0x8060
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x43ce
sqrtsd %xmm0, %xmm0
jmp 0x43d3
movsd 0x3c5f(%rip), %xmm1     # 0x8008
subsd %xmm0, %xmm1
movapd %xmm1, %xmm0
callq 0x2170
mulsd 0x3ca2(%rip), %xmm0     # 0x8060
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x443f
sqrtsd %xmm0, %xmm0
jmp 0x4444
callq 0x2160
movsd -0x8(%rbp), %xmm3
movsd 0x3d58(%rip), %xmm1     # 0x8138
mulsd %xmm0, %xmm1
addsd 0x3d54(%rip), %xmm1     # 0x8140
mulsd %xmm0, %xmm1
addsd 0x3d50(%rip), %xmm1     # 0x8148
movsd 0x3d50(%rip), %xmm2     # 0x8150
mulsd %xmm0, %xmm2
addsd 0x3d4c(%rip), %xmm2     # 0x8158
mulsd %xmm0, %xmm2
addsd 0x3d48(%rip), %xmm2     # 0x8160
mulsd %xmm0, %xmm2
addsd 0x3be4(%rip), %xmm2     # 0x8008
divsd %xmm2, %xmm1
subsd %xmm1, %xmm0
mulsd %xmm3, %xmm0
movsd -0x10(%rbp), %xmm1
subsd %xmm0, %xmm1
movapd %xmm1, %xmm0
jmp 0x44a6
callq 0x2160
movsd -0x8(%rbp), %xmm3
movsd 0x3ce7(%rip), %xmm1     # 0x8138
mulsd %xmm0, %xmm1
addsd 0x3ce3(%rip), %xmm1     # 0x8140
mulsd %xmm0, %xmm1
addsd 0x3cdf(%rip), %xmm1     # 0x8148
movsd 0x3cdf(%rip), %xmm2     # 0x8150
mulsd %xmm0, %xmm2
addsd 0x3cdb(%rip), %xmm2     # 0x8158
mulsd %xmm0, %xmm2
addsd 0x3cd7(%rip), %xmm2     # 0x8160
mulsd %xmm0, %xmm2
addsd 0x3b73(%rip), %xmm2     # 0x8008
divsd %xmm2, %xmm1
subsd %xmm1, %xmm0
mulsd %xmm3, %xmm0
addsd -0x10(%rbp), %xmm0
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ashlall[P]StreamStats/ChiSquareExperiments/VaryMemoryOneSample.cpp
// Function: get_estimate(ChiSquareContinuous*, char, int, double, double)
double get_estimate(ChiSquareContinuous *quantile_sketch, char distribution_type, int num_buckets, double location, double scale)
{
  if (distribution_type == 'N')
    return quantile_sketch->calculate_statistic_ifNormal(num_buckets, location, scale);
  else if (distribution_type == 'U')
    return quantile_sketch->calculate_statistic_ifUniform(num_buckets, location, scale);
  else if (distribution_type == 'P')
    return quantile_sketch->calculate_statistic_ifPareto(num_buckets, location, scale);
  else
    return quantile_sketch->calculate_statistic_ifExponential(num_buckets, location, scale);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0x55, %esi
je 0x5bd7
cmpl $0x50, %esi
je 0x5bcf
cmpl $0x4e, %esi
jne 0x5bdf
movl %edx, %esi
popq %rbp
jmp 0x41c6
movl %edx, %esi
popq %rbp
jmp 0x46e8
movl %edx, %esi
popq %rbp
jmp 0x4682
movl %edx, %esi
popq %rbp
jmp 0x477a
// File: /workspace/github_cpp_makefile_star2_O2/ashlall[P]StreamStats/ChiSquareExperiments/./../SourceCode/ChiSquare/../Quantiles/QDigestDouble.h
// Function: QDigestDouble::insert(double)
void insert(double x)
  { 
    if (x < -range)
      x = 0;
    if (x > range)
      x = precision;
    QDigest::insert(doubleToLong(x)); 
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movsd 0x70(%rdi), %xmm1
movsd 0x78(%rdi), %xmm2
movapd 0x1f9e(%rip), %xmm3     # 0x81d0
xorpd %xmm2, %xmm3
movapd %xmm0, %xmm4
cmpltsd %xmm3, %xmm4
andnpd %xmm0, %xmm4
movapd %xmm2, %xmm0
cmpltsd %xmm4, %xmm0
movapd %xmm0, %xmm3
andnpd %xmm4, %xmm3
andpd %xmm1, %xmm0
orpd %xmm3, %xmm0
addsd %xmm2, %xmm0
addsd %xmm2, %xmm2
divsd %xmm2, %xmm0
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
cvtsi2sd %rax, %xmm0
popq %rbp
jmp 0x2fa4
// File: /workspace/github_cpp_makefile_star2_O2/Joke-Shi[P]astrunc/sample/sample_en.cc
// Function: main
int main( int argc, const char **argv)
{         
    std::string s_en = "He said: Chang suggested organizing a canine patrol squad at the "
                       "museum \"abc\" and, in 1987, dogs came back. At 1 year old, each dog is "
                       "given a tailored training course. ";

    std::vector< std::string> vec_s;
    int rc = astrunc::access::split( vec_s, s_en, astrunc::access::EN, 32);
    if ( 0 == rc) {
        for ( auto const &__s : vec_s) {
            std::cout << __s << std::endl;
            std::cout << "------------------------------------------------------------------\n";
        }
    } else { std::cerr << "[Error]: Split error\n"; }


    return rc;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x40, %rsp
leaq 0xc19(%rip), %rsi       # 0x6322
leaq 0x20(%rsp), %rbx
movq %rsp, %r14
movq %rbx, %rdi
movq %r14, %rdx
callq 0x5800
xorps %xmm0, %xmm0
movaps %xmm0, (%r14)
andq $0x0, 0x10(%r14)
movq %rsp, %rdi
pushq $0xe
popq %rdx
pushq $0x20
popq %rcx
movq %rbx, %rsi
callq 0x2f16
movl %eax, %ebx
testl %eax, %eax
je 0x5774
movq 0x38aa(%rip), %rdi      # 0x8ff0
leaq 0xcc3(%rip), %rsi       # 0x6410
callq 0x2120
movq %rsp, %rdi
callq 0x5872
leaq 0x20(%rsp), %rdi
callq 0x21e8
movl %ebx, %eax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq (%rsp), %r14
movq 0x8(%rsp), %r13
movq 0x384c(%rip), %r15      # 0x8fd0
leaq 0xc41(%rip), %r12       # 0x63cc
cmpq %r13, %r14
je 0x5752
movq %r15, %rdi
movq %r14, %rsi
callq 0x2110
movq %rax, %rdi
callq 0x2090
movq %r15, %rdi
movq %r12, %rsi
callq 0x2120
addq $0x20, %r14
jmp 0x578b
jmp 0x57b6
movq %rax, %rbx
movq %rsp, %rdi
callq 0x5872
leaq 0x20(%rsp), %rdi
callq 0x21e8
movq %rbx, %rdi
callq 0x21b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/kentcz[P]rapl-tools/Rapl.cpp
// Function: Rapl::Rapl()
Rapl::Rapl() {

	open_msr();
	pp1_supported = detect_pp1();

	/* Read MSR_RAPL_POWER_UNIT Register */
	uint64_t raw_value = read_msr(MSR_RAPL_POWER_UNIT);
	power_units = pow(0.5,	(double) (raw_value & 0xf));
	energy_units = pow(0.5,	(double) ((raw_value >> 8) & 0x1f));
	time_units = pow(0.5,	(double) ((raw_value >> 16) & 0xf));

	/* Read MSR_PKG_POWER_INFO Register */
	raw_value = read_msr(MSR_PKG_POWER_INFO);
	thermal_spec_power = power_units * ((double)(raw_value & 0x7fff));
	minimum_power = power_units * ((double)((raw_value >> 16) & 0x7fff));
	maximum_power = power_units * ((double)((raw_value >> 32) & 0x7fff));
	time_window = time_units * ((double)((raw_value >> 48) & 0x7fff));

	reset();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
andl $0x0, 0x4(%rdi)
movb $0x1, 0x8(%rdi)
callq 0x2780
pushq $0x1
popq %rax
cpuid
andl $0xffff0, %eax          # imm = 0xFFFF0
cmpl $0x206d0, %eax          # imm = 0x206D0
setne %cl
cmpl $0x306f0, %eax          # imm = 0x306F0
setne %al
andb %cl, %al
movb %al, 0x8(%r14)
movq %r14, %rdi
movl $0x606, %esi            # imm = 0x606
callq 0x28e2
movq %rax, %rbx
andl $0xf, %eax
cvtsi2sd %eax, %xmm0
orpd 0x9bd(%rip), %xmm0      # 0x3070
callq 0x2100
movsd %xmm0, 0x10(%r14)
movl %ebx, %eax
shrl $0x8, %eax
andl $0x1f, %eax
cvtsi2sd %eax, %xmm0
orpd 0x99e(%rip), %xmm0      # 0x3070
callq 0x2100
movsd %xmm0, 0x18(%r14)
shrl $0x10, %ebx
andl $0xf, %ebx
cvtsi2sd %ebx, %xmm0
orpd 0x981(%rip), %xmm0      # 0x3070
callq 0x2100
movsd %xmm0, 0x20(%r14)
movq %r14, %rdi
movl $0x614, %esi            # imm = 0x614
callq 0x28e2
movupd 0x10(%r14), %xmm0
movq %rax, %xmm1
shrl $0x10, %eax
movd %eax, %xmm2
movdqa %xmm1, %xmm3
punpckldq %xmm2, %xmm3    # xmm3 = xmm3[0],xmm2[0],xmm3[1],xmm2[1]
movdqa 0x957(%rip), %xmm2      # 0x3080
pand %xmm2, %xmm3
cvtdq2pd %xmm3, %xmm3
movapd %xmm0, %xmm4
unpcklpd %xmm0, %xmm4            # xmm4 = xmm4[0],xmm0[0]
mulpd %xmm3, %xmm4
movupd %xmm4, 0x28(%r14)
pshufd $0x44, %xmm1, %xmm3     # xmm3 = xmm1[0,1,0,1]
psrlq $0x20, %xmm1
psrlq $0x30, %xmm3
movsd %xmm1, %xmm3            # xmm3 = xmm1[0],xmm3[1]
shufps $0xe8, %xmm3, %xmm3     # xmm3 = xmm3[0,2,2,3]
andps %xmm2, %xmm3
cvtdq2pd %xmm3, %xmm1
movhpd 0x20(%r14), %xmm0       # xmm0 = xmm0[0],mem[0]
mulpd %xmm1, %xmm0
movupd %xmm0, 0x38(%r14)
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2914
// File: /workspace/github_cpp_makefile_star2_O2/kentcz[P]rapl-tools/Rapl.cpp
// Function: Rapl::open_msr()
void Rapl::open_msr() {
	std::stringstream filename_stream;
	filename_stream << "/dev/cpu/" << core << "/msr";
	fd = open(filename_stream.str().c_str(), O_RDONLY);
	if (fd < 0) {
		if ( errno == ENXIO) {
			fprintf(stderr, "rdmsr: No CPU %d\n", core);
			exit(2);
		} else if ( errno == EIO) {
			fprintf(stderr, "rdmsr: CPU %d doesn't support MSRs\n", core);
			exit(3);
		} else {
			perror("rdmsr:open");
			fprintf(stderr, "Trying to open %s\n",
					filename_stream.str().c_str());
			exit(127);
		}
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rdi, %rbx
leaq 0x20(%rsp), %rdi
callq 0x20b0
leaq 0x30(%rsp), %rdi
leaq 0x935(%rip), %rsi       # 0x30d8
callq 0x2120
movl 0x4(%rbx), %esi
movq %rax, %rdi
callq 0x2200
leaq 0x928(%rip), %rsi       # 0x30e2
movq %rax, %rdi
callq 0x2120
leaq 0x38(%rsp), %rsi
movq %rsp, %rdi
callq 0x21c0
movq (%rsp), %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x20c0
movl %eax, (%rbx)
movq %rsp, %rdi
callq 0x2070
cmpl $0x0, (%rbx)
js 0x2800
leaq 0x20(%rsp), %rdi
callq 0x20d0
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r14
retq
callq 0x2030
movl (%rax), %eax
cmpl $0x5, %eax
je 0x287a
cmpl $0x6, %eax
je 0x285b
leaq 0x905(%rip), %rdi       # 0x311d
callq 0x20e0
movq 0x27b4(%rip), %rax      # 0x4fd8
movq (%rax), %rbx
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
callq 0x2110
movq %rsp, %r14
movq (%r14), %rdx
leaq 0x8e7(%rip), %rsi       # 0x3128
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2180
movq %r14, %rdi
callq 0x2070
pushq $0x7f
popq %rdi
callq 0x2150
movq 0x2776(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
movl 0x4(%rbx), %edx
leaq 0x878(%rip), %rsi       # 0x30e7
xorl %eax, %eax
callq 0x2180
pushq $0x2
jmp 0x2855
movq 0x2757(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
movl 0x4(%rbx), %edx
leaq 0x86b(%rip), %rsi       # 0x30f9
xorl %eax, %eax
callq 0x2180
pushq $0x3
jmp 0x2855
movq %rax, %rbx
movq %rsp, %rdi
callq 0x2070
jmp 0x28ad
jmp 0x28aa
jmp 0x28aa
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x20d0
movq %rbx, %rdi
callq 0x2210
nop
// File: /workspace/github_cpp_makefile_star2_O2/kentcz[P]rapl-tools/Rapl.cpp
// Function: Rapl::read_msr(int)
uint64_t Rapl::read_msr(int msr_offset) {
	uint64_t data;
	if (pread(fd, &data, sizeof(data), msr_offset) != sizeof(data)) {
		perror("read_msr():pread");
		exit(127);
	}
	return data;
}

// Assembly:
pushq %rax
movl (%rdi), %edi
movslq %esi, %rcx
movq %rsp, %rsi
pushq $0x8
popq %rdx
callq 0x2160
cmpq $0x8, %rax
jne 0x28ff
movq (%rsp), %rax
popq %rcx
retq
leaq 0x835(%rip), %rdi       # 0x313b
callq 0x20e0
pushq $0x7f
popq %rdi
callq 0x2150
nop
// File: /workspace/github_cpp_makefile_star2_O2/kentcz[P]rapl-tools/Rapl.cpp
// Function: Rapl::reset()
void Rapl::reset() {

	prev_state = &state1;
	current_state = &state2;
	next_state = &state3;

	// sample twice to fill current and previous
	sample();
	sample();

	// Initialize running_total
	running_total.pkg = 0;
	running_total.pp0 = 0;
	running_total.dram = 0;
	gettimeofday(&(running_total.tsc), NULL);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x60(%rdi), %rax
movq %rax, 0x50(%rdi)
leaq 0x90(%rdi), %rax
movq %rax, 0x48(%rdi)
leaq 0xc0(%rdi), %rax
movq %rax, 0x58(%rdi)
callq 0x2968
movq %rbx, %rdi
callq 0x2968
andq $0x0, 0x108(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0xf0(%rbx)
addq $0x110, %rbx            # imm = 0x110
movq %rbx, %rdi
xorl %esi, %esi
popq %rbx
jmp 0x21e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/kentcz[P]rapl-tools/Rapl.cpp
// Function: Rapl::sample()
void Rapl::sample() {
	uint32_t max_int = ~((uint32_t) 0);

	next_state->pkg = read_msr(MSR_PKG_ENERGY_STATUS) & max_int;
	next_state->pp0 = read_msr(MSR_PP0_ENERGY_STATUS) & max_int;

	if (pp1_supported) {
		next_state->pp1 = read_msr(MSR_PP1_ENERGY_STATUS) & max_int;
		next_state->dram = 0;
	} else {
		next_state->pp1 = 0;
		next_state->dram = read_msr(MSR_DRAM_ENERGY_STATUS) & max_int;
	}

	gettimeofday(&(next_state->tsc), NULL);


	// Update running total
	running_total.pkg += energy_delta(current_state->pkg, next_state->pkg);
	running_total.pp0 += energy_delta(current_state->pp0, next_state->pp0);
	running_total.pp1 += energy_delta(current_state->pp0, next_state->pp0);
	running_total.dram += energy_delta(current_state->dram, next_state->dram);

	// Rotate states
	rapl_state_t *pprev_state = prev_state;
	prev_state = current_state;
	current_state = next_state;
	next_state = pprev_state;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x611, %esi            # imm = 0x611
callq 0x28e2
movl %eax, %eax
movq 0x58(%rbx), %rcx
movq %rax, (%rcx)
movq %rbx, %rdi
movl $0x639, %esi            # imm = 0x639
callq 0x28e2
movl %eax, %ecx
movq 0x58(%rbx), %rax
movq %rcx, 0x8(%rax)
cmpb $0x1, 0x8(%rbx)
jne 0x29b7
movq %rbx, %rdi
movl $0x641, %esi            # imm = 0x641
callq 0x28e2
movl %eax, %eax
movq 0x58(%rbx), %rdi
movq %rax, 0x10(%rdi)
xorl %eax, %eax
jmp 0x29cf
andq $0x0, 0x10(%rax)
movq %rbx, %rdi
movl $0x619, %esi            # imm = 0x619
callq 0x28e2
movl %eax, %eax
movq 0x58(%rbx), %rdi
movq %rax, 0x18(%rdi)
addq $0x20, %rdi
xorl %esi, %esi
callq 0x21e0
movq 0x58(%rbx), %rax
movq 0x48(%rbx), %rcx
movdqu (%rcx), %xmm0
movdqu (%rax), %xmm1
movdqa %xmm1, %xmm2
psubq %xmm0, %xmm2
movdqa 0x692(%rip), %xmm3      # 0x3090
pxor %xmm3, %xmm1
pxor %xmm3, %xmm0
movdqa %xmm0, %xmm3
pcmpgtd %xmm1, %xmm3
pcmpeqd %xmm1, %xmm0
pshufd $0xf5, %xmm0, %xmm0     # xmm0 = xmm0[1,1,3,3]
pand %xmm3, %xmm0
pshufd $0xf5, %xmm3, %xmm1     # xmm1 = xmm3[1,1,3,3]
por %xmm0, %xmm1
pand 0x674(%rip), %xmm1      # 0x30a0
movq 0x50(%rbx), %rdx
movdqu 0xf0(%rbx), %xmm0
paddq %xmm2, %xmm0
paddq %xmm1, %xmm0
movdqu %xmm0, 0xf0(%rbx)
movq 0x8(%rax), %rsi
subq 0x8(%rcx), %rsi
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
leaq (%rsi,%rdi), %r8
cmovaeq %rsi, %r8
addq %r8, 0x100(%rbx)
movq 0x18(%rax), %rsi
subq 0x18(%rcx), %rsi
leaq (%rsi,%rdi), %rdi
cmovaeq %rsi, %rdi
addq %rdi, 0x108(%rbx)
movq %rcx, 0x50(%rbx)
movq %rax, 0x48(%rbx)
movq %rdx, 0x58(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/henrixh[P]shittydsa/examples/../src/fft.h
// Function: bitreversecopy(std::vector<std::complex<double>, std::allocator<std::complex<double>>>&)
vc bitreversecopy(vc& xs) {
  vc res;
  ul size = xs.size();
  ul lb_size = (ul)lb(size);
  res.assign(size, {});
  for (ul i { 0 }; i < size; i++) {
    ul index = (bitreverse(i) >> (sizeof(ul)*8 - lb_size + 1));
    cd r { xs[i] };
    res[index] = r;
  }
  return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
movq 0x8(%rsi), %r15
subq (%rsi), %r15
sarq $0x4, %r15
movl %r15d, %edi
callq 0x1b16
movl %eax, %ebp
movl %r15d, %esi
movq %rsp, %rdx
xorps %xmm0, %xmm0
movaps %xmm0, (%rdx)
movq %rbx, %rdi
callq 0x1efa
pushq $0x21
popq %rcx
subl %ebp, %ecx
movl %r15d, %eax
xorl %edx, %edx
movl $0xf0f0f0f, %esi        # imm = 0xF0F0F0F
movl $0x33333333, %edi       # imm = 0x33333333
movl $0x55555555, %r8d       # imm = 0x55555555
xorl %r9d, %r9d
cmpq %r9, %rax
je 0x1439
movl %r9d, %r10d
bswapl %r10d
movl %r10d, %r11d
shrl $0x4, %r11d
andl %esi, %r11d
andl %esi, %r10d
shll $0x4, %r10d
orl %r11d, %r10d
movl %r10d, %r11d
andl %edi, %r11d
shrl $0x2, %r10d
andl %edi, %r10d
leal (%r10,%r11,4), %r10d
movl %r10d, %r11d
andl %r8d, %r11d
shrl %r10d
andl %r8d, %r10d
leal (%r10,%r11,2), %r10d
shrl %cl, %r10d
movq (%r14), %r11
movq (%rbx), %r15
shlq $0x4, %r10
movups (%r11,%rdx), %xmm0
movups %xmm0, (%r15,%r10)
incq %r9
addq $0x10, %rdx
jmp 0x13d9
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x1edc
movq %r14, %rdi
callq 0x1160
// File: /workspace/github_cpp_makefile_star2_O2/henrixh[P]shittydsa/examples/fft.cpp
// Function: main
int main(int, char**) {
  ul len_a, len_b;
  cin >> len_a >> len_b;
  vd a,b;

  fp x;
  for (ul i { 0 }; i < len_a; ++i) {
    cin >> x;
    a.push_back(x);
  }

  for (ul i { 0 }; i < len_b; ++i) {
    cin >> x;
    b.push_back(x);
  }

  vd r { convolve(a,b) };
  r.resize(len_a+len_b);
  for (auto x : r) {
    cout << round(x) << '\n';
  }

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq 0x361a(%rip), %rbx      # 0x4fe0
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0x1150
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x1150
leaq 0x50(%rsp), %r14
andq $0x0, 0x10(%r14)
xorps %xmm0, %xmm0
andq $0x0, 0x20(%rsp)
movaps %xmm0, (%r14)
movaps %xmm0, 0x10(%rsp)
xorl %ebp, %ebp
leaq 0x48(%rsp), %r15
cmpl 0xc(%rsp), %ebp
jae 0x1a23
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1090
movq %r14, %rdi
movq %r15, %rsi
callq 0x1d02
incl %ebp
jmp 0x1a03
xorl %ebp, %ebp
movq 0x35b4(%rip), %rbx      # 0x4fe0
leaq 0x48(%rsp), %r14
leaq 0x10(%rsp), %r15
cmpl 0x8(%rsp), %ebp
jae 0x1a56
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1090
movq %r15, %rdi
movq %r14, %rsi
callq 0x1d02
incl %ebp
jmp 0x1a36
leaq 0x30(%rsp), %rdi
leaq 0x50(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x1695
movl 0x8(%rsp), %esi
addl 0xc(%rsp), %esi
leaq 0x30(%rsp), %rdi
callq 0x1d24
movq 0x30(%rsp), %r14
movq 0x38(%rsp), %r15
movq 0x3543(%rip), %rbx      # 0x4fd0
pushq $0xa
popq %rbp
cmpq %r15, %r14
je 0x1ab7
movsd (%r14), %xmm0
callq 0x1070
movq %rbx, %rdi
callq 0x1120
movq %rax, %rdi
movl %ebp, %esi
callq 0x10f0
addq $0x8, %r14
jmp 0x1a90
leaq 0x30(%rsp), %rdi
callq 0x208e
leaq 0x10(%rsp), %rdi
callq 0x208e
leaq 0x50(%rsp), %rdi
callq 0x208e
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1ae6
jmp 0x1af7
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x208e
jmp 0x1afa
jmp 0x1af7
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x208e
leaq 0x50(%rsp), %rdi
callq 0x208e
movq %rbx, %rdi
callq 0x1160
// File: /workspace/github_cpp_makefile_star2_O2/henrixh[P]shittydsa/examples/../src/fft.h
// Function: lb(int)
ul inline lb(l x) {
  ul res { 0 };
  while(x) {
    x >>= 1;
    res++;
  }
  return res;
}

// Assembly:
xorl %eax, %eax
testl %edi, %edi
je 0x1b22
sarl %edi
incl %eax
jmp 0x1b18
retq
// File: /workspace/github_cpp_makefile_star2_O2/superblocks[P]superblocks/set-nug.cpp
// Function: Superblocks::init()
void Superblocks::init() {

	coin = "NUG"; 
	coin_name = "Nuggets";

	hash_length = 64;

	// normal (step 0)
	reward[0] = 49;

	// superblock (step 1)
	reward[1] = 10045; // superblock reward (step 1)
	seed_type[1] = SEED_WITH_PREVIOUS_BLOCK_HASH;
	cutout_start[1] = 55;
	cutout_length[1] = 7;
	rnd_range_low[1] = 1;
	rnd_range_high[1] = 1000000;
	luck_type[1] = LUCK_WITH_LESS_THAN_X;
	luck_x[1] = 9723;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
addq $0x18, %rdi
leaq 0xe08(%rip), %rsi       # 0x2b00
callq 0x1160
leaq 0x38(%rbx), %rdi
leaq 0xdfc(%rip), %rsi       # 0x2b04
callq 0x1160
movl $0x40, 0x58(%rbx)
movabsq $0x273d00000031, %rax   # imm = 0x273D00000031
movq %rax, 0xd4(%rbx)
movl $0x2, 0x60(%rbx)
movl $0x37, 0x68(%rbx)
movl $0x7, 0x70(%rbx)
pushq $0x1
popq %rax
movl %eax, 0x78(%rbx)
movl $0xf4240, 0x80(%rbx)    # imm = 0xF4240
movl %eax, 0xc0(%rbx)
movl $0x25fb, 0xc8(%rbx)     # imm = 0x25FB
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ahupp[P]mural/mural_server.cpp
// Function: enforce(int, char const*)
int enforce(int a, const char* blame) {
  if (a == -1) {
    perror(blame);
    exit(1);
  }
  return a;
}

// Assembly:
cmpl $-0x1, %edi
je 0x24c4
movl %edi, %eax
retq
pushq %rax
movq %rsi, %rdi
callq 0x2180
pushq $0x1
popq %rdi
callq 0x2220
// File: /workspace/github_cpp_makefile_star2_O2/ahupp[P]mural/mural_server.cpp
// Function: handle_one_query(std::vector<TagInfo, std::allocator<TagInfo>> const&)
void handle_one_query(const vector<TagInfo>& tags) {

  string query;
  getline(cin, query);
  if (!query.length()) {
    cout << "DONE" << endl;
    return;
  }

  Timer t;
  vector<TagInfo> matches = find_best_fuzzy_matches(tags, query, 32);

  for (size_t i = 0; i < matches.size(); ++i) {
    const TagInfo& match = matches[i];
    cout << "MATCH\t"
         << match.symbol << "\t"
         << match.file << "\t"
         << match.row << endl;;
  }
  cout << "DONE " << t.elapsedMS() << "ms "
       << "#match: " << matches.size() << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
leaq 0x28(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x5ada(%rip), %rdi      # 0x7fd8
leaq 0x18(%rsp), %rsi
callq 0x2060
cmpq $0x0, 0x20(%rsp)
je 0x2637
leaq 0x38(%rsp), %rdi
callq 0x2904
movq %rsp, %rdi
leaq 0x18(%rsp), %rdx
pushq $0x20
popq %rcx
movq %rbx, %rsi
callq 0x2c25
pushq $0x40
popq %r13
xorl %ebp, %ebp
movq 0x5a8a(%rip), %rbx      # 0x7fc8
leaq 0x2ac4(%rip), %r14      # 0x5009
leaq 0x2ac2(%rip), %r15      # 0x500e
movq (%rsp), %r12
movq 0x8(%rsp), %rax
subq %r12, %rax
cqto
pushq $0x68
popq %rcx
idivq %rcx
cmpq %rax, %rbp
jae 0x25c0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21d0
leaq (%r12,%r13), %rsi
addq $-0x40, %rsi
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
movq %r15, %rsi
callq 0x21d0
leaq (%r12,%r13), %rsi
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
movq %r15, %rsi
callq 0x21d0
movl 0x20(%r12,%r13), %esi
movq %rax, %rdi
callq 0x2300
movq %rax, %rdi
callq 0x2100
incq %rbp
addq $0x68, %r13
jmp 0x254c
movq 0x5a01(%rip), %rdi      # 0x7fc8
leaq 0x2a42(%rip), %rsi      # 0x5010
callq 0x21d0
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x2910
movq %rbx, %rdi
movq %rax, %rsi
callq 0x21c0
leaq 0x2a24(%rip), %rsi      # 0x5016
movq %rax, %rdi
callq 0x21d0
leaq 0x2a19(%rip), %rsi      # 0x501a
movq %rax, %rdi
callq 0x21d0
movq %rax, %rdi
movq 0x8(%rsp), %rax
subq (%rsp), %rax
cqto
pushq $0x68
popq %rcx
idivq %rcx
movq %rax, %rsi
callq 0x2140
movq %rax, %rdi
callq 0x2100
movq %rsp, %rdi
callq 0x2954
jmp 0x2652
movq 0x598a(%rip), %rdi      # 0x7fc8
leaq 0x29bf(%rip), %rsi      # 0x5004
callq 0x21d0
movq %rax, %rdi
callq 0x2100
leaq 0x18(%rsp), %rdi
callq 0x20e0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x266d
movq %rax, %rbx
jmp 0x267f
jmp 0x2674
movq %rax, %rbx
movq %rsp, %rdi
callq 0x2954
leaq 0x18(%rsp), %rdi
callq 0x20e0
movq %rbx, %rdi
callq 0x2310
// File: /workspace/github_cpp_makefile_star2_O2/ahupp[P]mural/mural_server.cpp
// Function: mural_epoll_add(int, int)
void mural_epoll_add(const int epoll_fd, const int fd) {
  struct epoll_event evt;
  evt.data.fd = fd;
  evt.events = EPOLLIN;
  enforce(epoll_ctl(epoll_fd, EPOLL_CTL_ADD, fd, &evt), "mural_add_epoll");
}

// Assembly:
subq $0x18, %rsp
movl %esi, %edx
leaq 0xc(%rsp), %rcx
movl %esi, 0x4(%rcx)
movl $0x1, (%rcx)
pushq $0x1
popq %rsi
callq 0x2280
leaq 0x296f(%rip), %rsi      # 0x5023
movl %eax, %edi
callq 0x24bc
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ahupp[P]mural/mural_server.cpp
// Function: read_inotify_events(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<TagInfo, std::allocator<TagInfo>>&)
void read_inotify_events(const int inotify_fd,
                         const string& tag_file,
                         vector<TagInfo>& tags) {

  const int EVENT_SIZE = sizeof(struct inotify_event);
  const int BUF_SIZE = 1024 * (EVENT_SIZE + 16);
  char buf[BUF_SIZE];

  // The examples I've read check for EINTR, but its not clear when
  // that would happen, or what I should do about it.  So just fail
  // hard.  They also include a check for len == 0, same thing.
  int len = enforce(read(inotify_fd, buf, BUF_SIZE), "read");

  int i = 0;
  while (i < len) {

    struct inotify_event *event = (struct inotify_event*) &buf[i];

    if (event->mask & IN_CLOSE_WRITE) {
      // it can only be one thing...
      read_tags_file(tag_file, tags);
    }

    i += EVENT_SIZE + event->len;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x8000, %rsp           # imm = 0x8000
movq %rdx, %rbx
movq %rsi, %r14
movq %rsp, %rsi
movl $0x8000, %edx           # imm = 0x8000
callq 0x2290
movq %rax, %r15
leaq 0x2946(%rip), %rsi      # 0x5033
movl %r15d, %edi
callq 0x24bc
xorl %r12d, %r12d
cmpl %r15d, %r12d
jge 0x2721
movslq %r12d, %r13
testb $0x8, 0x4(%rsp,%r13)
je 0x2713
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3b7d
movl 0xc(%rsp,%r13), %eax
addl %eax, %r12d
addl $0x10, %r12d
jmp 0x26f8
addq $0x8000, %rsp           # imm = 0x8000
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/ahupp[P]mural/mural_server.cpp
// Function: Timer::elapsedMS()
long elapsedMS() {
    struct timespec end;
    clock_gettime(CLOCK_MONOTONIC, &end);

    return 1000*(end.tv_sec - start.tv_sec) +
      (long)((end.tv_nsec - start.tv_nsec)/(1000*1000));
  }

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
pushq $0x1
popq %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x21b0
movq (%r14), %rcx
movq 0x8(%r14), %rax
subq (%rbx), %rcx
subq 0x8(%rbx), %rax
imulq $0x3e8, %rcx, %rcx      # imm = 0x3E8
movl $0xf4240, %esi          # imm = 0xF4240
cqto
idivq %rsi
addq %rcx, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/ahupp[P]mural/search.cpp
// Function: is_fuzzy_match(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int*)
bool is_fuzzy_match(const string& symbol, const string& query,
                    int* inter_count_ret) {

  size_t qi = 0;
  size_t si = 0;
  int lastmatch = -1;

  // The number of characters between fuzzy matches.  This is 0 if
  // query is a substring of symbol.  Larger values of inter_count
  // will generally be worse matches than smaller values.
  int inter_count = 0;

  while (qi < query.length() && si < symbol.length()) {
    if (query[qi] == symbol[si]) {
      if (lastmatch != -1) {
        inter_count += si - lastmatch - 1;
      }
      lastmatch = si;
      ++qi;
    }
    ++si;
  }
  *inter_count_ret = inter_count;
  return qi == query.length();
}

// Assembly:
pushq %rbp
pushq %rbx
movq (%rsi), %rcx
movq 0x8(%rsi), %rax
movq (%rdi), %rsi
movq 0x8(%rdi), %rdi
xorl %r8d, %r8d
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
xorl %r9d, %r9d
xorl %r10d, %r10d
xorl %r11d, %r11d
cmpq %rax, %r9
jae 0x2b25
cmpq %rdi, %r10
jae 0x2b25
movb (%rcx,%r9), %bpl
cmpb (%rsi,%r10), %bpl
jne 0x2b20
movl %ebx, %ebp
notl %ebp
addl %r10d, %ebp
cmpl $-0x1, %ebx
cmovel %r8d, %ebp
addl %ebp, %r11d
incq %r9
movl %r10d, %ebx
incq %r10
jmp 0x2af5
movl %r11d, (%rdx)
cmpq %rax, %r9
sete %al
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ahupp[P]mural/search.cpp
// Function: is_better_match(std::pair<TagInfo const*, int> const&, std::pair<TagInfo const*, int> const&)
bool is_better_match(const FuzzyMatch& lhs, const FuzzyMatch& rhs) {
  if (lhs.second < rhs.second) {
    return true;
  } else if (lhs.second == rhs.second) {
    if (lhs.first->symbol.length() < rhs.first->symbol.length()) {
      return true;
    }
  }
  return false;
}

// Assembly:
movl 0x8(%rsi), %ecx
movb $0x1, %al
cmpl %ecx, 0x8(%rdi)
jl 0x2b4f
jne 0x2b4d
movq (%rdi), %rcx
movq 0x8(%rcx), %rcx
movq (%rsi), %rdx
cmpq 0x8(%rdx), %rcx
jb 0x2b4f
xorl %eax, %eax
retq