// File: /workspace/github_c_makefile_star2_O3/hfiguiere[P]exifprobe/ciff.c
// Function: print_ciffinheapdata
unsigned long
print_ciffinheapdata(FILE *inptr,unsigned short byteorder,char *dirname,
            char *tagname,unsigned long offset,unsigned long dirlength,
            unsigned short data_format,int indent)
{
    unsigned long end_offset = 0UL;
    unsigned long dumplength;
    unsigned short count;
    int chpr = 0;

    if(inptr)
    {
        end_offset = offset + dirlength;
        switch(data_format)
        {
            case 0x0000: count = dirlength; break;
            case 0x0800: count = dirlength; break;
            case 0x1000: count = dirlength/2; break;
            case 0x1800: count = dirlength/4; break;
            default: count = dirlength; break;  /* handle as bytes?   */
        }
        dirname = dirname ? dirname : QSTRING;
        tagname = tagname ? tagname : QSTRING;
        if((PRINT_SECTION))
        {
            print_tag_address(SECTION|ENTRY,offset, indent,"@");
            chpr += printf("<%s.%s> data, %u entries, length %lu",dirname,tagname,count,dirlength);
            chpr = newline(chpr);
        }
        if((PRINT_TAGINFO))
        {
            print_tag_address(ENTRY,offset,indent+MEDIUMINDENT,"@");
            if((PRINT_LONGNAMES))
                chpr += printf("%s.",dirname);
            chpr += printf("%-*.*s",CIFFTAGWIDTH,CIFFTAGWIDTH,tagname);
        }
        if(PRINT_VALUE)
        {
            chpr += printf(" = ");
            switch(data_format)
            {
                case 0x1000:    /* DC_USHORT                      */
                            print_ushort(inptr,count,byteorder,offset);
                            break;
                case 0x1800:   /* DC_UINT32:                      */
                            print_ulong(inptr,count,byteorder,offset);
                            break;
                case 0x0800:     /* DC_ASCII:                     */
                            print_ascii(inptr,count,offset);
                            break;
                case 0x0000:     /* DC_BYTE:                      */
                            print_ubytes(inptr,count,offset);
                            break;
                default:
                            chpr += printf("(data format %#x)",data_format);
                            break;
            }
            if(Max_undefined > 0L)
            {
                if((Max_undefined == DUMPALL) ||
                        (Max_undefined > dirlength))
                    dumplength = dirlength;
                else 
                    dumplength = Max_undefined;
                chpr = newline(chpr);
                hexdump(inptr,offset,dirlength,dumplength,16,indent+MEDIUMINDENT,
                                                        MEDIUMINDENT);
                chpr = newline(chpr);
            }
        }
        if(PRINT_SECTION)
        {
            chpr = newline(chpr);
            print_tag_address(SECTION|ENTRY,end_offset - 1, indent,"-");
            dirname = dirname ? dirname : QSTRING;
            chpr += printf("</%s.%s>",dirname,tagname);
        }
        setcharsprinted(chpr);
    }
    return(end_offset);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
testq %rdi, %rdi
je 0x2017b
movq %r9, %rbx
movq %rcx, %r14
movq %rdx, %rbp
movq %rdi, 0x10(%rsp)
movq %r8, 0x8(%rsp)
movzwl 0x60(%rsp), %r15d
movl %r15d, 0x1c(%rsp)
roll $0x15, %r15d
cmpl $0x3, %r15d
movl %esi, 0x18(%rsp)
movq %r9, %r12
je 0x20182
cmpl $0x2, %r15d
jne 0x20186
movq %rbx, %r12
shrq %r12
jmp 0x20186
xorl %ebx, %ebx
jmp 0x203fe
shrq $0x2, %r12
testq %rbp, %rbp
leaq 0x24f3c(%rip), %rax     # 0x450cc
cmoveq %rax, %rbp
testq %r14, %r14
cmoveq %rax, %r14
leaq 0x37fde(%rip), %rax     # 0x58180
movq (%rax), %rax
xorl %r13d, %r13d
btl $0x12, %eax
jae 0x201f7
leaq 0x20f27(%rip), %rcx     # 0x410dc
movl $0x4043333, %edi        # imm = 0x4043333
movq 0x8(%rsp), %rsi
movl 0x68(%rsp), %edx
callq 0x55eb
movzwl %r12w, %ecx
leaq 0x28766(%rip), %rdi     # 0x48939
movq %rbp, %rsi
movq %r14, %rdx
movq %rbx, %r8
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
callq 0x1707a
movl %eax, %r13d
leaq 0x37f8c(%rip), %rax     # 0x58180
movq (%rax), %rax
testl $0x3003, %eax           # imm = 0x3003
je 0x20263
movl 0x68(%rsp), %eax
leal 0x4(%rax), %edx
leaq 0x20ed0(%rip), %rcx     # 0x410dc
movl $0x4003333, %edi        # imm = 0x4003333
movq 0x8(%rsp), %rsi
callq 0x55eb
leaq 0x37f5e(%rip), %rax     # 0x58180
testb $0x40, (%rax)
je 0x2023b
leaq 0x252bd(%rip), %rdi     # 0x454eb
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
leaq 0x288ef(%rip), %rdi     # 0x48b31
movl $0x17, %esi
movl $0x17, %edx
movq %r14, %rcx
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
leaq 0x37f20(%rip), %rax     # 0x58180
movq (%rax), %rax
testb $0x30, %al
je 0x202ba
movq %rbp, 0x20(%rsp)
leaq 0x2a335(%rip), %rdi     # 0x4a5a8
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
addl %r13d, %ebp
cmpl $0x3, %r15d
ja 0x2031f
movl %r15d, %eax
leaq 0x28401(%rip), %rcx     # 0x48694
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movzwl %r12w, %esi
movq 0x10(%rsp), %r12
movq %r12, %rdi
movq 0x8(%rsp), %r15
movq %r15, %rdx
callq 0x79c7
jmp 0x2033d
movq 0x8(%rsp), %r15
jmp 0x203a6
movzwl %r12w, %esi
movzwl 0x18(%rsp), %edx
movq 0x10(%rsp), %r12
movq %r12, %rdi
movq 0x8(%rsp), %r15
movq %r15, %rcx
callq 0x7dcb
jmp 0x2033d
movzwl %r12w, %esi
movzwl 0x18(%rsp), %edx
movq 0x10(%rsp), %r12
movq %r12, %rdi
movq 0x8(%rsp), %r15
movq %r15, %rcx
callq 0x8302
jmp 0x2033d
movzwl %r12w, %esi
movq 0x10(%rsp), %r12
movq %r12, %rdi
movq 0x8(%rsp), %r15
movq %r15, %rdx
callq 0x77d6
jmp 0x2033d
leaq 0x28638(%rip), %rdi     # 0x4895e
movl 0x1c(%rsp), %esi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq 0x8(%rsp), %r15
movq 0x10(%rsp), %r12
leaq 0x390c4(%rip), %rax     # 0x59408
movq (%rax), %rax
testq %rax, %rax
je 0x2039e
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %rbx, %r13
cmpq %rcx, %rax
je 0x20363
cmpq %rbx, %rax
cmovaeq %rbx, %rax
movq %rax, %r13
movl %ebp, %edi
callq 0x1707a
movl %eax, %ebp
movl 0x68(%rsp), %eax
leal 0x4(%rax), %r9d
movl $0x4, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movq %r13, %rcx
movl $0x10, %r8d
callq 0x7480
movl %ebp, %edi
callq 0x1707a
movl %eax, %r13d
jmp 0x203a1
movl %ebp, %r13d
movq 0x20(%rsp), %rbp
addq %r15, %rbx
leaq 0x37dd0(%rip), %rax     # 0x58180
testb $0x4, 0x2(%rax)
je 0x203f6
movl %r13d, %edi
callq 0x1707a
movq %rbp, %r15
movl %eax, %ebp
leaq -0x1(%rbx), %rsi
leaq 0x20d2b(%rip), %rcx     # 0x410f9
movl $0x4043333, %edi        # imm = 0x4043333
movl 0x68(%rsp), %edx
callq 0x55eb
leaq 0x2858d(%rip), %rdi     # 0x48970
movq %r15, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x3120
movl %eax, %r13d
addl %ebp, %r13d
movl %r13d, %edi
callq 0x17a82
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq