// File: /workspace/github_c_makefile_star2_O0/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
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x1a20d(%rip), %rdi     # 0x28eb0
leaq 0x1c60e(%rip), %rsi     # 0x2b2b8
leaq 0x1c629(%rip), %rdx     # 0x2b2da
movb $0x0, %al
callq 0x4d20
movl $0x10f4c0, %edi         # imm = 0x10F4C0
callq 0x4160
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
addq $0x80, %rdi
movq -0x8(%rbp), %rsi
movl $0x40, %edx
callq 0x20a0
movq -0x8(%rbp), %rax
movl (%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x8ed8(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x10dae0(%rax)
movl $0x0, -0x14(%rbp)
cmpl $0x20, -0x14(%rbp)
jge 0xed3f
movq -0x10(%rbp), %rax
addq $0xd8, %rax
movslq -0x14(%rbp), %rcx
imulq $0x470, %rcx, %rcx      # imm = 0x470
addq %rcx, %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xed10
movl $0x0, -0x14(%rbp)
cmpl $0x100, -0x14(%rbp)     # imm = 0x100
jge 0xed78
movq -0x10(%rbp), %rax
addq $0x8ee0, %rax           # imm = 0x8EE0
movslq -0x14(%rbp), %rcx
imulq $0x104c, %rcx, %rcx     # imm = 0x104C
addq %rcx, %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xed46
movl $0x40, %edi
callq 0x4160
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10ee48(%rax)
movq -0x10(%rbp), %rax
movq 0x10ee48(%rax), %rax
movl $0x0, (%rax)
movq -0x10(%rbp), %rax
movq 0x10ee48(%rax), %rax
movl $0x0, 0x4(%rax)
movq -0x10(%rbp), %rax
movl (%rax), %edi
movq -0x10(%rbp), %rsi
addq $0x10f1d8, %rsi         # imm = 0x10F1D8
callq 0xcab0
movq -0x10(%rbp), %rax
movl (%rax), %edi
movq -0x10(%rbp), %rsi
addq $0x10f210, %rsi         # imm = 0x10F210
callq 0xd040
movq -0x10(%rbp), %rax
movl (%rax), %edi
movq -0x10(%rbp), %rsi
addq $0x10f248, %rsi         # imm = 0x10F248
callq 0xd730
movq -0x10(%rbp), %rax
movl (%rax), %edi
movq -0x10(%rbp), %rsi
addq $0x10f2a8, %rsi         # imm = 0x10F2A8
callq 0xb9a0
movq -0x10(%rbp), %rax
movl (%rax), %edi
movq -0x10(%rbp), %rsi
addq $0x10f398, %rsi         # imm = 0x10F398
callq 0x4430
movq -0x10(%rbp), %rax
movl (%rax), %edi
movq -0x10(%rbp), %rsi
addq $0x10f380, %rsi         # imm = 0x10F380
callq 0xab00
movl $0x0, -0x14(%rbp)
cmpl $0x5, -0x14(%rbp)
jge 0xee86
movslq -0x14(%rbp), %rax
leaq 0x1af01(%rip), %rdi     # 0x29d50
imulq $0x220, %rax, %rax      # imm = 0x220
addq %rax, %rdi
movl $0x44, %esi
movl $0x8, %edx
callq 0x15090
movq %rax, %rdx
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq %rdx, 0x10f3c8(%rax,%rcx,8)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xee3e
leaq 0x1ade3(%rip), %rdi     # 0x29c70
movl $0x10, %esi
movl $0x8, %edx
callq 0x15090
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10f3f0(%rax)
movl $0x0, -0x14(%rbp)
cmpl $0xf, -0x14(%rbp)
jge 0xeef6
movslq -0x14(%rbp), %rax
leaq 0x1b92e(%rip), %rdi     # 0x2a7f0
shlq $0x7, %rax
addq %rax, %rdi
movl $0x10, %esi
movl $0x9, %edx
callq 0x15090
movq %rax, %rdx
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq %rdx, 0x10f3f8(%rax,%rcx,8)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xeeb1
movl $0x0, -0x14(%rbp)
cmpl $0x3, -0x14(%rbp)
jge 0xef42
movslq -0x14(%rbp), %rax
leaq 0x1ade2(%rip), %rdi     # 0x29cf0
shlq $0x5, %rax
addq %rax, %rdi
movl $0x4, %esi
movl $0x3, %edx
callq 0x15090
movq %rax, %rdx
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq %rdx, 0x10f470(%rax,%rcx,8)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xeefd
movl $0x0, -0x14(%rbp)
cmpl $0x7, -0x14(%rbp)
jge 0xef8e
movslq -0x14(%rbp), %rax
leaq 0x1c016(%rip), %rdi     # 0x2af70
imulq $0x78, %rax, %rax
addq %rax, %rdi
movl $0xf, %esi
movl $0x6, %edx
callq 0x15090
movq %rax, %rdx
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq %rdx, 0x10f488(%rax,%rcx,8)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xef49
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)