// File: /workspace/github_c_makefile_star2_O0/hfiguiere[P]exifprobe/jp2000.c
// Function: process_jp2_colr
unsigned long
process_jp2_colr(FILE *inptr,struct jp2box *box,int indent)
{
    unsigned long boxoffset,dataoffset;
    unsigned long boxlength,proflength;
    unsigned short meth = 0;
    unsigned short prec = 0;
    unsigned short approx = 0;
    unsigned short csenum = 0;
    int chpr = 0;

    if((LIST_MODE))
        chpr = list_jp2box(inptr,box,"JP2.jp2h.",indent,1);
    else
        print_jp2box(inptr,box,indent);
    boxoffset = box->boxoffset;
    dataoffset = boxoffset + box->dataoffset;
    boxlength = box->boxlength;

    meth = read_ubyte(inptr,dataoffset);
    print_tag_address(ENTRY,dataoffset,indent + 8,"=");
    if((PRINT_TAGINFO))
    {
        if((PRINT_LONGNAMES))
            chpr += printf("JP2.jp2h.colr.");
        chpr += printf("Method");
    }
    if((PRINT_VALUE))
        chpr += printf(" = %u",meth);
    chpr = newline(chpr);
    dataoffset ++;

    prec = read_ubyte(inptr,dataoffset);
    print_tag_address(ENTRY,dataoffset,indent + 8,"=");
    if((PRINT_TAGINFO))
    {
        if((PRINT_LONGNAMES))
            chpr += printf("JP2.jp2h.colr.");
        chpr += printf("Precedence");
    }
    if((PRINT_VALUE))
        chpr += printf(" = %u",prec);
    chpr = newline(chpr);
    dataoffset ++;

    approx = read_ubyte(inptr,dataoffset);
    print_tag_address(ENTRY,dataoffset,indent + 8,"=");
    if((PRINT_TAGINFO))
    {
        if((PRINT_LONGNAMES))
            chpr += printf("JP2.jp2h.colr.");
        chpr += printf("ColorSpaceAproximation");
    }
    if((PRINT_VALUE))
        chpr += printf(" = %u",approx);
    chpr = newline(chpr);
    dataoffset ++;

    if(meth == 1)
    {
        csenum = read_ulong(inptr,TIFF_MOTOROLA,dataoffset);
        print_tag_address(ENTRY,dataoffset,indent + 8,"=");
        if((PRINT_TAGINFO))
        {
            if((PRINT_LONGNAMES))
                chpr += printf("JP2.jp2h.colr.");
            chpr += printf("EnumeratedColorSpace");
        }
        if((PRINT_VALUE))
        {
            chpr += printf(" = %u",csenum);
            switch(csenum)
            {
                case 16: chpr += printf(" = sRGB"); break;
                case 17: chpr += printf(" = greyscale"); break;
                default: chpr += printf(" = undefined"); break;
            }
        }
        chpr = newline(chpr);
        dataoffset += 4;
    }
    else
    {
        print_tag_address(ENTRY,dataoffset,indent + 8,"=");
        proflength = boxoffset + boxlength - dataoffset;
        if((PRINT_TAGINFO))
        {
            if((PRINT_LONGNAMES))
                chpr += printf("JP2.jp2h.colr.");
            chpr += printf("ICCProfileLength");
        }
        if((PRINT_VALUE))
            chpr += printf(" = %lu",proflength);
        chpr = newline(chpr);
        /* ###%%% display this as soon as we have some ICC routines   */
        dataoffset = boxoffset + boxlength;
    }
    dataoffset = boxoffset + boxlength;
    if((PRINT_SECTION))
    {
        chpr = newline(chpr);
        print_tag_address(SECTION,dataoffset - 1,indent,"@");
        print_jp2type(box->tbox,1);
    }
    chpr = newline(chpr);
    return(dataoffset);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movw $0x0, -0x3a(%rbp)
movw $0x0, -0x3c(%rbp)
movw $0x0, -0x3e(%rbp)
movw $0x0, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
leaq 0x46887(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x1040000, %rax        # imm = 0x1040000
cmpq $0x0, %rax
jne 0x3092a
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %ecx
leaq 0x3ab97(%rip), %rdx     # 0x6b4b1
movl $0x1, %r8d
callq 0x2eab0
movl %eax, -0x44(%rbp)
jmp 0x3093a
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x2e980
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
addq 0x10(%rcx), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x4f20
movw %ax, -0x3a(%rbp)
movq -0x28(%rbp), %rsi
movl -0x14(%rbp), %edx
addl $0x8, %edx
movl $0x4003333, %edi        # imm = 0x4003333
leaq 0x366ca(%rip), %rcx     # 0x67053
callq 0x5ed0
leaq 0x467eb(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x3003, %rax           # imm = 0x3003
cmpq $0x0, %rax
je 0x309e0
leaq 0x467d5(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40, %rax
cmpq $0x0, %rax
je 0x309cc
leaq 0x3abee(%rip), %rdi     # 0x6b5ad
movb $0x0, %al
callq 0x3110
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
leaq 0x3b2cc(%rip), %rdi     # 0x6bc9f
movb $0x0, %al
callq 0x3110
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
leaq 0x46799(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x30, %rax
cmpq $0x0, %rax
je 0x30a0c
movzwl -0x3a(%rbp), %esi
leaq 0x36c2d(%rip), %rdi     # 0x6762c
movb $0x0, %al
callq 0x3110
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %edi
callq 0x1ef50
movl %eax, -0x44(%rbp)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x4f20
movw %ax, -0x3c(%rbp)
movq -0x28(%rbp), %rsi
movl -0x14(%rbp), %edx
addl $0x8, %edx
movl $0x4003333, %edi        # imm = 0x4003333
leaq 0x36609(%rip), %rcx     # 0x67053
callq 0x5ed0
leaq 0x4672a(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x3003, %rax           # imm = 0x3003
cmpq $0x0, %rax
je 0x30aa1
leaq 0x46714(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40, %rax
cmpq $0x0, %rax
je 0x30a8d
leaq 0x3ab2d(%rip), %rdi     # 0x6b5ad
movb $0x0, %al
callq 0x3110
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
leaq 0x3ab28(%rip), %rdi     # 0x6b5bc
movb $0x0, %al
callq 0x3110
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
leaq 0x466d8(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x30, %rax
cmpq $0x0, %rax
je 0x30acd
movzwl -0x3c(%rbp), %esi
leaq 0x36b6c(%rip), %rdi     # 0x6762c
movb $0x0, %al
callq 0x3110
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %edi
callq 0x1ef50
movl %eax, -0x44(%rbp)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x4f20
movw %ax, -0x3e(%rbp)
movq -0x28(%rbp), %rsi
movl -0x14(%rbp), %edx
addl $0x8, %edx
movl $0x4003333, %edi        # imm = 0x4003333
leaq 0x36548(%rip), %rcx     # 0x67053
callq 0x5ed0
leaq 0x46669(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x3003, %rax           # imm = 0x3003
cmpq $0x0, %rax
je 0x30b62
leaq 0x46653(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40, %rax
cmpq $0x0, %rax
je 0x30b4e
leaq 0x3aa6c(%rip), %rdi     # 0x6b5ad
movb $0x0, %al
callq 0x3110
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
leaq 0x3aa72(%rip), %rdi     # 0x6b5c7
movb $0x0, %al
callq 0x3110
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
leaq 0x46617(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x30, %rax
cmpq $0x0, %rax
je 0x30b8e
movzwl -0x3e(%rbp), %esi
leaq 0x36aab(%rip), %rdi     # 0x6762c
movb $0x0, %al
callq 0x3110
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %edi
callq 0x1ef50
movl %eax, -0x44(%rbp)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movzwl -0x3a(%rbp), %eax
cmpl $0x1, %eax
jne 0x30cdb
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rdx
movl $0x4d4d, %esi           # imm = 0x4D4D
callq 0x4610
movw %ax, -0x40(%rbp)
movq -0x28(%rbp), %rsi
movl -0x14(%rbp), %edx
addl $0x8, %edx
movl $0x4003333, %edi        # imm = 0x4003333
leaq 0x36475(%rip), %rcx     # 0x67053
callq 0x5ed0
leaq 0x46596(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x3003, %rax           # imm = 0x3003
cmpq $0x0, %rax
je 0x30c35
leaq 0x46580(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40, %rax
cmpq $0x0, %rax
je 0x30c21
leaq 0x3a999(%rip), %rdi     # 0x6b5ad
movb $0x0, %al
callq 0x3110
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
leaq 0x3a9b6(%rip), %rdi     # 0x6b5de
movb $0x0, %al
callq 0x3110
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
leaq 0x46544(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x30, %rax
cmpq $0x0, %rax
je 0x30cbf
movzwl -0x40(%rbp), %esi
leaq 0x369d8(%rip), %rdi     # 0x6762c
xorl %eax, %eax
callq 0x3110
movl %eax, %ecx
movl -0x44(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x44(%rbp)
movzwl -0x40(%rbp), %eax
movl %eax, -0x48(%rbp)
subl $0x10, %eax
je 0x30c7d
jmp 0x30c73
movl -0x48(%rbp), %eax
subl $0x11, %eax
je 0x30c93
jmp 0x30ca9
leaq 0x3a96f(%rip), %rdi     # 0x6b5f3
movb $0x0, %al
callq 0x3110
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
jmp 0x30cbd
leaq 0x3a961(%rip), %rdi     # 0x6b5fb
movb $0x0, %al
callq 0x3110
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
jmp 0x30cbd
leaq 0x3a958(%rip), %rdi     # 0x6b608
movb $0x0, %al
callq 0x3110
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
jmp 0x30cbf
movl -0x44(%rbp), %edi
callq 0x1ef50
movl %eax, -0x44(%rbp)
movq -0x28(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x28(%rbp)
jmp 0x30d9b
movq -0x28(%rbp), %rsi
movl -0x14(%rbp), %edx
addl $0x8, %edx
movl $0x4003333, %edi        # imm = 0x4003333
leaq 0x36362(%rip), %rcx     # 0x67053
callq 0x5ed0
movq -0x20(%rbp), %rax
addq -0x30(%rbp), %rax
subq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq 0x46473(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x3003, %rax           # imm = 0x3003
cmpq $0x0, %rax
je 0x30d58
leaq 0x4645d(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40, %rax
cmpq $0x0, %rax
je 0x30d44
leaq 0x3a876(%rip), %rdi     # 0x6b5ad
movb $0x0, %al
callq 0x3110
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
leaq 0x3a8ca(%rip), %rdi     # 0x6b615
movb $0x0, %al
callq 0x3110
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
leaq 0x46421(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x30, %rax
cmpq $0x0, %rax
je 0x30d84
movq -0x38(%rbp), %rsi
leaq 0x33354(%rip), %rdi     # 0x640cb
movb $0x0, %al
callq 0x3110
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %edi
callq 0x1ef50
movl %eax, -0x44(%rbp)
movq -0x20(%rbp), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x28(%rbp)
leaq 0x463d2(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40000, %rax          # imm = 0x40000
cmpq $0x0, %rax
je 0x30df6
movl -0x44(%rbp), %edi
callq 0x1ef50
movl %eax, -0x44(%rbp)
movq -0x28(%rbp), %rsi
subq $0x1, %rsi
movl -0x14(%rbp), %edx
movl $0x40000, %edi          # imm = 0x40000
leaq 0x332fd(%rip), %rcx     # 0x640dc
callq 0x5ed0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movl $0x1, %esi
callq 0x2e830
movl -0x44(%rbp), %edi
callq 0x1ef50
movl %eax, -0x44(%rbp)
movq -0x28(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)