// File: /workspace/github_cpp_makefile_star2_O3/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, %eax
subl %r12d, %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
cmpl %ecx, %r12d
jle 0x13b544
leal -0x1(%r12), %edx
movslq %edx, %rdx
movslq %ecx, %rsi
movq %rdx, %rdi
movsd (%r14,%rdx,8), %xmm0
movsd %xmm0, (%r14,%rdi,8)
testq %rdx, %rdx
jle 0x13b532
addsd -0x8(%r14,%rdx,8), %xmm0
movsd %xmm0, (%r14,%rdi,8)
addq $-0x2, %rdx
leaq -0x1(%rdi), %r8
cmpq %rsi, %rdi
movq %r8, %rdi
jg 0x13b514
jmp 0x13b549
leal -0x1(%r12), %edx
addl $0x2, %edx
cmpl $0x2, %edx
ja 0x13b639
leal 0x1(%rax), %edx
shrl $0x1f, %edx
leal (%rax,%rdx), %r13d
incl %r13d
sarl %r13d
leal (%r12,%r13), %esi
movslq %esi, %rbp
cmpl $0x2, %eax
jl 0x13b593
decl %ecx
leaq 0x8(,%rcx,8), %rdx
movq %r14, %rdi
movq %rbx, (%rsp)
movl %esi, %ebx
xorl %esi, %esi
callq 0xb1d0
movl %ebx, %esi
movq (%rsp), %rbx
jmp 0x13b59b
movl %r12d, %ecx
cmpl $0x1, %eax
jne 0x13b5d1
movslq %r12d, %rax
movslq %r15d, %rdx
leaq 0x1(%rax), %rcx
movsd -0x8(%r14,%rcx,8), %xmm0
movsd %xmm0, (%r14,%rax,8)
cmpq %rdx, %rcx
jge 0x13b5c3
addsd (%r14,%rcx,8), %xmm0
movsd %xmm0, (%r14,%rax,8)
incq %rax
addq $0x2, %rcx
cmpq %rbp, %rax
jl 0x13b5a5
decl %ecx
cmpl %r15d, %ecx
sete %al
leal 0x1(%r15), %edx
cmpl %edx, %ecx
sete %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x13b658
cmpl %r15d, %esi
jge 0x13b608
leaq (%r14,%rbp,8), %rdi
notl %r12d
addl %r15d, %r12d
subl %r13d, %r12d
leaq 0x8(,%r12,8), %rdx
xorl %esi, %esi
callq 0xb1d0
movupd 0x78(%rbx), %xmm0
addpd %xmm0, %xmm0
movupd %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 0x219b0(%rip), %rdi     # 0x15cff0
leaq 0x219db(%rip), %rsi     # 0x15d022
leaq 0x219e5(%rip), %rcx     # 0x15d033
movl $0x21, %edx
callq 0xb200
leaq 0x219f6(%rip), %rdi     # 0x15d055
leaq 0x219bc(%rip), %rsi     # 0x15d022
leaq 0x219c6(%rip), %rcx     # 0x15d033
movl $0x2e, %edx
callq 0xb200
nop