// File: /workspace/github_c_makefile_star2_O1/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 $0x38, %rsp
testq %rdi, %rdi
je 0x1fba5
movq %r9, %rbx
movq %rcx, %r14
movq %rdx, %rbp
movl %esi, %r12d
movq %rdi, 0x20(%rsp)
movq %r8, 0x10(%rsp)
movzwl 0x70(%rsp), %r15d
movl %r15d, 0x34(%rsp)
roll $0x15, %r15d
cmpl $0x3, %r15d
je 0x1fbac
movq %rbx, 0x18(%rsp)
cmpl $0x2, %r15d
jne 0x1fbb8
movq %rbx, %rax
shrq %rax
jmp 0x1fbb3
xorl %ebx, %ebx
jmp 0x1fe3b
movq %rbx, %rax
shrq $0x2, %rax
movq %rax, 0x18(%rsp)
testq %rbp, %rbp
leaq 0x254c6(%rip), %rax     # 0x45088
cmoveq %rax, %rbp
testq %r14, %r14
cmoveq %rax, %r14
leaq 0x385ac(%rip), %rcx     # 0x58180
xorl %r13d, %r13d
testb $0x4, 0x2(%rcx)
je 0x1fc24
leaq 0x214f8(%rip), %rcx     # 0x410dc
movl $0x4043333, %edi        # imm = 0x4043333
movq 0x10(%rsp), %rsi
movl 0x78(%rsp), %edx
callq 0x5605
movzwl 0x18(%rsp), %ecx
leaq 0x28cf6(%rip), %rdi     # 0x488f9
movq %rbp, %rsi
movq %r14, %rdx
movq %rbx, %r8
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
callq 0x16b56
leaq 0x3855f(%rip), %rcx     # 0x58180
movl %eax, %r13d
movzwl (%rcx), %eax
testl $0x3003, %eax           # imm = 0x3003
je 0x1fc9d
movl %r12d, 0x28(%rsp)
movq %r14, %r12
movl 0x78(%rsp), %eax
leal 0x4(%rax), %edx
movq %rcx, %r14
leaq 0x21495(%rip), %rcx     # 0x410dc
movl $0x4003333, %edi        # imm = 0x4003333
movq 0x10(%rsp), %rsi
callq 0x5605
testb $0x40, (%r14)
je 0x1fc70
leaq 0x25844(%rip), %rdi     # 0x454a7
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movq %r12, %r14
leaq 0x28e77(%rip), %rdi     # 0x48af1
movl $0x17, %esi
movl $0x17, %edx
movq %r12, %rcx
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
leaq 0x384e8(%rip), %rcx     # 0x58180
movl 0x28(%rsp), %r12d
testb $0x30, (%rcx)
je 0x1fcf6
movq %rbp, 0x28(%rsp)
leaq 0x2a8ba(%rip), %rdi     # 0x4a568
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
addl %r13d, %ebp
cmpl $0x3, %r15d
ja 0x1fd5c
movl %r15d, %eax
leaq 0x28986(%rip), %rcx     # 0x48654
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movzwl 0x18(%rsp), %esi
movq 0x20(%rsp), %r12
movq %r12, %rdi
movq 0x10(%rsp), %r15
movq %r15, %rdx
callq 0x798e
jmp 0x1fd7a
movq 0x10(%rsp), %r15
jmp 0x1fdea
movzwl 0x18(%rsp), %esi
movzwl %r12w, %edx
movq 0x20(%rsp), %r12
movq %r12, %rdi
movq 0x10(%rsp), %r15
movq %r15, %rcx
callq 0x7d7a
jmp 0x1fd7a
movzwl 0x18(%rsp), %esi
movzwl %r12w, %edx
movq 0x20(%rsp), %r12
movq %r12, %rdi
movq 0x10(%rsp), %r15
movq %r15, %rcx
callq 0x8272
jmp 0x1fd7a
movzwl 0x18(%rsp), %esi
movq 0x20(%rsp), %r12
movq %r12, %rdi
movq 0x10(%rsp), %r15
movq %r15, %rdx
callq 0x7793
jmp 0x1fd7a
leaq 0x28bbb(%rip), %rdi     # 0x4891e
movl 0x34(%rsp), %esi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq 0x10(%rsp), %r15
movq 0x20(%rsp), %r12
leaq 0x39687(%rip), %rax     # 0x59408
movq (%rax), %rax
testq %rax, %rax
je 0x1fddb
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %rbx, %r13
cmpq %rcx, %rax
je 0x1fda0
cmpq %rbx, %rax
cmovaeq %rbx, %rax
movq %rax, %r13
movl %ebp, %edi
callq 0x16b56
movl %eax, %ebp
movl 0x78(%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 0x7446
movl %ebp, %edi
callq 0x16b56
movl %eax, %r13d
jmp 0x1fdde
movl %ebp, %r13d
movq 0x28(%rsp), %rbp
leaq 0x38396(%rip), %rcx     # 0x58180
addq %r15, %rbx
testb $0x4, 0x2(%rcx)
je 0x1fe33
movl %r13d, %edi
callq 0x16b56
movq %rbp, %r15
movl %eax, %ebp
leaq -0x1(%rbx), %rsi
leaq 0x212ee(%rip), %rcx     # 0x410f9
movl $0x4043333, %edi        # imm = 0x4043333
movl 0x78(%rsp), %edx
callq 0x5605
leaq 0x28b10(%rip), %rdi     # 0x48930
movq %r15, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x3120
movl %eax, %r13d
addl %ebp, %r13d
movl %r13d, %edi
callq 0x17530
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq