// File: /workspace/github_cpp_makefile_star2_O1/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 0x2907
cmpl $0x0, 0x4(%r14)
je 0x29a6
cmpq %r14, (%rbx)
je 0x29a6
movq 0x8(%r14), %rsi
movq 0x10(%rsi), %rdx
cmpq %r14, %rdx
jne 0x28ff
movq 0x18(%rsi), %rdx
movq %rbx, %rdi
callq 0x28c2
movl 0x4(%r15), %eax
cmpq %r15, 0x18(%r14)
je 0x2942
cmpl $0x1, %eax
jne 0x2972
movq 0x10(%r15), %rcx
testq %rcx, %rcx
je 0x2929
cmpl $0x0, 0x4(%rcx)
je 0x29b3
cmpl $0x1, %eax
jne 0x2972
movq 0x18(%r15), %rax
testq %rax, %rax
je 0x2972
cmpl $0x0, 0x4(%rax)
jne 0x2972
jmp 0x2a34
cmpl $0x1, %eax
jne 0x2972
movq 0x18(%r15), %rcx
testq %rcx, %rcx
je 0x295a
cmpl $0x0, 0x4(%rcx)
je 0x29f2
cmpl $0x1, %eax
jne 0x2972
movq 0x10(%r15), %rax
testq %rax, %rax
je 0x2972
cmpl $0x0, 0x4(%rax)
je 0x2a80
movl $0x0, 0x4(%r15)
cmpl $0x0, 0x4(%r14)
je 0x29a6
cmpq %r14, (%rbx)
je 0x29a6
movq 0x8(%r14), %rax
movq 0x10(%rax), %r15
cmpq %r14, %r15
movq %rax, %r14
jne 0x28d5
movq 0x18(%rax), %r15
movq %rax, %r14
jmp 0x28d5
movl $0x1, 0x4(%r14)
jmp 0x2b7b
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 0x2a6e
leaq 0x10(%rax), %rcx
leaq 0x18(%rax), %rbx
cmpq %r14, 0x10(%rax)
cmoveq %rcx, %rbx
jmp 0x2a70
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 0x2aba
leaq 0x10(%rax), %rcx
leaq 0x18(%rax), %rbx
cmpq %r14, 0x10(%rax)
cmoveq %rcx, %rbx
jmp 0x2abc
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)
testq %rcx, %rcx
je 0x2acc
leaq 0x10(%rcx), %rsi
leaq 0x18(%rcx), %rdx
cmpq %r15, 0x10(%rcx)
cmoveq %rsi, %rdx
jmp 0x2ad1
xorl %eax, %eax
movq %r15, (%rbx)
movq %rax, 0x8(%r15)
movq 0x10(%r15), %rax
jmp 0x2b74
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)
testq %rcx, %rcx
je 0x2b21
leaq 0x10(%rcx), %rsi
leaq 0x18(%rcx), %rdx
cmpq %r15, 0x10(%rcx)
cmoveq %rsi, %rdx
jmp 0x2b26
xorl %eax, %eax
movq %r15, (%rbx)
movq %rax, 0x8(%r15)
movq 0x18(%r15), %rax
jmp 0x2b74
xorl %ecx, %ecx
movq %rbx, %rdx
movq %rax, (%rdx)
movq %rcx, 0x8(%rax)
movl 0x4(%r14), %ecx
movl $0x1, 0x4(%r14)
movl %ecx, 0x4(%rax)
movq 0x8(%r14), %rcx
movq 0x18(%rax), %rdx
movq %rdx, 0x10(%r14)
movq %r14, 0x18(%rax)
movq %rax, 0x8(%r14)
testq %rcx, %rcx
je 0x2b12
leaq 0x10(%rcx), %rdx
leaq 0x18(%rcx), %rbx
cmpq %r14, 0x10(%rcx)
cmoveq %rdx, %rbx
jmp 0x2b14
xorl %ecx, %ecx
movq %rax, (%rbx)
movq %rcx, 0x8(%rax)
movq 0x10(%rax), %rax
jmp 0x2b74
xorl %ecx, %ecx
movq %rbx, %rdx
movq %rax, (%rdx)
movq %rcx, 0x8(%rax)
movl 0x4(%r14), %ecx
movl $0x1, 0x4(%r14)
movl %ecx, 0x4(%rax)
movq 0x8(%r14), %rcx
movq 0x10(%rax), %rdx
movq %rdx, 0x18(%r14)
movq %r14, 0x10(%rax)
movq %rax, 0x8(%r14)
testq %rcx, %rcx
je 0x2b67
leaq 0x10(%rcx), %rdx
leaq 0x18(%rcx), %rbx
cmpq %r14, 0x10(%rcx)
cmoveq %rdx, %rbx
jmp 0x2b69
xorl %ecx, %ecx
movq %rax, (%rbx)
movq %rcx, 0x8(%rax)
movq 0x18(%rax), %rax
movl $0x1, 0x4(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq