// File: /workspace/github_c_makefile_star2_O3/hfiguiere[P]exifprobe/maker_canon.c
// Function: canon_sensorinfo
unsigned long
canon_sensorinfo(FILE *inptr,unsigned short byteorder,char *tagprefix,
                        unsigned long offset,unsigned long dirlength,int indent)
{
    unsigned long count;
    unsigned long end_offset;
    unsigned short length,value;
    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_%-26.26s",i,"SensorWidth");
                    if((PRINT_VALUE))
                        chpr += printf(" = %u",value);
                    break;
                case 2:
                    if((PRINT_TAGINFO))
                        chpr += printf(".%02d_%-26.26s",i,"SensorHeight");
                    if((PRINT_VALUE))
                        chpr += printf(" = %u",value);
                    break;
                case 3:
                    if((PRINT_TAGINFO))
                        chpr += printf(".%02d_%-26.26s",i,"Unknown");
                    if((PRINT_VALUE))
                        chpr += printf(" = %u",value);
                    break;
                case 4:
                    if((PRINT_TAGINFO))
                        chpr += printf(".%02d_%-26.26s",i,"Unknown");
                    if((PRINT_VALUE))
                        chpr += printf(" = %u",value);
                    break;
                case 5:
                    if((PRINT_TAGINFO))
                        chpr += printf(".%02d_%-26.26s",i,"SensorLeftBorder");
                    if((PRINT_VALUE))
                        chpr += printf(" = %u",value);
                    break;
                case 6:
                    if((PRINT_TAGINFO))
                        chpr += printf(".%02d_%-26.26s",i,"SensorTopBorder");
                    if((PRINT_VALUE))
                        chpr += printf(" = %u",value);
                    break;
                case 7:
                    if((PRINT_TAGINFO))
                        chpr += printf(".%02d_%-26.26s",i,"SensorRightBorder");
                    if((PRINT_VALUE))
                        chpr += printf(" = %u",value);
                    break;
                case 8:
                    if((PRINT_TAGINFO))
                        chpr += printf(".%02d_%-26.26s",i,"SensorBottomBorder");
                    if((PRINT_VALUE))
                        chpr += printf(" = %u",value);
                    break;
                case 9:
                    if((PRINT_TAGINFO))
                        chpr += printf(".%02d_%-26.26s",i,"BlackMaskLeftBorder");
                    if((PRINT_VALUE))
                        chpr += printf(" = %u",value);
                    break;
                case 10:
                    if((PRINT_TAGINFO))
                        chpr += printf(".%02d_%-26.26s",i,"BlackMaskTopBorder");
                    if((PRINT_VALUE))
                        chpr += printf(" = %u",value);
                    break;
                case 11:
                    if((PRINT_TAGINFO))
                        chpr += printf(".%02d_%-26.26s",i,"BlackMaskRightBorder");
                    if((PRINT_VALUE))
                        chpr += printf(" = %u",value);
                    break;
                case 12:
                    if((PRINT_TAGINFO))
                        chpr += printf(".%02d_%-26.26s",i,"BlackMaskBottomBorder");
                    if((PRINT_VALUE))
                        chpr += printf(" = %u",value);
                    break;
                default:
                    if((PRINT_TAGINFO))
                        chpr += printf(".%02d_%-26.26s",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, %r12
movq %rdx, 0x28(%rsp)
movl %esi, %ebp
movq %rdi, 0x30(%rsp)
movq %rcx, 0x10(%rsp)
movq %rcx, %rdx
callq 0x45af
leaq 0x1f8f9(%rip), %r15     # 0x58180
xorl %edi, %edi
testb $0x4, 0x2(%r15)
je 0x388e7
movl %eax, %ebx
leaq 0xfec1(%rip), %rdi      # 0x4875a
movq %r12, %rsi
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
movzwl %bx, %ebx
cmpq %r12, %rbx
je 0x388e7
callq 0x1707a
movl %eax, %r14d
leaq 0x8820(%rip), %rcx      # 0x410dc
movl $0x40000, %edi          # imm = 0x40000
movq 0x10(%rsp), %rsi
movl 0xc(%rsp), %edx
callq 0x55eb
leaq 0x14557(%rip), %rdi     # 0x4ce2d
movl %ebx, %esi
movq %r12, %rdx
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
addl %r14d, %edi
callq 0x1707a
movl %eax, %r13d
testl $0x4003333, (%r15)      # imm = 0x4003333
movq %r12, 0x20(%rsp)
je 0x38906
shrq %r12
cmpq $0x1, %r12
jne 0x3892a
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
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 0x8777(%rip), %rcx      # 0x410dc
callq 0x55eb
movzwl (%r15), %eax
testl $0x3003, %eax           # imm = 0x3003
je 0x3898b
leaq 0x871b(%rip), %rdi      # 0x41097
movq 0x28(%rsp), %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movq (%r15), %rax
leal -0x1(%rbx), %ecx
cmpl $0xb, %ecx
ja 0x38b68
leaq 0x13f57(%rip), %rdx     # 0x4c8f8
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
testl $0x3003, %eax           # imm = 0x3003
je 0x38b30
leaq 0x15484(%rip), %rdi     # 0x4de40
movl $0x1, %esi
leaq 0x9dcc(%rip), %rdx      # 0x42794
jmp 0x38b23
testl $0x3003, %eax           # imm = 0x3003
je 0x38b30
leaq 0x15461(%rip), %rdi     # 0x4de40
movl $0xc, %esi
leaq 0x154c5(%rip), %rdx     # 0x4deb0
jmp 0x38b23
testl $0x3003, %eax           # imm = 0x3003
je 0x38b30
leaq 0x1543e(%rip), %rdi     # 0x4de40
movl $0x5, %esi
leaq 0x9daf(%rip), %rdx      # 0x427bd
jmp 0x38b23
testl $0x3003, %eax           # imm = 0x3003
je 0x38b30
leaq 0x1541b(%rip), %rdi     # 0x4de40
movl $0xa, %esi
leaq 0x15457(%rip), %rdx     # 0x4de88
jmp 0x38b23
testl $0x3003, %eax           # imm = 0x3003
je 0x38b30
leaq 0x153f8(%rip), %rdi     # 0x4de40
movl $0x3, %esi
jmp 0x38a66
testl $0x3003, %eax           # imm = 0x3003
je 0x38b30
leaq 0x153df(%rip), %rdi     # 0x4de40
movl $0x4, %esi
leaq 0x11c39(%rip), %rdx     # 0x4a6a6
jmp 0x38b23
testl $0x3003, %eax           # imm = 0x3003
je 0x38b30
leaq 0x153bc(%rip), %rdi     # 0x4de40
movl $0x8, %esi
leaq 0x153d1(%rip), %rdx     # 0x4de61
jmp 0x38b23
testl $0x3003, %eax           # imm = 0x3003
je 0x38b30
leaq 0x15399(%rip), %rdi     # 0x4de40
movl $0x2, %esi
leaq 0x9ced(%rip), %rdx      # 0x427a0
jmp 0x38b23
testl $0x3003, %eax           # imm = 0x3003
je 0x38b30
leaq 0x1537d(%rip), %rdi     # 0x4de40
movl $0x6, %esi
leaq 0x9cde(%rip), %rdx      # 0x427ad
jmp 0x38b23
testl $0x3003, %eax           # imm = 0x3003
je 0x38b30
leaq 0x15361(%rip), %rdi     # 0x4de40
movl $0x7, %esi
leaq 0x15364(%rip), %rdx     # 0x4de4f
jmp 0x38b23
testl $0x3003, %eax           # imm = 0x3003
je 0x38b30
leaq 0x15345(%rip), %rdi     # 0x4de40
movl $0xb, %esi
leaq 0x15394(%rip), %rdx     # 0x4de9b
jmp 0x38b23
testl $0x3003, %eax           # imm = 0x3003
je 0x38b30
leaq 0x15329(%rip), %rdi     # 0x4de40
movl $0x9, %esi
leaq 0x15351(%rip), %rdx     # 0x4de74
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movq (%r15), %rax
testb $0x30, %al
je 0x38b48
movzwl %bp, %esi
leaq 0xc460(%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, %r12
jne 0x3893f
jmp 0x38906
testl $0x3003, %eax           # imm = 0x3003
je 0x38b8c
leaq 0x152ca(%rip), %rdi     # 0x4de40
movl %ebx, %esi
leaq 0xfe47(%rip), %rdx      # 0x489c6
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movq (%r15), %rax
testb $0x30, %al
je 0x38b48
movzwl %bp, %edx
leaq 0x1464c(%rip), %rdi     # 0x4d1e6
movl %edx, %esi
xorl %eax, %eax
callq 0x3120
jmp 0x38b45