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

    length = read_ushort(inptr,byteorder,offset);
    end_offset = offset + dirlength;
    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 = 0; i < count; ++i)
        {
            value = read_ushort(inptr,byteorder,offset);
            print_tag_address(ENTRY,offset,indent,"@");
            chpr += printf("%s",tagprefix);
            offset += 2;
            cfn = (value & 0xff00) >> 8;
            cfv = value & 0xff;
            if(PRINT_SECTION)
                chpr += printf("Unk.%02d: = %#x/%u",cfn,cfv,cfv);
            else
                chpr += printf("Unk.%02d = %#x/%u",cfn,cfv,cfv);
            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, 0xc(%rsp)
movq %r8, %r15
movq %rcx, %r14
movq %rdx, 0x20(%rsp)
movl %esi, %ebp
movq %rdi, %r12
movq %rcx, %rdx
callq 0x416a
movl %eax, %ebx
leaq 0x1d008(%rip), %rax     # 0x57180
xorl %edi, %edi
testb $0x4, 0x2(%rax)
je 0x3a1d9
leaq 0xc583(%rip), %rdi      # 0x4670a
movq %r15, %rsi
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
movzwl %bx, %ebx
cmpq %r15, %rbx
je 0x3a1d9
callq 0x160f7
movq %r14, %r13
movl %eax, %r14d
leaq 0x4f2f(%rip), %rcx      # 0x3f0dc
movl $0x40000, %edi          # imm = 0x40000
movq %r13, %rsi
movl 0xc(%rsp), %edx
callq 0x5100
leaq 0x10c18(%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
leaq 0x1cf98(%rip), %rax     # 0x57180
testl $0x4003333, (%rax)      # imm = 0x4003333
je 0x3a2a4
movq %r15, 0x18(%rsp)
shrq %r15
decq %r15
movq %r14, 0x10(%rsp)
addq $0x2, %r14
movzwl %bp, %ebx
subq $0x1, %r15
jb 0x3a29a
movq %r12, %rdi
movl %ebx, %esi
movq %r14, %rdx
callq 0x416a
movl %eax, %ebp
movl $0x4003333, %edi        # imm = 0x4003333
movq %r14, %rsi
movl 0xc(%rsp), %edx
leaq 0x4ea5(%rip), %rcx      # 0x3f0dc
callq 0x5100
leaq 0x4e54(%rip), %rdi      # 0x3f097
movq 0x20(%rsp), %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movzwl %bp, %eax
movl %eax, %esi
shrl $0x8, %esi
leaq 0x1cf1f(%rip), %rcx     # 0x57180
btl $0x12, (%rcx)
movzbl %al, %ecx
leaq 0x110c3(%rip), %rdi     # 0x4b332
leaq 0x110cf(%rip), %rax     # 0x4b345
cmovaeq %rax, %rdi
movl %ecx, %edx
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movl %r13d, %edi
callq 0x160f7
movl %eax, %r13d
addq $0x2, %r14
jmp 0x3a20b
movq 0x18(%rsp), %r15
movq 0x10(%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