// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]ramulator/src/StatType.cpp
// Function: Stats::Histogram::grow_out()
void
Histogram::grow_out()
{
    int size = cvec.size();
    int zero = size / 2; // round down!
    int top_half = zero + (size - zero + 1) / 2; // round up!
    int bottom_half = (size - zero) / 2; // round down!

    // grow down
    int low_pair = zero - 1;
    for (int i = zero - 1; i >= bottom_half; i--) {
        cvec[i] = cvec[low_pair];
        if (low_pair - 1 >= 0)
            cvec[i] += cvec[low_pair - 1];
        low_pair -= 2;
    }
    assert(low_pair == 0 || low_pair == -1 || low_pair == -2);

    for (int i = bottom_half - 1; i >= 0; i--)
        cvec[i] = Counter();

    // grow up
    int high_pair = zero;
    for (int i = zero; i < top_half; i++) {
        cvec[i] = cvec[high_pair];
        if (high_pair + 1 < size)
            cvec[i] += cvec[high_pair + 1];
        high_pair += 2;
    }
    assert(high_pair == size || high_pair == size + 1);

    for (int i = top_half; i < size; i++)
        cvec[i] = Counter();

    max_bucket *= 2;
    min_bucket *= 2;
    bucket_size *= 2;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0xb0(%rdi), %r14
movq 0xb8(%rdi), %r15
subq %r14, %r15
shrq $0x3, %r15
movl %r15d, %r12d
shrl $0x1f, %r12d
addl %r15d, %r12d
sarl %r12d
movl %r15d, %ebp
subl %r12d, %ebp
movl %ebp, %eax
shrl $0x1f, %eax
addl %ebp, %eax
sarl %eax
cmpl %eax, %r12d
jle 0x13e9ec
leal -0x1(%r12), %ecx
movslq %ecx, %rcx
movslq %eax, %rdx
movq %rcx, %rsi
movsd (%r14,%rcx,8), %xmm0
movsd %xmm0, (%r14,%rsi,8)
testq %rcx, %rcx
jle 0x13e9da
addsd -0x8(%r14,%rcx,8), %xmm0
movsd %xmm0, (%r14,%rsi,8)
addq $-0x2, %rcx
leaq -0x1(%rsi), %rdi
cmpq %rdx, %rsi
movq %rdi, %rsi
jg 0x13e9bc
jmp 0x13e9f1
leal -0x1(%r12), %ecx
addl $0x2, %ecx
cmpl $0x2, %ecx
ja 0x13eaf2
leal 0x1(%rbp), %ecx
shrl $0x1f, %ecx
leal (%rcx,%rbp), %r13d
incl %r13d
sarl %r13d
leal (%r12,%r13), %edi
cmpl $0x2, %ebp
jl 0x13ea32
decl %eax
leaq 0x8(,%rax,8), %rdx
movl %edi, 0x4(%rsp)
movq %r14, %rdi
xorl %esi, %esi
callq 0xb1d0
movl 0x4(%rsp), %edi
movslq %edi, %rax
movl %r12d, %ecx
testl %ebp, %ebp
jle 0x13ea72
movslq %r12d, %rdx
movslq %r15d, %rsi
leaq 0x1(%rdx), %rcx
movsd -0x8(%r14,%rcx,8), %xmm0
movsd %xmm0, (%r14,%rdx,8)
cmpq %rsi, %rcx
jge 0x13ea64
addsd (%r14,%rcx,8), %xmm0
movsd %xmm0, (%r14,%rdx,8)
incq %rdx
addq $0x2, %rcx
cmpq %rax, %rdx
jl 0x13ea46
decl %ecx
cmpl %r15d, %ecx
sete %dl
leal 0x1(%r15), %esi
cmpl %esi, %ecx
sete %cl
orb %dl, %cl
cmpb $0x1, %cl
jne 0x13eb11
cmpl %r15d, %edi
jge 0x13eaad
leaq (%r14,%rax,8), %rdi
notl %r12d
addl %r15d, %r12d
subl %r13d, %r12d
leaq 0x8(,%r12,8), %rdx
xorl %esi, %esi
callq 0xb1d0
movsd 0x78(%rbx), %xmm0
movsd 0x80(%rbx), %xmm1
addsd %xmm1, %xmm1
movsd %xmm1, 0x80(%rbx)
addsd %xmm0, %xmm0
movsd %xmm0, 0x78(%rbx)
movsd 0x88(%rbx), %xmm0
addsd %xmm0, %xmm0
movsd %xmm0, 0x88(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x21487(%rip), %rdi     # 0x15ff80
leaq 0x214b2(%rip), %rsi     # 0x15ffb2
leaq 0x214bc(%rip), %rcx     # 0x15ffc3
movl $0x21, %edx
callq 0xb200
leaq 0x214cd(%rip), %rdi     # 0x15ffe5
leaq 0x21493(%rip), %rsi     # 0x15ffb2
leaq 0x2149d(%rip), %rcx     # 0x15ffc3
movl $0x2e, %edx
callq 0xb200