// File: /workspace/github_c_makefile_star2_O2/hfiguiere[P]exifprobe/jp2000.c
// Function: process_jp2_res
unsigned long
process_jp2_res(FILE *inptr,struct jp2box *box,int indent)
{
    unsigned long boxoffset,max_offset,resboxoffset;
    unsigned long dataoffset,resdataoffset;
    unsigned long resboxlength = 0UL;
    unsigned long boxlength;
    unsigned long tbox;
    unsigned short vrcn = 0;
    unsigned short vrcd = 0;
    unsigned short hrcn = 0;
    unsigned short hrcd = 0;
    unsigned short vrce = 0;
    unsigned short hrce = 0;
    double vrc = 0.0;
    double hrc = 0.0;
    char *rtype;
    char id;
    int chpr = 0;

    if((LIST_MODE))
        chpr = list_jp2box(inptr,box,"JP2.jp2h.",indent,1);
    else
        print_jp2box(inptr,box,indent);

    /* Save the parent box params.                                    */
    boxoffset = box->boxoffset;
    dataoffset = boxoffset + box->dataoffset;
    boxlength = box->boxlength;
    tbox = box->tbox;
    max_offset = boxoffset + boxlength;

    /* There may be one or two sub-boxes, resc, and resd.             */
    boxlength -= box->dataoffset;

    indent += SUBINDENT;
    if(boxlength >= 14ULL)  /* sub-box must be this long              */
    {
        box = read_jp2box(inptr,dataoffset);

        if((PRINT_LONGNAMES))
            chpr = list_jp2box(inptr,box,"JP2.jp2h.res.",indent,1);
        else
            print_jp2box(inptr,box,indent + SUBINDENT);
        resboxoffset = box->boxoffset;
        resdataoffset = resboxoffset + box->dataoffset;
        resboxlength = box->boxlength;
        boxlength -= resboxlength;

        id = box->tbox & 0xff;
        vrcn = read_ushort(inptr,TIFF_MOTOROLA,resdataoffset);
        if(!(LIST_MODE))
        {
            print_tag_address(ENTRY,resdataoffset,indent + 8,"=");
            if((PRINT_TAGINFO))
                chpr += printf("vr%cn",id);
            if((PRINT_VALUE))
                chpr += printf(" = %u",vrcn);
        }
        chpr = newline(chpr);
        resdataoffset += 2;

        vrcd = read_ushort(inptr,TIFF_MOTOROLA,resdataoffset);
        if(!(LIST_MODE))
        {
            print_tag_address(ENTRY,resdataoffset,indent + 8,"=");
            if((PRINT_TAGINFO))
                chpr += printf("vr%cd",id);
            if((PRINT_VALUE))
                chpr += printf(" = %u",vrcd);
        }
        chpr = newline(chpr);
        resdataoffset += 2;

        hrcn = read_ushort(inptr,TIFF_MOTOROLA,resdataoffset);
        if(!(LIST_MODE))
        {
            print_tag_address(ENTRY,resdataoffset,indent + 8,"=");
            if((PRINT_TAGINFO))
                chpr += printf("hr%cn",id);
            if((PRINT_VALUE))
                chpr += printf(" = %u",hrcn);
        }
        chpr = newline(chpr);
        resdataoffset += 2;

        hrcd = read_ushort(inptr,TIFF_MOTOROLA,resdataoffset);
        if(!(LIST_MODE))
        {
            print_tag_address(ENTRY,resdataoffset,indent + 8,"=");
            if((PRINT_TAGINFO))
                chpr += printf("hr%cd",id);
            if((PRINT_VALUE))
                chpr += printf(" = %u",hrcd);
        }
        chpr = newline(chpr);
        resdataoffset += 2;

        vrce = read_ubyte(inptr,resdataoffset);
        if(!(LIST_MODE))
        {
            print_tag_address(ENTRY,resdataoffset,indent + 8,"=");
            if((PRINT_TAGINFO))
                chpr += printf("vr%ce",id);
            if((PRINT_VALUE))
                chpr += printf(" = %u",vrce);
        }
        resdataoffset ++;

        if(id == 'c')
            rtype = "Capture";
        else if(id == 'd')
            rtype = "Display";
        else
            rtype = "Illegitimate";

        vrc = (double)vrcn * pow(10.0,(double)vrce) / (double)vrcd ;
        if((LIST_MODE))
            print_tag_address(ENTRY,HERE,indent + 8,"*");
        if((PRINT_TAGINFO))
        {
            if((LIST_MODE))
            {
                if((PRINT_LONGNAMES))
                {
                    chpr += printf("JP2.jp2h.res.");
                    print_jp2type(box->tbox,0);
                    chpr += printf(".");
                }
                chpr += printf("Vertical%sResolution",rtype);
            }
            else
                chpr += printf(" ==> Vertical %s Resolution",rtype);
        }
        if((PRINT_VALUE))
            chpr += printf(" = %3.2f samples/meter",vrc);
        chpr = newline(chpr);

        hrce = read_ubyte(inptr,resdataoffset);
        if(!(LIST_MODE))
        {
            print_tag_address(ENTRY,resdataoffset,indent + 8,"=");
            if((PRINT_TAGINFO))
                chpr += printf("hr%ce",id);
            if((PRINT_VALUE))
                chpr += printf(" = %u",hrce);
        }
        resdataoffset ++;

        hrc = (double)hrcn * pow(10.0,(double)hrce) / (double)hrcd ;
        if((LIST_MODE))
            print_tag_address(ENTRY,HERE,indent + 8,"*");
        if((PRINT_TAGINFO))
        {
            if((LIST_MODE))
            {
                if((PRINT_LONGNAMES))
                {
                    chpr += printf("JP2.jp2h.res.");
                    print_jp2type(box->tbox,0);
                    chpr += printf(".");
                }
                chpr += printf("Horizontal%sResolution",rtype);
            }
            else
                chpr += printf(" ==> Horizontal %s resolution",rtype);
        }
        if((PRINT_VALUE))
            chpr += printf(" = %3.2f samples/meter",vrc);
        chpr = newline(chpr);
        if((PRINT_SECTION))
        {
            print_tag_address(SECTION,resdataoffset - 1,indent + SUBINDENT,"=");
            print_jp2type(box->tbox,1);
            chpr = newline(chpr);
        }
    }
    chpr = newline(chpr);
    dataoffset += resboxlength;

    /* Sometimes both sub-boxes are present; do it again.             */
    if(boxlength >= 14ULL)
    {
        box = read_jp2box(inptr,dataoffset);

        if((PRINT_LONGNAMES))
            chpr = list_jp2box(inptr,box,"JP2.jp2h.res.",indent,1);
        else
            print_jp2box(inptr,box,indent + SUBINDENT);
        resboxoffset = box->boxoffset;
        resdataoffset = resboxoffset + box->dataoffset;
        resboxlength = box->boxlength;
        boxlength -= resboxlength;

        id = box->tbox & 0xff;
        vrcn = read_ushort(inptr,TIFF_MOTOROLA,resdataoffset);
        if(!(LIST_MODE))
        {
            print_tag_address(ENTRY,resdataoffset,indent + 8,"=");
            if((PRINT_TAGINFO))
                chpr += printf("vr%cn",id);
            if((PRINT_VALUE))
                chpr += printf(" = %u",vrcn);
        }
        chpr = newline(chpr);
        resdataoffset += 2;

        vrcd = read_ushort(inptr,TIFF_MOTOROLA,resdataoffset);
        if(!(LIST_MODE))
        {
            print_tag_address(ENTRY,resdataoffset,indent + 8,"=");
            if((PRINT_TAGINFO))
                chpr += printf("vr%cd",id);
            if((PRINT_VALUE))
                chpr += printf(" = %u",vrcd);
        }
        chpr = newline(chpr);
        resdataoffset += 2;

        hrcn = read_ushort(inptr,TIFF_MOTOROLA,resdataoffset);
        if(!(LIST_MODE))
        {
            print_tag_address(ENTRY,resdataoffset,indent + 8,"=");
            if((PRINT_TAGINFO))
                chpr += printf("hr%cn",id);
            if((PRINT_VALUE))
                chpr += printf(" = %u",hrcn);
        }
        chpr = newline(chpr);
        resdataoffset += 2;

        hrcd = read_ushort(inptr,TIFF_MOTOROLA,resdataoffset);
        if(!(LIST_MODE))
        {
            print_tag_address(ENTRY,resdataoffset,indent + 8,"=");
            if((PRINT_TAGINFO))
                chpr += printf("hr%cd",id);
            if((PRINT_VALUE))
                chpr += printf(" = %u",hrcd);
        }
        chpr = newline(chpr);
        resdataoffset += 2;

        vrce = read_ubyte(inptr,resdataoffset);
        if(!(LIST_MODE))
        {
            print_tag_address(ENTRY,resdataoffset,indent + 8,"=");
            if((PRINT_TAGINFO))
                chpr += printf("vr%ce",id);
            if((PRINT_VALUE))
                chpr += printf(" = %u",vrce);
        }
        resdataoffset ++;

        if(id == 'c')
            rtype = "Capture";
        else if(id == 'd')
            rtype = "Display";
        else
            rtype = "Illegitimate";

        vrc = (double)vrcn * pow(10.0,(double)vrce) / (double)vrcd ;
        if((PRINT_TAGINFO))
        {
            if((LIST_MODE))
            {
                if((PRINT_LONGNAMES))
                {
                    chpr += printf("JP2.jp2h.res.");
                    print_jp2type(box->tbox,0);
                    chpr += printf(".");
                }
                chpr += printf("Vertical%sResolution",rtype);
            }
            else
                chpr += printf(" ==> Vertical %s Resolution",rtype);
        }
        if((PRINT_VALUE))
            chpr += printf(" = %3.2f samples/meter",vrc);
        chpr = newline(chpr);

        hrce = read_ubyte(inptr,resdataoffset);
        if(!(LIST_MODE))
        {
            print_tag_address(ENTRY,resdataoffset,indent + 8,"=");
            if((PRINT_TAGINFO))
                chpr += printf("hr%ce",id);
            if((PRINT_VALUE))
                chpr += printf(" = %u",hrce);
        }
        resdataoffset ++;

        hrc = (double)hrcn * pow(10.0,(double)hrce) / (double)hrcd ;
        if((PRINT_TAGINFO))
        {
            if((LIST_MODE))
            {
                if((PRINT_LONGNAMES))
                {
                    chpr += printf("JP2.jp2h.res.");
                    print_jp2type(box->tbox,0);
                    chpr += printf(".");
                }
                chpr += printf("Horizontal%sResolution",rtype);
            }
            else
                chpr += printf(" ==> Horizontal %s resolution",rtype);
        }
        if((PRINT_VALUE))
            chpr += printf(" = %3.2f samples/meter",vrc);
        chpr = newline(chpr);
        if((PRINT_SECTION))
        {
            print_tag_address(SECTION,resdataoffset - 1,indent + SUBINDENT,"@");
            print_jp2type(box->tbox,1);
            chpr = newline(chpr);
        }
    }
    indent -= SUBINDENT;

    if((PRINT_SECTION))
    {
        chpr = newline(chpr);
        print_tag_address(SECTION|ENTRY,max_offset - 1,indent,"=");
        print_jp2type(tbox,1);
    }
    chpr = newline(chpr);
    return(max_offset);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %edx, %r14d
movq %rsi, %rbx
movq %rdi, %r12
leaq 0x3609f(%rip), %rax     # 0x57180
movzwl 0x2(%rax), %eax
testw $0x104, %ax             # imm = 0x104
je 0x210fd
movq %r12, %rdi
movq %rbx, %rsi
movl %r14d, %edx
callq 0x1f71d
xorl %ebp, %ebp
jmp 0x21118
leaq 0x25bc1(%rip), %rdx     # 0x46cc5
pushq $0x1
popq %r8
movq %r12, %rdi
movq %rbx, %rsi
movl %r14d, %ecx
callq 0x1f7e6
movl %eax, %ebp
movq 0x18(%rbx), %rcx
movq 0x8(%rbx), %rax
movq %rax, 0x58(%rsp)
movq 0x10(%rbx), %rsi
movq 0x20(%rbx), %r13
movq %r13, 0x48(%rsp)
subq %rsi, %r13
movq %rcx, 0x60(%rsp)
addq %rcx, %rsi
leal 0x2(%r14), %r15d
cmpq $0xe, %r13
movq %r12, (%rsp)
movq %r14, 0x10(%rsp)
movq %rsi, 0x40(%rsp)
jb 0x21182
movq %r13, 0x20(%rsp)
movq %r12, %rdi
callq 0x1f508
movq %rax, %r13
leaq 0x36014(%rip), %rbx     # 0x57180
testb $0x40, (%rbx)
jne 0x21197
leal 0x4(%r14), %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x1f71d
jmp 0x211b2
movq $0x0, 0x28(%rsp)
leaq 0x35fee(%rip), %rbx     # 0x57180
jmp 0x2175f
leaq 0x25c96(%rip), %rdx     # 0x46e34
pushq $0x1
popq %r8
movq %r12, %rdi
movq %r13, %rsi
movl %r15d, %ecx
callq 0x1f7e6
movl %eax, %ebp
movq 0x10(%r13), %r14
addq 0x18(%r13), %r14
movq 0x20(%r13), %rax
movq %rax, 0x28(%rsp)
movq %r13, 0x38(%rsp)
movb 0x8(%r13), %r13b
movq %r12, %rdi
movl $0x4d4d, %esi           # imm = 0x4D4D
movq %r14, %rdx
callq 0x416a
movzwl 0x2(%rbx), %ecx
movb %r13b, 0x30(%rsp)
movsbl %r13b, %edx
movl %edx, 0xc(%rsp)
movzwl %ax, %eax
movl %eax, 0x18(%rsp)
testw $0x104, %cx             # imm = 0x104
movl %r15d, 0x54(%rsp)
je 0x2125b
movq 0x10(%rsp), %rax
leal 0xa(%rax), %edx
leaq 0x21772(%rip), %rcx     # 0x42981
movl $0x4003333, %edi        # imm = 0x4003333
movq %r14, %rsi
callq 0x5100
movq (%rbx), %rax
testw $0x3003, %ax            # imm = 0x3003
movq 0x20(%rsp), %r13
je 0x21241
leaq 0x25c11(%rip), %rdi     # 0x46e42
movl 0xc(%rsp), %esi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq (%rbx), %rax
testb $0x30, %al
je 0x21260
leaq 0x21d0e(%rip), %rdi     # 0x42f5a
movl 0x18(%rsp), %esi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
jmp 0x21260
movq 0x20(%rsp), %r13
movl %ebp, %edi
callq 0x160f7
movl %eax, %ebp
leaq 0x2(%r14), %rbx
movq %r12, %rdi
movl $0x4d4d, %esi           # imm = 0x4D4D
movq %rbx, %rdx
callq 0x416a
leaq 0x35efc(%rip), %r15     # 0x57180
movzwl 0x2(%r15), %ecx
movzwl %ax, %eax
movl %eax, 0x20(%rsp)
testw $0x104, %cx             # imm = 0x104
je 0x212eb
movq 0x10(%rsp), %rax
leal 0xa(%rax), %edx
leaq 0x216db(%rip), %rcx     # 0x42981
movl $0x4003333, %edi        # imm = 0x4003333
movq %rbx, %rsi
callq 0x5100
movq (%r15), %rax
testw $0x3003, %ax            # imm = 0x3003
je 0x212d3
leaq 0x25b85(%rip), %rdi     # 0x46e48
movl 0xc(%rsp), %esi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq (%r15), %rax
testb $0x30, %al
je 0x212eb
leaq 0x21c7c(%rip), %rdi     # 0x42f5a
movl 0x20(%rsp), %esi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movl %ebp, %edi
callq 0x160f7
movl %eax, %ebp
leaq 0x4(%r14), %r15
movq %r12, %rdi
movl $0x4d4d, %esi           # imm = 0x4D4D
movq %r15, %rdx
callq 0x416a
movl %eax, %ebx
leaq 0x35e6f(%rip), %r12     # 0x57180
movzwl 0x2(%r12), %eax
testw $0x104, %ax             # imm = 0x104
je 0x21372
movq 0x10(%rsp), %rax
leal 0xa(%rax), %edx
leaq 0x21655(%rip), %rcx     # 0x42981
movl $0x4003333, %edi        # imm = 0x4003333
movq %r15, %rsi
callq 0x5100
movq (%r12), %rax
testw $0x3003, %ax            # imm = 0x3003
je 0x2135b
leaq 0x25b04(%rip), %rdi     # 0x46e4e
movl 0xc(%rsp), %esi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq (%r12), %rax
testb $0x30, %al
je 0x21372
movzwl %bx, %esi
leaq 0x21bf1(%rip), %rdi     # 0x42f5a
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq (%rsp), %rbx
movl %ebp, %edi
callq 0x160f7
movl %eax, %ebp
leaq 0x6(%r14), %r15
movq %rbx, %rdi
movl $0x4d4d, %esi           # imm = 0x4D4D
movq %r15, %rdx
callq 0x416a
movl %eax, %ebx
leaq 0x35de4(%rip), %r12     # 0x57180
movzwl 0x2(%r12), %eax
testw $0x104, %ax             # imm = 0x104
je 0x213fd
movq 0x10(%rsp), %rax
leal 0xa(%rax), %edx
leaq 0x215ca(%rip), %rcx     # 0x42981
movl $0x4003333, %edi        # imm = 0x4003333
movq %r15, %rsi
callq 0x5100
movq (%r12), %rax
testw $0x3003, %ax            # imm = 0x3003
je 0x213e6
leaq 0x25a7f(%rip), %rdi     # 0x46e54
movl 0xc(%rsp), %esi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq (%r12), %rax
testb $0x30, %al
je 0x213fd
movzwl %bx, %esi
leaq 0x21b66(%rip), %rdi     # 0x42f5a
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq (%rsp), %rbx
movl %ebp, %edi
callq 0x160f7
movl %eax, %ebp
leaq 0x8(%r14), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x48de
leaq 0x35d60(%rip), %r12     # 0x57180
movzwl 0x2(%r12), %ecx
movzwl %ax, %ebx
testw $0x104, %cx             # imm = 0x104
je 0x21484
movq 0x10(%rsp), %rax
leal 0xa(%rax), %edx
leaq 0x21542(%rip), %rcx     # 0x42981
movl $0x4003333, %edi        # imm = 0x4003333
movq %r15, %rsi
callq 0x5100
movq (%r12), %rax
testw $0x3003, %ax            # imm = 0x3003
je 0x2146e
leaq 0x259fd(%rip), %rdi     # 0x46e5a
movl 0xc(%rsp), %esi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq (%r12), %rax
testb $0x30, %al
je 0x21484
leaq 0x21ae1(%rip), %rdi     # 0x42f5a
movl %ebx, %esi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq (%rsp), %r12
movb 0x30(%rsp), %dl
cmpb $0x64, %dl
leaq 0x2a319(%rip), %rax     # 0x4b7af
leaq 0x259cb(%rip), %rcx     # 0x46e68
cmoveq %rax, %rcx
cmpb $0x63, %dl
leaq 0x259b5(%rip), %r15     # 0x46e60
cmovneq %rcx, %r15
cvtsi2sdl 0x18(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
cvtsi2sd %ebx, %xmm1
movsd 0x25711(%rip), %xmm0    # 0x46bd8
callq 0x30e0
leaq 0x35cad(%rip), %rbx     # 0x57180
movq (%rbx), %rax
testl $0x1040000, %eax        # imm = 0x1040000
jne 0x2150a
movq 0x10(%rsp), %rax
leal 0xa(%rax), %edx
leaq 0x1e46d(%rip), %rcx     # 0x3f959
movl $0x4003333, %edi        # imm = 0x4003333
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movsd %xmm0, 0x18(%rsp)
callq 0x5100
movsd 0x18(%rsp), %xmm0
movq (%rbx), %rax
mulsd 0x30(%rsp), %xmm0
cvtsi2sdl 0x20(%rsp), %xmm1
testw $0x3003, %ax            # imm = 0x3003
je 0x2159b
testl $0x1040000, %eax        # imm = 0x1040000
movsd %xmm0, 0x18(%rsp)
movsd %xmm1, 0x20(%rsp)
je 0x21538
leaq 0x25954(%rip), %rbx     # 0x46e8a
jmp 0x21579
leaq 0x25936(%rip), %rbx     # 0x46e75
testb $0x40, %al
je 0x21579
leaq 0x258ea(%rip), %rdi     # 0x46e34
xorl %eax, %eax
callq 0x3120
movl %eax, 0x30(%rsp)
movq 0x38(%rsp), %rax
movq 0x8(%rax), %rdi
xorl %esi, %esi
callq 0x1f649
leaq 0x1e42b(%rip), %rdi     # 0x3f997
xorl %eax, %eax
callq 0x3120
addl 0x30(%rsp), %eax
addl %eax, %ebp
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
leaq 0x35bf1(%rip), %rbx     # 0x57180
movsd 0x18(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
addq $0x9, %r14
divsd %xmm1, %xmm0
testb $0x30, (%rbx)
movsd %xmm0, 0x18(%rsp)
je 0x215be
leaq 0x258f1(%rip), %rdi     # 0x46ea6
movb $0x1, %al
callq 0x3120
addl %eax, %ebp
movl %ebp, %edi
callq 0x160f7
movl %eax, %ebp
movq %r12, %rdi
movq %r14, %rsi
callq 0x48de
movzwl 0x2(%rbx), %ecx
movq %rbx, %r12
movzwl %ax, %ebx
testw $0x104, %cx             # imm = 0x104
je 0x21637
movq 0x10(%rsp), %rax
leal 0xa(%rax), %edx
leaq 0x2138f(%rip), %rcx     # 0x42981
movl $0x4003333, %edi        # imm = 0x4003333
movq %r14, %rsi
callq 0x5100
movq (%r12), %rax
testw $0x3003, %ax            # imm = 0x3003
je 0x21621
leaq 0x258ad(%rip), %rdi     # 0x46ebd
movl 0xc(%rsp), %esi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq (%r12), %rax
testb $0x30, %al
je 0x21637
leaq 0x2192e(%rip), %rdi     # 0x42f5a
movl %ebx, %esi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq (%rsp), %r12
cvtsi2sd %ebx, %xmm1
movsd 0x25591(%rip), %xmm0    # 0x46bd8
callq 0x30e0
leaq 0x35b2d(%rip), %rbx     # 0x57180
movq (%rbx), %rax
testl $0x1040000, %eax        # imm = 0x1040000
jne 0x2167e
movq 0x10(%rsp), %rax
leal 0xa(%rax), %edx
leaq 0x1e2ed(%rip), %rcx     # 0x3f959
movl $0x4003333, %edi        # imm = 0x4003333
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x5100
movq (%rbx), %rax
testw $0x3003, %ax            # imm = 0x3003
je 0x216eb
testl $0x1040000, %eax        # imm = 0x1040000
je 0x21694
leaq 0x25848(%rip), %rbx     # 0x46eda
jmp 0x216d5
leaq 0x25828(%rip), %rbx     # 0x46ec3
testb $0x40, %al
je 0x216d5
leaq 0x2578e(%rip), %rdi     # 0x46e34
xorl %eax, %eax
callq 0x3120
movl %eax, 0xc(%rsp)
movq 0x38(%rsp), %rax
movq 0x8(%rax), %rdi
xorl %esi, %esi
callq 0x1f649
leaq 0x1e2cf(%rip), %rdi     # 0x3f997
xorl %eax, %eax
callq 0x3120
addl 0xc(%rsp), %eax
addl %eax, %ebp
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
leaq 0x35a95(%rip), %rbx     # 0x57180
testb $0x30, (%rbx)
movl 0x54(%rsp), %r15d
movsd 0x18(%rsp), %xmm0
je 0x2170b
leaq 0x257a4(%rip), %rdi     # 0x46ea6
movb $0x1, %al
callq 0x3120
addl %eax, %ebp
subq 0x28(%rsp), %r13
movl %ebp, %edi
callq 0x160f7
movl %eax, %ebp
testb $0x4, 0x2(%rbx)
jne 0x21726
movq 0x10(%rsp), %r14
jmp 0x2175f
movq 0x10(%rsp), %rax
leal 0x4(%rax), %edx
leaq 0x2124c(%rip), %rcx     # 0x42981
movl $0x40000, %edi          # imm = 0x40000
movq %r14, %rsi
movq %rax, %r14
callq 0x5100
movq 0x38(%rsp), %rax
movq 0x8(%rax), %rdi
pushq $0x1
popq %rsi
callq 0x1f649
movl %ebp, %edi
callq 0x160f7
movl %eax, %ebp
movl %ebp, %edi
callq 0x160f7
movl %eax, %ebp
cmpq $0xe, %r13
jb 0x21cf1
movq 0x28(%rsp), %rsi
addq 0x40(%rsp), %rsi
movq %r12, %rdi
callq 0x1f508
movq %rax, %r13
testb $0x40, (%rbx)
jne 0x2179d
leal 0x4(%r14), %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x1f71d
jmp 0x217b8
leaq 0x25690(%rip), %rdx     # 0x46e34
pushq $0x1
popq %r8
movq %r12, %rdi
movq %r13, %rsi
movl %r15d, %ecx
callq 0x1f7e6
movl %eax, %ebp
movq 0x10(%r13), %r15
addq 0x18(%r13), %r15
movq %r13, 0x20(%rsp)
movb 0x8(%r13), %r13b
movq %r12, %rdi
movl $0x4d4d, %esi           # imm = 0x4D4D
movq %r15, %rdx
callq 0x416a
movzwl 0x2(%rbx), %ecx
movb %r13b, 0xc(%rsp)
movsbl %r13b, %edx
movl %edx, 0x28(%rsp)
movzwl %ax, %r13d
testw $0x104, %cx             # imm = 0x104
je 0x21844
leal 0xa(%r14), %edx
leaq 0x21181(%rip), %rcx     # 0x42981
movl $0x4003333, %edi        # imm = 0x4003333
movq %r15, %rsi
callq 0x5100
movq (%rbx), %rax
testw $0x3003, %ax            # imm = 0x3003
je 0x2182d
leaq 0x25625(%rip), %rdi     # 0x46e42
movl 0x28(%rsp), %esi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq (%rbx), %rax
testb $0x30, %al
je 0x21844
leaq 0x21722(%rip), %rdi     # 0x42f5a
movl %r13d, %esi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movl %ebp, %edi
callq 0x160f7
movl %eax, %ebp
leaq 0x2(%r15), %rbx
movq %r12, %rdi
movl $0x4d4d, %esi           # imm = 0x4D4D
movq %rbx, %rdx
callq 0x416a
leaq 0x35918(%rip), %r12     # 0x57180
movzwl 0x2(%r12), %ecx
movzwl %ax, %eax
movl %eax, 0x18(%rsp)
testw $0x104, %cx             # imm = 0x104
je 0x218ce
leal 0xa(%r14), %edx
leaq 0x210fa(%rip), %rcx     # 0x42981
movl $0x4003333, %edi        # imm = 0x4003333
movq %rbx, %rsi
callq 0x5100
movq (%r12), %rax
testw $0x3003, %ax            # imm = 0x3003
je 0x218b6
leaq 0x255a3(%rip), %rdi     # 0x46e48
movl 0x28(%rsp), %esi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq (%r12), %rax
testb $0x30, %al
je 0x218ce
leaq 0x21699(%rip), %rdi     # 0x42f5a
movl 0x18(%rsp), %esi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq (%rsp), %rbx
movl %ebp, %edi
callq 0x160f7
movl %eax, %ebp
leaq 0x4(%r15), %r14
movq %rbx, %rdi
movl $0x4d4d, %esi           # imm = 0x4D4D
movq %r14, %rdx
callq 0x416a
movl %eax, %ebx
leaq 0x35888(%rip), %r12     # 0x57180
movzwl 0x2(%r12), %eax
testw $0x104, %ax             # imm = 0x104
je 0x21959
movq 0x10(%rsp), %rax
leal 0xa(%rax), %edx
leaq 0x2106e(%rip), %rcx     # 0x42981
movl $0x4003333, %edi        # imm = 0x4003333
movq %r14, %rsi
callq 0x5100
movq (%r12), %rax
testw $0x3003, %ax            # imm = 0x3003
je 0x21942
leaq 0x2551d(%rip), %rdi     # 0x46e4e
movl 0x28(%rsp), %esi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq (%r12), %rax
testb $0x30, %al
je 0x21959
movzwl %bx, %esi
leaq 0x2160a(%rip), %rdi     # 0x42f5a
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq (%rsp), %rbx
movl %ebp, %edi
callq 0x160f7
movl %eax, %ebp
leaq 0x6(%r15), %r14
movq %rbx, %rdi
movl $0x4d4d, %esi           # imm = 0x4D4D
movq %r14, %rdx
callq 0x416a
movl %eax, %ebx
leaq 0x357fd(%rip), %r12     # 0x57180
movzwl 0x2(%r12), %eax
testw $0x104, %ax             # imm = 0x104
movl %r13d, 0x40(%rsp)
je 0x219e9
movq 0x10(%rsp), %rax
leal 0xa(%rax), %edx
leaq 0x20fde(%rip), %rcx     # 0x42981
movl $0x4003333, %edi        # imm = 0x4003333
movq %r14, %rsi
callq 0x5100
movq (%r12), %rax
testw $0x3003, %ax            # imm = 0x3003
je 0x219d2
leaq 0x25493(%rip), %rdi     # 0x46e54
movl 0x28(%rsp), %esi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq (%r12), %rax
testb $0x30, %al
je 0x219e9
movzwl %bx, %esi
leaq 0x2157a(%rip), %rdi     # 0x42f5a
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq (%rsp), %r14
movl %ebp, %edi
callq 0x160f7
movl %eax, %r13d
leaq 0x8(%r15), %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x48de
leaq 0x35773(%rip), %r12     # 0x57180
movzwl 0x2(%r12), %ecx
movzwl %ax, %r14d
testw $0x104, %cx             # imm = 0x104
je 0x21a7d
movq 0x10(%rsp), %rax
leal 0xa(%rax), %edx
leaq 0x20f54(%rip), %rcx     # 0x42981
movl $0x4003333, %edi        # imm = 0x4003333
movq %rbx, %rsi
callq 0x5100
movq (%r12), %rax
testw $0x3003, %ax            # imm = 0x3003
movq %r12, %rbx
je 0x21a5f
leaq 0x2540c(%rip), %rdi     # 0x46e5a
movl 0x28(%rsp), %esi
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movq (%rbx), %rax
testb $0x30, %al
movq (%rsp), %r12
je 0x21a84
leaq 0x214ec(%rip), %rdi     # 0x42f5a
movl %r14d, %esi
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
jmp 0x21a84
movq %r12, %rbx
movq (%rsp), %r12
movb 0xc(%rsp), %dl
cmpb $0x64, %dl
leaq 0x29d1d(%rip), %rax     # 0x4b7af
leaq 0x253cf(%rip), %rcx     # 0x46e68
cmoveq %rax, %rcx
cmpb $0x63, %dl
leaq 0x253b9(%rip), %rbp     # 0x46e60
cmovneq %rcx, %rbp
cvtsi2sdl 0x40(%rsp), %xmm0
movsd %xmm0, (%rsp)
cvtsi2sd %r14d, %xmm1
movsd 0x25115(%rip), %xmm0    # 0x46bd8
callq 0x30e0
mulsd (%rsp), %xmm0
cvtsi2sdl 0x18(%rsp), %xmm1
movq (%rbx), %rax
testw $0x3003, %ax            # imm = 0x3003
je 0x21afc
testl $0x1040000, %eax        # imm = 0x1040000
movq 0x10(%rsp), %r14
movsd %xmm0, (%rsp)
movsd %xmm1, 0x18(%rsp)
je 0x21b03
leaq 0x25390(%rip), %rbx     # 0x46e8a
jmp 0x21b48
movq 0x10(%rsp), %r14
jmp 0x21b6a
leaq 0x2536b(%rip), %rbx     # 0x46e75
testb $0x40, %al
je 0x21b48
leaq 0x2531f(%rip), %rdi     # 0x46e34
xorl %eax, %eax
callq 0x3120
movl %eax, %r14d
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rdi
xorl %esi, %esi
callq 0x1f649
leaq 0x1de61(%rip), %rdi     # 0x3f997
xorl %eax, %eax
callq 0x3120
addl %r14d, %eax
movq 0x10(%rsp), %r14
addl %eax, %r13d
movq %rbx, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
leaq 0x35621(%rip), %rbx     # 0x57180
movsd (%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
addq $0x9, %r15
divsd %xmm1, %xmm0
testb $0x30, (%rbx)
movsd %xmm0, (%rsp)
je 0x21b8d
leaq 0x25323(%rip), %rdi     # 0x46ea6
movb $0x1, %al
callq 0x3120
addl %eax, %r13d
movl %r13d, %edi
callq 0x160f7
movl %eax, %r13d
movq %r12, %rdi
movq %r15, %rsi
callq 0x48de
movzwl 0x2(%rbx), %ecx
movq %rbx, %r12
movzwl %ax, %ebx
testw $0x104, %cx             # imm = 0x104
je 0x21c06
leal 0xa(%r14), %edx
leaq 0x20dc2(%rip), %rcx     # 0x42981
movl $0x4003333, %edi        # imm = 0x4003333
movq %r15, %rsi
callq 0x5100
movq (%r12), %rax
testw $0x3003, %ax            # imm = 0x3003
je 0x21bef
leaq 0x252e0(%rip), %rdi     # 0x46ebd
movl 0x28(%rsp), %esi
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movq (%r12), %rax
testb $0x30, %al
je 0x21c06
leaq 0x21360(%rip), %rdi     # 0x42f5a
movl %ebx, %esi
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
cvtsi2sd %ebx, %xmm1
movsd 0x24fc6(%rip), %xmm0    # 0x46bd8
callq 0x30e0
leaq 0x35562(%rip), %rbx     # 0x57180
movq (%rbx), %rax
testw $0x3003, %ax            # imm = 0x3003
je 0x21c94
testl $0x1040000, %eax        # imm = 0x1040000
je 0x21c37
leaq 0x252a5(%rip), %rbx     # 0x46eda
jmp 0x21c7d
leaq 0x25285(%rip), %rbx     # 0x46ec3
testb $0x40, %al
je 0x21c7d
leaq 0x251eb(%rip), %rdi     # 0x46e34
xorl %eax, %eax
callq 0x3120
movq %r14, %r12
movl %eax, %r14d
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rdi
xorl %esi, %esi
callq 0x1f649
leaq 0x1dd2a(%rip), %rdi     # 0x3f997
xorl %eax, %eax
callq 0x3120
addl %r14d, %eax
movq %r12, %r14
addl %eax, %r13d
movq %rbx, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
leaq 0x354ec(%rip), %rbx     # 0x57180
movsd (%rsp), %xmm0
testb $0x30, (%rbx)
je 0x21caf
leaq 0x25201(%rip), %rdi     # 0x46ea6
movb $0x1, %al
callq 0x3120
addl %eax, %r13d
movl %r13d, %edi
callq 0x160f7
movl %eax, %ebp
testb $0x4, 0x2(%rbx)
je 0x21cf1
leal 0x4(%r14), %edx
leaq 0x1d412(%rip), %rcx     # 0x3f0dc
movl $0x40000, %edi          # imm = 0x40000
movq %r15, %rsi
callq 0x5100
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rdi
pushq $0x1
popq %rsi
callq 0x1f649
movl %ebp, %edi
callq 0x160f7
movl %eax, %ebp
movq 0x48(%rsp), %r15
addq 0x60(%rsp), %r15
testb $0x4, 0x2(%rbx)
je 0x21d2f
movl %ebp, %edi
callq 0x160f7
movl %eax, %ebp
leaq -0x1(%r15), %rsi
leaq 0x20c6c(%rip), %rcx     # 0x42981
movl $0x4043333, %edi        # imm = 0x4043333
movl %r14d, %edx
callq 0x5100
pushq $0x1
popq %rsi
movq 0x58(%rsp), %rdi
callq 0x1f649
movl %ebp, %edi
callq 0x160f7
movq %r15, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq