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

/* Variables and functions */
int /*<<< orphan*/ bplus_tree_get(struct bplus_tree *, int);
int /*<<< orphan*/ bplus_tree_put(struct bplus_tree *, int, int);
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/);
void _proc(struct bplus_tree *tree, char op, int n) {
  switch (op) {
  case 'i':
    bplus_tree_put(tree, n, n);
    break;
  case 'r':
    bplus_tree_put(tree, n, 0);
    break;
  case 's':
    printf("key:%d data_index:%ld\n", n, bplus_tree_get(tree, n));
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<_proc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
movsbl -0x9(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x69,%eax
je     117c <_proc+0x4c>
jmp    115a <_proc+0x2a>
mov    -0x14(%rbp),%eax
sub    $0x72,%eax
je     1190 <_proc+0x60>
jmp    116b <_proc+0x3b>
mov    -0x14(%rbp),%eax
sub    $0x73,%eax
je     11a3 <_proc+0x73>
jmp    11cb <_proc+0x9b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <bplus_tree_put@plt>
jmp    11d0 <_proc+0xa0>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
xor    %edx,%edx
call   1030 <bplus_tree_put@plt>
jmp    11d0 <_proc+0xa0>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1050 <bplus_tree_get@plt>
mov    -0x18(%rbp),%esi
mov    %eax,%edx
lea    0xe3f(%rip),%rdi
call   1040 <printf@plt>
jmp    11d0 <_proc+0xa0>
jmp    11d0 <_proc+0xa0>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_proc>:
push   %rbx
mov    %edx,%ebx
cmp    $0x73,%esi
je     114c <_proc+0x1c>
cmp    $0x72,%esi
je     1164 <_proc+0x34>
cmp    $0x69,%esi
jne    116e <_proc+0x3e>
mov    %ebx,%esi
mov    %ebx,%edx
pop    %rbx
jmp    1030 <bplus_tree_put@plt>
mov    %ebx,%esi
call   1050 <bplus_tree_get@plt>
lea    0xea6(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
jmp    1040 <printf@plt>
mov    %ebx,%esi
xor    %edx,%edx
pop    %rbx
jmp    1030 <bplus_tree_put@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct.bplus_tree = type { i32 }
@.str = [23 x i8] c"key:%d data_index:%ld\0A\00"
define void @_proc(%struct.bplus_tree* %0, i8 signext %1, i32 %2) {
%4 = alloca %struct.bplus_tree*
%5 = alloca i8
%6 = alloca i32
store %struct.bplus_tree* %0, %struct.bplus_tree** %4
store i8 %1, i8* %5
store i32 %2, i32* %6
%7 = load i8, i8* %5
%8 = sext i8 %7 to i32
switch i32 %8, label %24 [
i32 105, label %9
i32 114, label %14
i32 115, label %18
]
9: ; preds = %3
%10 = load %struct.bplus_tree*, %struct.bplus_tree** %4
%11 = load i32, i32* %6
%12 = load i32, i32* %6
%13 = call i32 @bplus_tree_put(%struct.bplus_tree* %10, i32 %11, i32 %12)
br label %25
14: ; preds = %3
%15 = load %struct.bplus_tree*, %struct.bplus_tree** %4
%16 = load i32, i32* %6
%17 = call i32 @bplus_tree_put(%struct.bplus_tree* %15, i32 %16, i32 0)
br label %25
18: ; preds = %3
%19 = load i32, i32* %6
%20 = load %struct.bplus_tree*, %struct.bplus_tree** %4
%21 = load i32, i32* %6
%22 = call i32 @bplus_tree_get(%struct.bplus_tree* %20, i32 %21)
%23 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %19, i32 %22)
br label %25
24: ; preds = %3
br label %25
25: ; preds = %24, %18, %14, %9
ret void
}

LLVM IR (-O2):
%struct.bplus_tree = type { i32 }
@.str = [23 x i8] c"key:%d data_index:%ld\0A\00"
define void @_proc(%struct.bplus_tree* %0, i8 signext %1, i32 %2) {
%4 = sext i8 %1 to i32
switch i32 %4, label %12 [
i32 105, label %5
i32 114, label %7
i32 115, label %9
]
5: ; preds = %3
%6 = tail call i32 @bplus_tree_put(%struct.bplus_tree* %0, i32 %2, i32 %2)
br label %12
7: ; preds = %3
%8 = tail call i32 @bplus_tree_put(%struct.bplus_tree* %0, i32 %2, i32 0)
br label %12
9: ; preds = %3
%10 = tail call i32 @bplus_tree_get(%struct.bplus_tree* %0, i32 %2)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %10)
br label %12
12: ; preds = %3, %9, %7, %5
ret void
}