// File: /workspace/github_c_makefile_star2_O3/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 $0x38, %rsp
movl %r9d, 0xc(%rsp)
movq %r8, %r15
movq %rdx, 0x28(%rsp)
movl %esi, %ebp
movq %rdi, 0x30(%rsp)
movq %rcx, 0x10(%rsp)
movq %rcx, %rdx
callq 0x45af
leaq 0x1f5a5(%rip), %r12     # 0x58180
xorl %edi, %edi
testb $0x4, 0x2(%r12)
je 0x38c3c
movl %eax, %ebx
leaq 0xfb6c(%rip), %rdi      # 0x4875a
movq %r15, %rsi
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
movzwl %bx, %ebx
cmpq %r15, %rbx
je 0x38c3c
callq 0x1707a
movl %eax, %r14d
leaq 0x84cb(%rip), %rcx      # 0x410dc
movl $0x40000, %edi          # imm = 0x40000
movq 0x10(%rsp), %rsi
movl 0xc(%rsp), %edx
callq 0x55eb
leaq 0x14202(%rip), %rdi     # 0x4ce2d
movl %ebx, %esi
movq %r15, %rdx
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
addl %r14d, %edi
callq 0x1707a
movl %eax, %r13d
testl $0x4003333, (%r12)      # imm = 0x4003333
movq %r15, 0x20(%rsp)
je 0x38e21
shrq %r15
cmpq $0x1, %r15
je 0x38e21
movq 0x10(%rsp), %rax
leaq 0x2(%rax), %r14
movl $0x1, %ebx
movzwl %bp, %eax
movl %eax, 0x1c(%rsp)
movq 0x30(%rsp), %rdi
movl 0x1c(%rsp), %esi
movq %r14, %rdx
callq 0x45af
movl %eax, %ebp
movl $0x4003333, %edi        # imm = 0x4003333
movq %r14, %rsi
movl 0xc(%rsp), %edx
leaq 0x843d(%rip), %rcx      # 0x410dc
callq 0x55eb
movzwl (%r12), %eax
testl $0x3003, %eax           # imm = 0x3003
je 0x38cc6
leaq 0x83e0(%rip), %rdi      # 0x41097
movq 0x28(%rsp), %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movq (%r12), %rax
leal -0x1(%rbx), %ecx
cmpl $0x4, %ecx
ja 0x38d05
leaq 0x13c4f(%rip), %rdx     # 0x4c928
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
testl $0x3003, %eax           # imm = 0x3003
je 0x38dee
leaq 0x1522f(%rip), %rdi     # 0x4df23
movl $0x1, %esi
leaq 0x119a6(%rip), %rdx     # 0x4a6a6
jmp 0x38de0
cmpl $0x16, %ebx
jne 0x38d2d
testl $0x3003, %eax           # imm = 0x3003
je 0x38dee
leaq 0x15207(%rip), %rdi     # 0x4df23
movl $0x16, %esi
leaq 0x1536c(%rip), %rdx     # 0x4e094
jmp 0x38de0
testl $0x3003, %eax           # imm = 0x3003
je 0x38d52
leaq 0x151e8(%rip), %rdi     # 0x4df23
movl %ebx, %esi
leaq 0xfc82(%rip), %rdx      # 0x489c6
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movq (%r12), %rax
testb $0x30, %al
je 0x38e06
movzwl %bp, %edx
leaq 0x14482(%rip), %rdi     # 0x4d1e6
movl %edx, %esi
xorl %eax, %eax
callq 0x3120
jmp 0x38e03
testl $0x3003, %eax           # imm = 0x3003
je 0x38dee
leaq 0x151a3(%rip), %rdi     # 0x4df23
movl $0x5, %esi
leaq 0x152f6(%rip), %rdx     # 0x4e082
jmp 0x38de0
testl $0x3003, %eax           # imm = 0x3003
je 0x38dee
leaq 0x15187(%rip), %rdi     # 0x4df23
movl $0x3, %esi
leaq 0x1514c(%rip), %rdx     # 0x4def4
jmp 0x38de0
testl $0x3003, %eax           # imm = 0x3003
je 0x38dee
leaq 0x1516b(%rip), %rdi     # 0x4df23
movl $0x4, %esi
leaq 0x152ad(%rip), %rdx     # 0x4e071
jmp 0x38de0
testl $0x3003, %eax           # imm = 0x3003
je 0x38dee
leaq 0x1514f(%rip), %rdi     # 0x4df23
movl $0x2, %esi
leaq 0x15102(%rip), %rdx     # 0x4dee2
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movq (%r12), %rax
testb $0x30, %al
je 0x38e06
movzwl %bp, %esi
leaq 0xc1a2(%rip), %rdi      # 0x44f9e
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movl %r13d, %edi
callq 0x1707a
movl %eax, %r13d
incq %rbx
addq $0x2, %r14
cmpq %rbx, %r15
jne 0x38c79
movq 0x20(%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