// File: /workspace/github_c_makefile_star2_O2/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 0x1eea8
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 0x1eeaf
cmpl $0x2, %r15d
jne 0x1eeb3
movq %rbx, %r12
shrq %r12
jmp 0x1eeb3
xorl %ebx, %ebx
jmp 0x1f123
shrq $0x2, %r12
testq %rbp, %rbp
leaq 0x241cb(%rip), %rax     # 0x43088
cmoveq %rax, %rbp
testq %r14, %r14
cmoveq %rax, %r14
leaq 0x382b1(%rip), %rax     # 0x57180
movq (%rax), %rax
xorl %r13d, %r13d
btl $0x12, %eax
jae 0x1ef24
leaq 0x201fa(%rip), %rcx     # 0x3f0dc
movl $0x4043333, %edi        # imm = 0x4043333
movq 0x8(%rsp), %rsi
movl 0x68(%rsp), %edx
callq 0x5100
movzwl %r12w, %ecx
leaq 0x279e9(%rip), %rdi     # 0x468e9
movq %rbp, %rsi
movq %r14, %rdx
movq %rbx, %r8
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
callq 0x160f7
movl %eax, %r13d
leaq 0x3825f(%rip), %rax     # 0x57180
movq (%rax), %rax
testw $0x3003, %ax            # imm = 0x3003
je 0x1ef8a
movl 0x68(%rsp), %eax
leal 0x4(%rax), %edx
leaq 0x201a4(%rip), %rcx     # 0x3f0dc
movl $0x4003333, %edi        # imm = 0x4003333
movq 0x8(%rsp), %rsi
callq 0x5100
leaq 0x38232(%rip), %rax     # 0x57180
testb $0x40, (%rax)
je 0x1ef67
leaq 0x2454d(%rip), %rdi     # 0x434a7
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
leaq 0x27b73(%rip), %rdi     # 0x46ae1
pushq $0x17
popq %rdx
movl %edx, %esi
movq %r14, %rcx
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
leaq 0x381f9(%rip), %rax     # 0x57180
movq (%rax), %rax
testb $0x30, %al
je 0x1efe1
movq %rbp, 0x20(%rsp)
leaq 0x295be(%rip), %rdi     # 0x48558
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
addl %r13d, %ebp
cmpl $0x3, %r15d
ja 0x1f046
movl %r15d, %eax
leaq 0x2768a(%rip), %rcx     # 0x46644
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 0x73b2
jmp 0x1f064
movq 0x8(%rsp), %r15
jmp 0x1f0cb
movzwl %r12w, %esi
movzwl 0x18(%rsp), %edx
movq 0x10(%rsp), %r12
movq %r12, %rdi
movq 0x8(%rsp), %r15
movq %r15, %rcx
callq 0x7790
jmp 0x1f064
movzwl %r12w, %esi
movzwl 0x18(%rsp), %edx
movq 0x10(%rsp), %r12
movq %r12, %rdi
movq 0x8(%rsp), %r15
movq %r15, %rcx
callq 0x7caf
jmp 0x1f064
movzwl %r12w, %esi
movq 0x10(%rsp), %r12
movq %r12, %rdi
movq 0x8(%rsp), %r15
movq %r15, %rdx
callq 0x71a9
jmp 0x1f064
leaq 0x278c1(%rip), %rdi     # 0x4690e
movl 0x1c(%rsp), %esi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq 0x8(%rsp), %r15
movq 0x10(%rsp), %r12
leaq 0x3939d(%rip), %rax     # 0x58408
movq (%rax), %rax
testq %rax, %rax
je 0x1f0c3
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %rbx, %r13
cmpq %rcx, %rax
je 0x1f08a
cmpq %rbx, %rax
cmovaeq %rbx, %rax
movq %rax, %r13
movl %ebp, %edi
callq 0x160f7
movl %eax, %ebp
movl 0x68(%rsp), %eax
leal 0x4(%rax), %r9d
movl $0x4, (%rsp)
pushq $0x10
popq %r8
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movq %r13, %rcx
callq 0x6e93
movl %ebp, %edi
callq 0x160f7
movl %eax, %r13d
jmp 0x1f0c6
movl %ebp, %r13d
movq 0x20(%rsp), %rbp
addq %r15, %rbx
leaq 0x380ab(%rip), %rax     # 0x57180
testb $0x4, 0x2(%rax)
je 0x1f11b
movl %r13d, %edi
callq 0x160f7
movq %rbp, %r15
movl %eax, %ebp
leaq -0x1(%rbx), %rsi
leaq 0x20006(%rip), %rcx     # 0x3f0f9
movl $0x4043333, %edi        # imm = 0x4043333
movl 0x68(%rsp), %edx
callq 0x5100
leaq 0x27818(%rip), %rdi     # 0x46920
movq %r15, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x3120
movl %eax, %r13d
addl %ebp, %r13d
movl %r13d, %edi
callq 0x16a4f
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq