// File: Manca[P]algorithms1/./lib/Heap.hpp
// Function: DataStructures::Heap::bubbleUp(bool)
void bubbleUp(bool minHeap)
        {
            if (_heap.size() > 1)
            {
                int lastIndex = _heap.size() - 1;
                int parentIndex = parent(_heap.size() - 1);
                if (minHeap)
                {
                    while (parentIndex >= 0 && _heap[lastIndex] < _heap[parentIndex])
                    {
                        // exchange values
                        int tmp = _heap[parentIndex];
                        _heap[parentIndex] = _heap[lastIndex];
                        _heap[lastIndex] = tmp;
                        
                        // buuble up
                        lastIndex = parentIndex;
                        parentIndex = parent(parentIndex);
                    }
                }
                else
                {
                    while (parentIndex >= 0 && _heap[lastIndex] > _heap[parentIndex])
                    {
                        // exchange values
                        int tmp = _heap[parentIndex];
                        _heap[parentIndex] = _heap[lastIndex];
                        _heap[lastIndex] = tmp;
                        
                        // buuble up
                        lastIndex = parentIndex;
                        parentIndex = parent(parentIndex);
                    }
                }
            }
        }

// Assembly:
subq $0x48, %rsp
movb %sil, %al
movq %rdi, 0x40(%rsp)
andb $0x1, %al
movb %al, 0x3f(%rsp)
movq 0x40(%rsp), %rdi
movq %rdi, 0x20(%rsp)
addq $0x8, %rdi
callq 0x7f90
cmpq $0x1, %rax
jbe 0xc39f
movq 0x20(%rsp), %rdi
addq $0x8, %rdi
callq 0x7f90
movq 0x20(%rsp), %rdi
subq $0x1, %rax
movl %eax, 0x38(%rsp)
addq $0x8, %rdi
callq 0x7f90
movq 0x20(%rsp), %rdi
subq $0x1, %rax
movl %eax, %esi
callq 0xc3b0
movl %eax, 0x34(%rsp)
testb $0x1, 0x3f(%rsp)
je 0xc2ba
jmp 0xc1d4
xorl %eax, %eax
cmpl $0x0, 0x34(%rsp)
movb %al, 0x1f(%rsp)
jl 0xc21d
movq 0x20(%rsp), %rdi
addq $0x8, %rdi
movslq 0x38(%rsp), %rsi
callq 0x84b0
movq 0x20(%rsp), %rdi
movl (%rax), %eax
movl %eax, 0x18(%rsp)
addq $0x8, %rdi
movslq 0x34(%rsp), %rsi
callq 0x84b0
movq %rax, %rcx
movl 0x18(%rsp), %eax
cmpl (%rcx), %eax
setl %al
movb %al, 0x1f(%rsp)
movb 0x1f(%rsp), %al
testb $0x1, %al
jne 0xc22a
jmp 0xc2b5
movq 0x20(%rsp), %rdi
addq $0x8, %rdi
movslq 0x34(%rsp), %rsi
callq 0x84b0
movq 0x20(%rsp), %rdi
movl (%rax), %eax
movl %eax, 0x30(%rsp)
addq $0x8, %rdi
movslq 0x38(%rsp), %rsi
callq 0x84b0
movq 0x20(%rsp), %rdi
movl (%rax), %eax
movl %eax, 0x10(%rsp)
addq $0x8, %rdi
movslq 0x34(%rsp), %rsi
callq 0x84b0
movl 0x10(%rsp), %ecx
movq 0x20(%rsp), %rdi
movl %ecx, (%rax)
movl 0x30(%rsp), %eax
movl %eax, 0x14(%rsp)
addq $0x8, %rdi
movslq 0x38(%rsp), %rsi
callq 0x84b0
movl 0x14(%rsp), %ecx
movq 0x20(%rsp), %rdi
movl %ecx, (%rax)
movl 0x34(%rsp), %eax
movl %eax, 0x38(%rsp)
movl 0x34(%rsp), %esi
callq 0xc3b0
movl %eax, 0x34(%rsp)
jmp 0xc1d4
jmp 0xc39d
jmp 0xc2bc
xorl %eax, %eax
cmpl $0x0, 0x34(%rsp)
movb %al, 0xf(%rsp)
jl 0xc305
movq 0x20(%rsp), %rdi
addq $0x8, %rdi
movslq 0x38(%rsp), %rsi
callq 0x84b0
movq 0x20(%rsp), %rdi
movl (%rax), %eax
movl %eax, 0x8(%rsp)
addq $0x8, %rdi
movslq 0x34(%rsp), %rsi
callq 0x84b0
movq %rax, %rcx
movl 0x8(%rsp), %eax
cmpl (%rcx), %eax
setg %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0xc312
jmp 0xc39b
movq 0x20(%rsp), %rdi
addq $0x8, %rdi
movslq 0x34(%rsp), %rsi
callq 0x84b0
movq 0x20(%rsp), %rdi
movl (%rax), %eax
movl %eax, 0x2c(%rsp)
addq $0x8, %rdi
movslq 0x38(%rsp), %rsi
callq 0x84b0
movq 0x20(%rsp), %rdi
movl (%rax), %eax
movl %eax, (%rsp)
addq $0x8, %rdi
movslq 0x34(%rsp), %rsi
callq 0x84b0
movl (%rsp), %ecx
movq 0x20(%rsp), %rdi
movl %ecx, (%rax)
movl 0x2c(%rsp), %eax
movl %eax, 0x4(%rsp)
addq $0x8, %rdi
movslq 0x38(%rsp), %rsi
callq 0x84b0
movl 0x4(%rsp), %ecx
movq 0x20(%rsp), %rdi
movl %ecx, (%rax)
movl 0x34(%rsp), %eax
movl %eax, 0x38(%rsp)
movl 0x34(%rsp), %esi
callq 0xc3b0
movl %eax, 0x34(%rsp)
jmp 0xc2bc
jmp 0xc39d
jmp 0xc39f
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
nop