// File: /workspace/github_c_makefile_star2_O1/hfiguiere[P]exifprobe/maker_casio.c
// Function: casio1_offset_makervalue
void
casio1_offset_makervalue(FILE *inptr,unsigned short byteorder,
    struct ifd_entry *entry_ptr,unsigned long fileoffset_base,
    struct image_summary *summary_entry,char *parent_name,char*prefix,
    int indent,int make,int model,int at_offset)
{
    char *nameoftag;
    unsigned long value_offset,current_offset;
    unsigned long count;
    int chpr = 0;
    char *fulldirname = NULL;

    if(entry_ptr)
    {
        value_offset = fileoffset_base + entry_ptr->value;
        nameoftag = maker_tagname(entry_ptr->tag,make,model); 
        fulldirname = splice(parent_name,".",nameoftag);
        count = entry_ptr->count;

        switch(entry_ptr->tag)
        {
            case 0x0e00: /* PrintIM (Epson Print Image matching)  */
                if(!at_offset && (PRINT_VALUE))
                {
                    if(!(PRINT_OFFSET))
                    {
                        chpr += printf("@%lu:%lu",value_offset,count);
                        chpr = newline(chpr);
                    }
                }
                current_offset = ftell(inptr);
                if(process_pim(inptr,byteorder,entry_ptr->value,fileoffset_base,
                    count,nameoftag,parent_name,prefix,indent) == 0)
                {
                    /* At least one QV4000 image uses a PIM offset    */
                    /* relative to the entry address, even though     */
                    /* other entries in the note are TIFF-relative;   */
                    /* check for a PIM entry at that location if the  */
                    /* previous one failed. GROSS HACK!               */
                    fileoffset_base = current_offset - 12;
                    PUSHCOLOR(HI_BLACK);
                    chpr += printf(" checking for entry-relative offset bug");
                    POPCOLOR();
                    if(process_pim(inptr,byteorder,entry_ptr->value,fileoffset_base,
                                    count,nameoftag,parent_name,
                                    prefix,indent))
                    {
                        if(!(PRINT_SECTION))
                        {
                            chpr = newline(chpr);
                            printred("# WARNING:");
                        }
                        PUSHCOLOR(HI_BLACK);
                        chpr += printf(" %s data found at offset %lu - ",nameoftag,
                                                entry_ptr->value + fileoffset_base);
                        printred("start offset is incorrect!");
                        POPCOLOR();
                        if(!(PRINT_SECTION))
                        {
                            chpr = newline(chpr);
                            print_filename();
                            if((PRINT_TAGINFO))
                            {
                                if((PRINT_LONGNAMES))
                                    chpr += printf("%s.",fulldirname);
                                chpr += printf("%-*.*s",MAKERTAGWIDTH,MAKERTAGWIDTH,nameoftag);
                            }
                            if((PRINT_VALUE))
                                chpr += printf(" = @%lu:%lu",entry_ptr->value + fileoffset_base,
                                                                                        count);
                        }
                    }
                }
                break;
            default:
                print_generic_offset_makervalue(inptr,byteorder,entry_ptr,
                                        fileoffset_base,fulldirname,prefix,indent,
                                        make,model,at_offset);
                break;
        }
        if(fulldirname)
            free(fulldirname);
    }
    setcharsprinted(chpr);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
testq %rdx, %rdx
je 0x313c5
movq %r9, %r15
movl %esi, 0x8(%rsp)
movq %rdi, 0x28(%rsp)
movl 0xa0(%rsp), %eax
movq %rax, (%rsp)
movl 0x98(%rsp), %ebx
movq %rdx, %r12
movl 0x90(%rsp), %r13d
movl 0x88(%rsp), %eax
movq %rax, 0x30(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rdx), %rbp
addq %rcx, %rbp
movzwl (%rdx), %edi
movl %r13d, %esi
movl %ebx, %edx
movq %rcx, %r14
callq 0x1c020
leaq 0x10612(%rip), %rsi     # 0x41997
movq %r15, 0x38(%rsp)
movq %r15, %rdi
movq %rax, 0x40(%rsp)
movq %rax, %rdx
callq 0x17a47
movq %rax, %r15
cmpw $0xe00, (%r12)          # imm = 0xE00
jne 0x313cd
movq 0x10(%rsp), %r13
movq %r15, 0x18(%rsp)
movq 0x8(%r12), %rbx
xorl %eax, %eax
cmpl $0x0, (%rsp)
movq %r12, %r15
je 0x31400
movq %r13, %r12
jmp 0x3143e
xorl %r12d, %r12d
jmp 0x3160b
movzwl 0x8(%rsp), %esi
movq 0x28(%rsp), %rdi
movq %r12, %rdx
movq %r14, %rcx
movq %r15, %r8
movq 0x10(%rsp), %r9
pushq (%rsp)
pushq %rbx
pushq %r13
pushq 0x48(%rsp)
callq 0x191ac
addq $0x20, %rsp
xorl %r12d, %r12d
jmp 0x315fe
leaq 0x26d79(%rip), %rcx     # 0x58180
movq (%rcx), %rsi
testb $0x30, %sil
sete %cl
testl $0x300, %esi            # imm = 0x300
setne %sil
orb %cl, %sil
movq %r13, %r12
jne 0x3143e
leaq 0x13d38(%rip), %rdi     # 0x45162
movq %rbp, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
callq 0x16b56
movl %eax, (%rsp)
movq 0x28(%rsp), %r13
movq %r13, %rdi
callq 0x3190
movq %rax, 0x20(%rsp)
movq 0x10(%r15), %rdx
subq $0x8, %rsp
movq %rbx, %rbp
movzwl 0x10(%rsp), %ebx
movq %r13, %rdi
movl %ebx, %esi
movq %r14, %rcx
movq %rbp, %r8
movq 0x48(%rsp), %r14
movq %r14, %r9
movq %r15, 0x10(%rsp)
movq 0x38(%rsp), %r15
pushq %r15
pushq %r12
movq 0x50(%rsp), %r12
pushq %r12
callq 0x12f22
addq $0x20, %rsp
testq %rax, %rax
je 0x314a7
movq 0x18(%rsp), %r15
movl (%rsp), %r12d
jmp 0x315fe
addq $-0xc, 0x20(%rsp)
leaq 0x1a10c(%rip), %rdi     # 0x4b5c0
xorl %eax, %eax
callq 0x3120
addl (%rsp), %eax
movl %eax, (%rsp)
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rdx
subq $0x8, %rsp
movq %r13, %rdi
movl %ebx, %esi
movq 0x28(%rsp), %r13
movq %r13, %rcx
movq %rbp, %r8
movq %r14, %rbx
movq %r14, %r9
pushq %r15
pushq 0x20(%rsp)
pushq %r12
callq 0x12f22
addq $0x20, %rsp
testq %rax, %rax
je 0x315ca
movq %r13, %r12
movl (%rsp), %r14d
movq %rbp, 0x10(%rsp)
leaq 0x26c6f(%rip), %r13     # 0x58180
testb $0x4, 0x2(%r13)
jne 0x3152f
movl %r14d, %edi
callq 0x16b56
movl %eax, %r14d
leaq 0x13ea9(%rip), %rdi     # 0x453d3
callq 0x5c33
movq %rbx, %rbp
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rdx
movq %r12, %rbx
addq %r12, %rdx
leaq 0x1a0a0(%rip), %rdi     # 0x4b5e8
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3120
movl %eax, %r12d
addl %r14d, %r12d
leaq 0x1a0a9(%rip), %rdi     # 0x4b608
callq 0x5c33
testb $0x4, 0x2(%r13)
jne 0x315ce
movl %r12d, %edi
callq 0x16b56
movl %eax, %r12d
xorl %eax, %eax
callq 0x17aa7
movq (%r13), %rax
testl $0x3003, %eax           # imm = 0x3003
movq 0x18(%rsp), %r15
je 0x315d5
testb $0x40, %al
movq 0x8(%rsp), %r14
je 0x315aa
leaq 0x13f0a(%rip), %rdi     # 0x454a7
movq %r15, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r12d
leaq 0x17540(%rip), %rdi     # 0x48af1
movl $0x19, %esi
movl $0x19, %edx
movq %rbp, %rcx
xorl %eax, %eax
callq 0x3120
addl %eax, %r12d
jmp 0x315da
movl (%rsp), %r12d
movq 0x18(%rsp), %r15
jmp 0x315fe
movq 0x8(%rsp), %r14
testb $0x30, (%r13)
je 0x315fe
movq %rbx, %rsi
addq 0x10(%r14), %rsi
leaq 0x13b70(%rip), %rdi     # 0x4515f
movq 0x10(%rsp), %rdx
xorl %eax, %eax
callq 0x3120
addl %eax, %r12d
testq %r15, %r15
je 0x3160b
movq %r15, %rdi
callq 0x3050
movl %r12d, %edi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x17530