// File: /workspace/github_c_makefile_star2_O3/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, %r13
movq %rdi, %r12
leaq 0x35052(%rip), %rax     # 0x58180
movzwl 0x2(%rax), %eax
testl $0x104, %eax            # imm = 0x104
je 0x2314a
movq %r12, %rdi
movq %r13, %rsi
movl %ebp, %edx
callq 0x209e0
xorl %ebx, %ebx
jmp 0x23166
leaq 0x25c68(%rip), %rdx     # 0x48db9
movq %r12, %rdi
movq %r13, %rsi
movl %ebp, %ecx
movl $0x1, %r8d
callq 0x20aa9
movl %eax, %ebx
movq 0x18(%r13), %rcx
movq 0x20(%r13), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%r13), %r14
movq %rcx, 0x8(%rsp)
addq %rcx, %r14
movq %r12, %rdi
movl $0x4d4d, %esi           # imm = 0x4D4D
movq %r14, %rdx
callq 0x45af
movl %eax, %r15d
leal 0x8(%rbp), %edx
leaq 0x21829(%rip), %rcx     # 0x449c5
movl $0x4003333, %edi        # imm = 0x4003333
movq %r14, %rsi
callq 0x55eb
leaq 0x34fd0(%rip), %rax     # 0x58180
movq (%rax), %rax
testl $0x3003, %eax           # imm = 0x3003
je 0x231e8
testb $0x40, %al
je 0x231ce
leaq 0x25bfe(%rip), %rdi     # 0x48dc3
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
leaq 0x25bfd(%rip), %rdi     # 0x48dd2
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
leaq 0x34f9b(%rip), %rax     # 0x58180
movq (%rax), %rax
movzwl %r15w, %esi
testb $0x30, %al
movq %r13, 0x20(%rsp)
movq %rbp, 0x18(%rsp)
movl %esi, (%rsp)
je 0x2320d
leaq 0x21d9a(%rip), %rdi     # 0x44f9e
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
movl %ebx, %edi
callq 0x1707a
movl %eax, %ebp
addq $0x2, %r14
testw %r15w, %r15w
je 0x23349
movq 0x18(%rsp), %rax
addl $0x4, %eax
movl %eax, 0x4(%rsp)
xorl %r15d, %r15d
movl $0x4043333, %edi        # imm = 0x4043333
movq %r14, %rsi
movl 0x4(%rsp), %edx
leaq 0x1e713(%rip), %rcx     # 0x41959
callq 0x55eb
leaq 0x34f2e(%rip), %rax     # 0x58180
movq (%rax), %rax
testl $0x3003, %eax           # imm = 0x3003
je 0x2328d
testb $0x40, %al
je 0x23270
leaq 0x25b5c(%rip), %rdi     # 0x48dc3
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
leaq 0x25b69(%rip), %rdi     # 0x48de0
movl %r15d, %esi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
leaq 0x34ef6(%rip), %rax     # 0x58180
movq (%rax), %rax
testb $0x30, %al
je 0x232a1
leaq 0x27310(%rip), %rdi     # 0x4a5a8
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq %r12, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x23349
movq %r12, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x23349
leaq 0x1(%r14), %r13
movq %r12, %rdi
movq %r14, %rsi
callq 0x4d48
movl %eax, %ebx
movq %r12, %rdi
callq 0x31a0
testl %eax, %eax
je 0x232f9
movq %r13, %r14
movl %ebp, %edi
callq 0x1707a
movl %eax, %ebp
incl %r15d
cmpl (%rsp), %r15d
jl 0x23233
jmp 0x23349
movq %r12, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x232de
leaq 0x34e74(%rip), %rax     # 0x58180
testb $0x30, (%rax)
je 0x23324
movzbl %bl, %esi
leaq 0x1e42a(%rip), %rdi     # 0x41745
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
incl %r15d
leaq 0x1(%r13), %r14
movq %r12, %rdi
movq %r13, %rsi
callq 0x4d48
movl %eax, %ebx
movq %r12, %rdi
callq 0x31a0
movq %r14, %r13
testl %eax, %eax
je 0x232f9
jmp 0x232e1
leaq 0x34e30(%rip), %rax     # 0x58180
testb $0x4, 0x2(%rax)
je 0x2338e
movl %ebp, %edi
callq 0x1707a
movl %eax, %ebp
decq %r14
leaq 0x1dd73(%rip), %rcx     # 0x410dc
movl $0x40000, %edi          # imm = 0x40000
movq %r14, %rsi
movq 0x18(%rsp), %rdx
callq 0x55eb
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rdi
movl $0x1, %esi
callq 0x208ff
movq 0x10(%rsp), %rbx
movq 0x8(%rsp), %rax
addq %rax, %rbx
movl %ebp, %edi
callq 0x1707a
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq