// File: /workspace/github_cpp_makefile_star2_O3/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, %r14
movq %rdi, %r15
movq 0x48(%rsi), %rdx
testq %rdx, %rdx
je 0x8b2d
movl 0x14(%rsi), %esi
jmp 0x8b43
movl 0x8(%r15), %eax
decl %eax
cmpl %eax, 0x8(%rsi)
jne 0x8c69
movl 0x14(%rsi), %esi
leaq 0x10(%r15), %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 %r15, %rdi
pushq %r10
pushq %rax
pushq %r11
callq 0x8c8f
addq $0x20, %rsp
testl %eax, %eax
je 0x8c65
movsd 0x10(%rsp), %xmm0
xorpd %xmm1, %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x7b5d(%rip), %xmm2     # 0x106f0
orpd %xmm2, %xmm0
subpd %xmm2, %xmm0
movapd 0x7b5d(%rip), %xmm3     # 0x10700
addpd %xmm3, %xmm0
movupd %xmm0, (%r14)
movl 0x18(%rsp), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
movsd 0x7ae0(%rip), %xmm4     # 0x106a0
addsd %xmm4, %xmm0
movsd %xmm0, 0x10(%r14)
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
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
addsd %xmm4, %xmm0
movsd %xmm0, 0x10(%rbx)
movsd 0x20020(%r15), %xmm0
movupd (%r14), %xmm1
movupd 0x20028(%r15), %xmm2
movapd %xmm0, %xmm3
unpcklpd %xmm0, %xmm3            # xmm3 = xmm3[0],xmm0[0]
mulpd %xmm3, %xmm1
subpd %xmm2, %xmm1
movupd %xmm1, (%r14)
movsd 0x20038(%r15), %xmm1
movsd 0x10(%r14), %xmm4
mulsd %xmm0, %xmm4
subsd %xmm1, %xmm4
movsd %xmm4, 0x10(%r14)
movupd (%rbx), %xmm4
mulpd %xmm3, %xmm4
subpd %xmm2, %xmm4
movupd %xmm4, (%rbx)
mulsd 0x10(%rbx), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rbx)
movl $0x1, %ebx
jmp 0x8c83
xorl %ebx, %ebx
jmp 0x8c83
leaq 0x7bb8(%rip), %rdx      # 0x10828
xorl %ebx, %ebx
movl $0x2, %edi
movl $0x1, %esi
xorl %eax, %eax
callq 0x460c
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq