// File: /workspace/github_c_makefile_star2_O2/hfiguiere[P]exifprobe/ciff.c
// Function: process_ciff
unsigned long
process_ciff(FILE *inptr,struct fileheader *header,unsigned long fileoffset_base,
                        unsigned long heaplength,struct image_summary *summary_entry,
                        char *parent_name,int level,int indent)
{
    struct ciff_header *ciffheader;
    unsigned long max_offset = 0UL;
    unsigned short byteorder = 0;
    unsigned long heap_start = 0UL;
    unsigned long offset_table_end = 0UL;

    if(inptr)
    {
        if(header)
        {
            if(header->ciff_header)
            {
                ciffheader = header->ciff_header;
                byteorder = ciffheader->byteorder;
                heap_start = fileoffset_base + ciffheader->headerlength;
                if(heaplength)
                    offset_table_end = fileoffset_base + heaplength;
                else if(fseek(inptr,0L,SEEK_END) == 0)
                    offset_table_end = ftell(inptr);
                if(ferror(inptr) == 0)
                {
                    max_offset = process_ciff_dir(inptr,heap_start,offset_table_end,
                                                    ciffheader->subtype,parent_name,
                                                    summary_entry,byteorder,
                                                    level,indent);
                    if(max_offset > 0L)
                        max_offset += 4;
                }
                else
                    fprintf(stderr,"%s: cannot read offset table\n",Progname);
            }
            else
                fprintf(stderr,"%s: null ciffheader to process_ciff()\n",Progname);
        }
        else
            fprintf(stderr,"%s: null fileheader to process_ciff()\n",Progname);
    }
    else
        fprintf(stderr,"%s: no open file pointer to read Print Image data\n",
                Progname);

    return(max_offset);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x1bd04
testq %rsi, %rsi
je 0x1bd21
movq 0x10(%rsi), %r13
testq %r13, %r13
je 0x1bd3e
movq %rcx, %r12
movq %rdi, %r15
movq %r9, %r14
movq %r8, (%rsp)
movzwl (%r13), %ebx
movq 0x8(%r13), %rbp
addq %rdx, %rbp
testq %rcx, %rcx
je 0x1bc91
addq %rdx, %r12
jmp 0x1bcb0
xorl %r12d, %r12d
pushq $0x2
popq %rdx
movq %r15, %rdi
xorl %esi, %esi
callq 0x3210
testl %eax, %eax
jne 0x1bcb0
movq %r15, %rdi
callq 0x3190
movq %rax, %r12
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x1bd5b
movl 0x48(%rsp), %eax
movl 0x40(%rsp), %r10d
addq $0x15, %r13
subq $0x8, %rsp
movzwl %bx, %r11d
movq %r15, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movq %r13, %rcx
movq %r14, %r8
movq 0x8(%rsp), %r9
pushq %rax
pushq %r10
pushq %r11
callq 0x1bd91
addq $0x20, %rsp
leaq 0x4(%rax), %rbx
testq %rax, %rax
cmoveq %rax, %rbx
jmp 0x1bd7f
movq 0x3b2ed(%rip), %rax     # 0x56ff8
movq (%rax), %rdi
leaq 0x3c753(%rip), %rax     # 0x58468
movq (%rax), %rdx
leaq 0x27674(%rip), %rsi     # 0x43393
jmp 0x1bd76
movq 0x3b2d0(%rip), %rax     # 0x56ff8
movq (%rax), %rdi
leaq 0x3c736(%rip), %rax     # 0x58468
movq (%rax), %rdx
leaq 0x2a99d(%rip), %rsi     # 0x466d9
jmp 0x1bd76
movq 0x3b2b3(%rip), %rax     # 0x56ff8
movq (%rax), %rdi
leaq 0x3c719(%rip), %rax     # 0x58468
movq (%rax), %rdx
leaq 0x2a959(%rip), %rsi     # 0x466b2
jmp 0x1bd76
movq 0x3b296(%rip), %rax     # 0x56ff8
movq (%rax), %rdi
leaq 0x3c6fc(%rip), %rax     # 0x58468
movq (%rax), %rdx
leaq 0x2a91e(%rip), %rsi     # 0x46694
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x3180
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq