#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*/ add();
int /*<<< orphan*/ divide();
int /*<<< orphan*/ findAbsoluteValue();
int /*<<< orphan*/ findAcos();
int /*<<< orphan*/ findAsin();
int /*<<< orphan*/ findAtan();
int /*<<< orphan*/ findRemainder();
int get(char *);
int /*<<< orphan*/ multiply();
int /*<<< orphan*/ screwUp();
int /*<<< orphan*/ subtract();
void main() {
  int operation =
      get("Operation: 1: add, 2: subtract, 3: multiply, 4: divide, 5: "
          "remainder, 6: absolute value, 7: ACOS, 8: ASIN, 9: ATAN");
  switch (operation) {
  case 1:
    add();
  case 2:
    subtract();
  case 3:
    multiply();
  case 4:
    divide();
  case 5:
    findRemainder();
  case 6:
    findAbsoluteValue();
  case 7:
    findAcos();
  case 8:
    findAsin();
  case 9:
    findAtan();
  default:
    screwUp();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xe65(%rip),%rdi
call   10a0 <get@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x8,%eax
ja     122f <main+0x7f>
mov    -0x10(%rbp),%rax
lea    0xe19(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1040 <add@plt>
mov    $0x0,%al
call   10c0 <subtract@plt>
mov    $0x0,%al
call   1050 <multiply@plt>
mov    $0x0,%al
call   1080 <divide@plt>
mov    $0x0,%al
call   1070 <findRemainder@plt>
mov    $0x0,%al
call   1060 <findAbsoluteValue@plt>
mov    $0x0,%al
call   1030 <findAcos@plt>
mov    $0x0,%al
call   10b0 <findAsin@plt>
mov    $0x0,%al
call   10d0 <findAtan@plt>
mov    $0x0,%al
call   1090 <screwUp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xe6c(%rip),%rdi
call   10a0 <get@plt>
add    $0xffffffff,%eax
cmp    $0x8,%eax
ja     1214 <main+0x64>
lea    0xe34(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %eax,%eax
call   1040 <add@plt>
xor    %eax,%eax
call   10c0 <subtract@plt>
xor    %eax,%eax
call   1050 <multiply@plt>
xor    %eax,%eax
call   1080 <divide@plt>
xor    %eax,%eax
call   1070 <findRemainder@plt>
xor    %eax,%eax
call   1060 <findAbsoluteValue@plt>
xor    %eax,%eax
call   1030 <findAcos@plt>
xor    %eax,%eax
call   10b0 <findAsin@plt>
xor    %eax,%eax
call   10d0 <findAtan@plt>
xor    %eax,%eax
pop    %rcx
jmp    1090 <screwUp@plt>

LLVM IR (-O0):
@.str = [115 x i8] c"Operation: 1: add, 2: subtract, 3: multiply, 4: divide, 5: remainder, 6: absolute value, 7: ACOS, 8: ASIN, 9: ATAN\00"
define void @main() {
%1 = alloca i32
%2 = call i32 @get(i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str, i64 0, i64 0))
store i32 %2, i32* %1
%3 = load i32, i32* %1
switch i32 %3, label %22 [
i32 1, label %4
i32 2, label %6
i32 3, label %8
i32 4, label %10
i32 5, label %12
i32 6, label %14
i32 7, label %16
i32 8, label %18
i32 9, label %20
]
4: ; preds = %0
%5 = call i32 (...) @add()
br label %6
6: ; preds = %0, %4
%7 = call i32 (...) @subtract()
br label %8
8: ; preds = %0, %6
%9 = call i32 (...) @multiply()
br label %10
10: ; preds = %0, %8
%11 = call i32 (...) @divide()
br label %12
12: ; preds = %0, %10
%13 = call i32 (...) @findRemainder()
br label %14
14: ; preds = %0, %12
%15 = call i32 (...) @findAbsoluteValue()
br label %16
16: ; preds = %0, %14
%17 = call i32 (...) @findAcos()
br label %18
18: ; preds = %0, %16
%19 = call i32 (...) @findAsin()
br label %20
20: ; preds = %0, %18
%21 = call i32 (...) @findAtan()
br label %22
22: ; preds = %0, %20
%23 = call i32 (...) @screwUp()
br label %24
24: ; preds = %22
ret void
}

LLVM IR (-O2):
@.str = [115 x i8] c"Operation: 1: add, 2: subtract, 3: multiply, 4: divide, 5: remainder, 6: absolute value, 7: ACOS, 8: ASIN, 9: ATAN\00"
define void @main() {
%1 = tail call i32 @get(i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str, i64 0, i64 0))
switch i32 %1, label %20 [
i32 1, label %2
i32 2, label %4
i32 3, label %6
i32 4, label %8
i32 5, label %10
i32 6, label %12
i32 7, label %14
i32 8, label %16
i32 9, label %18
]
2: ; preds = %0
%3 = tail call i32 (...) @add()
br label %4
4: ; preds = %0, %2
%5 = tail call i32 (...) @subtract()
br label %6
6: ; preds = %0, %4
%7 = tail call i32 (...) @multiply()
br label %8
8: ; preds = %0, %6
%9 = tail call i32 (...) @divide()
br label %10
10: ; preds = %0, %8
%11 = tail call i32 (...) @findRemainder()
br label %12
12: ; preds = %0, %10
%13 = tail call i32 (...) @findAbsoluteValue()
br label %14
14: ; preds = %0, %12
%15 = tail call i32 (...) @findAcos()
br label %16
16: ; preds = %0, %14
%17 = tail call i32 (...) @findAsin()
br label %18
18: ; preds = %0, %16
%19 = tail call i32 (...) @findAtan()
br label %20
20: ; preds = %0, %18
%21 = tail call i32 (...) @screwUp()
ret void
}