LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/xiane[P]libvphevcodec/vdi.cpp
// Function: vdi_set_bit_firmware_to_pm(unsigned int, unsigned short const*)
s32 vdi_set_bit_firmware_to_pm(u32 core_idx, const u16 *code) {
    s32 i;
    vpu_bit_firmware_info_t bit_firmware_info;
    vdi_info_t *vdi;

    if (core_idx >= MAX_NUM_VPU_CORE)
        return 0;

    vdi = &s_vdi_info[core_idx];
    if (!vdi || vdi->vpu_fd < 0 || vdi->opened == 0)
        return 0;

    bit_firmware_info.size = sizeof(vpu_bit_firmware_info_t);
    bit_firmware_info.core_idx = core_idx;
    bit_firmware_info.reg_base_offset = 0;
    for (i = 0; i < 512; i++)
        bit_firmware_info.bit_code[i] = code[i];

    if (write(vdi->vpu_fd, &bit_firmware_info, bit_firmware_info.size) < 0) {
        VLOG(ERR, "[VDI] fail to vdi_set_bit_firmware core=%d", bit_firmware_info.core_idx);
        return -1;
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x430, %rsp            # imm = 0x430
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x1, -0x8(%rbp)
jb 0x9f14
movl $0x0, -0x4(%rbp)
jmp 0xa00c
movl -0x8(%rbp), %eax
movl %eax, %ecx
leaq 0x292f0(%rip), %rax     # 0x33210
imulq $0x2888, %rcx, %rcx     # imm = 0x2888
addq %rcx, %rax
movq %rax, -0x428(%rbp)
cmpq $0x0, -0x428(%rbp)
je 0x9f58
movq -0x428(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jl 0x9f58
movq -0x428(%rbp), %rax
movzbl 0x8(%rax), %eax
cmpl $0x0, %eax
jne 0x9f64
movl $0x0, -0x4(%rbp)
jmp 0xa00c
movl $0x40c, -0x420(%rbp)    # imm = 0x40C
movl -0x8(%rbp), %eax
movl %eax, -0x41c(%rbp)
movl $0x0, -0x418(%rbp)
movl $0x0, -0x14(%rbp)
cmpl $0x200, -0x14(%rbp)     # imm = 0x200
jge 0x9fb4
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movw (%rax,%rcx,2), %cx
movslq -0x14(%rbp), %rax
movw %cx, -0x414(%rbp,%rax,2)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x9f88
movq -0x428(%rbp), %rax
movl 0x4(%rax), %edi
movl -0x420(%rbp), %eax
movl %eax, %edx
leaq -0x420(%rbp), %rsi
callq 0x20d0
cmpq $0x0, %rax
jge 0xa005
jmp 0x9fda
movl -0x41c(%rbp), %esi
leaq 0x26506(%rip), %rdi     # 0x304ed
movb $0x0, %al
callq 0x2050
leaq 0x26271(%rip), %rdi     # 0x30266
movb $0x0, %al
callq 0x2050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xa00c
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x430, %rsp            # imm = 0x430
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/xiane[P]libvphevcodec/vdi.cpp
// Function: vdi_get_common_memory(unsigned int, vpu_buffer_t*)
s32 vdi_get_common_memory(u32 core_idx, vpu_buffer_t *vb) {
    vdi_info_t *vdi;

    if (core_idx >= MAX_NUM_VPU_CORE)
        return -1;

    vdi = &s_vdi_info[core_idx];
    if (!vdi || vdi->vpu_fd < 0 || vdi->opened == 0)
        return -1;

    memcpy(vb, &vdi->vpu_common_memory, sizeof(vpu_buffer_t));
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x1, -0x8(%rbp)
jb 0xa03a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xa0a9
movl -0x8(%rbp), %eax
movl %eax, %ecx
leaq 0x291ca(%rip), %rax     # 0x33210
imulq $0x2888, %rcx, %rcx     # imm = 0x2888
addq %rcx, %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xa072
movq -0x18(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jl 0xa072
movq -0x18(%rbp), %rax
movzbl 0x8(%rax), %eax
cmpl $0x0, %eax
jne 0xa07b
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xa0a9
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x60(%rcx), %rdx
movq %rdx, (%rax)
movq 0x68(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x70(%rcx), %rdx
movq %rdx, 0x10(%rax)
movq 0x78(%rcx), %rcx
movq %rcx, 0x18(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/xiane[P]libvphevcodec/vdi.cpp
// Function: vdi_open_instance(unsigned int, unsigned int)
s32 vdi_open_instance(u32 core_idx, u32 inst_idx) {
    vdi_info_t *vdi;
    vpudrv_inst_info_t inst_info;
    u32* pCodecInst;

    if (core_idx >= MAX_NUM_VPU_CORE)
        return -1;

    vdi = &s_vdi_info[core_idx];
    if (!vdi || vdi->vpu_fd < 0 || vdi->opened == 0)
        return -1;

    inst_info.core_idx = core_idx;
    inst_info.inst_idx = inst_idx;
    if (ioctl(vdi->vpu_fd, VDI_IOCTL_OPEN_INSTANCE, &inst_info) < 0) {
        VLOG(ERR, "[VDI] fail to deliver open instance num inst_idx=%d", inst_idx);
        return -1;
    }
    vdi->pvip->vpu_instance_num = inst_info.inst_open_count;
    pCodecInst = (u32 *) vdi->pvip->codecInstPool[inst_idx];
    pCodecInst[0] = 1;
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
cmpl $0x1, -0x8(%rbp)
jb 0xa0d0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xa19e
movl -0x8(%rbp), %eax
movl %eax, %ecx
leaq 0x29134(%rip), %rax     # 0x33210
imulq $0x2888, %rcx, %rcx     # imm = 0x2888
addq %rcx, %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xa108
movq -0x18(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jl 0xa108
movq -0x18(%rbp), %rax
movzbl 0x8(%rax), %eax
cmpl $0x0, %eax
jne 0xa114
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xa19e
movl -0x8(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movl 0x4(%rax), %edi
movl $0x400c5609, %esi       # imm = 0x400C5609
leaq -0x24(%rbp), %rdx
movb $0x0, %al
callq 0x2230
cmpl $0x0, %eax
jge 0xa166
jmp 0xa13e
movl -0xc(%rbp), %esi
leaq 0x26448(%rip), %rdi     # 0x30590
movb $0x0, %al
callq 0x2050
leaq 0x26110(%rip), %rdi     # 0x30266
movb $0x0, %al
callq 0x2050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xa19e
movl -0x1c(%rbp), %ecx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl %ecx, 0x20020(%rax)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl -0xc(%rbp), %ecx
shlq $0xf, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movl $0x1, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/xiane[P]libvphevcodec/vdi.cpp
// Function: vdi_get_instance_num(unsigned int)
s32 vdi_get_instance_num(u32 core_idx) {
    vdi_info_t *vdi;

    if (core_idx >= MAX_NUM_VPU_CORE)
        return -1;

    vdi = &s_vdi_info[core_idx];
    if (!vdi || vdi->vpu_fd < 0 || vdi->opened == 0)
        return -1;

    return vdi->pvip->vpu_instance_num;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
cmpl $0x1, -0x8(%rbp)
jb 0xa2c6
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xa318
movl -0x8(%rbp), %eax
movl %eax, %ecx
leaq 0x28f3e(%rip), %rax     # 0x33210
imulq $0x2888, %rcx, %rcx     # imm = 0x2888
addq %rcx, %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xa2fe
movq -0x10(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jl 0xa2fe
movq -0x10(%rbp), %rax
movzbl 0x8(%rax), %eax
cmpl $0x0, %eax
jne 0xa307
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xa318
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x20020(%rax), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/xiane[P]libvphevcodec/vdi.cpp
// Function: vdi_hw_reset(unsigned int)
s32 vdi_hw_reset(u32 core_idx) {
    vdi_info_t *vdi;

    if (core_idx >= MAX_NUM_VPU_CORE)
        return -1;

    vdi = &s_vdi_info[core_idx];
    if (!vdi || vdi->vpu_fd < 0 || vdi->opened == 0)
        return -1;

    return ioctl(vdi->vpu_fd, VDI_IOCTL_RESET, 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x8(%rbp)
cmpl $0x1, -0x8(%rbp)
jb 0xa33a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xa393
movl -0x8(%rbp), %eax
movl %eax, %ecx
leaq 0x28eca(%rip), %rax     # 0x33210
imulq $0x2888, %rcx, %rcx     # imm = 0x2888
addq %rcx, %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xa372
movq -0x10(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jl 0xa372
movq -0x10(%rbp), %rax
movzbl 0x8(%rax), %eax
cmpl $0x0, %eax
jne 0xa37b
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xa393
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edi
movl $0x40045604, %esi       # imm = 0x40045604
xorl %edx, %edx
movb $0x0, %al
callq 0x2230
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/xiane[P]libvphevcodec/vdi.cpp
// Function: vdi_write_register(unsigned int, unsigned int, unsigned int)
void vdi_write_register(u32 core_idx, u32 addr, u32 data) {
    vdi_info_t *vdi;
    ulong *reg_addr;

    if (core_idx >= MAX_NUM_VPU_CORE)
        return;

    vdi = &s_vdi_info[core_idx];
    if (!vdi || vdi->vpu_fd < 0 || vdi->opened == 0)
        return;

    reg_addr = (ulong *) (addr + (ulong) vdi->vdb_register.virt_addr);
    *(volatile u32 *) reg_addr = data;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
cmpl $0x1, -0x4(%rbp)
jb 0xa3b5
jmp 0xa407
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x28e4f(%rip), %rax     # 0x33210
imulq $0x2888, %rcx, %rcx     # imm = 0x2888
addq %rcx, %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xa3ed
movq -0x18(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jl 0xa3ed
movq -0x18(%rbp), %rax
movzbl 0x8(%rax), %eax
cmpl $0x0, %eax
jne 0xa3ef
jmp 0xa407
movl -0x8(%rbp), %eax
movq -0x18(%rbp), %rcx
addq 0x38(%rcx), %rax
movq %rax, -0x20(%rbp)
movl -0xc(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/xiane[P]libvphevcodec/vdi.cpp
// Function: vdi_read_register(unsigned int, unsigned int)
u32 vdi_read_register(u32 core_idx, u32 addr) {
    vdi_info_t *vdi;
    ulong *reg_addr;

    if (core_idx >= MAX_NUM_VPU_CORE)
        return (u32) -1;

    vdi = &s_vdi_info[core_idx];
    if (!vdi || vdi->vpu_fd < 0 || vdi->opened == 0)
        return (u32) -1;

    reg_addr = (ulong *) (addr + (ulong) vdi->vdb_register.virt_addr);
    return *(volatile u32 *) reg_addr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
cmpl $0x1, -0x8(%rbp)
jb 0xa429
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xa482
movl -0x8(%rbp), %eax
movl %eax, %ecx
leaq 0x28ddb(%rip), %rax     # 0x33210
imulq $0x2888, %rcx, %rcx     # imm = 0x2888
addq %rcx, %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xa461
movq -0x18(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jl 0xa461
movq -0x18(%rbp), %rax
movzbl 0x8(%rax), %eax
cmpl $0x0, %eax
jne 0xa46a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xa482
movl -0xc(%rbp), %eax
movq -0x18(%rbp), %rcx
addq 0x38(%rcx), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/xiane[P]libvphevcodec/vdi.cpp
// Function: vdi_fio_read_register(unsigned int, unsigned int)
u32 vdi_fio_read_register(u32 core_idx, u32 addr) {
    u32 ctrl;
    u32 count = 0;
    u32 data = 0xffffffff;

    ctrl = (addr & 0xffff);
    ctrl |= (0 << 16); /* read operation */
    vdi_write_register(core_idx, W4_VPU_FIO_CTRL_ADDR, ctrl);
    count = FIO_TIMEOUT;
    while (count--) {
        ctrl = vdi_read_register(core_idx, W4_VPU_FIO_CTRL_ADDR);
        if (ctrl & 0x80000000) {
            data = vdi_read_register(core_idx, W4_VPU_FIO_DATA);
            break;
        }
    }
    return data;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl $0x0, -0x10(%rbp)
movl $0xffffffff, -0x14(%rbp) # imm = 0xFFFFFFFF
movl -0x8(%rbp), %eax
andl $0xffff, %eax           # imm = 0xFFFF
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
orl $0x0, %eax
movl %eax, -0xc(%rbp)
movl -0x4(%rbp), %edi
movl -0xc(%rbp), %edx
movl $0x20, %esi
callq 0x2160
movl $0x2710, -0x10(%rbp)    # imm = 0x2710
movl -0x10(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x10(%rbp)
cmpl $0x0, %eax
je 0xa518
movl -0x4(%rbp), %edi
movl $0x20, %esi
callq 0x2210
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
andl $0x80000000, %eax       # imm = 0x80000000
cmpl $0x0, %eax
je 0xa516
movl -0x4(%rbp), %edi
movl $0x24, %esi
callq 0x2210
movl %eax, -0x14(%rbp)
jmp 0xa518
jmp 0xa4d7
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/xiane[P]libvphevcodec/vdi.cpp
// Function: vdi_fio_write_register(unsigned int, unsigned int, unsigned int)
void vdi_fio_write_register(u32 core_idx, u32 addr, u32 data) {
    u32 ctrl;
    vdi_write_register(core_idx, W4_VPU_FIO_DATA, data);
    ctrl = (addr & 0xffff);
    ctrl |= (1 << 16); /* write operation */
    vdi_write_register(core_idx, W4_VPU_FIO_CTRL_ADDR, ctrl);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl -0x4(%rbp), %edi
movl -0xc(%rbp), %edx
movl $0x24, %esi
callq 0x2160
movl -0x8(%rbp), %eax
andl $0xffff, %eax           # imm = 0xFFFF
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
orl $0x10000, %eax          # imm = 0x10000
movl %eax, -0x10(%rbp)
movl -0x4(%rbp), %edi
movl -0x10(%rbp), %edx
movl $0x20, %esi
callq 0x2160
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/xiane[P]libvphevcodec/vdi.cpp
// Function: WriteRegVCE(unsigned int, unsigned int, unsigned int, unsigned int)
void WriteRegVCE(u32 core_idx, u32 vce_core_idx, u32 vce_addr, u32 udata) {
    s32 vcpu_reg_addr;

    vdi_fio_write_register(core_idx, VCORE_DBG_READY(vce_core_idx), 0);

    vcpu_reg_addr = vce_addr >> 2;
    vdi_fio_write_register(core_idx, VCORE_DBG_DATA(vce_core_idx), udata);
    vdi_fio_write_register(core_idx, VCORE_DBG_ADDR(vce_core_idx), (vcpu_reg_addr) & 0x00007FFF);

    if (vdi_fio_read_register(0, VCORE_DBG_READY(vce_core_idx)) < 0)
        VLOG(ERR, "failed to write VCE register: 0x%04x", vce_addr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl %ecx, -0x10(%rbp)
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
shll $0xc, %esi
addl $0x8000, %esi           # imm = 0x8000
addl $0x308, %esi            # imm = 0x308
xorl %edx, %edx
callq 0x2070
movl -0xc(%rbp), %eax
shrl $0x2, %eax
movl %eax, -0x14(%rbp)
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
shll $0xc, %esi
addl $0x8000, %esi           # imm = 0x8000
addl $0x304, %esi            # imm = 0x304
movl -0x10(%rbp), %edx
callq 0x2070
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
shll $0xc, %esi
addl $0x8000, %esi           # imm = 0x8000
addl $0x300, %esi            # imm = 0x300
movl -0x14(%rbp), %edx
andl $0x7fff, %edx           # imm = 0x7FFF
callq 0x2070
movl -0x8(%rbp), %esi
shll $0xc, %esi
addl $0x8000, %esi           # imm = 0x8000
addl $0x308, %esi            # imm = 0x308
xorl %edi, %edi
callq 0x2030
cmpl $0x0, %eax
jae 0xa63a
jmp 0xa619
movl -0xc(%rbp), %esi
leaq 0x25fa1(%rip), %rdi     # 0x305c4
movb $0x0, %al
callq 0x2050
leaq 0x25c35(%rip), %rdi     # 0x30266
movb $0x0, %al
callq 0x2050
jmp 0xa63a
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/xiane[P]libvphevcodec/vdi.cpp
// Function: ReadRegVCE(unsigned int, unsigned int, unsigned int)
u32 ReadRegVCE(u32 core_idx, u32 vce_core_idx, u32 vce_addr) {
    s32 vcpu_reg_addr;
    s32 udata;
    s32 vce_core_base = 0x8000 + 0x1000 * vce_core_idx;

    vdi_fio_write_register(core_idx, VCORE_DBG_READY(vce_core_idx), 0);

    vcpu_reg_addr = vce_addr >> 2;

    vdi_fio_write_register(core_idx, VCORE_DBG_ADDR(vce_core_idx), vcpu_reg_addr + vce_core_base);

    if (vdi_fio_read_register(0, VCORE_DBG_READY(vce_core_idx)) == 1)
        udata = vdi_fio_read_register(0, VCORE_DBG_DATA(vce_core_idx));
    else
        udata = -1;
    return udata;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl -0x8(%rbp), %eax
shll $0xc, %eax
addl $0x8000, %eax           # imm = 0x8000
movl %eax, -0x18(%rbp)
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
shll $0xc, %esi
addl $0x8000, %esi           # imm = 0x8000
addl $0x308, %esi            # imm = 0x308
xorl %edx, %edx
callq 0x2070
movl -0xc(%rbp), %eax
shrl $0x2, %eax
movl %eax, -0x10(%rbp)
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
shll $0xc, %esi
addl $0x8000, %esi           # imm = 0x8000
addl $0x300, %esi            # imm = 0x300
movl -0x10(%rbp), %edx
addl -0x18(%rbp), %edx
callq 0x2070
movl -0x8(%rbp), %esi
shll $0xc, %esi
addl $0x8000, %esi           # imm = 0x8000
addl $0x308, %esi            # imm = 0x308
xorl %edi, %edi
callq 0x2030
cmpl $0x1, %eax
jne 0xa6e0
movl -0x8(%rbp), %esi
shll $0xc, %esi
addl $0x8000, %esi           # imm = 0x8000
addl $0x304, %esi            # imm = 0x304
xorl %edi, %edi
callq 0x2030
movl %eax, -0x14(%rbp)
jmp 0xa6e7
movl $0xffffffff, -0x14(%rbp) # imm = 0xFFFFFFFF
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/xiane[P]libvphevcodec/vdi.cpp
// Function: vdi_set_sdram(unsigned int, unsigned int, unsigned int, unsigned char)
void vdi_set_sdram(u32 core_idx, u32 addr, u32 len, u8 data) {
    vdi_info_t *vdi;
    u8 *buf;

    if (core_idx >= MAX_NUM_VPU_CORE)
        return;

    vdi = &s_vdi_info[core_idx];
    if (!vdi || vdi->vpu_fd < 0 || vdi->opened == 0)
        return;

    buf = (u8 *) malloc(len);
    if (!buf)
        return;

    memset(buf, data, len);
    vdi_write_memory(core_idx, addr, buf, len);
    free(buf);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %cl, %al
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movb %al, -0xd(%rbp)
cmpl $0x1, -0x4(%rbp)
jb 0xa8b1
jmp 0xa932
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x28953(%rip), %rax     # 0x33210
imulq $0x2888, %rcx, %rcx     # imm = 0x2888
addq %rcx, %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xa8e9
movq -0x18(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jl 0xa8e9
movq -0x18(%rbp), %rax
movzbl 0x8(%rax), %eax
cmpl $0x0, %eax
jne 0xa8eb
jmp 0xa932
movl -0xc(%rbp), %eax
movl %eax, %edi
callq 0x2220
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0xa902
jmp 0xa932
movq -0x20(%rbp), %rdi
movzbl -0xd(%rbp), %eax
movl -0xc(%rbp), %ecx
movl %ecx, %edx
movzbl %al, %esi
callq 0x20f0
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
movq -0x20(%rbp), %rdx
movl -0xc(%rbp), %ecx
callq 0x2120
movq -0x20(%rbp), %rdi
callq 0x2200
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/xiane[P]libvphevcodec/vdi.cpp
// Function: vdi_write_memory(unsigned int, unsigned int, unsigned char*, unsigned int)
s32 vdi_write_memory(u32 core_idx, u32 addr, u8 *data, u32 len) {
    vdi_info_t *vdi;
    vpu_buffer_t vdb;
    ulong offset;
    s32 i;

    if (core_idx >= MAX_NUM_VPU_CORE)
        return -1;

    vdi = &s_vdi_info[core_idx];
    if (!vdi || vdi->vpu_fd < 0 || vdi->opened == 0)
        return -1;

    memset(&vdb, 0x00, sizeof(vpu_buffer_t));

    for (i = 0; i < MAX_VPU_BUFFER_POOL; i++) {
        if (vdi->vpu_buffer_pool[i].inuse == 1) {
            vdb = vdi->vpu_buffer_pool[i].vdb;
            if (addr >= vdb.phys_addr && addr < (vdb.phys_addr + vdb.size))
                break;
        }
    }

    if (!vdb.size) {
        VLOG(ERR, "address 0x%08x is not mapped address!!!", addr);
        return -1;
    }
    offset = addr - (ulong) vdb.phys_addr;
    memcpy((void *) ((ulong) vdb.virt_addr + offset), data, len);
    return len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
cmpl $0x1, -0x8(%rbp)
jb 0xa967
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xaaa0
movl -0x8(%rbp), %eax
movl %eax, %ecx
leaq 0x2889d(%rip), %rax     # 0x33210
imulq $0x2888, %rcx, %rcx     # imm = 0x2888
addq %rcx, %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0xa99f
movq -0x28(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jl 0xa99f
movq -0x28(%rbp), %rax
movzbl 0x8(%rax), %eax
cmpl $0x0, %eax
jne 0xa9ab
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xaaa0
leaq -0x48(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x20f0
movl $0x0, -0x54(%rbp)
cmpl $0x100, -0x54(%rbp)     # imm = 0x100
jge 0xaa49
movq -0x28(%rbp), %rax
addq $0x80, %rax
movslq -0x54(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
cmpl $0x1, 0x20(%rax)
jne 0xaa39
movq -0x28(%rbp), %rax
addq $0x80, %rax
movslq -0x54(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0x48(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x40(%rbp)
movq 0x10(%rax), %rcx
movq %rcx, -0x38(%rbp)
movq 0x18(%rax), %rax
movq %rax, -0x30(%rbp)
movl -0xc(%rbp), %eax
cmpq -0x40(%rbp), %rax
jb 0xaa37
movl -0xc(%rbp), %eax
movq -0x40(%rbp), %rcx
movl -0x48(%rbp), %edx
addq %rdx, %rcx
cmpq %rcx, %rax
jae 0xaa37
jmp 0xaa49
jmp 0xaa39
jmp 0xaa3b
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0xa9c2
cmpl $0x0, -0x48(%rbp)
jne 0xaa79
jmp 0xaa51
movl -0xc(%rbp), %esi
leaq 0x25b8e(%rip), %rdi     # 0x305e9
movb $0x0, %al
callq 0x2050
leaq 0x257fd(%rip), %rdi     # 0x30266
movb $0x0, %al
callq 0x2050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xaaa0
movl -0xc(%rbp), %eax
subq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x30(%rbp), %rdi
addq -0x50(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %eax
movl %eax, %edx
callq 0x2150
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/xiane[P]libvphevcodec/vdi.cpp
// Function: vdi_read_memory(unsigned int, unsigned int, unsigned char*, unsigned int)
s32 vdi_read_memory(u32 core_idx, u32 addr, u8 *data, u32 len) {
    vdi_info_t *vdi;
    vpu_buffer_t vdb;
    ulong offset;
    s32 i;

    if (core_idx >= MAX_NUM_VPU_CORE)
        return -1;

    vdi = &s_vdi_info[core_idx];
    if (!vdi || vdi->vpu_fd < 0 || vdi->opened == 0)
        return -1;

    memset(&vdb, 0x00, sizeof(vpu_buffer_t));

    for (i = 0; i < MAX_VPU_BUFFER_POOL; i++) {
        if (vdi->vpu_buffer_pool[i].inuse == 1) {
            vdb = vdi->vpu_buffer_pool[i].vdb;
            if (addr >= vdb.phys_addr && addr < (vdb.phys_addr + vdb.size))
                break;
        }
    }

    if (!vdb.size)
        return -1;

    offset = addr - (ulong) vdb.phys_addr;
    memcpy(data, (void *) ((ulong) vdb.virt_addr + offset), len);
    return len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
cmpl $0x1, -0x8(%rbp)
jb 0xaad7
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xabef
movl -0x8(%rbp), %eax
movl %eax, %ecx
leaq 0x2872d(%rip), %rax     # 0x33210
imulq $0x2888, %rcx, %rcx     # imm = 0x2888
addq %rcx, %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0xab0f
movq -0x28(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jl 0xab0f
movq -0x28(%rbp), %rax
movzbl 0x8(%rax), %eax
cmpl $0x0, %eax
jne 0xab1b
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xabef
leaq -0x48(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x20f0
movl $0x0, -0x54(%rbp)
cmpl $0x100, -0x54(%rbp)     # imm = 0x100
jge 0xabb9
movq -0x28(%rbp), %rax
addq $0x80, %rax
movslq -0x54(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
cmpl $0x1, 0x20(%rax)
jne 0xaba9
movq -0x28(%rbp), %rax
addq $0x80, %rax
movslq -0x54(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0x48(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x40(%rbp)
movq 0x10(%rax), %rcx
movq %rcx, -0x38(%rbp)
movq 0x18(%rax), %rax
movq %rax, -0x30(%rbp)
movl -0xc(%rbp), %eax
cmpq -0x40(%rbp), %rax
jb 0xaba7
movl -0xc(%rbp), %eax
movq -0x40(%rbp), %rcx
movl -0x48(%rbp), %edx
addq %rdx, %rcx
cmpq %rcx, %rax
jae 0xaba7
jmp 0xabb9
jmp 0xaba9
jmp 0xabab
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0xab32
cmpl $0x0, -0x48(%rbp)
jne 0xabc8
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xabef
movl -0xc(%rbp), %eax
subq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq -0x50(%rbp), %rsi
movl -0x1c(%rbp), %eax
movl %eax, %edx
callq 0x2150
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/xiane[P]libvphevcodec/vdi.cpp
// Function: vdi_dettach_dma_memory(unsigned int, vpu_buffer_t*)
s32 vdi_dettach_dma_memory(u32 core_idx, vpu_buffer_t *vb) {
    vdi_info_t *vdi;
    s32 i;

    if (core_idx >= MAX_NUM_VPU_CORE)
        return -1;

    vdi = &s_vdi_info[core_idx];
    if (!vdi || vdi->vpu_fd < 0 || vdi->opened == 0)
        return -1;

    if (vb->size == 0)
        return -1;

    for (i = 0; i < MAX_VPU_BUFFER_POOL; i++) {
        if (vdi->vpu_buffer_pool[i].vdb.phys_addr == vb->phys_addr) {
            vdi->vpu_buffer_pool[i].inuse = 0;
            vdi->vpu_buffer_pool_count--;
            break;
        }
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x1, -0x8(%rbp)
jb 0xb0ad
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xb17b
movl -0x8(%rbp), %eax
movl %eax, %ecx
leaq 0x28157(%rip), %rax     # 0x33210
imulq $0x2888, %rcx, %rcx     # imm = 0x2888
addq %rcx, %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xb0e5
movq -0x18(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jl 0xb0e5
movq -0x18(%rbp), %rax
movzbl 0x8(%rax), %eax
cmpl $0x0, %eax
jne 0xb0f1
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xb17b
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
jne 0xb103
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xb17b
movl $0x0, -0x1c(%rbp)
cmpl $0x100, -0x1c(%rbp)     # imm = 0x100
jge 0xb174
movq -0x18(%rbp), %rax
addq $0x80, %rax
movslq -0x1c(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xb167
movq -0x18(%rbp), %rax
addq $0x80, %rax
movslq -0x1c(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0x20(%rax)
movq -0x18(%rbp), %rax
movl 0x2880(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x2880(%rax)
jmp 0xb174
jmp 0xb169
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xb10a
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/xiane[P]libvphevcodec/vdi.cpp
// Function: vdi_get_clock_gate(unsigned int)
s32 vdi_get_clock_gate(u32 core_idx) {
    vdi_info_t *vdi;
    s32 ret;

    if (core_idx >= MAX_NUM_VPU_CORE)
        return -1;

    vdi = &s_vdi_info[core_idx];
    if (!vdi || vdi->vpu_fd < 0 || vdi->opened == 0)
        return -1;

    ret = vdi->clock_state;
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
cmpl $0x1, -0x8(%rbp)
jb 0xb346
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xb397
movl -0x8(%rbp), %eax
movl %eax, %ecx
leaq 0x27ebe(%rip), %rax     # 0x33210
imulq $0x2888, %rcx, %rcx     # imm = 0x2888
addq %rcx, %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xb37e
movq -0x10(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jl 0xb37e
movq -0x10(%rbp), %rax
movzbl 0x8(%rax), %eax
cmpl $0x0, %eax
jne 0xb387
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xb397
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/xiane[P]libvphevcodec/vdi.cpp
// Function: vdi_wait_bus_busy(unsigned int, unsigned int, unsigned int)
s32 vdi_wait_bus_busy(u32 core_idx, u32 timeoutMs, u32 gdi_busy_flag) {
    ulong elapse, cur;
    struct timeval tv;
    vdi_info_t *vdi;

    vdi = &s_vdi_info[core_idx];
    tv.tv_sec = 0;
    tv.tv_usec = 0;
    gettimeofday(&tv, NULL);
    elapse = tv.tv_sec * 1000 + tv.tv_usec / 1000;

    while (1) {
        if (vdi_fio_read_register(core_idx, gdi_busy_flag) == 0x738)
            break;
        gettimeofday(&tv, NULL);
        cur = tv.tv_sec * 1000 + tv.tv_usec / 1000;
        if ((cur - elapse) > timeoutMs) {
            VLOG(ERR, "[VDI] vdi_wait_bus_busy timeout, timeoutMs: %d, PC=0x%x",
                                                     timeoutMs, vdi_read_register(core_idx, W4_VCPU_CUR_PC));
            return -1;
        }
        usleep(5);
    }
    return 0;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl -0x8(%rbp), %eax
movl %eax, %ecx
leaq 0x27e53(%rip), %rax     # 0x33210
imulq $0x2888, %rcx, %rcx     # imm = 0x2888
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x28(%rbp)
leaq -0x30(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x22a0
imulq $0x3e8, -0x30(%rbp), %rax # imm = 0x3E8
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rax
movl $0x3e8, %ecx            # imm = 0x3E8
cqto
idivq %rcx
movq %rax, %rcx
movq -0x40(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movl -0x8(%rbp), %edi
movl -0x10(%rbp), %esi
callq 0x2030
cmpl $0x738, %eax            # imm = 0x738
jne 0xb427
jmp 0xb4ba
leaq -0x30(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x22a0
imulq $0x3e8, -0x30(%rbp), %rax # imm = 0x3E8
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rax
movl $0x3e8, %ecx            # imm = 0x3E8
cqto
idivq %rcx
movq %rax, %rcx
movq -0x48(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
subq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
cmpq %rcx, %rax
jbe 0xb4ab
jmp 0xb46e
movl -0xc(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl -0x8(%rbp), %edi
movl $0x4, %esi
callq 0x2210
movl -0x4c(%rbp), %esi
movl %eax, %edx
leaq 0x252bb(%rip), %rdi     # 0x30748
movb $0x0, %al
callq 0x2050
leaq 0x24dcb(%rip), %rdi     # 0x30266
movb $0x0, %al
callq 0x2050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xb4c1
movl $0x5, %edi
callq 0x2240
jmp 0xb410
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/xiane[P]libvphevcodec/vdi.cpp
// Function: vdi_wait_interrupt(unsigned int, unsigned int)
s32 vdi_wait_interrupt(u32 coreIdx, u32 timeout) {
    s32 intr_reason = 0;
    s32 ret;
    vdi_info_t *vdi;
    vpudrv_intr_info_t intr_info;

    if (coreIdx >= MAX_NUM_VPU_CORE)
        return -1;

    vdi = &s_vdi_info[coreIdx];
    if (!vdi || vdi->vpu_fd < 0 || vdi->opened == 0)
        return -1;

    intr_info.timeout = timeout;
    intr_info.intr_reason = 0;
    ret = ioctl(vdi->vpu_fd, VDI_IOCTL_WAIT_INTERRUPT, (void*) &intr_info);
    if (ret != 0)
        return -1;

    intr_reason = intr_info.intr_reason;
    return intr_reason;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
cmpl $0x1, -0x8(%rbp)
jb 0xb677
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xb6fa
movl -0x8(%rbp), %eax
movl %eax, %ecx
leaq 0x27b8d(%rip), %rax     # 0x33210
imulq $0x2888, %rcx, %rcx     # imm = 0x2888
addq %rcx, %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0xb6af
movq -0x20(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jl 0xb6af
movq -0x20(%rbp), %rax
movzbl 0x8(%rax), %eax
cmpl $0x0, %eax
jne 0xb6b8
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xb6fa
movl -0xc(%rbp), %eax
movl %eax, -0x28(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x20(%rbp), %rax
movl 0x4(%rax), %edi
movl $0x40085602, %esi       # imm = 0x40085602
leaq -0x28(%rbp), %rdx
movb $0x0, %al
callq 0x2230
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0xb6ee
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xb6fa
movl -0x24(%rbp), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/xiane[P]libvphevcodec/vdi.cpp
// Function: flush_memory(unsigned int, vpu_buffer_t*)
s32 flush_memory(u32 core_idx, vpu_buffer_t *vb) {
    vdi_info_t *vdi;
    s32 i, ret = -1;
    vpu_buffer_t vdb;

    if (core_idx >= MAX_NUM_VPU_CORE)
        return -1;

    vdi = &s_vdi_info[core_idx];
    if (!vdi || vdi->vpu_fd < 0 || vdi->opened == 0)
        return -1;

    memset(&vdb, 0x00, sizeof(vpu_buffer_t));

    for (i = 0; i < MAX_VPU_BUFFER_POOL; i++) {
        if (vdi->vpu_buffer_pool[i].vdb.phys_addr == vb->phys_addr) {
            vdb = vdi->vpu_buffer_pool[i].vdb;
            break;
        }
    }
    VLOG(DEBUG, "[VDI] flush_memory vdb.size = %d", vdb.size);
    if (vdb.size > 0)
        ret = ioctl(vdi->vpu_fd, VDI_IOCTL_FLUSH_BUFFER, (void*) &vdb);
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0xffffffff, -0x20(%rbp) # imm = 0xFFFFFFFF
cmpl $0x1, -0x8(%rbp)
jb 0xb738
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xb82c
movl -0x8(%rbp), %eax
movl %eax, %ecx
leaq 0x27acc(%rip), %rax     # 0x33210
imulq $0x2888, %rcx, %rcx     # imm = 0x2888
addq %rcx, %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xb770
movq -0x18(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jl 0xb770
movq -0x18(%rbp), %rax
movzbl 0x8(%rax), %eax
cmpl $0x0, %eax
jne 0xb77c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xb82c
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x20f0
movl $0x0, -0x1c(%rbp)
cmpl $0x100, -0x1c(%rbp)     # imm = 0x100
jge 0xb802
movq -0x18(%rbp), %rax
addq $0x80, %rax
movslq -0x1c(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xb7f5
movq -0x18(%rbp), %rax
addq $0x80, %rax
movslq -0x1c(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0x40(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x38(%rbp)
movq 0x10(%rax), %rcx
movq %rcx, -0x30(%rbp)
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0xb802
jmp 0xb7f7
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xb793
jmp 0xb804
jmp 0xb806
cmpl $0x0, -0x40(%rbp)
jbe 0xb826
movq -0x18(%rbp), %rax
movl 0x4(%rax), %edi
movl $0x4020560d, %esi       # imm = 0x4020560D
leaq -0x40(%rbp), %rdx
movb $0x0, %al
callq 0x2230
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lua.c
// Function: main
int main (int argc, char **argv) {
  int status, result;
  lua_State *L = luaL_newstate();  /* create state */
  if (L == NULL) {
    l_message(argv[0], "cannot create state: not enough memory");
    return EXIT_FAILURE;
  }
  /* call 'pmain' in protected mode */
  lua_pushcfunction(L, &pmain);
  lua_pushinteger(L, argc);  /* 1st argument */
  lua_pushlightuserdata(L, argv); /* 2nd argument */
  status = lua_pcall(L, 2, 1, 0);
  result = lua_toboolean(L, -1);  /* get result */
  finalreport(L, status);
  lua_close(L);
  return (result && status == LUA_OK) ? EXIT_SUCCESS : EXIT_FAILURE;
}

// Assembly:
subq $0x28, %rsp
movl $0x0, 0x24(%rsp)
movl %edi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
callq 0xe1e0
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x7718
movq 0x18(%rsp), %rax
movq (%rax), %rdi
leaq 0x2d90a(%rip), %rsi     # 0x35010
callq 0x77d0
movl $0x1, 0x24(%rsp)
jmp 0x77c5
movq 0x8(%rsp), %rdi
leaq 0x12c(%rip), %rsi       # 0x7850
xorl %edx, %edx
callq 0xa1e0
movq 0x8(%rsp), %rdi
movslq 0x20(%rsp), %rsi
callq 0x9e70
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0xa380
movq 0x8(%rsp), %rdi
movl $0x2, %esi
movl $0x1, %edx
xorl %r8d, %r8d
xorl %eax, %eax
movl %eax, %r9d
movl %r8d, %ecx
callq 0xb1c0
movl %eax, 0x14(%rsp)
movq 0x8(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x9a10
movl %eax, 0x10(%rsp)
movq 0x8(%rsp), %rdi
movl 0x14(%rsp), %esi
callq 0x7aa0
movq 0x8(%rsp), %rdi
callq 0x202c0
xorl %eax, %eax
cmpl $0x0, 0x10(%rsp)
movb %al, 0x7(%rsp)
je 0x77b0
cmpl $0x0, 0x14(%rsp)
sete %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %dl
movl $0x1, %eax
xorl %ecx, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lua.c
// Function: finalreport
static void finalreport (lua_State *L, int status) {
  if (status != LUA_OK) {
    const char *msg = (lua_type(L, -1) == LUA_TSTRING) ? lua_tostring(L, -1)
                                                       : NULL;
    if (msg == NULL) msg = "(error object is not a string)";
    l_message(progname, msg);
    lua_pop(L, 1);
  }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl %esi, 0x1c(%rsp)
cmpl $0x0, 0x1c(%rsp)
je 0x7b29
movq 0x20(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x9350
cmpl $0x4, %eax
jne 0x7ae2
movq 0x20(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, %edx
callq 0x9a80
movq %rax, 0x8(%rsp)
jmp 0x7aeb
xorl %eax, %eax
movq %rax, 0x8(%rsp)
jmp 0x7aeb
movq 0x8(%rsp), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x7b09
leaq 0x2d746(%rip), %rax     # 0x3524a
movq %rax, 0x10(%rsp)
movq 0x397e8(%rip), %rdi     # 0x412f8
movq 0x10(%rsp), %rsi
callq 0x77d0
movq 0x20(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x8e50
addq $0x28, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lua.c
// Function: print_usage
static void print_usage (const char *badoption) {
  luai_writestringerror("%s: ", progname);
  if (badoption[1] == 'e' || badoption[1] == 'l')
    luai_writestringerror("'%s' needs argument\n", badoption);
  else
    luai_writestringerror("unrecognized option '%s'\n", badoption);
  luai_writestringerror(
  "usage: %s [options] [script [args]]\n"
  "Available options are:\n"
  "  -e stat  execute string " LUA_QL("stat") "\n"
  "  -i       enter interactive mode after executing " LUA_QL("script") "\n"
  "  -l name  require library " LUA_QL("name") "\n"
  "  -v       show version information\n"
  "  -E       ignore environment variables\n"
  "  --       stop handling options\n"
  "  -        stop handling options and execute stdin\n"
  ,
  progname);
}

// Assembly:
pushq %rax
movq %rdi, (%rsp)
movq 0x39274(%rip), %rax     # 0x40ff0
movq (%rax), %rdi
movq 0x39572(%rip), %rdx     # 0x412f8
leaq 0x2d2aa(%rip), %rsi     # 0x35037
movb $0x0, %al
callq 0x7310
movq 0x39255(%rip), %rax     # 0x40ff0
movq (%rax), %rdi
callq 0x73b0
movq (%rsp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x65, %eax
je 0x7dbd
movq (%rsp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x6c, %eax
jne 0x7dea
movq 0x3922c(%rip), %rax     # 0x40ff0
movq (%rax), %rdi
movq (%rsp), %rdx
leaq 0x2d278(%rip), %rsi     # 0x3504a
movb $0x0, %al
callq 0x7310
movq 0x39210(%rip), %rax     # 0x40ff0
movq (%rax), %rdi
callq 0x73b0
jmp 0x7e15
movq 0x391ff(%rip), %rax     # 0x40ff0
movq (%rax), %rdi
movq (%rsp), %rdx
leaq 0x2d260(%rip), %rsi     # 0x3505f
movb $0x0, %al
callq 0x7310
movq 0x391e3(%rip), %rax     # 0x40ff0
movq (%rax), %rdi
callq 0x73b0
movq 0x391d4(%rip), %rax     # 0x40ff0
movq (%rax), %rdi
movq 0x394d2(%rip), %rdx     # 0x412f8
leaq 0x2d24c(%rip), %rsi     # 0x35079
movb $0x0, %al
callq 0x7310
movq 0x391b5(%rip), %rax     # 0x40ff0
movq (%rax), %rdi
callq 0x73b0
popq %rax
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lua.c
// Function: handle_luainit
static int handle_luainit (lua_State *L) {
  const char *name = "=" LUA_INITVERSION;
  const char *init = getenv(name + 1);
  if (init == NULL) {
    name = "=" LUA_INIT;
    init = getenv(name + 1);  /* try alternative name */
  }
  if (init == NULL) return LUA_OK;
  else if (init[0] == '@')
    return dofile(L, init+1);
  else
    return dostring(L, init, name);
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
leaq 0x2d357(%rip), %rax     # 0x35207
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
addq $0x1, %rdi
callq 0x7030
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x7eef
leaq 0x2d33e(%rip), %rax     # 0x35215
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
addq $0x1, %rdi
callq 0x7030
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x7f01
movl $0x0, 0x24(%rsp)
jmp 0x7f3f
movq 0x8(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x40, %eax
jne 0x7f27
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rsi
addq $0x1, %rsi
callq 0x8330
movl %eax, 0x24(%rsp)
jmp 0x7f3f
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
callq 0x8390
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lua.c
// Function: runargs
static int runargs (lua_State *L, char **argv, int n) {
  int i;
  for (i = 1; i < n; i++) {
    lua_assert(argv[i][0] == '-');
    switch (argv[i][1]) {  /* option */
      case 'e': {
        const char *chunk = argv[i] + 2;
        if (*chunk == '\0') chunk = argv[++i];
        lua_assert(chunk != NULL);
        if (dostring(L, chunk, "=(command line)") != LUA_OK)
          return 0;
        break;
      }
      case 'l': {
        const char *filename = argv[i] + 2;
        if (*filename == '\0') filename = argv[++i];
        lua_assert(filename != NULL);
        if (dolibrary(L, filename) != LUA_OK)
          return 0;  /* stop if file fails */
        break;
      }
      default: break;
    }
  }
  return 1;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movl %edx, 0x1c(%rsp)
movl $0x1, 0x18(%rsp)
movl 0x18(%rsp), %eax
cmpl 0x1c(%rsp), %eax
jge 0x807e
movq 0x20(%rsp), %rax
movslq 0x18(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x1(%rax), %eax
movl %eax, 0x4(%rsp)
subl $0x65, %eax
je 0x7fa3
jmp 0x7f95
movl 0x4(%rsp), %eax
subl $0x6c, %eax
je 0x800a
jmp 0x806a
movq 0x20(%rsp), %rax
movslq 0x18(%rsp), %rcx
movq (%rax,%rcx,8), %rax
addq $0x2, %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x7fe3
movq 0x20(%rsp), %rax
movl 0x18(%rsp), %ecx
addl $0x1, %ecx
movl %ecx, 0x18(%rsp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rdi
movq 0x10(%rsp), %rsi
leaq 0x2d275(%rip), %rdx     # 0x35269
callq 0x8390
cmpl $0x0, %eax
je 0x8008
movl $0x0, 0x34(%rsp)
jmp 0x8086
jmp 0x806c
movq 0x20(%rsp), %rax
movslq 0x18(%rsp), %rcx
movq (%rax,%rcx,8), %rax
addq $0x2, %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x804a
movq 0x20(%rsp), %rax
movl 0x18(%rsp), %ecx
addl $0x1, %ecx
movl %ecx, 0x18(%rsp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x8670
cmpl $0x0, %eax
je 0x8068
movl $0x0, 0x34(%rsp)
jmp 0x8086
jmp 0x806c
jmp 0x806c
jmp 0x806e
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0x7f6a
movl $0x1, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lua.c
// Function: handle_script
static int handle_script (lua_State *L, char **argv, int n) {
  int status;
  const char *fname;
  int narg = getargs(L, argv, n);  /* collect arguments */
  lua_setglobal(L, "arg");
  fname = argv[n];
  if (strcmp(fname, "-") == 0 && strcmp(argv[n-1], "--") != 0)
    fname = NULL;  /* stdin */
  status = luaL_loadfile(L, fname);
  lua_insert(L, -(narg+1));
  if (status == LUA_OK)
    status = docall(L, narg, LUA_MULTRET);
  else
    lua_pop(L, narg);
  return report(L, status);
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movl %edx, 0x14(%rsp)
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl 0x14(%rsp), %edx
callq 0x86e0
movl %eax, 0x4(%rsp)
movq 0x20(%rsp), %rdi
leaq 0x2f88f(%rip), %rsi     # 0x37954
callq 0xa9a0
movq 0x18(%rsp), %rax
movslq 0x14(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rdi
leaq 0x2ea57(%rip), %rsi     # 0x36b40
callq 0x72d0
cmpl $0x0, %eax
jne 0x8120
movq 0x18(%rsp), %rax
movl 0x14(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x2d174(%rip), %rsi     # 0x35281
callq 0x72d0
cmpl $0x0, %eax
je 0x8120
movq $0x0, 0x8(%rsp)
movq 0x20(%rsp), %rdi
movq 0x8(%rsp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0xd580
movl %eax, 0x10(%rsp)
movq 0x20(%rsp), %rdi
movl 0x4(%rsp), %eax
addl $0x1, %eax
xorl %esi, %esi
subl %eax, %esi
callq 0x90d0
cmpl $0x0, 0x10(%rsp)
jne 0x816c
movq 0x20(%rsp), %rdi
movl 0x4(%rsp), %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x8410
movl %eax, 0x10(%rsp)
jmp 0x817f
movq 0x20(%rsp), %rdi
xorl %esi, %esi
subl 0x4(%rsp), %esi
subl $0x1, %esi
callq 0x8e50
movq 0x20(%rsp), %rdi
movl 0x10(%rsp), %esi
callq 0x84c0
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lua.c
// Function: dotty
static void dotty (lua_State *L) {
  int status;
  const char *oldprogname = progname;
  progname = NULL;
  while ((status = loadline(L)) != -1) {
    if (status == LUA_OK) status = docall(L, 0, LUA_MULTRET);
    report(L, status);
    if (status == LUA_OK && lua_gettop(L) > 0) {  /* any result to print? */
      luaL_checkstack(L, LUA_MINSTACK, "too many results to print");
      lua_getglobal(L, "print");
      lua_insert(L, 1);
      if (lua_pcall(L, lua_gettop(L)-1, 0, 0) != LUA_OK)
        l_message(progname, lua_pushfstring(L,
                               "error calling " LUA_QL("print") " (%s)",
                               lua_tostring(L, -1)));
    }
  }
  lua_settop(L, 0);  /* clear stack */
  luai_writeline();
  progname = oldprogname;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq 0x39148(%rip), %rax     # 0x412f8
movq %rax, 0x20(%rsp)
movq $0x0, 0x39138(%rip) # 0x412f8
movq 0x30(%rsp), %rdi
callq 0x87f0
movl %eax, 0x2c(%rsp)
cmpl $-0x1, %eax
je 0x82de
cmpl $0x0, 0x2c(%rsp)
jne 0x81f3
movq 0x30(%rsp), %rdi
xorl %esi, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x8410
movl %eax, 0x2c(%rsp)
movq 0x30(%rsp), %rdi
movl 0x2c(%rsp), %esi
callq 0x84c0
cmpl $0x0, 0x2c(%rsp)
jne 0x82d9
movq 0x30(%rsp), %rdi
callq 0x8e20
cmpl $0x0, %eax
jle 0x82d9
movq 0x30(%rsp), %rdi
movl $0x14, %esi
leaq 0x2d071(%rip), %rdx     # 0x352a1
callq 0xcd50
movq 0x30(%rsp), %rdi
leaq 0x2d074(%rip), %rsi     # 0x352b5
callq 0xa430
movq 0x30(%rsp), %rdi
movl $0x1, %esi
callq 0x90d0
movq 0x30(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x30(%rsp), %rdi
callq 0x8e20
movq 0x18(%rsp), %rdi
movl %eax, %esi
subl $0x1, %esi
xorl %r8d, %r8d
xorl %eax, %eax
movl %eax, %r9d
movl %r8d, %edx
movl %r8d, %ecx
callq 0xb1c0
cmpl $0x0, %eax
je 0x82d7
movq 0x39066(%rip), %rax     # 0x412f8
movq %rax, 0x10(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x30(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, %edx
callq 0x9a80
movq 0x8(%rsp), %rdi
movq %rax, %rdx
leaq 0x2cff8(%rip), %rsi     # 0x352bb
movb $0x0, %al
callq 0xa0f0
movq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x77d0
jmp 0x82d9
jmp 0x81c0
movq 0x30(%rsp), %rdi
xorl %esi, %esi
callq 0x8e50
movq 0x38cd7(%rip), %rax     # 0x40fc8
movq (%rax), %rcx
leaq 0x2ecea(%rip), %rdi     # 0x36fe5
movl $0x1, %edx
movq %rdx, %rsi
callq 0x7530
movq 0x38cb9(%rip), %rax     # 0x40fc8
movq (%rax), %rdi
callq 0x73b0
movq 0x20(%rsp), %rax
movq %rax, 0x38fd5(%rip)     # 0x412f8
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lua.c
// Function: docall
static int docall (lua_State *L, int narg, int nres) {
  int status;
  int base = lua_gettop(L) - narg;  /* function index */
  lua_pushcfunction(L, traceback);  /* push traceback function */
  lua_insert(L, base);  /* put it under chunk and args */
  globalL = L;  /* to be available to 'laction' */
  signal(SIGINT, laction);
  status = lua_pcall(L, narg, nres, base);
  signal(SIGINT, SIG_DFL);
  lua_remove(L, base);  /* remove traceback function */
  return status;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl %esi, 0xc(%rsp)
movl %edx, 0x8(%rsp)
movq 0x10(%rsp), %rdi
callq 0x8e20
subl 0xc(%rsp), %eax
movl %eax, (%rsp)
movq 0x10(%rsp), %rdi
leaq 0x112(%rip), %rsi       # 0x8550
xorl %edx, %edx
callq 0xa1e0
movq 0x10(%rsp), %rdi
movl (%rsp), %esi
callq 0x90d0
movq 0x10(%rsp), %rax
movq %rax, 0x38eaa(%rip)     # 0x41308
movl $0x2, %edi
leaq 0x186(%rip), %rsi       # 0x85f0
callq 0x72e0
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %esi
movl 0x8(%rsp), %edx
movl (%rsp), %ecx
xorl %r8d, %r8d
xorl %eax, %eax
movl %eax, %r9d
callq 0xb1c0
movl %eax, 0x4(%rsp)
movl $0x2, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x72e0
movq 0x10(%rsp), %rdi
movl (%rsp), %esi
callq 0x8f00
movl 0x4(%rsp), %eax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)