// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
pushq %rbx
subq $0x88, %rsp
movw %si, %ax
movl 0x30(%rbp), %esi
movl 0x28(%rbp), %esi
movl 0x20(%rbp), %esi
movl 0x18(%rbp), %esi
movq 0x10(%rbp), %rsi
movq %rdi, -0x10(%rbp)
movw %ax, -0x12(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movl $0x0, -0x5c(%rbp)
movq $0x0, -0x68(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x48dae
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
movq 0x10(%rcx), %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movzwl (%rax), %edi
movl 0x20(%rbp), %esi
movl 0x28(%rbp), %edx
callq 0x28160
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rdx
leaq 0x1be69(%rip), %rsi     # 0x64962
callq 0x20960
movq %rax, -0x68(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x20(%rbp), %rax
movw (%rax), %ax
subw $0xe00, %ax             # imm = 0xE00
jne 0x48d5d
jmp 0x48b21
cmpl $0x0, 0x30(%rbp)
jne 0x48b7a
leaq 0x2e652(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x30, %rax
cmpq $0x0, %rax
je 0x48b7a
leaq 0x2e63e(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x300, %rax            # imm = 0x300
cmpq $0x0, %rax
jne 0x48b78
movq -0x48(%rbp), %rsi
movq -0x58(%rbp), %rdx
leaq 0x1ecd4(%rip), %rdi     # 0x67834
movb $0x0, %al
callq 0x3110
addl -0x5c(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0x5c(%rbp), %edi
callq 0x1ef50
movl %eax, -0x5c(%rbp)
jmp 0x48b7a
movq -0x10(%rbp), %rdi
callq 0x3180
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rdi
movw -0x12(%rbp), %si
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0x28(%rbp), %rcx
movq -0x58(%rbp), %r8
movq -0x40(%rbp), %r9
movq -0x38(%rbp), %r11
movq 0x10(%rbp), %r10
movl 0x18(%rbp), %eax
movzwl %si, %esi
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movl %eax, 0x10(%rsp)
callq 0x19950
cmpq $0x0, %rax
jne 0x48d5b
movq -0x50(%rbp), %rax
subq $0xc, %rax
movq %rax, -0x28(%rbp)
leaq 0x24fe0(%rip), %rdi     # 0x6dbc0
movb $0x0, %al
callq 0x3110
addl -0x5c(%rbp), %eax
movl %eax, -0x5c(%rbp)
movq -0x10(%rbp), %rdi
movw -0x12(%rbp), %si
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0x28(%rbp), %rcx
movq -0x58(%rbp), %r8
movq -0x40(%rbp), %r9
movq -0x38(%rbp), %r11
movq 0x10(%rbp), %r10
movl 0x18(%rbp), %eax
movzwl %si, %esi
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movl %eax, 0x10(%rsp)
callq 0x19950
cmpq $0x0, %rax
je 0x48d59
leaq 0x2e546(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40000, %rax          # imm = 0x40000
cmpq $0x0, %rax
jne 0x48c60
movl -0x5c(%rbp), %edi
callq 0x1ef50
movl %eax, -0x5c(%rbp)
leaq 0x1ee4a(%rip), %rdi     # 0x67aa5
callq 0x6860
movq -0x40(%rbp), %rsi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdx
addq -0x28(%rbp), %rdx
leaq 0x24f71(%rip), %rdi     # 0x6dbe8
movb $0x0, %al
callq 0x3110
addl -0x5c(%rbp), %eax
movl %eax, -0x5c(%rbp)
leaq 0x24f7d(%rip), %rdi     # 0x6dc08
callq 0x6860
leaq 0x2e4e9(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40000, %rax          # imm = 0x40000
cmpq $0x0, %rax
jne 0x48d57
movl -0x5c(%rbp), %edi
callq 0x1ef50
movl %eax, -0x5c(%rbp)
movb $0x0, %al
callq 0x20a30
leaq 0x2e4bd(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x3003, %rax           # imm = 0x3003
cmpq $0x0, %rax
je 0x48d1d
leaq 0x2e4a7(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40, %rax
cmpq $0x0, %rax
je 0x48cfe
movq -0x68(%rbp), %rsi
leaq 0x1ee88(%rip), %rdi     # 0x67b79
movb $0x0, %al
callq 0x3110
addl -0x5c(%rbp), %eax
movl %eax, -0x5c(%rbp)
movq -0x40(%rbp), %rcx
leaq 0x22393(%rip), %rdi     # 0x6b09c
movl $0x19, %edx
movl %edx, %esi
movb $0x0, %al
callq 0x3110
addl -0x5c(%rbp), %eax
movl %eax, -0x5c(%rbp)
leaq 0x2e45c(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x30, %rax
cmpq $0x0, %rax
je 0x48d55
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rsi
addq -0x28(%rbp), %rsi
movq -0x58(%rbp), %rdx
leaq 0x1eae9(%rip), %rdi     # 0x67831
movb $0x0, %al
callq 0x3110
addl -0x5c(%rbp), %eax
movl %eax, -0x5c(%rbp)
jmp 0x48d57
jmp 0x48d59
jmp 0x48d5b
jmp 0x48d9c
movq -0x10(%rbp), %rdi
movw -0x12(%rbp), %si
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x68(%rbp), %r8
movq 0x10(%rbp), %r9
movl 0x18(%rbp), %ebx
movl 0x20(%rbp), %r11d
movl 0x28(%rbp), %r10d
movl 0x30(%rbp), %eax
movzwl %si, %esi
movl %ebx, (%rsp)
movl %r11d, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movl %eax, 0x18(%rsp)
callq 0x23f60
cmpq $0x0, -0x68(%rbp)
je 0x48dac
movq -0x68(%rbp), %rdi
callq 0x3040
jmp 0x48dae
movl -0x5c(%rbp), %edi
callq 0x1ff00
addq $0x88, %rsp
popq %rbx
popq %rbp
retq