// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movl $0x0, -0x54(%rbp)
movq -0x8(%rbp), %rdi
movw -0xa(%rbp), %ax
movq -0x20(%rbp), %rdx
movzwl %ax, %esi
callq 0x4480
movw %ax, -0x42(%rbp)
movq -0x20(%rbp), %rax
addq -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
leaq 0x1cb1b(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40000, %rax          # imm = 0x40000
cmpq $0x0, %rax
je 0x5a6d7
movq -0x28(%rbp), %rsi
leaq 0x1063a(%rip), %rdi     # 0x6acb9
movb $0x0, %al
callq 0x3110
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movzwl -0x42(%rbp), %eax
cmpq -0x28(%rbp), %rax
je 0x5a6d5
movl -0x54(%rbp), %edi
callq 0x1ef50
movl %eax, -0x54(%rbp)
movq -0x20(%rbp), %rsi
movl -0x2c(%rbp), %edx
movl $0x40000, %edi          # imm = 0x40000
leaq 0x9a28(%rip), %rcx      # 0x640dc
callq 0x5ed0
movzwl -0x42(%rbp), %esi
movq -0x28(%rbp), %rdx
leaq 0x14ea5(%rip), %rdi     # 0x6f56d
movb $0x0, %al
callq 0x3110
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
jmp 0x5a6d7
movl -0x54(%rbp), %edi
callq 0x1ef50
movl %eax, -0x54(%rbp)
leaq 0x1ca97(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x4003333, %rax        # imm = 0x4003333
cmpq $0x0, %rax
je 0x5a808
movq -0x20(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rax
shrq %rax
subq $0x1, %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x48(%rbp)
movslq -0x48(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0x5a806
movq -0x8(%rbp), %rdi
movw -0xa(%rbp), %ax
movq -0x20(%rbp), %rdx
movzwl %ax, %esi
callq 0x4480
movw %ax, -0x44(%rbp)
movq -0x20(%rbp), %rsi
movl -0x2c(%rbp), %edx
movl $0x4003333, %edi        # imm = 0x4003333
leaq 0x9985(%rip), %rcx      # 0x640dc
callq 0x5ed0
movq -0x18(%rbp), %rsi
leaq 0x9930(%rip), %rdi      # 0x64097
movb $0x0, %al
callq 0x3110
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movq -0x20(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x20(%rbp)
movzwl -0x44(%rbp), %eax
andl $0xff00, %eax           # imm = 0xFF00
sarl $0x8, %eax
movl %eax, -0x4c(%rbp)
movzwl -0x44(%rbp), %eax
andl $0xff, %eax
movl %eax, -0x50(%rbp)
leaq 0x1c9de(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40000, %rax          # imm = 0x40000
cmpq $0x0, %rax
je 0x5a7d0
movl -0x4c(%rbp), %esi
movl -0x50(%rbp), %edx
movl -0x50(%rbp), %ecx
leaq 0x15301(%rip), %rdi     # 0x6fac2
movb $0x0, %al
callq 0x3110
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
jmp 0x5a7ed
movl -0x4c(%rbp), %esi
movl -0x50(%rbp), %edx
movl -0x50(%rbp), %ecx
leaq 0x152f5(%rip), %rdi     # 0x6fad5
movb $0x0, %al
callq 0x3110
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %edi
callq 0x1ef50
movl %eax, -0x54(%rbp)
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x5a71e
jmp 0x5a808
movl -0x54(%rbp), %edi
callq 0x1ff00
movq -0x40(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)