// File: sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TStepStream::_flush_step_code()
void TStepStream::_flush_step_code() {
    step_bufRle.finishAppend();
    const size_t curStepMemSize=step_bufCover_size+step_bufRle.fixed_code.size();
    if (curMaxStepMemSize<curStepMemSize)
        curMaxStepMemSize=curStepMemSize;
    if (isInInit){
        assert(step_buf.empty());
        sumBufSize_forInit+=hpatch_packUInt_size(step_bufCover_size) +
                            hpatch_packUInt_size(step_bufRle.curCodeSize())+
                            curStepMemSize + step_dataDiff.streamSize;
    }else{
        //step head
        assert(step_bufCover_size==step_bufCover.size());
        packUInt(step_buf,step_bufCover.size());
        packUInt(step_buf,step_bufRle.curCodeSize());
        //step cache data
        pushBack(step_buf,step_bufCover);            
        pushBack(step_buf,step_bufRle.fixed_code);
    }
    step_bufCover_size=0;
    step_bufCover.clear();
    step_bufRle.clear();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x18(%rbp)
addq $0x170, %rdi            # imm = 0x170
callq 0x38840
movq -0x18(%rbp), %rdi
movq 0x240(%rdi), %rax
movq %rax, -0x20(%rbp)
addq $0x170, %rdi            # imm = 0x170
callq 0xbe90
movq -0x20(%rbp), %rcx
movq %rax, %rdx
movq -0x18(%rbp), %rax
addq %rdx, %rcx
movq %rcx, -0x10(%rbp)
movq 0x138(%rax), %rax
cmpq -0x10(%rbp), %rax
jae 0x4f179
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, 0x138(%rax)
movq -0x18(%rbp), %rax
testb $0x1, 0x230(%rax)
je 0x4f21b
movq -0x18(%rbp), %rdi
addq $0x248, %rdi            # imm = 0x248
callq 0xce50
testb $0x1, %al
jne 0x4f1a0
jmp 0x4f1a2
jmp 0x4f1c1
leaq 0x61e78(%rip), %rdi     # 0xb1021
leaq 0x6178b(%rip), %rsi     # 0xb093b
movl $0x2ad, %edx            # imm = 0x2AD
leaq 0x61e76(%rip), %rcx     # 0xb1032
callq 0x4270
movq -0x18(%rbp), %rax
movq 0x240(%rax), %rdi
xorl %esi, %esi
callq 0x859b0
movq -0x18(%rbp), %rdi
movl %eax, -0x24(%rbp)
addq $0x170, %rdi            # imm = 0x170
callq 0x50960
movq %rax, %rdi
xorl %esi, %esi
callq 0x859b0
movl -0x24(%rbp), %ecx
movl %eax, %edx
movq -0x18(%rbp), %rax
addl %edx, %ecx
movl %ecx, %ecx
addq -0x10(%rbp), %rcx
addq 0x268(%rax), %rcx
addq 0x238(%rax), %rcx
movq %rcx, 0x238(%rax)
jmp 0x4f2e9
movq -0x18(%rbp), %rdi
movq 0x240(%rdi), %rax
movq %rax, -0x30(%rbp)
addq $0x158, %rdi            # imm = 0x158
callq 0xbe90
movq %rax, %rcx
movq -0x30(%rbp), %rax
cmpq %rcx, %rax
jne 0x4f244
jmp 0x4f263
leaq 0x61e1b(%rip), %rdi     # 0xb1066
leaq 0x616e9(%rip), %rsi     # 0xb093b
movl $0x2b3, %edx            # imm = 0x2B3
leaq 0x61dd4(%rip), %rcx     # 0xb1032
callq 0x4270
movq -0x18(%rbp), %rdi
movq %rdi, %rax
addq $0x248, %rax            # imm = 0x248
movq %rax, -0x40(%rbp)
addq $0x158, %rdi            # imm = 0x158
callq 0xbe90
movq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0x4f320
movq -0x18(%rbp), %rdi
movq %rdi, %rax
addq $0x248, %rax            # imm = 0x248
movq %rax, -0x38(%rbp)
addq $0x170, %rdi            # imm = 0x170
callq 0x50960
movq -0x38(%rbp), %rdi
movq %rax, %rsi
callq 0x4efd0
movq -0x18(%rbp), %rsi
movq %rsi, %rdi
addq $0x248, %rdi            # imm = 0x248
addq $0x158, %rsi            # imm = 0x158
callq 0x4f350
movq -0x18(%rbp), %rsi
movq %rsi, %rdi
addq $0x248, %rdi            # imm = 0x248
addq $0x170, %rsi            # imm = 0x170
callq 0x4f350
movq -0x18(%rbp), %rdi
movq $0x0, 0x240(%rdi)
addq $0x158, %rdi            # imm = 0x158
callq 0xce90
movq -0x18(%rbp), %rdi
addq $0x170, %rdi            # imm = 0x170
callq 0x50920
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)