// File: /workspace/github_c_makefile_star2_O2/hfiguiere[P]exifprobe/maker_canon.c
// Function: canon_pictureinfo
unsigned long
canon_pictureinfo(FILE *inptr,unsigned short byteorder,char *tagprefix,
                            unsigned long offset,unsigned long dirlength,int indent)
{
    unsigned long count;
    unsigned long end_offset;
    unsigned short value,length;
    int i;
    int chpr = 0;

    end_offset = offset + dirlength;
    length = read_ushort(inptr,byteorder,offset);
    if(PRINT_SECTION)
    {
        chpr += printf(" length %lu",dirlength);
        if(length != dirlength)
        {
            chpr = newline(chpr);
            PUSHCOLOR(RED);
            print_tag_address(SECTION,offset,indent,"@");
            chpr += printf("# WARNING: length %u from segment does not match length %lu from directory",
                        length,dirlength);
            POPCOLOR();
        }
    }
    chpr = newline(chpr);

    if((PRINT_ENTRY))
    {
        offset += 2;
        count = (dirlength / sizeof(unsigned short)) - 1;

        for(i = 1; i <= count; ++i)
        {
            value = read_ushort(inptr,byteorder,offset);
            print_tag_address(ENTRY,offset,indent,"@");
            if((PRINT_TAGINFO))
                chpr += printf("%s",tagprefix);
            offset += 2;
            switch(i)
            {
                case 1:
                    if((PRINT_TAGINFO))
                        chpr += printf(".%02d_%-22.22s",i,"Unknown");
                    if((PRINT_VALUE))
                        chpr += printf(" = %u",value);
                    break;
                case 2:
                    if((PRINT_TAGINFO))
                        chpr += printf(".%02d_%-22.22s",i,"ImageWidth");
                    if((PRINT_VALUE))
                        chpr += printf(" = %u",value);
                    break;
                case 3:
                    if((PRINT_TAGINFO))
                        chpr += printf(".%02d_%-22.22s",i,"ImageHeight");
                    if((PRINT_VALUE))
                        chpr += printf(" = %u",value);
                    break;
                case 4:
                    if((PRINT_TAGINFO))
                        chpr += printf(".%02d_%-22.22s",i,"ImageWidthAsShot");
                    if((PRINT_VALUE))
                        chpr += printf(" = %u",value);
                    break;
                case 5:
                    if((PRINT_TAGINFO))
                        chpr += printf(".%02d_%-22.22s",i,"ImageHeightAsShot");
                    if((PRINT_VALUE))
                        chpr += printf(" = %u",value);
                    break;
                case 22:
                    if((PRINT_TAGINFO))
                        chpr += printf(".%02d_%-22.22s",i,"AFPointsUsed");
                    if((PRINT_VALUE))
                        chpr += printf(" = %u",value);
                    break;
                default:
                    if((PRINT_TAGINFO))
                        chpr += printf(".%02d_%-22.22s",i,"Undefined");
                    if((PRINT_VALUE))
                        chpr += printf(" = %#x%u",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 $0x28, %rsp
movl %r9d, (%rsp)
movq %r8, %r15
movq %rcx, %r14
movq %rdx, 0x18(%rsp)
movl %esi, %ebp
movq %rdi, 0x20(%rsp)
movq %rcx, %rdx
callq 0x416a
leaq 0x202a5(%rip), %r12     # 0x57180
xorl %edi, %edi
testb $0x4, 0x2(%r12)
je 0x36f3f
movl %eax, %ebx
leaq 0xf81c(%rip), %rdi      # 0x4670a
movq %r15, %rsi
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
movzwl %bx, %ebx
cmpq %r15, %rbx
je 0x36f3f
callq 0x160f7
movq %r14, %r13
movl %eax, %r14d
leaq 0x81c8(%rip), %rcx      # 0x3f0dc
movl $0x40000, %edi          # imm = 0x40000
movq %r13, %rsi
movl (%rsp), %edx
callq 0x5100
leaq 0x13eb2(%rip), %rdi     # 0x4addd
movl %ebx, %esi
movq %r15, %rdx
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
addl %r14d, %edi
movq %r13, %r14
callq 0x160f7
movl %eax, %r13d
testl $0x4003333, (%r12)      # imm = 0x4003333
je 0x37113
movq %r15, 0x10(%rsp)
shrq %r15
movq %r14, 0x8(%rsp)
addq $0x2, %r14
pushq $0x1
popq %rbx
movzwl %bp, %eax
movl %eax, 0x4(%rsp)
cmpq %rbx, %r15
je 0x37109
movq 0x20(%rsp), %rdi
movl 0x4(%rsp), %esi
movq %r14, %rdx
callq 0x416a
movl %eax, %ebp
movl $0x4003333, %edi        # imm = 0x4003333
movq %r14, %rsi
movl (%rsp), %edx
leaq 0x813e(%rip), %rcx      # 0x3f0dc
callq 0x5100
movzwl (%r12), %eax
testw $0x3003, %ax            # imm = 0x3003
je 0x36fc4
leaq 0x80e2(%rip), %rdi      # 0x3f097
movq 0x18(%rsp), %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movq (%r12), %rax
leal -0x1(%rbx), %ecx
movzwl %bp, %ebp
cmpl $0x4, %ecx
ja 0x37003
leaq 0x138fe(%rip), %rdx     # 0x4a8d8
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
testw $0x3003, %ax            # imm = 0x3003
je 0x370db
leaq 0x14edf(%rip), %rdi     # 0x4bed3
pushq $0x1
popq %rsi
leaq 0x11658(%rip), %rdx     # 0x48656
jmp 0x370cd
cmpl $0x16, %ebx
jne 0x37028
testw $0x3003, %ax            # imm = 0x3003
je 0x370db
leaq 0x14eba(%rip), %rdi     # 0x4bed3
pushq $0x16
popq %rsi
leaq 0x15021(%rip), %rdx     # 0x4c044
jmp 0x370cd
testw $0x3003, %ax            # imm = 0x3003
je 0x3704c
leaq 0x14e9e(%rip), %rdi     # 0x4bed3
movl %ebx, %esi
leaq 0xf938(%rip), %rdx      # 0x46976
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movq (%r12), %rax
testb $0x30, %al
je 0x370f2
leaq 0x1413b(%rip), %rdi     # 0x4b196
movl %ebp, %esi
movl %ebp, %edx
xorl %eax, %eax
callq 0x3120
jmp 0x370ef
testw $0x3003, %ax            # imm = 0x3003
je 0x370db
leaq 0x14e5b(%rip), %rdi     # 0x4bed3
pushq $0x5
popq %rsi
leaq 0x14fb0(%rip), %rdx     # 0x4c032
jmp 0x370cd
testw $0x3003, %ax            # imm = 0x3003
je 0x370db
leaq 0x14e42(%rip), %rdi     # 0x4bed3
pushq $0x3
popq %rsi
leaq 0x14e09(%rip), %rdx     # 0x4bea4
jmp 0x370cd
testw $0x3003, %ax            # imm = 0x3003
je 0x370db
leaq 0x14e29(%rip), %rdi     # 0x4bed3
pushq $0x4
popq %rsi
leaq 0x14f6d(%rip), %rdx     # 0x4c021
jmp 0x370cd
testw $0x3003, %ax            # imm = 0x3003
je 0x370db
leaq 0x14e10(%rip), %rdi     # 0x4bed3
pushq $0x2
popq %rsi
leaq 0x14dc5(%rip), %rdx     # 0x4be92
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movq (%r12), %rax
testb $0x30, %al
je 0x370f2
leaq 0xbe74(%rip), %rdi      # 0x42f5a
movl %ebp, %esi
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movl %r13d, %edi
callq 0x160f7
movl %eax, %r13d
incq %rbx
addq $0x2, %r14
jmp 0x36f70
movq 0x10(%rsp), %r15
movq 0x8(%rsp), %r14
addq %r14, %r15
movl %r13d, %edi
callq 0x16a4f
movq %r15, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq