// File: /workspace/github_c_makefile_star2_O1/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 0xb953
movq %rax, %r15
cmpq $0x0, 0x10(%r14)
je 0xb864
cmpl $0x1, %ebp
jne 0xb825
leaq 0x3735(%rip), %rcx      # 0xef58
jmp 0xb83c
cmpb $0x1, 0x18(%r14)
leaq 0x381c(%rip), %rax      # 0xf04d
leaq 0x3727(%rip), %rcx      # 0xef5f
cmoveq %rax, %rcx
leaq 0x3710(%rip), %rsi      # 0xef53
movq %r15, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x10f0
movq 0x10(%r14), %rdi
movl $0x1, %esi
movq %r15, %rdx
movq %rbx, %rcx
callq 0xb7dd
testl %ebp, %ebp
leaq 0x37ef(%rip), %rax      # 0xf05c
leaq 0x37e0(%rip), %rcx      # 0xf054
cmoveq %rax, %rcx
leaq 0x36ef(%rip), %rax      # 0xef6e
leaq 0x36e0(%rip), %rsi      # 0xef66
cmoveq %rax, %rsi
cmpb $0x1, 0x18(%r14)
movq 0x6742(%rip), %r13      # 0x11fd8
movq (%r13), %rdi
cmoveq %rcx, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x10b0
testq %rbx, %rbx
je 0xb8b4
movq (%r14), %rdi
callq *%rbx
jmp 0xb8de
cmpb $0x1, 0x18(%r14)
movq (%r13), %rcx
jne 0xb8c8
leaq 0x2e11(%rip), %rdi      # 0xe6d7
jmp 0xb8cf
leaq 0x3225(%rip), %rdi      # 0xeaf4
movl $0x3, %esi
movl $0x1, %edx
callq 0x1100
movq (%r13), %rsi
movl $0xa, %edi
callq 0x1090
cmpq $0x0, 0x8(%r14)
je 0xb93d
cmpl $0x1, %ebp
jne 0xb911
cmpb $0x1, 0x18(%r14)
leaq 0x3749(%rip), %rax      # 0xf04d
leaq 0x3654(%rip), %rcx      # 0xef5f
cmoveq %rax, %rcx
jmp 0xb918
leaq 0x3640(%rip), %rcx      # 0xef58
leaq 0x3634(%rip), %rsi      # 0xef53
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 0xb7dd
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1120
leaq 0x3594(%rip), %rdi      # 0xeeee
leaq 0x28ac(%rip), %rsi      # 0xe20d
leaq 0x3693(%rip), %rcx      # 0xeffb
movl $0x10f5, %edx           # imm = 0x10F5
callq 0x1080