// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::CreateBox(gaps::R3Box const&)
void R3Mesh::
CreateBox(const R3Box& box)
{
  // Create box 
  R3MeshVertex *v1 = CreateVertex(box.Corner(RN_NNP_OCTANT));
  R3MeshVertex *v2 = CreateVertex(box.Corner(RN_PNP_OCTANT));
  R3MeshVertex *v3 = CreateVertex(box.Corner(RN_NPP_OCTANT));
  R3MeshVertex *v4 = CreateVertex(box.Corner(RN_PPP_OCTANT));
  R3MeshVertex *v5 = CreateVertex(box.Corner(RN_NPN_OCTANT));
  R3MeshVertex *v6 = CreateVertex(box.Corner(RN_PPN_OCTANT));
  R3MeshVertex *v7 = CreateVertex(box.Corner(RN_NNN_OCTANT));
  R3MeshVertex *v8 = CreateVertex(box.Corner(RN_PNN_OCTANT));
  CreateFace(v1, v2, v4);
  CreateFace(v1, v4, v3);
  CreateFace(v3, v4, v6);
  CreateFace(v3, v6, v5);
  CreateFace(v5, v6, v8);
  CreateFace(v5, v8, v7);
  CreateFace(v7, v8, v2);
  CreateFace(v7, v2, v1);
  CreateFace(v2, v8, v6);
  CreateFace(v2, v6, v4);
  CreateFace(v7, v1, v3);
  CreateFace(v7, v3, v5);
}

// Assembly:
subq $0x118, %rsp            # imm = 0x118
movq %rdi, 0x110(%rsp)
movq %rsi, 0x108(%rsp)
movq 0x110(%rsp), %rax
movq %rax, (%rsp)
movq 0x108(%rsp), %rsi
leaq 0xe8(%rsp), %rdi
movl $0x1, %edx
callq 0x42e40
movq (%rsp), %rdi
movq (%rdi), %rax
leaq 0xe8(%rsp), %rsi
xorl %ecx, %ecx
movl %ecx, %edx
callq *0x20(%rax)
movq %rax, 0x100(%rsp)
movq 0x108(%rsp), %rsi
leaq 0xc8(%rsp), %rdi
movl $0x5, %edx
callq 0x42e40
movq (%rsp), %rdi
movq (%rdi), %rax
leaq 0xc8(%rsp), %rsi
xorl %ecx, %ecx
movl %ecx, %edx
callq *0x20(%rax)
movq %rax, 0xe0(%rsp)
movq 0x108(%rsp), %rsi
leaq 0xa8(%rsp), %rdi
movl $0x3, %edx
callq 0x42e40
movq (%rsp), %rdi
movq (%rdi), %rax
leaq 0xa8(%rsp), %rsi
xorl %ecx, %ecx
movl %ecx, %edx
callq *0x20(%rax)
movq %rax, 0xc0(%rsp)
movq 0x108(%rsp), %rsi
leaq 0x88(%rsp), %rdi
movl $0x7, %edx
callq 0x42e40
movq (%rsp), %rdi
movq (%rdi), %rax
leaq 0x88(%rsp), %rsi
xorl %ecx, %ecx
movl %ecx, %edx
callq *0x20(%rax)
movq %rax, 0xa0(%rsp)
movq 0x108(%rsp), %rsi
leaq 0x68(%rsp), %rdi
movl $0x2, %edx
callq 0x42e40
movq (%rsp), %rdi
movq (%rdi), %rax
leaq 0x68(%rsp), %rsi
xorl %ecx, %ecx
movl %ecx, %edx
callq *0x20(%rax)
movq %rax, 0x80(%rsp)
movq 0x108(%rsp), %rsi
leaq 0x48(%rsp), %rdi
movl $0x6, %edx
callq 0x42e40
movq (%rsp), %rdi
movq (%rdi), %rax
leaq 0x48(%rsp), %rsi
xorl %ecx, %ecx
movl %ecx, %edx
callq *0x20(%rax)
movq %rax, 0x60(%rsp)
movq 0x108(%rsp), %rsi
leaq 0x28(%rsp), %rdi
xorl %edx, %edx
callq 0x42e40
movq (%rsp), %rdi
movq (%rdi), %rax
leaq 0x28(%rsp), %rsi
xorl %ecx, %ecx
movl %ecx, %edx
callq *0x20(%rax)
movq %rax, 0x40(%rsp)
movq 0x108(%rsp), %rsi
leaq 0x8(%rsp), %rdi
movl $0x4, %edx
callq 0x42e40
movq (%rsp), %rdi
movq (%rdi), %rax
leaq 0x8(%rsp), %rsi
xorl %ecx, %ecx
movl %ecx, %edx
callq *0x20(%rax)
movq (%rsp), %rdi
movq %rax, 0x20(%rsp)
movq 0x100(%rsp), %rsi
movq 0xe0(%rsp), %rdx
movq 0xa0(%rsp), %rcx
movq (%rdi), %rax
xorl %r8d, %r8d
callq *0x48(%rax)
movq (%rsp), %rdi
movq 0x100(%rsp), %rsi
movq 0xa0(%rsp), %rdx
movq 0xc0(%rsp), %rcx
movq (%rdi), %rax
xorl %r8d, %r8d
callq *0x48(%rax)
movq (%rsp), %rdi
movq 0xc0(%rsp), %rsi
movq 0xa0(%rsp), %rdx
movq 0x60(%rsp), %rcx
movq (%rdi), %rax
xorl %r8d, %r8d
callq *0x48(%rax)
movq (%rsp), %rdi
movq 0xc0(%rsp), %rsi
movq 0x60(%rsp), %rdx
movq 0x80(%rsp), %rcx
movq (%rdi), %rax
xorl %r8d, %r8d
callq *0x48(%rax)
movq (%rsp), %rdi
movq 0x80(%rsp), %rsi
movq 0x60(%rsp), %rdx
movq 0x20(%rsp), %rcx
movq (%rdi), %rax
xorl %r8d, %r8d
callq *0x48(%rax)
movq (%rsp), %rdi
movq 0x80(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq 0x40(%rsp), %rcx
movq (%rdi), %rax
xorl %r8d, %r8d
callq *0x48(%rax)
movq (%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq 0xe0(%rsp), %rcx
movq (%rdi), %rax
xorl %r8d, %r8d
callq *0x48(%rax)
movq (%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0xe0(%rsp), %rdx
movq 0x100(%rsp), %rcx
movq (%rdi), %rax
xorl %r8d, %r8d
callq *0x48(%rax)
movq (%rsp), %rdi
movq 0xe0(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq 0x60(%rsp), %rcx
movq (%rdi), %rax
xorl %r8d, %r8d
callq *0x48(%rax)
movq (%rsp), %rdi
movq 0xe0(%rsp), %rsi
movq 0x60(%rsp), %rdx
movq 0xa0(%rsp), %rcx
movq (%rdi), %rax
xorl %r8d, %r8d
callq *0x48(%rax)
movq (%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x100(%rsp), %rdx
movq 0xc0(%rsp), %rcx
movq (%rdi), %rax
xorl %r8d, %r8d
callq *0x48(%rax)
movq (%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0xc0(%rsp), %rdx
movq 0x80(%rsp), %rcx
movq (%rdi), %rax
xorl %r8d, %r8d
callq *0x48(%rax)
addq $0x118, %rsp            # imm = 0x118
retq
nopl (%rax)