// File: /workspace/github_c_makefile_star2_O2/hfiguiere[P]exifprobe/maker_asahi.c
// Function: asahi1_offset_makervalue
void
asahi1_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 short marker;
    unsigned long count;
    char *nameoftag;
    char *fulldirname = CNULL;
    int status = 0;
    int chpr = 0;

    if(inptr && 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 0x0004:    /* JpegThumbnailOffset                    */
                /* These models provide the 0x2000 tag as well as the */
                /* 0x0003/0x0004 tags. Both entries point to the same */
                /* thumbnail, so just print values for length and     */
                /* offset tags, and display the thumbnail on the      */
                /* (self-contained) 0x2000 tag                        */
                if(!at_offset && (PRINT_VALUE))
                {
                    if(!(PRINT_OFFSET))
                        chpr += printf("@%lu",value_offset);
                }
                break;
            case 0x2000: /* Jpeg Thumbnail as UNDEFINED section       */
                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:%lu    # UNDEFINED",value_offset,count);
                }
                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+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 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;
            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
movq %rcx, %r13
testq %rdi, %rdi
sete %al
testq %rdx, %rdx
sete %cl
xorl %ebx, %ebx
orb %al, %cl
jne 0x3cf05
movq %r9, %r12
movq %rdx, %rbp
movl %esi, 0x10(%rsp)
movq %r8, 0x40(%rsp)
movq %rdi, 0x8(%rsp)
movl 0xa0(%rsp), %eax
movq %rax, 0x28(%rsp)
movl 0x98(%rsp), %r15d
movl 0x90(%rsp), %ebx
movl 0x88(%rsp), %eax
movq %rax, 0x20(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x30(%rsp)
movzwl (%rdx), %edi
movl %ebx, %esi
movl %r15d, %edx
callq 0x1b2e4
movq %rax, %r14
leaq 0x2dc3(%rip), %rsi      # 0x3f997
movq %r12, %rdi
movq %rax, %rdx
callq 0x16f1d
movq %rax, 0x18(%rsp)
movq 0x8(%rbp), %r8
movq 0x10(%rbp), %rdx
leaq (%rdx,%r13), %rsi
movzwl (%rbp), %eax
cmpl $0x2000, %eax           # imm = 0x2000
je 0x3cc67
cmpl $0xe00, %eax            # imm = 0xE00
je 0x3cc50
cmpl $0x4, %eax
jne 0x3ccdb
xorl %ebx, %ebx
cmpl $0x0, 0x28(%rsp)
jne 0x3cd7b
leaq 0x1a561(%rip), %rax     # 0x57180
movq (%rax), %rax
testb $0x30, %al
sete %cl
testw $0x300, %ax             # imm = 0x300
setne %al
orb %cl, %al
movq 0x18(%rsp), %r13
jne 0x3cefd
leaq 0x9b9a(%rip), %rdi      # 0x467dc
xorl %eax, %eax
callq 0x3120
movl %eax, %ebx
jmp 0x3cefd
xorl %ebx, %ebx
cmpl $0x0, 0x28(%rsp)
je 0x3cd13
movq 0x8(%rsp), %r15
jmp 0x3cd56
leaq 0x1a512(%rip), %r14     # 0x57180
movq (%r14), %rax
cmpl $0x0, 0x28(%rsp)
movq %rsi, 0x10(%rsp)
movq %r8, 0x38(%rsp)
je 0x3cd85
btl $0x12, %eax
movq 0x18(%rsp), %r13
movq 0x8(%rsp), %r15
jae 0x3cdb4
movl $0x1000000, %edi        # imm = 0x1000000
movq 0x20(%rsp), %rdx
movq 0x30(%rsp), %rcx
movq %r8, %rbx
callq 0x5100
leaq 0xb358(%rip), %rdi      # 0x48010
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
leaq 0x9a42(%rip), %rdi      # 0x4670a
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3120
movl %eax, %ebx
addl %ebp, %ebx
jmp 0x3cdb6
movzwl 0x10(%rsp), %esi
movq 0x8(%rsp), %rdi
movq %rbp, %rdx
movq %r13, %rcx
movq 0x18(%rsp), %r13
movq %r13, %r8
movq 0x30(%rsp), %r9
pushq 0x28(%rsp)
pushq %r15
pushq %rbx
pushq 0x38(%rsp)
callq 0x185a8
addq $0x20, %rsp
xorl %ebx, %ebx
jmp 0x3cefd
leaq 0x1a466(%rip), %rax     # 0x57180
movq (%rax), %rax
testb $0x30, %al
sete %cl
testw $0x300, %ax             # imm = 0x300
setne %al
orb %cl, %al
movq 0x8(%rsp), %r15
jne 0x3cd56
leaq 0x6429(%rip), %rdi      # 0x43162
movq %r8, %rdx
xorl %eax, %eax
movq %r8, %rbx
callq 0x3120
movl %eax, %edi
callq 0x160f7
movq %rbx, %r8
movl %eax, %ebx
movq 0x10(%rbp), %rdx
subq $0x8, %rsp
movzwl 0x18(%rsp), %esi
movq %r15, %rdi
movq %r13, %rcx
movq %r14, %r9
pushq 0x28(%rsp)
pushq 0x40(%rsp)
pushq %r12
callq 0x125a8
addq $0x20, %rsp
movq 0x18(%rsp), %r13
jmp 0x3cefd
testb $0x30, %al
sete %cl
testw $0x300, %ax             # imm = 0x300
setne %al
orb %cl, %al
movq 0x18(%rsp), %r13
movq 0x8(%rsp), %r15
jne 0x3cdb4
leaq 0xf846(%rip), %rdi      # 0x4c5ec
movq %r8, %rdx
xorl %eax, %eax
callq 0x3120
movl %eax, %ebx
jmp 0x3cdb6
xorl %ebx, %ebx
testb $0xc, 0x2(%r14)
je 0x3cdc6
movl %ebx, %edi
callq 0x160f7
movl %eax, %ebx
movq %r15, %rdi
movl $0x4d4d, %esi           # imm = 0x4D4D
movq 0x10(%rsp), %rbp
movq %rbp, %rdx
callq 0x416a
movl %eax, %r12d
movq 0x20(%rsp), %rax
addl $0x2, %eax
movzwl %r12w, %edx
movq %r15, %rdi
movq %rbp, %rsi
movq 0x38(%rsp), %rcx
movq 0x40(%rsp), %r8
movq %r13, %r9
pushq %rax
pushq 0x38(%rsp)
callq 0x105af
addq $0x10, %rsp
cmpl $0x0, 0x28(%rsp)
je 0x3cea2
testb $0x4, 0x2(%r14)
je 0x3cea2
xorl %edi, %edi
callq 0x1259b
xorl %ebp, %ebp
cmpl $0x1, %eax
sete %bpl
jne 0x3ce3c
movl %ebx, %edi
callq 0x160f7
movl %eax, %ebx
movl %ebx, %r15d
movl %ebp, %edi
callq 0x1259b
movq 0x10(%rsp), %rax
movq 0x38(%rsp), %rcx
leaq (%rax,%rcx), %rsi
decq %rsi
leaq 0x229b(%rip), %rcx      # 0x3f0f9
movl $0x1000000, %edi        # imm = 0x1000000
movq 0x20(%rsp), %rdx
callq 0x5100
leaq 0xb1c5(%rip), %rdi      # 0x48039
xorl %eax, %eax
callq 0x3120
movl %eax, %ebx
addl %r15d, %ebx
movq (%r14), %rax
testl $0x4003333, %eax        # imm = 0x4003333
sete %cl
testb $0x30, %al
setne %al
orb %cl, %al
jne 0x3ce9d
movl %ebx, %edi
callq 0x160f7
movl %eax, %ebx
movq 0x8(%rsp), %r15
xorl %eax, %eax
callq 0x8fb2
testw %r12w, %r12w
sete %al
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
sete %cl
orb %al, %cl
jne 0x3cee1
callq 0xf111
testq %rax, %rax
je 0x3cee1
orb $0x1, 0x19(%rax)
movl $0x5, 0x118(%rax)
movl $0x2, 0xc4(%rax)
movq %r15, %rdi
callq 0x31b0
movq 0x10(%rsp), %rsi
addq 0x38(%rsp), %rsi
movq %r15, %rdi
xorl %edx, %edx
callq 0x3210
movq %r13, %rdi
callq 0x3050
movl %ebx, %edi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x16a4f