// File: /workspace/github_c_makefile_star2_O1/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 0x4574
movl %eax, %ebx
leaq 0x1ca4e(%rip), %rax     # 0x58180
xorl %edi, %edi
testb $0x4, 0x2(%rax)
je 0x3b793
leaq 0xcfd9(%rip), %rdi      # 0x4871a
movq %r15, %rsi
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
movzwl %bx, %ebx
cmpq %r15, %rbx
je 0x3b793
callq 0x16b56
movq %r14, %r13
movl %eax, %r14d
leaq 0x5975(%rip), %rcx      # 0x410dc
movl $0x40000, %edi          # imm = 0x40000
movq 0x10(%rsp), %rsi
movl %ebp, %edx
callq 0x5605
leaq 0x1166e(%rip), %rdi     # 0x4cded
movl %ebx, %esi
movq %r15, %rdx
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
addl %r14d, %edi
movq %r13, %r14
callq 0x16b56
movl %eax, %r13d
leaq 0x1c9de(%rip), %rax     # 0x58180
testl $0x4003333, (%rax)      # imm = 0x4003333
movq %r15, 0x18(%rsp)
je 0x3b86b
movq %r12, %rbx
movl %ebp, %r12d
movq %r15, %rbp
shrq %rbp
decq %rbp
je 0x3b86b
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 0x4574
movl %eax, %r15d
movl $0x4003333, %edi        # imm = 0x4003333
movq %r14, %rsi
movl %r12d, %edx
leaq 0x58d7(%rip), %rcx      # 0x410dc
callq 0x5605
leaq 0x5886(%rip), %rdi      # 0x41097
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movzwl %r15w, %eax
movl %eax, %esi
shrl $0x8, %esi
leaq 0x1c952(%rip), %rcx     # 0x58180
btl $0x12, (%rcx)
movzbl %al, %ecx
leaq 0x11b06(%rip), %rdi     # 0x4d342
leaq 0x11b12(%rip), %rax     # 0x4d355
cmovaeq %rax, %rdi
movl %ecx, %edx
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movl %r13d, %edi
callq 0x16b56
movl %eax, %r13d
addq $0x2, %r14
decq %rbp
jne 0x3b7df
movq 0x18(%rsp), %rbx
addq 0x10(%rsp), %rbx
movl %r13d, %edi
callq 0x17530
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq