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

/* Variables and functions */
int /*<<< orphan*/ insertInTree(struct tree *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
void performActionInTree(int action, struct tree *thisTree) {
  int valueToInsert;
  switch (action) {
  case 1:
    printf("\nValue : ");
    scanf("%d", &valueToInsert);
    insertInTree(thisTree, valueToInsert);
    break;
  case 2:
    break;
  case 3:
    break;
  case 4:
    break;
  case 5:
    break;
  case 6:
    break;
  case 7:
    break;
  case 8:
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<performActionInTree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x7,%eax
ja     11b8 <performActionInTree+0x88>
mov    -0x20(%rbp),%rax
lea    0xea1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <insertInTree@plt>
jmp    11bd <performActionInTree+0x8d>
jmp    11bd <performActionInTree+0x8d>
jmp    11bd <performActionInTree+0x8d>
jmp    11bd <performActionInTree+0x8d>
jmp    11bd <performActionInTree+0x8d>
jmp    11bd <performActionInTree+0x8d>
jmp    11bd <performActionInTree+0x8d>
jmp    11bd <performActionInTree+0x8d>
jmp    11bd <performActionInTree+0x8d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<performActionInTree>:
cmp    $0x1,%edi
jne    116b <performActionInTree+0x3b>
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
lea    0xeba(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1050 <insertInTree@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tree = type { i32 }
@.str = [10 x i8] c"\0AValue : \00"
@.str.1 = [3 x i8] c"%d\00"
define void @performActionInTree(i32 %0, %struct.tree* %1) {
%3 = alloca i32
%4 = alloca %struct.tree*
%5 = alloca i32
store i32 %0, i32* %3
store %struct.tree* %1, %struct.tree** %4
%6 = load i32, i32* %3
switch i32 %6, label %20 [
i32 1, label %7
i32 2, label %13
i32 3, label %14
i32 4, label %15
i32 5, label %16
i32 6, label %17
i32 7, label %18
i32 8, label %19
]
7: ; preds = %2
%8 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%10 = load %struct.tree*, %struct.tree** %4
%11 = load i32, i32* %5
%12 = call i32 @insertInTree(%struct.tree* %10, i32 %11)
br label %21
13: ; preds = %2
br label %21
14: ; preds = %2
br label %21
15: ; preds = %2
br label %21
16: ; preds = %2
br label %21
17: ; preds = %2
br label %21
18: ; preds = %2
br label %21
19: ; preds = %2
br label %21
20: ; preds = %2
br label %21
21: ; preds = %20, %19, %18, %17, %16, %15, %14, %13, %7
ret void
}

LLVM IR (-O2):
%struct.tree = type { i32 }
@.str = [10 x i8] c"\0AValue : \00"
@.str.1 = [3 x i8] c"%d\00"
define void @performActionInTree(i32 %0, %struct.tree* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = icmp eq i32 %0, 1
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%9 = load i32, i32* %3
%10 = call i32 @insertInTree(%struct.tree* %1, i32 %9)
br label %11
11: ; preds = %2, %6
ret void
}