// File: /workspace/github_c_makefile_star2_O2/hfiguiere[P]exifprobe/maker_sanyo.c
// Function: sanyo1_offset_makervalue
void
sanyo1_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)
{
    unsigned long value_offset;
    unsigned long dumplength;
    unsigned long count;
    unsigned short marker;
    unsigned long max_offset = 0;
    char *nameoftag;
    char *fulldirname = NULL;
    int status = 0;
    int chpr = 0;

    if(entry_ptr)
    {
        nameoftag = maker_tagname(entry_ptr->tag,make,model); 
        fulldirname = splice(parent_name,".",nameoftag);
        value_offset = fileoffset_base + entry_ptr->value;
        count = entry_ptr->count;
        switch(entry_ptr->tag)
        {
            case 0x0100:    /* Jpeg Thumbnail in TIFF MakerNote       */
                if(at_offset && (PRINT_SECTION))
                {
                    print_tag_address(VALUE_AT_OFFSET,value_offset,indent,prefix);
                    extraindent(4);
                    chpr += printf("# Start of JPEG Thumbnail from MakerNote");
                    chpr += printf(" length %ld",count); 
                }
                else if(!at_offset && (PRINT_VALUE))
                {
                    if(!(PRINT_OFFSET))
                        chpr += printf("@%lu:%lu",value_offset,entry_ptr->count);
                    else
                        chpr += printf(":%lu", entry_ptr->count);
                    if(!(PRINT_VALUE_AT_OFFSET))
                        chpr += printf(" # UNDEFINED");
                }
                if((PRINT_SECTION) || (PRINT_SEGMENT))
                    chpr = newline(chpr);
                marker = read_ushort(inptr,TIFF_MOTOROLA,value_offset);
                max_offset = process_jpeg_segments(inptr,value_offset,marker,
                                    count,summary_entry,fulldirname,
                                    prefix,indent+(SUBINDENT * 2));
                if(at_offset)
                {
                    if((PRINT_SECTION))
                    {
                        if((status = jpeg_status(0) == JPEG_EARLY_EOI))
                            chpr = newline(chpr);
                        jpeg_status(status);
                        print_tag_address(VALUE_AT_OFFSET,value_offset + count - 1,
                                                    indent,"-");
                        extraindent(SUBINDENT);
                        chpr += printf("# End of JPEG Thumbnail from MakerNote");
                        if((PRINT_ENTRY) && !(PRINT_VALUE))
                            chpr = newline(chpr);
                    }
                }
                print_jpeg_status();
                if(marker && summary_entry)
                { 
                    /* The new one is on the end of the chain         */
                    if((summary_entry = last_summary_entry(summary_entry)))
                    {
                        summary_entry->filesubformat |= FILESUBFMT_MNOTE;
                        summary_entry->datatype = MAKER_IFD;
                        summary_entry->subfiletype = THUMBNAIL_TYPE;
                    }
                }
                /* make certain we're at the end                      */
                clearerr(inptr);
                fseek(inptr,value_offset + count,SEEK_SET);
                break;
            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);
                    }
                }
                process_pim(inptr,byteorder,entry_ptr->value,fileoffset_base,
                    count,nameoftag,parent_name,prefix,indent);
                break;
            case 0x0f00: /* Data                                      */
                if(at_offset && (PRINT_ENTRY))
                {
                    print_tag_address(ENTRY,value_offset,indent,prefix);
                    print_makertagid(entry_ptr,23," : ",make,model);
                    chpr += printf("length %-9lu # UNDEFINED", count);
                    if(Max_undefined == 0)
                    {
                        if(chpr)
                            printred(" (not dumped, use -U)");
                    }
                    else
                    {
                        if((Max_undefined == DUMPALL) || (Max_undefined > count))
                            dumplength = count;
                        else 
                            dumplength = Max_undefined;
                        chpr = newline(chpr);
                        hexdump(inptr,value_offset,count,dumplength,12,
                                    indent,SUBINDENT);
                        chpr = newline(1);
                    }
                }
                else if(!at_offset && (PRINT_VALUE))
                {
                    if(!(PRINT_OFFSET))
                        chpr += printf("@%lu:%lu",value_offset,entry_ptr->count);
                    else
                        chpr += printf(":%lu", entry_ptr->count);
                    if(!(PRINT_VALUE_AT_OFFSET))
                        chpr += printf(" # UNDEFINED");
                }
                /* make certain we're at the end                      */
                fseek(inptr,value_offset + count,SEEK_SET);
                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 0x33de2
movq %r9, %r15
movq %rcx, %r14
movq %rdx, %r13
movl %esi, 0x34(%rsp)
movq %r8, 0x40(%rsp)
movq %rdi, 0x10(%rsp)
movl 0xa0(%rsp), %eax
movq %rax, 0x8(%rsp)
movl 0x98(%rsp), %r12d
movl 0x90(%rsp), %ebp
movl 0x88(%rsp), %eax
movq %rax, 0x18(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x28(%rsp)
movzwl (%rdx), %edi
movl %ebp, %esi
movl %r12d, %edx
callq 0x1b2e4
movq %rax, %rbx
leaq 0xbc6d(%rip), %rsi      # 0x3f997
movq %r15, %rdi
movq %rax, %rdx
callq 0x16f1d
movq %rax, 0x20(%rsp)
movq 0x8(%r13), %r8
movq 0x10(%r13), %rdx
leaq (%rdx,%r14), %rsi
movzwl (%r13), %eax
cmpl $0xf00, %eax            # imm = 0xF00
je 0x33e00
cmpl $0xe00, %eax            # imm = 0xE00
je 0x33de9
cmpl $0x100, %eax            # imm = 0x100
jne 0x33eb3
leaq 0x2340d(%rip), %rax     # 0x57180
movq (%rax), %rax
cmpl $0x0, 0x8(%rsp)
movq 0x20(%rsp), %r15
je 0x33f9d
btl $0x12, %eax
jae 0x33fc7
movl $0x1000000, %edi        # imm = 0x1000000
movq %rsi, %r13
movq 0x18(%rsp), %rdx
movq 0x28(%rsp), %rcx
movq %r8, %r14
callq 0x5100
pushq $0x4
popq %rdi
callq 0x8f6f
leaq 0x14257(%rip), %rdi     # 0x48010
xorl %eax, %eax
callq 0x3120
movl %eax, %ebx
leaq 0x14297(%rip), %rdi     # 0x48060
movq %r14, %rsi
xorl %eax, %eax
callq 0x3120
movq %r13, %rsi
movq %r14, %r8
movl %eax, %ebp
addl %ebx, %ebp
jmp 0x34091
xorl %ebp, %ebp
jmp 0x34215
xorl %ebp, %ebp
cmpl $0x0, 0x8(%rsp)
je 0x33eeb
movq 0x10(%rsp), %r12
jmp 0x33f2e
leaq 0x23379(%rip), %rbx     # 0x57180
movq (%rbx), %rax
cmpl $0x0, 0x8(%rsp)
je 0x33f5d
testl $0x4003333, %eax        # imm = 0x4003333
movq 0x20(%rsp), %r15
je 0x33f91
movl $0x4003333, %edi        # imm = 0x4003333
movq %rsi, 0x8(%rsp)
movq 0x18(%rsp), %rdx
movq 0x28(%rsp), %rcx
movq %r8, %r14
callq 0x5100
leaq 0x10a28(%rip), %rdx     # 0x44870
pushq $0x17
popq %rsi
movq %r13, %rdi
movl %ebp, %ecx
movl %r12d, %r8d
callq 0x1850a
leaq 0xbe86(%rip), %rdi      # 0x3fce5
movq %r14, %rsi
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
leaq 0x24596(%rip), %rax     # 0x58408
movq (%rax), %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %r14, %rbx
cmpq %rcx, %rax
movq 0x10(%rsp), %r12
je 0x33fd8
movq %r14, %r8
testq %rax, %rax
jne 0x33fce
testl %ebp, %ebp
je 0x341f9
leaq 0xb819(%rip), %rdi      # 0x3f6bf
callq 0x56e2
movq %r14, %r8
jmp 0x341fb
movzwl 0x34(%rsp), %esi
movq 0x10(%rsp), %rdi
movq %r13, %rdx
movq %r14, %rcx
movq 0x20(%rsp), %r15
movq %r15, %r8
movq 0x28(%rsp), %r9
pushq 0x8(%rsp)
pushq %r12
pushq %rbp
pushq 0x30(%rsp)
callq 0x185a8
addq $0x20, %rsp
xorl %ebp, %ebp
jmp 0x3420d
leaq 0x2328e(%rip), %rax     # 0x57180
movq (%rax), %rax
testb $0x30, %al
sete %cl
testw $0x300, %ax             # imm = 0x300
setne %al
orb %cl, %al
movq 0x10(%rsp), %r12
jne 0x33f2e
leaq 0xf251(%rip), %rdi      # 0x43162
movq %r8, %rdx
xorl %eax, %eax
movq %r8, %rbp
callq 0x3120
movl %eax, %edi
callq 0x160f7
movq %rbp, %r8
movl %eax, %ebp
movq 0x10(%r13), %rdx
subq $0x8, %rsp
movzwl 0x3c(%rsp), %esi
movq %r12, %rdi
movq %r14, %rcx
movq %rbx, %r9
pushq 0x20(%rsp)
pushq 0x38(%rsp)
pushq %r15
callq 0x125a8
addq $0x20, %rsp
movq 0x20(%rsp), %r15
jmp 0x3420d
testb $0x30, %al
movq 0x20(%rsp), %r15
je 0x33f91
testw $0x300, %ax             # imm = 0x300
movq 0x10(%rsp), %r12
je 0x3401b
movq %rsi, %r13
leaq 0xf1e7(%rip), %rdi      # 0x43166
movq %r8, %r14
movq %r8, %rsi
xorl %eax, %eax
callq 0x3120
jmp 0x34032
xorl %ebp, %ebp
movq 0x10(%rsp), %r12
jmp 0x34200
testb $0x30, %al
je 0x33fc7
testw $0x300, %ax             # imm = 0x300
je 0x34055
movq %rsi, %r14
leaq 0xf1b1(%rip), %rdi      # 0x43166
movq %r8, %rbx
movq %r8, %rsi
xorl %eax, %eax
callq 0x3120
jmp 0x3406c
xorl %ebp, %ebp
jmp 0x34091
cmpq %r8, %rax
cmovaeq %r8, %rax
movq %rax, %rbx
movl %ebp, %edi
callq 0x160f7
subq $0x8, %rsp
pushq $0xc
popq %r8
movq %r12, %rdi
movq 0x10(%rsp), %r13
movq %r13, %rsi
movq %r14, %rdx
movq %rbx, %rcx
movq 0x20(%rsp), %r9
pushq $0x2
callq 0x6e93
popq %rax
popq %rcx
pushq $0x1
popq %rdi
callq 0x160f7
movq %r13, %rsi
movq %r14, %r8
movl %eax, %ebp
jmp 0x34200
leaq 0xf140(%rip), %rdi      # 0x43162
movq %rsi, %r13
movq %r8, %r14
movq %r8, %rdx
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
testb $0x1, 0x3(%rbx)
jne 0x3404a
leaq 0xbcc5(%rip), %rdi      # 0x3fd06
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq %r14, %r8
movq %r13, %rsi
jmp 0x34200
leaq 0xf106(%rip), %rdi      # 0x43162
movq %rsi, %r14
movq %r8, %rbx
movq %r8, %rdx
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
leaq 0x2310b(%rip), %rax     # 0x57180
testb $0x1, 0x3(%rax)
jne 0x3408b
leaq 0xbc84(%rip), %rdi      # 0x3fd06
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq %rbx, %r8
movq %r14, %rsi
movq %r8, 0x38(%rsp)
movq %rsi, %r12
leaq 0x230e0(%rip), %rax     # 0x57180
testb $0xc, 0x2(%rax)
je 0x340af
movl %ebp, %edi
callq 0x160f7
movl %eax, %ebp
movq 0x10(%rsp), %r14
movq %r14, %rdi
movl $0x4d4d, %esi           # imm = 0x4D4D
movq %r12, %rdx
callq 0x416a
movl %eax, %r13d
movq 0x18(%rsp), %rax
addl $0x4, %eax
movzwl %r13w, %edx
movq %r14, %rdi
movq %r12, %rsi
movq 0x38(%rsp), %rcx
movq 0x40(%rsp), %rbx
movq %rbx, %r8
movq %r15, %r9
pushq %rax
pushq 0x30(%rsp)
callq 0x105af
addq $0x10, %rsp
cmpl $0x0, 0x8(%rsp)
je 0x341a2
leaq 0x23077(%rip), %rax     # 0x57180
testb $0x4, 0x2(%rax)
je 0x341a2
xorl %edi, %edi
callq 0x1259b
xorl %ebx, %ebx
cmpl $0x1, %eax
sete %bl
jne 0x3412d
movl %ebp, %edi
callq 0x160f7
movl %eax, %ebp
movl %ebp, %r15d
movl %ebx, %edi
callq 0x1259b
movq 0x38(%rsp), %rax
leaq (%r12,%rax), %rsi
decq %rsi
leaq 0xafaf(%rip), %rcx      # 0x3f0f9
movl $0x1000000, %edi        # imm = 0x1000000
movq 0x18(%rsp), %rdx
callq 0x5100
pushq $0x2
popq %rdi
callq 0x8f6f
leaq 0x13ed1(%rip), %rdi     # 0x48039
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
addl %r15d, %ebp
leaq 0x23005(%rip), %rax     # 0x57180
movq (%rax), %rax
testl $0x4003333, %eax        # imm = 0x4003333
sete %cl
testb $0x30, %al
setne %al
orb %cl, %al
jne 0x34198
movl %ebp, %edi
callq 0x160f7
movl %eax, %ebp
movq 0x20(%rsp), %r15
movq 0x40(%rsp), %rbx
xorl %eax, %eax
callq 0x8fb2
testw %r13w, %r13w
sete %al
testq %rbx, %rbx
sete %cl
orb %al, %cl
jne 0x341df
movq %rbx, %rdi
callq 0xf111
testq %rax, %rax
je 0x341df
orb $0x1, 0x19(%rax)
movl $0x5, 0x118(%rax)
movl $0x2, 0xc4(%rax)
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x31b0
addq 0x38(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rsi
jmp 0x34206
xorl %ebp, %ebp
movq 0x8(%rsp), %rsi
addq %r8, %rsi
movq %r12, %rdi
xorl %edx, %edx
callq 0x3210
movq %r15, %rdi
callq 0x3050
movl %ebp, %edi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x16a4f