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

/* Variables and functions */
struct node *buildTree(int *, int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printInorder(struct node *);
int /*<<< orphan*/ printf(char *);
int main() {
  int in[] = {3, 2, 4, 1, 6, 5, 7};
  int pre[] = {1, 2, 3, 4, 5, 6, 7};
  struct node *root = buildTree(in, pre, 0, 6);
  printf("Inorder traversal of the constructed tree is \n");
  printInorder(root);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeb2(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    0xeb0(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xead(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xeaa(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xea8(%rip),%eax
mov    %eax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
xor    %edx,%edx
mov    $0x6,%ecx
call   1040 <buildTree@plt>
mov    %rax,-0x48(%rbp)
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x48(%rbp),%rdi
call   1050 <printInorder@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
movups 0xed0(%rip),%xmm0
movups %xmm0,0x2c(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movups 0xed8(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xec0(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x20(%rsp),%rdi
mov    %rsp,%rsi
xor    %edx,%edx
mov    $0x6,%ecx
call   1040 <buildTree@plt>
mov    %rax,%rbx
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1050 <printInorder@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.node = type { i32 }
@__const.main.in = [7 x i32] [i32 3, i32 2, i32 4, i32 1, i32 6, i32 5, i32 7]
@__const.main.pre = [7 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7]
@.str = [47 x i8] c"Inorder traversal of the constructed tree is \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i32]
%3 = alloca [7 x i32]
%4 = alloca %struct.node*
store i32 0, i32* %1
%5 = bitcast [7 x i32]* %2 to i8*
%6 = bitcast [7 x i32]* %3 to i8*
%7 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%8 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 0
%9 = call %struct.node* @buildTree(i32* %7, i32* %8, i32 0, i32 6)
store %struct.node* %9, %struct.node** %4
%10 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%11 = load %struct.node*, %struct.node** %4
%12 = call i32 @printInorder(%struct.node* %11)
ret i32 0
}

LLVM IR (-O2):
%struct.node = type { i32 }
@__const.main.in = [7 x i32] [i32 3, i32 2, i32 4, i32 1, i32 6, i32 5, i32 7]
@__const.main.pre = [7 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7]
@str = [46 x i8] c"Inorder traversal of the constructed tree is \00"
define i32 @main() {
%1 = alloca [7 x i32]
%2 = alloca [7 x i32]
%3 = bitcast [7 x i32]* %1 to i8*
%4 = bitcast [7 x i32]* %2 to i8*
%5 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%7 = call %struct.node* @buildTree(i32* %5, i32* %6, i32 0, i32 6)
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
%9 = call i32 @printInorder(%struct.node* %7)
ret i32 0
}