// File: /workspace/github_c_makefile_star2_O1/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 0x4574
leaq 0x1fe42(%rip), %r12     # 0x58180
xorl %edi, %edi
testb $0x4, 0x2(%r12)
je 0x3839f
movl %eax, %ebx
leaq 0x103c9(%rip), %rdi     # 0x4871a
movq %r15, %rsi
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
movzwl %bx, %ebx
cmpq %r15, %rbx
je 0x3839f
callq 0x16b56
movl %eax, %r14d
leaq 0x8d68(%rip), %rcx      # 0x410dc
movl $0x40000, %edi          # imm = 0x40000
movq 0x10(%rsp), %rsi
movl 0xc(%rsp), %edx
callq 0x5605
leaq 0x14a5f(%rip), %rdi     # 0x4cded
movl %ebx, %esi
movq %r15, %rdx
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
addl %r14d, %edi
callq 0x16b56
movl %eax, %r13d
testl $0x4003333, (%r12)      # imm = 0x4003333
movq %r15, 0x20(%rsp)
je 0x38582
shrq %r15
cmpq $0x1, %r15
je 0x38582
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 0x4574
movl %eax, %ebp
movl $0x4003333, %edi        # imm = 0x4003333
movq %r14, %rsi
movl 0xc(%rsp), %edx
leaq 0x8cda(%rip), %rcx      # 0x410dc
callq 0x5605
movzwl (%r12), %eax
testl $0x3003, %eax           # imm = 0x3003
je 0x38429
leaq 0x8c7d(%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 0x38468
leaq 0x144ac(%rip), %rdx     # 0x4c8e8
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
testl $0x3003, %eax           # imm = 0x3003
je 0x3854c
leaq 0x15a8c(%rip), %rdi     # 0x4dee3
movl $0x1, %esi
leaq 0x12203(%rip), %rdx     # 0x4a666
jmp 0x38542
cmpl $0x16, %ebx
jne 0x38490
testl $0x3003, %eax           # imm = 0x3003
je 0x3854c
leaq 0x15a64(%rip), %rdi     # 0x4dee3
movl $0x16, %esi
leaq 0x15bc9(%rip), %rdx     # 0x4e054
jmp 0x38542
testl $0x3003, %eax           # imm = 0x3003
je 0x384b1
leaq 0x15a45(%rip), %rdi     # 0x4dee3
movl %ebx, %esi
leaq 0x104df(%rip), %rdx     # 0x48986
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
testb $0x30, (%r12)
je 0x38567
movzwl %bp, %edx
leaq 0x14ce0(%rip), %rdi     # 0x4d1a6
movl %edx, %esi
xorl %eax, %eax
callq 0x3120
jmp 0x38564
testl $0x3003, %eax           # imm = 0x3003
je 0x3854c
leaq 0x15a01(%rip), %rdi     # 0x4dee3
movl $0x5, %esi
leaq 0x15b54(%rip), %rdx     # 0x4e042
jmp 0x38542
testl $0x3003, %eax           # imm = 0x3003
je 0x3854c
leaq 0x159e5(%rip), %rdi     # 0x4dee3
movl $0x3, %esi
leaq 0x159aa(%rip), %rdx     # 0x4deb4
jmp 0x38542
testl $0x3003, %eax           # imm = 0x3003
je 0x3854c
leaq 0x159c9(%rip), %rdi     # 0x4dee3
movl $0x4, %esi
leaq 0x15b0b(%rip), %rdx     # 0x4e031
jmp 0x38542
testl $0x3003, %eax           # imm = 0x3003
je 0x3854c
leaq 0x159ad(%rip), %rdi     # 0x4dee3
movl $0x2, %esi
leaq 0x15960(%rip), %rdx     # 0x4dea2
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
testb $0x30, (%r12)
je 0x38567
movzwl %bp, %esi
leaq 0xc9fd(%rip), %rdi      # 0x44f5a
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movl %r13d, %edi
callq 0x16b56
movl %eax, %r13d
incq %rbx
addq $0x2, %r14
cmpq %rbx, %r15
jne 0x383dc
movq 0x20(%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