// File: /workspace/github_c_makefile_star2_O3/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 0xb9d7
movq %rax, %r15
cmpq $0x0, 0x10(%r14)
je 0xb8e8
cmpl $0x1, %ebp
jne 0xb8a9
leaq 0x36b1(%rip), %rcx      # 0xef58
jmp 0xb8c0
cmpb $0x1, 0x18(%r14)
leaq 0x3798(%rip), %rax      # 0xf04d
leaq 0x36a3(%rip), %rcx      # 0xef5f
cmoveq %rax, %rcx
leaq 0x368c(%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 0xb861
testl %ebp, %ebp
leaq 0x376b(%rip), %rax      # 0xf05c
leaq 0x375c(%rip), %rcx      # 0xf054
cmoveq %rax, %rcx
leaq 0x366b(%rip), %rax      # 0xef6e
leaq 0x365c(%rip), %rsi      # 0xef66
cmoveq %rax, %rsi
cmpb $0x1, 0x18(%r14)
movq 0x66be(%rip), %r13      # 0x11fd8
movq (%r13), %rdi
cmoveq %rcx, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x10b0
testq %rbx, %rbx
je 0xb938
movq (%r14), %rdi
callq *%rbx
jmp 0xb962
cmpb $0x1, 0x18(%r14)
movq (%r13), %rcx
jne 0xb94c
leaq 0x2d8d(%rip), %rdi      # 0xe6d7
jmp 0xb953
leaq 0x31a1(%rip), %rdi      # 0xeaf4
movl $0x3, %esi
movl $0x1, %edx
callq 0x1100
movq (%r13), %rsi
movl $0xa, %edi
callq 0x1090
cmpq $0x0, 0x8(%r14)
je 0xb9c1
cmpl $0x1, %ebp
jne 0xb995
cmpb $0x1, 0x18(%r14)
leaq 0x36c5(%rip), %rax      # 0xf04d
leaq 0x35d0(%rip), %rcx      # 0xef5f
cmoveq %rax, %rcx
jmp 0xb99c
leaq 0x35bc(%rip), %rcx      # 0xef58
leaq 0x35b0(%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 0xb861
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1120
leaq 0x3510(%rip), %rdi      # 0xeeee
leaq 0x2828(%rip), %rsi      # 0xe20d
leaq 0x360f(%rip), %rcx      # 0xeffb
movl $0x10f5, %edx           # imm = 0x10F5
callq 0x1080