#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 */

/* Variables and functions */
int /*<<< orphan*/ bazulate(int, int);
int /*<<< orphan*/ frobulate(int);
int switcheroo(int arg) {
  switch (arg) {
  case 0:
  case 1:
  case 2:
    frobulate(arg);
    break;
  case 4:
    frobulate(arg - 3);
    break;
  case 6:
    bazulate(arg, arg);
  default:
    bazulate(0, 0);
  }
  return arg + 1;
}


x86 assembly (clang, -O0):
<switcheroo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x3,%eax
jb     1161 <switcheroo+0x41>
jmp    113f <switcheroo+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x4,%eax
je     116e <switcheroo+0x4e>
jmp    1150 <switcheroo+0x30>
mov    -0x8(%rbp),%eax
sub    $0x6,%eax
je     117e <switcheroo+0x5e>
jmp    1189 <switcheroo+0x69>
mov    -0x4(%rbp),%edi
call   1040 <frobulate@plt>
jmp    1192 <switcheroo+0x72>
mov    -0x4(%rbp),%edi
sub    $0x3,%edi
call   1040 <frobulate@plt>
jmp    1192 <switcheroo+0x72>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <bazulate@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <bazulate@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<switcheroo>:
push   %rbx
mov    %edi,%ebx
cmp    $0x3,%edi
jae    112c <switcheroo+0xc>
mov    %ebx,%edi
jmp    1155 <switcheroo+0x35>
cmp    $0x4,%ebx
je     1150 <switcheroo+0x30>
cmp    $0x6,%ebx
jne    1145 <switcheroo+0x25>
mov    $0x6,%edi
mov    $0x6,%esi
call   1030 <bazulate@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1030 <bazulate@plt>
jmp    115a <switcheroo+0x3a>
mov    $0x1,%edi
call   1040 <frobulate@plt>
add    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @switcheroo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %15 [
i32 0, label %4
i32 1, label %4
i32 2, label %4
i32 4, label %7
i32 6, label %11
]
4: ; preds = %1, %1, %1
%5 = load i32, i32* %2
%6 = call i32 @frobulate(i32 %5)
br label %17
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 3
%10 = call i32 @frobulate(i32 %9)
br label %17
11: ; preds = %1
%12 = load i32, i32* %2
%13 = load i32, i32* %2
%14 = call i32 @bazulate(i32 %12, i32 %13)
br label %15
15: ; preds = %1, %11
%16 = call i32 @bazulate(i32 0, i32 0)
br label %17
17: ; preds = %15, %7, %4
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 1
ret i32 %19
}

LLVM IR (-O2):
define i32 @switcheroo(i32 %0) {
switch i32 %0, label %8 [
i32 0, label %2
i32 1, label %2
i32 2, label %2
i32 4, label %4
i32 6, label %6
]
2: ; preds = %1, %1, %1
%3 = tail call i32 @frobulate(i32 %0)
br label %10
4: ; preds = %1
%5 = tail call i32 @frobulate(i32 1)
br label %10
6: ; preds = %1
%7 = tail call i32 @bazulate(i32 6, i32 6)
br label %8
8: ; preds = %1, %6
%9 = tail call i32 @bazulate(i32 0, i32 0)
br label %10
10: ; preds = %8, %4, %2
%11 = add nsw i32 %0, 1
ret i32 %11
}