// File: /workspace/github_c_makefile_star2_O3/hfiguiere[P]exifprobe/maker_olympus.c
// Function: olympus1_offset_makervalue
void
olympus1_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,max_offset;
    unsigned long dumplength;
    unsigned long count;
    unsigned short marker;
    char *nameoftag;
    char *fulldirname = CNULL;
    int status = 0;
    int chpr = 0;

    if(entry_ptr)
    {
        nameoftag = maker_tagname(entry_ptr->tag,make,model); 
        if((PRINT_LONGNAMES))
        {
            fulldirname = splice(parent_name,".",nameoftag);
            nameoftag = fulldirname;
        }
        value_offset = fileoffset_base + entry_ptr->value;
        count = entry_ptr->count;
        switch(entry_ptr->tag)
        {
            case 0x0209:    /* CameraId                               */
                if(at_offset)
                {
                    print_tag_address(ENTRY,value_offset,indent,prefix);
                    print_makertagid(entry_ptr,MAKERTAGWIDTH," = ",make,model);
                }
                if((PRINT_VALUE))
                    print_ascii(inptr,entry_ptr->count,value_offset);
                break;
            case 0x0100: /* JPEG Thumbnail in TIFF MakerNote          */
                if(at_offset && (PRINT_SECTION))
                {
                    print_tag_address(VALUE_AT_OFFSET,value_offset,indent,prefix);
                    chpr += printf("# Start of JPEG Thumbnail from MakerNote");
                    chpr += printf(" length %lu",count); 
                }
                else if(!at_offset && (PRINT_VALUE))
                {
                    if(!(PRINT_OFFSET))
                        chpr += printf("@%lu:%-9lu",value_offset,entry_ptr->count);
                    else
                        chpr += printf(":%-9lu", 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);
                setcharsprinted(chpr);
                chpr = 0;
                max_offset = process_jpeg_segments(inptr,value_offset,marker,
                                    count,summary_entry,fulldirname,
                                    prefix,indent+SMALLINDENT);
                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,"-");
                        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 0x0f00: /* Data                                      */
                if(at_offset && (PRINT_ENTRY))
                {
                    print_tag_address(ENTRY,value_offset,indent,prefix);
                    print_makertagid(entry_ptr,MAKERTAGWIDTH," : ",make,model);
                    chpr += printf("length %-9lu # UNDEFINED", count);
                }
                else if(!at_offset && (PRINT_VALUE))
                {
                    if(!(PRINT_OFFSET))
                        chpr += printf("@%lu:%-9lu",value_offset,entry_ptr->count);
                    else
                        chpr += printf(":%-9lu", entry_ptr->count);
                    if(!(PRINT_VALUE_AT_OFFSET))
                        chpr += printf(" # UNDEFINED");
                }
                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);
                }
                /* make certain we're at the end                      */
                fseek(inptr,value_offset + count,SEEK_SET);
                break;
            case 0x2010:    /* Private IFD's all                      */
            case 0x2020:
            case 0x2030:
            case 0x2040:
            case 0x2050:
                if(!at_offset && (PRINT_VALUE))
                {
                    if(!(PRINT_OFFSET))
                        chpr += printf("@%lu",value_offset);
                }
                chpr = newline(chpr);
                max_offset = entry_ptr->value + fileoffset_base + entry_ptr->count;
                max_offset = process_private_ifd(inptr,byteorder,entry_ptr->value,
                                        fileoffset_base,max_offset,entry_ptr->tag,
                                        summary_entry,nameoftag,prefix,
                                        make,model,indent);
                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 0x2ef14
movq %r9, %r12
movq %rcx, %rbp
movq %rdx, %r13
movl %esi, 0x34(%rsp)
movq %r8, 0x40(%rsp)
movq %rdi, 0x8(%rsp)
movl 0xa0(%rsp), %r15d
movl 0x98(%rsp), %edx
movl 0x90(%rsp), %esi
movl 0x88(%rsp), %eax
movq %rax, 0x20(%rsp)
movq 0x80(%rsp), %r14
movzwl (%r13), %edi
movq %rsi, 0x18(%rsp)
movq %rdx, 0x28(%rsp)
callq 0x1c518
movq %rax, %rbx
leaq 0x2927c(%rip), %rsi     # 0x58180
testb $0x40, (%rsi)
jne 0x2ef1c
movq $0x0, 0x10(%rsp)
jmp 0x2ef3d
xorl %r12d, %r12d
jmp 0x2f44e
leaq 0x12a74(%rip), %rsi     # 0x41997
movq %r12, %rdi
movq %rbx, %rdx
callq 0x17f99
leaq 0x2924b(%rip), %rsi     # 0x58180
movq %rax, %rbx
movq %rax, 0x10(%rsp)
movq 0x10(%r13), %r12
addq %rbp, %r12
movzwl (%r13), %eax
cmpl $0x200f, %eax           # imm = 0x200F
jg 0x2efe1
movq 0x8(%r13), %rbx
cmpl $0x100, %eax            # imm = 0x100
je 0x2f088
cmpl $0x209, %eax            # imm = 0x209
je 0x2f0ff
cmpl $0xf00, %eax            # imm = 0xF00
jne 0x2f16a
movq (%rsi), %rax
testl %r15d, %r15d
movq %r12, 0x38(%rsp)
je 0x2f1df
testl $0x4003333, %eax        # imm = 0x4003333
je 0x2f211
movl $0x4003333, %edi        # imm = 0x4003333
movq %r12, %rsi
movq 0x20(%rsp), %rdx
movq %r14, %rcx
callq 0x55eb
leaq 0x1790f(%rip), %rdx     # 0x468c0
movq %r13, %rdi
movl $0x19, %esi
movq 0x18(%rsp), %rcx
movq 0x28(%rsp), %r8
callq 0x19668
leaq 0x12d16(%rip), %rdi     # 0x41ce5
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3120
movl %eax, %r12d
jmp 0x2f214
leal -0x2020(%rax), %ecx
cmpl $0x30, %ecx
ja 0x2f15f
movabsq $0x1000100010001, %rdx  # imm = 0x1000100010001
btq %rcx, %rdx
jae 0x2f15f
xorl %edi, %edi
testl %r15d, %r15d
je 0x2f012
movq 0x18(%rsp), %r15
jmp 0x2f03e
movq (%rsi), %rax
testb $0x30, %al
sete %cl
testl $0x300, %eax            # imm = 0x300
setne %al
orb %cl, %al
movq 0x18(%rsp), %r15
jne 0x2f03e
leaq 0x197fa(%rip), %rdi     # 0x4882c
movq %r12, %rsi
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
callq 0x1707a
movl %eax, %r12d
movq 0x10(%r13), %rdx
leaq (%rdx,%rbp), %r8
addq 0x8(%r13), %r8
movzwl (%r13), %r9d
movzwl 0x34(%rsp), %esi
movq 0x8(%rsp), %rdi
movq %rbp, %rcx
pushq 0x20(%rsp)
pushq 0x30(%rsp)
pushq %r15
pushq %r14
pushq %rbx
pushq 0x68(%rsp)
callq 0x98bf
addq $0x30, %rsp
movq 0x10(%rsp), %r15
jmp 0x2f441
movq %r14, 0x18(%rsp)
movq (%rsi), %rax
movq %r15, 0x28(%rsp)
testl %r15d, %r15d
je 0x2f1a6
btl $0x12, %eax
movq 0x10(%rsp), %r15
movq 0x8(%rsp), %r14
jae 0x2f1d8
movl $0x1000000, %edi        # imm = 0x1000000
movq %rsi, %rbp
movq %r12, %rsi
movq 0x20(%rsp), %rdx
movq 0x18(%rsp), %rcx
callq 0x55eb
leaq 0x1af8d(%rip), %rdi     # 0x4a060
xorl %eax, %eax
callq 0x3120
movq %rbx, %r13
movl %eax, %ebx
leaq 0x19674(%rip), %rdi     # 0x4875a
movq %r13, %rsi
xorl %eax, %eax
callq 0x3120
movq %rbp, %rsi
movl %eax, %ebp
addl %ebx, %ebp
movq %r13, %rbx
jmp 0x2f2e4
testl %r15d, %r15d
je 0x2f13d
movl $0x4003333, %edi        # imm = 0x4003333
movq %rsi, %rbx
movq %r12, %rsi
movq 0x20(%rsp), %rdx
movq %r14, %rcx
callq 0x55eb
leaq 0x1b485(%rip), %rdx     # 0x4a5a8
movq %r13, %rdi
movl $0x19, %esi
movq 0x18(%rsp), %rcx
movq 0x28(%rsp), %r8
callq 0x19668
movq %rbx, %rsi
movq %r12, %rdx
xorl %r12d, %r12d
testb $0x30, (%rsi)
je 0x2f07e
movq 0x8(%r13), %rsi
movq 0x8(%rsp), %rdi
callq 0x77d6
jmp 0x2f07e
cmpl $0x2010, %eax           # imm = 0x2010
je 0x2f004
movzwl 0x34(%rsp), %esi
movq 0x8(%rsp), %rdi
movq %r13, %rdx
movq %rbp, %rcx
movq %r15, %rax
movq 0x10(%rsp), %r15
movq %r15, %r8
movq %r14, %r9
pushq %rax
pushq 0x30(%rsp)
pushq 0x28(%rsp)
pushq 0x38(%rsp)
callq 0x19706
addq $0x20, %rsp
xorl %r12d, %r12d
jmp 0x2f441
testb $0x30, %al
movq 0x10(%rsp), %r15
movq 0x8(%rsp), %r14
je 0x2f1d8
movq %rsi, %r13
testl $0x300, %eax            # imm = 0x300
je 0x2f2af
leaq 0x15798(%rip), %rdi     # 0x44961
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3120
jmp 0x2f2c3
xorl %ebp, %ebp
jmp 0x2f2e4
testb $0x30, %al
je 0x2f211
movq %rsi, %r13
testl $0x300, %eax            # imm = 0x300
movq 0x10(%rsp), %r15
movq 0x8(%rsp), %r14
je 0x2f464
leaq 0x1575f(%rip), %rdi     # 0x44961
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3120
jmp 0x2f478
xorl %r12d, %r12d
movq 0x10(%rsp), %r15
movq 0x8(%rsp), %r14
leaq 0x2a1e3(%rip), %rax     # 0x59408
movq (%rax), %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %rbx, %rbp
cmpq %rcx, %rax
je 0x2f257
testq %rax, %rax
jne 0x2f24d
testl %r12d, %r12d
je 0x2f299
leaq 0x12479(%rip), %rdi     # 0x416bf
callq 0x5c26
jmp 0x2f29c
cmpq %rbx, %rax
cmovaeq %rbx, %rax
movq %rax, %rbp
movl %r12d, %edi
callq 0x1707a
subq $0x8, %rsp
movq %r14, %rdi
movq 0x40(%rsp), %r13
movq %r13, %rsi
movq %rbx, %rdx
movq %rbp, %rcx
movl $0xc, %r8d
movq 0x28(%rsp), %r9
pushq $0x2
callq 0x7480
addq $0x10, %rsp
movl $0x1, %edi
callq 0x1707a
movl %eax, %r12d
jmp 0x2f2a1
xorl %r12d, %r12d
movq 0x38(%rsp), %r13
addq %rbx, %r13
movq %r14, %rdi
movq %r13, %rsi
jmp 0x2f43a
leaq 0x156a7(%rip), %rdi     # 0x4495d
movq %r12, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
testb $0x1, 0x3(%r13)
jne 0x2f2e1
leaq 0x12a33(%rip), %rdi     # 0x41d06
xorl %eax, %eax
callq 0x3120
movq %r13, %rsi
addl %eax, %ebp
jmp 0x2f2e4
movq %r13, %rsi
testb $0xc, 0x2(%rsi)
je 0x2f2f8
movq %rbx, %r13
movl %ebp, %edi
callq 0x1707a
movl %eax, %ebp
jmp 0x2f2fb
movq %rbx, %r13
movq %r14, %rdi
movl $0x4d4d, %esi           # imm = 0x4D4D
movq %r12, %rdx
callq 0x45af
movl %eax, %ebx
movl %ebp, %edi
callq 0x17a82
movq 0x20(%rsp), %rax
addl $0x2, %eax
movzwl %bx, %edx
movq %r14, %rdi
movq %r12, %rbp
movq %r12, %rsi
movq %r13, %rcx
movq 0x40(%rsp), %r8
movq %r15, %r9
pushq %rax
pushq 0x20(%rsp)
callq 0x11455
addq $0x10, %rsp
xorl %r12d, %r12d
cmpl $0x0, 0x28(%rsp)
je 0x2f3eb
leaq 0x28e2a(%rip), %rax     # 0x58180
testb $0x4, 0x2(%rax)
je 0x2f3eb
xorl %r12d, %r12d
xorl %edi, %edi
callq 0x1336d
xorl %r14d, %r14d
cmpl $0x1, %eax
sete %r14b
jne 0x2f380
xorl %edi, %edi
callq 0x1707a
movl %eax, %r12d
movl %r14d, %edi
callq 0x1336d
leaq -0x1(,%r13), %rsi
addq %rbp, %rsi
leaq 0x11d5f(%rip), %rcx     # 0x410f9
movl $0x1000000, %edi        # imm = 0x1000000
movq 0x20(%rsp), %rdx
callq 0x55eb
leaq 0x1acd9(%rip), %rdi     # 0x4a089
xorl %eax, %eax
callq 0x3120
movl %r12d, %ecx
movl %eax, %r12d
addl %ecx, %r12d
leaq 0x28db9(%rip), %rax     # 0x58180
movq (%rax), %rax
testl $0x4003333, %eax        # imm = 0x4003333
sete %cl
testb $0x30, %al
setne %al
orb %cl, %al
jne 0x2f3e6
movl %r12d, %edi
callq 0x1707a
movl %eax, %r12d
movq 0x8(%rsp), %r14
xorl %eax, %eax
callq 0x9734
testw %bx, %bx
sete %al
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
sete %cl
orb %al, %cl
jne 0x2f429
callq 0xfed1
testq %rax, %rax
je 0x2f429
orb $0x1, 0x19(%rax)
movl $0x5, 0x118(%rax)
movl $0x2, 0xc4(%rax)
movq %r14, %rdi
callq 0x31b0
addq %r13, %rbp
movq %r14, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0x3210
testq %r15, %r15
je 0x2f44e
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
leaq 0x154f2(%rip), %rdi     # 0x4495d
movq %r12, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3120
movl %eax, %r12d
testb $0x1, 0x3(%r13)
jne 0x2f21e
leaq 0x12879(%rip), %rdi     # 0x41d06
xorl %eax, %eax
callq 0x3120
addl %eax, %r12d
jmp 0x2f21e