#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 atomic_mass_phosphate();
char char_input();
char character_encoding(char);
double circuit_current(double, double);
int /*<<< orphan*/ display_introduction();
double double_input();
double general_equation(int, double, double);
double height_projectile(double, double, double);
int int_input();
double newtons_2nd_law(double, double);
int /*<<< orphan*/ printf(char *, ...);
double volume_cylinder(double, double);
int main(void) {
  double force = 0.0, mass = 0.0, acceleration = 0.0;
  double cylinder_volume = 0.0, radius = 0.0, height = 0.0;
  char plaintext_character = '\0', encoded_character = '\0';
  double phosphate_atomic_mass = 0.0;
  double projectile_height = 0.0, time = 0.0, initial_velocity = 0.0,
         initial_height = 0.0;
  double current = 0.0, power = 0.0, resistance = 0.0;
  double var_X = 0.0, var_Y = 0.0, var_Z = 0.0;
  int var_A = 0;
  display_introduction();
  printf("*******************Equation 1: Newton's Second Law of "
         "Motion********************");
  printf("Please enter the mass: ");
  mass = double_input();
  printf("Please enter the acceleration: ");
  acceleration = double_input();
  force = newtons_2nd_law(mass, acceleration);
  printf("Force = mass * acceleration = %.2lf * %.2lf = %.2lf\n\n", mass,
         acceleration, force);
  printf("************************Equation 2: Volume of a "
         "Cylinder************************");
  printf("Please enter the radius: ");
  radius = double_input();
  printf("Please enter the height: ");
  height = double_input();
  cylinder_volume = volume_cylinder(radius, height);
  printf("Volume of a Cylinder = PI * radius^2 * height = %.2lf * %.2lf^2 * "
         "%.2lf = %.2lf * %.2lf * %.2lf * %.2lf = %.2lf\n\n",
         3.14159265, radius, height, 3.14159265, radius, radius, height,
         cylinder_volume);
  printf("************************Equation 3: Encoding a "
         "Character************************");
  printf("Please enter a character: ");
  plaintext_character = char_input();
  encoded_character = character_encoding(plaintext_character);
  printf("Encoded Character = Original Character + 4 = %c + 4 = %c\n\n",
         plaintext_character, encoded_character);
  printf("*********************Equation 4: Atomic Mass of "
         "Phosphate***********************");
  phosphate_atomic_mass = atomic_mass_phosphate();
  printf("Atomic Mass of Phosphate = 3 * Mass of Hydrogen + 4 * Mass of Oxygen "
         "+ Mass of Phosphorous = 3 * %.2lf + 4 * %.2lf + %.2lf = %.2lf\n\n",
         1.008, 16.00, 30.97, phosphate_atomic_mass);
  printf("**********************Equation 5: Height of a "
         "Projectile************************");
  printf("Please enter time: ");
  time = double_input();
  printf("Please enter initial velocity: ");
  initial_velocity = double_input();
  printf("Please enter initial height: ");
  initial_height = double_input();
  projectile_height = height_projectile(time, initial_velocity, initial_height);
  printf("Projectile Height = -16 * Time^2 + Initial Velocity * Time + Initial "
         "Height = -16 * %.2lf^2 + %.2lf * %.2lf + %.2lf = %.2lf\n\n",
         time, initial_velocity, time, initial_height, projectile_height);
  printf("****************Equation 6: Current through Circuit in "
         "Amperes******************");
  printf("Please enter power: ");
  power = double_input();
  printf("Please enter resistance: ");
  resistance = double_input();
  current = circuit_current(power, resistance);
  printf(
      "Current = sqrt(power / resistance) = sqrt(%.2lf / %.2lf ) = %.2lf\n\n",
      power, resistance, current);
  printf("*************************Equation 7: General "
         "Equation***************************");
  printf("Please enter x: ");
  var_X = double_input();
  printf("Please enter z: ");
  var_Z = double_input();
  printf("Please enter A: ");
  var_A = int_input();
  var_Y = general_equation(var_A, var_X, var_Z);
  printf("Y = (3 / 4) * x - z / (A %% 2) + PI = (3.0 / 4.0) * %.2lf - %.2lf / "
         "(%d %% 2) + %.2lf = %.2lf\n",
         var_X, var_Z, var_A, 3.14159265, var_Y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movb   $0x0,-0x39(%rbp)
movb   $0x0,-0x3a(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movl   $0x0,-0x9c(%rbp)
mov    $0x0,%al
call   1030 <display_introduction@plt>
lea    0xd9d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xde0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <double_input@plt>
movsd  %xmm0,-0x18(%rbp)
lea    0xdde(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <double_input@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   10a0 <newtons_2nd_law@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
lea    0xdc1(%rip),%rdi
mov    $0x3,%al
call   1050 <printf@plt>
lea    0xde9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe2c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <double_input@plt>
movsd  %xmm0,-0x30(%rbp)
lea    0xe2c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <double_input@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
call   1080 <volume_cylinder@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x30(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm4
movsd  -0x30(%rbp),%xmm5
movsd  -0x38(%rbp),%xmm6
movsd  -0x28(%rbp),%xmm7
lea    0xdfa(%rip),%rdi
movsd  0xc8e(%rip),%xmm3
movaps %xmm3,%xmm0
mov    $0x8,%al
call   1050 <printf@plt>
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1070 <char_input@plt>
mov    %al,-0x39(%rbp)
movsbl -0x39(%rbp),%edi
call   10b0 <character_encoding@plt>
mov    %al,-0x3a(%rbp)
movsbl -0x39(%rbp),%esi
movsbl -0x3a(%rbp),%edx
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   10c0 <atomic_mass_phosphate@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm3
lea    0xee4(%rip),%rdi
movsd  0xc16(%rip),%xmm0
movsd  0xc16(%rip),%xmm1
movsd  0xc16(%rip),%xmm2
mov    $0x4,%al
call   1050 <printf@plt>
lea    0xf43(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf86(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <double_input@plt>
movsd  %xmm0,-0x58(%rbp)
lea    0xf80(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <double_input@plt>
movsd  %xmm0,-0x60(%rbp)
lea    0xf86(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <double_input@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm2
call   10d0 <height_projectile@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm3
movsd  -0x50(%rbp),%xmm4
lea    0xf58(%rip),%rdi
mov    $0x5,%al
call   1050 <printf@plt>
lea    0xfc8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0x100b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <double_input@plt>
movsd  %xmm0,-0x78(%rbp)
lea    0x1006(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <double_input@plt>
movsd  %xmm0,-0x80(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm1
call   10e0 <circuit_current@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm2
lea    0xfe3(%rip),%rdi
mov    $0x3,%al
call   1050 <printf@plt>
lea    0x1019(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0x105c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <double_input@plt>
movsd  %xmm0,-0x88(%rbp)
ff
lea    0x1050(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <double_input@plt>
movsd  %xmm0,-0x98(%rbp)
ff
lea    0x1044(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <int_input@plt>
mov    %eax,-0x9c(%rbp)
mov    -0x9c(%rbp),%edi
movsd  -0x88(%rbp),%xmm0
ff
movsd  -0x98(%rbp),%xmm1
ff
call   1090 <general_equation@plt>
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  -0x98(%rbp),%xmm1
ff
mov    -0x9c(%rbp),%esi
movsd  -0x90(%rbp),%xmm3
ff
lea    0xff9(%rip),%rdi
movsd  0xa35(%rip),%xmm2
mov    $0x4,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
xor    %eax,%eax
call   1030 <display_introduction@plt>
lea    0xe4d(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe90(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <double_input@plt>
movsd  %xmm0,0x8(%rsp)
lea    0xe8d(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <double_input@plt>
movaps %xmm0,%xmm1
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   10a0 <newtons_2nd_law@plt>
movaps %xmm0,%xmm2
lea    0xe81(%rip),%rdi
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mov    $0x3,%al
call   1050 <printf@plt>
lea    0xe9d(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xee0(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <double_input@plt>
movsd  %xmm0,0x8(%rsp)
lea    0xedf(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <double_input@plt>
movaps %xmm0,%xmm1
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1080 <volume_cylinder@plt>
movaps %xmm0,%xmm7
lea    0xecd(%rip),%rdi
movsd  0xd61(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
movaps %xmm0,%xmm3
movaps %xmm1,%xmm4
movaps %xmm1,%xmm5
movaps %xmm2,%xmm6
mov    $0x8,%al
call   1050 <printf@plt>
lea    0xf11(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf54(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1070 <char_input@plt>
movsbl %al,%ebx
mov    %ebx,%edi
call   10b0 <character_encoding@plt>
movsbl %al,%edx
lea    0xf4d(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf78(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   10c0 <atomic_mass_phosphate@plt>
movaps %xmm0,%xmm3
lea    0xfb1(%rip),%rdi
movsd  0xce3(%rip),%xmm0
movsd  0xce3(%rip),%xmm1
movsd  0xce3(%rip),%xmm2
mov    $0x4,%al
call   1050 <printf@plt>
lea    0x1010(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x1053(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <double_input@plt>
movsd  %xmm0,0x8(%rsp)
lea    0x104c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <double_input@plt>
movsd  %xmm0,0x10(%rsp)
lea    0x1051(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <double_input@plt>
movaps %xmm0,%xmm2
movsd  %xmm0,0x18(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   10d0 <height_projectile@plt>
movaps %xmm0,%xmm4
lea    0x103d(%rip),%rdi
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movaps %xmm0,%xmm2
movsd  0x18(%rsp),%xmm3
mov    $0x5,%al
call   1050 <printf@plt>
lea    0x1098(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x10db(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <double_input@plt>
movsd  %xmm0,0x8(%rsp)
lea    0x10d5(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <double_input@plt>
movaps %xmm0,%xmm1
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   10e0 <circuit_current@plt>
movaps %xmm0,%xmm2
lea    0x10c3(%rip),%rdi
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mov    $0x3,%al
call   1050 <printf@plt>
lea    0x10ed(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x1130(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <double_input@plt>
movsd  %xmm0,0x8(%rsp)
lea    0x1126(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <double_input@plt>
movsd  %xmm0,0x10(%rsp)
lea    0x111c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <int_input@plt>
mov    %eax,%ebx
mov    %eax,%edi
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1090 <general_equation@plt>
movaps %xmm0,%xmm3
lea    0x1100(%rip),%rdi
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mov    %ebx,%esi
movsd  0xb2e(%rip),%xmm2
mov    $0x4,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [81 x i8] c"*******************Equation 1: Newton's Second Law of Motion********************\00"
@.str.1 = [24 x i8] c"Please enter the mass: \00"
@.str.2 = [32 x i8] c"Please enter the acceleration: \00"
@.str.3 = [54 x i8] c"Force = mass * acceleration = %.2lf * %.2lf = %.2lf\0A\0A\00"
@.str.4 = [81 x i8] c"************************Equation 2: Volume of a Cylinder************************\00"
@.str.5 = [26 x i8] c"Please enter the radius: \00"
@.str.6 = [26 x i8] c"Please enter the height: \00"
@.str.7 = [114 x i8] c"Volume of a Cylinder = PI * radius^2 * height = %.2lf * %.2lf^2 * %.2lf = %.2lf * %.2lf * %.2lf * %.2lf = %.2lf\0A\0A\00"
@.str.8 = [81 x i8] c"************************Equation 3: Encoding a Character************************\00"
@.str.9 = [27 x i8] c"Please enter a character: \00"
@.str.10 = [59 x i8] c"Encoded Character = Original Character + 4 = %c + 4 = %c\0A\0A\00"
@.str.11 = [81 x i8] c"*********************Equation 4: Atomic Mass of Phosphate***********************\00"
@.str.12 = [133 x i8] c"Atomic Mass of Phosphate = 3 * Mass of Hydrogen + 4 * Mass of Oxygen + Mass of Phosphorous = 3 * %.2lf + 4 * %.2lf + %.2lf = %.2lf\0A\0A\00"
@.str.13 = [81 x i8] c"**********************Equation 5: Height of a Projectile************************\00"
@.str.14 = [20 x i8] c"Please enter time: \00"
@.str.15 = [32 x i8] c"Please enter initial velocity: \00"
@.str.16 = [30 x i8] c"Please enter initial height: \00"
@.str.17 = [126 x i8] c"Projectile Height = -16 * Time^2 + Initial Velocity * Time + Initial Height = -16 * %.2lf^2 + %.2lf * %.2lf + %.2lf = %.2lf\0A\0A\00"
@.str.18 = [81 x i8] c"****************Equation 6: Current through Circuit in Amperes******************\00"
@.str.19 = [21 x i8] c"Please enter power: \00"
@.str.20 = [26 x i8] c"Please enter resistance: \00"
@.str.21 = [68 x i8] c"Current = sqrt(power / resistance) = sqrt(%.2lf / %.2lf ) = %.2lf\0A\0A\00"
@.str.22 = [81 x i8] c"*************************Equation 7: General Equation***************************\00"
@.str.23 = [17 x i8] c"Please enter x: \00"
@.str.24 = [17 x i8] c"Please enter z: \00"
@.str.25 = [17 x i8] c"Please enter A: \00"
@.str.26 = [95 x i8] c"Y = (3 / 4) * x - z / (A %% 2) + PI = (3.0 / 4.0) * %.2lf - %.2lf / (%d %% 2) + %.2lf = %.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca i8
%9 = alloca i8
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca i32
store i32 0, i32* %1
store double 0.000000e+00, double* %2
store double 0.000000e+00, double* %3
store double 0.000000e+00, double* %4
store double 0.000000e+00, double* %5
store double 0.000000e+00, double* %6
store double 0.000000e+00, double* %7
store i8 0, i8* %8
store i8 0, i8* %9
store double 0.000000e+00, double* %10
store double 0.000000e+00, double* %11
store double 0.000000e+00, double* %12
store double 0.000000e+00, double* %13
store double 0.000000e+00, double* %14
store double 0.000000e+00, double* %15
store double 0.000000e+00, double* %16
store double 0.000000e+00, double* %17
store double 0.000000e+00, double* %18
store double 0.000000e+00, double* %19
store double 0.000000e+00, double* %20
store i32 0, i32* %21
%22 = call i32 (...) @display_introduction()
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0))
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%25 = call double (...) @double_input()
store double %25, double* %3
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%27 = call double (...) @double_input()
store double %27, double* %4
%28 = load double, double* %3
%29 = load double, double* %4
%30 = call double @newtons_2nd_law(double %28, double %29)
store double %30, double* %2
%31 = load double, double* %3
%32 = load double, double* %4
%33 = load double, double* %2
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.3, i64 0, i64 0), double %31, double %32, double %33)
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.4, i64 0, i64 0))
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
%37 = call double (...) @double_input()
store double %37, double* %6
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0))
%39 = call double (...) @double_input()
store double %39, double* %7
%40 = load double, double* %6
%41 = load double, double* %7
%42 = call double @volume_cylinder(double %40, double %41)
store double %42, double* %5
%43 = load double, double* %6
%44 = load double, double* %7
%45 = load double, double* %6
%46 = load double, double* %6
%47 = load double, double* %7
%48 = load double, double* %5
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([114 x i8], [114 x i8]* @.str.7, i64 0, i64 0), double 0x400921FB53C8D4F1, double %43, double %44, double 0x400921FB53C8D4F1, double %45, double %46, double %47, double %48)
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.8, i64 0, i64 0))
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0))
%52 = call signext i8 (...) @char_input()
store i8 %52, i8* %8
%53 = load i8, i8* %8
%54 = call signext i8 @character_encoding(i8 signext %53)
store i8 %54, i8* %9
%55 = load i8, i8* %8
%56 = sext i8 %55 to i32
%57 = load i8, i8* %9
%58 = sext i8 %57 to i32
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.10, i64 0, i64 0), i32 %56, i32 %58)
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.11, i64 0, i64 0))
%61 = call double (...) @atomic_mass_phosphate()
store double %61, double* %10
%62 = load double, double* %10
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str.12, i64 0, i64 0), double 1.008000e+00, double 1.600000e+01, double 3.097000e+01, double %62)
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.13, i64 0, i64 0))
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0))
%66 = call double (...) @double_input()
store double %66, double* %12
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.15, i64 0, i64 0))
%68 = call double (...) @double_input()
store double %68, double* %13
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.16, i64 0, i64 0))
%70 = call double (...) @double_input()
store double %70, double* %14
%71 = load double, double* %12
%72 = load double, double* %13
%73 = load double, double* %14
%74 = call double @height_projectile(double %71, double %72, double %73)
store double %74, double* %11
%75 = load double, double* %12
%76 = load double, double* %13
%77 = load double, double* %12
%78 = load double, double* %14
%79 = load double, double* %11
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.17, i64 0, i64 0), double %75, double %76, double %77, double %78, double %79)
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.18, i64 0, i64 0))
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.19, i64 0, i64 0))
%83 = call double (...) @double_input()
store double %83, double* %16
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.20, i64 0, i64 0))
%85 = call double (...) @double_input()
store double %85, double* %17
%86 = load double, double* %16
%87 = load double, double* %17
%88 = call double @circuit_current(double %86, double %87)
store double %88, double* %15
%89 = load double, double* %16
%90 = load double, double* %17
%91 = load double, double* %15
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.21, i64 0, i64 0), double %89, double %90, double %91)
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.22, i64 0, i64 0))
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.23, i64 0, i64 0))
%95 = call double (...) @double_input()
store double %95, double* %18
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.24, i64 0, i64 0))
%97 = call double (...) @double_input()
store double %97, double* %20
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.25, i64 0, i64 0))
%99 = call i32 (...) @int_input()
store i32 %99, i32* %21
%100 = load i32, i32* %21
%101 = load double, double* %18
%102 = load double, double* %20
%103 = call double @general_equation(i32 %100, double %101, double %102)
store double %103, double* %19
%104 = load double, double* %18
%105 = load double, double* %20
%106 = load i32, i32* %21
%107 = load double, double* %19
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str.26, i64 0, i64 0), double %104, double %105, i32 %106, double 0x400921FB53C8D4F1, double %107)
ret i32 0
}

LLVM IR (-O2):
@.str = [81 x i8] c"*******************Equation 1: Newton's Second Law of Motion********************\00"
@.str.1 = [24 x i8] c"Please enter the mass: \00"
@.str.2 = [32 x i8] c"Please enter the acceleration: \00"
@.str.3 = [54 x i8] c"Force = mass * acceleration = %.2lf * %.2lf = %.2lf\0A\0A\00"
@.str.4 = [81 x i8] c"************************Equation 2: Volume of a Cylinder************************\00"
@.str.5 = [26 x i8] c"Please enter the radius: \00"
@.str.6 = [26 x i8] c"Please enter the height: \00"
@.str.7 = [114 x i8] c"Volume of a Cylinder = PI * radius^2 * height = %.2lf * %.2lf^2 * %.2lf = %.2lf * %.2lf * %.2lf * %.2lf = %.2lf\0A\0A\00"
@.str.8 = [81 x i8] c"************************Equation 3: Encoding a Character************************\00"
@.str.9 = [27 x i8] c"Please enter a character: \00"
@.str.10 = [59 x i8] c"Encoded Character = Original Character + 4 = %c + 4 = %c\0A\0A\00"
@.str.11 = [81 x i8] c"*********************Equation 4: Atomic Mass of Phosphate***********************\00"
@.str.12 = [133 x i8] c"Atomic Mass of Phosphate = 3 * Mass of Hydrogen + 4 * Mass of Oxygen + Mass of Phosphorous = 3 * %.2lf + 4 * %.2lf + %.2lf = %.2lf\0A\0A\00"
@.str.13 = [81 x i8] c"**********************Equation 5: Height of a Projectile************************\00"
@.str.14 = [20 x i8] c"Please enter time: \00"
@.str.15 = [32 x i8] c"Please enter initial velocity: \00"
@.str.16 = [30 x i8] c"Please enter initial height: \00"
@.str.17 = [126 x i8] c"Projectile Height = -16 * Time^2 + Initial Velocity * Time + Initial Height = -16 * %.2lf^2 + %.2lf * %.2lf + %.2lf = %.2lf\0A\0A\00"
@.str.18 = [81 x i8] c"****************Equation 6: Current through Circuit in Amperes******************\00"
@.str.19 = [21 x i8] c"Please enter power: \00"
@.str.20 = [26 x i8] c"Please enter resistance: \00"
@.str.21 = [68 x i8] c"Current = sqrt(power / resistance) = sqrt(%.2lf / %.2lf ) = %.2lf\0A\0A\00"
@.str.22 = [81 x i8] c"*************************Equation 7: General Equation***************************\00"
@.str.23 = [17 x i8] c"Please enter x: \00"
@.str.24 = [17 x i8] c"Please enter z: \00"
@.str.25 = [17 x i8] c"Please enter A: \00"
@.str.26 = [95 x i8] c"Y = (3 / 4) * x - z / (A %% 2) + PI = (3.0 / 4.0) * %.2lf - %.2lf / (%d %% 2) + %.2lf = %.2lf\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @display_introduction()
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call double (...) @double_input()
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call double (...) @double_input()
%7 = tail call double @newtons_2nd_law(double %4, double %6)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.3, i64 0, i64 0), double %4, double %6, double %7)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @.str.4, i64 0, i64 0))
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
%11 = tail call double (...) @double_input()
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0))
%13 = tail call double (...) @double_input()
%14 = tail call double @volume_cylinder(double %11, double %13)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([114 x i8], [114 x i8]* @.str.7, i64 0, i64 0), double 0x400921FB53C8D4F1, double %11, double %13, double 0x400921FB53C8D4F1, double %11, double %11, double %13, double %14)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @.str.8, i64 0, i64 0))
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0))
%18 = tail call signext i8 (...) @char_input()
%19 = tail call signext i8 @character_encoding(i8 signext %18)
%20 = sext i8 %18 to i32
%21 = sext i8 %19 to i32
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str.10, i64 0, i64 0), i32 %20, i32 %21)
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @.str.11, i64 0, i64 0))
%24 = tail call double (...) @atomic_mass_phosphate()
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([133 x i8], [133 x i8]* @.str.12, i64 0, i64 0), double 1.008000e+00, double 1.600000e+01, double 3.097000e+01, double %24)
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @.str.13, i64 0, i64 0))
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0))
%28 = tail call double (...) @double_input()
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.15, i64 0, i64 0))
%30 = tail call double (...) @double_input()
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.16, i64 0, i64 0))
%32 = tail call double (...) @double_input()
%33 = tail call double @height_projectile(double %28, double %30, double %32)
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([126 x i8], [126 x i8]* @.str.17, i64 0, i64 0), double %28, double %30, double %28, double %32, double %33)
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @.str.18, i64 0, i64 0))
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.19, i64 0, i64 0))
%37 = tail call double (...) @double_input()
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.20, i64 0, i64 0))
%39 = tail call double (...) @double_input()
%40 = tail call double @circuit_current(double %37, double %39)
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @.str.21, i64 0, i64 0), double %37, double %39, double %40)
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @.str.22, i64 0, i64 0))
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.23, i64 0, i64 0))
%44 = tail call double (...) @double_input()
%45 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.24, i64 0, i64 0))
%46 = tail call double (...) @double_input()
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.25, i64 0, i64 0))
%48 = tail call i32 (...) @int_input()
%49 = tail call double @general_equation(i32 %48, double %44, double %46)
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([95 x i8], [95 x i8]* @.str.26, i64 0, i64 0), double %44, double %46, i32 %48, double 0x400921FB53C8D4F1, double %49)
ret i32 0
}