// File: /workspace/github_c_makefile_star2_O2/hfiguiere[P]exifprobe/maker_canon.c
// Function: canon_focusinfo
unsigned long
canon_focusinfo(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;
    int i;
    int chpr = 0;

    if(PRINT_SECTION)
        chpr += printf(" length %lu",dirlength);
    chpr = newline(chpr);

    /* NOTE that focallength is not treated as a directory; there is  */
    /* no 2-byte count at the beginning.                              */

    end_offset = offset + dirlength;
    count = (dirlength / sizeof(unsigned short));

    for(i = 0; i < count; ++i)
    {
        value = read_ushort(inptr,byteorder,offset);
        print_tag_address(ENTRY,offset,indent,"@");
        if((PRINT_ENTRY))
        {
            if((PRINT_TAGINFO))
                chpr += printf("%s",tagprefix);
        }
        offset += 2;
        switch(i)
        {
            case 0:
                if((PRINT_TAGINFO))
                    chpr += printf(".%02d_%-22.22s",i,"unknown");
                if((PRINT_VALUE))
                    chpr += printf(" = %u",value);
                break;
            case 1:
                if((PRINT_TAGINFO))
                    chpr += printf(".%02d_%-22.22s",i,"FocalLength");
                if((PRINT_VALUE))
                    chpr += printf(" = %u",value);
                break;
            case 2:
                if((PRINT_TAGINFO))
                    chpr += printf(".%02d_%-22.22s",i,"FocalPlaneXSize");
                if((PRINT_VALUE))
                    chpr += printf(" = %u",value);
                break;
            case 3:
                if((PRINT_TAGINFO))
                    chpr += printf(".%02d_%-22.22s",i,"FocalPlaneYSize");
                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 $0x28, %rsp
movl %r9d, 0x4(%rsp)
movq %r8, %r14
movq %rcx, %r15
movq %rdx, 0x18(%rsp)
movl %esi, %ebx
movq %rdi, 0x20(%rsp)
leaq 0x20fe7(%rip), %r12     # 0x57180
xorl %edi, %edi
testb $0x4, 0x2(%r12)
je 0x361b6
leaq 0x10560(%rip), %rdi     # 0x4670a
movq %r14, %rsi
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
callq 0x160f7
movl %eax, %r13d
movq %r14, 0x10(%rsp)
shrq %r14
movzwl %bx, %eax
movl %eax, (%rsp)
xorl %ebx, %ebx
movq %r15, 0x8(%rsp)
cmpq %rbx, %r14
je 0x36322
movq 0x20(%rsp), %rdi
movl (%rsp), %esi
movq %r15, %rdx
callq 0x416a
movl %eax, %ebp
movl $0x4003333, %edi        # imm = 0x4003333
movq %r15, %rsi
movl 0x4(%rsp), %edx
leaq 0x8edb(%rip), %rcx      # 0x3f0dc
callq 0x5100
movzwl (%r12), %eax
testw $0x3003, %ax            # imm = 0x3003
je 0x36227
leaq 0x8e7f(%rip), %rdi      # 0x3f097
movq 0x18(%rsp), %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movq (%r12), %rax
movzwl %bp, %ebp
cmpl $0x3, %ebx
ja 0x362e6
movl %ebx, %ecx
leaq 0x14534(%rip), %rdx     # 0x4a774
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
testw $0x3003, %ax            # imm = 0x3003
je 0x362b8
leaq 0x15c7d(%rip), %rdi     # 0x4bed3
xorl %esi, %esi
leaq 0xd705(%rip), %rdx      # 0x43964
jmp 0x362aa
testw $0x3003, %ax            # imm = 0x3003
je 0x362b8
leaq 0x15c65(%rip), %rdi     # 0x4bed3
pushq $0x2
popq %rsi
leaq 0x15e3a(%rip), %rdx     # 0x4c0b2
jmp 0x362aa
testw $0x3003, %ax            # imm = 0x3003
je 0x362b8
leaq 0x15c4c(%rip), %rdi     # 0x4bed3
pushq $0x3
popq %rsi
leaq 0x15e31(%rip), %rdx     # 0x4c0c2
jmp 0x362aa
testw $0x3003, %ax            # imm = 0x3003
je 0x362b8
leaq 0x15c33(%rip), %rdi     # 0x4bed3
pushq $0x1
popq %rsi
leaq 0x12251(%rip), %rdx     # 0x484fb
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movq (%r12), %rax
testb $0x30, %al
je 0x362cf
leaq 0xcc97(%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, %r15
jmp 0x361d3
testw $0x3003, %ax            # imm = 0x3003
je 0x3630a
leaq 0x15be0(%rip), %rdi     # 0x4bed3
movl %ebx, %esi
leaq 0x1067a(%rip), %rdx     # 0x46976
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movq (%r12), %rax
testb $0x30, %al
je 0x362cf
leaq 0x14e81(%rip), %rdi     # 0x4b196
movl %ebp, %esi
movl %ebp, %edx
xorl %eax, %eax
callq 0x3120
jmp 0x362cc
movq 0x10(%rsp), %rbx
addq 0x8(%rsp), %rbx
movl %r13d, %edi
callq 0x16a4f
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq