// File: /workspace/github_cpp_makefile_star2_O2/rurban[P]dgnlib/dgnread.cpp
// Function: DGNParseCore(DGNInfo*, DGNElemCore*)
int DGNParseCore( DGNInfo *psDGN, DGNElemCore *psElement )

{
    GByte       *psData = psDGN->abyElem+0;

    psElement->level = psData[0] & 0x3f;
    psElement->complex = psData[0] & 0x80;
    psElement->deleted = psData[1] & 0x80;
    psElement->type = psData[1] & 0x7f;

    if( psDGN->nElemBytes >= 36 && DGNElemTypeHasDispHdr( psElement->type ) )
    {
        psElement->graphic_group = psData[28] + psData[29] * 256;
        psElement->properties = psData[32] + psData[33] * 256;
        psElement->style = psData[34] & 0x7;
        psElement->weight = (psData[34] & 0xf8) >> 3;
        psElement->color = psData[35];
    }
    else
    {
        psElement->graphic_group = 0;
        psElement->properties = 0;
        psElement->style = 0;
        psElement->weight = 0;
        psElement->color = 0;
    }

    if( psElement->properties & DGNPF_ATTRIBUTES )
    {
        int   nAttIndex;
        
        nAttIndex = psData[30] + psData[31] * 256;

        psElement->attr_bytes = psDGN->nElemBytes - nAttIndex*2 - 32;
        if( psElement->attr_bytes > 0 )
        {
            psElement->attr_data = (unsigned char *) 
                CPLMalloc(psElement->attr_bytes);
            memcpy( psElement->attr_data, psData + nAttIndex * 2 + 32,
                    psElement->attr_bytes );
        }
        else
        {
            CPLError(
                CE_Warning, CPLE_AppDefined, 
                "Computed %d bytes for attribute info on element,\n"
                "perhaps this element type doesn't really have a disphdr?",
                psElement->attr_bytes );
            psElement->attr_bytes = 0;
        }
    }
    
    return TRUE;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movzbl 0x10(%rdi), %eax
andl $0x3f, %eax
movl %eax, 0x10(%rsi)
movzbl 0x10(%rdi), %eax
andl $-0x80, %eax
movl %eax, 0x18(%rsi)
movzbl 0x11(%rdi), %eax
andl $-0x80, %eax
movl %eax, 0x1c(%rsi)
movzbl 0x11(%rdi), %ecx
andl $0x7f, %ecx
movl %ecx, 0x14(%rsi)
movl 0xc(%rdi), %eax
cmpl $0x24, %eax
jl 0xa215
movq %rdi, %r14
cmpb $0x3f, %cl
ja 0xa228
movzbl %cl, %ecx
movabsq $-0xdf0effefffff9fd, %rdx # imm = 0xF20F100100000603
btq %rcx, %rdx
jae 0xa228
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rbx)
andl $0x0, 0x30(%rbx)
pushq $0x1
popq %rax
popq %rbx
popq %r14
popq %rbp
retq
movzwl 0x2c(%r14), %ecx
movl %ecx, 0x20(%rbx)
movzwl 0x30(%r14), %ecx
movl %ecx, 0x24(%rbx)
movzbl 0x32(%r14), %edx
andl $0x7, %edx
movl %edx, 0x30(%rbx)
movzbl 0x32(%r14), %edx
shrl $0x3, %edx
movl %edx, 0x2c(%rbx)
movzbl 0x33(%r14), %edx
movl %edx, 0x28(%rbx)
btl $0xb, %ecx
jae 0xa220
movzbl 0x2e(%r14), %ecx
movzbl 0x2f(%r14), %edx
shll $0x9, %edx
leal (%rdx,%rcx,2), %ebp
subl %ebp, %eax
leal -0x20(%rax), %ecx
movl %ecx, 0x34(%rbx)
cmpl $0x21, %eax
jl 0xa2a0
addq $0x10, %r14
movl %ecx, %edi
callq 0x2cb3
movq %rax, 0x38(%rbx)
movl %ebp, %ecx
leaq (%r14,%rcx), %rsi
addq $0x20, %rsi
movslq 0x34(%rbx), %rdx
movq %rax, %rdi
callq 0x2230
jmp 0xa220
leaq 0x55ef(%rip), %rdx      # 0xf896
pushq $0x2
popq %rdi
pushq $0x1
popq %rsi
xorl %eax, %eax
callq 0x439c
andl $0x0, 0x34(%rbx)
jmp 0xa220