// File: /workspace/github_c_makefile_star2_O2/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, %ebp
movq %r8, %r15
movq %rcx, 0x10(%rsp)
movq %rdx, 0x20(%rsp)
movl %esi, %ebx
movq %rdi, 0x28(%rsp)
leaq 0x1ca6d(%rip), %rax     # 0x57180
xorl %r13d, %r13d
testb $0x4, 0x2(%rax)
je 0x3a737
leaq 0xbfe7(%rip), %rdi      # 0x4670a
movq %r15, %rsi
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
callq 0x160f7
movl %eax, %r13d
movq 0x70(%rsp), %r14
movq %r15, 0x18(%rsp)
shrq $0x3, %r15
movq %r15, 0x30(%rsp)
addl $0x4, %ebp
movzwl %bx, %eax
movl %eax, 0x8(%rsp)
xorl %ebx, %ebx
movq 0x10(%rsp), %r15
movl %ebp, 0xc(%rsp)
cmpq %rbx, 0x30(%rsp)
je 0x3aa52
movq 0x28(%rsp), %rdi
movl 0x8(%rsp), %esi
movq %r15, %rdx
callq 0x42ba
movq %rax, %r12
movl $0x4003333, %edi        # imm = 0x4003333
movq %r15, %rsi
movl 0xc(%rsp), %edx
leaq 0x494b(%rip), %rcx      # 0x3f0dc
callq 0x5100
leaq 0x1c9e3(%rip), %rax     # 0x57180
movzwl (%rax), %eax
testw $0x3003, %ax            # imm = 0x3003
je 0x3a7bc
leaq 0x48ea(%rip), %rdi      # 0x3f097
movq 0x20(%rsp), %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
cmpl $0x6, %ebx
ja 0x3a8b9
movl %ebx, %eax
leaq 0x104c2(%rip), %rcx     # 0x4ac90
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x1c9a2(%rip), %rbp     # 0x57180
movq (%rbp), %rax
testw $0x3003, %ax            # imm = 0x3003
je 0x3a806
leaq 0x116e4(%rip), %rdi     # 0x4bed3
xorl %esi, %esi
leaq 0x1169a(%rip), %rdx     # 0x4be92
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movq (%rbp), %rax
testb $0x30, %al
je 0x3a81e
leaq 0x48ba(%rip), %rdi      # 0x3f0cb
movq %r12, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
testq %r14, %r14
je 0x3a9a4
movq %r12, 0x70(%r14)
jmp 0x3a9a4
leaq 0x1c949(%rip), %rbp     # 0x57180
movq (%rbp), %rax
testw $0x3003, %ax            # imm = 0x3003
je 0x3a98c
leaq 0x11687(%rip), %rdi     # 0x4bed3
pushq $0x4
popq %rsi
leaq 0x1180c(%rip), %rdx     # 0x4c062
jmp 0x3a97e
movq %r12, %rdi
callq 0x4a1f
leaq 0x1c916(%rip), %rbp     # 0x57180
movq (%rbp), %rax
testw $0x3003, %ax            # imm = 0x3003
je 0x3a98c
leaq 0x11654(%rip), %rdi     # 0x4bed3
pushq $0x2
popq %rsi
leaq 0x117c8(%rip), %rdx     # 0x4c051
jmp 0x3a97e
leaq 0x1c8eb(%rip), %rbp     # 0x57180
movq (%rbp), %rax
testw $0x3003, %ax            # imm = 0x3003
je 0x3a98c
leaq 0x11629(%rip), %rdi     # 0x4bed3
pushq $0x3
popq %rsi
leaq 0xcfea(%rip), %rdx      # 0x4789e
jmp 0x3a97e
leaq 0x1c8c0(%rip), %rbp     # 0x57180
movq (%rbp), %rax
testw $0x3003, %ax            # imm = 0x3003
je 0x3a8e8
leaq 0x11602(%rip), %rdi     # 0x4bed3
movl %ebx, %esi
leaq 0xc09c(%rip), %rdx      # 0x46976
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movq (%rbp), %rax
testb $0x30, %al
je 0x3a9a4
leaq 0x47f2(%rip), %rdi      # 0x3f0e9
movq %r12, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x3120
jmp 0x3a9a1
leaq 0x1c870(%rip), %rbp     # 0x57180
movq (%rbp), %rax
testw $0x3003, %ax            # imm = 0x3003
je 0x3a939
leaq 0x115b2(%rip), %rdi     # 0x4bed3
pushq $0x1
popq %rsi
leaq 0x11579(%rip), %rdx     # 0x4bea4
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movq (%rbp), %rax
testb $0x30, %al
je 0x3a951
leaq 0x4787(%rip), %rdi      # 0x3f0cb
movq %r12, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
testq %r14, %r14
je 0x3a9a4
movq %r12, 0x78(%r14)
jmp 0x3a9a4
leaq 0x1c81d(%rip), %rbp     # 0x57180
movq (%rbp), %rax
testw $0x3003, %ax            # imm = 0x3003
je 0x3a98c
leaq 0x1155f(%rip), %rdi     # 0x4bed3
pushq $0x5
popq %rsi
leaq 0x116f6(%rip), %rdx     # 0x4c074
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movq (%rbp), %rax
testb $0x30, %al
je 0x3a9a4
leaq 0x4734(%rip), %rdi      # 0x3f0cb
movq %r12, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movl %r13d, %edi
callq 0x160f7
movl %eax, %r13d
incq %rbx
addq $0x4, %r15
jmp 0x3a75f
leaq 0x1c7be(%rip), %rbp     # 0x57180
movq (%rbp), %rax
testw $0x3003, %ax            # imm = 0x3003
je 0x3a9eb
leaq 0x11500(%rip), %rdi     # 0x4bed3
pushq $0x6
popq %rsi
leaq 0x116a5(%rip), %rdx     # 0x4c082
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movq (%rbp), %rax
testb $0x30, %al
je 0x3a9a4
leaq 0x46f3(%rip), %rdi      # 0x3f0e9
movq %r12, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
addl %r13d, %ebp
cmpb $0x1, %r12b
leaq 0xc3f6(%rip), %rdi      # 0x46e09
leaq 0x11670(%rip), %rax     # 0x4c08a
cmoveq %rax, %rdi
xorl %eax, %eax
callq 0x3120
movl %eax, %r13d
addl %ebp, %r13d
andl $0xff00, %r12d          # imm = 0xFF00
cmpl $0x100, %r12d           # imm = 0x100
jne 0x3a9a4
leaq 0x1164d(%rip), %rdi     # 0x4c093
xorl %eax, %eax
callq 0x3120
jmp 0x3a9a1
movq 0x18(%rsp), %rbx
addq 0x10(%rsp), %rbx
movl %r13d, %edi
callq 0x16a4f
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq