// File: /workspace/github_c_makefile_star2_O2/CarlosLunaMota[P]BinaryTrees/BinaryTrees.c
// Function: print_rb_subtree
static void print_rb_subtree(const rb_node *node, const int is_right,
                             char *indent, void (* print_node) (const void *)) {

    // Allocate memory:
    char *new_indent = (char *) malloc((6+strlen(indent)*sizeof(char)));
    assert(new_indent != NULL);

    // Print right subtree recursively:
    if (node->right != NULL) {
        if (is_right == YES) { sprintf(new_indent, "%s%s", indent, "      "); }
        else {
            if (node->color == RED) {
                sprintf(new_indent, "%s%s", indent, "||    ");
            } else {
                sprintf(new_indent, "%s%s", indent, "|     ");
            }
        }
        print_rb_subtree(node->right, YES, new_indent, print_node);
    }

    // Print current node:
    if (node->color == RED) {
        if (is_right) { fprintf(stdout, "%s/====",indent); }
        else          { fprintf(stdout, "%s\\====",indent); }
    } else {
        if (is_right) { fprintf(stdout, "%s,----",indent); }
        else          { fprintf(stdout, "%s`----",indent); }
    }
    if (print_node == NULL)  {
        if (node->color == RED) { fprintf(stdout, "(#)"); }
        else                    { fprintf(stdout, "( )"); }
    } else { print_node(node->data); }
    fprintf(stdout, "\n");

    // Print left subtree recursively:
    if (node->left != NULL) {
        if (is_right == YES) {
            if (node->color == RED) {
                sprintf(new_indent, "%s%s", indent, "||    ");
            } else {
                sprintf(new_indent, "%s%s", indent, "|     ");
            }
        } else { sprintf(new_indent, "%s%s", indent, "      "); }
        print_rb_subtree(node->left, NO, new_indent, print_node);
    }

    // Free memory:
    free(new_indent);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r12
movl %esi, %ebp
movq %rdi, %r14
movq %rdx, %rdi
callq 0x1060
leaq 0x6(%rax), %rdi
callq 0x10d0
testq %rax, %rax
je 0xb12b
movq %rax, %r15
cmpq $0x0, 0x10(%r14)
je 0xb042
cmpl $0x1, %ebp
jne 0xb005
leaq 0x2f55(%rip), %rcx      # 0xdf58
jmp 0xb01c
cmpb $0x1, 0x18(%r14)
leaq 0x303c(%rip), %rax      # 0xe04d
leaq 0x2f47(%rip), %rcx      # 0xdf5f
cmoveq %rax, %rcx
leaq 0x2f30(%rip), %rsi      # 0xdf53
movq %r15, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x10f0
movq 0x10(%r14), %rdi
pushq $0x1
popq %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0xafbd
testl %ebp, %ebp
leaq 0x3011(%rip), %rax      # 0xe05c
leaq 0x3002(%rip), %rcx      # 0xe054
cmoveq %rax, %rcx
leaq 0x2f11(%rip), %rax      # 0xdf6e
leaq 0x2f02(%rip), %rsi      # 0xdf66
cmoveq %rax, %rsi
cmpb $0x1, 0x18(%r14)
movq 0x5f64(%rip), %r13      # 0x10fd8
movq (%r13), %rdi
cmoveq %rcx, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x10b0
testq %rbx, %rbx
je 0xb092
movq (%r14), %rdi
callq *%rbx
jmp 0xb0b8
cmpb $0x1, 0x18(%r14)
movq (%r13), %rcx
jne 0xb0a6
leaq 0x2633(%rip), %rdi      # 0xd6d7
jmp 0xb0ad
leaq 0x2a47(%rip), %rdi      # 0xdaf4
pushq $0x3
popq %rsi
pushq $0x1
popq %rdx
callq 0x1100
movq (%r13), %rsi
pushq $0xa
popq %rdi
callq 0x1090
cmpq $0x0, 0x8(%r14)
je 0xb115
cmpl $0x1, %ebp
jne 0xb0e9
cmpb $0x1, 0x18(%r14)
leaq 0x2f71(%rip), %rax      # 0xe04d
leaq 0x2e7c(%rip), %rcx      # 0xdf5f
cmoveq %rax, %rcx
jmp 0xb0f0
leaq 0x2e68(%rip), %rcx      # 0xdf58
leaq 0x2e5c(%rip), %rsi      # 0xdf53
movq %r15, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x10f0
movq 0x8(%r14), %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %rbx, %rcx
callq 0xafbd
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1120
leaq 0x2dbc(%rip), %rdi      # 0xdeee
leaq 0x20d4(%rip), %rsi      # 0xd20d
leaq 0x2ebb(%rip), %rcx      # 0xdffb
movl $0x10f5, %edx           # imm = 0x10F5
callq 0x1080