// File: /workspace/github_c_makefile_star2_O1/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 0x19894(%rip), %rdi     # 0x251b4
leaq 0x1be7d(%rip), %rsi     # 0x277a4
leaq 0x1be98(%rip), %rdx     # 0x277c6
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x4c22
movl $0x10f4c0, %edi         # imm = 0x10F4C0
callq 0x47e2
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 0xb98c
movl $0x8ee0, %eax           # imm = 0x8EE0
movl $0xffffffff, (%rbx,%rax) # imm = 0xFFFFFFFF
addq $0x104c, %rax           # imm = 0x104C
cmpq $0x10dae0, %rax         # imm = 0x10DAE0
jne 0xb9a6
movl $0x40, %edi
callq 0x47e2
movq %rax, 0x10ee48(%rbx)
movq $0x0, (%rax)
movl (%rbx), %edi
leaq 0x10f1d8(%rbx), %rsi
callq 0xaa94
movl (%rbx), %edi
leaq 0x10f210(%rbx), %rsi
callq 0xad61
movl (%rbx), %edi
leaq 0x10f248(%rbx), %rsi
callq 0xb0c0
movl (%rbx), %edi
leaq 0x10f2a8(%rbx), %rsi
callq 0x9f14
movl (%rbx), %edi
leaq 0x10f398(%rbx), %rsi
callq 0x4874
movl (%rbx), %edi
movq %rbx, %rsi
addq $0x10f380, %rsi         # imm = 0x10F380
callq 0x8778
movl $0x21e79, %r15d         # imm = 0x21E79
leaq 0x1a779(%rip), %r14     # 0x261b0
movq %r14, %rdi
movl $0x44, %esi
movl $0x8, %edx
callq 0x12d40
movq %rax, (%rbx,%r15,8)
incq %r15
addq $0x220, %r14            # imm = 0x220
cmpq $0x21e7e, %r15          # imm = 0x21E7E
jne 0xba37
leaq 0x1a669(%rip), %rdi     # 0x260d0
movl $0x10, %esi
movl $0x8, %edx
callq 0x12d40
movq %rax, 0x10f3f0(%rbx)
movl $0x21e7f, %r15d         # imm = 0x21E7F
leaq 0x1b1c6(%rip), %r14     # 0x26c50
movq %r14, %rdi
movl $0x10, %esi
movl $0x9, %edx
callq 0x12d40
movq %rax, (%rbx,%r15,8)
incq %r15
subq $-0x80, %r14
cmpq $0x21e8e, %r15          # imm = 0x21E8E
jne 0xba8a
movl $0x21e8e, %r15d         # imm = 0x21E8E
leaq 0x1a693(%rip), %r14     # 0x26150
movq %r14, %rdi
movl $0x4, %esi
movl $0x3, %edx
callq 0x12d40
movq %rax, (%rbx,%r15,8)
incq %r15
addq $0x20, %r14
cmpq $0x21e91, %r15          # imm = 0x21E91
jne 0xbabd
movl $0x21e91, %r15d         # imm = 0x21E91
leaq 0x1b8e0(%rip), %r14     # 0x273d0
movq %r14, %rdi
movl $0xf, %esi
movl $0x6, %edx
callq 0x12d40
movq %rax, (%rbx,%r15,8)
incq %r15
addq $0x78, %r14
cmpq $0x21e98, %r15          # imm = 0x21E98
jne 0xbaf0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq