// File: /workspace/github_c_makefile_star2_O3/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 0x31c55
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 0x1c518
leaq 0xfd82(%rip), %rsi      # 0x41997
movq %r15, 0x38(%rsp)
movq %r15, %rdi
movq %rax, 0x40(%rsp)
movq %rax, %rdx
callq 0x17f99
movq %rax, %r15
cmpw $0xe00, (%r12)          # imm = 0xE00
jne 0x31c5d
movq 0x10(%rsp), %r13
movq %r15, 0x18(%rsp)
movq 0x8(%r12), %rbx
xorl %eax, %eax
cmpl $0x0, (%rsp)
movq %r12, %r15
je 0x31c90
movq %r13, %r12
jmp 0x31cce
xorl %r12d, %r12d
jmp 0x31e97
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 0x19706
addq $0x20, %rsp
xorl %r12d, %r12d
jmp 0x31e8a
leaq 0x264e9(%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 0x31cce
leaq 0x134ec(%rip), %rdi     # 0x451a6
movq %rbp, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
callq 0x1707a
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 0x1337a
addq $0x20, %rsp
testq %rax, %rax
je 0x31d37
movq 0x18(%rsp), %r15
movl (%rsp), %r12d
jmp 0x31e8a
addq $-0xc, 0x20(%rsp)
leaq 0x198bc(%rip), %rdi     # 0x4b600
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), %rbx
movq %rbx, %rcx
movq %rbp, %r8
movq %r14, %r9
pushq %r15
pushq 0x20(%rsp)
pushq %r12
callq 0x1337a
addq $0x20, %rsp
testq %rax, %rax
je 0x31db8
movq %rbx, %r12
movl (%rsp), %edi
movq %r14, %r13
movq %rbp, 0x10(%rsp)
leaq 0x263e4(%rip), %rbx     # 0x58180
testb $0x4, 0x2(%rbx)
jne 0x31dc1
callq 0x1707a
movl %eax, %r14d
leaq 0x13666(%rip), %rdi     # 0x45417
callq 0x5c26
jmp 0x31dc4
movl (%rsp), %r12d
jmp 0x31e5d
movl %edi, %r14d
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rdx
movq %r12, %rbp
addq %r12, %rdx
leaq 0x1984e(%rip), %rdi     # 0x4b628
movq %r13, %rsi
xorl %eax, %eax
callq 0x3120
movl %eax, %r12d
addl %r14d, %r12d
leaq 0x19857(%rip), %rdi     # 0x4b648
callq 0x5c26
testb $0x4, 0x2(%rbx)
jne 0x31e5d
movl %r12d, %edi
callq 0x1707a
movl %eax, %r12d
xorl %eax, %eax
callq 0x17ff9
movq (%rbx), %rax
testl $0x3003, %eax           # imm = 0x3003
movq 0x18(%rsp), %r15
je 0x31e64
testb $0x40, %al
movq 0x8(%rsp), %r14
je 0x31e3a
leaq 0x136be(%rip), %rdi     # 0x454eb
movq %r15, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r12d
leaq 0x16cf0(%rip), %rdi     # 0x48b31
movl $0x19, %esi
movl $0x19, %edx
movq %r13, %rcx
xorl %eax, %eax
callq 0x3120
addl %eax, %r12d
movq (%rbx), %rax
jmp 0x31e69
movq 0x18(%rsp), %r15
jmp 0x31e8a
movq 0x8(%rsp), %r14
testb $0x30, %al
movq 0x10(%rsp), %rdx
je 0x31e8a
addq 0x10(%r14), %rbp
leaq 0x13326(%rip), %rdi     # 0x451a3
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r12d
testq %r15, %r15
je 0x31e97
movq %r15, %rdi
callq 0x3050
movl %r12d, %edi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x17a82