LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: ddunbar[P]PDSample/./WeightedDiscretePDF.cpp
// Function: WeightedDiscretePDF<int>::choose(float)
T WeightedDiscretePDF<T>::choose(float p)
{
	if (p<0.0 || p>=1.0) {
		throw std::domain_error("choose: argument(p) outside valid range");
	} else if (!m_root) {
		throw std::logic_error("choose: choose() called on empty tree");
	} else {
		float w = m_root->sumWeights * p;
		WDPDF_Node<T> *n = m_root;

		while (1) {
			if (n->left) {
				if (w<n->left->sumWeights) {
					n = n->left;
					continue;
				} else {
					w -= n->left->sumWeights;
				}
			}
			if (w<n->weight || !n->right) {
				break; // !n->right condition shouldn't be necessary, just sanity check
			}
			w -= n->weight;
			n = n->right;
		}

		return n->key;
	}
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movss %xmm0, 0x3c(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x18(%rsp)
movss 0x3c(%rsp), %xmm0
cvtss2sd %xmm0, %xmm1
xorps %xmm0, %xmm0
ucomisd %xmm1, %xmm0
ja 0x7294
movss 0x3c(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0xf17a(%rip), %xmm1     # 0x16408
ucomisd %xmm1, %xmm0
jb 0x72ec
movl $0x10, %edi
callq 0x20a0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x10(%rsp)
leaq 0x11096(%rip), %rsi     # 0x18346
callq 0x20e0
jmp 0x72b7
movq 0x10(%rsp), %rdi
movq 0x18cfd(%rip), %rsi     # 0x1ffc0
movq 0x18d06(%rip), %rdx     # 0x1ffd0
callq 0x22e0
movq 0x10(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
callq 0x2100
jmp 0x7422
movq 0x18(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x734f
movl $0x10, %edi
callq 0x20a0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x8(%rsp)
leaq 0x1105b(%rip), %rsi     # 0x1836e
callq 0x2260
jmp 0x731a
movq 0x8(%rsp), %rdi
movq 0x18cc2(%rip), %rsi     # 0x1ffe8
movq 0x18cab(%rip), %rdx     # 0x1ffd8
callq 0x22e0
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
callq 0x2100
jmp 0x7422
movq 0x18(%rsp), %rax
movq (%rax), %rcx
movss 0x28(%rcx), %xmm0
mulss 0x3c(%rsp), %xmm0
movss %xmm0, 0x28(%rsp)
movq (%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
cmpq $0x0, 0x10(%rax)
je 0x73c5
movss 0x28(%rsp), %xmm1
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movss 0x28(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x73a5
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x20(%rsp)
jmp 0x7370
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movss 0x28(%rax), %xmm1
movss 0x28(%rsp), %xmm0
subss %xmm1, %xmm0
movss %xmm0, 0x28(%rsp)
jmp 0x73c5
movss 0x28(%rsp), %xmm1
movq 0x20(%rsp), %rax
movss 0x24(%rax), %xmm0
ucomiss %xmm1, %xmm0
ja 0x73e6
movq 0x20(%rsp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x73e8
jmp 0x7415
movq 0x20(%rsp), %rax
movss 0x24(%rax), %xmm1
movss 0x28(%rsp), %xmm0
subss %xmm1, %xmm0
movss %xmm0, 0x28(%rsp)
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x20(%rsp)
jmp 0x7370
movq 0x20(%rsp), %rax
movl 0x20(%rax), %eax
addq $0x48, %rsp
retq
movq 0x30(%rsp), %rdi
callq 0x22f0
nopl (%rax)
// File: ddunbar[P]PDSample/./WeightedDiscretePDF.cpp
// Function: WeightedDiscretePDF<int>::remove(int)
void WeightedDiscretePDF<T>::remove(T item)
{
	WDPDF_Node<T> **np = lookup(item, 0);
	WDPDF_Node<T> *child, *n = *np;

	if (!n) {
		throw std::domain_error("remove: argument(item) not in tree");
	} else {
		if (n->left) {
			WDPDF_Node<T> **leftMaxp = &n->left;

			while ((*leftMaxp)->right)
				leftMaxp = &(*leftMaxp)->right;

			n->key = (*leftMaxp)->key;
			n->weight = (*leftMaxp)->weight;

			np = leftMaxp;
			n = *np;
		}

			// node now has at most one child

		child = n->left?n->left:n->right;
		*np = child;

		if (child) {
			child->parent = n->parent;

			if (n->isBlack()) {
				lengthen(child);
			}
		}

		propogateSumsUp(n->parent);

		n->left = n->right = 0;
		delete n;
	}
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movl %esi, 0x5c(%rsp)
movq 0x60(%rsp), %rdi
movq %rdi, 0x20(%rsp)
movl 0x5c(%rsp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0xf930
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x40(%rsp)
cmpq $0x0, 0x40(%rsp)
jne 0x7706
movl $0x10, %edi
callq 0x20a0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x18(%rsp)
leaq 0x10cca(%rip), %rsi     # 0x18394
callq 0x20e0
jmp 0x76d1
movq 0x18(%rsp), %rdi
movq 0x188e3(%rip), %rsi     # 0x1ffc0
movq 0x188ec(%rip), %rdx     # 0x1ffd0
callq 0x22e0
movq 0x18(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x38(%rsp)
movl %eax, 0x34(%rsp)
callq 0x2100
jmp 0x785c
movq 0x40(%rsp), %rax
cmpq $0x0, 0x10(%rax)
je 0x7783
movq 0x40(%rsp), %rax
addq $0x10, %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq (%rax), %rax
cmpq $0x0, 0x18(%rax)
je 0x7742
movq 0x28(%rsp), %rax
movq (%rax), %rax
addq $0x18, %rax
movq %rax, 0x28(%rsp)
jmp 0x7720
movq 0x28(%rsp), %rax
movq (%rax), %rax
movl 0x20(%rax), %ecx
movq 0x40(%rsp), %rax
movl %ecx, 0x20(%rax)
movq 0x28(%rsp), %rax
movq (%rax), %rax
movss 0x24(%rax), %xmm0
movq 0x40(%rsp), %rax
movss %xmm0, 0x24(%rax)
movq 0x28(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
cmpq $0x0, 0x10(%rax)
je 0x779f
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
jmp 0x77ad
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rcx
movq 0x50(%rsp), %rax
movq %rcx, (%rax)
cmpq $0x0, 0x48(%rsp)
je 0x77ff
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x40(%rsp), %rdi
callq 0xf4f0
testb $0x1, %al
jne 0x77ee
jmp 0x77fd
movq 0x20(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0xf9d0
jmp 0x77ff
movq 0x20(%rsp), %rdi
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rsi
callq 0xf470
movq 0x40(%rsp), %rax
movq $0x0, 0x18(%rax)
movq 0x40(%rsp), %rax
movq $0x0, 0x10(%rax)
movq 0x40(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x7855
movq 0x8(%rsp), %rdi
callq 0xe290
movq 0x8(%rsp), %rdi
movl $0x30, %esi
callq 0x21b0
jmp 0x7857
addq $0x68, %rsp
retq
movq 0x38(%rsp), %rdi
callq 0x22f0
nopw %cs:(%rax,%rax)
// File: ddunbar[P]PDSample/./WeightedDiscretePDF.cpp
// Function: WeightedDiscretePDF<int>::update(int, float)
void WeightedDiscretePDF<T>::update(T item, float weight)
{
	WDPDF_Node<T> *n = *lookup(item, 0);

	if (!n) {
		throw std::domain_error("update: argument(item) not in tree");
	} else {
		float delta = weight - n->weight;
		n->weight = weight;

		for (; n; n=n->parent) {
			n->sumWeights += delta;
		}
	}
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movss %xmm0, 0x28(%rsp)
movq 0x30(%rsp), %rdi
movl 0x2c(%rsp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0xf930
movq (%rax), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0x78fa
movl $0x10, %edi
callq 0x20a0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x8(%rsp)
leaq 0x10af6(%rip), %rsi     # 0x183b7
callq 0x20e0
jmp 0x78c8
movq 0x8(%rsp), %rdi
movq 0x186ec(%rip), %rsi     # 0x1ffc0
movq 0x186f5(%rip), %rdx     # 0x1ffd0
callq 0x22e0
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x18(%rsp)
movl %eax, 0x14(%rsp)
callq 0x2100
jmp 0x7954
movss 0x28(%rsp), %xmm0
movq 0x20(%rsp), %rax
subss 0x24(%rax), %xmm0
movss %xmm0, 0x10(%rsp)
movss 0x28(%rsp), %xmm0
movq 0x20(%rsp), %rax
movss %xmm0, 0x24(%rax)
cmpq $0x0, 0x20(%rsp)
je 0x794d
movss 0x10(%rsp), %xmm0
movq 0x20(%rsp), %rax
addss 0x28(%rax), %xmm0
movss %xmm0, 0x28(%rax)
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x20(%rsp)
jmp 0x7920
jmp 0x794f
addq $0x38, %rsp
retq
movq 0x18(%rsp), %rdi
callq 0x22f0
nop
// File: ddunbar[P]PDSample/./quasisampler_prototype.h
// Function: Quasisampler::getSamplingPoints()
std::vector<Point2D> getSamplingPoints()
  {
    if (root) delete root;
    std::vector<Point2D> pointlist;
    
    buildAdaptiveSubdivision(); 
    collectPoints(pointlist);
    return pointlist;
  }

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x8(%rsp)
movq %rdi, %rax
movq %rax, 0x10(%rsp)
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x8(%rax)
je 0x7aa8
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x7aa6
movq (%rsp), %rdi
callq 0x84c0
movq (%rsp), %rdi
movl $0x78, %esi
callq 0x21b0
jmp 0x7aa8
movq 0x8(%rsp), %rdi
movb $0x0, 0x37(%rsp)
callq 0x8880
movq 0x18(%rsp), %rdi
movl $0x6, %esi
callq 0x8890
jmp 0x7ac8
movq 0x8(%rsp), %rsi
movq 0x18(%rsp), %rdi
movl $0x1, %edx
callq 0x8b90
jmp 0x7ade
movb $0x1, 0x37(%rsp)
testb $0x1, 0x37(%rsp)
jne 0x7b10
jmp 0x7b06
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
callq 0x7c20
jmp 0x7b1a
movq 0x8(%rsp), %rdi
callq 0x7c20
movq 0x10(%rsp), %rax
addq $0x48, %rsp
retq
movq 0x28(%rsp), %rdi
callq 0x22f0
nopw %cs:(%rax,%rax)
nop
// File: ddunbar[P]PDSample/./quasisampler_prototype.h
// Function: Quasisampler::TileNode::collapse()
void collapse()
    {
      // Recursively prune the tree.
      for (unsigned i=0; i<children.size(); i++) delete children[i];
      terminal = true;
      children.clear();
    }

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movl $0x0, 0x1c(%rsp)
movq 0x10(%rsp), %rdi
movl 0x1c(%rsp), %eax
movq %rax, 0x8(%rsp)
addq $0x60, %rdi
callq 0x8600
movq %rax, %rcx
movq 0x8(%rsp), %rax
cmpq %rcx, %rax
jae 0x8586
movq 0x10(%rsp), %rdi
addq $0x60, %rdi
movl 0x1c(%rsp), %eax
movl %eax, %esi
callq 0x8620
movq (%rax), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x8577
movq (%rsp), %rdi
callq 0x84c0
movq (%rsp), %rdi
movl $0x78, %esi
callq 0x21b0
jmp 0x8579
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x851b
movq 0x10(%rsp), %rdi
movb $0x1, 0x5c(%rdi)
addq $0x60, %rdi
callq 0x8640
addq $0x28, %rsp
retq
nopl (%rax)
// File: ddunbar[P]PDSample/./quasisampler_prototype.h
// Function: Quasisampler::collectPoints(std::vector<Point2D, std::allocator<Point2D>>&, bool)
void collectPoints( 
    std::vector<Point2D> &pointlist,
    bool filterBounds = true )
  {
    pointlist.clear();

    Point2D pt, pt_displaced;
    unsigned importance;
    TileLeafIterator it(root);
    do {
      pt = it->getP1();  
      if ( it->isSamplingType() ) // Only "pentagonal" tiles generate sampling points.
      {   
        importance = getImportanceAt_bounded( pt );

        // Threshold the function against the F-Code value.           
        if ( importance >= calcFCodeValue( it->getFCode() , 2*it->getLevel() ) )
        {
          // Get the displaced point using the lookup table.
          pt_displaced = it->getDisplacedSamplingPoint(importance);

          if ( !filterBounds ||
            (pt_displaced.x>=0 && pt_displaced.x<width && 
            pt_displaced.y>=0 && pt_displaced.y<height) )
          {
            pointlist.push_back(pt_displaced); // collect point.
          }
        }
      }

    } while ( it.next() );

  }

// Assembly:
subq $0x88, %rsp
movb %dl, %al
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
andb $0x1, %al
movb %al, 0x77(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x78(%rsp), %rdi
callq 0xc020
leaq 0x60(%rsp), %rdi
callq 0xa030
leaq 0x50(%rsp), %rdi
callq 0xa030
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rsi
leaq 0x40(%rsp), %rdi
callq 0x9060
leaq 0x40(%rsp), %rdi
callq 0x9090
movq %rax, %rdi
callq 0x9240
movsd %xmm0, 0x30(%rsp)
movsd %xmm1, 0x38(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x68(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x9090
movq %rax, %rdi
callq 0x90b0
testb $0x1, %al
jne 0x8c37
jmp 0x8d48
movq 0x8(%rsp), %rdi
movq 0x60(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x28(%rsp)
movsd 0x20(%rsp), %xmm0
movsd 0x28(%rsp), %xmm1
callq 0x9190
movl %eax, 0x4c(%rsp)
movl 0x4c(%rsp), %eax
movl %eax, 0x4(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x9090
movq %rax, %rdi
callq 0xc0c0
movl %eax, (%rsp)
leaq 0x40(%rsp), %rdi
callq 0x9090
movq %rax, %rdi
callq 0x90a0
movl (%rsp), %edi
movl %eax, %esi
shll %esi
callq 0xc040
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jb 0x8d46
leaq 0x40(%rsp), %rdi
callq 0x9090
movq %rax, %rdi
movl 0x4c(%rsp), %esi
callq 0xc0d0
movsd %xmm0, 0x10(%rsp)
movsd %xmm1, 0x18(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x58(%rsp)
testb $0x1, 0x77(%rsp)
je 0x8d35
movsd 0x50(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x8d44
movq 0x8(%rsp), %rax
movsd 0x50(%rsp), %xmm1
movsd 0x10(%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x8d44
movsd 0x58(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x8d44
movq 0x8(%rsp), %rax
movsd 0x58(%rsp), %xmm1
movsd 0x18(%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x8d44
movq 0x78(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xc160
jmp 0x8d46
jmp 0x8d48
jmp 0x8d4a
leaq 0x40(%rsp), %rdi
callq 0x9fd0
testb $0x1, %al
jne 0x8bea
addq $0x88, %rsp
retq
nopw %cs:(%rax,%rax)
nop
// File: ddunbar[P]PDSample/./quasisampler_prototype.h
// Function: Quasisampler::TileNode::TileNode(double, double)
TileNode( double roi_width,  double roi_height)
    {
      double side = MAX(roi_width,roi_height);
      double scale = 2.0 * side;
      Point2D offset(PHI*PHI/2.0-0.25,0.125);
      *this = TileNode(NULL, TileTypeF,offset*-scale,15,0,0,scale);
    }

// Assembly:
subq $0xf8, %rsp
movq %rdi, 0xf0(%rsp)
movsd %xmm0, 0xe8(%rsp)
movsd %xmm1, 0xe0(%rsp)
movq 0xf0(%rsp), %rdi
movq %rdi, 0x18(%rsp)
addq $0x18, %rdi
callq 0xa030
movq 0x18(%rsp), %rdi
addq $0x28, %rdi
callq 0xa030
movq 0x18(%rsp), %rdi
addq $0x38, %rdi
callq 0xa030
movq 0x18(%rsp), %rdi
addq $0x60, %rdi
movq %rdi, 0x20(%rsp)
callq 0xa040
movsd 0xe8(%rsp), %xmm0
ucomisd 0xe0(%rsp), %xmm0
jbe 0x8e8b
movsd 0xe8(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
jmp 0x8e9a
movsd 0xe0(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0xd8(%rsp)
movsd 0xd8(%rsp), %xmm0
addsd %xmm0, %xmm0
movsd %xmm0, 0xd0(%rsp)
leaq 0xc0(%rsp), %rdi
movsd 0xd5a9(%rip), %xmm0     # 0x16478
movsd 0xd5a9(%rip), %xmm1     # 0x16480
callq 0x6a50
jmp 0x8ede
movaps 0xd61b(%rip), %xmm1     # 0x16500
movsd 0xd0(%rsp), %xmm0
pxor %xmm1, %xmm0
leaq 0xc0(%rsp), %rdi
callq 0xa050
movsd %xmm1, (%rsp)
movsd %xmm0, 0x8(%rsp)
jmp 0x8f0c
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movsd %xmm1, 0x28(%rsp)
movsd %xmm0, 0x30(%rsp)
movsd 0xd0(%rsp), %xmm2
movsd 0x28(%rsp), %xmm0
movsd 0x30(%rsp), %xmm1
xorl %r9d, %r9d
movl %r9d, %esi
leaq 0x38(%rsp), %rdi
movl $0x5, %edx
movl $0xf, %ecx
movl %r9d, %r8d
callq 0xa0a0
jmp 0x8f57
movq 0x18(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0xa870
jmp 0x8f68
leaq 0x38(%rsp), %rdi
callq 0x84c0
addq $0xf8, %rsp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
jmp 0x8fae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x84c0
movq 0x20(%rsp), %rdi
callq 0x85a0
movq 0xb8(%rsp), %rdi
callq 0x22f0
nopw %cs:(%rax,%rax)
nop
// File: ddunbar[P]PDSample/./quasisampler_prototype.h
// Function: Quasisampler::subdivideAll(int)
void subdivideAll(int times=1)
  {
    if (!root) return;
    TileNode *tmp;
    for (int i=0;i<times;i++)  
    {
      TileLeafIterator it(root);
      do { 
        tmp = *it;
        it.next();
        tmp->refine();
      }
      while (*it);
    }
  }

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rax)
jne 0x8ff0
jmp 0x9057
movl $0x0, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
cmpl 0x2c(%rsp), %eax
jge 0x9057
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rsi
leaq 0x10(%rsp), %rdi
callq 0x9060
leaq 0x10(%rsp), %rdi
callq 0x9260
movq %rax, 0x20(%rsp)
leaq 0x10(%rsp), %rdi
callq 0x9fd0
movq 0x20(%rsp), %rdi
callq 0x9270
leaq 0x10(%rsp), %rdi
callq 0x9260
cmpq $0x0, %rax
jne 0x9015
jmp 0x904a
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x8ff8
addq $0x38, %rsp
retq
nopl (%rax)
// File: ddunbar[P]PDSample/./quasisampler_prototype.h
// Function: Quasisampler::getReqSubdivisionLevel(unsigned int)
static unsigned getReqSubdivisionLevel( unsigned importance )
  {
    if (importance==0) return 0;
    unsigned nbits = (unsigned)(log( (double)importance*SQRT5 + 1.0 ) / LOG_PHI) - 1;
    if (nbits<1) nbits = 1;
    return (unsigned)ceil(0.5*nbits);
  }

// Assembly:
subq $0x18, %rsp
movl %edi, 0x10(%rsp)
cmpl $0x0, 0x10(%rsp)
jne 0x9109
movl $0x0, 0x14(%rsp)
jmp 0x9179
movl 0x10(%rsp), %eax
cvtsi2sd %rax, %xmm0
movsd 0xd36e(%rip), %xmm1     # 0x16488
mulsd %xmm1, %xmm0
movsd 0xd2e2(%rip), %xmm1     # 0x16408
addsd %xmm1, %xmm0
callq 0x2150
movsd 0xd359(%rip), %xmm1     # 0x16490
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
subl $0x1, %eax
movl %eax, 0xc(%rsp)
cmpl $0x1, 0xc(%rsp)
jae 0x9156
movl $0x1, 0xc(%rsp)
movl 0xc(%rsp), %eax
cvtsi2sd %rax, %xmm0
movsd 0xceb1(%rip), %xmm1     # 0x16018
mulsd %xmm1, %xmm0
callq 0x2060
cvttsd2si %xmm0, %rax
movl %eax, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: ddunbar[P]PDSample/./quasisampler_prototype.h
// Function: Quasisampler::getImportanceAt_bounded(Point2D)
unsigned getImportanceAt_bounded(Point2D pt)
  {
    if (pt.x>=0 && pt.x<width && pt.y>=0 && pt.y<height) 
      return getImportanceAt(pt);
    else 
      return 0;
  }

// Assembly:
subq $0x38, %rsp
movsd %xmm0, 0x20(%rsp)
movsd %xmm1, 0x28(%rsp)
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
movsd 0x20(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x9226
movq (%rsp), %rax
movsd 0x20(%rsp), %xmm1
movsd 0x10(%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x9226
movsd 0x28(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x9226
movq (%rsp), %rax
movsd 0x28(%rsp), %xmm1
movsd 0x18(%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x9226
movq (%rsp), %rdi
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rsp)
movsd 0x8(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
movq (%rdi), %rax
callq *0x10(%rax)
movl %eax, 0x34(%rsp)
jmp 0x922e
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw (%rax,%rax)
// File: ddunbar[P]PDSample/./quasisampler_prototype.h
// Function: Quasisampler::TileLeafIterator::next()
bool next()
    {
      TileNode* s = shape->nextLeaf();
      if (s)
      {
        shape = s;
        return true;
      }
      else
      {
        shape = s;
        return false;
      }
    }

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq (%rax), %rdi
callq 0xbe70
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
je 0xa00c
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
movq %rcx, (%rax)
movb $0x1, 0x27(%rsp)
jmp 0xa01e
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
movq %rcx, (%rax)
movb $0x0, 0x27(%rsp)
movb 0x27(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
retq
nopl (%rax)
// File: ddunbar[P]PDSample/./quasisampler_prototype.h
// Function: Quasisampler::TileNode::nextLeaf()
TileNode* nextLeaf()
    {
      TileNode* tmp = this;
      do
      {
        tmp = tmp->nextNode();
        if ( !tmp ) return NULL;
        if ( tmp->terminal ) return tmp;
      }
      while (1);
    }

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, (%rsp)
movq (%rsp), %rdi
callq 0xbed0
movq %rax, (%rsp)
cmpq $0x0, (%rsp)
jne 0xbea1
movq $0x0, 0x10(%rsp)
jmp 0xbec2
movq (%rsp), %rax
testb $0x1, 0x5c(%rax)
je 0xbeb6
movq (%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0xbec2
jmp 0xbeb8
movb $0x1, %al
testb $0x1, %al
jne 0xbe82
jmp 0xbec0
ud2
movq 0x10(%rsp), %rax
addq $0x18, %rsp
retq
nopl (%rax)
// File: ddunbar[P]PDSample/./quasisampler_prototype.h
// Function: Quasisampler::TileNode::nextNode()
TileNode* nextNode()
    {
      if (!terminal) return children[0];
      
      if (level == 0) return NULL; // single node case.

      if ( parent_slot < parent->children.size()-1 )
        return parent->children[parent_slot+1];

      // last child case
      TileNode* tmp = this;
      do
      {
        tmp = tmp->parent;
      }
      while ( (tmp->level != 0) && (tmp->parent_slot ==  tmp->parent->children.size()-1) );

      if (tmp->level == 0) return NULL; // last node
      return tmp->parent->children[tmp->parent_slot+1];

    }

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x18(%rsp)
testb $0x1, 0x5c(%rax)
jne 0xbf08
movq 0x18(%rsp), %rdi
addq $0x60, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x8620
movq (%rax), %rax
movq %rax, 0x30(%rsp)
jmp 0xc015
movq 0x18(%rsp), %rax
cmpl $0x0, (%rax)
jne 0xbf20
movq $0x0, 0x30(%rsp)
jmp 0xc015
movq 0x18(%rsp), %rax
movl 0x58(%rax), %ecx
movq %rcx, 0x10(%rsp)
movq 0x50(%rax), %rdi
addq $0x60, %rdi
callq 0x8600
movq %rax, %rcx
movq 0x10(%rsp), %rax
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0xbf74
movq 0x18(%rsp), %rax
movq 0x50(%rax), %rdi
addq $0x60, %rdi
movl 0x58(%rax), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
callq 0x8620
movq (%rax), %rax
movq %rax, 0x30(%rsp)
jmp 0xc015
movq 0x18(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq 0x50(%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rcx
xorl %eax, %eax
cmpl $0x0, (%rcx)
movb %al, 0xf(%rsp)
je 0xbfcf
movq 0x20(%rsp), %rax
movl 0x58(%rax), %eax
movq %rax, (%rsp)
movq 0x20(%rsp), %rax
movq 0x50(%rax), %rdi
addq $0x60, %rdi
callq 0x8600
movq %rax, %rcx
movq (%rsp), %rax
subq $0x1, %rcx
cmpq %rcx, %rax
sete %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0xbf7e
movq 0x20(%rsp), %rax
cmpl $0x0, (%rax)
jne 0xbfec
movq $0x0, 0x30(%rsp)
jmp 0xc015
movq 0x20(%rsp), %rax
movq 0x50(%rax), %rdi
addq $0x60, %rdi
movq 0x20(%rsp), %rax
movl 0x58(%rax), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
callq 0x8620
movq (%rax), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nop
// File: ddunbar[P]PDSample/./quasisampler_prototype.h
// Function: Quasisampler::calcFCodeValue(unsigned int, unsigned int)
static unsigned calcFCodeValue(unsigned bitsequence,unsigned nbits)
  {
    unsigned i_s = 0;
    for (unsigned i=0; i<nbits ;i++ )
    {
      if ( bitsequence & ( 1u<<(nbits-i-1) ) ) i_s += fibonacci(i+2);
    }
    return i_s;
  }

// Assembly:
subq $0x18, %rsp
movl %edi, 0x14(%rsp)
movl %esi, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
movl $0x0, 0x8(%rsp)
movl 0x8(%rsp), %eax
cmpl 0x10(%rsp), %eax
jae 0xc0a8
movl 0x14(%rsp), %eax
movl 0x10(%rsp), %ecx
subl 0x8(%rsp), %ecx
subl $0x1, %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0xc099
movl 0x8(%rsp), %edi
addl $0x2, %edi
callq 0xc2e0
addl 0xc(%rsp), %eax
movl %eax, 0xc(%rsp)
jmp 0xc09b
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0xc05c
movl 0xc(%rsp), %eax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: ddunbar[P]PDSample/./quasisampler_prototype.h
// Function: Quasisampler::calcDisplacementVector(unsigned int, unsigned int, int)
static Point2D calcDisplacementVector(unsigned importance, unsigned f_code, int dir)
  {
    unsigned i_s = calcStructuralIndex(f_code);
    unsigned i_v = calcImportanceIndex(importance);

    return  
      vvect[dir]        * lut[i_v][i_s][0] + // u component
      vvect[(dir+5)%20] * lut[i_v][i_s][1] ; // v component
  }

// Assembly:
subq $0x58, %rsp
movl %edi, 0x44(%rsp)
movl %esi, 0x40(%rsp)
movl %edx, 0x3c(%rsp)
movl 0x40(%rsp), %edi
callq 0xc470
movl %eax, 0x38(%rsp)
movl 0x44(%rsp), %edi
callq 0xc490
movl %eax, 0x34(%rsp)
movslq 0x3c(%rsp), %rax
shlq $0x4, %rax
leaq 0x13e56(%rip), %rdi     # 0x201e0
movq %rdi, (%rsp)
addq %rax, %rdi
movl 0x34(%rsp), %eax
imulq $0x150, %rax, %rax      # imm = 0x150
leaq 0xa20d(%rip), %rcx      # 0x165b0
movq %rcx, 0x8(%rsp)
addq %rax, %rcx
movl 0x38(%rsp), %eax
shlq $0x4, %rax
movsd (%rax,%rcx), %xmm0
callq 0xa050
movq (%rsp), %rdi
movq 0x8(%rsp), %rcx
movsd %xmm0, 0x20(%rsp)
movsd %xmm1, 0x28(%rsp)
movl 0x3c(%rsp), %esi
movl %esi, %edx
addl $0x5, %edx
movl %esi, %eax
movslq %edx, %rdx
imulq $0x66666667, %rdx, %rsi # imm = 0x66666667
movq %rsi, %rdx
shrq $0x3f, %rdx
sarq $0x23, %rsi
addl %edx, %esi
shll $0x2, %esi
movl %esi, %edx
leal (%rdx,%rdx,4), %esi
negl %esi
movl %esi, %edx
leal 0x5(%rax,%rdx), %eax
cltq
shlq $0x4, %rax
addq %rax, %rdi
movl 0x34(%rsp), %eax
imulq $0x150, %rax, %rax      # imm = 0x150
addq %rax, %rcx
movl 0x38(%rsp), %eax
shlq $0x4, %rax
movsd 0x8(%rax,%rcx), %xmm0
callq 0xa050
movsd %xmm0, 0x10(%rsp)
movsd %xmm1, 0x18(%rsp)
leaq 0x20(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xa950
movsd %xmm0, 0x48(%rsp)
movsd %xmm1, 0x50(%rsp)
movsd 0x48(%rsp), %xmm0
movsd 0x50(%rsp), %xmm1
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)
// File: ddunbar[P]PDSample/./WeightedDiscretePDF.cpp
// Function: WeightedDiscretePDF<int>::split(WDPDF_Node<int>*)
void WeightedDiscretePDF<T>::split(WDPDF_Node<T> *n)
{
	if (n->left) n->left->markBlack();
	if (n->right) n->right->markBlack();

	if (n->parent) {
		WDPDF_Node<T> *p = n->parent;

		n->markRed();

		if (p->isRed()) {
			p->parent->markRed();

				// not same direction
			if (!(	(n==p->left && p==p->parent->left) || 
					(n==p->right && p==p->parent->right))) {
			  rotate(n);
			  p = n;
			}

			rotate(p);
			p->markBlack();
		}
	}
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rax
cmpq $0x0, 0x10(%rax)
je 0xf332
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0xf550
movq 0x18(%rsp), %rax
cmpq $0x0, 0x18(%rax)
je 0xf34c
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0xf550
movq 0x18(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0xf411
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
callq 0xf560
movq 0x10(%rsp), %rdi
callq 0xf570
testb $0x1, %al
jne 0xf387
jmp 0xf40f
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0xf560
movq 0x18(%rsp), %rax
movq 0x10(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jne 0xf3b9
movq 0x10(%rsp), %rax
movq 0x10(%rsp), %rcx
movq 0x8(%rcx), %rcx
cmpq 0x10(%rcx), %rax
je 0xf3f6
movq 0x18(%rsp), %rax
movq 0x10(%rsp), %rcx
cmpq 0x18(%rcx), %rax
jne 0xf3dd
movq 0x10(%rsp), %rax
movq 0x10(%rsp), %rcx
movq 0x8(%rcx), %rcx
cmpq 0x18(%rcx), %rax
je 0xf3f6
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0xf580
movq 0x18(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0xf580
movq 0x10(%rsp), %rdi
callq 0xf550
jmp 0xf411
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: ddunbar[P]PDSample/./WeightedDiscretePDF.cpp
// Function: WDPDF_Node<int>::WDPDF_Node(int, float, WDPDF_Node<int>*)
WDPDF_Node<T>::WDPDF_Node(T key_, float weight_, WDPDF_Node<T> *parent_)
{
	m_mark = false;

	key = key_;
	weight = weight_;
	sumWeights = 0;
	left = right = 0;
	parent = parent_;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movl %esi, -0xc(%rsp)
movss %xmm0, -0x10(%rsp)
movq %rdx, -0x18(%rsp)
movq -0x8(%rsp), %rax
movb $0x0, (%rax)
movl -0xc(%rsp), %ecx
movl %ecx, 0x20(%rax)
movss -0x10(%rsp), %xmm0
movss %xmm0, 0x24(%rax)
xorps %xmm0, %xmm0
movss %xmm0, 0x28(%rax)
movq $0x0, 0x18(%rax)
movq $0x0, 0x10(%rax)
movq -0x18(%rsp), %rcx
movq %rcx, 0x8(%rax)
retq
// File: ddunbar[P]PDSample/./WeightedDiscretePDF.cpp
// Function: WeightedDiscretePDF<int>::rotate(WDPDF_Node<int>*)
void WeightedDiscretePDF<T>::rotate(WDPDF_Node<T> *n)
{
	WDPDF_Node<T> *p=n->parent, *pp=p->parent;

	n->parent = pp;
	p->parent = n;

	if (n==p->left) {
		p->left = n->right;
		n->right = p;
		if (p->left) p->left->parent = p;
	} else {
		p->right = n->left;
		n->left = p;
		if (p->right) p->right->parent = p;
	}

	n->setSum();
	p->setSum();
	
	if (!pp) {
		m_root = n;
	} else {
		if (p==pp->left) {
			pp->left = n;
		} else {
			pp->right = n;
		}
	}
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rsp), %rax
movq 0x10(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jne 0xf61f
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x10(%rsp), %rax
cmpq $0x0, 0x10(%rax)
je 0xf61d
movq 0x10(%rsp), %rcx
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
movq %rcx, 0x8(%rax)
jmp 0xf65f
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x10(%rsp), %rax
cmpq $0x0, 0x18(%rax)
je 0xf65d
movq 0x10(%rsp), %rcx
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movq %rcx, 0x8(%rax)
jmp 0xf65f
movq 0x18(%rsp), %rdi
callq 0xf6c0
movq 0x10(%rsp), %rdi
callq 0xf6c0
cmpq $0x0, 0x8(%rsp)
jne 0xf689
movq (%rsp), %rax
movq 0x18(%rsp), %rcx
movq %rcx, (%rax)
jmp 0xf6b9
movq 0x10(%rsp), %rax
movq 0x8(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jne 0xf6a9
movq 0x18(%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x10(%rax)
jmp 0xf6b7
movq 0x18(%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x18(%rax)
jmp 0xf6b9
addq $0x28, %rsp
retq
nop
// File: ddunbar[P]PDSample/./WeightedDiscretePDF.cpp
// Function: WeightedDiscretePDF<int>::lookup(int, WDPDF_Node<int>**)
WDPDF_Node<T> **WeightedDiscretePDF<T>::lookup(T item, WDPDF_Node<T> **parent_out)
{
	WDPDF_Node<T> *n, *p=0, **np=&m_root;

	while ((n = *np)) {
		if (n->key==item) {
			break;
		} else {
			p = n;
			if (item<n->key) {
				np = &n->left;
			} else {
				np = &n->right;
			}
		}
	}

	if (parent_out)
		*parent_out = p;
	return np;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movl %esi, -0xc(%rsp)
movq %rdx, -0x18(%rsp)
movq -0x8(%rsp), %rax
movq $0x0, -0x28(%rsp)
movq %rax, -0x30(%rsp)
movq -0x30(%rsp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rsp)
cmpq $0x0, %rax
je 0xf9ae
movq -0x20(%rsp), %rax
movl 0x20(%rax), %eax
cmpl -0xc(%rsp), %eax
jne 0xf974
jmp 0xf9ae
movq -0x20(%rsp), %rax
movq %rax, -0x28(%rsp)
movl -0xc(%rsp), %eax
movq -0x20(%rsp), %rcx
cmpl 0x20(%rcx), %eax
jge 0xf99c
movq -0x20(%rsp), %rax
addq $0x10, %rax
movq %rax, -0x30(%rsp)
jmp 0xf9aa
movq -0x20(%rsp), %rax
addq $0x18, %rax
movq %rax, -0x30(%rsp)
jmp 0xf9ac
jmp 0xf951
cmpq $0x0, -0x18(%rsp)
je 0xf9c3
movq -0x28(%rsp), %rcx
movq -0x18(%rsp), %rax
movq %rcx, (%rax)
movq -0x30(%rsp), %rax
retq
nopl (%rax)
// File: ddunbar[P]PDSample/RangeList.cpp
// Function: RangeList::RangeList(float, float)
RangeList::RangeList(float min, float max)
{
	numRanges = 0;
	rangesSize = 8;
	ranges = new RangeEntry[rangesSize];
	reset(min, max);
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movss %xmm0, 0xc(%rsp)
movss %xmm1, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
movl $0x0, 0x8(%rax)
movl $0x8, 0xc(%rax)
movslq 0xc(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x2030
movq (%rsp), %rdi
movq %rax, (%rdi)
movss 0xc(%rsp), %xmm0
movss 0x8(%rsp), %xmm1
callq 0xfd00
addq $0x18, %rsp
retq
nop
// File: ddunbar[P]PDSample/RangeList.cpp
// Function: RangeList::insertRange(int, float, float)
void RangeList::insertRange(int pos, float min, float max)
{
	if (numRanges==rangesSize) {
		RangeEntry *tmp = new RangeEntry[rangesSize];
		memcpy(tmp, ranges, numRanges*sizeof(*tmp));
		delete[] ranges;
		ranges = tmp;
	}

	if (pos<numRanges) {
		memmove(&ranges[pos+1], &ranges[pos], sizeof(*ranges)*(numRanges-pos));
	}

	ranges[pos].min = min;
	ranges[pos].max = max;
	numRanges++;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movss %xmm0, 0x28(%rsp)
movss %xmm1, 0x24(%rsp)
movq 0x30(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movl 0x8(%rcx), %eax
cmpl 0xc(%rcx), %eax
jne 0xfe91
movq 0x10(%rsp), %rax
movslq 0xc(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x2030
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movq (%rax), %rsi
movslq 0x8(%rax), %rdx
shlq $0x3, %rdx
callq 0x2160
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0xfe84
movq 0x8(%rsp), %rdi
callq 0x2220
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
movq %rcx, (%rax)
movq 0x10(%rsp), %rcx
movl 0x2c(%rsp), %eax
cmpl 0x8(%rcx), %eax
jge 0xfeda
movq 0x10(%rsp), %rax
movq (%rax), %rdi
movl 0x2c(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rdi
movq (%rax), %rsi
movslq 0x2c(%rsp), %rcx
shlq $0x3, %rcx
addq %rcx, %rsi
movl 0x8(%rax), %eax
subl 0x2c(%rsp), %eax
movslq %eax, %rdx
shlq $0x3, %rdx
callq 0x22b0
movq 0x10(%rsp), %rax
movss 0x28(%rsp), %xmm0
movq (%rax), %rcx
movslq 0x2c(%rsp), %rdx
movss %xmm0, (%rcx,%rdx,8)
movss 0x24(%rsp), %xmm0
movq (%rax), %rcx
movslq 0x2c(%rsp), %rdx
movss %xmm0, 0x4(%rcx,%rdx,8)
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: ddunbar[P]PDSample/RangeList.cpp
// Function: RangeList::print()
void RangeList::print()
{
	printf("[");
	for (int i=0; i<numRanges; i++) {
		printf("(%f,%f)%s", ranges[i].min, ranges[i].max, (i==numRanges-1)?"":", ");
	}
	printf("]\n");
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
leaq 0x811b(%rip), %rdi      # 0x18414
movb $0x0, %al
callq 0x2040
movl $0x0, 0xc(%rsp)
movq (%rsp), %rcx
movl 0xc(%rsp), %eax
cmpl 0x8(%rcx), %eax
jge 0x10375
movq (%rsp), %rax
movq (%rax), %rcx
movslq 0xc(%rsp), %rdx
movss (%rcx,%rdx,8), %xmm0
cvtss2sd %xmm0, %xmm0
movq (%rax), %rcx
movslq 0xc(%rsp), %rdx
movss 0x4(%rcx,%rdx,8), %xmm1
cvtss2sd %xmm1, %xmm1
movl 0xc(%rsp), %ecx
movl 0x8(%rax), %edx
subl $0x1, %edx
leaq 0x80d3(%rip), %rsi      # 0x18420
leaq 0x7f37(%rip), %rax      # 0x1828b
cmpl %edx, %ecx
cmoveq %rax, %rsi
leaq 0x80b5(%rip), %rdi      # 0x18416
movb $0x2, %al
callq 0x2040
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x10308
leaq 0x80a7(%rip), %rdi      # 0x18423
movb $0x0, %al
callq 0x2040
addq $0x18, %rsp
retq
nopl (%rax,%rax)
// File: ddunbar[P]PDSample/ScallopedSector.cpp
// Function: integralOfDistToCircle(float, float, float, float)
static float integralOfDistToCircle(float x, float d, float r, float k)
{
	if (r<FLT_EPSILON)
		return 0.0;

	float sin_x = sin(x);
	float d_sin_x = d*sin_x;
	float y = sin_x*d/r;
	if (y<-1) y = -1;
	else if (y>1) y = 1;

	float theta = asin(y);

	return (r*(r*(x + 
				  k*theta) +
			   k*cos(theta)*d_sin_x) +
		    d*cos(x)*d_sin_x)*.5f;
}

// Assembly:
subq $0x48, %rsp
movss %xmm0, 0x40(%rsp)
movss %xmm1, 0x3c(%rsp)
movss %xmm2, 0x38(%rsp)
movss %xmm3, 0x34(%rsp)
movss 0x7de4(%rip), %xmm0     # 0x18428
ucomiss 0x38(%rsp), %xmm0
jbe 0x10659
xorps %xmm0, %xmm0
movss %xmm0, 0x44(%rsp)
jmp 0x107b3
movss 0x40(%rsp), %xmm0
callq 0x6e20
movss %xmm0, 0x30(%rsp)
movss 0x3c(%rsp), %xmm0
mulss 0x30(%rsp), %xmm0
movss %xmm0, 0x2c(%rsp)
movss 0x30(%rsp), %xmm0
mulss 0x3c(%rsp), %xmm0
divss 0x38(%rsp), %xmm0
movss %xmm0, 0x28(%rsp)
movss 0x5e28(%rip), %xmm0     # 0x164c4
ucomiss 0x28(%rsp), %xmm0
jbe 0x106b3
movss 0x5e19(%rip), %xmm0     # 0x164c4
movss %xmm0, 0x28(%rsp)
jmp 0x106d6
movss 0x28(%rsp), %xmm0
movss 0x5e07(%rip), %xmm1     # 0x164c8
ucomiss %xmm1, %xmm0
jbe 0x106d4
movss 0x5dfa(%rip), %xmm0     # 0x164c8
movss %xmm0, 0x28(%rsp)
jmp 0x106d6
movss 0x28(%rsp), %xmm0
callq 0x120b0
movss %xmm0, 0x24(%rsp)
movss 0x38(%rsp), %xmm0
movss %xmm0, 0x20(%rsp)
movss 0x38(%rsp), %xmm0
movss %xmm0, 0x14(%rsp)
movss 0x40(%rsp), %xmm1
movss 0x34(%rsp), %xmm0
movss 0x24(%rsp), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x10(%rsp)
movss 0x34(%rsp), %xmm0
movss %xmm0, 0xc(%rsp)
movss 0x24(%rsp), %xmm0
callq 0x6e00
movss 0xc(%rsp), %xmm1
movss 0x10(%rsp), %xmm2
movaps %xmm0, %xmm3
movss 0x14(%rsp), %xmm0
mulss %xmm3, %xmm1
mulss 0x2c(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x1c(%rsp)
movss 0x3c(%rsp), %xmm0
movss %xmm0, 0x18(%rsp)
movss 0x40(%rsp), %xmm0
callq 0x6e00
movss 0x18(%rsp), %xmm1
movss 0x1c(%rsp), %xmm2
movaps %xmm0, %xmm3
movss 0x20(%rsp), %xmm0
mulss %xmm3, %xmm1
mulss 0x2c(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss 0x589b(%rip), %xmm1     # 0x16044
mulss %xmm1, %xmm0
movss %xmm0, 0x44(%rsp)
movss 0x44(%rsp), %xmm0
addq $0x48, %rsp
retq
nop
// File: ddunbar[P]PDSample/ScallopedSector.cpp
// Function: ScallopedSector::calcAngleForArea(float, RNG&)
float ScallopedSector::calcAngleForArea(float area, RNG &rng)
{
	float lo = a1, hi = a2, cur = lo + (hi-lo)*rng.getFloat();

	for (int i=0; i<10; i++) {
		if (calcAreaToAngle(cur)<area) {
			lo = cur;
			cur = (cur + hi)*.5f;
		} else {
			hi = cur;
			cur = (lo + cur)*.5f;
		}
	}

	return cur;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movss %xmm0, 0x2c(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x30(%rsp), %rax
movq %rax, (%rsp)
movss 0x8(%rax), %xmm0
movss %xmm0, 0x1c(%rsp)
movss 0xc(%rax), %xmm0
movss %xmm0, 0x18(%rsp)
movss 0x1c(%rsp), %xmm0
movss %xmm0, 0x8(%rsp)
movss 0x18(%rsp), %xmm0
subss 0x1c(%rsp), %xmm0
movss %xmm0, 0xc(%rsp)
movq 0x20(%rsp), %rdi
callq 0x2e00
movss 0x8(%rsp), %xmm1
movaps %xmm0, %xmm2
movss 0xc(%rsp), %xmm0
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x14(%rsp)
movl $0x0, 0x10(%rsp)
cmpl $0xa, 0x10(%rsp)
jge 0x10960
movq (%rsp), %rdi
movss 0x14(%rsp), %xmm0
callq 0x107c0
movaps %xmm0, %xmm1
movss 0x2c(%rsp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x10924
movss 0x14(%rsp), %xmm0
movss %xmm0, 0x1c(%rsp)
movss 0x14(%rsp), %xmm0
addss 0x18(%rsp), %xmm0
movss 0x572c(%rip), %xmm1     # 0x16044
mulss %xmm1, %xmm0
movss %xmm0, 0x14(%rsp)
jmp 0x1094e
movss 0x14(%rsp), %xmm0
movss %xmm0, 0x18(%rsp)
movss 0x1c(%rsp), %xmm0
addss 0x14(%rsp), %xmm0
movss 0x5700(%rip), %xmm1     # 0x16044
mulss %xmm1, %xmm0
movss %xmm0, 0x14(%rsp)
jmp 0x10950
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0x108d0
movss 0x14(%rsp), %xmm0
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: ddunbar[P]PDSample/ScallopedSector.cpp
// Function: ScallopedSector::distToCurve(float, int)
float ScallopedSector::distToCurve(float angle, int index)
{
	float alpha = angle - arcs[index].theta;
	float sin_alpha = sin(alpha);
	float t0 = arcs[index].rSqrd - arcs[index].dSqrd*sin_alpha*sin_alpha;
	if (t0<0) {
		return arcs[index].d*cos(alpha);
	} else {
		return arcs[index].d*cos(alpha) + arcs[index].sign*sqrt(t0);
	}
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movss %xmm0, 0x34(%rsp)
movl %esi, 0x30(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x18(%rsp)
movss 0x34(%rsp), %xmm0
addq $0x14, %rax
movslq 0x30(%rsp), %rcx
imulq $0x24, %rcx, %rcx
addq %rcx, %rax
subss 0x14(%rax), %xmm0
movss %xmm0, 0x2c(%rsp)
movss 0x2c(%rsp), %xmm0
callq 0x6e20
movq 0x18(%rsp), %rax
movss %xmm0, 0x28(%rsp)
movq %rax, %rcx
addq $0x14, %rcx
movslq 0x30(%rsp), %rdx
imulq $0x24, %rdx, %rdx
addq %rdx, %rcx
movss 0x1c(%rcx), %xmm1
addq $0x14, %rax
movslq 0x30(%rsp), %rcx
imulq $0x24, %rcx, %rcx
addq %rcx, %rax
movss 0x20(%rax), %xmm0
mulss 0x28(%rsp), %xmm0
movss 0x28(%rsp), %xmm2
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x24(%rsp)
xorps %xmm0, %xmm0
ucomiss 0x24(%rsp), %xmm0
jbe 0x10a65
movq 0x18(%rsp), %rax
addq $0x14, %rax
movslq 0x30(%rsp), %rcx
imulq $0x24, %rcx, %rcx
addq %rcx, %rax
movss 0x10(%rax), %xmm0
movss %xmm0, 0x14(%rsp)
movss 0x2c(%rsp), %xmm0
callq 0x6e00
movaps %xmm0, %xmm1
movss 0x14(%rsp), %xmm0
mulss %xmm1, %xmm0
movss %xmm0, 0x44(%rsp)
jmp 0x10ae8
movq 0x18(%rsp), %rax
addq $0x14, %rax
movslq 0x30(%rsp), %rcx
imulq $0x24, %rcx, %rcx
addq %rcx, %rax
movss 0x10(%rax), %xmm0
movss %xmm0, 0x10(%rsp)
movss 0x2c(%rsp), %xmm0
callq 0x6e00
movq 0x18(%rsp), %rax
movss %xmm0, 0xc(%rsp)
addq $0x14, %rax
movslq 0x30(%rsp), %rcx
imulq $0x24, %rcx, %rcx
addq %rcx, %rax
movss 0xc(%rax), %xmm0
movss %xmm0, 0x8(%rsp)
movss 0x24(%rsp), %xmm0
callq 0x6d50
movss 0x8(%rsp), %xmm1
movss 0xc(%rsp), %xmm2
movaps %xmm0, %xmm3
movss 0x10(%rsp), %xmm0
mulss %xmm3, %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x44(%rsp)
movss 0x44(%rsp), %xmm0
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
// File: ddunbar[P]PDSample/ScallopedSector.cpp
// Function: ScallopedSector::sample(RNG&)
Vec2 ScallopedSector::sample(RNG &rng)
{
	float angle = calcAngleForArea(area*rng.getFloatL(), rng);
	float d1 = distToCurve(angle, 0);
	float d2 = distToCurve(angle, 1);
	float d = sqrt(d1*d1 + (d2*d2 - d1*d1)*rng.getFloat());
	
	return Vec2(P.x + cos(angle)*d, P.y + sin(angle)*d);
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
movss 0x10(%rax), %xmm0
movss %xmm0, (%rsp)
movq 0x30(%rsp), %rdi
callq 0x2d90
movq 0x10(%rsp), %rdi
movaps %xmm0, %xmm1
movss (%rsp), %xmm0
mulss %xmm1, %xmm0
movq 0x30(%rsp), %rsi
callq 0x10850
movq 0x10(%rsp), %rdi
movss %xmm0, 0x2c(%rsp)
movss 0x2c(%rsp), %xmm0
xorl %esi, %esi
callq 0x10970
movq 0x10(%rsp), %rdi
movss %xmm0, 0x28(%rsp)
movss 0x2c(%rsp), %xmm0
movl $0x1, %esi
callq 0x10970
movss %xmm0, 0x24(%rsp)
movss 0x28(%rsp), %xmm1
movss 0x24(%rsp), %xmm0
mulss %xmm1, %xmm1
movss %xmm1, 0x8(%rsp)
mulss %xmm0, %xmm0
subss %xmm1, %xmm0
movss %xmm0, 0x4(%rsp)
movq 0x30(%rsp), %rdi
callq 0x2e00
movss 0x4(%rsp), %xmm1
movaps %xmm0, %xmm2
movss 0x8(%rsp), %xmm0
mulss %xmm2, %xmm1
addss %xmm1, %xmm0
callq 0x6d50
movq 0x10(%rsp), %rax
movss %xmm0, 0x20(%rsp)
movss (%rax), %xmm0
movss %xmm0, 0xc(%rsp)
movss 0x2c(%rsp), %xmm0
callq 0x6e00
movss 0xc(%rsp), %xmm1
movq 0x10(%rsp), %rax
movss 0x20(%rsp), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x1c(%rsp)
movss 0x4(%rax), %xmm0
movss %xmm0, 0x18(%rsp)
movss 0x2c(%rsp), %xmm0
callq 0x6e20
movss 0x18(%rsp), %xmm2
movaps %xmm0, %xmm1
movss 0x1c(%rsp), %xmm0
movss 0x20(%rsp), %xmm3
mulss %xmm3, %xmm1
addss %xmm2, %xmm1
leaq 0x40(%rsp), %rdi
callq 0x6b60
movsd 0x40(%rsp), %xmm0
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
// File: ddunbar[P]PDSample/ScallopedSector.cpp
// Function: ScallopedSector::distToCircle(float, Vec2&, float, float*, float*)
void ScallopedSector::distToCircle(float angle, Vec2 &C, float r, float *d1_out, float *d2_out)
{
	Vec2 v(C.x - P.x, C.y - P.y);
	float dSqrd = v.x*v.x + v.y*v.y;
	float theta = atan2(v.y, v.x);
	float alpha = angle - theta;
	float sin_alpha = sin(alpha);
	float xSqrd = r*r - dSqrd*sin_alpha*sin_alpha;

	if (xSqrd<0) {
		*d1_out = *d2_out = -10000000;
	} else {
		float a = sqrt(dSqrd)*cos(alpha);
		float x = sqrt(xSqrd);
		*d1_out = a-x;
		*d2_out = a+x;
	}
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movss %xmm0, 0x4c(%rsp)
movq %rsi, 0x40(%rsp)
movss %xmm1, 0x3c(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movq 0x50(%rsp), %rax
movq 0x40(%rsp), %rcx
movss (%rcx), %xmm0
subss (%rax), %xmm0
movq 0x40(%rsp), %rcx
movss 0x4(%rcx), %xmm1
subss 0x4(%rax), %xmm1
leaq 0x20(%rsp), %rdi
callq 0x6b60
movss 0x20(%rsp), %xmm0
movss 0x20(%rsp), %xmm2
movss 0x24(%rsp), %xmm1
mulss 0x24(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x1c(%rsp)
movss 0x24(%rsp), %xmm0
movss 0x20(%rsp), %xmm1
callq 0x6dc0
movss %xmm0, 0x18(%rsp)
movss 0x4c(%rsp), %xmm0
subss 0x18(%rsp), %xmm0
movss %xmm0, 0x14(%rsp)
movss 0x14(%rsp), %xmm0
callq 0x6e20
movss %xmm0, 0x10(%rsp)
movss 0x3c(%rsp), %xmm0
movss 0x3c(%rsp), %xmm2
movss 0x1c(%rsp), %xmm1
mulss 0x10(%rsp), %xmm1
mulss 0x10(%rsp), %xmm1
movd %xmm1, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0xc(%rsp)
xorps %xmm0, %xmm0
ucomiss 0xc(%rsp), %xmm0
jbe 0x10de6
movq 0x28(%rsp), %rax
movss 0x765d(%rip), %xmm0     # 0x1842c
movss %xmm0, (%rax)
movq 0x30(%rsp), %rax
movss 0x764c(%rip), %xmm0     # 0x1842c
movss %xmm0, (%rax)
jmp 0x10e4e
movss 0x1c(%rsp), %xmm0
callq 0x6d50
movss %xmm0, (%rsp)
movss 0x14(%rsp), %xmm0
callq 0x6e00
movaps %xmm0, %xmm1
movss (%rsp), %xmm0
mulss %xmm1, %xmm0
movss %xmm0, 0x8(%rsp)
movss 0xc(%rsp), %xmm0
callq 0x6d50
movss %xmm0, 0x4(%rsp)
movss 0x8(%rsp), %xmm0
subss 0x4(%rsp), %xmm0
movq 0x30(%rsp), %rax
movss %xmm0, (%rax)
movss 0x8(%rsp), %xmm0
addss 0x4(%rsp), %xmm0
movq 0x28(%rsp), %rax
movss %xmm0, (%rax)
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)
// File: ddunbar[P]PDSample/ScallopedSector.cpp
// Function: ScallopedRegion::sample(RNG&)
Vec2 ScallopedRegion::sample(RNG &rng)
{
	if (!regions->size()) {
		printf("Fatal error, sampled from empty region.");
		exit(1);
		return Vec2(0,0); 
	} else {
		float a = area*rng.getFloatL();
		ScallopedSector &ss = (*regions)[0];

		for (unsigned int i=0; i<regions->size(); i++) {
			ss = (*regions)[i];
			if (a<ss.area)
				break;
			a -= ss.area;
		}

		return ss.sample(rng);
	}
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
movq (%rax), %rdi
callq 0x80b0
cmpq $0x0, %rax
jne 0x11f7e
leaq 0x64c3(%rip), %rdi      # 0x18430
movb $0x0, %al
callq 0x2040
movl $0x1, %edi
callq 0x2200
movq 0x10(%rsp), %rax
movss 0xc(%rax), %xmm0
movss %xmm0, 0xc(%rsp)
movq 0x30(%rsp), %rdi
callq 0x2d90
movq 0x10(%rsp), %rax
movaps %xmm0, %xmm1
movss 0xc(%rsp), %xmm0
mulss %xmm1, %xmm0
movss %xmm0, 0x2c(%rsp)
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x12520
movq %rax, 0x20(%rsp)
movl $0x0, 0x1c(%rsp)
movq 0x10(%rsp), %rax
movl 0x1c(%rsp), %ecx
movq %rcx, (%rsp)
movq (%rax), %rdi
callq 0x80b0
movq %rax, %rcx
movq (%rsp), %rax
cmpq %rcx, %rax
jae 0x12050
movq 0x10(%rsp), %rax
movq (%rax), %rdi
movl 0x1c(%rsp), %eax
movl %eax, %esi
callq 0x12520
movq %rax, %rsi
movq 0x20(%rsp), %rdi
movl $0x5c, %edx
callq 0x2160
movss 0x2c(%rsp), %xmm1
movq 0x20(%rsp), %rax
movss 0x10(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x12026
jmp 0x12050
movq 0x20(%rsp), %rax
movss 0x10(%rax), %xmm1
movss 0x2c(%rsp), %xmm0
subss %xmm1, %xmm0
movss %xmm0, 0x2c(%rsp)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x11fc9
movq 0x20(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x10b00
movlpd %xmm0, 0x40(%rsp)
movsd 0x40(%rsp), %xmm0
addq $0x48, %rsp
retq
// File: pokorj54[P]Pathfinder-utilities/src/Helpers/fraction.cpp
// Function: Fraction::Normalize()
Fraction Fraction::Normalize()
{
    int d = gcd(numerator, denominator);
    numerator /= d;
    denominator /= d;
    if(denominator < 0)
    {
        numerator *= -1;
        denominator *= -1;
    }
    return *this;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movl (%rax), %edi
movl 0x4(%rax), %esi
callq 0x2420
movl %eax, %ecx
movq 0x8(%rsp), %rax
movl %ecx, 0x14(%rsp)
movl 0x14(%rsp), %ecx
movl (%rax), %eax
cltd
idivl %ecx
movl %eax, %ecx
movq 0x8(%rsp), %rax
movl %ecx, (%rax)
movl 0x14(%rsp), %ecx
movl 0x4(%rax), %eax
cltd
idivl %ecx
movl %eax, %ecx
movq 0x8(%rsp), %rax
movl %ecx, 0x4(%rax)
cmpl $0x0, 0x4(%rax)
jge 0x2505
movq 0x8(%rsp), %rax
imull $-0x1, (%rax), %ecx
movl %ecx, (%rax)
imull $-0x1, 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
nopl (%rax)