#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
struct rbt {
  int dummy;
};

/* Variables and functions */
struct rbt *init_tree();
int /*<<< orphan*/ insert_node(struct rbt *, int);
int /*<<< orphan*/ printTree(struct rbt *);
int /*<<< orphan*/ remove_node(struct rbt *, int);
int main() {
  struct rbt *tree;
  tree = init_tree();
  insert_node(tree, 15);
  insert_node(tree, 17);
  insert_node(tree, 16);
  insert_node(tree, 20);
  insert_node(tree, 13);
  insert_node(tree, 10);
  insert_node(tree, 12);
  insert_node(tree, 6);
  insert_node(tree, 3);
  insert_node(tree, 4);
  insert_node(tree, 2);
  remove_node(tree, 13);
  printTree(tree);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <init_tree@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xf,%esi
call   1040 <insert_node@plt>
mov    -0x10(%rbp),%rdi
mov    $0x11,%esi
call   1040 <insert_node@plt>
mov    -0x10(%rbp),%rdi
mov    $0x10,%esi
call   1040 <insert_node@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%esi
call   1040 <insert_node@plt>
mov    -0x10(%rbp),%rdi
mov    $0xd,%esi
call   1040 <insert_node@plt>
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1040 <insert_node@plt>
mov    -0x10(%rbp),%rdi
mov    $0xc,%esi
call   1040 <insert_node@plt>
mov    -0x10(%rbp),%rdi
mov    $0x6,%esi
call   1040 <insert_node@plt>
mov    -0x10(%rbp),%rdi
mov    $0x3,%esi
call   1040 <insert_node@plt>
mov    -0x10(%rbp),%rdi
mov    $0x4,%esi
call   1040 <insert_node@plt>
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1040 <insert_node@plt>
mov    -0x10(%rbp),%rdi
mov    $0xd,%esi
call   1050 <remove_node@plt>
mov    -0x10(%rbp),%rdi
call   1030 <printTree@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1060 <init_tree@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0xf,%esi
call   1040 <insert_node@plt>
mov    %rbx,%rdi
mov    $0x11,%esi
call   1040 <insert_node@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
call   1040 <insert_node@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
call   1040 <insert_node@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
call   1040 <insert_node@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <insert_node@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
call   1040 <insert_node@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1040 <insert_node@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1040 <insert_node@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <insert_node@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1040 <insert_node@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
call   1050 <remove_node@plt>
mov    %rbx,%rdi
call   1030 <printTree@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.rbt = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.rbt*
store i32 0, i32* %1
%3 = call %struct.rbt* (...) @init_tree()
store %struct.rbt* %3, %struct.rbt** %2
%4 = load %struct.rbt*, %struct.rbt** %2
%5 = call i32 @insert_node(%struct.rbt* %4, i32 15)
%6 = load %struct.rbt*, %struct.rbt** %2
%7 = call i32 @insert_node(%struct.rbt* %6, i32 17)
%8 = load %struct.rbt*, %struct.rbt** %2
%9 = call i32 @insert_node(%struct.rbt* %8, i32 16)
%10 = load %struct.rbt*, %struct.rbt** %2
%11 = call i32 @insert_node(%struct.rbt* %10, i32 20)
%12 = load %struct.rbt*, %struct.rbt** %2
%13 = call i32 @insert_node(%struct.rbt* %12, i32 13)
%14 = load %struct.rbt*, %struct.rbt** %2
%15 = call i32 @insert_node(%struct.rbt* %14, i32 10)
%16 = load %struct.rbt*, %struct.rbt** %2
%17 = call i32 @insert_node(%struct.rbt* %16, i32 12)
%18 = load %struct.rbt*, %struct.rbt** %2
%19 = call i32 @insert_node(%struct.rbt* %18, i32 6)
%20 = load %struct.rbt*, %struct.rbt** %2
%21 = call i32 @insert_node(%struct.rbt* %20, i32 3)
%22 = load %struct.rbt*, %struct.rbt** %2
%23 = call i32 @insert_node(%struct.rbt* %22, i32 4)
%24 = load %struct.rbt*, %struct.rbt** %2
%25 = call i32 @insert_node(%struct.rbt* %24, i32 2)
%26 = load %struct.rbt*, %struct.rbt** %2
%27 = call i32 @remove_node(%struct.rbt* %26, i32 13)
%28 = load %struct.rbt*, %struct.rbt** %2
%29 = call i32 @printTree(%struct.rbt* %28)
ret i32 0
}

LLVM IR (-O2):
%struct.rbt = type { i32 }
define i32 @main() {
%1 = tail call %struct.rbt* (...) @init_tree()
%2 = tail call i32 @insert_node(%struct.rbt* %1, i32 15)
%3 = tail call i32 @insert_node(%struct.rbt* %1, i32 17)
%4 = tail call i32 @insert_node(%struct.rbt* %1, i32 16)
%5 = tail call i32 @insert_node(%struct.rbt* %1, i32 20)
%6 = tail call i32 @insert_node(%struct.rbt* %1, i32 13)
%7 = tail call i32 @insert_node(%struct.rbt* %1, i32 10)
%8 = tail call i32 @insert_node(%struct.rbt* %1, i32 12)
%9 = tail call i32 @insert_node(%struct.rbt* %1, i32 6)
%10 = tail call i32 @insert_node(%struct.rbt* %1, i32 3)
%11 = tail call i32 @insert_node(%struct.rbt* %1, i32 4)
%12 = tail call i32 @insert_node(%struct.rbt* %1, i32 2)
%13 = tail call i32 @remove_node(%struct.rbt* %1, i32 13)
%14 = tail call i32 @printTree(%struct.rbt* %1)
ret i32 0
}