#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 */
double findAreaLeft(int, int, int, int, int, int);
double findAreaMid(int, int, int, int, int, int);
double findAreaRight(int, int, int, int, int, int);
int /*<<< orphan*/ inputData(int *, int *, int *, int *, int *, int *);
int /*<<< orphan*/ printData(double);
int selectChoice();
int main(void) {
  int coeff_a;
  int coeff_b;
  int coeff_c;
  int initial;
  int final;
  int rectNum;
  int choice;
  double area;
  inputData(&coeff_a, &coeff_b, &coeff_c, &initial, &final, &rectNum);
  choice = selectChoice();
  switch (choice) {
  case 1:
    area = findAreaLeft(coeff_a, coeff_b, coeff_c, initial, final, rectNum);
    break;
  case 2:
    area = findAreaMid(coeff_a, coeff_b, coeff_c, initial, final, rectNum);
    break;
  case 3:
    area = findAreaRight(coeff_a, coeff_b, coeff_c, initial, final, rectNum);
    break;
  }
  printData(area);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
lea    -0x18(%rbp),%r8
lea    -0x1c(%rbp),%r9
call   1080 <inputData@plt>
xor    %eax,%eax
call   1030 <selectChoice@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x2c(%rbp)
sub    $0x1,%eax
je     11cc <main+0x6c>
jmp    11aa <main+0x4a>
mov    -0x2c(%rbp),%eax
sub    $0x2,%eax
je     11ef <main+0x8f>
jmp    11bb <main+0x5b>
mov    -0x2c(%rbp),%eax
sub    $0x3,%eax
je     1212 <main+0xb2>
jmp    1230 <main+0xd0>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
call   1050 <findAreaLeft@plt>
movsd  %xmm0,-0x28(%rbp)
jmp    1230 <main+0xd0>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
call   1040 <findAreaMid@plt>
movsd  %xmm0,-0x28(%rbp)
jmp    1230 <main+0xd0>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
call   1070 <findAreaRight@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1060 <printData@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0x4(%rsp),%r8
mov    %rsp,%r9
call   1080 <inputData@plt>
xor    %eax,%eax
call   1030 <selectChoice@plt>
cmp    $0x3,%eax
je     11b6 <main+0x56>
cmp    $0x2,%eax
jne    11d6 <main+0x76>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
mov    0x4(%rsp),%r8d
mov    (%rsp),%r9d
call   1040 <findAreaMid@plt>
jmp    11f4 <main+0x94>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
mov    0x4(%rsp),%r8d
mov    (%rsp),%r9d
call   1070 <findAreaRight@plt>
jmp    11f4 <main+0x94>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
mov    0x4(%rsp),%r8d
mov    (%rsp),%r9d
call   1050 <findAreaLeft@plt>
call   1060 <printData@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
store i32 0, i32* %1
%10 = call i32 @inputData(i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7)
%11 = call i32 (...) @selectChoice()
store i32 %11, i32* %8
%12 = load i32, i32* %8
switch i32 %12, label %37 [
i32 1, label %13
i32 2, label %21
i32 3, label %29
]
13: ; preds = %0
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = call double @findAreaLeft(i32 %14, i32 %15, i32 %16, i32 %17, i32 %18, i32 %19)
store double %20, double* %9
br label %37
21: ; preds = %0
%22 = load i32, i32* %2
%23 = load i32, i32* %3
%24 = load i32, i32* %4
%25 = load i32, i32* %5
%26 = load i32, i32* %6
%27 = load i32, i32* %7
%28 = call double @findAreaMid(i32 %22, i32 %23, i32 %24, i32 %25, i32 %26, i32 %27)
store double %28, double* %9
br label %37
29: ; preds = %0
%30 = load i32, i32* %2
%31 = load i32, i32* %3
%32 = load i32, i32* %4
%33 = load i32, i32* %5
%34 = load i32, i32* %6
%35 = load i32, i32* %7
%36 = call double @findAreaRight(i32 %30, i32 %31, i32 %32, i32 %33, i32 %34, i32 %35)
store double %36, double* %9
br label %37
37: ; preds = %0, %29, %21, %13
%38 = load double, double* %9
%39 = call i32 @printData(double %38)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %1 to i8*
%8 = bitcast i32* %2 to i8*
%9 = bitcast i32* %3 to i8*
%10 = bitcast i32* %4 to i8*
%11 = bitcast i32* %5 to i8*
%12 = bitcast i32* %6 to i8*
%13 = call i32 @inputData(i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6)
%14 = call i32 (...) @selectChoice()
switch i32 %14, label %39 [
i32 1, label %15
i32 2, label %23
i32 3, label %31
]
15: ; preds = %0
%16 = load i32, i32* %1
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = load i32, i32* %6
%22 = call double @findAreaLeft(i32 %16, i32 %17, i32 %18, i32 %19, i32 %20, i32 %21)
br label %40
23: ; preds = %0
%24 = load i32, i32* %1
%25 = load i32, i32* %2
%26 = load i32, i32* %3
%27 = load i32, i32* %4
%28 = load i32, i32* %5
%29 = load i32, i32* %6
%30 = call double @findAreaMid(i32 %24, i32 %25, i32 %26, i32 %27, i32 %28, i32 %29)
br label %40
31: ; preds = %0
%32 = load i32, i32* %1
%33 = load i32, i32* %2
%34 = load i32, i32* %3
%35 = load i32, i32* %4
%36 = load i32, i32* %5
%37 = load i32, i32* %6
%38 = call double @findAreaRight(i32 %32, i32 %33, i32 %34, i32 %35, i32 %36, i32 %37)
br label %40
39: ; preds = %0
unreachable
40: ; preds = %31, %23, %15
%41 = phi double [ %38, %31 ], [ %30, %23 ], [ %22, %15 ]
%42 = call i32 @printData(double %41)
ret i32 0
}