// File: /workspace/github_cpp_makefile_star2_O1/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 0x8c52
movl 0x14(%rsi), %esi
jmp 0x8c68
movl 0x8(%r15), %eax
decl %eax
cmpl %eax, 0x8(%rsi)
jne 0x8dc0
movl 0x14(%rsi), %esi
leaq 0x10(%r15), %rdx
leaq 0x18(%rsp), %r8
leaq 0x1c(%rsp), %r9
leaq 0xc(%rsp), %rax
leaq 0x10(%rsp), %r10
subq $0x8, %rsp
leaq 0x10(%rsp), %r11
leaq 0x1c(%rsp), %rcx
movq %r15, %rdi
pushq %r10
pushq %rax
pushq %r11
callq 0x8de6
addq $0x20, %rsp
testl %eax, %eax
je 0x8dbc
movl 0x14(%rsp), %eax
cvtsi2sd %rax, %xmm0
movsd 0x89b4(%rip), %xmm1     # 0x11668
addsd %xmm1, %xmm0
movsd %xmm0, (%r14)
movl 0x18(%rsp), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x8(%r14)
movl 0x1c(%rsp), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x10(%r14)
movl 0x8(%rsp), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rbx)
movl 0xc(%rsp), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rbx)
movl 0x10(%rsp), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rbx)
movsd 0x20020(%r15), %xmm0
movsd 0x20028(%r15), %xmm1
movsd (%r14), %xmm2
mulsd %xmm0, %xmm2
subsd %xmm1, %xmm2
movsd %xmm2, (%r14)
movsd 0x20030(%r15), %xmm2
movsd 0x8(%r14), %xmm3
mulsd %xmm0, %xmm3
subsd %xmm2, %xmm3
movsd %xmm3, 0x8(%r14)
movsd 0x20038(%r15), %xmm3
movsd 0x10(%r14), %xmm4
mulsd %xmm0, %xmm4
subsd %xmm3, %xmm4
movsd %xmm4, 0x10(%r14)
movsd (%rbx), %xmm4
mulsd %xmm0, %xmm4
subsd %xmm1, %xmm4
movsd %xmm4, (%rbx)
movsd 0x8(%rbx), %xmm1
mulsd %xmm0, %xmm1
subsd %xmm2, %xmm1
movsd %xmm1, 0x8(%rbx)
mulsd 0x10(%rbx), %xmm0
subsd %xmm3, %xmm0
movsd %xmm0, 0x10(%rbx)
movl $0x1, %ebx
jmp 0x8dda
xorl %ebx, %ebx
jmp 0x8dda
leaq 0x89c9(%rip), %rdx      # 0x11790
xorl %ebx, %ebx
movl $0x2, %edi
movl $0x1, %esi
xorl %eax, %eax
callq 0x46dc
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq