// File: /workspace/github_c_makefile_star2_O3/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 %rbx
pushq %rax
movq %rdi, %r14
leaq 0x1ba28(%rip), %rdi     # 0x271b4
leaq 0x1df01(%rip), %rsi     # 0x29694
leaq 0x1df1c(%rip), %rdx     # 0x296b6
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x4a56
movl $0x10f4c0, %edi         # imm = 0x10F4C0
callq 0x461e
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)
movq %r15, 0x8ed8(%rbx)
movq %r15, 0x10dae0(%rbx)
movl $0xd8, %eax
movl $0xffffffff, (%rbx,%rax) # imm = 0xFFFFFFFF
addq $0x470, %rax            # imm = 0x470
cmpq $0x8ed8, %rax           # imm = 0x8ED8
jne 0xb7f8
movl $0x8ee0, %eax           # imm = 0x8EE0
movl $0xffffffff, (%rbx,%rax) # imm = 0xFFFFFFFF
addq $0x104c, %rax           # imm = 0x104C
cmpq $0x10dae0, %rax         # imm = 0x10DAE0
jne 0xb812
movl $0x40, %edi
callq 0x461e
movq %rax, 0x10ee48(%rbx)
movq $0x0, (%rax)
movl (%rbx), %edi
leaq 0x10f1d8(%rbx), %rsi
callq 0xa8dc
movl (%rbx), %edi
leaq 0x10f210(%rbx), %rsi
callq 0xaba9
movl (%rbx), %edi
leaq 0x10f248(%rbx), %rsi
callq 0xaf08
movl (%rbx), %edi
leaq 0x10f2a8(%rbx), %rsi
callq 0x9d40
movl (%rbx), %edi
leaq 0x10f398(%rbx), %rsi
callq 0x46a8
movl (%rbx), %edi
movq %rbx, %rsi
addq $0x10f380, %rsi         # imm = 0x10F380
callq 0x85cc
movl $0x21e79, %r15d         # imm = 0x21E79
leaq 0x1c7fd(%rip), %r14     # 0x280a0
movq %r14, %rdi
movl $0x44, %esi
movl $0x8, %edx
callq 0x129d8
movq %rax, (%rbx,%r15,8)
incq %r15
addq $0x220, %r14            # imm = 0x220
cmpq $0x21e7e, %r15          # imm = 0x21E7E
jne 0xb8a3
leaq 0x1c6ed(%rip), %rdi     # 0x27fc0
movl $0x10, %esi
movl $0x8, %edx
callq 0x129d8
movq %rax, 0x10f3f0(%rbx)
movl $0x21e7f, %r15d         # imm = 0x21E7F
leaq 0x1d24a(%rip), %r14     # 0x28b40
movq %r14, %rdi
movl $0x10, %esi
movl $0x9, %edx
callq 0x129d8
movq %rax, (%rbx,%r15,8)
incq %r15
subq $-0x80, %r14
cmpq $0x21e8e, %r15          # imm = 0x21E8E
jne 0xb8f6
movl $0x21e8e, %r15d         # imm = 0x21E8E
leaq 0x1c717(%rip), %r14     # 0x28040
movq %r14, %rdi
movl $0x4, %esi
movl $0x3, %edx
callq 0x129d8
movq %rax, (%rbx,%r15,8)
incq %r15
addq $0x20, %r14
cmpq $0x21e91, %r15          # imm = 0x21E91
jne 0xb929
movl $0x21e91, %r15d         # imm = 0x21E91
leaq 0x1d964(%rip), %r14     # 0x292c0
movq %r14, %rdi
movl $0xf, %esi
movl $0x6, %edx
callq 0x129d8
movq %rax, (%rbx,%r15,8)
incq %r15
addq $0x78, %r14
cmpq $0x21e98, %r15          # imm = 0x21E98
jne 0xb95c
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq