// File: /workspace/github_c_makefile_star2_O3/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, %ebp
movq %r8, %r15
movq %rdx, %r12
movq %rdi, %r14
movl %esi, 0xc(%rsp)
movq %rcx, 0x10(%rsp)
movq %rcx, %rdx
callq 0x45af
movl %eax, %ebx
leaq 0x1c127(%rip), %rax     # 0x58180
xorl %edi, %edi
testb $0x4, 0x2(%rax)
je 0x3c0ba
leaq 0xc6f2(%rip), %rdi      # 0x4875a
movq %r15, %rsi
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
movzwl %bx, %ebx
cmpq %r15, %rbx
je 0x3c0ba
callq 0x1707a
movq %r14, %r13
movl %eax, %r14d
leaq 0x504e(%rip), %rcx      # 0x410dc
movl $0x40000, %edi          # imm = 0x40000
movq 0x10(%rsp), %rsi
movl %ebp, %edx
callq 0x55eb
leaq 0x10d87(%rip), %rdi     # 0x4ce2d
movl %ebx, %esi
movq %r15, %rdx
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
addl %r14d, %edi
movq %r13, %r14
callq 0x1707a
movl %eax, %r13d
leaq 0x1c0b7(%rip), %rax     # 0x58180
testl $0x4003333, (%rax)      # imm = 0x4003333
movq %r15, 0x18(%rsp)
je 0x3c192
movq %r12, %rbx
movl %ebp, %r12d
movq %r15, %rbp
shrq %rbp
decq %rbp
je 0x3c192
movq 0x10(%rsp), %rax
movq %r14, 0x20(%rsp)
leaq 0x2(%rax), %r14
movzwl 0xc(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0x20(%rsp), %rdi
movl 0xc(%rsp), %esi
movq %r14, %rdx
callq 0x45af
movl %eax, %r15d
movl $0x4003333, %edi        # imm = 0x4003333
movq %r14, %rsi
movl %r12d, %edx
leaq 0x4fb0(%rip), %rcx      # 0x410dc
callq 0x55eb
leaq 0x4f5f(%rip), %rdi      # 0x41097
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movzwl %r15w, %eax
movl %eax, %esi
shrl $0x8, %esi
leaq 0x1c02b(%rip), %rcx     # 0x58180
btl $0x12, (%rcx)
movzbl %al, %ecx
leaq 0x1121f(%rip), %rdi     # 0x4d382
leaq 0x1122b(%rip), %rax     # 0x4d395
cmovaeq %rax, %rdi
movl %ecx, %edx
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movl %r13d, %edi
callq 0x1707a
movl %eax, %r13d
addq $0x2, %r14
decq %rbp
jne 0x3c106
movq 0x18(%rsp), %rbx
addq 0x10(%rsp), %rbx
movl %r13d, %edi
callq 0x17a82
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq