// File: tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Box.cpp
// Function: gaps::R2Box::Quadrant(int, int) const
const R2Box R2Box::
Quadrant (RNDirection xdir, RNDirection ydir) const
{
    // Return box in quadrant (xdir, ydir)
    R2Box result;
    R2Point 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]; }
    return result;
}

// Assembly:
subq $0x138, %rsp            # imm = 0x138
movq %rdi, 0xe0(%rsp)
movq %rdi, %rax
movq %rax, 0xe8(%rsp)
movq %rdi, 0x130(%rsp)
movq %rsi, 0x128(%rsp)
movl %edx, 0x124(%rsp)
movl %ecx, 0x120(%rsp)
movq 0x128(%rsp), %rax
movq %rax, 0xf0(%rsp)
movb $0x0, 0x11f(%rsp)
callq 0xbd370
movq 0xf0(%rsp), %rsi
leaq 0x108(%rsp), %rdi
callq 0xbdf00
jmp 0xbdb4c
cmpl $0x1, 0x124(%rsp)
jne 0xbdc62
leaq 0x108(%rsp), %rdi
xorl %esi, %esi
callq 0xa5b60
movq %rax, 0xd8(%rsp)
jmp 0xbdb73
movq 0xe0(%rsp), %rdi
movq 0xd8(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0xc8(%rsp)
xorl %esi, %esi
callq 0xbeaf0
movq %rax, 0xd0(%rsp)
jmp 0xbdba1
movq 0xd0(%rsp), %rdi
xorl %esi, %esi
callq 0xa5b60
movq %rax, 0xc0(%rsp)
jmp 0xbdbba
movq 0xf0(%rsp), %rdi
movq 0xc0(%rsp), %rax
movsd 0xc8(%rsp), %xmm0
movsd %xmm0, (%rax)
addq $0x18, %rdi
xorl %esi, %esi
callq 0xa5bf0
movsd %xmm0, 0xb8(%rsp)
jmp 0xbdbed
movq 0xe0(%rsp), %rdi
movl $0x1, %esi
callq 0xbeaf0
movq %rax, 0xb0(%rsp)
jmp 0xbdc09
movq 0xb0(%rsp), %rdi
xorl %esi, %esi
callq 0xa5b60
movq %rax, 0xa8(%rsp)
jmp 0xbdc22
movq 0xa8(%rsp), %rax
movsd 0xb8(%rsp), %xmm0
movsd %xmm0, (%rax)
jmp 0xbdd33
movq 0xe0(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x100(%rsp)
movl %eax, 0xfc(%rsp)
callq 0x6bc50
jmp 0xbdef1
movq 0xf0(%rsp), %rdi
addq $0x8, %rdi
xorl %esi, %esi
callq 0xa5bf0
movsd %xmm0, 0xa0(%rsp)
jmp 0xbdc80
movq 0xe0(%rsp), %rdi
xorl %esi, %esi
callq 0xbeaf0
movq %rax, 0x98(%rsp)
jmp 0xbdc99
movq 0x98(%rsp), %rdi
xorl %esi, %esi
callq 0xa5b60
movq %rax, 0x90(%rsp)
jmp 0xbdcb2
movq 0x90(%rsp), %rax
movsd 0xa0(%rsp), %xmm0
movsd %xmm0, (%rax)
leaq 0x108(%rsp), %rdi
xorl %esi, %esi
callq 0xa5b60
movq %rax, 0x88(%rsp)
jmp 0xbdce0
movq 0xe0(%rsp), %rdi
movq 0x88(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x78(%rsp)
movl $0x1, %esi
callq 0xbeaf0
movq %rax, 0x80(%rsp)
jmp 0xbdd0e
movq 0x80(%rsp), %rdi
xorl %esi, %esi
callq 0xa5b60
movq %rax, 0x70(%rsp)
jmp 0xbdd24
movq 0x70(%rsp), %rax
movsd 0x78(%rsp), %xmm0
movsd %xmm0, (%rax)
cmpl $0x1, 0x120(%rsp)
jne 0xbde05
leaq 0x108(%rsp), %rdi
movl $0x1, %esi
callq 0xa5b60
movq %rax, 0x68(%rsp)
jmp 0xbdd5a
movq 0xe0(%rsp), %rdi
movq 0x68(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x58(%rsp)
xorl %esi, %esi
callq 0xbeaf0
movq %rax, 0x60(%rsp)
jmp 0xbdd7f
movq 0x60(%rsp), %rdi
movl $0x1, %esi
callq 0xa5b60
movq %rax, 0x50(%rsp)
jmp 0xbdd95
movq 0xf0(%rsp), %rdi
movq 0x50(%rsp), %rax
movsd 0x58(%rsp), %xmm0
movsd %xmm0, (%rax)
addq $0x18, %rdi
movl $0x1, %esi
callq 0xa5bf0
movsd %xmm0, 0x48(%rsp)
jmp 0xbddc2
movq 0xe0(%rsp), %rdi
movl $0x1, %esi
callq 0xbeaf0
movq %rax, 0x40(%rsp)
jmp 0xbdddb
movq 0x40(%rsp), %rdi
movl $0x1, %esi
callq 0xa5b60
movq %rax, 0x38(%rsp)
jmp 0xbddf1
movq 0x38(%rsp), %rax
movsd 0x48(%rsp), %xmm0
movsd %xmm0, (%rax)
jmp 0xbdec2
movq 0xf0(%rsp), %rdi
addq $0x8, %rdi
movl $0x1, %esi
callq 0xa5bf0
movsd %xmm0, 0x30(%rsp)
jmp 0xbde23
movq 0xe0(%rsp), %rdi
xorl %esi, %esi
callq 0xbeaf0
movq %rax, 0x28(%rsp)
jmp 0xbde39
movq 0x28(%rsp), %rdi
movl $0x1, %esi
callq 0xa5b60
movq %rax, 0x20(%rsp)
jmp 0xbde4f
movq 0x20(%rsp), %rax
movsd 0x30(%rsp), %xmm0
movsd %xmm0, (%rax)
leaq 0x108(%rsp), %rdi
movl $0x1, %esi
callq 0xa5b60
movq %rax, 0x18(%rsp)
jmp 0xbde77
movq 0xe0(%rsp), %rdi
movq 0x18(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
movl $0x1, %esi
callq 0xbeaf0
movq %rax, 0x10(%rsp)
jmp 0xbde9f
movq 0x10(%rsp), %rdi
movl $0x1, %esi
callq 0xa5b60
movq %rax, (%rsp)
jmp 0xbdeb4
movq (%rsp), %rax
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movb $0x1, 0x11f(%rsp)
testb $0x1, 0x11f(%rsp)
jne 0xbdee1
movq 0xe0(%rsp), %rdi
callq 0x6bc50
movq 0xe8(%rsp), %rax
addq $0x138, %rsp            # imm = 0x138
retq
movq 0x100(%rsp), %rdi
callq 0xf890
nop