// File: /workspace/github_c_makefile_star2_O0/hfiguiere[P]exifprobe/ciff.c
// Function: canon_colorspace
unsigned long
canon_colorspace(FILE *inptr,unsigned short byteorder,char *tagprefix,
                            unsigned long offset,unsigned long dirlength,int indent)
{
    unsigned long count,value;
    unsigned long end_offset;
    int i;
    int chpr = 0;

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

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

    /* There should be just one (no idea why they didn't do it        */
    /* INRECORD), and there is no 2-byte count                        */
    for(i = 0; i < count; ++i)
    {
        value = read_ushort(inptr,byteorder,offset);
        print_tag_address(ENTRY,offset,indent,"@");
        if((PRINT_TAGINFO))
        {
            if(tagprefix && (PRINT_LONGNAMES))
                chpr = printf("%s.",tagprefix);
            chpr = printf("%-*.*s",CIFFTAGWIDTH,CIFFTAGWIDTH,"type");
        }
        if((PRINT_VALUE))
        {
            chpr += printf(" = %lu ",value);
            if(value == 1)
                chpr += printf(" = \"real-world\"");
            else if(value == 2)
                chpr += printf(" = \"document\"");
            else if(value == 0xfff)
                chpr += printf(" = \"uncalibrated\"");
            else
                chpr += printf(" = \"undefined\"");
        }
        chpr = newline(chpr);
        offset += 2;
    }
    setcharsprinted(chpr);
    return(end_offset);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %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, -0x50(%rbp)
leaq 0x4994f(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40000, %rax          # imm = 0x40000
cmpq $0x0, %rax
je 0x2d863
movq -0x28(%rbp), %rsi
leaq 0x3d46d(%rip), %rdi     # 0x6acb8
movb $0x0, %al
callq 0x3110
addl -0x50(%rbp), %eax
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %edi
callq 0x1ef50
movl %eax, -0x50(%rbp)
movq -0x20(%rbp), %rax
addq -0x28(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rax
shrq %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x4c(%rbp)
movslq -0x4c(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0x2d9f0
movq -0x8(%rbp), %rdi
movw -0xa(%rbp), %ax
movq -0x20(%rbp), %rdx
movzwl %ax, %esi
callq 0x4480
movzwl %ax, %eax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rsi
movl -0x2c(%rbp), %edx
movl $0x4003333, %edi        # imm = 0x4003333
leaq 0x3681f(%rip), %rcx     # 0x640dc
callq 0x5ed0
leaq 0x498b7(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x3003, %rax           # imm = 0x3003
cmpq $0x0, %rax
je 0x2d927
cmpq $0x0, -0x18(%rbp)
je 0x2d908
leaq 0x4989a(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40, %rax
cmpq $0x0, %rax
je 0x2d908
movq -0x18(%rbp), %rsi
leaq 0x3a27b(%rip), %rdi     # 0x67b79
movb $0x0, %al
callq 0x3110
movl %eax, -0x50(%rbp)
leaq 0x3d78d(%rip), %rdi     # 0x6b09c
movl $0x17, %edx
leaq 0x37af3(%rip), %rcx     # 0x6540e
movl %edx, %esi
movb $0x0, %al
callq 0x3110
movl %eax, -0x50(%rbp)
leaq 0x49852(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x30, %rax
cmpq $0x0, %rax
je 0x2d9cb
movq -0x40(%rbp), %rsi
leaq 0x3d4e7(%rip), %rdi     # 0x6ae31
movb $0x0, %al
callq 0x3110
addl -0x50(%rbp), %eax
movl %eax, -0x50(%rbp)
cmpq $0x1, -0x40(%rbp)
jne 0x2d974
leaq 0x3d4d4(%rip), %rdi     # 0x6ae39
movb $0x0, %al
callq 0x3110
addl -0x50(%rbp), %eax
movl %eax, -0x50(%rbp)
jmp 0x2d9c9
cmpq $0x2, -0x40(%rbp)
jne 0x2d991
leaq 0x3d4c7(%rip), %rdi     # 0x6ae49
movb $0x0, %al
callq 0x3110
addl -0x50(%rbp), %eax
movl %eax, -0x50(%rbp)
jmp 0x2d9c7
cmpq $0xfff, -0x40(%rbp)     # imm = 0xFFF
jne 0x2d9b1
leaq 0x3d4b5(%rip), %rdi     # 0x6ae57
movb $0x0, %al
callq 0x3110
addl -0x50(%rbp), %eax
movl %eax, -0x50(%rbp)
jmp 0x2d9c5
leaq 0x3d4b1(%rip), %rdi     # 0x6ae69
movb $0x0, %al
callq 0x3110
addl -0x50(%rbp), %eax
movl %eax, -0x50(%rbp)
jmp 0x2d9c7
jmp 0x2d9c9
jmp 0x2d9cb
movl -0x50(%rbp), %edi
callq 0x1ef50
movl %eax, -0x50(%rbp)
movq -0x20(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x20(%rbp)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x2d881
movl -0x50(%rbp), %edi
callq 0x1ff00
movq -0x48(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)