// File: /workspace/github_c_makefile_star2_O2/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 $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 0x205d4(%rip), %r12     # 0x57180
xorl %edi, %edi
testb $0x4, 0x2(%r12)
je 0x36c10
movl %eax, %ebx
leaq 0xfb4b(%rip), %rdi      # 0x4670a
movq %r15, %rsi
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
movzwl %bx, %ebx
cmpq %r15, %rbx
je 0x36c10
callq 0x160f7
movq %r14, %r13
movl %eax, %r14d
leaq 0x84f7(%rip), %rcx      # 0x3f0dc
movl $0x40000, %edi          # imm = 0x40000
movq %r13, %rsi
movl (%rsp), %edx
callq 0x5100
leaq 0x141e1(%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 0x36e8b
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 0x36e81
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 0x846d(%rip), %rcx      # 0x3f0dc
callq 0x5100
movzwl (%r12), %eax
testw $0x3003, %ax            # imm = 0x3003
je 0x36c95
leaq 0x8411(%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 $0xb, %ecx
ja 0x36e45
leaq 0x13bf9(%rip), %rdx     # 0x4a8a8
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
testw $0x3003, %ax            # imm = 0x3003
je 0x36e17
leaq 0x15127(%rip), %rdi     # 0x4bdf0
pushq $0x1
popq %rsi
leaq 0x9ac1(%rip), %rdx      # 0x40794
jmp 0x36e09
testw $0x3003, %ax            # imm = 0x3003
je 0x36e17
leaq 0x15107(%rip), %rdi     # 0x4bdf0
pushq $0xc
popq %rsi
leaq 0x1516d(%rip), %rdx     # 0x4be60
jmp 0x36e09
testw $0x3003, %ax            # imm = 0x3003
je 0x36e17
leaq 0x150e7(%rip), %rdi     # 0x4bdf0
pushq $0x5
popq %rsi
leaq 0x9aaa(%rip), %rdx      # 0x407bd
jmp 0x36e09
testw $0x3003, %ax            # imm = 0x3003
je 0x36e17
leaq 0x150c7(%rip), %rdi     # 0x4bdf0
pushq $0xa
popq %rsi
leaq 0x15105(%rip), %rdx     # 0x4be38
jmp 0x36e09
testw $0x3003, %ax            # imm = 0x3003
je 0x36e17
leaq 0x150a7(%rip), %rdi     # 0x4bdf0
pushq $0x3
jmp 0x36d60
testw $0x3003, %ax            # imm = 0x3003
je 0x36e17
leaq 0x15092(%rip), %rdi     # 0x4bdf0
pushq $0x4
popq %rsi
leaq 0x118ee(%rip), %rdx     # 0x48656
jmp 0x36e09
testw $0x3003, %ax            # imm = 0x3003
je 0x36e17
leaq 0x15072(%rip), %rdi     # 0x4bdf0
pushq $0x8
popq %rsi
leaq 0x15089(%rip), %rdx     # 0x4be11
jmp 0x36e09
testw $0x3003, %ax            # imm = 0x3003
je 0x36e17
leaq 0x15055(%rip), %rdi     # 0x4bdf0
pushq $0x2
popq %rsi
leaq 0x99fb(%rip), %rdx      # 0x407a0
jmp 0x36e09
testw $0x3003, %ax            # imm = 0x3003
je 0x36e17
leaq 0x1503c(%rip), %rdi     # 0x4bdf0
pushq $0x6
popq %rsi
leaq 0x99ef(%rip), %rdx      # 0x407ad
jmp 0x36e09
testw $0x3003, %ax            # imm = 0x3003
je 0x36e17
leaq 0x15023(%rip), %rdi     # 0x4bdf0
pushq $0x7
popq %rsi
leaq 0x15028(%rip), %rdx     # 0x4bdff
jmp 0x36e09
testw $0x3003, %ax            # imm = 0x3003
je 0x36e17
leaq 0x1500a(%rip), %rdi     # 0x4bdf0
pushq $0xb
popq %rsi
leaq 0x1505b(%rip), %rdx     # 0x4be4b
jmp 0x36e09
testw $0x3003, %ax            # imm = 0x3003
je 0x36e17
leaq 0x14ff1(%rip), %rdi     # 0x4bdf0
pushq $0x9
popq %rsi
leaq 0x1501b(%rip), %rdx     # 0x4be24
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movq (%r12), %rax
testb $0x30, %al
je 0x36e2e
leaq 0xc138(%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 0x36c41
testw $0x3003, %ax            # imm = 0x3003
je 0x36e69
leaq 0x14f9e(%rip), %rdi     # 0x4bdf0
movl %ebx, %esi
leaq 0xfb1b(%rip), %rdx      # 0x46976
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movq (%r12), %rax
testb $0x30, %al
je 0x36e2e
leaq 0x14322(%rip), %rdi     # 0x4b196
movl %ebp, %esi
movl %ebp, %edx
xorl %eax, %eax
callq 0x3120
jmp 0x36e2b
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