// File: /workspace/github_c_makefile_star2_O0/hfiguiere[P]exifprobe/jp2000.c
// Function: process_jp2_jp2i
unsigned long
process_jp2_jp2i(FILE *inptr,struct jp2box *box,int indent)
{
    unsigned long boxoffset,max_offset,dataoffset;
    unsigned long readsize;
    unsigned long boxlength,size;
    int chpr = 0;

    print_jp2box(inptr,box,indent);
    boxoffset = box->boxoffset;
    boxlength = box->boxlength;

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

    if((PRINT_SECTION))
    {
        print_tag_address(SECTION,dataoffset,indent + 8,"=");
        size = boxlength - 8;
        if((inptr && (fseek(inptr,dataoffset,SEEK_SET)) != -1))
        {
            while(size > 0ULL)
            {
                if(size > READSIZE)
                    readsize = READSIZE;
                else
                    readsize = size;
                /* Print as ascii...                                  */
                setcharsprinted(chpr);
                print_ascii(inptr,readsize,dataoffset);
                dataoffset += readsize;
                size -= readsize;
            }
        }
        chpr = newline(chpr);
        print_tag_address(SECTION,dataoffset - 1,indent,"=");
        print_jp2type(box->tbox,1);
    }
    else if((LIST_MODE))
        chpr = list_jp2box(inptr,box,"JP2.",indent,1);
    chpr = newline(chpr);
    return(max_offset);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl $0x0, -0x4c(%rbp)
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 -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
addq 0x10(%rcx), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x28(%rbp)
leaq 0x47b6b(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40000, %rax          # imm = 0x40000
cmpq $0x0, %rax
je 0x2f702
movq -0x30(%rbp), %rsi
movl -0x14(%rbp), %edx
addl $0x8, %edx
movl $0x40000, %edi          # imm = 0x40000
leaq 0x37a15(%rip), %rcx     # 0x67053
callq 0x5ed0
movq -0x40(%rbp), %rax
subq $0x8, %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x2f6c7
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
xorl %edx, %edx
callq 0x3200
cmpl $-0x1, %eax
je 0x2f6c7
jmp 0x2f66c
cmpq $0x0, -0x48(%rbp)
jbe 0x2f6c5
cmpq $0x2000, -0x48(%rbp)    # imm = 0x2000
jbe 0x2f687
movq $0x2000, -0x38(%rbp)    # imm = 0x2000
jmp 0x2f68f
movq -0x48(%rbp), %rax
movq %rax, -0x38(%rbp)
movl -0x4c(%rbp), %edi
callq 0x1ff00
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x8e70
movq -0x38(%rbp), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x38(%rbp), %rcx
movq -0x48(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x48(%rbp)
jmp 0x2f66c
jmp 0x2f6c7
movl -0x4c(%rbp), %edi
callq 0x1ef50
movl %eax, -0x4c(%rbp)
movq -0x30(%rbp), %rsi
subq $0x1, %rsi
movl -0x14(%rbp), %edx
movl $0x40000, %edi          # imm = 0x40000
leaq 0x3796a(%rip), %rcx     # 0x67053
callq 0x5ed0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movl $0x1, %esi
callq 0x2e830
jmp 0x2f73a
leaq 0x47a77(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x1040000, %rax        # imm = 0x1040000
cmpq $0x0, %rax
jne 0x2f738
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %ecx
leaq 0x3bd31(%rip), %rdx     # 0x6b45b
movl $0x1, %r8d
callq 0x2eab0
movl %eax, -0x4c(%rbp)
jmp 0x2f73a
movl -0x4c(%rbp), %edi
callq 0x1ef50
movl %eax, -0x4c(%rbp)
movq -0x28(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nop