// File: /workspace/github_cpp_makefile_star2_O3/DRSY[P]MyRBTree/main.cpp
// Function: RBTree::black_black(Node*, Node*)
void black_black(NodePtr_t father, NodePtr_t brother) {
        if(!brother) {
            if(isred(father) || father==this->root) {
                father->color = Color::black;
                return;
            }else {
                NodePtr_t tmp = father->father;
                NodePtr_t b = (father==tmp->left)?tmp->right:tmp->left;
                black_black(tmp, b);
            }
        }
        if(brother==father->right) {
            if(isblack(brother) && brother->right && isred(brother->right)) {
                Color tmp = father->color;
                father->color = Color::black;
                brother->color = tmp;
                rotate_left(father, brother);
                brother->right->color = Color::black;
            }
            else if(isblack(brother) && brother->left && isred(brother->left)) {
                brother->left->color = Color::black;
                brother->color = Color::red;
                auto p = rotate_right(brother->left, brother);
                Color tmp = father->color;
                father->color = Color::black;
                p->color = tmp;
                rotate_left(father, p);
                p->right->color = Color::black;
            }
            else {
                brother->color = Color::red;
                if(isred(father) || father==this->root)
                    father->color = Color::black;
                else {
                    NodePtr_t tmp = father->father;
                    NodePtr_t b = (father==tmp->left)?tmp->right:tmp->left;
                    black_black(tmp, b);
                }
            }
        }else {
            NodePtr_t prev = father->right;
            if(isblack(brother) && brother->left && isred(brother->left)) {
                Color tmp = father->color;
                father->color = Color::black;
                brother->color = tmp;
                rotate_right(brother, father);
                brother->left->color = Color::black;
            }
            else if(isblack(brother) && brother->right && isred(brother->right)) {
                brother->right->color = Color::black;
                brother->color = Color::red;
                auto p = rotate_left(brother, brother->right);
                Color tmp = father->color;
                father->color = Color::black;
                p->color = tmp;
                rotate_right(p, father);
                p->left->color = Color::black;
            }
            else {
                brother->color = Color::red;
                if(isred(father) || father==this->root)
                    father->color = Color::black;
                else {
                    NodePtr_t tmp = father->father;
                    NodePtr_t b = (father==tmp->left)?tmp->right:tmp->left;
                    black_black(tmp, b);
                }
            }
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
testq %r15, %r15
jne 0x28ad
cmpl $0x0, 0x4(%r14)
je 0x2adc
cmpq %r14, (%rbx)
je 0x2adc
movq 0x8(%r14), %rsi
movq 0x10(%rsi), %rdx
cmpq %r14, %rdx
jne 0x28a5
movq 0x18(%rsi), %rdx
movq %rbx, %rdi
callq 0x2868
movl 0x4(%r15), %eax
cmpq %r15, 0x18(%r14)
je 0x28df
cmpl $0x1, %eax
jne 0x290a
movq 0x10(%r15), %rax
testq %rax, %rax
je 0x28cb
cmpl $0x0, 0x4(%rax)
je 0x2946
movq 0x18(%r15), %rax
testq %rax, %rax
je 0x290a
cmpl $0x0, 0x4(%rax)
jne 0x290a
jmp 0x2988
cmpl $0x1, %eax
jne 0x290a
movq 0x18(%r15), %rax
testq %rax, %rax
je 0x28f7
cmpl $0x0, 0x4(%rax)
je 0x2a0b
movq 0x10(%r15), %rax
testq %rax, %rax
je 0x290a
cmpl $0x0, 0x4(%rax)
je 0x2a54
movl $0x0, 0x4(%r15)
cmpl $0x0, 0x4(%r14)
je 0x2adc
cmpq %r14, (%rbx)
je 0x2adc
movq 0x8(%r14), %rax
movq 0x10(%rax), %r15
cmpq %r14, %r15
movq %rax, %r14
jne 0x287b
movq 0x18(%rax), %r15
movq %rax, %r14
jmp 0x287b
movl 0x4(%r14), %eax
movl $0x1, 0x4(%r14)
movl %eax, 0x4(%r15)
movq 0x8(%r14), %rax
movq 0x18(%r15), %rcx
movq %rcx, 0x10(%r14)
movq %r14, 0x18(%r15)
movq %r15, 0x8(%r14)
testq %rax, %rax
je 0x297f
leaq 0x10(%rax), %rcx
leaq 0x18(%rax), %rbx
cmpq %r14, 0x10(%rax)
cmoveq %rcx, %rbx
leaq 0x10(%r15), %rcx
jmp 0x2a48
movl $0x1, 0x4(%rax)
movl $0x0, 0x4(%r15)
movq 0x8(%r15), %rcx
movq 0x10(%rax), %rdx
movq %rdx, 0x18(%r15)
movq %r15, 0x10(%rax)
movq %rax, 0x8(%r15)
movq %rbx, %rdx
testq %rcx, %rcx
je 0x29c3
leaq 0x10(%rcx), %rsi
leaq 0x18(%rcx), %rdx
cmpq %r15, 0x10(%rcx)
cmoveq %rsi, %rdx
movq %rax, (%rdx)
movq %rcx, 0x8(%rax)
movl 0x4(%r14), %ecx
movl $0x1, 0x4(%r14)
movl %ecx, 0x4(%rax)
movq 0x8(%r14), %rdx
movq 0x18(%rax), %rcx
movq %rcx, 0x10(%r14)
movq %r14, 0x18(%rax)
movq %rax, 0x8(%r14)
testq %rdx, %rdx
je 0x2a02
leaq 0x10(%rdx), %rcx
leaq 0x18(%rdx), %rbx
cmpq %r14, 0x10(%rdx)
cmoveq %rcx, %rbx
leaq 0x10(%rax), %rcx
jmp 0x2ad2
movl 0x4(%r14), %eax
movl $0x1, 0x4(%r14)
movl %eax, 0x4(%r15)
movq 0x8(%r14), %rax
movq 0x10(%r15), %rcx
movq %rcx, 0x18(%r14)
movq %r14, 0x10(%r15)
movq %r15, 0x8(%r14)
testq %rax, %rax
je 0x2a44
leaq 0x10(%rax), %rcx
leaq 0x18(%rax), %rbx
cmpq %r14, 0x10(%rax)
cmoveq %rcx, %rbx
leaq 0x18(%r15), %rcx
movq %r15, (%rbx)
movq %rax, 0x8(%r15)
jmp 0x2ad9
movl $0x1, 0x4(%rax)
movl $0x0, 0x4(%r15)
movq 0x8(%r15), %rcx
movq 0x18(%rax), %rdx
movq %rdx, 0x10(%r15)
movq %r15, 0x18(%rax)
movq %rax, 0x8(%r15)
movq %rbx, %rdx
testq %rcx, %rcx
je 0x2a8f
leaq 0x10(%rcx), %rsi
leaq 0x18(%rcx), %rdx
cmpq %r15, 0x10(%rcx)
cmoveq %rsi, %rdx
movq %rax, (%rdx)
movq %rcx, 0x8(%rax)
movl 0x4(%r14), %ecx
movl $0x1, 0x4(%r14)
movl %ecx, 0x4(%rax)
movq 0x8(%r14), %rdx
movq 0x10(%rax), %rcx
movq %rcx, 0x18(%r14)
movq %r14, 0x10(%rax)
movq %rax, 0x8(%r14)
testq %rdx, %rdx
je 0x2ace
leaq 0x10(%rdx), %rcx
leaq 0x18(%rdx), %rbx
cmpq %r14, 0x10(%rdx)
cmoveq %rcx, %rbx
leaq 0x18(%rax), %rcx
movq %rax, (%rbx)
movq %rdx, 0x8(%rax)
movq (%rcx), %r14
movl $0x1, 0x4(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq