// File: /workspace/github_c_makefile_star2_O3/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 0x3585f
movq %r9, %r13
movq %rcx, %r14
movq %rdx, %rbx
movl %esi, 0x34(%rsp)
movq %r8, 0x40(%rsp)
movq %rdi, 0x8(%rsp)
movl 0xa0(%rsp), %eax
movq %rax, 0x28(%rsp)
movl 0x98(%rsp), %r12d
movl 0x90(%rsp), %ebp
movl 0x88(%rsp), %eax
movq %rax, 0x10(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x18(%rsp)
movzwl (%rdx), %edi
movl %ebp, %esi
movl %r12d, %edx
callq 0x1c518
movq %rax, %r15
leaq 0xc1f7(%rip), %rsi      # 0x41997
movq %r13, %rdi
movq %rax, %rdx
callq 0x17f99
movq %rax, 0x20(%rsp)
movq 0x8(%rbx), %rax
movq %rax, (%rsp)
movq 0x10(%rbx), %rdx
leaq (%rdx,%r14), %rsi
movzwl (%rbx), %eax
cmpl $0xf00, %eax            # imm = 0xF00
je 0x3587d
cmpl $0xe00, %eax            # imm = 0xE00
je 0x35866
cmpl $0x100, %eax            # imm = 0x100
jne 0x3592b
leaq 0x22995(%rip), %r15     # 0x58180
movq (%r15), %rax
cmpl $0x0, 0x28(%rsp)
movq 0x20(%rsp), %r13
je 0x35a1c
btl $0x12, %eax
movq 0x8(%rsp), %r14
movq (%rsp), %r12
jae 0x35a4d
movl $0x1000000, %edi        # imm = 0x1000000
movq %rsi, %rbp
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
callq 0x55eb
movl $0x4, %edi
callq 0x96eb
leaq 0x14827(%rip), %rdi     # 0x4a060
xorl %eax, %eax
callq 0x3120
movl %eax, %ebx
leaq 0x14867(%rip), %rdi     # 0x4a0b0
movq %r12, %rsi
xorl %eax, %eax
callq 0x3120
movq %rbp, %rsi
movl %eax, %ebp
addl %ebx, %ebp
jmp 0x35b04
xorl %ebp, %ebp
jmp 0x35c80
xorl %ebp, %ebp
cmpl $0x0, 0x28(%rsp)
je 0x35963
movq 0x8(%rsp), %r12
jmp 0x359a2
leaq 0x228fc(%rip), %r14     # 0x58180
movq (%r14), %rax
cmpl $0x0, 0x28(%rsp)
je 0x359d6
testl $0x4003333, %eax        # imm = 0x4003333
movq 0x20(%rsp), %r13
je 0x35a0c
movl $0x4003333, %edi        # imm = 0x4003333
movq %rsi, %r14
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
callq 0x55eb
leaq 0x11000(%rip), %rdx     # 0x468c0
movq %rbx, %rdi
movl $0x17, %esi
movl %ebp, %ecx
movl %r12d, %r8d
callq 0x19668
leaq 0xc40c(%rip), %rdi      # 0x41ce5
movq (%rsp), %r12
movq %r12, %rsi
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
leaq 0x23b18(%rip), %rax     # 0x59408
movq (%rax), %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %r12, %rbx
cmpq %rcx, %rax
movq 0x8(%rsp), %r15
je 0x35a5e
testq %rax, %rax
jne 0x35a54
testl %ebp, %ebp
je 0x35c61
leaq 0xbd9e(%rip), %rdi      # 0x416bf
callq 0x5c26
jmp 0x35c63
movzwl 0x34(%rsp), %esi
movq 0x8(%rsp), %rdi
movq %rbx, %rdx
movq %r14, %rcx
movq 0x20(%rsp), %r13
movq %r13, %r8
movq 0x18(%rsp), %r9
pushq 0x28(%rsp)
pushq %r12
pushq %rbp
pushq 0x28(%rsp)
callq 0x19706
addq $0x20, %rsp
xorl %ebp, %ebp
jmp 0x35c73
leaq 0x22816(%rip), %rax     # 0x58180
movq (%rax), %rax
testb $0x30, %al
sete %cl
testl $0x300, %eax            # imm = 0x300
setne %al
orb %cl, %al
movq 0x8(%rsp), %r12
jne 0x359a2
leaq 0xf81c(%rip), %rdi      # 0x451a6
movq (%rsp), %rdx
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
callq 0x1707a
movl %eax, %ebp
movq 0x10(%rbx), %rdx
subq $0x8, %rsp
movzwl 0x3c(%rsp), %esi
movq %r12, %rdi
movq %r14, %rcx
movq 0x8(%rsp), %r8
movq %r15, %r9
pushq 0x18(%rsp)
pushq 0x28(%rsp)
pushq %r13
callq 0x1337a
addq $0x20, %rsp
movq 0x20(%rsp), %r13
jmp 0x35c73
testb $0x30, %al
movq 0x20(%rsp), %r13
je 0x35a0c
testl $0x300, %eax            # imm = 0x300
movq 0x8(%rsp), %r15
movq (%rsp), %r12
je 0x35a9f
movq %rsi, %rbx
leaq 0xf7ad(%rip), %rdi      # 0x451aa
movq %r12, %rsi
xorl %eax, %eax
callq 0x3120
jmp 0x35ab3
xorl %ebp, %ebp
movq 0x8(%rsp), %r15
movq (%rsp), %r12
jmp 0x35c66
testb $0x30, %al
movq 0x8(%rsp), %r14
movq (%rsp), %r12
je 0x35a4d
testl $0x300, %eax            # imm = 0x300
je 0x35ad4
movq %rsi, %rbx
leaq 0xf76c(%rip), %rdi      # 0x451aa
movq %r12, %rsi
xorl %eax, %eax
callq 0x3120
jmp 0x35ae8
xorl %ebp, %ebp
jmp 0x35b04
cmpq %r12, %rax
cmovaeq %r12, %rax
movq %rax, %rbx
movl %ebp, %edi
callq 0x1707a
subq $0x8, %rsp
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rbx, %rcx
movl $0xc, %r8d
movq 0x18(%rsp), %r9
pushq $0x2
callq 0x7480
addq $0x10, %rsp
movl $0x1, %edi
callq 0x1707a
movq %r14, %rsi
movl %eax, %ebp
jmp 0x35c66
leaq 0xf700(%rip), %rdi      # 0x451a6
movq %rsi, %rbx
movq %r12, %rdx
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
testb $0x1, 0x3(%r14)
jne 0x35acc
leaq 0xc243(%rip), %rdi      # 0x41d06
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq %rbx, %rsi
jmp 0x35c66
leaq 0xf6cb(%rip), %rdi      # 0x451a6
movq %rsi, %rbx
movq %r12, %rdx
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
testb $0x1, 0x3(%r15)
jne 0x35b01
leaq 0xc20e(%rip), %rdi      # 0x41d06
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq %rbx, %rsi
movq %rsi, 0x38(%rsp)
testb $0xc, 0x2(%r15)
je 0x35b19
movl %ebp, %edi
callq 0x1707a
movl %eax, %ebp
movq %r14, %rdi
movl $0x4d4d, %esi           # imm = 0x4D4D
movq 0x38(%rsp), %r15
movq %r15, %rdx
callq 0x45af
movl %eax, %ebx
movq 0x10(%rsp), %rax
addl $0x4, %eax
movzwl %bx, %edx
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rcx
movq 0x40(%rsp), %r15
movq %r15, %r8
movq %r13, %r9
pushq %rax
pushq 0x20(%rsp)
callq 0x11455
addq $0x10, %rsp
cmpl $0x0, 0x28(%rsp)
je 0x35c10
leaq 0x22611(%rip), %rax     # 0x58180
testb $0x4, 0x2(%rax)
je 0x35c10
xorl %edi, %edi
callq 0x1336d
xorl %r14d, %r14d
cmpl $0x1, %eax
sete %r14b
jne 0x35b95
movl %ebp, %edi
callq 0x1707a
movl %eax, %ebp
movl %ebp, %r12d
movl %r14d, %edi
callq 0x1336d
movq (%rsp), %rax
movq 0x38(%rsp), %rcx
leaq (%rcx,%rax), %rsi
decq %rsi
leaq 0xb542(%rip), %rcx      # 0x410f9
movl $0x1000000, %edi        # imm = 0x1000000
movq 0x10(%rsp), %rdx
callq 0x55eb
movl $0x2, %edi
callq 0x96eb
leaq 0x144b2(%rip), %rdi     # 0x4a089
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
addl %r12d, %ebp
leaq 0x22596(%rip), %rax     # 0x58180
movq (%rax), %rax
testl $0x4003333, %eax        # imm = 0x4003333
sete %cl
testb $0x30, %al
setne %al
orb %cl, %al
jne 0x35c07
movl %ebp, %edi
callq 0x1707a
movl %eax, %ebp
movq 0x8(%rsp), %r14
movq (%rsp), %r12
xorl %eax, %eax
callq 0x9734
testw %bx, %bx
sete %al
testq %r15, %r15
sete %cl
orb %al, %cl
jne 0x35c4c
movq %r15, %rdi
callq 0xfed1
testq %rax, %rax
je 0x35c4c
orb $0x1, 0x19(%rax)
movl $0x5, 0x118(%rax)
movl $0x2, 0xc4(%rax)
movq %r14, %rdi
callq 0x31b0
movq 0x38(%rsp), %rsi
addq %r12, %rsi
movq %r14, %rdi
jmp 0x35c6c
xorl %ebp, %ebp
movq %r14, %rsi
addq %r12, %rsi
movq %r15, %rdi
xorl %edx, %edx
callq 0x3210
testq %r13, %r13
je 0x35c80
movq %r13, %rdi
callq 0x3050
movl %ebp, %edi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x17a82