// File: 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 %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0xd181
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x14(%rax), %esi
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rdx
leaq -0x3c(%rbp), %rcx
leaq -0x3c(%rbp), %r8
addq $0x4, %r8
leaq -0x3c(%rbp), %r9
addq $0x8, %r9
leaq -0x48(%rbp), %r11
leaq -0x48(%rbp), %r10
addq $0x4, %r10
leaq -0x48(%rbp), %rax
addq $0x8, %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0xd2e0
movl %eax, -0x4c(%rbp)
jmp 0xd20f
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x30(%rbp), %rcx
movl 0x8(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0xd1e9
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x14(%rax), %esi
movq -0x30(%rbp), %rdx
addq $0x10, %rdx
leaq -0x3c(%rbp), %rcx
leaq -0x3c(%rbp), %r8
addq $0x4, %r8
leaq -0x3c(%rbp), %r9
addq $0x8, %r9
leaq -0x48(%rbp), %r11
leaq -0x48(%rbp), %r10
addq $0x4, %r10
leaq -0x48(%rbp), %rax
addq $0x8, %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0xd2e0
movl %eax, -0x4c(%rbp)
jmp 0xd20d
movl $0x2, %edi
movl $0x1, %esi
leaq 0xd27e(%rip), %rdx      # 0x1a478
movb $0x0, %al
callq 0x5740
movl $0x0, -0x4(%rbp)
jmp 0xd2ce
jmp 0xd20f
cmpl $0x0, -0x4c(%rbp)
jne 0xd221
movl $0x0, -0x4(%rbp)
jmp 0xd2ce
movl -0x3c(%rbp), %eax
cvtsi2sd %rax, %xmm0
movsd 0xd107(%rip), %xmm1     # 0x1a338
subsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, (%rax)
movl -0x38(%rbp), %eax
cvtsi2sd %rax, %xmm0
subsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0x8(%rax)
movl -0x34(%rbp), %eax
cvtsi2sd %rax, %xmm0
subsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0x10(%rax)
movl -0x48(%rbp), %eax
cvtsi2sd %rax, %xmm0
subsd %xmm1, %xmm0
movq -0x28(%rbp), %rax
movsd %xmm0, (%rax)
movl -0x44(%rbp), %eax
cvtsi2sd %rax, %xmm0
subsd %xmm1, %xmm0
movq -0x28(%rbp), %rax
movsd %xmm0, 0x8(%rax)
movl -0x40(%rbp), %eax
cvtsi2sd %rax, %xmm0
movsd 0xd098(%rip), %xmm1     # 0x1a338
subsd %xmm1, %xmm0
movq -0x28(%rbp), %rax
movsd %xmm0, 0x10(%rax)
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xd4f0
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0xd4f0
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw (%rax,%rax)