// File: /workspace/github_c_makefile_star2_O0/akumrao[P]videoAnalyzer/encoder/encoder.c
// Function: x264_encoder_close(x264_t*)
void x264_encoder_close(x264_t *h) {LOG_CALL;
    int64_t i_mtime_total = i_mtime_analyse + i_mtime_encode + i_mtime_write + i_mtime_filter + 1;
    int i;

    fprintf(stderr, "x264: analyse=%d(%lldms) encode=%d(%lldms) write=%d(%lldms) filter=%d(%lldms)",
            (int) (100 * i_mtime_analyse / i_mtime_total), i_mtime_analyse / 1000,
            (int) (100 * i_mtime_encode / i_mtime_total), i_mtime_encode / 1000,
            (int) (100 * i_mtime_write / i_mtime_total), i_mtime_write / 1000,
            (int) (100 * i_mtime_filter / i_mtime_total), i_mtime_filter / 1000);

    /* ref frames */
    for (i = 0; i < h->param.i_frame_reference + 2; i++)
    {
        x264_frame_delete(h->freference[i]);
    }

    /* empty all allocated picture for bframes */
    for (i = 0; i < h->param.i_bframe; i++)
    {
        if (h->frame_unused[i])
        {
            x264_frame_delete(h->frame_unused[i]);
        }
        if (h->bframe_current[i])
        {
            x264_frame_delete(h->bframe_current[i]);
        }
        if (h->frame_next[i])
        {
            x264_frame_delete(h->frame_next[i]);
        }
    }

    /* rc */
    x264_ratecontrol_delete(h->rc);

    x264_free(h->mb);
    x264_free(h->p_bitstream);
    x264_free(h);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x38, %rsp
movq %rdi, -0x10(%rbp)
leaq 0xea3c(%rip), %rdi      # 0x28eb0
leaq 0x12619(%rip), %rsi     # 0x2ca94
leaq 0x1277f(%rip), %rdx     # 0x2cc01
movb $0x0, %al
callq 0x4d20
movq 0x2f9170(%rip), %rax    # 0x313600
addq 0x2f9171(%rip), %rax    # 0x313608
addq 0x2f9172(%rip), %rax    # 0x313610
addq 0x2f9173(%rip), %rax    # 0x313618
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq 0x1bb1c(%rip), %rax     # 0x35fd0
movq (%rax), %rdi
imulq $0x64, 0x2f9141(%rip), %rax # 0x313600
cqto
idivq -0x18(%rbp)
movl %eax, -0x20(%rbp)
movq 0x2f9131(%rip), %rax    # 0x313600
movl $0x3e8, %ecx            # imm = 0x3E8
cqto
idivq %rcx
movq %rax, %rcx
imulq $0x64, 0x2f9124(%rip), %rax # 0x313608
cqto
idivq -0x18(%rbp)
movl %eax, %r8d
movq 0x2f9114(%rip), %rax    # 0x313608
movl $0x3e8, %esi            # imm = 0x3E8
cqto
idivq %rsi
movq %rax, %r9
imulq $0x64, 0x2f9107(%rip), %rax # 0x313610
cqto
idivq -0x18(%rbp)
movl %eax, %ebx
movq 0x2f90f8(%rip), %rax    # 0x313610
movl $0x3e8, %esi            # imm = 0x3E8
cqto
idivq %rsi
movq %rax, %r11
imulq $0x64, 0x2f90eb(%rip), %rax # 0x313618
cqto
idivq -0x18(%rbp)
movl %eax, %r10d
movq 0x2f90db(%rip), %rax    # 0x313618
movl $0x3e8, %esi            # imm = 0x3E8
cqto
idivq %rsi
movl -0x20(%rbp), %edx
leaq 0x126c3(%rip), %rsi     # 0x2cc14
movl %ebx, (%rsp)
movq %r11, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movb $0x0, %al
callq 0x2160
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
movl 0x98(%rcx), %ecx
addl $0x2, %ecx
cmpl %ecx, %eax
jge 0x1a5a5
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq 0x10eff0(%rax,%rcx,8), %rdi
callq 0x5440
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1a571
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0xa4(%rcx), %eax
jge 0x1a647
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
cmpq $0x0, 0x10ef58(%rax,%rcx,8)
je 0x1a5e7
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq 0x10ef58(%rax,%rcx,8), %rdi
callq 0x5440
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
cmpq $0x0, 0x10ee50(%rax,%rcx,8)
je 0x1a60f
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq 0x10ee50(%rax,%rcx,8), %rdi
callq 0x5440
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
cmpq $0x0, 0x10eed0(%rax,%rcx,8)
je 0x1a637
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq 0x10eed0(%rax,%rcx,8), %rdi
callq 0x5440
jmp 0x1a639
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1a5ac
movq -0x10(%rbp), %rax
movq 0x10f188(%rax), %rdi
callq 0x22f10
movq -0x10(%rbp), %rax
movq 0x10efe8(%rax), %rdi
callq 0x41d0
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rdi
callq 0x41d0
movq -0x10(%rbp), %rdi
callq 0x41d0
addq $0x38, %rsp
popq %rbx
popq %rbp
retq
nopw %cs:(%rax,%rax)