// File: /workspace/github_c_makefile_star2_O0/hfiguiere[P]exifprobe/x3f.c
// Function: read_x3fheader
struct x3f_header *
read_x3fheader(FILE *inptr,unsigned long offset)
{
    static struct x3f_header header;
    struct x3f_header *headerptr = NULL;
    unsigned long xmagic;
    unsigned char *bytearray;

    memset(&header,0,sizeof(struct x3f_header));
    if(inptr)
    {
        xmagic = read_ulong(inptr,TIFF_INTEL,offset);
        if(xmagic == PROBE_X3FMAGIC)
        {
            header.magic = xmagic;
            header.version_major = read_ushort(inptr,TIFF_INTEL,HERE);
            header.version_minor = read_ushort(inptr,TIFF_INTEL,HERE);
            bytearray = read_bytes(inptr,16,HERE);
            if(bytearray)
                memcpy(header.unique_id,bytearray,16);
            header.mark_bits = read_ulong(inptr,TIFF_INTEL,HERE);
            header.image_width = read_ulong(inptr,TIFF_INTEL,HERE);
            header.image_height = read_ulong(inptr,TIFF_INTEL,HERE);
            header.image_rotation = read_ulong(inptr,TIFF_INTEL,HERE);
            if(header.version_minor >= 1)
            {
                /* this is a string, e.g. "AUTO\0"                    */
                bytearray = read_bytes(inptr,32,HERE);
                if(bytearray)
                    memcpy(header.white_balance,bytearray,32);
                bytearray = read_bytes(inptr,32,HERE);
                if(bytearray)
                    memcpy(header.extended_data_types,bytearray,32);
                bytearray = read_bytes(inptr,128,HERE);
                if(bytearray)
                    memcpy(header.extended_data_values,bytearray,128);
            }
            headerptr = &header;
        }
    }
    return(headerptr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
leaq 0x42759(%rip), %rdi     # 0x7c718
xorl %esi, %esi
movl $0x180, %edx            # imm = 0x180
callq 0x3130
cmpq $0x0, -0x8(%rbp)
je 0x3a1cb
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
movl $0x4949, %esi           # imm = 0x4949
callq 0x4610
movq %rax, -0x20(%rbp)
cmpq $0x62564f46, -0x20(%rbp) # imm = 0x62564F46
jne 0x3a1c9
movq -0x20(%rbp), %rax
movq %rax, 0x42713(%rip)     # 0x7c718
movq -0x8(%rbp), %rdi
movl $0x4949, %esi           # imm = 0x4949
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x4480
movw %ax, 0x42703(%rip)      # 0x7c722
movq -0x8(%rbp), %rdi
movl $0x4949, %esi           # imm = 0x4949
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x4480
movw %ax, 0x426e7(%rip)      # 0x7c720
movq -0x8(%rbp), %rdi
movl $0x10, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x47a0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x3a070
movq -0x28(%rbp), %rax
movq (%rax), %rcx
movq %rcx, 0x426bf(%rip)     # 0x7c724
movq 0x8(%rax), %rax
movq %rax, 0x426bc(%rip)     # 0x7c72c
movq -0x8(%rbp), %rdi
movl $0x4949, %esi           # imm = 0x4949
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x4610
movq %rax, 0x426ae(%rip)     # 0x7c738
movq -0x8(%rbp), %rdi
movl $0x4949, %esi           # imm = 0x4949
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x4610
movq %rax, 0x4269c(%rip)     # 0x7c740
movq -0x8(%rbp), %rdi
movl $0x4949, %esi           # imm = 0x4949
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x4610
movq %rax, 0x4268a(%rip)     # 0x7c748
movq -0x8(%rbp), %rdi
movl $0x4949, %esi           # imm = 0x4949
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x4610
movq %rax, 0x42678(%rip)     # 0x7c750
movzwl 0x42641(%rip), %eax     # 0x7c720
cmpl $0x1, %eax
jl 0x3a1be
movq -0x8(%rbp), %rdi
movl $0x20, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x47a0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x3a135
movq -0x28(%rbp), %rax
movq (%rax), %rcx
movq %rcx, 0x42644(%rip)     # 0x7c758
movq 0x8(%rax), %rcx
movq %rcx, 0x42641(%rip)     # 0x7c760
movq 0x10(%rax), %rcx
movq %rcx, 0x4263e(%rip)     # 0x7c768
movq 0x18(%rax), %rax
movq %rax, 0x4263b(%rip)     # 0x7c770
movq -0x8(%rbp), %rdi
movl $0x20, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x47a0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x3a182
movq -0x28(%rbp), %rax
movq (%rax), %rcx
movq %rcx, 0x42617(%rip)     # 0x7c778
movq 0x8(%rax), %rcx
movq %rcx, 0x42614(%rip)     # 0x7c780
movq 0x10(%rax), %rcx
movq %rcx, 0x42611(%rip)     # 0x7c788
movq 0x18(%rax), %rax
movq %rax, 0x4260e(%rip)     # 0x7c790
movq -0x8(%rbp), %rdi
movl $0x80, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x47a0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x3a1bc
movq -0x28(%rbp), %rsi
leaq 0x4256d(%rip), %rdi     # 0x7c718
addq $0x80, %rdi
movl $0x80, %edx
callq 0x31b0
jmp 0x3a1be
leaq 0x42553(%rip), %rax     # 0x7c718
movq %rax, -0x18(%rbp)
jmp 0x3a1cb
movq -0x18(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)