// File: /workspace/github_c_makefile_star2_O1/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 0x4574
leaq 0x20194(%rip), %r15     # 0x58180
xorl %edi, %edi
testb $0x4, 0x2(%r15)
je 0x3804c
movl %eax, %ebx
leaq 0x1071c(%rip), %rdi     # 0x4871a
movq %r12, %rsi
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
movzwl %bx, %ebx
cmpq %r12, %rbx
je 0x3804c
callq 0x16b56
movl %eax, %r14d
leaq 0x90bb(%rip), %rcx      # 0x410dc
movl $0x40000, %edi          # imm = 0x40000
movq 0x10(%rsp), %rsi
movl 0xc(%rsp), %edx
callq 0x5605
leaq 0x14db2(%rip), %rdi     # 0x4cded
movl %ebx, %esi
movq %r12, %rdx
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
addl %r14d, %edi
callq 0x16b56
movl %eax, %r13d
testl $0x4003333, (%r15)      # imm = 0x4003333
movq %r12, 0x20(%rsp)
je 0x3806b
shrq %r12
cmpq $0x1, %r12
jne 0x3808f
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
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 0x9012(%rip), %rcx      # 0x410dc
callq 0x5605
movzwl (%r15), %eax
testl $0x3003, %eax           # imm = 0x3003
je 0x380f0
leaq 0x8fb6(%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 0x382cc
leaq 0x147b2(%rip), %rdx     # 0x4c8b8
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
testl $0x3003, %eax           # imm = 0x3003
je 0x38292
leaq 0x15cdf(%rip), %rdi     # 0x4de00
movl $0x1, %esi
leaq 0xa667(%rip), %rdx      # 0x42794
jmp 0x38288
testl $0x3003, %eax           # imm = 0x3003
je 0x38292
leaq 0x15cbc(%rip), %rdi     # 0x4de00
movl $0xc, %esi
leaq 0x15d20(%rip), %rdx     # 0x4de70
jmp 0x38288
testl $0x3003, %eax           # imm = 0x3003
je 0x38292
leaq 0x15c99(%rip), %rdi     # 0x4de00
movl $0x5, %esi
leaq 0xa64a(%rip), %rdx      # 0x427bd
jmp 0x38288
testl $0x3003, %eax           # imm = 0x3003
je 0x38292
leaq 0x15c76(%rip), %rdi     # 0x4de00
movl $0xa, %esi
leaq 0x15cb2(%rip), %rdx     # 0x4de48
jmp 0x38288
testl $0x3003, %eax           # imm = 0x3003
je 0x38292
leaq 0x15c53(%rip), %rdi     # 0x4de00
movl $0x3, %esi
jmp 0x381cb
testl $0x3003, %eax           # imm = 0x3003
je 0x38292
leaq 0x15c3a(%rip), %rdi     # 0x4de00
movl $0x4, %esi
leaq 0x12494(%rip), %rdx     # 0x4a666
jmp 0x38288
testl $0x3003, %eax           # imm = 0x3003
je 0x38292
leaq 0x15c17(%rip), %rdi     # 0x4de00
movl $0x8, %esi
leaq 0x15c2c(%rip), %rdx     # 0x4de21
jmp 0x38288
testl $0x3003, %eax           # imm = 0x3003
je 0x38292
leaq 0x15bf4(%rip), %rdi     # 0x4de00
movl $0x2, %esi
leaq 0xa588(%rip), %rdx      # 0x427a0
jmp 0x38288
testl $0x3003, %eax           # imm = 0x3003
je 0x38292
leaq 0x15bd8(%rip), %rdi     # 0x4de00
movl $0x6, %esi
leaq 0xa579(%rip), %rdx      # 0x427ad
jmp 0x38288
testl $0x3003, %eax           # imm = 0x3003
je 0x38292
leaq 0x15bbc(%rip), %rdi     # 0x4de00
movl $0x7, %esi
leaq 0x15bbf(%rip), %rdx     # 0x4de0f
jmp 0x38288
testl $0x3003, %eax           # imm = 0x3003
je 0x38292
leaq 0x15ba0(%rip), %rdi     # 0x4de00
movl $0xb, %esi
leaq 0x15bef(%rip), %rdx     # 0x4de5b
jmp 0x38288
testl $0x3003, %eax           # imm = 0x3003
je 0x38292
leaq 0x15b84(%rip), %rdi     # 0x4de00
movl $0x9, %esi
leaq 0x15bac(%rip), %rdx     # 0x4de34
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
testb $0x30, (%r15)
je 0x382ac
movzwl %bp, %esi
leaq 0xccb8(%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, %r12
jne 0x380a4
jmp 0x3806b
testl $0x3003, %eax           # imm = 0x3003
je 0x382ed
leaq 0x15b26(%rip), %rdi     # 0x4de00
movl %ebx, %esi
leaq 0x106a3(%rip), %rdx     # 0x48986
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
testb $0x30, (%r15)
je 0x382ac
movzwl %bp, %edx
leaq 0x14ea9(%rip), %rdi     # 0x4d1a6
movl %edx, %esi
xorl %eax, %eax
callq 0x3120
jmp 0x382a9