// File: /workspace/github_c_makefile_star2_O1/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 0x2e714
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 0x1c020
movq %rax, %rbx
leaq 0x29a7c(%rip), %rsi     # 0x58180
testb $0x40, (%rsi)
jne 0x2e71c
movq $0x0, 0x10(%rsp)
jmp 0x2e73d
xorl %r12d, %r12d
jmp 0x2ec4e
leaq 0x13274(%rip), %rsi     # 0x41997
movq %r12, %rdi
movq %rbx, %rdx
callq 0x17a47
leaq 0x29a4b(%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 0x2e7e1
movq 0x8(%r13), %rbx
cmpl $0x100, %eax            # imm = 0x100
je 0x2e888
cmpl $0x209, %eax            # imm = 0x209
je 0x2e8ff
cmpl $0xf00, %eax            # imm = 0xF00
jne 0x2e96a
movq (%rsi), %rax
testl %r15d, %r15d
movq %r12, 0x38(%rsp)
je 0x2e9df
testl $0x4003333, %eax        # imm = 0x4003333
je 0x2ea11
movl $0x4003333, %edi        # imm = 0x4003333
movq %r12, %rsi
movq 0x20(%rsp), %rdx
movq %r14, %rcx
callq 0x5605
leaq 0x180cf(%rip), %rdx     # 0x46880
movq %r13, %rdi
movl $0x19, %esi
movq 0x18(%rsp), %rcx
movq 0x28(%rsp), %r8
callq 0x1910e
leaq 0x13516(%rip), %rdi     # 0x41ce5
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3120
movl %eax, %r12d
jmp 0x2ea14
leal -0x2020(%rax), %ecx
cmpl $0x30, %ecx
ja 0x2e95f
movabsq $0x1000100010001, %rdx  # imm = 0x1000100010001
btq %rcx, %rdx
jae 0x2e95f
xorl %edi, %edi
testl %r15d, %r15d
je 0x2e812
movq 0x18(%rsp), %r15
jmp 0x2e83e
movq (%rsi), %rax
testb $0x30, %al
sete %cl
testl $0x300, %eax            # imm = 0x300
setne %al
orb %cl, %al
movq 0x18(%rsp), %r15
jne 0x2e83e
leaq 0x19fba(%rip), %rdi     # 0x487ec
movq %r12, %rsi
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
callq 0x16b56
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 0x9794
addq $0x30, %rsp
movq 0x10(%rsp), %r15
jmp 0x2ec41
movq %r14, 0x18(%rsp)
movq (%rsi), %rax
movq %r15, 0x28(%rsp)
testl %r15d, %r15d
je 0x2e9a6
btl $0x12, %eax
movq 0x10(%rsp), %r15
movq 0x8(%rsp), %r14
jae 0x2e9d8
movl $0x1000000, %edi        # imm = 0x1000000
movq %rsi, %rbp
movq %r12, %rsi
movq 0x20(%rsp), %rdx
movq 0x18(%rsp), %rcx
callq 0x5605
leaq 0x1b74d(%rip), %rdi     # 0x4a020
xorl %eax, %eax
callq 0x3120
movq %rbx, %r13
movl %eax, %ebx
leaq 0x19e34(%rip), %rdi     # 0x4871a
movq %r13, %rsi
xorl %eax, %eax
callq 0x3120
movq %rbp, %rsi
movl %eax, %ebp
addl %ebx, %ebp
movq %r13, %rbx
jmp 0x2eae4
testl %r15d, %r15d
je 0x2e93d
movl $0x4003333, %edi        # imm = 0x4003333
movq %rsi, %rbx
movq %r12, %rsi
movq 0x20(%rsp), %rdx
movq %r14, %rcx
callq 0x5605
leaq 0x1bc45(%rip), %rdx     # 0x4a568
movq %r13, %rdi
movl $0x19, %esi
movq 0x18(%rsp), %rcx
movq 0x28(%rsp), %r8
callq 0x1910e
movq %rbx, %rsi
movq %r12, %rdx
xorl %r12d, %r12d
testb $0x30, (%rsi)
je 0x2e87e
movq 0x8(%r13), %rsi
movq 0x8(%rsp), %rdi
callq 0x7793
jmp 0x2e87e
cmpl $0x2010, %eax           # imm = 0x2010
je 0x2e804
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 0x191ac
addq $0x20, %rsp
xorl %r12d, %r12d
jmp 0x2ec41
testb $0x30, %al
movq 0x10(%rsp), %r15
movq 0x8(%rsp), %r14
je 0x2e9d8
movq %rsi, %r13
testl $0x300, %eax            # imm = 0x300
je 0x2eaaf
leaq 0x15f54(%rip), %rdi     # 0x4491d
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3120
jmp 0x2eac3
xorl %ebp, %ebp
jmp 0x2eae4
testb $0x30, %al
je 0x2ea11
movq %rsi, %r13
testl $0x300, %eax            # imm = 0x300
movq 0x10(%rsp), %r15
movq 0x8(%rsp), %r14
je 0x2ec64
leaq 0x15f1b(%rip), %rdi     # 0x4491d
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3120
jmp 0x2ec78
xorl %r12d, %r12d
movq 0x10(%rsp), %r15
movq 0x8(%rsp), %r14
leaq 0x2a9e3(%rip), %rax     # 0x59408
movq (%rax), %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %rbx, %rbp
cmpq %rcx, %rax
je 0x2ea57
testq %rax, %rax
jne 0x2ea4d
testl %r12d, %r12d
je 0x2ea99
leaq 0x12c79(%rip), %rdi     # 0x416bf
callq 0x5c33
jmp 0x2ea9c
cmpq %rbx, %rax
cmovaeq %rbx, %rax
movq %rax, %rbp
movl %r12d, %edi
callq 0x16b56
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 0x7446
addq $0x10, %rsp
movl $0x1, %edi
callq 0x16b56
movl %eax, %r12d
jmp 0x2eaa1
xorl %r12d, %r12d
movq 0x38(%rsp), %r13
addq %rbx, %r13
movq %r14, %rdi
movq %r13, %rsi
jmp 0x2ec3a
leaq 0x15e63(%rip), %rdi     # 0x44919
movq %r12, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
testb $0x1, 0x3(%r13)
jne 0x2eae1
leaq 0x13233(%rip), %rdi     # 0x41d06
xorl %eax, %eax
callq 0x3120
movq %r13, %rsi
addl %eax, %ebp
jmp 0x2eae4
movq %r13, %rsi
testb $0xc, 0x2(%rsi)
je 0x2eaf8
movq %rbx, %r13
movl %ebp, %edi
callq 0x16b56
movl %eax, %ebp
jmp 0x2eafb
movq %rbx, %r13
movq %r14, %rdi
movl $0x4d4d, %esi           # imm = 0x4D4D
movq %r12, %rdx
callq 0x4574
movl %eax, %ebx
movl %ebp, %edi
callq 0x17530
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 0x112cd
addq $0x10, %rsp
xorl %r12d, %r12d
cmpl $0x0, 0x28(%rsp)
je 0x2ebeb
leaq 0x2962a(%rip), %rax     # 0x58180
testb $0x4, 0x2(%rax)
je 0x2ebeb
xorl %r12d, %r12d
xorl %edi, %edi
callq 0x12f15
xorl %r14d, %r14d
cmpl $0x1, %eax
sete %r14b
jne 0x2eb80
xorl %edi, %edi
callq 0x16b56
movl %eax, %r12d
movl %r14d, %edi
callq 0x12f15
leaq -0x1(,%r13), %rsi
addq %rbp, %rsi
leaq 0x1255f(%rip), %rcx     # 0x410f9
movl $0x1000000, %edi        # imm = 0x1000000
movq 0x20(%rsp), %rdx
callq 0x5605
leaq 0x1b499(%rip), %rdi     # 0x4a049
xorl %eax, %eax
callq 0x3120
movl %r12d, %ecx
movl %eax, %r12d
addl %ecx, %r12d
leaq 0x295b9(%rip), %rax     # 0x58180
movq (%rax), %rax
testl $0x4003333, %eax        # imm = 0x4003333
sete %cl
testb $0x30, %al
setne %al
orb %cl, %al
jne 0x2ebe6
movl %r12d, %edi
callq 0x16b56
movl %eax, %r12d
movq 0x8(%rsp), %r14
xorl %eax, %eax
callq 0x9609
testw %bx, %bx
sete %al
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
sete %cl
orb %al, %cl
jne 0x2ec29
callq 0xfdaa
testq %rax, %rax
je 0x2ec29
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 0x2ec4e
movq %r15, %rdi
callq 0x3050
movl %r12d, %edi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x17530
leaq 0x15cae(%rip), %rdi     # 0x44919
movq %r12, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3120
movl %eax, %r12d
testb $0x1, 0x3(%r13)
jne 0x2ea1e
leaq 0x13079(%rip), %rdi     # 0x41d06
xorl %eax, %eax
callq 0x3120
addl %eax, %r12d
jmp 0x2ea1e