// File: /workspace/github_c_makefile_star2_O3/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 0x1bb3e(%rip), %rbp     # 0x58180
xorl %r13d, %r13d
testb $0x4, 0x2(%rbp)
je 0x3c666
leaq 0xc108(%rip), %rdi      # 0x4875a
movq %r14, %rsi
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
callq 0x1707a
movl %eax, %r13d
cmpq $0x8, %r14
movq %r14, 0x18(%rsp)
movq %r15, 0x10(%rsp)
jb 0x3c976
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 0x4707
movq %rax, %r12
movl $0x4003333, %edi        # imm = 0x4003333
movq %r15, %rsi
movl %r14d, %edx
leaq 0x4a1e(%rip), %rcx      # 0x410dc
callq 0x55eb
movzwl (%rbp), %eax
testl $0x3003, %eax           # imm = 0x3003
je 0x3c6e4
leaq 0x49c2(%rip), %rdi      # 0x41097
movq 0x20(%rsp), %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
cmpl $0x6, %ebx
ja 0x3c7d4
movl %ebx, %eax
leaq 0x105ea(%rip), %rcx     # 0x4cce0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq (%rbp), %rax
testl $0x3003, %eax           # imm = 0x3003
je 0x3c728
leaq 0x11812(%rip), %rdi     # 0x4df23
xorl %esi, %esi
leaq 0x117c8(%rip), %rdx     # 0x4dee2
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movq (%rbp), %rax
testb $0x30, %al
je 0x3c740
leaq 0x4998(%rip), %rdi      # 0x410cb
movq %r12, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movq 0x70(%rsp), %rax
testq %rax, %rax
je 0x3c959
movq %r12, 0x70(%rax)
jmp 0x3c959
movq (%rbp), %rax
testl $0x3003, %eax           # imm = 0x3003
je 0x3c8a5
leaq 0x117b6(%rip), %rdi     # 0x4df23
movl $0x4, %esi
leaq 0x11939(%rip), %rdx     # 0x4e0b2
jmp 0x3c897
movq %r12, %rdi
callq 0x4e8d
movq (%rbp), %rax
testl $0x3003, %eax           # imm = 0x3003
je 0x3c8a5
leaq 0x11787(%rip), %rdi     # 0x4df23
movl $0x2, %esi
leaq 0x118f9(%rip), %rdx     # 0x4e0a1
jmp 0x3c897
movq (%rbp), %rax
testl $0x3003, %eax           # imm = 0x3003
je 0x3c8a5
leaq 0x11760(%rip), %rdi     # 0x4df23
movl $0x3, %esi
leaq 0xd11f(%rip), %rdx      # 0x498ee
jmp 0x3c897
movq (%rbp), %rax
testl $0x3003, %eax           # imm = 0x3003
je 0x3c7fd
leaq 0x1173d(%rip), %rdi     # 0x4df23
movl %ebx, %esi
leaq 0xc1d7(%rip), %rdx      # 0x489c6
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movq (%rbp), %rax
testb $0x30, %al
je 0x3c959
leaq 0x48dd(%rip), %rdi      # 0x410e9
movq %r12, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x3120
jmp 0x3c8be
movq (%rbp), %rax
testl $0x3003, %eax           # imm = 0x3003
je 0x3c84a
leaq 0x116f3(%rip), %rdi     # 0x4df23
movl $0x1, %esi
leaq 0x116b8(%rip), %rdx     # 0x4def4
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movq (%rbp), %rax
testb $0x30, %al
je 0x3c862
leaq 0x4876(%rip), %rdi      # 0x410cb
movq %r12, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movq 0x70(%rsp), %rax
testq %rax, %rax
je 0x3c959
movq %r12, 0x78(%rax)
jmp 0x3c959
movq (%rbp), %rax
testl $0x3003, %eax           # imm = 0x3003
je 0x3c8a5
leaq 0x11698(%rip), %rdi     # 0x4df23
movl $0x5, %esi
leaq 0x1182d(%rip), %rdx     # 0x4e0c4
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movq (%rbp), %rax
testb $0x30, %al
je 0x3c959
leaq 0x4817(%rip), %rdi      # 0x410cb
movq %r12, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
jmp 0x3c959
movq (%rbp), %rax
testl $0x3003, %eax           # imm = 0x3003
je 0x3c8f2
leaq 0x1164b(%rip), %rdi     # 0x4df23
movl $0x6, %esi
leaq 0x117ee(%rip), %rdx     # 0x4e0d2
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movq (%rbp), %rax
testb $0x30, %al
je 0x3c954
leaq 0x47ec(%rip), %rdi      # 0x410e9
movq %r12, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x3120
movl %eax, %r14d
addl %r13d, %r14d
cmpb $0x1, %r12b
leaq 0xc53e(%rip), %rdi      # 0x48e59
leaq 0x117b8(%rip), %rax     # 0x4e0da
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 0x3c954
leaq 0x11799(%rip), %rdi     # 0x4e0e3
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movl 0x8(%rsp), %r14d
movl %r13d, %edi
callq 0x1707a
movl %eax, %r13d
incq %rbx
addq $0x4, %r15
cmpq %rbx, 0x28(%rsp)
jne 0x3c698
movq 0x18(%rsp), %rbx
addq 0x10(%rsp), %rbx
movl %r13d, %edi
callq 0x17a82
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq