// File: /workspace/github_c_makefile_star2_O2/hfiguiere[P]exifprobe/x3f.c
// Function: process_x3f
unsigned long
process_x3f(FILE *inptr,struct fileheader *header,unsigned long fileoffset_base,
                                        struct image_summary *summary_entry,
                                        char *parent_name,int level,int indent)
{
    struct x3f_header *x3fheader;
    unsigned long max_offset = 0UL;
    unsigned short byteorder = 0;
    unsigned long directory_pointer = 0UL;

    if(inptr)
    {
        if(header)
        {
            if(header->x3f_header)
            {
                x3fheader = header->x3f_header;
                /* X3F is always little-endian; nonetheless, pass it  */
                /* as an argument to lower-level functions. Just set  */
                /* it here.                                           */
                byteorder = TIFF_INTEL;
                if(fseek(inptr,-4L,SEEK_END) == 0)
                    directory_pointer = ftell(inptr);
                if(ferror(inptr) == 0)
                {
                    max_offset = process_x3f_dir(inptr,byteorder,x3fheader,
                                                    directory_pointer,summary_entry,
                                                    parent_name,level,indent);
                    if(max_offset > 0L)
                        max_offset += 4;
                }
                else
                    fprintf(stderr,"%s: cannot read directory offset\n",Progname);
            }
            else
                fprintf(stderr,"%s: null x3fheader to process_x3f()\n",Progname);
        }
        else
            fprintf(stderr,"%s: null fileheader to process_x3f()\n",Progname);
    }
    else
        fprintf(stderr,"%s: no open file pointer to read Print Image data\n",
                                                                        Progname);

    return(max_offset);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
testq %rdi, %rdi
je 0x27dbb
testq %rsi, %rsi
je 0x27dd8
cmpq $0x0, 0x40(%rsi)
je 0x27df5
movq %r8, %rbx
movq %rcx, %r14
movq %rdi, %r15
pushq $-0x4
popq %rsi
pushq $0x2
popq %rdx
callq 0x3210
testl %eax, %eax
je 0x27d75
xorl %r12d, %r12d
jmp 0x27d80
movq %r15, %rdi
callq 0x3190
movq %rax, %r12
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x27e12
movl 0x40(%rsp), %eax
movl %eax, 0x8(%rsp)
movq %r15, %rdi
movl $0x4949, %esi           # imm = 0x4949
movq %r12, %rcx
movq %r14, %r8
movq %rbx, %r9
callq 0x27e45
leaq 0x4(%rax), %rbx
testq %rax, %rax
cmoveq %rax, %rbx
jmp 0x27e36
movq 0x2f236(%rip), %rax     # 0x56ff8
movq (%rax), %rdi
leaq 0x3069c(%rip), %rax     # 0x58468
movq (%rax), %rdx
leaq 0x1b5bd(%rip), %rsi     # 0x43393
jmp 0x27e2d
movq 0x2f219(%rip), %rax     # 0x56ff8
movq (%rax), %rdi
leaq 0x3067f(%rip), %rax     # 0x58468
movq (%rax), %rdx
leaq 0x1fb9e(%rip), %rsi     # 0x47991
jmp 0x27e2d
movq 0x2f1fc(%rip), %rax     # 0x56ff8
movq (%rax), %rdi
leaq 0x30662(%rip), %rax     # 0x58468
movq (%rax), %rdx
leaq 0x1fb5c(%rip), %rsi     # 0x4796c
jmp 0x27e2d
movq 0x2f1df(%rip), %rax     # 0x56ff8
movq (%rax), %rdi
leaq 0x30645(%rip), %rax     # 0x58468
movq (%rax), %rdx
leaq 0x1fb1d(%rip), %rsi     # 0x4794a
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x3180
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq