// File: /workspace/github_c_makefile_star2_O1/hfiguiere[P]exifprobe/maker_canon.c
// Function: canon_imageinfo
unsigned long
canon_imageinfo(FILE *inptr,unsigned short byteorder,char *tagprefix,
                            unsigned long offset,unsigned long dirlength,int indent,
                            struct image_summary *summary_entry)
{
    unsigned long count,value;
    unsigned long end_offset;
    float fvalue;
    int i;
    int chpr = 0;

    if(PRINT_SECTION)
    {
        chpr += printf(" length %lu",dirlength);
        chpr = newline(chpr);
    }

    /* NOTE that imageinfo is not treated as a directory; there is no */
    /* 2-byte count at the beginning.                                 */

    end_offset = offset + dirlength;
    count = (dirlength / sizeof(unsigned long));

    /* Must always do the processing, in order to pick up the image   */
    /* width and height for the summary, even if nothing is to be     */
    /* printed                                                        */
    for(i = 0; i < count; ++i)
    {
        value = read_ulong(inptr,byteorder,offset);
        print_tag_address(ENTRY,offset,indent + MEDIUMINDENT,"@");
        if((PRINT_ENTRY))
        {
            if((PRINT_TAGINFO))
                chpr += printf("%s",tagprefix);
        }
        offset += 4;
        switch(i)
        {
            case 0:
                if((PRINT_TAGINFO))
                     chpr += printf(".%02d_%-22.22s",i,"ImageWidth");
                if((PRINT_VALUE))
                    chpr += printf(" = %lu",value);
                if(summary_entry)
                    summary_entry->pixel_width = value;
                break;
            case 1:
                if((PRINT_TAGINFO))
                     chpr += printf(".%02d_%-22.22s",i,"ImageHeight");
                if((PRINT_VALUE))
                    chpr += printf(" = %lu",value);
                if(summary_entry)
                    summary_entry->pixel_height = value;
                break;
            case 2:
                fvalue = to_float(value);
                if((PRINT_TAGINFO))
                     chpr += printf(".%02d_%-22.22s",i,"PixelAspectRatio");
                if((PRINT_VALUE))
                    chpr += printf(" = %lu",value);
                break;
            case 3:
                if((PRINT_TAGINFO))
                     chpr += printf(".%02d_%-22.22s",i,"Rotation");
                if((PRINT_VALUE))
                    chpr += printf(" = %lu",value);
                break;
            case 4:
                if((PRINT_TAGINFO))
                     chpr += printf(".%02d_%-22.22s",i,"ComponentBitDepth");
                if((PRINT_VALUE))
                    chpr += printf(" = %lu",value);
                break;
            case 5:
                if((PRINT_TAGINFO))
                     chpr += printf(".%02d_%-22.22s",i,"ColorBitDepth");
                if((PRINT_VALUE))
                    chpr += printf(" = %lu",value);
                break;
            case 6:
                if((PRINT_TAGINFO))
                     chpr += printf(".%02d_%-22.22s",i,"ColorBW");
                if((PRINT_VALUE))
                {
                    chpr += printf(" = %#lx/%lu",value,value);
                    if((value & 0xff) == 1)
                         chpr += printf(" = color");
                    else
                         chpr += printf(" = greyscale");
                    if(((value & 0xff00) >> 8) == 1)
                         chpr += printf(" = \'pixel ratio postproc reqd\'");
                }
                break;
            default:
                if((PRINT_TAGINFO))
                     chpr += printf(".%02d_%-22.22s",i,"Undefined");
                if((PRINT_VALUE))
                    chpr += printf(" = %#lx/%lu",value,value);
                break;
        }
        chpr = newline(chpr);
    }
    setcharsprinted(chpr);
    return(end_offset);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r9d, %r12d
movq %r8, %r14
movq %rcx, %r15
movq %rdx, 0x20(%rsp)
movl %esi, %ebx
movq %rdi, 0x30(%rsp)
leaq 0x1c464(%rip), %rbp     # 0x58180
xorl %r13d, %r13d
testb $0x4, 0x2(%rbp)
je 0x3bd40
leaq 0xc9ee(%rip), %rdi      # 0x4871a
movq %r14, %rsi
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
callq 0x16b56
movl %eax, %r13d
cmpq $0x8, %r14
movq %r14, 0x18(%rsp)
movq %r15, 0x10(%rsp)
jb 0x3c046
shrq $0x3, %r14
movq %r14, 0x28(%rsp)
movl %r12d, %r14d
addl $0x4, %r14d
movzwl %bx, %eax
movl %eax, 0xc(%rsp)
xorl %ebx, %ebx
movl %r14d, 0x8(%rsp)
movq 0x30(%rsp), %rdi
movl 0xc(%rsp), %esi
movq %r15, %rdx
callq 0x46cc
movq %rax, %r12
movl $0x4003333, %edi        # imm = 0x4003333
movq %r15, %rsi
movl %r14d, %edx
leaq 0x5344(%rip), %rcx      # 0x410dc
callq 0x5605
movzwl (%rbp), %eax
testl $0x3003, %eax           # imm = 0x3003
je 0x3bdbe
leaq 0x52e8(%rip), %rdi      # 0x41097
movq 0x20(%rsp), %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
cmpl $0x6, %ebx
ja 0x3beac
movl %ebx, %eax
leaq 0x10ed0(%rip), %rcx     # 0x4cca0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movzwl (%rbp), %eax
testl $0x3003, %eax           # imm = 0x3003
je 0x3bdfe
leaq 0x120f8(%rip), %rdi     # 0x4dee3
xorl %esi, %esi
leaq 0x120ae(%rip), %rdx     # 0x4dea2
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
testb $0x30, (%rbp)
je 0x3be18
leaq 0x52c0(%rip), %rdi      # 0x410cb
movq %r12, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movq 0x70(%rsp), %rax
testq %rax, %rax
je 0x3c029
movq %r12, 0x70(%rax)
jmp 0x3c029
movzwl (%rbp), %eax
testl $0x3003, %eax           # imm = 0x3003
je 0x3bf75
leaq 0x1209e(%rip), %rdi     # 0x4dee3
movl $0x4, %esi
leaq 0x12221(%rip), %rdx     # 0x4e072
jmp 0x3bf6b
movq %r12, %rdi
callq 0x4e89
movzwl (%rbp), %eax
testl $0x3003, %eax           # imm = 0x3003
je 0x3bf75
leaq 0x1206f(%rip), %rdi     # 0x4dee3
movl $0x2, %esi
leaq 0x121e1(%rip), %rdx     # 0x4e061
jmp 0x3bf6b
movzwl (%rbp), %eax
testl $0x3003, %eax           # imm = 0x3003
je 0x3bf75
leaq 0x12048(%rip), %rdi     # 0x4dee3
movl $0x3, %esi
leaq 0xda07(%rip), %rdx      # 0x498ae
jmp 0x3bf6b
movzwl (%rbp), %eax
testl $0x3003, %eax           # imm = 0x3003
je 0x3bed1
leaq 0x12025(%rip), %rdi     # 0x4dee3
movl %ebx, %esi
leaq 0xcabf(%rip), %rdx      # 0x48986
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
testb $0x30, (%rbp)
je 0x3c029
leaq 0x5207(%rip), %rdi      # 0x410e9
movq %r12, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x3120
jmp 0x3bf90
movzwl (%rbp), %eax
testl $0x3003, %eax           # imm = 0x3003
je 0x3bf1c
leaq 0x11fdd(%rip), %rdi     # 0x4dee3
movl $0x1, %esi
leaq 0x11fa2(%rip), %rdx     # 0x4deb4
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
testb $0x30, (%rbp)
je 0x3bf36
leaq 0x51a2(%rip), %rdi      # 0x410cb
movq %r12, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movq 0x70(%rsp), %rax
testq %rax, %rax
je 0x3c029
movq %r12, 0x78(%rax)
jmp 0x3c029
movzwl (%rbp), %eax
testl $0x3003, %eax           # imm = 0x3003
je 0x3bf75
leaq 0x11f84(%rip), %rdi     # 0x4dee3
movl $0x5, %esi
leaq 0x12119(%rip), %rdx     # 0x4e084
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
testb $0x30, (%rbp)
je 0x3c029
leaq 0x5145(%rip), %rdi      # 0x410cb
movq %r12, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
jmp 0x3c029
movzwl (%rbp), %eax
testl $0x3003, %eax           # imm = 0x3003
je 0x3bfc0
leaq 0x11f39(%rip), %rdi     # 0x4dee3
movl $0x6, %esi
leaq 0x120dc(%rip), %rdx     # 0x4e092
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
testb $0x30, (%rbp)
je 0x3c024
leaq 0x511c(%rip), %rdi      # 0x410e9
movq %r12, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x3120
movl %eax, %r14d
addl %r13d, %r14d
cmpb $0x1, %r12b
leaq 0xce2e(%rip), %rdi      # 0x48e19
leaq 0x120a8(%rip), %rax     # 0x4e09a
cmoveq %rax, %rdi
xorl %eax, %eax
callq 0x3120
movl %eax, %r13d
addl %r14d, %r13d
andl $0xff00, %r12d          # imm = 0xFF00
cmpl $0x100, %r12d           # imm = 0x100
jne 0x3c024
leaq 0x12089(%rip), %rdi     # 0x4e0a3
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movl 0x8(%rsp), %r14d
movl %r13d, %edi
callq 0x16b56
movl %eax, %r13d
incq %rbx
addq $0x4, %r15
cmpq %rbx, 0x28(%rsp)
jne 0x3bd72
movq 0x18(%rsp), %rbx
addq 0x10(%rsp), %rbx
movl %r13d, %edi
callq 0x17530
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq