// File: /workspace/github_c_makefile_star2_O3/salextpuru[P]speccy-toochain/src/mhmt/mhmt-emit.c
// Function: emit_hrust
ULONG emit_hrust(struct optchain * optch, ULONG actual_len)
{
    ULONG position;
    LONG length;
    LONG disp;
    LONG max_disp; // maximum encountered displacement
    ULONG varbits,varlen;
    ULONG success = 1;
    UBYTE wrlen[2];
    ULONG expbitlen = 2; // expandable match: bitlength of displacement
    max_disp = 0;

    // some checks
    if( !optch ) {
        printf("mhmt-emit.c:emit_hrust() - NULL passed!\n");
        return 0;
    }

    // initialize
    success = success && emit_file(NULL, EMIT_FILE_INIT);
    success = success && emit_byte(0, EMIT_BYTE_INIT);
    success = success && emit_bits(0, EMIT_BITS_INIT);

    // manage zx header info
    if( wrk.zxheader ) {
        success = success && emit_file( (UBYTE*)"HR", 2);
        wrlen[0] = wrk.inlen&0x00FF;
        wrlen[1] = (wrk.inlen>>8)&0x00FF;
        success = success && emit_file( wrlen, 2); // unpacked length mod 65536
        success = success && emit_file( wrlen, 2); // packed length - !to be filled later!
        success = success && emit_file( &wrk.indata[wrk.inlen-6], 6); // last bytes
    }

    // schedule first byte to be placed just after first bitstream word
    success = success && emit_byte( wrk.indata[0], EMIT_BYTE_ADD);
    // go emitting codes
    position = 1;

    while( (position<actual_len) && success ) {
#ifdef DBG
        printf("%04x:",position);
#endif
        length = optch[position].code.length;
        disp   = optch[position].code.disp;

        if( length==0 ) {
            printf("mhmt-emit.c:emit_hrust() - encountered stop-code in optimal chain before emitting all data!\n");
            return 0;

        } else if( disp==0 ) { // copy-bytes
            if( length==1 ) { // 1 byte: %1<byte>
                success = success && emit_bits( 0x80000000, 1 );
                success = success && emit_byte( wrk.indata[position], EMIT_BYTE_ADD );

            } else if( (12<=length) && (length<=42) && ( !(length&1) ) ) { // %0110001abcd<byte,byte,...>
                varbits = (length-12)<<27;
                success = success && emit_bits( 0x62000000, 7 );
                success = success && emit_bits( varbits, 4 );
                varlen = 0;

                while( success && (varlen<(ULONG)length) ) {
                    success = success && emit_byte( wrk.indata[position+varlen], EMIT_BYTE_ADD );
                    varlen++;
                }

            } else
                goto INVALID_CODE_HRUST;

        } else if( length==(-3) ) { // insertion code
            if( (-16)<=disp && disp<=(-1) ) { // %011001abcd<byte>
                success = success && emit_bits( 0x64000000, 6 );
                success = success && emit_bits( disp<<(32-4), 4 );

            } else if( (-79)<=disp && disp<(-16) ) {
                if( disp&1 ) { // ffb1..ffef: %01001<byte><byte>
                    success = success && emit_bits( 0x48000000, 5 );
                    varbits = disp&0x00FF;
                    varbits += 15;
                    varbits ^= 3;
                    varbits = ( (varbits>>1)&0x007F ) | ( (varbits<<7)&0x0080 );
                    success = success && emit_byte( (UBYTE)(varbits&0x00FF), EMIT_BYTE_ADD );

                } else { // ffb2..ffee: %00110<byte><byte>
                    success = success && emit_bits( 0x30000000, 5 );
                    varbits = disp&0x00FF;
                    varbits += 15;
                    varbits ^= 2;
                    varbits = ( (varbits>>1)&0x007F ) | ( (varbits<<7)&0x0080 );
                    success = success && emit_byte( (UBYTE)(varbits&0x00FF), EMIT_BYTE_ADD );
                }

            } else
                goto INVALID_CODE_HRUST;

            success = success && emit_byte( wrk.indata[position+1], EMIT_BYTE_ADD );

        } else if( length==1 ) { // %000abc
            if( (-8)<=disp && disp<=(-1) ) {
                success = success && emit_bits( 0x00000000, 3 );
                success = success && emit_bits( disp<<(32-3), 3 );

            } else
                goto INVALID_CODE_HRUST;

        } else if( length==2 ) {
            if( (-32)<=disp && disp<=(-1) ) { // %00111abcde
                success = success && emit_bits( 0x38000000, 5 );
                success = success && emit_bits( disp<<(32-5), 5 );

            } else if( (-256)<=disp && disp<(-32) ) { // %00110<byte>
                success = success && emit_bits( 0x30000000, 5 );
                success = success && emit_byte( (UBYTE)(0x00FF & disp), EMIT_BYTE_ADD );

            } else if( (-512)<=disp && disp<(-256) ) { // %00101<byte>
                success = success && emit_bits( 0x28000000, 5 );
                success = success && emit_byte( (UBYTE)(0x00FF & disp), EMIT_BYTE_ADD );

            } else if( (-768)<=disp && disp<(-512) ) { // %00100<byte>
                success = success && emit_bits( 0x20000000, 5 );
                success = success && emit_byte( (UBYTE)(0x00FF & disp), EMIT_BYTE_ADD );

            } else
                goto INVALID_CODE_HRUST;

        } else if (3<=length && length<=3839 && (-65536)<=disp && disp<=(-1) ) {
            // first see if we need emitting expansion codes
            //  -513.. -1024  (FDFF..FC00) - 2 bits
            //  -1025..-2048  (FBFF..F800) - 3
            //  -2049..-4096  (F7FF..F000) - 4
            //  -4097..-8192  (EFFF..E000) - 5
            //  -8193..-16384 (DFFF..C000) - 6
            // -16385..-32768 (BFFF..8000) - 7
            // -32769..-65536 (7FFF..0000) - 8
            if( disp<(-512) ) {
                varbits = 1024;
                varlen  = 2;

                while( (ULONG)(-disp) > varbits ) {
                    varbits <<= 1;
                    varlen++;
                }

                // emit expansion codes, if necessary: %00110<FE>
                while( varlen>expbitlen ) {
                    success = success && emit_bits( 0x30000000, 5 );
                    success = success && emit_byte( 0x00FE, EMIT_BYTE_ADD );
#ifdef DBG
                    printf("expansion\n");
#endif
                    expbitlen++;
                }
            }

            // emit length
            if( length<=15 ) { // 3..15
                success = success && emit_bits( 0, 1 );

                if( length==3 ) {
                    success = success && emit_bits( 0x80000000, 2 ); // %010

                } else {
                    varlen  = length/3;
                    varbits = length%3;
                    success = success && emit_bits( 0xFFFFFFFF, varlen<<1 );

                    if( length!=15 )
                        success = success && emit_bits( varbits<<(32-2), 2 );
                }

            } else if( length<=127 ) { // 16..127: %0110000abcdefg
                success = success && emit_bits( 0x60000000, 7 );
                success = success && emit_bits( length<<(32-7), 7 );

            } else { // 128..3839
                success = success && emit_bits( 0x60000000, 7 );
                success = success && emit_bits( length<<(32-15), 7 );
                success = success && emit_byte( (UBYTE)(length&0x00FF), EMIT_BYTE_ADD );
            }

            // emit displacement
            if( (-32)<=disp ) { // ffe0..ffff: %10abcde
                success = success && emit_bits( 0x80000000, 2 );
                success = success && emit_bits( disp<<(32-5), 5 );

            } else if( (-256)<=disp ) { // ff00..ffdf: %01<byte>
                success = success && emit_bits( 0x40000000, 2 );
                success = success && emit_byte( (UBYTE)(disp&0x00FF), EMIT_BYTE_ADD );

            } else if( (-512)<=disp ) { // fe00..feff: %00<byte>
                success = success && emit_bits( 0x00000000, 2 );
                success = success && emit_byte( (UBYTE)(disp&0x00FF), EMIT_BYTE_ADD );

            } else { // variable code length: [-65536..-512)
                // displacement itself: %11ab[cdefgh]<byte>
                success = success && emit_bits( 0xC0000000, 2 );
                success = success && emit_bits( disp<<(24-expbitlen), expbitlen );
                success = success && emit_byte( (UBYTE)(disp&0x00FF), EMIT_BYTE_ADD );
            }

        } else {
INVALID_CODE_HRUST:
            printf("mhmt-emit.c:emit_hrust() - invalid code: length=%d, displacement=%d\n",length,disp);
            return 0;
        }

#ifdef DBG

        if( length==(-3) ) {
            printf("insert-match.len=%d,disp=%d\n",(-length),disp);

        } else if( disp==0 ) {
            printf("copy.len=%d\n",length);

        } else {
            printf("match.len=%d,disp=%d\n",length,disp);
        }

#endif

        if( max_disp > disp ) max_disp = disp;

        if( length>0 ) // account for negative length
            position += length;

        else
            position -= length;
    }

    // stop-code: %0110_0000_0011_11
    success = success && emit_bits( 0x603C0000, 14 );
    success = success && emit_bits( 0, EMIT_BITS_FINISH ); // this also flushes emit_byte()
    success = success && emit_file( NULL, EMIT_FILE_FINISH );

    if( success ) {
        printf("Maximum displacement actually used is %d.\n",-max_disp);
        // TODO: patch packed length in file, if zx header
    }

    return success;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
testq %rdi, %rdi
je 0x1edb
movl %esi, %r12d
movq %rdi, %rbp
xorl %eax, %eax
movl %eax, 0x93e7(%rip)      # 0xb200
movl %eax, 0x94f1(%rip)      # 0xb310
movl %eax, 0x94ef(%rip)      # 0xb314
movl %eax, 0x94ed(%rip)      # 0xb318
movl %eax, 0x94eb(%rip)      # 0xb31c
leaq 0x94e8(%rip), %rbx      # 0xb320
movl $0x0, %ecx
cmpl %eax, 0xc(%rbx)
je 0x1eb1
leaq 0x4273(%rip), %rdi      # 0x60bc
movl $0x2, %esi
callq 0x15f2
xorl %r14d, %r14d
movzwl 0x48(%rbx), %ecx
movw %cx, 0x1e(%rsp)
testl %eax, %eax
je 0x1eea
leaq 0x1e(%rsp), %rdi
movl $0x2, %esi
callq 0x15f2
testl %eax, %eax
je 0x1eea
leaq 0x1e(%rsp), %rdi
movl $0x2, %esi
callq 0x15f2
testl %eax, %eax
je 0x1eea
movl 0x48(%rbx), %edi
addl $-0x6, %edi
addq 0x40(%rbx), %rdi
movl $0x6, %esi
callq 0x15f2
testl %eax, %eax
je 0x1eea
movl 0x9465(%rip), %ecx      # 0xb310
movl 0x9463(%rip), %eax      # 0xb314
movq 0x40(%rbx), %rdx
movb (%rdx), %dl
movl %ecx, %esi
leaq 0x9350(%rip), %rdi      # 0xb210
movb %dl, (%rsi,%rdi)
incl %ecx
movzbl %cl, %ecx
movl %ecx, 0x9442(%rip)      # 0xb310
cmpl %eax, %ecx
jne 0x1efc
leaq 0x4315(%rip), %rdi      # 0x61ee
jmp 0x1ee2
leaq 0x4425(%rip), %rdi      # 0x6307
callq 0x1120
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r14d, %r14d
movl $0x0, %r15d
cmpl $0x2, %r12d
jb 0x266a
movl $0x1, %eax
movl $0x2, %ebx
xorl %r15d, %r15d
movq %rbp, 0x20(%rsp)
movl %eax, %r10d
movq %r10, %rax
shlq $0x4, %rax
movl (%rbp,%rax), %r13d
testq %r13, %r13
je 0x264f
movl 0x4(%rbp,%rax), %edx
testl %edx, %edx
movq %r10, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
je 0x1fc5
cmpq $0x2, %r13
je 0x2109
cmpl $0x1, %r13d
je 0x20d1
cmpl $-0x3, %r13d
jne 0x2121
cmpl $-0x10, %edx
jb 0x2218
movl $0x64000000, %edi       # imm = 0x64000000
movl $0x6, %esi
callq 0x180b
xorl %r14d, %r14d
testl %eax, %eax
je 0x257d
movq 0x8(%rsp), %rax
movl %eax, %edi
shll $0x1c, %edi
movl $0x4, %esi
callq 0x180b
testl %eax, %eax
je 0x257d
movl 0x9362(%rip), %eax      # 0xb310
movl 0x9360(%rip), %ecx      # 0xb314
leaq 0x9255(%rip), %rdi      # 0xb210
movq 0x10(%rsp), %r10
jmp 0x22f4
cmpl $0x1, %r13d
jne 0x2026
movl $0x80000000, %edi       # imm = 0x80000000
movl $0x1, %esi
callq 0x180b
xorl %r14d, %r14d
testl %eax, %eax
je 0x257d
leaq 0x9334(%rip), %rax      # 0xb320
movq 0x40(%rax), %rax
movq 0x10(%rsp), %r10
movb (%rax,%r10), %al
movl 0x9311(%rip), %ecx      # 0xb310
leaq 0x920a(%rip), %rdx      # 0xb210
movb %al, (%rcx,%rdx)
leal 0x1(%rcx), %eax
movzbl %al, %eax
movl %eax, 0x92fb(%rip)      # 0xb310
cmpl 0x92f9(%rip), %eax      # 0xb314
jne 0x20c6
jmp 0x2341
leal -0xc(%r13), %eax
cmpl $0x1e, %eax
ja 0x26c8
movl %r13d, %eax
andl $0x1, %eax
jne 0x26c8
movl $0x62000000, %edi       # imm = 0x62000000
movl $0x7, %esi
callq 0x180b
xorl %r14d, %r14d
testl %eax, %eax
je 0x257d
movl %r13d, %edi
shll $0x1b, %edi
addl $0xa0000000, %edi       # imm = 0xA0000000
movl $0x4, %esi
callq 0x180b
testl %eax, %eax
je 0x257d
leaq 0x92a2(%rip), %rax      # 0xb320
movq 0x40(%rax), %rcx
movl 0x9288(%rip), %eax      # 0xb310
movl 0x9286(%rip), %edx      # 0xb314
xorl %esi, %esi
leaq 0x9179(%rip), %r9       # 0xb210
movq 0x10(%rsp), %r10
leal (%r10,%rsi), %edi
movb (%rcx,%rdi), %dil
movl %eax, %r8d
movb %dil, (%r8,%r9)
incl %eax
movzbl %al, %eax
cmpl %edx, %eax
je 0x233b
incq %rsi
cmpq %r13, %rsi
jb 0x209c
movl %eax, 0x924a(%rip)      # 0xb310
movl $0x1, %r14d
jmp 0x2582
cmpl $-0x8, %edx
jb 0x26c8
xorl %r14d, %r14d
xorl %edi, %edi
movl $0x3, %esi
callq 0x180b
testl %eax, %eax
je 0x257d
movl %r12d, %r14d
movq 0x8(%rsp), %r12
movl %r12d, %edi
shll $0x1d, %edi
movl $0x3, %esi
jmp 0x24f8
cmpl $-0x20, %edx
jb 0x2201
movl $0x38000000, %edi       # imm = 0x38000000
movl $0x5, %esi
jmp 0x24d8
leal -0x3(%r13), %eax
cmpl $0xefc, %eax            # imm = 0xEFC
ja 0x26c8
cmpl $0xffff0000, %edx       # imm = 0xFFFF0000
jb 0x26c8
cmpl $0xfffffdff, %edx       # imm = 0xFFFFFDFF
ja 0x2230
movl %edx, %eax
negl %eax
movl $0x2, %ebp
cmpl $0x401, %eax            # imm = 0x401
jb 0x2165
movl $0x400, %ecx            # imm = 0x400
addl %ecx, %ecx
incl %ebp
cmpl %eax, %ecx
jb 0x215d
cmpl %ebx, %ebp
jbe 0x226f
movl %r12d, 0x18(%rsp)
movl $0x1, %r14d
movl %r14d, %eax
xorl %r14d, %r14d
movb $0x1, %r12b
testl %eax, %eax
je 0x21db
movl $0x30000000, %edi       # imm = 0x30000000
movl $0x5, %esi
callq 0x180b
testl %eax, %eax
je 0x21d6
movl 0x9172(%rip), %eax      # 0xb310
leaq 0x906b(%rip), %rcx      # 0xb210
movb $-0x2, (%rax,%rcx)
incl %eax
movzbl %al, %eax
movl %eax, 0x915c(%rip)      # 0xb310
xorl %r14d, %r14d
cmpl 0x9157(%rip), %eax      # 0xb314
jne 0x21cd
leaq 0x4028(%rip), %rdi      # 0x61ee
callq 0x1120
jmp 0x21d6
movl $0x1, %r14d
xorl %r12d, %r12d
movq 0x10(%rsp), %r10
incl %ebx
cmpl %ebx, %ebp
jne 0x2178
cmpl $0x10, %r13d
jge 0x23cd
testb %r12b, %r12b
je 0x242a
xorl %r14d, %r14d
movl 0x18(%rsp), %r12d
jmp 0x24b4
leal 0x100(%rdx), %eax
cmpl $0xdf, %eax
ja 0x2248
movl $0x30000000, %edi       # imm = 0x30000000
jmp 0x23c3
leal 0x4f(%rdx), %eax
cmpl $0x3e, %eax
ja 0x26c8
testb $0x1, %dl
jne 0x22a3
movl $0x30000000, %edi       # imm = 0x30000000
jmp 0x22a8
cmpl $0x10, %r13d
jb 0x2279
cmpl $0x80, %r13d
jb 0x23f7
jmp 0x244f
movl %edx, %eax
andl $0xffffff00, %eax       # imm = 0xFFFFFF00
cmpl $0xfffffd00, %eax       # imm = 0xFFFFFD00
je 0x23be
cmpl $0xfffffe00, %eax       # imm = 0xFFFFFE00
jne 0x26c8
movl $0x28000000, %edi       # imm = 0x28000000
jmp 0x23c3
cmpl $0x10, %r13d
jge 0x23e9
movl %ebx, %ebp
xorl %edi, %edi
movl $0x1, %esi
callq 0x180b
cmpl $0x3, %r13d
jne 0x2352
testl %eax, %eax
je 0x23b6
movl $0x80000000, %edi       # imm = 0x80000000
jmp 0x23a4
movl $0x48000000, %edi       # imm = 0x48000000
movl $0x5, %esi
callq 0x180b
xorl %r14d, %r14d
testl %eax, %eax
je 0x257d
movq 0x8(%rsp), %rax
addl $0xf, %eax
shrb %al
xorb $-0x7f, %al
movl 0x9041(%rip), %ecx      # 0xb310
leaq 0x8f3a(%rip), %rdi      # 0xb210
movb %al, (%rcx,%rdi)
leal 0x1(%rcx), %eax
movzbl %al, %eax
movl %eax, 0x902b(%rip)      # 0xb310
movl 0x9029(%rip), %ecx      # 0xb314
cmpl %ecx, %eax
movq 0x10(%rsp), %r10
je 0x2341
leaq 0x9025(%rip), %rdx      # 0xb320
movq 0x40(%rdx), %rdx
movb 0x1(%r10,%rdx), %dl
movl %eax, %esi
movb %dl, (%rsi,%rdi)
incl %eax
movzbl %al, %eax
movl %eax, 0x8ffc(%rip)      # 0xb310
movl $0x1, %r14d
cmpl %ecx, %eax
jne 0x2582
leaq 0x3ec5(%rip), %rdi      # 0x61ee
callq 0x1120
movq 0x10(%rsp), %r10
xorl %r14d, %r14d
jmp 0x2582
movl %eax, 0x8fcf(%rip)      # 0xb310
leaq 0x3ea6(%rip), %rdi      # 0x61ee
callq 0x1120
jmp 0x257d
testl %eax, %eax
je 0x23b6
movq %r13, %rbx
movl $0xaaaaaaab, %eax       # imm = 0xAAAAAAAB
imulq %rax, %rbx
shrq $0x21, %rbx
leal (%rbx,%rbx), %esi
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x180b
movl %eax, %r14d
testl %eax, %eax
sete %al
cmpq $0xf, %r13
sete %cl
orb %al, %cl
cmpl $0xf, %r13d
movl $0x0, %eax
cmovnel %eax, %r14d
testb %cl, %cl
jne 0x24af
leal (%rbx,%rbx,2), %eax
movl %r13d, %edi
subl %eax, %edi
shll $0x1e, %edi
movl $0x2, %esi
callq 0x180b
movl %eax, %r14d
jmp 0x24af
xorl %r14d, %r14d
jmp 0x24af
movl $0x20000000, %edi       # imm = 0x20000000
movl $0x5, %esi
jmp 0x2533
cmpl $0x80, %r13d
movq 0x8(%rsp), %rcx
jae 0x2434
testb %r12b, %r12b
jne 0x2439
movl %ebp, %ebx
movl 0x18(%rsp), %r12d
jmp 0x23f7
cmpl $0x80, %r13d
movq 0x20(%rsp), %rbp
jae 0x244f
movl $0x60000000, %edi       # imm = 0x60000000
movl $0x7, %esi
callq 0x180b
testl %eax, %eax
je 0x2422
movl %r13d, %edi
shll $0x19, %edi
movl $0x7, %esi
callq 0x180b
movl %eax, %r14d
jmp 0x24ad
xorl %r14d, %r14d
jmp 0x24ad
movl 0x18(%rsp), %r12d
jmp 0x227b
testb %r12b, %r12b
je 0x2443
xorl %r14d, %r14d
movl 0x18(%rsp), %r12d
jmp 0x24b9
movl %ebp, %ebx
movl 0x18(%rsp), %r12d
movq 0x20(%rsp), %rbp
movl $0x60000000, %edi       # imm = 0x60000000
movl $0x7, %esi
callq 0x180b
xorl %r14d, %r14d
testl %eax, %eax
je 0x24ad
movl %r13d, %edi
shll $0x11, %edi
movl $0x7, %esi
callq 0x180b
testl %eax, %eax
je 0x24ad
movl 0x8e91(%rip), %eax      # 0xb310
leaq 0x8d8a(%rip), %rcx      # 0xb210
movb %r13b, (%rax,%rcx)
incl %eax
movzbl %al, %eax
movl %eax, 0x8e7b(%rip)      # 0xb310
cmpl 0x8e79(%rip), %eax      # 0xb314
jne 0x262d
leaq 0x3d46(%rip), %rdi      # 0x61ee
callq 0x1120
movl %ebx, %ebp
movq 0x10(%rsp), %r10
movq 0x8(%rsp), %rcx
cmpl $-0x21, %ecx
jle 0x250d
testl %r14d, %r14d
je 0x261e
movl %ebp, %ebx
movq 0x20(%rsp), %rbp
movl $0x80000000, %edi       # imm = 0x80000000
movl $0x2, %esi
callq 0x180b
testl %eax, %eax
je 0x257a
movl %r12d, %r14d
movq 0x8(%rsp), %r12
movl %r12d, %edi
shll $0x1b, %edi
movl $0x5, %esi
callq 0x180b
movq %r12, %rcx
movl %r14d, %r12d
movl %eax, %r14d
movq 0x10(%rsp), %r10
jmp 0x2587
cmpl $0xfffffeff, %ecx       # imm = 0xFFFFFEFF
jbe 0x25bf
testl %r14d, %r14d
je 0x261e
movl %ebp, %ebx
movq 0x20(%rsp), %rbp
movl $0x40000000, %edi       # imm = 0x40000000
movl $0x2, %esi
callq 0x180b
xorl %r14d, %r14d
testl %eax, %eax
je 0x257d
movl 0x8dcb(%rip), %eax      # 0xb310
leaq 0x8cc4(%rip), %rcx      # 0xb210
movq 0x8(%rsp), %rdx
movb %dl, (%rax,%rcx)
incl %eax
movzbl %al, %eax
movl %eax, 0x8db1(%rip)      # 0xb310
cmpl 0x8daf(%rip), %eax      # 0xb314
jne 0x25b1
leaq 0x3c80(%rip), %rdi      # 0x61ee
callq 0x1120
movq 0x8(%rsp), %rcx
jmp 0x2506
xorl %r14d, %r14d
movq 0x10(%rsp), %r10
movq 0x8(%rsp), %rcx
cmpl %ecx, %r15d
cmovgel %ecx, %r15d
movl %r13d, %eax
negl %eax
cmovsl %r13d, %eax
addl %r10d, %eax
cmpl %r12d, %eax
jae 0x265b
testl %r14d, %r14d
jne 0x1f21
jmp 0x265b
movq %rdx, %rcx
movl $0x1, %r14d
jmp 0x2506
cmpl $0xfffffdff, %ecx       # imm = 0xFFFFFDFF
jbe 0x25df
testl %r14d, %r14d
je 0x261e
movl %ebp, %ebx
movq 0x20(%rsp), %rbp
xorl %r14d, %r14d
xorl %edi, %edi
movl $0x2, %esi
jmp 0x2614
testl %r14d, %r14d
je 0x261e
movl %ebp, %ebx
movq 0x20(%rsp), %rbp
movl $0xc0000000, %edi       # imm = 0xC0000000
movl $0x2, %esi
callq 0x180b
xorl %r14d, %r14d
testl %eax, %eax
je 0x257d
movb $0x18, %cl
subb %bl, %cl
movq 0x8(%rsp), %rax
movl %eax, %edi
shll %cl, %edi
movl %ebx, %esi
callq 0x180b
jmp 0x253b
xorl %r14d, %r14d
movl %ebp, %ebx
movq 0x20(%rsp), %rbp
jmp 0x2587
movq 0x8(%rsp), %rax
cmpl $-0x21, %eax
jg 0x24ce
cmpl $0xfffffeff, %eax       # imm = 0xFFFFFEFF
ja 0x2529
cmpl $0xfffffdff, %eax       # imm = 0xFFFFFDFF
ja 0x25d3
jmp 0x25eb
leaq 0x3cd9(%rip), %rdi      # 0x632f
jmp 0x1ee2
testl %r14d, %r14d
movl $0x0, %r14d
je 0x1ee7
movl $0x603c0000, %edi       # imm = 0x603C0000
movl $0xe, %esi
callq 0x180b
testl %eax, %eax
je 0x1eea
xorl %r14d, %r14d
xorl %edi, %edi
xorl %esi, %esi
callq 0x180b
testl %eax, %eax
je 0x1eea
xorl %r14d, %r14d
xorl %edi, %edi
xorl %esi, %esi
callq 0x15f2
testl %eax, %eax
je 0x1eea
negl %r15d
leaq 0x3997(%rip), %rdi      # 0x604a
movl %r15d, %esi
xorl %eax, %eax
callq 0x1040
movl $0x1, %r14d
jmp 0x1eea
leaq 0x39f0(%rip), %rdi      # 0x60bf
movl %r13d, %esi
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x1040
jmp 0x1eea