// File: /workspace/github_c_makefile_star2_O2/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 0x3023e
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 0x1b2e4
leaq 0xf799(%rip), %rsi      # 0x3f997
movq %r15, 0x38(%rsp)
movq %r15, %rdi
movq %rax, 0x40(%rsp)
movq %rax, %rdx
callq 0x16f1d
movq %rax, %r15
cmpw $0xe00, (%r12)          # imm = 0xE00
jne 0x30246
movq 0x10(%rsp), %r13
movq %r15, 0x18(%rsp)
movq 0x8(%r12), %rbx
xorl %eax, %eax
cmpl $0x0, (%rsp)
movq %r12, %r15
je 0x30279
movq %r13, %r12
jmp 0x302b6
xorl %r12d, %r12d
jmp 0x30474
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 0x185a8
addq $0x20, %rsp
xorl %r12d, %r12d
jmp 0x3046c
leaq 0x26f00(%rip), %rcx     # 0x57180
movq (%rcx), %rsi
testb $0x30, %sil
sete %cl
testw $0x300, %si             # imm = 0x300
setne %sil
orb %cl, %sil
movq %r13, %r12
jne 0x302b6
leaq 0x12ec0(%rip), %rdi     # 0x43162
movq %rbp, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
callq 0x160f7
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 0x125a8
addq $0x20, %rsp
testq %rax, %rax
je 0x3031f
movq 0x18(%rsp), %r15
movl (%rsp), %r12d
jmp 0x3046c
addq $-0xc, 0x20(%rsp)
leaq 0x19284(%rip), %rdi     # 0x495b0
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 0x125a8
addq $0x20, %rsp
testq %rax, %rax
je 0x303a0
movq %rbx, %r12
movl (%rsp), %edi
movq %r14, %r13
movq %rbp, 0x10(%rsp)
leaq 0x26dfc(%rip), %rbx     # 0x57180
testb $0x4, 0x2(%rbx)
jne 0x303a9
callq 0x160f7
movl %eax, %r14d
leaq 0x1303a(%rip), %rdi     # 0x433d3
callq 0x56e2
jmp 0x303ac
movl (%rsp), %r12d
jmp 0x3043f
movl %edi, %r14d
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rdx
movq %r12, %rbp
addq %r12, %rdx
leaq 0x19216(%rip), %rdi     # 0x495d8
movq %r13, %rsi
xorl %eax, %eax
callq 0x3120
movl %eax, %r12d
addl %r14d, %r12d
leaq 0x1921f(%rip), %rdi     # 0x495f8
callq 0x56e2
testb $0x4, 0x2(%rbx)
jne 0x3043f
movl %r12d, %edi
callq 0x160f7
movl %eax, %r12d
xorl %eax, %eax
callq 0x16f7d
movq (%rbx), %rax
testw $0x3003, %ax            # imm = 0x3003
movq 0x18(%rsp), %r15
je 0x30446
testb $0x40, %al
movq 0x8(%rsp), %r14
je 0x30421
leaq 0x13093(%rip), %rdi     # 0x434a7
movq %r15, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r12d
leaq 0x166b9(%rip), %rdi     # 0x46ae1
pushq $0x19
popq %rdx
movl %edx, %esi
movq %r13, %rcx
xorl %eax, %eax
callq 0x3120
addl %eax, %r12d
movq (%rbx), %rax
jmp 0x3044b
movq 0x18(%rsp), %r15
jmp 0x3046c
movq 0x8(%rsp), %r14
testb $0x30, %al
movq 0x10(%rsp), %rdx
je 0x3046c
addq 0x10(%r14), %rbp
leaq 0x12d00(%rip), %rdi     # 0x4315f
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r12d
movq %r15, %rdi
callq 0x3050
movl %r12d, %edi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x16a4f