#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 TreeNode {
  int dummy;
};

/* Variables and functions */
int maxDepth(struct TreeNode *);
struct TreeNode *newNode(int, struct TreeNode *, struct TreeNode *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  struct TreeNode *n15 = newNode(15, NULL, NULL);
  struct TreeNode *n7 = newNode(7, NULL, NULL);
  struct TreeNode *n20 = newNode(20, n15, n7);
  struct TreeNode *n9 = newNode(9, NULL, NULL);
  struct TreeNode *n3 = newNode(3, n9, n20);
  printf("%d\n", maxDepth(n3));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0xf,%edi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1050 <newNode@plt>
mov    %rax,-0x8(%rbp)
mov    $0x7,%edi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1050 <newNode@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x14,%edi
call   1050 <newNode@plt>
mov    %rax,-0x18(%rbp)
mov    $0x9,%edi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1050 <newNode@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x3,%edi
call   1050 <newNode@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <maxDepth@plt>
mov    %eax,%esi
lea    0xe4b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xf,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <newNode@plt>
mov    %rax,%rbx
mov    $0x7,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <newNode@plt>
mov    $0x14,%edi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1050 <newNode@plt>
mov    %rax,%rbx
mov    $0x9,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <newNode@plt>
mov    $0x3,%edi
mov    %rax,%rsi
mov    %rbx,%rdx
call   1050 <newNode@plt>
mov    %rax,%rdi
call   1040 <maxDepth@plt>
lea    0xe70(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.TreeNode = type { i32 }
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca %struct.TreeNode*
%2 = alloca %struct.TreeNode*
%3 = alloca %struct.TreeNode*
%4 = alloca %struct.TreeNode*
%5 = alloca %struct.TreeNode*
%6 = call %struct.TreeNode* @newNode(i32 15, %struct.TreeNode* null, %struct.TreeNode* null)
store %struct.TreeNode* %6, %struct.TreeNode** %1
%7 = call %struct.TreeNode* @newNode(i32 7, %struct.TreeNode* null, %struct.TreeNode* null)
store %struct.TreeNode* %7, %struct.TreeNode** %2
%8 = load %struct.TreeNode*, %struct.TreeNode** %1
%9 = load %struct.TreeNode*, %struct.TreeNode** %2
%10 = call %struct.TreeNode* @newNode(i32 20, %struct.TreeNode* %8, %struct.TreeNode* %9)
store %struct.TreeNode* %10, %struct.TreeNode** %3
%11 = call %struct.TreeNode* @newNode(i32 9, %struct.TreeNode* null, %struct.TreeNode* null)
store %struct.TreeNode* %11, %struct.TreeNode** %4
%12 = load %struct.TreeNode*, %struct.TreeNode** %4
%13 = load %struct.TreeNode*, %struct.TreeNode** %3
%14 = call %struct.TreeNode* @newNode(i32 3, %struct.TreeNode* %12, %struct.TreeNode* %13)
store %struct.TreeNode* %14, %struct.TreeNode** %5
%15 = load %struct.TreeNode*, %struct.TreeNode** %5
%16 = call i32 @maxDepth(%struct.TreeNode* %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %16)
ret i32 0
}

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call %struct.TreeNode* @newNode(i32 15, %struct.TreeNode* null, %struct.TreeNode* null)
%2 = tail call %struct.TreeNode* @newNode(i32 7, %struct.TreeNode* null, %struct.TreeNode* null)
%3 = tail call %struct.TreeNode* @newNode(i32 20, %struct.TreeNode* %1, %struct.TreeNode* %2)
%4 = tail call %struct.TreeNode* @newNode(i32 9, %struct.TreeNode* null, %struct.TreeNode* null)
%5 = tail call %struct.TreeNode* @newNode(i32 3, %struct.TreeNode* %4, %struct.TreeNode* %3)
%6 = tail call i32 @maxDepth(%struct.TreeNode* %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}