// File: /workspace/github_c_makefile_star2_O3/videolan[P]bitstream/examples/dvb_ecmg_test.c
// Function: main
int main(int i_argc, char **ppsz_argv)
{
    if (i_argc != 3) {
        fprintf(stderr, "usage: %s <# streams> <crypto-period (s)> < < <input stream> > <output stream>\n",
                ppsz_argv[0]);
        return EXIT_FAILURE;
    }

    i_wanted_streams = atoi(ppsz_argv[1]);
    i_period = atoi(ppsz_argv[2]);
    i_last_time = time(NULL);

    srand(time(NULL));
    i_channelid = rand();
    i_supercasid = rand();
    send_channel_setup();

    for ( ; ; ) {
        uint8_t *p_tlv_h = malloc(TLVH_HEADER_SIZE + TLV_HEADER_SIZE);
        uint8_t *p_tlv = tlvh_get_tlv(p_tlv_h);
        uint16_t i_type;
        fd_set rset;
        struct timeval timeout;
        int i_ret;

        FD_ZERO(&rset);
        FD_SET(STDIN_FILENO, &rset);
        timeout.tv_sec = SELECT_TIMEOUT;
        timeout.tv_usec = 0;

        if ((i_ret = select(STDIN_FILENO + 1, &rset, NULL, NULL, &timeout)) < 0)
            return EXIT_FAILURE;
        if (!i_ret) {
            goto no_packet;
        }

        if (read_wrapper(p_tlv_h, TLVH_HEADER_SIZE + TLV_HEADER_SIZE) <= 0)
            return EXIT_FAILURE;

        p_tlv_h = realloc(p_tlv_h, TLVH_HEADER_SIZE + TLV_HEADER_SIZE
                                    + tlv_get_length(p_tlv));
        p_tlv = tlvh_get_tlv(p_tlv_h);
        if (read_wrapper(p_tlv + TLV_HEADER_SIZE, tlv_get_length(p_tlv)) <= 0)
            return EXIT_FAILURE;

        if (tlvh_get_version(p_tlv_h) != i_version) {
            send_channel_error(i_channelid, 0x2);
            free(p_tlv_h);
            exit(EXIT_FAILURE);
        }

        i_type = tlv_get_type(p_tlv);

        if (!tlv_validate(p_tlv)) {
            send_channel_error(i_channelid, 0x1);
            free(p_tlv_h);
            exit(EXIT_FAILURE);
        }

        if (!ecmg_validate(p_tlv)) {
            send_channel_error(i_channelid, 0xf);
            free(p_tlv_h);
            exit(EXIT_FAILURE);
        }

        if (b_init && i_type != ECMG_TYPE_CHANNEL_STATUS) {
            send_channel_error(i_channelid, 0x6);
            free(p_tlv_h);
            exit(EXIT_FAILURE);
        }

        switch (i_type) {
            case ECMG_TYPE_CHANNEL_STATUS:
                handle_channel_status(p_tlv);
                break;

            case ECMG_TYPE_CHANNEL_TEST:
                handle_channel_test(p_tlv);
                break;

            case ECMG_TYPE_CHANNEL_ERROR:
                handle_channel_error(p_tlv);
                break;

            case ECMG_TYPE_STREAM_STATUS:
                handle_stream_status(p_tlv);
                break;

            case ECMG_TYPE_STREAM_TEST:
                handle_stream_test(p_tlv);
                break;

            case ECMG_TYPE_STREAM_ERROR:
                handle_stream_error(p_tlv);
                break;

            case ECMG_TYPE_ECM:
                handle_ecm(p_tlv);
                break;

            default:
                send_channel_error(i_channelid, 0x3);
                break;
        }

no_packet:
        free(p_tlv_h);

        if (!b_init) {
            time_t i_time = time(NULL);

            if (i_nb_streams < i_wanted_streams)
                create_stream();

            while (i_last_time < i_time) {
                i_last_time++;
                check_cw();
            }
        }
    }

    return EXIT_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4b8, %rsp            # imm = 0x4B8
movq %rsi, %rbx
cmpl $0x3, %edi
jne 0x2c02
movq 0x8(%rbx), %rdi
callq 0x10d0
movl %eax, 0x36cb(%rip)      # 0x50a0
movq 0x10(%rbx), %rdi
callq 0x10d0
movl %eax, 0x36c0(%rip)      # 0x50a4
xorl %edi, %edi
callq 0x1090
movq %rax, 0x36b6(%rip)      # 0x50a8
xorl %edi, %edi
callq 0x1090
movl %eax, %edi
callq 0x1070
callq 0x1100
movw %ax, 0x36a4(%rip)       # 0x50b0
callq 0x1100
movl %eax, 0x369d(%rip)      # 0x50b4
leaq 0xb1(%rsp), %rcx
leaq 0xb5(%rsp), %rdx
movb $0x0, 0x1(%rdx)
movl $0x3010001, -0x5(%rdx)  # imm = 0x3010001
movw $0xfc, -0x1(%rdx)
movzwl 0x3671(%rip), %ebx      # 0x50b0
xorl %edi, %edi
movq %rdx, %rsi
testb %dil, %dil
je 0x1a7a
movzbl %dil, %r8d
movq %rdx, %rsi
movq %rsi, %r9
subq %rcx, %r9
cmpq $0x3fc, %r9             # imm = 0x3FC
jg 0x1a9b
movzwl 0x2(%rsi), %r9d
rolw $0x8, %r9w
movzwl %r9w, %r9d
addq %r9, %rsi
addq $0x4, %rsi
decw %r8w
jne 0x1a50
movq %rsi, %r8
subq %rcx, %r8
addq $-0x4, %r8
cmpq $0x3fb, %r8             # imm = 0x3FB
jg 0x1a9b
movb 0x1(%rsi), %r8b
incb %dil
orb (%rsi), %r8b
jne 0x1a41
jmp 0x1a9d
xorl %esi, %esi
movq %rsi, %r8
subq %rcx, %r8
addq $0x4, %r8
movl $0x3fc, %edi            # imm = 0x3FC
cmpq $0x3fc, %r8             # imm = 0x3FC
jg 0x1adc
movl $0x2000e00, (%rsi)      # imm = 0x2000E00
movb %bh, 0x4(%rsi)
movb %bl, 0x5(%rsi)
movw $0x0, 0x6(%rsi)
movzwl 0xb3(%rsp), %eax
rolw $0x8, %ax
movzwl %ax, %edi
movl 0x35d8(%rip), %eax      # 0x50b4
xorl %r8d, %r8d
movq %rdx, %rsi
testb %r8b, %r8b
je 0x1b14
movzbl %r8b, %r9d
movq %rdx, %rsi
movq %rsi, %r10
subq %rcx, %r10
cmpq %rdi, %r10
jg 0x1b31
movzwl 0x2(%rsi), %r10d
rolw $0x8, %r10w
movzwl %r10w, %r10d
addq %r10, %rsi
addq $0x4, %rsi
decw %r9w
jne 0x1aee
movq %rsi, %r9
subq %rcx, %r9
addq $-0x4, %r9
cmpq %rdi, %r9
jge 0x1b31
movb 0x1(%rsi), %r9b
incb %r8b
orb (%rsi), %r9b
jne 0x1adf
jmp 0x1b33
xorl %esi, %esi
movq %rsi, %r8
subq %rcx, %r8
addq $0x6, %r8
cmpq %rdi, %r8
jg 0x1b9d
movl $0x4000100, (%rsi)      # imm = 0x4000100
movd %eax, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, %xmm1
psrld $0x8, %xmm1
punpckhqdq %xmm0, %xmm1    # xmm1 = xmm1[1],xmm0[1]
movdqa %xmm0, %xmm2
psrld $0x10, %xmm2
psrld $0x18, %xmm0
punpcklqdq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0]
shufps $0xcc, %xmm1, %xmm0     # xmm0 = xmm0[0,3],xmm1[0,3]
andps 0x1495(%rip), %xmm0     # 0x3010
packuswb %xmm0, %xmm0
packuswb %xmm0, %xmm0
movd %xmm0, 0x4(%rsi)
movw $0x0, 0x8(%rsi)
movzwl 0xb3(%rsp), %eax
rolw $0x8, %ax
movzwl %ax, %edi
xorl %esi, %esi
xorl %eax, %eax
movq %rdx, %r8
testb %al, %al
je 0x1bd5
movzbl %al, %r9d
movq %rdx, %r8
movq %r8, %r10
subq %rcx, %r10
cmpq %rdi, %r10
jg 0x1bf2
movzwl 0x2(%r8), %r10d
rolw $0x8, %r10w
movzwl %r10w, %r10d
addq %r10, %r8
addq $0x4, %r8
decw %r9w
jne 0x1baf
movq %r8, %r9
subq %rcx, %r9
addq $-0x4, %r9
cmpq %rdi, %r9
jge 0x1bf2
movb 0x1(%r8), %r9b
incb %al
orb (%r8), %r9b
jne 0x1ba1
movq %r8, %rsi
movl %esi, %eax
subl %ecx, %eax
addl $-0x4, %eax
rolw $0x8, %ax
leaq 0xb0(%rsp), %rdi
movw %ax, 0x3(%rdi)
subq %rdi, %rsi
callq 0x194f
movl $0x1, %ebx
movl $0x5, %edi
callq 0x10b0
movq %rax, %r15
pxor %xmm0, %xmm0
leaq 0x30(%rsp), %rsi
movdqu %xmm0, 0x8(%rsi)
movdqu %xmm0, 0x18(%rsi)
movdqu %xmm0, 0x28(%rsi)
movdqu %xmm0, 0x38(%rsi)
movdqu %xmm0, 0x48(%rsi)
movdqu %xmm0, 0x58(%rsi)
movdqu %xmm0, 0x68(%rsi)
xorl %eax, %eax
movq %rax, 0x78(%rsi)
movq %rbx, (%rsi)
leaq 0x20(%rsp), %r8
movl $0x1, %r14d
movq %rbx, (%r8)
movq %rax, 0x8(%r8)
movl $0x1, %edi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x10a0
testl %eax, %eax
js 0x2c0a
leaq 0xb0(%rsp), %rbx
orq %r14, %rbx
testl %eax, %eax
je 0x1db3
movl $0x5, %esi
movq %r15, %rdi
callq 0x18cc
testq %rax, %rax
jle 0x2c0a
movzwl 0x3(%r15), %eax
rolw $0x8, %ax
movzwl %ax, %esi
addq $0x5, %rsi
movq %r15, %rdi
callq 0x10c0
movq %rax, %r15
leaq 0x5(%rax), %r14
movzwl 0x3(%rax), %eax
rolw $0x8, %ax
movzwl %ax, %esi
movq %r14, %rdi
callq 0x18cc
testq %rax, %rax
jle 0x2c0a
cmpb $0x1, (%r15)
jne 0x2c54
movq %r15, %rbp
incq %rbp
movzwl 0x3(%r15), %eax
rolw $0x8, %ax
movzwl %ax, %edx
cmpw $0x4, %dx
movq %r15, 0x8(%rsp)
jb 0x1d26
movzwl 0x7(%r15), %eax
rolw $0x8, %ax
movzwl %ax, %esi
leaq (%r14,%rsi), %rax
subq %rbp, %rax
movq %r14, %rcx
cmpq %rdx, %rax
jle 0x1d2a
xorl %eax, %eax
jmp 0x1d57
addq %rsi, %rcx
addq $0x4, %rcx
movq %rcx, %rax
subq %rbp, %rax
cmpq %rdx, %rax
jg 0x1d53
movzwl 0x2(%rcx), %esi
rolw $0x8, %si
movzwl %si, %esi
leaq (%rcx,%rsi), %rdi
subq %rbp, %rdi
cmpq %rdx, %rdi
jle 0x1d2a
addq $-0x4, %rax
cmpq %rdx, %rax
jne 0x2c46
movq 0x8(%rsp), %rax
movzwl 0x1(%rax), %ecx
rolw $0x8, %cx
movzwl %cx, %eax
movw $0x0, 0xb4(%rsp)
movl $0x0, 0xb0(%rsp)
cmpl $0x100, %eax            # imm = 0x100
jle 0x1dbd
leal -0x101(%rax), %esi
cmpl $0x5, %esi
ja 0x1de6
leaq 0x1296(%rip), %rdi      # 0x3034
movslq (%rdi,%rsi,4), %rsi
addq %rdi, %rsi
jmpq *%rsi
leaq 0x1392(%rip), %rsi      # 0x3140
jmp 0x1e42
movq %r15, 0x8(%rsp)
jmp 0x24a0
leal -0x1(%rax), %edi
leaq 0xb0(%rsp), %rsi
cmpl $0x4, %edi
ja 0x1e42
leaq 0x124c(%rip), %r8       # 0x3020
movslq (%r8,%rdi,4), %rsi
addq %r8, %rsi
jmpq *%rsi
leaq 0x12e6(%rip), %rsi      # 0x30ca
jmp 0x1e42
cmpl $0x201, %eax            # imm = 0x201
je 0x1e20
leaq 0xb0(%rsp), %rsi
cmpl $0x202, %eax            # imm = 0x202
jne 0x1e42
leaq 0x13ad(%rip), %rsi      # 0x31b0
jmp 0x1e42
leaq 0x12d4(%rip), %rsi      # 0x30e0
jmp 0x1e42
leaq 0x12eb(%rip), %rsi      # 0x3100
jmp 0x1e42
leaq 0x1232(%rip), %rsi      # 0x3050
jmp 0x1e42
leaq 0x1359(%rip), %rsi      # 0x3180
jmp 0x1e42
leaq 0x1240(%rip), %rsi      # 0x3070
jmp 0x1e42
leaq 0x1327(%rip), %rsi      # 0x3160
jmp 0x1e42
leaq 0x12de(%rip), %rsi      # 0x3120
movzwl (%rsi), %r8d
testw %r8w, %r8w
je 0x1edf
leaq 0x6(%rsi), %rdi
xorl %r10d, %r10d
xorl %r9d, %r9d
xorl %r11d, %r11d
movq %r14, %r13
testw %r11w, %r11w
je 0x1e92
movl %r10d, %r12d
movq %r14, %r13
movq %r13, %r15
subq %rbp, %r15
cmpq %rdx, %r15
jg 0x1ec1
movzwl 0x2(%r13), %r15d
rolw $0x8, %r15w
movzwl %r15w, %r15d
addq %r15, %r13
addq $0x4, %r13
incw %r12w
jne 0x1e6c
movq %r13, %r15
subq %rbp, %r15
addq $-0x4, %r15
cmpq %rdx, %r15
jge 0x1ec1
incl %r11d
movzwl (%r13), %r15d
rolw $0x8, %r15w
xorl %r12d, %r12d
cmpw %r8w, %r15w
sete %r12b
addl %r12d, %r9d
decl %r10d
jmp 0x1e5d
cmpw 0x2(%rsi), %r9w
jb 0x2c21
cmpw 0x4(%rsi), %r9w
movq %rdi, %rsi
jbe 0x1e42
jmp 0x2c21
xorl %esi, %esi
xorl %edi, %edi
movq %r14, %r8
testw %di, %di
je 0x1f17
movl %esi, %r9d
movq %r14, %r8
movq %r8, %r10
subq %rbp, %r10
cmpq %rdx, %r10
jg 0x1f74
movzwl 0x2(%r8), %r10d
rolw $0x8, %r10w
movzwl %r10w, %r10d
addq %r10, %r8
addq $0x4, %r8
incw %r9w
jne 0x1ef1
movq %r8, %r9
subq %rbp, %r9
addq $-0x4, %r9
cmpq %rdx, %r9
jge 0x1f74
movzwl (%r8), %r9d
movzwl 0x2(%r8), %r8d
rolw $0x8, %r9w
movzwl %r9w, %r9d
rolw $0x8, %r8w
cmpw $0x19, %r9w
ja 0x1f57
leaq 0x1285(%rip), %r10      # 0x31d0
cmpw (%r10,%r9,2), %r8w
jae 0x1f6b
jmp 0x2c21
cmpl $0x7000, %r9d           # imm = 0x7000
jne 0x1f6b
cmpw $0x2, %r8w
jb 0x2c21
incl %edi
decl %esi
jmp 0x1ee3
movb 0x313d(%rip), %sil      # 0x50b8
testb %sil, %sil
jne 0x1f8a
cmpw $0x3, %cx
jne 0x2c6a
cmpl $0x102, %eax            # imm = 0x102
jg 0x2193
cmpl $0x4, %eax
jg 0x2467
cmpl $0x3, %eax
jne 0x247c
xorl %eax, %eax
movq %r14, %rcx
testb %al, %al
je 0x1fcd
movzbl %al, %edx
movq %r14, %rcx
movzwl 0x2(%rcx), %edi
rolw $0x8, %di
movzwl %di, %edi
addq %rdi, %rcx
addq $0x4, %rcx
decw %dx
jne 0x1fb6
movzwl (%rcx), %edx
rolw $0x8, %dx
incb %al
cmpw $0xe, %dx
jne 0x1fa9
movzwl 0x4(%rcx), %eax
rolw $0x8, %ax
movzwl %ax, %edx
cmpw 0x30c2(%rip), %dx       # 0x50b0
jne 0x2c78
testb %sil, %sil
jne 0x24a0
xorl %eax, %eax
movq %r14, %rcx
testb %al, %al
je 0x2023
movzbl %al, %esi
movq %r14, %rcx
movzwl 0x2(%rcx), %edi
rolw $0x8, %di
movzwl %di, %edi
addq %rdi, %rcx
addq $0x4, %rcx
decw %si
jne 0x200c
movzwl (%rcx), %esi
rolw $0x8, %si
incb %al
cmpw $0x8, %si
jne 0x1fff
movzwl 0x4(%rcx), %eax
rolw $0x8, %ax
movzwl %ax, %eax
cmpl %eax, 0x305d(%rip)      # 0x50a0
jg 0x2daa
xorl %eax, %eax
movq %r14, %rcx
testb %al, %al
je 0x206f
movzbl %al, %esi
movq %r14, %rcx
movzwl 0x2(%rcx), %edi
rolw $0x8, %di
movzwl %di, %edi
addq %rdi, %rcx
addq $0x4, %rcx
decw %si
jne 0x2058
movzwl (%rcx), %esi
rolw $0x8, %si
incb %al
cmpw $0x9, %si
jne 0x204b
movzwl 0x4(%rcx), %eax
rolw $0x8, %ax
movzwl %ax, %eax
movl 0x3015(%rip), %ecx      # 0x50a4
addl %ecx, %ecx
leal (%rcx,%rcx,4), %ecx
cmpl %eax, %ecx
jl 0x2da2
xorl %eax, %eax
movq 0x8(%rsp), %r15
movq %r14, %rcx
testb %al, %al
je 0x20c7
movzbl %al, %esi
movq %r14, %rcx
movzwl 0x2(%rcx), %edi
rolw $0x8, %di
movzwl %di, %edi
addq %rdi, %rcx
addq $0x4, %rcx
decw %si
jne 0x20b0
movzwl (%rcx), %esi
rolw $0x8, %si
incb %al
cmpw $0x2, %si
jne 0x20a3
movb 0x4(%rcx), %al
movb %al, 0x2fe1(%rip)       # 0x50c0
xorl %eax, %eax
movq %r14, %rcx
testb %al, %al
je 0x2105
movzbl %al, %esi
movq %r14, %rcx
movzwl 0x2(%rcx), %edi
rolw $0x8, %di
movzwl %di, %edi
addq %rdi, %rcx
addq $0x4, %rcx
decw %si
jne 0x20ee
movzwl (%rcx), %esi
rolw $0x8, %si
incb %al
cmpw $0xb, %si
jne 0x20e1
movb 0x4(%rcx), %al
movb %al, 0x2fa4(%rip)       # 0x50c1
xorl %eax, %eax
movq %r14, %rcx
testb %al, %al
je 0x2143
movzbl %al, %esi
movq %r14, %rcx
movzwl 0x2(%rcx), %edi
rolw $0x8, %di
movzwl %di, %edi
addq %rdi, %rcx
addq $0x4, %rcx
decw %si
jne 0x212c
movzwl (%rcx), %esi
rolw $0x8, %si
incb %al
cmpw $0xa, %si
jne 0x211f
movb 0x4(%rcx), %al
movb %al, 0x2f67(%rip)       # 0x50c2
movq 0x2e96(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
movl 0x2f48(%rip), %r8d      # 0x50b4
leaq 0x119e(%rip), %rsi      # 0x3311
movl $0x1, %ecx
xorl %eax, %eax
callq 0x1080
movb $0x1, 0x2f32(%rip)      # 0x50b8
movq %r15, %rdi
callq 0x1030
jmp 0x24bb
cmpl $0x103, %eax            # imm = 0x103
je 0x227d
cmpl $0x202, %eax            # imm = 0x202
jne 0x2453
xorl %eax, %eax
movq %r14, %rdx
testb %al, %al
je 0x21cf
movzbl %al, %ecx
movq %r14, %rdx
movzwl 0x2(%rdx), %esi
rolw $0x8, %si
movzwl %si, %esi
addq %rsi, %rdx
addq $0x4, %rdx
decw %cx
jne 0x21b8
movzwl (%rdx), %ecx
rolw $0x8, %cx
incb %al
cmpw $0xe, %cx
jne 0x21ab
movzbl 0x4(%rdx), %ecx
movzbl 0x5(%rdx), %eax
xorl %esi, %esi
movq %r14, %rdx
testb %sil, %sil
je 0x2211
movzbl %sil, %edi
movq %r14, %rdx
movzwl 0x2(%rdx), %r8d
rolw $0x8, %r8w
movzwl %r8w, %r8d
addq %r8, %rdx
addq $0x4, %rdx
decw %di
jne 0x21f7
movzwl (%rdx), %edi
rolw $0x8, %di
incb %sil
cmpw $0xf, %di
jne 0x21e8
movzwl %cx, %ecx
shll $0x8, %ecx
movzwl %ax, %eax
orl %ecx, %eax
cmpw 0x2e7d(%rip), %ax       # 0x50b0
jne 0x2493
movzwl 0x4(%rdx), %ecx
rolw $0x8, %cx
movslq 0x2e74(%rip), %rdx      # 0x50bc
testq %rdx, %rdx
jle 0x2270
movq 0x2e74(%rip), %rsi      # 0x50c8
xorl %edi, %edi
movq (%rsi,%rdi,8), %rax
testq %rax, %rax
je 0x2268
cmpw %cx, (%rax)
je 0x2352
incq %rdi
cmpq %rdi, %rdx
jne 0x2256
movzwl %cx, %edi
callq 0x12f4
jmp 0x24a0
xorl %eax, %eax
movq %r14, %rdx
testb %al, %al
je 0x22a3
movzbl %al, %ecx
movq %r14, %rdx
movzwl 0x2(%rdx), %esi
rolw $0x8, %si
movzwl %si, %esi
addq %rsi, %rdx
addq $0x4, %rdx
decw %cx
jne 0x228c
movzwl (%rdx), %ecx
rolw $0x8, %cx
incb %al
cmpw $0xe, %cx
jne 0x227f
movzbl 0x4(%rdx), %ecx
movzbl 0x5(%rdx), %eax
xorl %esi, %esi
movq %r14, %rdx
testb %sil, %sil
je 0x22e5
movzbl %sil, %edi
movq %r14, %rdx
movzwl 0x2(%rdx), %r8d
rolw $0x8, %r8w
movzwl %r8w, %r8d
addq %r8, %rdx
addq $0x4, %rdx
decw %di
jne 0x22cb
movzwl (%rdx), %edi
rolw $0x8, %di
incb %sil
cmpw $0xf, %di
jne 0x22bc
movzwl %cx, %ecx
shll $0x8, %ecx
movzwl %ax, %eax
orl %ecx, %eax
cmpw 0x2da9(%rip), %ax       # 0x50b0
jne 0x2db2
movzwl 0x4(%rdx), %eax
rolw $0x8, %ax
movslq 0x2da0(%rip), %rcx      # 0x50bc
testq %rcx, %rcx
jle 0x2d95
movq 0x2d9c(%rip), %rdx      # 0x50c8
xorl %esi, %esi
movq (%rdx,%rsi,8), %rdi
testq %rdi, %rdi
je 0x233c
cmpw %ax, (%rdi)
je 0x2349
incq %rsi
cmpq %rsi, %rcx
jne 0x232e
jmp 0x2d95
movb $0x0, 0x6(%rdi)
jmp 0x24a0
xorl %ecx, %ecx
movq %r14, %rdx
testb %cl, %cl
je 0x2378
movzbl %cl, %esi
movq %r14, %rdx
movzwl 0x2(%rdx), %edi
rolw $0x8, %di
movzwl %di, %edi
addq %rdi, %rdx
addq $0x4, %rdx
decw %si
jne 0x2361
movzwl (%rdx), %esi
rolw $0x8, %si
incb %cl
cmpw $0x12, %si
jne 0x2354
movzwl 0x4(%rdx), %ecx
rolw $0x8, %cx
cmpw 0x4(%rax), %cx
jne 0x2be4
cmpb $0x0, 0x2d20(%rip)      # 0x50c0
jne 0x24a0
movq 0x8(%rsp), %rax
movzwl 0x3(%rax), %eax
rolw $0x8, %ax
movzwl %ax, %ecx
xorl %edx, %edx
movq %r14, %rax
testb %dl, %dl
je 0x23e7
movzbl %dl, %esi
movq %r14, %rax
movq %rax, %rdi
subq %rbp, %rdi
cmpq %rcx, %rdi
jg 0x2407
movzwl 0x2(%rax), %edi
rolw $0x8, %di
movzwl %di, %edi
addq %rdi, %rax
addq $0x4, %rax
decw %si
jne 0x23c5
movq %rax, %rsi
subq %rbp, %rsi
addq $-0x4, %rsi
cmpq %rcx, %rsi
jge 0x2407
movzwl (%rax), %esi
rolw $0x8, %si
incb %dl
cmpw $0x15, %si
jne 0x23b8
jmp 0x2409
xorl %eax, %eax
movzwl 0x2(%rax), %edi
rolw $0x8, %di
cmpw $0x2, %di
jbe 0x2bee
movzbl 0x5(%rax), %ecx
movzbl 0x6(%rax), %edx
movl %ecx, %eax
andl $0xf, %eax
shll $0x8, %eax
leal (%rax,%rdx), %esi
addl $0x3, %esi
cmpw %si, %di
jne 0x2bf8
orl %edx, %eax
testb %cl, %cl
setns %cl
cmpw $0x9, %ax
setae %al
orb %cl, %al
jne 0x24a0
callq 0x15c1
jmp 0x24a0
cmpl $0x106, %eax            # imm = 0x106
jne 0x2485
movq %r14, %rdi
movq %rbp, %rsi
callq 0x1604
jmp 0x24a0
cmpl $0x5, %eax
je 0x2c7f
cmpl $0x102, %eax            # imm = 0x102
jne 0x2485
jmp 0x2cd6
cmpl $0x2, %eax
je 0x2c87
movzwl 0x2c24(%rip), %edi      # 0x50b0
movl $0x3, %esi
jmp 0x249b
movzwl %ax, %edi
movl $0x6, %esi
callq 0x1120
movb 0x2c11(%rip), %bpl      # 0x50b8
movq 0x8(%rsp), %rdi
callq 0x1030
cmpb $0x1, %bpl
jne 0x28bb
xorl %edi, %edi
callq 0x1090
movq %rax, %r12
movslq 0x2bf0(%rip), %r15      # 0x50bc
cmpl 0x2bcd(%rip), %r15d     # 0x50a0
jl 0x2932
movq 0x2bc8(%rip), %rcx      # 0x50a8
cmpq %r12, %rcx
leaq 0xb5(%rsp), %r9
jge 0x28bb
movl 0x2bc5(%rip), %esi      # 0x50bc
movq %r12, 0x10(%rsp)
incq %rcx
movq %rcx, 0x2ba2(%rip)      # 0x50a8
movslq 0x2b97(%rip), %rdi      # 0x50a4
movq %rcx, %rax
cqto
idivq %rdi
testl %esi, %esi
jle 0x28b2
movq %rdx, %rdi
movq 0x2ba1(%rip), %rcx      # 0x50c8
xorl %r8d, %r8d
movq %rdx, 0x18(%rsp)
movq (%rcx,%r8,8), %r13
cmpb $0x0, 0x6(%r13)
jne 0x2897
movl %r8d, %eax
cltd
idivl 0x2b5c(%rip)            # 0x50a4
cmpl %edi, %edx
jne 0x2897
movb $0x0, 0xb6(%rsp)
movl $0x3010201, 0xb0(%rsp) # imm = 0x3010201
movw $0xfc, 0xb4(%rsp)
movzwl 0x2b3c(%rip), %ecx      # 0x50b0
xorl %eax, %eax
movq %r9, %rdx
testb %al, %al
je 0x25a9
movzbl %al, %esi
movq %r9, %rdx
movq %rdx, %rdi
subq %rbx, %rdi
cmpq $0x3fc, %rdi            # imm = 0x3FC
jg 0x25c9
movzwl 0x2(%rdx), %edi
rolw $0x8, %di
movzwl %di, %edi
addq %rdi, %rdx
addq $0x4, %rdx
decw %si
jne 0x2583
movq %rdx, %rsi
subq %rbx, %rsi
addq $-0x4, %rsi
cmpq $0x3fb, %rsi            # imm = 0x3FB
jg 0x25c9
movb 0x1(%rdx), %sil
incb %al
orb (%rdx), %sil
jne 0x2576
jmp 0x25cb
xorl %edx, %edx
movq %r8, 0x8(%rsp)
movq %rdx, %rsi
subq %rbx, %rsi
addq $0x4, %rsi
movl $0x3fc, %eax            # imm = 0x3FC
cmpq $0x3fc, %rsi            # imm = 0x3FC
jg 0x2609
movl $0x2000e00, (%rdx)      # imm = 0x2000E00
movb %ch, 0x4(%rdx)
movb %cl, 0x5(%rdx)
movw $0x0, 0x6(%rdx)
movzwl 0xb3(%rsp), %eax
rolw $0x8, %ax
movzwl %ax, %eax
movzwl (%r13), %ecx
xorl %esi, %esi
movq %r9, %rdx
testb %sil, %sil
je 0x2644
movzbl %sil, %edi
movq %r9, %rdx
movq %rdx, %r8
subq %rbx, %r8
cmpq %rax, %r8
jg 0x2661
movzwl 0x2(%rdx), %r8d
rolw $0x8, %r8w
movzwl %r8w, %r8d
addq %r8, %rdx
addq $0x4, %rdx
decw %di
jne 0x261f
movq %rdx, %rdi
subq %rbx, %rdi
addq $-0x4, %rdi
cmpq %rax, %rdi
jge 0x2661
movb 0x1(%rdx), %dil
incb %sil
orb (%rdx), %dil
jne 0x2610
jmp 0x2663
xorl %edx, %edx
movq %rdx, %rsi
subq %rbx, %rsi
addq $0x4, %rsi
cmpq %rax, %rsi
jg 0x2693
movl $0x2000f00, (%rdx)      # imm = 0x2000F00
movb %ch, 0x4(%rdx)
movb %cl, 0x5(%rdx)
movw $0x0, 0x6(%rdx)
movzwl 0xb3(%rsp), %eax
rolw $0x8, %ax
movzwl %ax, %eax
movzwl 0x4(%r13), %ecx
xorl %esi, %esi
movq %r9, %rdx
testb %sil, %sil
je 0x26ce
movzbl %sil, %edi
movq %r9, %rdx
movq %rdx, %r8
subq %rbx, %r8
cmpq %rax, %r8
jg 0x26eb
movzwl 0x2(%rdx), %r8d
rolw $0x8, %r8w
movzwl %r8w, %r8d
addq %r8, %rdx
addq $0x4, %rdx
decw %di
jne 0x26a9
movq %rdx, %rdi
subq %rbx, %rdi
addq $-0x4, %rdi
cmpq %rax, %rdi
jge 0x26eb
movb 0x1(%rdx), %dil
incb %sil
orb (%rdx), %dil
jne 0x269a
jmp 0x26ed
xorl %edx, %edx
movq %rdx, %rsi
subq %rbx, %rsi
addq $0x4, %rsi
cmpq %rax, %rsi
jg 0x270e
movl $0x2001200, (%rdx)      # imm = 0x2001200
movb %ch, 0x4(%rdx)
movb %cl, 0x5(%rdx)
movw $0x0, 0x6(%rdx)
movzbl 0x29ac(%rip), %eax      # 0x50c1
testl %eax, %eax
je 0x27f9
movl $0x1, %r14d
movzwl 0x4(%r13), %ecx
addl %r14d, %ecx
movzbl 0x298f(%rip), %r12d     # 0x50c2
subl %eax, %r12d
addl %ecx, %r12d
movl %r12d, %ebp
shrl $0x8, %ebp
callq 0x1100
movl %eax, %r15d
callq 0x1100
leaq 0xb5(%rsp), %r9
movzwl 0xb3(%rsp), %ecx
rolw $0x8, %cx
movzwl %cx, %ecx
xorl %esi, %esi
movq %r9, %rdx
testb %sil, %sil
je 0x2799
movzbl %sil, %edi
movq %r9, %rdx
movq %rdx, %r8
subq %rbx, %r8
cmpq %rcx, %r8
jg 0x27b6
movzwl 0x2(%rdx), %r8d
rolw $0x8, %r8w
movzwl %r8w, %r8d
addq %r8, %rdx
addq $0x4, %rdx
decw %di
jne 0x2774
movq %rdx, %rdi
subq %rbx, %rdi
addq $-0x4, %rdi
cmpq %rcx, %rdi
jge 0x27b6
movb 0x1(%rdx), %dil
incb %sil
orb (%rdx), %dil
jne 0x2765
jmp 0x27b8
xorl %edx, %edx
movq %rdx, %rsi
subq %rbx, %rsi
addq $0xc, %rsi
cmpq %rcx, %rsi
jg 0x27e2
movl $0xa001400, (%rdx)      # imm = 0xA001400
movb %bpl, 0x4(%rdx)
movb %r12b, 0x5(%rdx)
movl %r15d, 0x6(%rdx)
movl %eax, 0xa(%rdx)
movw $0x0, 0xe(%rdx)
leal 0x1(%r14), %ecx
movzbl 0x28d4(%rip), %eax      # 0x50c1
cmpl %eax, %r14d
movl %ecx, %r14d
jb 0x2723
movzwl 0xb3(%rsp), %eax
rolw $0x8, %ax
movzwl %ax, %eax
xorl %ecx, %ecx
movq %r9, %rsi
testb %cl, %cl
je 0x2839
movzbl %cl, %edx
movq %r9, %rsi
movq %rsi, %rdi
subq %rbx, %rdi
cmpq %rax, %rdi
jg 0x2853
movzwl 0x2(%rsi), %edi
rolw $0x8, %di
movzwl %di, %edi
addq %rdi, %rsi
addq $0x4, %rsi
decw %dx
jne 0x2817
movq %rsi, %rdx
subq %rbx, %rdx
addq $-0x4, %rdx
cmpq %rax, %rdx
jge 0x2853
movb 0x1(%rsi), %dl
incb %cl
orb (%rsi), %dl
jne 0x280a
jmp 0x2855
xorl %esi, %esi
movl %esi, %eax
subl %ebx, %eax
addl $-0x4, %eax
rolw $0x8, %ax
movw %ax, 0xb3(%rsp)
leaq 0xb0(%rsp), %rdi
subq %rdi, %rsi
callq 0x194f
movq 0x2849(%rip), %rcx      # 0x50c8
movl 0x2837(%rip), %esi      # 0x50bc
leaq 0xb5(%rsp), %r9
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %r8
incq %r8
movslq %esi, %rax
cmpq %rax, %r8
jl 0x252f
movq 0x27fb(%rip), %rcx      # 0x50a8
movq 0x10(%rsp), %r12
cmpq %r12, %rcx
jl 0x24fc
movl $0x5, %edi
callq 0x10b0
movq %rax, %r15
leaq 0x38(%rsp), %rax
xorl %ecx, %ecx
movq %rcx, 0x70(%rax)
pxor %xmm0, %xmm0
movdqu %xmm0, 0x60(%rax)
movdqu %xmm0, 0x50(%rax)
movdqu %xmm0, 0x40(%rax)
movdqu %xmm0, 0x30(%rax)
movdqu %xmm0, 0x20(%rax)
movdqu %xmm0, 0x10(%rax)
movdqu %xmm0, (%rax)
movl $0x1, %eax
movq %rax, 0x30(%rsp)
movq %rax, 0x20(%rsp)
movq %rcx, 0x28(%rsp)
movl $0x1, %edi
leaq 0x30(%rsp), %rsi
xorl %edx, %edx
xorl %ecx, %ecx
leaq 0x20(%rsp), %r8
callq 0x10a0
testl %eax, %eax
jns 0x1c8b
jmp 0x2c0a
movl $0x8, %edi
callq 0x10b0
movq %rax, %r14
movq 0x2782(%rip), %rdi      # 0x50c8
leaq 0x1(%r15), %r13
movl %r13d, 0x276b(%rip)     # 0x50bc
leaq 0x8(,%r15,8), %rsi
callq 0x10c0
movq %rax, 0x2763(%rip)      # 0x50c8
movq %r14, (%rax,%r15,8)
movw %r13w, (%r14)
movq %r13, %r8
movw %r13w, 0x2(%r14)
movw $0xff, 0x4(%r14)
movb $0x1, 0x6(%r14)
movb $0x0, 0xb6(%rsp)
movl $0x3010101, 0xb0(%rsp) # imm = 0x3010101
movw $0xf7, 0xb4(%rsp)
xorl %eax, %eax
movzwl 0x2709(%rip), %ecx      # 0x50b0
leaq 0xb5(%rsp), %r9
movq %r9, %rdx
testb %al, %al
je 0x29e2
movzbl %al, %esi
movq %r9, %rdx
movq %rdx, %rdi
subq %rbx, %rdi
cmpq $0x3f7, %rdi            # imm = 0x3F7
jg 0x2a02
movzwl 0x2(%rdx), %edi
rolw $0x8, %di
movzwl %di, %edi
addq %rdi, %rdx
addq $0x4, %rdx
decw %si
jne 0x29bc
movq %rdx, %rsi
subq %rbx, %rsi
addq $-0x4, %rsi
cmpq $0x3f6, %rsi            # imm = 0x3F6
jg 0x2a02
movb 0x1(%rdx), %sil
incb %al
orb (%rdx), %sil
jne 0x29af
jmp 0x2a04
xorl %edx, %edx
movq %rdx, %rsi
subq %rbx, %rsi
addq $0x4, %rsi
movl $0x3f7, %eax            # imm = 0x3F7
cmpq $0x3f7, %rsi            # imm = 0x3F7
jg 0x2a41
movl $0x2000e00, (%rdx)      # imm = 0x2000E00
movb %ch, 0x4(%rdx)
movb %cl, 0x5(%rdx)
movw $0x0, 0x6(%rdx)
movzwl 0xb3(%rsp), %eax
rolw $0x8, %ax
movzwl %ax, %eax
movzwl (%r14), %r8d
xorl %edx, %edx
movq %r9, %rcx
testb %dl, %dl
je 0x2a72
movzbl %dl, %esi
movq %r9, %rcx
movq %rcx, %rdi
subq %rbx, %rdi
cmpq %rax, %rdi
jg 0x2a8e
movzwl 0x2(%rcx), %edi
rolw $0x8, %di
movzwl %di, %edi
addq %rdi, %rcx
addq $0x4, %rcx
decw %si
jne 0x2a50
movq %rcx, %rsi
subq %rbx, %rsi
addq $-0x4, %rsi
cmpq %rax, %rsi
jge 0x2a8e
movb 0x1(%rcx), %sil
incb %dl
orb (%rcx), %sil
jne 0x2a43
jmp 0x2a90
xorl %ecx, %ecx
movq %rcx, %rdx
subq %rbx, %rdx
addq $0x4, %rdx
cmpq %rax, %rdx
jg 0x2ac3
movl $0x2000f00, (%rcx)      # imm = 0x2000F00
movq %r8, %rax
movb %ah, 0x4(%rcx)
movb %al, 0x5(%rcx)
movw $0x0, 0x6(%rcx)
movzwl 0xb3(%rsp), %eax
rolw $0x8, %ax
movzwl %ax, %eax
movl 0x25db(%rip), %ecx      # 0x50a4
addl %ecx, %ecx
leal (%rcx,%rcx,4), %ecx
xorl %esi, %esi
movq %r9, %rdx
testb %sil, %sil
je 0x2b04
movzbl %sil, %edi
movq %r9, %rdx
movq %rdx, %r8
subq %rbx, %r8
cmpq %rax, %r8
jg 0x2b21
movzwl 0x2(%rdx), %r8d
rolw $0x8, %r8w
movzwl %r8w, %r8d
addq %r8, %rdx
addq $0x4, %rdx
decw %di
jne 0x2adf
movq %rdx, %rdi
subq %rbx, %rdi
addq $-0x4, %rdi
cmpq %rax, %rdi
jge 0x2b21
movb 0x1(%rdx), %dil
incb %sil
orb (%rdx), %dil
jne 0x2ad0
jmp 0x2b23
xorl %edx, %edx
movq %rdx, %rsi
subq %rbx, %rsi
addq $0x4, %rsi
cmpq %rax, %rsi
jg 0x2b53
movl $0x2001000, (%rdx)      # imm = 0x2001000
movb %ch, 0x4(%rdx)
movb %cl, 0x5(%rdx)
movw $0x0, 0x6(%rdx)
movzwl 0xb3(%rsp), %eax
rolw $0x8, %ax
movzwl %ax, %eax
xorl %ecx, %ecx
movq %r9, %rsi
testb %cl, %cl
je 0x2b84
movzbl %cl, %edx
movq %r9, %rsi
movq %rsi, %rdi
subq %rbx, %rdi
cmpq %rax, %rdi
jg 0x2b9e
movzwl 0x2(%rsi), %edi
rolw $0x8, %di
movzwl %di, %edi
addq %rdi, %rsi
addq $0x4, %rsi
decw %dx
jne 0x2b62
movq %rsi, %rdx
subq %rbx, %rdx
addq $-0x4, %rdx
cmpq %rax, %rdx
jge 0x2b9e
movb 0x1(%rsi), %dl
incb %cl
orb (%rsi), %dl
jne 0x2b55
jmp 0x2ba0
xorl %esi, %esi
movl %esi, %eax
subl %ebx, %eax
addl $-0x4, %eax
rolw $0x8, %ax
movw %ax, 0xb3(%rsp)
leaq 0xb0(%rsp), %rdi
subq %rdi, %rsi
callq 0x194f
movq 0x242e(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
movzwl (%r14), %edx
leaq 0x888(%rip), %rsi       # 0x3460
xorl %eax, %eax
callq 0x1080
jmp 0x24d9
callq 0x157d
jmp 0x2399
callq 0x15e3
jmp 0x24a0
callq 0x159f
jmp 0x24a0
movq %rbx, %rdi
callq 0x155f
movl $0x1, %eax
addq $0x4b8, %rsp            # imm = 0x4B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movzwl 0x2488(%rip), %edi      # 0x50b0
movl $0xf, %esi
callq 0x1120
movq 0x8(%rsp), %rdi
callq 0x1030
movl $0x1, %edi
callq 0x10e0
movzwl 0x2463(%rip), %edi      # 0x50b0
movl $0x1, %esi
jmp 0x2c2d
movzwl 0x2455(%rip), %edi      # 0x50b0
movl $0x2, %esi
callq 0x1120
movq %r15, %rdi
jmp 0x2c37
movzwl 0x243f(%rip), %edi      # 0x50b0
movl $0x6, %esi
jmp 0x2c2d
movl %edx, %edi
jmp 0x2dba
movq %rbp, %rdi
callq 0x171e
xorl %eax, %eax
movq %r14, %rcx
testb %al, %al
je 0x2cad
movzbl %al, %edx
movq %r14, %rcx
movzwl 0x2(%rcx), %esi
rolw $0x8, %si
movzwl %si, %esi
addq %rsi, %rcx
addq $0x4, %rcx
decw %dx
jne 0x2c96
movzwl (%rcx), %edx
rolw $0x8, %dx
incb %al
cmpw $0xe, %dx
jne 0x2c89
movzwl 0x4(%rcx), %eax
rolw $0x8, %ax
cmpw 0x23e5(%rip), %ax       # 0x50b0
jne 0x2db7
callq 0x175d
xorl %eax, %eax
movq %r14, %rdx
testb %al, %al
je 0x2cfc
movzbl %al, %ecx
movq %r14, %rdx
movzwl 0x2(%rdx), %esi
rolw $0x8, %si
movzwl %si, %esi
addq %rsi, %rdx
addq $0x4, %rdx
decw %cx
jne 0x2ce5
movzwl (%rdx), %ecx
rolw $0x8, %cx
incb %al
cmpw $0xe, %cx
jne 0x2cd8
movzbl 0x4(%rdx), %ecx
movzbl 0x5(%rdx), %eax
xorl %esi, %esi
movq %r14, %rdx
testb %sil, %sil
je 0x2d3e
movzbl %sil, %edi
movq %r14, %rdx
movzwl 0x2(%rdx), %r8d
rolw $0x8, %r8w
movzwl %r8w, %r8d
addq %r8, %rdx
addq $0x4, %rdx
decw %di
jne 0x2d24
movzwl (%rdx), %edi
rolw $0x8, %di
incb %sil
cmpw $0xf, %di
jne 0x2d15
movzwl %cx, %ecx
shll $0x8, %ecx
movzwl %ax, %eax
orl %ecx, %eax
cmpw 0x2350(%rip), %ax       # 0x50b0
jne 0x2db2
movzwl 0x4(%rdx), %eax
rolw $0x8, %ax
movslq 0x234b(%rip), %rcx      # 0x50bc
testq %rcx, %rcx
jle 0x2d95
movq 0x234b(%rip), %rdx      # 0x50c8
xorl %esi, %esi
movq (%rdx,%rsi,8), %rdi
testq %rdi, %rdi
je 0x2d8d
cmpw %ax, (%rdi)
je 0x2dc9
incq %rsi
cmpq %rsi, %rcx
jne 0x2d7f
movzwl %ax, %edi
callq 0x12f4
jmp 0x2c3c
movq %rbp, %rdi
callq 0x1782
movq %rbp, %rdi
callq 0x17ae
movzwl %ax, %edi
jmp 0x2dba
movzwl %ax, %edi
movl $0x6, %esi
callq 0x1120
jmp 0x2c3c
callq 0x16f9