// File: /workspace/github_cpp_makefile_star2_O2/rurban[P]dgnlib/dgnread.cpp
// Function: DGNGetElementExtents
int DGNGetElementExtents( DGNHandle hDGN, DGNElemCore *psElement, 
                          DGNPoint *psMin, DGNPoint *psMax )

{
    DGNInfo     *psDGN = (DGNInfo *) hDGN;
    GUInt32 anMin[3], anMax[3];
    int bResult;

/* -------------------------------------------------------------------- */
/*      Get the extents if we have raw data in the element, or          */
/*      loaded in the file buffer.                                      */
/* -------------------------------------------------------------------- */
    if( psElement->raw_data != NULL )
        bResult = DGNGetRawExtents( psDGN, psElement->type, 
                                    psElement->raw_data, 
                                    anMin + 0, anMin + 1, anMin + 2,
                                    anMax + 0, anMax + 1, anMax + 2 );
    else if( psElement->element_id == psDGN->next_element_id - 1 )
        bResult = DGNGetRawExtents( psDGN, psElement->type, 
                                    psDGN->abyElem + 0, 
                                    anMin + 0, anMin + 1, anMin + 2,
                                    anMax + 0, anMax + 1, anMax + 2 );
    else
    {
        CPLError(CE_Warning, CPLE_AppDefined, 
                 "DGNGetElementExtents() fails because the requested element\n"
                 " does not have raw data available." );
        return FALSE;
    }

    if( !bResult )
        return FALSE;

/* -------------------------------------------------------------------- */
/*      Transform to user coordinate system and return.  The offset     */
/*      is to convert from "binary offset" form to twos complement.     */
/* -------------------------------------------------------------------- */
    psMin->x = anMin[0] - 2147483648.0;
    psMin->y = anMin[1] - 2147483648.0;
    psMin->z = anMin[2] - 2147483648.0;

    psMax->x = anMax[0] - 2147483648.0;
    psMax->y = anMax[1] - 2147483648.0;
    psMax->z = anMax[2] - 2147483648.0;

    DGNTransformPoint( psDGN, psMin );
    DGNTransformPoint( psDGN, psMax );

    return TRUE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rcx, %rbx
movq %rdx, %r15
movq %rdi, %r14
movq 0x48(%rsi), %rdx
testq %rdx, %rdx
je 0x850a
movl 0x14(%rsi), %esi
jmp 0x8520
movl 0x8(%r14), %eax
decl %eax
cmpl %eax, 0x8(%rsi)
jne 0x85ed
movl 0x14(%rsi), %esi
leaq 0x10(%r14), %rdx
leaq 0x14(%rsp), %r8
leaq 0x18(%rsp), %r9
leaq 0x4(%rsp), %rax
leaq 0x8(%rsp), %r10
subq $0x8, %rsp
leaq 0x8(%rsp), %r11
leaq 0x18(%rsp), %rcx
movq %r14, %rdi
pushq %r10
pushq %rax
pushq %r11
callq 0x860f
addq $0x20, %rsp
testl %eax, %eax
je 0x85e9
movsd 0x10(%rsp), %xmm0
xorpd %xmm1, %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x7180(%rip), %xmm2     # 0xf6f0
orpd %xmm2, %xmm0
subpd %xmm2, %xmm0
movapd 0x7180(%rip), %xmm3     # 0xf700
addpd %xmm3, %xmm0
movupd %xmm0, (%r15)
movl 0x18(%rsp), %eax
cvtsi2sd %rax, %xmm0
movsd 0x7106(%rip), %xmm4     # 0xf6a0
addsd %xmm4, %xmm0
movsd %xmm0, 0x10(%r15)
movsd (%rsp), %xmm0
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
orpd %xmm2, %xmm0
subpd %xmm2, %xmm0
addpd %xmm3, %xmm0
movupd %xmm0, (%rbx)
movl 0x8(%rsp), %eax
cvtsi2sd %rax, %xmm0
addsd %xmm4, %xmm0
movsd %xmm0, 0x10(%rbx)
movq %r14, %rdi
movq %r15, %rsi
callq 0x86f6
movq %r14, %rdi
movq %rbx, %rsi
callq 0x86f6
pushq $0x1
popq %rbx
jmp 0x8603
xorl %ebx, %ebx
jmp 0x8603
leaq 0x7244(%rip), %rdx      # 0xf838
xorl %ebx, %ebx
pushq $0x2
popq %rdi
pushq $0x1
popq %rsi
xorl %eax, %eax
callq 0x439c
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq