// File: /workspace/github_c_makefile_star2_O0/CarlosLunaMota[P]BinaryTrees/BinaryTrees.c
// Function: print_bs_subtree
static void print_bs_subtree(const bs_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                 { sprintf(new_indent, "%s%s", indent, "|     "); }
        print_bs_subtree(node->right, YES, new_indent, print_node);
    }

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

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

    // Free memory:
    free(new_indent);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1040
movq %rax, %rdi
shlq $0x0, %rdi
addq $0x6, %rdi
callq 0x10a0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0xfcbd
jmp 0xfcdc
leaq 0x7226(%rip), %rdi      # 0x16eea
leaq 0x6531(%rip), %rsi      # 0x161fc
movl $0x83a, %edx            # imm = 0x83A
leaq 0x7226(%rip), %rcx      # 0x16efd
callq 0x1060
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0xfd43
cmpl $0x1, -0xc(%rbp)
jne 0xfd0c
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x7253(%rip), %rsi      # 0x16f4f
leaq 0x7251(%rip), %rcx      # 0x16f54
movb $0x0, %al
callq 0x10c0
jmp 0xfd29
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x7234(%rip), %rsi      # 0x16f4f
leaq 0x7239(%rip), %rcx      # 0x16f5b
movb $0x0, %al
callq 0x10c0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x28(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl $0x1, %esi
callq 0xfc80
cmpl $0x0, -0xc(%rbp)
je 0xfd67
movq 0xa288(%rip), %rax      # 0x19fd8
movq (%rax), %rdi
movq -0x18(%rbp), %rdx
leaq 0x7204(%rip), %rsi      # 0x16f62
movb $0x0, %al
callq 0x1080
jmp 0xfd83
movq 0xa26a(%rip), %rax      # 0x19fd8
movq (%rax), %rdi
movq -0x18(%rbp), %rdx
leaq 0x71ee(%rip), %rsi      # 0x16f6a
movb $0x0, %al
callq 0x1080
cmpq $0x0, -0x20(%rbp)
jne 0xfda4
movq 0xa247(%rip), %rax      # 0x19fd8
movq (%rax), %rdi
leaq 0x692b(%rip), %rsi      # 0x166c6
movb $0x0, %al
callq 0x1080
jmp 0xfdb1
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rcx
movq (%rcx), %rdi
callq *%rax
leaq 0x6319(%rip), %rdi      # 0x160d1
movb $0x0, %al
callq 0x1050
movq -0x8(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xfe23
cmpl $0x1, -0xc(%rbp)
jne 0xfdef
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x7170(%rip), %rsi      # 0x16f4f
leaq 0x7175(%rip), %rcx      # 0x16f5b
movb $0x0, %al
callq 0x10c0
jmp 0xfe0c
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x7151(%rip), %rsi      # 0x16f4f
leaq 0x714f(%rip), %rcx      # 0x16f54
movb $0x0, %al
callq 0x10c0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x28(%rbp), %rdx
movq -0x20(%rbp), %rcx
xorl %esi, %esi
callq 0xfc80
movq -0x28(%rbp), %rdi
callq 0x10e0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)