// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/decoder/decoder.c
// Function: x264_decoder_open(x264_param_t*)
x264_t *x264_decoder_open(x264_param_t *param) {LOG_CALL;
    x264_t *h = (x264_t *)x264_aligned_alloc(sizeof ( x264_t));
    int i;

    memcpy(&h->param, param, sizeof ( x264_param_t));

    h->cpu = param->cpu;

    /* no SPS and PPS active yet */
    h->sps = NULL;
    h->pps = NULL;

    for (i = 0; i < 32; i++)
    {
        h->sps_array[i].i_id = -1; /* invalidate it */
    }
    for (i = 0; i < 256; i++)
    {
        h->pps_array[i].i_id = -1; /* invalidate it */
    }

    h->picture =(x264_picture_t*) x264_aligned_alloc(sizeof ( x264_picture_t));
    h->picture->i_width = 0;
    h->picture->i_height = 0;

    /* init predict_XxX */
    x264_predict_16x16_init(h->cpu, h->predict_16x16);
    x264_predict_8x8_init(h->cpu, h->predict_8x8);
    x264_predict_4x4_init(h->cpu, h->predict_4x4);

    x264_pixel_init(h->cpu, &h->pixf);
    x264_dct_init(h->cpu, &h->dctf);

    x264_mc_init(h->cpu, h->mc);

    /* create the vlc table (we could remove it from x264_t but it will need
     * to introduce a x264_init() for global librarie) */
    for (i = 0; i < 5; i++)
    {
        /* max 2 step */
        h->x264_coeff_token_lookup[i] = x264_vlc_table_lookup_new(x264_coeff_token[i], 17 * 4, 8);
    }
    /* max 2 step */
    h->x264_level_prefix_lookup = x264_vlc_table_lookup_new(x264_level_prefix, 16, 8);

    for (i = 0; i < 15; i++)
    {
        /* max 1 step */
        h->x264_total_zeros_lookup[i] = x264_vlc_table_lookup_new(x264_total_zeros[i], 16, 9);
    }
    for (i = 0; i < 3; i++)
    {
        /* max 1 step */
        h->x264_total_zeros_dc_lookup[i] = x264_vlc_table_lookup_new(x264_total_zeros_dc[i], 4, 3);
    }
    for (i = 0; i < 7; i++)
    {
        /* max 2 step */
        h->x264_run_before_lookup[i] = x264_vlc_table_lookup_new(x264_run_before[i], 15, 6);
    }

    return h;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x11bcd(%rip), %rdi     # 0x1b1b4
leaq 0x14106(%rip), %rsi     # 0x1d6f4
leaq 0x14121(%rip), %rdx     # 0x1d716
xorl %eax, %eax
callq 0x39ba
movl $0x10f4c0, %edi         # imm = 0x10F4C0
callq 0x34d2
movq %rax, %rbx
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups 0x30(%r14), %xmm3
movups %xmm0, 0x80(%rax)
movups %xmm1, 0x90(%rax)
movups %xmm2, 0xa0(%rax)
movups %xmm3, 0xb0(%rax)
movl (%r14), %eax
movl %eax, (%rbx)
andq $0x0, 0x8ed8(%rbx)
andq $0x0, 0x10dae0(%rbx)
movl $0xd8, %eax
cmpq $0x8ed8, %rax           # imm = 0x8ED8
je 0x9666
orl $-0x1, (%rbx,%rax)
addq $0x470, %rax            # imm = 0x470
jmp 0x9652
movl $0x8ee0, %eax           # imm = 0x8EE0
cmpq $0x10dae0, %rax         # imm = 0x10DAE0
je 0x967f
orl $-0x1, (%rbx,%rax)
addq $0x104c, %rax           # imm = 0x104C
jmp 0x966b
pushq $0x40
popq %rdi
callq 0x34d2
movq %rax, 0x10ee48(%rbx)
andq $0x0, (%rax)
movl (%rbx), %edi
leaq 0x10f1d8(%rbx), %rsi
callq 0x86f0
movl (%rbx), %edi
leaq 0x10f210(%rbx), %rsi
callq 0x89bf
movl (%rbx), %edi
leaq 0x10f248(%rbx), %rsi
callq 0x8d4b
movl (%rbx), %edi
leaq 0x10f2a8(%rbx), %rsi
callq 0x7dd0
movl (%rbx), %edi
leaq 0x10f398(%rbx), %rsi
callq 0x361c
movl (%rbx), %edi
movq %rbx, %rsi
addq $0x10f380, %rsi         # imm = 0x10F380
callq 0x72b0
movl $0x21e79, %r13d         # imm = 0x21E79
leaq 0x12a0a(%rip), %r14     # 0x1c100
pushq $0x44
popq %r15
pushq $0x8
popq %r12
cmpq $0x21e7e, %r13          # imm = 0x21E7E
je 0x9725
movq %r14, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0xcf98
movq %rax, (%rbx,%r13,8)
incq %r13
addq $0x220, %r14            # imm = 0x220
jmp 0x96fe
leaq 0x128f4(%rip), %rdi     # 0x1c020
pushq $0x10
popq %r14
pushq $0x8
popq %rdx
movl %r14d, %esi
callq 0xcf98
movq %rax, 0x10f3f0(%rbx)
movl $0x21e7f, %r13d         # imm = 0x21E7F
leaq 0x13451(%rip), %r15     # 0x1cba0
pushq $0x9
popq %r12
cmpq $0x21e8e, %r13          # imm = 0x21E8E
je 0x9777
movq %r15, %rdi
movl %r14d, %esi
movl %r12d, %edx
callq 0xcf98
movq %rax, (%rbx,%r13,8)
incq %r13
subq $-0x80, %r15
jmp 0x9753
movl $0x21e8e, %r13d         # imm = 0x21E8E
leaq 0x1291c(%rip), %r14     # 0x1c0a0
pushq $0x4
popq %r15
pushq $0x3
popq %r12
cmpq $0x21e91, %r13          # imm = 0x21E91
je 0x97b0
movq %r14, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0xcf98
movq %rax, (%rbx,%r13,8)
incq %r13
addq $0x20, %r14
jmp 0x978c
movl $0x21e91, %r13d         # imm = 0x21E91
leaq 0x13b63(%rip), %r14     # 0x1d320
pushq $0xf
popq %r15
pushq $0x6
popq %r12
cmpq $0x21e98, %r13          # imm = 0x21E98
je 0x97e9
movq %r14, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0xcf98
movq %rax, (%rbx,%r13,8)
incq %r13
addq $0x78, %r14
jmp 0x97c5
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq