// File: /workspace/github_c_makefile_star2_O2/hfiguiere[P]exifprobe/jp2000.c
// Function: process_jp2_ulst
unsigned long
process_jp2_ulst(FILE *inptr,struct jp2box *box,int indent)
{
    unsigned long boxoffset,max_offset,dataoffset,tbox;
    unsigned long boxlength;
    unsigned short nuuid,byte;
    int chpr = 0;
    int i,j;

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

    dataoffset = boxoffset + box->dataoffset;
    max_offset = boxoffset + boxlength;

    nuuid = read_ushort(inptr,TIFF_MOTOROLA,dataoffset);
    print_tag_address(ENTRY,dataoffset,indent + 8,"=");
    if((PRINT_TAGINFO))
    {
        if((PRINT_LONGNAMES))
            chpr += printf("JP2.uinf.ulst.");
        chpr += printf("NumberOfUuids");
    }
    if((PRINT_VALUE))
        chpr += printf(" = %u",nuuid);
    chpr = newline(chpr);
    dataoffset += 2;

    /* Print the uuid list, in hex                                */
    for(i = 0; i < nuuid; ++i)
    {
        print_tag_address(SECTION|ENTRY,dataoffset,indent + 4,"*");
        if((PRINT_TAGINFO))
        {
            if((PRINT_LONGNAMES))
                chpr += printf("JP2.uinf.ulst.");
            chpr += printf("ID%d = ",i);
        }
        if((PRINT_VALUE))
            chpr += printf(" = ");
        if(!feof(inptr) && !ferror(inptr))
        {
            for(j = 0; j < 16; ++i)
            {
                byte = read_ubyte(inptr,dataoffset++);
                if(feof(inptr) || ferror(inptr))
                    break;
                if((PRINT_VALUE))
                    chpr += printf(",%02x",(unsigned int)byte & 0xff);
            }
        }
        else
            break;
        chpr = newline(chpr);
    }
    if((PRINT_SECTION))
    {
        chpr = newline(chpr);
        print_tag_address(SECTION,dataoffset - 1,indent,"@");
        print_jp2type(box->tbox,1);
    }
    chpr = newline(chpr);
    return(max_offset);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r12
leaq 0x3541b(%rip), %rbx     # 0x57180
movzwl 0x2(%rbx), %eax
testw $0x104, %ax             # imm = 0x104
je 0x21d81
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x1f71d
xorl %r14d, %r14d
jmp 0x21d9c
leaq 0x24fe1(%rip), %rdx     # 0x46d69
pushq $0x1
popq %r8
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %ecx
callq 0x1f7e6
movl %eax, %r14d
movq 0x18(%r15), %rcx
movq 0x20(%r15), %rax
movq %rax, 0x10(%rsp)
movq %r15, 0x20(%rsp)
movq 0x10(%r15), %r13
movq %rcx, 0x8(%rsp)
addq %rcx, %r13
movq %r12, %rdi
movl $0x4d4d, %esi           # imm = 0x4D4D
movq %r13, %rdx
callq 0x416a
movl %eax, %r15d
movq %rbp, 0x18(%rsp)
leal 0x8(%rbp), %edx
leaq 0x20ba5(%rip), %rcx     # 0x42981
movl $0x4003333, %edi        # imm = 0x4003333
movq %r13, %rsi
callq 0x5100
movq (%rbx), %rax
testw $0x3003, %ax            # imm = 0x3003
je 0x21e1b
testb $0x40, %al
je 0x21e07
leaq 0x24f76(%rip), %rdi     # 0x46d73
xorl %eax, %eax
callq 0x3120
addl %eax, %r14d
leaq 0x24f74(%rip), %rdi     # 0x46d82
xorl %eax, %eax
callq 0x3120
addl %eax, %r14d
movq (%rbx), %rax
movzwl %r15w, %esi
testb $0x30, %al
movl %esi, 0x4(%rsp)
je 0x21e38
leaq 0x2112c(%rip), %rdi     # 0x42f5a
xorl %eax, %eax
callq 0x3120
addl %eax, %r14d
movl %r14d, %edi
callq 0x160f7
movl %eax, %ebp
addq $0x2, %r13
movq 0x18(%rsp), %rax
addl $0x4, %eax
movl %eax, (%rsp)
xorl %r15d, %r15d
cmpl 0x4(%rsp), %r15d
jge 0x21f30
movl $0x4043333, %edi        # imm = 0x4043333
movq %r13, %rsi
movl (%rsp), %edx
leaq 0x1dae8(%rip), %rcx     # 0x3f959
callq 0x5100
movq (%rbx), %rax
testw $0x3003, %ax            # imm = 0x3003
je 0x21ea9
testb $0x40, %al
je 0x21e93
leaq 0x24ee9(%rip), %rdi     # 0x46d73
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
leaq 0x24ef6(%rip), %rdi     # 0x46d90
movl %r15d, %esi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq (%rbx), %rax
testb $0x30, %al
je 0x21ebd
leaq 0x266a4(%rip), %rdi     # 0x48558
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq %r12, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x21f30
movq %r12, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x21f30
incl %r15d
movq %r12, %rdi
movq %r13, %rsi
callq 0x48de
movl %eax, %r14d
movq %r12, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x21f1f
movq %r12, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x21f1f
testb $0x30, (%rbx)
je 0x21f17
movzbl %r14b, %esi
leaq 0x1d837(%rip), %rdi     # 0x3f745
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
incl %r15d
incq %r13
jmp 0x21ed8
movl %ebp, %edi
callq 0x160f7
movl %eax, %ebp
incq %r13
jmp 0x21e54
testb $0x4, 0x2(%rbx)
je 0x21f6c
movl %ebp, %edi
callq 0x160f7
movl %eax, %ebp
decq %r13
leaq 0x1d193(%rip), %rcx     # 0x3f0dc
movl $0x40000, %edi          # imm = 0x40000
movq %r13, %rsi
movq 0x18(%rsp), %rdx
callq 0x5100
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rdi
pushq $0x1
popq %rsi
callq 0x1f649
movq 0x10(%rsp), %rbx
movq 0x8(%rsp), %rax
addq %rax, %rbx
movl %ebp, %edi
callq 0x160f7
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq