// File: /workspace/github_c_makefile_star2_O1/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 0x356b1(%rip), %rax     # 0x58180
movzwl 0x2(%rax), %eax
testl $0x104, %eax            # imm = 0x104
je 0x22aeb
movq %r12, %rdi
movq %r13, %rsi
movl %ebp, %edx
callq 0x2041a
xorl %ebx, %ebx
jmp 0x22b07
leaq 0x26287(%rip), %rdx     # 0x48d79
movq %r12, %rdi
movq %r13, %rsi
movl %ebp, %ecx
movl $0x1, %r8d
callq 0x204e6
movl %eax, %ebx
movq 0x18(%r13), %rcx
movq 0x20(%r13), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%r13), %r15
movq %rcx, 0x8(%rsp)
addq %rcx, %r15
movq %r12, %rdi
movl $0x4d4d, %esi           # imm = 0x4D4D
movq %r15, %rdx
callq 0x4574
movl %eax, %r14d
leal 0x8(%rbp), %edx
leaq 0x21e44(%rip), %rcx     # 0x44981
movl $0x4003333, %edi        # imm = 0x4003333
movq %r15, %rsi
callq 0x5605
leaq 0x3562f(%rip), %rax     # 0x58180
movq (%rax), %rax
testl $0x3003, %eax           # imm = 0x3003
je 0x22b7f
testb $0x40, %al
je 0x22b6f
leaq 0x2621d(%rip), %rdi     # 0x48d83
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
leaq 0x2621c(%rip), %rdi     # 0x48d92
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
leaq 0x355fa(%rip), %rax     # 0x58180
testb $0x30, (%rax)
movzwl %r14w, %esi
movq %r13, 0x20(%rsp)
movq %rbp, 0x18(%rsp)
movl %esi, (%rsp)
je 0x22bac
leaq 0x223b7(%rip), %rdi     # 0x44f5a
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
movl %ebx, %edi
callq 0x16b56
movl %eax, %ebp
addq $0x2, %r15
testw %r14w, %r14w
je 0x22ce6
movq 0x18(%rsp), %rax
addl $0x4, %eax
movl %eax, 0x4(%rsp)
xorl %r14d, %r14d
movl $0x4043333, %edi        # imm = 0x4043333
movq %r15, %rsi
movl 0x4(%rsp), %edx
leaq 0x1ed74(%rip), %rcx     # 0x41959
callq 0x5605
leaq 0x3558f(%rip), %rax     # 0x58180
movq (%rax), %rax
testl $0x3003, %eax           # imm = 0x3003
je 0x22c22
testb $0x40, %al
je 0x22c0f
leaq 0x2617d(%rip), %rdi     # 0x48d83
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
leaq 0x2618a(%rip), %rdi     # 0x48da0
movl %r14d, %esi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
leaq 0x35557(%rip), %rax     # 0x58180
testb $0x30, (%rax)
je 0x22c3e
leaq 0x27933(%rip), %rdi     # 0x4a568
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq %r12, %rdi
callq 0x31a0
testl %eax, %eax
jne 0x22ce6
movq %r12, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x22ce6
leaq 0x1(%r15), %r13
movq %r12, %rdi
movq %r15, %rsi
callq 0x4d44
movl %eax, %ebx
movq %r12, %rdi
callq 0x31a0
testl %eax, %eax
je 0x22c96
movq %r13, %r15
movl %ebp, %edi
callq 0x16b56
movl %eax, %ebp
incl %r14d
cmpl (%rsp), %r14d
jl 0x22bd2
jmp 0x22ce6
movq %r12, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x22c7b
leaq 0x354d7(%rip), %rax     # 0x58180
testb $0x30, (%rax)
je 0x22cc1
movzbl %bl, %esi
leaq 0x1ea8d(%rip), %rdi     # 0x41745
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
incl %r14d
leaq 0x1(%r13), %r15
movq %r12, %rdi
movq %r13, %rsi
callq 0x4d44
movl %eax, %ebx
movq %r12, %rdi
callq 0x31a0
movq %r15, %r13
testl %eax, %eax
je 0x22c96
jmp 0x22c7e
leaq 0x35493(%rip), %rax     # 0x58180
testb $0x4, 0x2(%rax)
je 0x22d2b
movl %ebp, %edi
callq 0x16b56
movl %eax, %ebp
decq %r15
leaq 0x1e3d6(%rip), %rcx     # 0x410dc
movl $0x40000, %edi          # imm = 0x40000
movq %r15, %rsi
movq 0x18(%rsp), %rdx
callq 0x5605
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rdi
movl $0x1, %esi
callq 0x2033b
movq 0x10(%rsp), %rbx
movq 0x8(%rsp), %rax
addq %rax, %rbx
movl %ebp, %edi
callq 0x16b56
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq