#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 isBalanced(struct TreeNode *);
struct TreeNode *newNode(int, struct TreeNode *, struct TreeNode *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  struct TreeNode *n16 = newNode(16, NULL, NULL);
  struct TreeNode *n15 = newNode(15, NULL, n16);
  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", isBalanced(n3));
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x10,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <newNode@plt>
mov    $0xf,%edi
xor    %esi,%esi
mov    %rax,%rdx
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 <isBalanced@plt>
lea    0xe61(%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 = alloca %struct.TreeNode*
%7 = call %struct.TreeNode* @newNode(i32 16, %struct.TreeNode* null, %struct.TreeNode* null)
store %struct.TreeNode* %7, %struct.TreeNode** %1
%8 = load %struct.TreeNode*, %struct.TreeNode** %1
%9 = call %struct.TreeNode* @newNode(i32 15, %struct.TreeNode* null, %struct.TreeNode* %8)
store %struct.TreeNode* %9, %struct.TreeNode** %2
%10 = call %struct.TreeNode* @newNode(i32 7, %struct.TreeNode* null, %struct.TreeNode* null)
store %struct.TreeNode* %10, %struct.TreeNode** %3
%11 = load %struct.TreeNode*, %struct.TreeNode** %2
%12 = load %struct.TreeNode*, %struct.TreeNode** %3
%13 = call %struct.TreeNode* @newNode(i32 20, %struct.TreeNode* %11, %struct.TreeNode* %12)
store %struct.TreeNode* %13, %struct.TreeNode** %4
%14 = call %struct.TreeNode* @newNode(i32 9, %struct.TreeNode* null, %struct.TreeNode* null)
store %struct.TreeNode* %14, %struct.TreeNode** %5
%15 = load %struct.TreeNode*, %struct.TreeNode** %5
%16 = load %struct.TreeNode*, %struct.TreeNode** %4
%17 = call %struct.TreeNode* @newNode(i32 3, %struct.TreeNode* %15, %struct.TreeNode* %16)
store %struct.TreeNode* %17, %struct.TreeNode** %6
%18 = load %struct.TreeNode*, %struct.TreeNode** %6
%19 = call i32 @isBalanced(%struct.TreeNode* %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %19)
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 16, %struct.TreeNode* null, %struct.TreeNode* null)
%2 = tail call %struct.TreeNode* @newNode(i32 15, %struct.TreeNode* null, %struct.TreeNode* %1)
%3 = tail call %struct.TreeNode* @newNode(i32 7, %struct.TreeNode* null, %struct.TreeNode* null)
%4 = tail call %struct.TreeNode* @newNode(i32 20, %struct.TreeNode* %2, %struct.TreeNode* %3)
%5 = tail call %struct.TreeNode* @newNode(i32 9, %struct.TreeNode* null, %struct.TreeNode* null)
%6 = tail call %struct.TreeNode* @newNode(i32 3, %struct.TreeNode* %5, %struct.TreeNode* %4)
%7 = tail call i32 @isBalanced(%struct.TreeNode* %6)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}