// File: /workspace/github_c_makefile_star2_O2/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 0x2d744
movq %r9, %r13
movq %rcx, %rbp
movq %rdx, %rbx
movl %esi, %r15d
movq %r8, 0x28(%rsp)
movq %rdi, 0x30(%rsp)
movl 0xa0(%rsp), %eax
movq %rax, 0x20(%rsp)
movl 0x98(%rsp), %r14d
movl 0x90(%rsp), %esi
movl 0x88(%rsp), %eax
movq %rax, 0x8(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x18(%rsp)
movzwl (%rdx), %edi
movq %rsi, 0x38(%rsp)
movl %r14d, %edx
callq 0x1b2e4
movq %rax, %r12
leaq 0x29a4c(%rip), %r8      # 0x57180
testb $0x40, (%r8)
jne 0x2d74c
movq $0x0, (%rsp)
jmp 0x2d76b
xorl %r13d, %r13d
jmp 0x2dc97
leaq 0x12244(%rip), %rsi     # 0x3f997
movq %r13, %rdi
movq %r12, %rdx
movq %r8, %r12
callq 0x16f1d
movq %r12, %r8
movq %rax, %r12
movq %rax, (%rsp)
movq 0x10(%rbx), %r13
addq %rbp, %r13
movq 0x8(%rbx), %rsi
movzwl (%rbx), %eax
leal -0x2020(%rax), %ecx
cmpl $0x30, %ecx
jbe 0x2d81c
cmpl $0x100, %eax            # imm = 0x100
je 0x2d8a9
cmpl $0x2010, %eax           # imm = 0x2010
je 0x2d830
cmpl $0xf00, %eax            # imm = 0xF00
je 0x2d91d
cmpl $0x209, %eax            # imm = 0x209
movq 0x30(%rsp), %r12
jne 0x2d994
cmpl $0x0, 0x20(%rsp)
je 0x2d7f7
movl $0x4003333, %edi        # imm = 0x4003333
movq %r13, %rsi
movq 0x8(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq %r8, %r15
callq 0x5100
leaq 0x1ad77(%rip), %rdx     # 0x48558
pushq $0x19
popq %rsi
movq %rbx, %rdi
movq 0x38(%rsp), %rcx
movl %r14d, %r8d
callq 0x1850a
movq %r15, %r8
movq %r13, %rdx
xorl %r13d, %r13d
testb $0x30, (%r8)
movq (%rsp), %r15
je 0x2dc8f
movq 0x8(%rbx), %rsi
movq %r12, %rdi
callq 0x71a9
jmp 0x2dc8f
movabsq $0x1000100010001, %rdx  # imm = 0x1000100010001
btq %rcx, %rdx
jae 0x2d788
xorl %edi, %edi
cmpl $0x0, 0x20(%rsp)
jne 0x2d85f
movq (%r8), %rax
testb $0x30, %al
sete %cl
testw $0x300, %ax             # imm = 0x300
setne %al
orb %cl, %al
jne 0x2d85f
leaq 0x18f89(%rip), %rdi     # 0x467dc
movq %r13, %rsi
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
callq 0x160f7
movl %eax, %r13d
movq 0x10(%rbx), %rdx
leaq (%rdx,%rbp), %r8
addq 0x8(%rbx), %r8
movzwl (%rbx), %r9d
movzwl %r15w, %esi
movq 0x30(%rsp), %rdi
movq %rbp, %rcx
pushq 0x8(%rsp)
pushq %r14
pushq 0x48(%rsp)
pushq 0x30(%rsp)
pushq %r12
pushq 0x50(%rsp)
callq 0x9124
addq $0x30, %rsp
movq (%rsp), %r15
jmp 0x2dc8f
movq (%r8), %rax
cmpl $0x0, 0x20(%rsp)
movq %rsi, 0x10(%rsp)
je 0x2d9cc
btl $0x12, %eax
movq (%rsp), %r15
movq 0x30(%rsp), %r12
movq 0x28(%rsp), %r14
jae 0x2d9fc
movl $0x1000000, %edi        # imm = 0x1000000
movq %r13, %rsi
movq 0x8(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq %r8, %rbp
callq 0x5100
leaq 0x1a71b(%rip), %rdi     # 0x48010
xorl %eax, %eax
callq 0x3120
movl %eax, %ebx
leaq 0x18e05(%rip), %rdi     # 0x4670a
movq 0x10(%rsp), %rsi
xorl %eax, %eax
callq 0x3120
movq %rbp, %r8
movl %eax, %ebp
addl %ebx, %ebp
jmp 0x2da6c
movq (%r8), %rax
cmpl $0x0, 0x20(%rsp)
movq 0x30(%rsp), %rbp
movq %r13, 0x40(%rsp)
je 0x2da00
testl $0x4003333, %eax        # imm = 0x4003333
movq (%rsp), %r15
je 0x2da2e
movq %rsi, %r12
movl $0x4003333, %edi        # imm = 0x4003333
movq %r13, %rsi
movq 0x8(%rsp), %rdx
movq 0x18(%rsp), %rcx
callq 0x5100
leaq 0x16f0b(%rip), %rdx     # 0x44870
pushq $0x19
popq %rsi
movq %rbx, %rdi
movq 0x38(%rsp), %rcx
movl %r14d, %r8d
callq 0x1850a
leaq 0x12366(%rip), %rdi     # 0x3fce5
movq %r12, %rsi
xorl %eax, %eax
callq 0x3120
movq %r12, %rsi
movl %eax, %r13d
jmp 0x2dbf3
movzwl %r15w, %esi
movq %r12, %rdi
movq %rbx, %rdx
movq %rbp, %rcx
movq (%rsp), %r15
movq %r15, %r8
movq 0x18(%rsp), %r9
pushq 0x20(%rsp)
pushq %r14
pushq 0x48(%rsp)
pushq 0x20(%rsp)
callq 0x185a8
addq $0x20, %rsp
xorl %r13d, %r13d
jmp 0x2dc8f
testb $0x30, %al
movq (%rsp), %r15
movq 0x30(%rsp), %r12
movq 0x28(%rsp), %r14
je 0x2d9fc
movq %r8, %rbx
testw $0x300, %ax             # imm = 0x300
je 0x2da36
leaq 0x14f2f(%rip), %rdi     # 0x4291d
movq 0x10(%rsp), %rsi
xorl %eax, %eax
callq 0x3120
jmp 0x2da4c
xorl %ebp, %ebp
jmp 0x2da6c
testb $0x30, %al
movq (%rsp), %r15
je 0x2da2e
movq %r8, %r14
movq %rsi, %rbx
testw $0x300, %ax             # imm = 0x300
je 0x2dbc1
leaq 0x14efe(%rip), %rdi     # 0x4291d
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3120
jmp 0x2dbd5
xorl %r13d, %r13d
jmp 0x2dbf3
leaq 0x14edc(%rip), %rdi     # 0x42919
movq %r13, %rsi
movq 0x10(%rsp), %rdx
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
testb $0x1, 0x3(%rbx)
jne 0x2da69
leaq 0x122ab(%rip), %rdi     # 0x3fd06
xorl %eax, %eax
callq 0x3120
movq %rbx, %r8
addl %eax, %ebp
jmp 0x2da6c
movq %rbx, %r8
testb $0xc, 0x2(%r8)
je 0x2da7c
movl %ebp, %edi
callq 0x160f7
movl %eax, %ebp
movq %r12, %rdi
movl $0x4d4d, %esi           # imm = 0x4D4D
movq %r13, %rdx
callq 0x416a
movl %eax, %ebx
movl %ebp, %edi
callq 0x16a4f
movq 0x8(%rsp), %rax
addl $0x2, %eax
movzwl %bx, %edx
movq %r12, %rdi
movq %r13, %rbp
movq %r13, %rsi
movq 0x10(%rsp), %rcx
movq %r14, %r8
movq %r15, %r9
pushq %rax
pushq 0x20(%rsp)
callq 0x105af
addq $0x10, %rsp
xorl %r13d, %r13d
cmpl $0x0, 0x20(%rsp)
je 0x2db6d
leaq 0x296a9(%rip), %rax     # 0x57180
testb $0x4, 0x2(%rax)
je 0x2db6d
xorl %r13d, %r13d
xorl %edi, %edi
callq 0x1259b
xorl %r14d, %r14d
cmpl $0x1, %eax
sete %r14b
jne 0x2db01
xorl %edi, %edi
callq 0x160f7
movl %eax, %r13d
movl %r14d, %edi
callq 0x1259b
movq 0x10(%rsp), %rax
leaq (%rax,%rbp), %rsi
decq %rsi
leaq 0x115dd(%rip), %rcx     # 0x3f0f9
movl $0x1000000, %edi        # imm = 0x1000000
movq 0x8(%rsp), %rdx
callq 0x5100
leaq 0x1a507(%rip), %rdi     # 0x48039
xorl %eax, %eax
callq 0x3120
movl %r13d, %ecx
movl %eax, %r13d
addl %ecx, %r13d
leaq 0x29637(%rip), %rax     # 0x57180
movq (%rax), %rax
testl $0x4003333, %eax        # imm = 0x4003333
sete %cl
testb $0x30, %al
setne %al
orb %cl, %al
jne 0x2db68
movl %r13d, %edi
callq 0x160f7
movl %eax, %r13d
movq 0x28(%rsp), %r14
xorl %eax, %eax
callq 0x8fb2
testw %bx, %bx
sete %al
testq %r14, %r14
sete %cl
orb %al, %cl
jne 0x2dba9
movq %r14, %rdi
callq 0xf111
testq %rax, %rax
je 0x2dba9
orb $0x1, 0x19(%rax)
movl $0x5, 0x118(%rax)
movl $0x2, 0xc4(%rax)
movq %r12, %rdi
callq 0x31b0
addq 0x10(%rsp), %rbp
movq %r12, %rdi
movq %rbp, %rsi
jmp 0x2dc88
leaq 0x14d51(%rip), %rdi     # 0x42919
movq %r13, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3120
movl %eax, %r13d
testb $0x1, 0x3(%r14)
jne 0x2dbf0
leaq 0x12120(%rip), %rdi     # 0x3fd06
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movq %rbx, %rsi
leaq 0x2a80e(%rip), %rax     # 0x58408
movq (%rax), %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %rsi, %rbx
cmpq %rcx, %rax
je 0x2dc32
testq %rax, %rax
jne 0x2dc28
testl %r13d, %r13d
je 0x2dc77
movq %rsi, %rbx
leaq 0x11aa1(%rip), %rdi     # 0x3f6bf
callq 0x56e2
movq %rbx, %rsi
jmp 0x2dc7a
cmpq %rsi, %rax
cmovaeq %rsi, %rax
movq %rax, %rbx
movq %rsi, %r12
movl %r13d, %edi
callq 0x160f7
subq $0x8, %rsp
pushq $0xc
popq %r8
movq %rbp, %rdi
movq 0x48(%rsp), %r14
movq %r14, %rsi
movq %r12, %rdx
movq %rbx, %rcx
movq 0x10(%rsp), %r9
pushq $0x2
callq 0x6e93
popq %rax
popq %rcx
pushq $0x1
popq %rdi
callq 0x160f7
movq %r12, %rsi
movq %rbp, %rdi
movl %eax, %r13d
jmp 0x2dc82
xorl %r13d, %r13d
movq 0x40(%rsp), %r14
movq %rbp, %rdi
addq %rsi, %r14
movq %r14, %rsi
xorl %edx, %edx
callq 0x3210
movq %r15, %rdi
callq 0x3050
movl %r13d, %edi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x16a4f