// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Box.cpp
// Function: gaps::R3Box::Octant(int, int, int) const
const R3Box R3Box::
Octant (RNDirection xdir, RNDirection ydir, RNDirection zdir) const
{
    // Return box in octant (xdir, ydir, zdir)
    R3Box result;
    R3Point centroid = Centroid();
    if (xdir == RN_HI) { result[RN_LO][RN_X] = centroid[RN_X]; result[RN_HI][RN_X] = maxpt[RN_X]; }
    else { result[RN_LO][RN_X] = minpt[RN_X]; result[RN_HI][RN_X] = centroid[RN_X]; }
    if (ydir == RN_HI) { result[RN_LO][RN_Y] = centroid[RN_Y]; result[RN_HI][RN_Y] = maxpt[RN_Y]; }
    else { result[RN_LO][RN_Y] = minpt[RN_Y]; result[RN_HI][RN_Y] = centroid[RN_Y]; }
    if (zdir == RN_HI) { result[RN_LO][RN_Z] = centroid[RN_Z]; result[RN_HI][RN_Z] = maxpt[RN_Z]; }
    else { result[RN_LO][RN_Z] = minpt[RN_Z]; result[RN_HI][RN_Z] = centroid[RN_Z]; }
    return result;
}

// Assembly:
subq $0x1b8, %rsp            # imm = 0x1B8
movq %rdi, 0x158(%rsp)
movq %rdi, %rax
movq %rax, 0x160(%rsp)
movq %rdi, 0x1b0(%rsp)
movq %rsi, 0x1a8(%rsp)
movl %edx, 0x1a4(%rsp)
movl %ecx, 0x1a0(%rsp)
movl %r8d, 0x19c(%rsp)
movq 0x1a8(%rsp), %rax
movq %rax, 0x168(%rsp)
movb $0x0, 0x19b(%rsp)
callq 0x42850
movq 0x168(%rsp), %rsi
movq (%rsi), %rax
movq 0x68(%rax), %rax
leaq 0x180(%rsp), %rdi
callq *%rax
jmp 0x433b8
cmpl $0x1, 0x1a4(%rsp)
jne 0x434ce
leaq 0x180(%rsp), %rdi
xorl %esi, %esi
callq 0x36be0
movq %rax, 0x150(%rsp)
jmp 0x433df
movq 0x158(%rsp), %rdi
movq 0x150(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x140(%rsp)
xorl %esi, %esi
callq 0x44f40
movq %rax, 0x148(%rsp)
jmp 0x4340d
movq 0x148(%rsp), %rdi
xorl %esi, %esi
callq 0x36be0
movq %rax, 0x138(%rsp)
jmp 0x43426
movq 0x168(%rsp), %rdi
movq 0x138(%rsp), %rax
movsd 0x140(%rsp), %xmm0
movsd %xmm0, (%rax)
addq $0x20, %rdi
xorl %esi, %esi
callq 0x13af0
movsd %xmm0, 0x130(%rsp)
jmp 0x43459
movq 0x158(%rsp), %rdi
movl $0x1, %esi
callq 0x44f40
movq %rax, 0x128(%rsp)
jmp 0x43475
movq 0x128(%rsp), %rdi
xorl %esi, %esi
callq 0x36be0
movq %rax, 0x120(%rsp)
jmp 0x4348e
movq 0x120(%rsp), %rax
movsd 0x130(%rsp), %xmm0
movsd %xmm0, (%rax)
jmp 0x435ab
movq 0x158(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x178(%rsp)
movl %eax, 0x174(%rsp)
callq 0x36a80
jmp 0x4394a
movq 0x168(%rsp), %rdi
addq $0x8, %rdi
xorl %esi, %esi
callq 0x13af0
movsd %xmm0, 0x118(%rsp)
jmp 0x434ec
movq 0x158(%rsp), %rdi
xorl %esi, %esi
callq 0x44f40
movq %rax, 0x110(%rsp)
jmp 0x43505
movq 0x110(%rsp), %rdi
xorl %esi, %esi
callq 0x36be0
movq %rax, 0x108(%rsp)
jmp 0x4351e
movq 0x108(%rsp), %rax
movsd 0x118(%rsp), %xmm0
movsd %xmm0, (%rax)
leaq 0x180(%rsp), %rdi
xorl %esi, %esi
callq 0x36be0
movq %rax, 0x100(%rsp)
jmp 0x4354c
movq 0x158(%rsp), %rdi
movq 0x100(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0xf0(%rsp)
movl $0x1, %esi
callq 0x44f40
movq %rax, 0xf8(%rsp)
jmp 0x4357d
movq 0xf8(%rsp), %rdi
xorl %esi, %esi
callq 0x36be0
movq %rax, 0xe8(%rsp)
jmp 0x43596
movq 0xe8(%rsp), %rax
movsd 0xf0(%rsp), %xmm0
movsd %xmm0, (%rax)
cmpl $0x1, 0x1a0(%rsp)
jne 0x436a7
leaq 0x180(%rsp), %rdi
movl $0x1, %esi
callq 0x36be0
movq %rax, 0xe0(%rsp)
jmp 0x435d5
movq 0x158(%rsp), %rdi
movq 0xe0(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0xd0(%rsp)
xorl %esi, %esi
callq 0x44f40
movq %rax, 0xd8(%rsp)
jmp 0x43603
movq 0xd8(%rsp), %rdi
movl $0x1, %esi
callq 0x36be0
movq %rax, 0xc8(%rsp)
jmp 0x4361f
movq 0x168(%rsp), %rdi
movq 0xc8(%rsp), %rax
movsd 0xd0(%rsp), %xmm0
movsd %xmm0, (%rax)
addq $0x20, %rdi
movl $0x1, %esi
callq 0x13af0
movsd %xmm0, 0xc0(%rsp)
jmp 0x43655
movq 0x158(%rsp), %rdi
movl $0x1, %esi
callq 0x44f40
movq %rax, 0xb8(%rsp)
jmp 0x43671
movq 0xb8(%rsp), %rdi
movl $0x1, %esi
callq 0x36be0
movq %rax, 0xb0(%rsp)
jmp 0x4368d
movq 0xb0(%rsp), %rax
movsd 0xc0(%rsp), %xmm0
movsd %xmm0, (%rax)
jmp 0x4378a
movq 0x168(%rsp), %rdi
addq $0x8, %rdi
movl $0x1, %esi
callq 0x13af0
movsd %xmm0, 0xa8(%rsp)
jmp 0x436c8
movq 0x158(%rsp), %rdi
xorl %esi, %esi
callq 0x44f40
movq %rax, 0xa0(%rsp)
jmp 0x436e1
movq 0xa0(%rsp), %rdi
movl $0x1, %esi
callq 0x36be0
movq %rax, 0x98(%rsp)
jmp 0x436fd
movq 0x98(%rsp), %rax
movsd 0xa8(%rsp), %xmm0
movsd %xmm0, (%rax)
leaq 0x180(%rsp), %rdi
movl $0x1, %esi
callq 0x36be0
movq %rax, 0x90(%rsp)
jmp 0x4372e
movq 0x158(%rsp), %rdi
movq 0x90(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x80(%rsp)
movl $0x1, %esi
callq 0x44f40
movq %rax, 0x88(%rsp)
jmp 0x4375f
movq 0x88(%rsp), %rdi
movl $0x1, %esi
callq 0x36be0
movq %rax, 0x78(%rsp)
jmp 0x43778
movq 0x78(%rsp), %rax
movsd 0x80(%rsp), %xmm0
movsd %xmm0, (%rax)
cmpl $0x1, 0x19c(%rsp)
jne 0x4385c
leaq 0x180(%rsp), %rdi
movl $0x2, %esi
callq 0x36be0
movq %rax, 0x70(%rsp)
jmp 0x437b1
movq 0x158(%rsp), %rdi
movq 0x70(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x60(%rsp)
xorl %esi, %esi
callq 0x44f40
movq %rax, 0x68(%rsp)
jmp 0x437d6
movq 0x68(%rsp), %rdi
movl $0x2, %esi
callq 0x36be0
movq %rax, 0x58(%rsp)
jmp 0x437ec
movq 0x168(%rsp), %rdi
movq 0x58(%rsp), %rax
movsd 0x60(%rsp), %xmm0
movsd %xmm0, (%rax)
addq $0x20, %rdi
movl $0x2, %esi
callq 0x13af0
movsd %xmm0, 0x50(%rsp)
jmp 0x43819
movq 0x158(%rsp), %rdi
movl $0x1, %esi
callq 0x44f40
movq %rax, 0x48(%rsp)
jmp 0x43832
movq 0x48(%rsp), %rdi
movl $0x2, %esi
callq 0x36be0
movq %rax, 0x40(%rsp)
jmp 0x43848
movq 0x40(%rsp), %rax
movsd 0x50(%rsp), %xmm0
movsd %xmm0, (%rax)
jmp 0x4391b
movq 0x168(%rsp), %rdi
addq $0x8, %rdi
movl $0x2, %esi
callq 0x13af0
movsd %xmm0, 0x38(%rsp)
jmp 0x4387a
movq 0x158(%rsp), %rdi
xorl %esi, %esi
callq 0x44f40
movq %rax, 0x30(%rsp)
jmp 0x43890
movq 0x30(%rsp), %rdi
movl $0x2, %esi
callq 0x36be0
movq %rax, 0x28(%rsp)
jmp 0x438a6
movq 0x28(%rsp), %rax
movsd 0x38(%rsp), %xmm0
movsd %xmm0, (%rax)
leaq 0x180(%rsp), %rdi
movl $0x2, %esi
callq 0x36be0
movq %rax, 0x20(%rsp)
jmp 0x438ce
movq 0x158(%rsp), %rdi
movq 0x20(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
movl $0x1, %esi
callq 0x44f40
movq %rax, 0x18(%rsp)
jmp 0x438f6
movq 0x18(%rsp), %rdi
movl $0x2, %esi
callq 0x36be0
movq %rax, 0x8(%rsp)
jmp 0x4390c
movq 0x8(%rsp), %rax
movsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rax)
movb $0x1, 0x19b(%rsp)
testb $0x1, 0x19b(%rsp)
jne 0x4393a
movq 0x158(%rsp), %rdi
callq 0x36a80
movq 0x160(%rsp), %rax
addq $0x1b8, %rsp            # imm = 0x1B8
retq
movq 0x178(%rsp), %rdi
callq 0xf890
nopw (%rax,%rax)