// File: /workspace/github_cpp_makefile_star2_O1/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
movq %rdi, %r14
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 0xaffc
cmpb $0x3f, %cl
ja 0xb07d
movzbl %cl, %ecx
movabsq $-0xdf0effefffff9fd, %rdx # imm = 0xF20F100100000603
btq %rcx, %rdx
jae 0xb07d
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rbx)
movl $0x0, 0x30(%rbx)
testb $0x8, 0x25(%rbx)
je 0xb073
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 0xb054
addq $0x10, %r14
movl %ecx, %edi
callq 0x2d9b
movq %rax, 0x38(%rbx)
movl %ebp, %ecx
leaq (%r14,%rcx), %rsi
addq $0x20, %rsi
movslq 0x34(%rbx), %rdx
movq %rax, %rdi
callq 0x2240
jmp 0xb073
leaq 0x6793(%rip), %rdx      # 0x117ee
movl $0x2, %edi
movl $0x1, %esi
xorl %eax, %eax
callq 0x46dc
movl $0x0, 0x34(%rbx)
movl $0x1, %eax
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), %ecx
andl $0x7, %ecx
movl %ecx, 0x30(%rbx)
movzbl 0x32(%r14), %ecx
shrl $0x3, %ecx
movl %ecx, 0x2c(%rbx)
movzbl 0x33(%r14), %ecx
movl %ecx, 0x28(%rbx)
jmp 0xb00a