// File: /workspace/github_cpp_makefile_star2_O2/ddunbar[P]PDSample/./quasisampler_prototype.h
// Function: Quasisampler::TileNode::TileNode(Quasisampler::TileNode*, int, Point2D, int, unsigned int, int, double)
TileNode(  
      TileNode* parent = NULL, 
      int tileType = TileTypeF,
      Point2D refPt = Point2D(0,0),
      int dir = 15, // 15 = East.
      unsigned newbits = 0,
      int parent_slot = 0,
      double scale = 1.0)
    {
      this->parent = parent;
      this->tileType = tileType;
      this->p1 = refPt;
      this->dir = dir%20;
      this->parent_slot = parent_slot;
      this->scale = scale;
      this->level = parent ? parent->level + 1 : 0; // Increment the level.


      // Build triangle, according to type.
      switch(tileType)
      {
      case TileTypeC:
      case TileTypeD:
        // "Skinny" triangles
        p2 = p1 + vvect[dir%20]*scale;
        p3 = p1 + vvect[(dir+4)%20]*(PHI*scale);
        break;
      case TileTypeE:
      case TileTypeF:
        // "Fat" triangles
        p2 = p1 + vvect[dir%20]*(PHI2*scale);
        p3 = p1 + vvect[(dir+2)%20]*(PHI*scale);
        break;
      default:
        // Pentagonal tiles (triangle undefined)
        p2 = p1 + vvect[dir%20]*scale;
        p3 = p1 + vvect[(dir+5)%20]*scale;
      }
      
      // Append 2 new bits to the F-Code.
      if (parent)
        f_code = (parent->f_code<<2)^newbits;
      else 
        f_code = newbits;
      
      // Set as leaf node
      terminal = true;
      children.clear();
    }

// Assembly:
movl %edx, %r10d
xorps %xmm3, %xmm3
movups %xmm3, 0x60(%rdi)
andq $0x0, 0x70(%rdi)
movq %rsi, 0x50(%rdi)
movl %edx, 0x4(%rdi)
movsd %xmm0, 0x18(%rdi)
movsd %xmm1, 0x20(%rdi)
pushq $0x14
popq %r11
movl %ecx, %eax
cltd
idivl %r11d
movl %edx, 0x8(%rdi)
movl %r9d, 0x58(%rdi)
movsd %xmm2, 0x10(%rdi)
testq %rsi, %rsi
je 0x57c1
movl (%rsi), %eax
incl %eax
jmp 0x57c3
xorl %eax, %eax
movl %eax, (%rdi)
leal -0x4(%r10), %eax
cmpl $0x2, %eax
jb 0x580e
addl $-0x2, %r10d
movslq %edx, %rax
shlq $0x4, %rax
leaq 0x3de0(%rip), %r9       # 0x95c0
cmpl $0x1, %r10d
ja 0x5889
movapd %xmm2, %xmm3
unpcklpd %xmm2, %xmm3            # xmm3 = xmm3[0],xmm2[0]
mulpd (%rax,%r9), %xmm3
movapd %xmm0, %xmm4
unpcklpd %xmm1, %xmm4            # xmm4 = xmm4[0],xmm1[0]
addpd %xmm3, %xmm4
movupd %xmm4, 0x28(%rdi)
addl $0x4, %ecx
jmp 0x5846
movslq %edx, %rax
shlq $0x4, %rax
leaq 0x3da4(%rip), %r9       # 0x95c0
movsd 0x3c0c(%rip), %xmm3     # 0x9430
mulsd %xmm2, %xmm3
unpcklpd %xmm3, %xmm3            # xmm3 = xmm3[0,0]
mulpd (%rax,%r9), %xmm3
movapd %xmm0, %xmm4
unpcklpd %xmm1, %xmm4            # xmm4 = xmm4[0],xmm1[0]
addpd %xmm3, %xmm4
movupd %xmm4, 0x28(%rdi)
addl $0x2, %ecx
movl %ecx, %eax
cltd
idivl %r11d
movslq %edx, %rax
mulsd 0x3be1(%rip), %xmm2     # 0x9438
shlq $0x4, %rax
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
mulpd (%rax,%r9), %xmm2
unpcklpd %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
addpd %xmm2, %xmm0
movupd %xmm0, 0x38(%rdi)
testq %rsi, %rsi
je 0x5880
movl 0x48(%rsi), %eax
shll $0x2, %eax
xorl %eax, %r8d
movl %r8d, 0x48(%rdi)
movb $0x1, 0x5c(%rdi)
retq
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
movapd (%rax,%r9), %xmm3
mulpd %xmm2, %xmm3
movapd %xmm0, %xmm4
unpcklpd %xmm1, %xmm4            # xmm4 = xmm4[0],xmm1[0]
addpd %xmm3, %xmm4
movupd %xmm4, 0x28(%rdi)
addl $0x5, %ecx
movl %ecx, %eax
cltd
idivl %r11d
movslq %edx, %rax
shlq $0x4, %rax
jmp 0x585f