// File: /workspace/github_c_makefile_star2_O0/xiane[P]libvphevcodec/AML_HEVCEncoder.cpp
// Function: dumpCodedPicture(AMVHEVCEncHandle_s*, int, unsigned char const*, unsigned int)
void dumpCodedPicture(AMVHEVCEncHandle *Handle, const int idx, const unsigned char *buffer, const uint32_t nal_length) {
    VLOG(INFO, "-------------- Picture[%d] dump --------------", idx);
    VLOG(INFO, " widthxheight - %dx%d", Handle->src_pics[idx].width, Handle->src_pics[idx].height);
    VLOG(INFO, " nal_type     - %x", Handle->src_pics[idx].type);
    VLOG(INFO, " order, pts   - %d, %ld", Handle->src_pics[idx].order,  Handle->src_pics[idx].pts);
    VLOG(INFO, " nal_length   - %d", nal_length);
    VLOG(INFO, "-------------- NAL + PayLoad Start -----------------");

    int max_stride = nal_length / 4;
    for (int i = 0; i < max_stride; i += 8)
        VLOG(INFO, "[%d] %2x %2x %2x %2x %2x %2x %2x %2x", i,
                buffer[i], buffer[i+1], buffer[i+2], buffer[i+3], buffer[i+4], buffer[i+5], buffer[i+6], buffer[i+7]);

    for(int i=0; i < nal_length%4; i++)
        VLOG(INFO, "[%d] %2x", i, buffer[i]);

    VLOG(INFO, "-------------- PayLoad End -------------------");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x48, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movl -0x14(%rbp), %esi
leaq 0x2c41f(%rip), %rdi     # 0x2e8b0
movb $0x0, %al
callq 0x2050
leaq 0x2ddc7(%rip), %rdi     # 0x30266
movb $0x0, %al
callq 0x2050
jmp 0x24a8
movq -0x10(%rbp), %rax
addq $0xa0, %rax
movslq -0x14(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movl 0x44(%rax), %esi
movq -0x10(%rbp), %rax
addq $0xa0, %rax
movslq -0x14(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movl 0x48(%rax), %edx
leaq 0x2c400(%rip), %rdi     # 0x2e8df
movb $0x0, %al
callq 0x2050
leaq 0x2dd79(%rip), %rdi     # 0x30266
movb $0x0, %al
callq 0x2050
jmp 0x24f6
movq -0x10(%rbp), %rax
addq $0xa0, %rax
movslq -0x14(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movl 0x18(%rax), %esi
leaq 0x2c3e0(%rip), %rdi     # 0x2e8f5
movb $0x0, %al
callq 0x2050
leaq 0x2dd43(%rip), %rdi     # 0x30266
movb $0x0, %al
callq 0x2050
jmp 0x252c
movq -0x10(%rbp), %rax
addq $0xa0, %rax
movslq -0x14(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movl 0x40(%rax), %esi
movq -0x10(%rbp), %rax
addq $0xa0, %rax
movslq -0x14(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdx
leaq 0x2c3a5(%rip), %rdi     # 0x2e908
movb $0x0, %al
callq 0x2050
leaq 0x2dcf5(%rip), %rdi     # 0x30266
movb $0x0, %al
callq 0x2050
jmp 0x257a
movl -0x24(%rbp), %esi
leaq 0x2c39c(%rip), %rdi     # 0x2e920
movb $0x0, %al
callq 0x2050
leaq 0x2dcd4(%rip), %rdi     # 0x30266
movb $0x0, %al
callq 0x2050
jmp 0x259b
leaq 0x2c391(%rip), %rdi     # 0x2e933
movb $0x0, %al
callq 0x2050
leaq 0x2dcb6(%rip), %rdi     # 0x30266
movb $0x0, %al
callq 0x2050
movl -0x24(%rbp), %eax
shrl $0x2, %eax
movl %eax, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0x269c
jmp 0x25d5
movl -0x2c(%rbp), %esi
movq -0x20(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movzbl (%rax,%rcx), %edx
movq -0x20(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %ecx
movq -0x20(%rbp), %rax
movl -0x2c(%rbp), %edi
addl $0x2, %edi
movslq %edi, %rdi
movzbl (%rax,%rdi), %r8d
movq -0x20(%rbp), %rax
movl -0x2c(%rbp), %edi
addl $0x3, %edi
movslq %edi, %rdi
movzbl (%rax,%rdi), %r9d
movq -0x20(%rbp), %rax
movl -0x2c(%rbp), %edi
addl $0x4, %edi
movslq %edi, %rdi
movzbl (%rax,%rdi), %ebx
movq -0x20(%rbp), %rax
movl -0x2c(%rbp), %edi
addl $0x5, %edi
movslq %edi, %rdi
movzbl (%rax,%rdi), %r11d
movq -0x20(%rbp), %rax
movl -0x2c(%rbp), %edi
addl $0x6, %edi
movslq %edi, %rdi
movzbl (%rax,%rdi), %r10d
movq -0x20(%rbp), %rax
movl -0x2c(%rbp), %edi
addl $0x7, %edi
movslq %edi, %rdi
movzbl (%rax,%rdi), %eax
leaq 0x2c302(%rip), %rdi     # 0x2e968
movl %ebx, (%rsp)
movl %r11d, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movl %eax, 0x18(%rsp)
movb $0x0, %al
callq 0x2050
leaq 0x2dbe1(%rip), %rdi     # 0x30266
movb $0x0, %al
callq 0x2050
jmp 0x268e
movl -0x2c(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x2c(%rbp)
jmp 0x25c7
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
movl -0x24(%rbp), %ecx
andl $0x3, %ecx
cmpl %ecx, %eax
jae 0x26ea
jmp 0x26b2
movl -0x30(%rbp), %esi
movq -0x20(%rbp), %rax
movslq -0x30(%rbp), %rcx
movzbl (%rax,%rcx), %edx
leaq 0x2c2c5(%rip), %rdi     # 0x2e98d
movb $0x0, %al
callq 0x2050
leaq 0x2db90(%rip), %rdi     # 0x30266
movb $0x0, %al
callq 0x2050
jmp 0x26df
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x26a3
jmp 0x26ec
leaq 0x2c2a3(%rip), %rdi     # 0x2e996
movb $0x0, %al
callq 0x2050
leaq 0x2db65(%rip), %rdi     # 0x30266
movb $0x0, %al
callq 0x2050
addq $0x48, %rsp
popq %rbx
popq %rbp
retq
nop