// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x80, %rsp
movw %si, %ax
movl 0x18(%rbp), %esi
movw 0x10(%rbp), %si
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movl $0x0, -0x48(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x2e01d
movq -0x28(%rbp), %rax
movq -0x30(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movzwl 0x10(%rbp), %eax
movl %eax, -0x4c(%rbp)
testl %eax, %eax
je 0x2dcd7
jmp 0x2dcb3
movl -0x4c(%rbp), %eax
subl $0x800, %eax            # imm = 0x800
je 0x2dce1
jmp 0x2dcbf
movl -0x4c(%rbp), %eax
subl $0x1000, %eax           # imm = 0x1000
je 0x2dceb
jmp 0x2dccb
movl -0x4c(%rbp), %eax
subl $0x1800, %eax           # imm = 0x1800
je 0x2dcf8
jmp 0x2dd06
movq -0x30(%rbp), %rax
movw %ax, -0x42(%rbp)
jmp 0x2dd0e
movq -0x30(%rbp), %rax
movw %ax, -0x42(%rbp)
jmp 0x2dd0e
movq -0x30(%rbp), %rax
shrq %rax
movw %ax, -0x42(%rbp)
jmp 0x2dd0e
movq -0x30(%rbp), %rax
shrq $0x2, %rax
movw %ax, -0x42(%rbp)
jmp 0x2dd0e
movq -0x30(%rbp), %rax
movw %ax, -0x42(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x2dd1f
movq -0x18(%rbp), %rax
movq %rax, -0x58(%rbp)
jmp 0x2dd2c
leaq 0x39a34(%rip), %rax     # 0x6775a
movq %rax, -0x58(%rbp)
jmp 0x2dd2c
movq -0x58(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x2dd45
movq -0x20(%rbp), %rax
movq %rax, -0x60(%rbp)
jmp 0x2dd52
leaq 0x39a0e(%rip), %rax     # 0x6775a
movq %rax, -0x60(%rbp)
jmp 0x2dd52
movq -0x60(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq 0x4941f(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40000, %rax          # imm = 0x40000
cmpq $0x0, %rax
je 0x2ddb7
movq -0x28(%rbp), %rsi
movl 0x18(%rbp), %edx
movl $0x4043333, %edi        # imm = 0x4043333
leaq 0x36359(%rip), %rcx     # 0x640dc
callq 0x5ed0
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movzwl -0x42(%rbp), %ecx
movq -0x30(%rbp), %r8
leaq 0x3d105(%rip), %rdi     # 0x6aea4
movb $0x0, %al
callq 0x3110
addl -0x48(%rbp), %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %edi
callq 0x1ef50
movl %eax, -0x48(%rbp)
leaq 0x493c2(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x3003, %rax           # imm = 0x3003
cmpq $0x0, %rax
je 0x2de33
movq -0x28(%rbp), %rsi
movl 0x18(%rbp), %edx
addl $0x4, %edx
movl $0x4003333, %edi        # imm = 0x4003333
leaq 0x362f9(%rip), %rcx     # 0x640dc
callq 0x5ed0
leaq 0x49391(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40, %rax
cmpq $0x0, %rax
je 0x2de14
movq -0x18(%rbp), %rsi
leaq 0x39d72(%rip), %rdi     # 0x67b79
movb $0x0, %al
callq 0x3110
addl -0x48(%rbp), %eax
movl %eax, -0x48(%rbp)
movq -0x20(%rbp), %rcx
leaq 0x3d27d(%rip), %rdi     # 0x6b09c
movl $0x17, %edx
movl %edx, %esi
movb $0x0, %al
callq 0x3110
addl -0x48(%rbp), %eax
movl %eax, -0x48(%rbp)
leaq 0x49346(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x30, %rax
cmpq $0x0, %rax
je 0x2df96
leaq 0x3eec6(%rip), %rdi     # 0x6cd18
xorl %eax, %eax
callq 0x3110
movl %eax, %ecx
movl -0x48(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x48(%rbp)
movzwl 0x10(%rbp), %eax
movl %eax, -0x64(%rbp)
testl %eax, %eax
je 0x2dee1
jmp 0x2de70
movl -0x64(%rbp), %eax
subl $0x800, %eax            # imm = 0x800
je 0x2decc
jmp 0x2de7c
movl -0x64(%rbp), %eax
subl $0x1000, %eax           # imm = 0x1000
je 0x2de94
jmp 0x2de88
movl -0x64(%rbp), %eax
subl $0x1800, %eax           # imm = 0x1800
je 0x2deb0
jmp 0x2def6
movq -0x8(%rbp), %rdi
movzwl -0x42(%rbp), %eax
movl %eax, %esi
movw -0xa(%rbp), %ax
movq -0x28(%rbp), %rcx
movzwl %ax, %edx
callq 0x9660
jmp 0x2df0e
movq -0x8(%rbp), %rdi
movzwl -0x42(%rbp), %eax
movl %eax, %esi
movw -0xa(%rbp), %ax
movq -0x28(%rbp), %rcx
movzwl %ax, %edx
callq 0x9df0
jmp 0x2df0e
movq -0x8(%rbp), %rdi
movzwl -0x42(%rbp), %eax
movl %eax, %esi
movq -0x28(%rbp), %rdx
callq 0x8e70
jmp 0x2df0e
movq -0x8(%rbp), %rdi
movzwl -0x42(%rbp), %eax
movl %eax, %esi
movq -0x28(%rbp), %rdx
callq 0x9110
jmp 0x2df0e
movzwl 0x10(%rbp), %esi
leaq 0x3cfc8(%rip), %rdi     # 0x6aec9
movb $0x0, %al
callq 0x3110
addl -0x48(%rbp), %eax
movl %eax, -0x48(%rbp)
leaq 0x4a4f3(%rip), %rax     # 0x78408
cmpq $0x0, (%rax)
jbe 0x2df94
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
leaq 0x4a4e1(%rip), %rax     # 0x78408
cmpq %rcx, (%rax)
je 0x2df3c
leaq 0x4a4d5(%rip), %rax     # 0x78408
movq (%rax), %rax
cmpq -0x30(%rbp), %rax
jbe 0x2df46
movq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0x2df54
leaq 0x4a4bb(%rip), %rax     # 0x78408
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movl -0x48(%rbp), %edi
callq 0x1ef50
movl %eax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x40(%rbp), %rcx
movl 0x18(%rbp), %r9d
addl $0x4, %r9d
movl $0x10, %r8d
movl $0x4, (%rsp)
callq 0x8aa0
movl -0x48(%rbp), %edi
callq 0x1ef50
movl %eax, -0x48(%rbp)
jmp 0x2df96
leaq 0x491e3(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40000, %rax          # imm = 0x40000
cmpq $0x0, %rax
je 0x2e015
movl -0x48(%rbp), %edi
callq 0x1ef50
movl %eax, -0x48(%rbp)
movq -0x38(%rbp), %rsi
subq $0x1, %rsi
movl 0x18(%rbp), %edx
movl $0x4043333, %edi        # imm = 0x4043333
leaq 0x3612b(%rip), %rcx     # 0x640f9
callq 0x5ed0
cmpq $0x0, -0x18(%rbp)
je 0x2dfe4
movq -0x18(%rbp), %rax
movq %rax, -0x70(%rbp)
jmp 0x2dff1
leaq 0x3976f(%rip), %rax     # 0x6775a
movq %rax, -0x70(%rbp)
jmp 0x2dff1
movq -0x70(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq 0x3ced3(%rip), %rdi     # 0x6aedb
movb $0x0, %al
callq 0x3110
addl -0x48(%rbp), %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %edi
callq 0x1ff00
movq -0x38(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopw (%rax,%rax)