#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*/ getchar();
double pow(float, double);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  float Endurance, Diameter, ReliabilityLevel, a, b, Kb, Ka, Kc;
  float Kd, Kf, Ke;
  char SurfaceCondition, Units, Bend;
  printf("Please input the surface condition of a shaft: G, M, H, or A? > ");
  scanf("%c", &SurfaceCondition);
  getchar();
  printf("Please input the diameter of the shaft > ");
  scanf("%f", &Diameter);
  getchar();
  printf("Please input the units of the diameter (I or M) > ");
  scanf("%c", &Units);
  getchar();
  printf("Please specify whether your shaft is bending (B) or torsion (T) > ");
  scanf("%c", &Bend);
  getchar();
  printf("Please specify the reliability level in percentage > ");
  scanf("%f", &ReliabilityLevel);
  getchar();
  if (SurfaceCondition == 'G') {
    a = 1.34;
    b = -.085;
  } else if (SurfaceCondition == 'M') {
    a = 2.70;
    b = -.265;
  } else if (SurfaceCondition == 'H') {
    a = 14.4;
    b = -.718;
  } else if (SurfaceCondition == 'A') {
    a = 39.9;
    b = -.995;
  } else
    printf("AYour inputs are wrong. So I gave you the wrong answers\n");
  Ka = a * pow(75, b);
  if (Units == 'I') {
    if (Diameter <= 2) {
      if (Diameter >= .11)
        Kb = 0.879 * pow(Diameter, -.107);
      else
        printf("BYour inputs are wrong. So I gave you the wrong answers\n");
    }
    if (Diameter > 2) {
      if (Diameter <= 10)
        Kb = .879 * pow(Diameter, -.107);
      else
        printf("CYour inputs are wrong. So I gave you the wrong answers\n");
    }
  }
  if (Units == 'M') {
    if (Diameter <= 51) {
      if (Diameter >= 2.79)
        Kb = 1.24 * pow(Diameter, -.107);
      else
        printf("DYour inputs are wrong. So I gave you the wrong answers\n");
    }
    if (Diameter <= 254) {
      if (Diameter > 51)
        Kb = 1.51 * pow(Diameter, -.157);
      else
        printf("EYour inputs are wrong. So I gave you the wrong answers\n");
    }
  }
  if (Bend == 'B')
    Kc = 1;
  else if (Bend == 'T')
    Kc = .59;
  else
    printf("FYour inputs are wrong. So I gave you the wrong answers\n");
  Kd = 1;
  Kf = 1;
  if (ReliabilityLevel <= 50 && ReliabilityLevel > 0)
    Ke = 1.000;
  else if (ReliabilityLevel > 50 && ReliabilityLevel <= 90)
    Ke = .897;
  else if (ReliabilityLevel > 90 && ReliabilityLevel <= 95)
    Ke = .814;
  else if (ReliabilityLevel > 95 && ReliabilityLevel <= 99.000)
    Ke = .814;
  else if (ReliabilityLevel > 99.000) {
    if (ReliabilityLevel <= 99.9)
      Ke = .753;
  }
  Endurance = Ka * Kb * Kc * Kd * Ke * Kf;
  printf("\n\nThe estimated endurance limit for this shaft is %.3f\n\n",
         Endurance);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xf4a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf7d(%rip),%rdi
lea    -0x31(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
lea    0xf67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf83(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
lea    0xf6d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf2f(%rip),%rdi
lea    -0x32(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
lea    0xf79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf08(%rip),%rdi
lea    -0x33(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
lea    0xf95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf0e(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl -0x31(%rbp),%eax
cmp    $0x47,%eax
jne    123e <main+0xfe>
movss  0xdf5(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xde4(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
jmp    12df <main+0x19f>
movsbl -0x31(%rbp),%eax
cmp    $0x4d,%eax
jne    126a <main+0x12a>
movss  0xdc1(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xdb0(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
jmp    12da <main+0x19a>
movsbl -0x31(%rbp),%eax
cmp    $0x48,%eax
jne    1296 <main+0x156>
movss  0xd8d(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xd7c(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
jmp    12d5 <main+0x195>
movsbl -0x31(%rbp),%eax
cmp    $0x41,%eax
jne    12c2 <main+0x182>
movss  0xd59(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xd48(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
jmp    12d0 <main+0x190>
lea    0xef4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d5 <main+0x195>
jmp    12da <main+0x19a>
jmp    12df <main+0x19f>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  0xd22(%rip),%xmm0
call   1060 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
movsbl -0x32(%rbp),%eax
cmp    $0x49,%eax
jne    1403 <main+0x2c3>
movss  0xcf7(%rip),%xmm0
ucomiss -0xc(%rbp),%xmm0
jb     1394 <main+0x254>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd10(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1381 <main+0x241>
movss  -0xc(%rbp),%xmm0
movsd  0xd09(%rip),%xmm1
call   1060 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xcf1(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    138f <main+0x24f>
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1394 <main+0x254>
movss  -0xc(%rbp),%xmm0
movss  0xc83(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    13fe <main+0x2be>
movss  0xc76(%rip),%xmm0
ucomiss -0xc(%rbp),%xmm0
jb     13eb <main+0x2ab>
movss  -0xc(%rbp),%xmm0
movsd  0xc9f(%rip),%xmm1
call   1060 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xc87(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    13f9 <main+0x2b9>
lea    0xe3d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13fe <main+0x2be>
jmp    1403 <main+0x2c3>
movsbl -0x32(%rbp),%eax
cmp    $0x4d,%eax
jne    14ee <main+0x3ae>
movss  0xc14(%rip),%xmm0
ucomiss -0xc(%rbp),%xmm0
jb     147f <main+0x33f>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xc3d(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     146c <main+0x32c>
movss  -0xc(%rbp),%xmm0
movsd  0xc1e(%rip),%xmm1
call   1060 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xc1e(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    147a <main+0x33a>
lea    0xdf5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    147f <main+0x33f>
movss  0xba9(%rip),%xmm0
ucomiss -0xc(%rbp),%xmm0
jb     14e9 <main+0x3a9>
movss  -0xc(%rbp),%xmm0
movss  0xb8e(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    14d6 <main+0x396>
movss  -0xc(%rbp),%xmm0
movsd  0xbd4(%rip),%xmm1
call   1060 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xbbc(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    14e4 <main+0x3a4>
lea    0xdc4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    14e9 <main+0x3a9>
jmp    14ee <main+0x3ae>
movsbl -0x33(%rbp),%eax
cmp    $0x42,%eax
jne    150d <main+0x3cd>
movss  0xb35(%rip),%xmm0
movss  %xmm0,-0x24(%rbp)
jmp    153f <main+0x3ff>
movsbl -0x33(%rbp),%eax
cmp    $0x54,%eax
jne    152c <main+0x3ec>
movss  0xb12(%rip),%xmm0
movss  %xmm0,-0x24(%rbp)
jmp    153a <main+0x3fa>
lea    0xda7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    153f <main+0x3ff>
movss  0xaf1(%rip),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  0xae4(%rip),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  0xadb(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jb     158e <main+0x44e>
movss  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    158e <main+0x44e>
movss  0xab4(%rip),%xmm0
movss  %xmm0,-0x30(%rbp)
jmp    16a1 <main+0x561>
movss  -0x10(%rbp),%xmm0
movss  0xaa1(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    15c8 <main+0x488>
movss  0xa94(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jb     15c8 <main+0x488>
movss  0xa92(%rip),%xmm0
movss  %xmm0,-0x30(%rbp)
jmp    169c <main+0x55c>
movss  -0x10(%rbp),%xmm0
movss  0xa6b(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1602 <main+0x4c2>
movss  0xa5e(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jb     1602 <main+0x4c2>
movss  0xa54(%rip),%xmm0
movss  %xmm0,-0x30(%rbp)
jmp    1697 <main+0x557>
movss  -0x10(%rbp),%xmm0
movss  0xa35(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1645 <main+0x505>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xa67(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1645 <main+0x505>
movss  0xa11(%rip),%xmm0
movss  %xmm0,-0x30(%rbp)
jmp    1692 <main+0x552>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xa3a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    168d <main+0x54d>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xa27(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1688 <main+0x548>
movss  0x9c5(%rip),%xmm0
movss  %xmm0,-0x30(%rbp)
jmp    168d <main+0x54d>
jmp    1692 <main+0x552>
jmp    1697 <main+0x557>
jmp    169c <main+0x55c>
jmp    16a1 <main+0x561>
movss  -0x20(%rbp),%xmm0
mulss  -0x1c(%rbp),%xmm0
mulss  -0x24(%rbp),%xmm0
mulss  -0x28(%rbp),%xmm0
mulss  -0x30(%rbp),%xmm0
mulss  -0x2c(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc3f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xc68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
lea    0xf7e(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xfb1(%rip),%rbx
lea    0xf(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <scanf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
lea    0xf97(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xfb3(%rip),%r14
lea    0x10(%rsp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1070 <scanf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
lea    0xf99(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x7(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <scanf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
lea    0xfa8(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <scanf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
lea    0xfc7(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x14(%rsp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1070 <scanf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    0xf(%rsp),%al
add    $0xbf,%al
cmp    $0xc,%al
ja     1534 <main+0x3d4>
movsd  0xdc1(%rip),%xmm0
movsd  0xdc1(%rip),%xmm1
movzbl %al,%eax
lea    0xe67(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movsd  0xdae(%rip),%xmm0
movsd  0xdae(%rip),%xmm1
jmp    128e <main+0x12e>
movsd  0xdbc(%rip),%xmm0
movsd  0xdbc(%rip),%xmm1
jmp    128e <main+0x12e>
movsd  0xd9a(%rip),%xmm0
movsd  0xd9a(%rip),%xmm1
movsd  %xmm0,0x20(%rsp)
movss  0xde4(%rip),%xmm0
call   1080 <pow@plt>
movsd  %xmm0,0x18(%rsp)
mov    0x7(%rsp),%al
cmp    $0x49,%al
jne    1365 <main+0x205>
movss  0x10(%rsp),%xmm0
movss  0xdc3(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    12d4 <main+0x174>
ucomiss 0xdb7(%rip),%xmm0
ja     131e <main+0x1be>
jmp    1361 <main+0x201>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
ucomisd 0xd5d(%rip),%xmm1
jae    12f3 <main+0x193>
lea    0x106e(%rip),%rdi
call   1040 <puts@plt>
jmp    130f <main+0x1af>
movsd  0xd4d(%rip),%xmm1
call   1080 <pow@plt>
mulsd  0xd48(%rip),%xmm0
xorps  %xmm4,%xmm4
cvtsd2ss %xmm0,%xmm4
movss  0x10(%rsp),%xmm0
ucomiss 0xd68(%rip),%xmm0
jbe    1361 <main+0x201>
movss  0xd62(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    1345 <main+0x1e5>
lea    0xff0(%rip),%rdi
movss  %xmm4,0x8(%rsp)
call   1040 <puts@plt>
movss  0x8(%rsp),%xmm4
jmp    1361 <main+0x201>
movsd  0xcfb(%rip),%xmm1
call   1080 <pow@plt>
mulsd  0xcf6(%rip),%xmm0
xorps  %xmm4,%xmm4
cvtsd2ss %xmm0,%xmm4
mov    0x7(%rsp),%al
cmp    $0x4d,%al
jne    1419 <main+0x2b9>
movss  0x10(%rsp),%xmm0
movss  0xd11(%rip),%xmm1
ucomiss %xmm0,%xmm1
jb     13cd <main+0x26d>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
ucomisd 0xcc9(%rip),%xmm1
jae    13ab <main+0x24b>
lea    0xf52(%rip),%rdi
movss  %xmm4,0x8(%rsp)
call   1040 <puts@plt>
movss  0x8(%rsp),%xmm4
jmp    13c7 <main+0x267>
movsd  0xc95(%rip),%xmm1
call   1080 <pow@plt>
mulsd  0xca0(%rip),%xmm0
xorps  %xmm4,%xmm4
cvtsd2ss %xmm0,%xmm4
movss  0x10(%rsp),%xmm0
movss  0xcbb(%rip),%xmm1
ucomiss %xmm0,%xmm1
jb     1419 <main+0x2b9>
ucomiss 0xcab(%rip),%xmm0
jbe    1401 <main+0x2a1>
movsd  0xc7d(%rip),%xmm1
call   1080 <pow@plt>
mulsd  0xc78(%rip),%xmm0
xorps  %xmm4,%xmm4
cvtsd2ss %xmm0,%xmm4
jmp    1419 <main+0x2b9>
lea    0xeaa(%rip),%rdi
movss  %xmm4,0x8(%rsp)
call   1040 <puts@plt>
movss  0x8(%rsp),%xmm4
movss  0xc73(%rip),%xmm5
mov    0xe(%rsp),%al
movaps %xmm5,%xmm0
cmp    $0x42,%al
je     145a <main+0x2fa>
cmp    $0x54,%al
jne    143a <main+0x2da>
movss  0xc60(%rip),%xmm0
jmp    145a <main+0x2fa>
lea    0xe39(%rip),%rdi
movss  %xmm4,0x8(%rsp)
call   1040 <puts@plt>
movss  0xc40(%rip),%xmm5
movss  0x8(%rsp),%xmm4
movss  0x14(%rsp),%xmm1
movss  0xc34(%rip),%xmm2
ucomiss %xmm1,%xmm2
jb     1475 <main+0x315>
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm1
ja     14ef <main+0x38f>
ucomiss 0xc20(%rip),%xmm1
jbe    1495 <main+0x335>
movss  0xc1e(%rip),%xmm2
ucomiss %xmm1,%xmm2
jb     1495 <main+0x335>
movss  0xc0d(%rip),%xmm5
jmp    14ef <main+0x38f>
ucomiss 0xc08(%rip),%xmm1
jbe    14b5 <main+0x355>
movss  0xc06(%rip),%xmm2
ucomiss %xmm1,%xmm2
jb     14b5 <main+0x355>
movss  0xbf5(%rip),%xmm5
jmp    14ef <main+0x38f>
movss  0xbf3(%rip),%xmm2
xor    %eax,%eax
ucomiss %xmm1,%xmm2
setb   %al
lea    0xbac(%rip),%rcx
movss  (%rcx,%rax,4),%xmm2
movss  0xbd3(%rip),%xmm3
cmpnltss %xmm1,%xmm3
movss  0xbce(%rip),%xmm5
andps  %xmm3,%xmm5
andnps %xmm2,%xmm3
orps   %xmm3,%xmm5
movsd  0x20(%rsp),%xmm1
mulsd  0x18(%rsp),%xmm1
cvtsd2ss %xmm1,%xmm1
mulss  %xmm1,%xmm4
mulss  %xmm0,%xmm4
mulss  %xmm5,%xmm4
xorps  %xmm0,%xmm0
cvtss2sd %xmm4,%xmm0
lea    0xcf0(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret
lea    0xd07(%rip),%rdi
call   1040 <puts@plt>

LLVM IR (-O0):
@.str = [65 x i8] c"Please input the surface condition of a shaft: G, M, H, or A? > \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [42 x i8] c"Please input the diameter of the shaft > \00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [51 x i8] c"Please input the units of the diameter (I or M) > \00"
@.str.5 = [67 x i8] c"Please specify whether your shaft is bending (B) or torsion (T) > \00"
@.str.6 = [54 x i8] c"Please specify the reliability level in percentage > \00"
@.str.7 = [57 x i8] c"AYour inputs are wrong. So I gave you the wrong answers\0A\00"
@.str.8 = [57 x i8] c"BYour inputs are wrong. So I gave you the wrong answers\0A\00"
@.str.9 = [57 x i8] c"CYour inputs are wrong. So I gave you the wrong answers\0A\00"
@.str.10 = [57 x i8] c"DYour inputs are wrong. So I gave you the wrong answers\0A\00"
@.str.11 = [57 x i8] c"EYour inputs are wrong. So I gave you the wrong answers\0A\00"
@.str.12 = [57 x i8] c"FYour inputs are wrong. So I gave you the wrong answers\0A\00"
@.str.13 = [57 x i8] c"\0A\0AThe estimated endurance limit for this shaft is %.3f\0A\0A\00"
@.str.14 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca i8
%14 = alloca i8
%15 = alloca i8
store i32 0, i32* %1
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %13)
%18 = call i32 (...) @getchar()
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %3)
%21 = call i32 (...) @getchar()
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.4, i64 0, i64 0))
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%24 = call i32 (...) @getchar()
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.5, i64 0, i64 0))
%26 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %15)
%27 = call i32 (...) @getchar()
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.6, i64 0, i64 0))
%29 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %4)
%30 = call i32 (...) @getchar()
%31 = load i8, i8* %13
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 71
br i1 %33, label %34, label %35
34: ; preds = %0
store float 0x3FF570A3E0000000, float* %5
store float 0xBFB5C28F60000000, float* %6
br label %55
35: ; preds = %0
%36 = load i8, i8* %13
%37 = sext i8 %36 to i32
%38 = icmp eq i32 %37, 77
br i1 %38, label %39, label %40
39: ; preds = %35
store float 0x40059999A0000000, float* %5
store float 0xBFD0F5C280000000, float* %6
br label %54
40: ; preds = %35
%41 = load i8, i8* %13
%42 = sext i8 %41 to i32
%43 = icmp eq i32 %42, 72
br i1 %43, label %44, label %45
44: ; preds = %40
store float 0x402CCCCCC0000000, float* %5
store float 0xBFE6F9DB20000000, float* %6
br label %53
45: ; preds = %40
%46 = load i8, i8* %13
%47 = sext i8 %46 to i32
%48 = icmp eq i32 %47, 65
br i1 %48, label %49, label %50
49: ; preds = %45
store float 0x4043F33340000000, float* %5
store float 0xBFEFD70A40000000, float* %6
br label %52
50: ; preds = %45
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.7, i64 0, i64 0))
br label %52
52: ; preds = %50, %49
br label %53
53: ; preds = %52, %44
br label %54
54: ; preds = %53, %39
br label %55
55: ; preds = %54, %34
%56 = load float, float* %5
%57 = fpext float %56 to double
%58 = load float, float* %6
%59 = fpext float %58 to double
%60 = call double @pow(float 7.500000e+01, double %59)
%61 = fmul double %57, %60
%62 = fptrunc double %61 to float
store float %62, float* %8
%63 = load i8, i8* %14
%64 = sext i8 %63 to i32
%65 = icmp eq i32 %64, 73
br i1 %65, label %66, label %96
66: ; preds = %55
%67 = load float, float* %3
%68 = fcmp ole float %67, 2.000000e+00
br i1 %68, label %69, label %81
69: ; preds = %66
%70 = load float, float* %3
%71 = fpext float %70 to double
%72 = fcmp oge double %71, 1.100000e-01
br i1 %72, label %73, label %78
73: ; preds = %69
%74 = load float, float* %3
%75 = call double @pow(float %74, double -1.070000e-01)
%76 = fmul double 8.790000e-01, %75
%77 = fptrunc double %76 to float
store float %77, float* %7
br label %80
78: ; preds = %69
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.8, i64 0, i64 0))
br label %80
80: ; preds = %78, %73
br label %81
81: ; preds = %80, %66
%82 = load float, float* %3
%83 = fcmp ogt float %82, 2.000000e+00
br i1 %83, label %84, label %95
84: ; preds = %81
%85 = load float, float* %3
%86 = fcmp ole float %85, 1.000000e+01
br i1 %86, label %87, label %92
87: ; preds = %84
%88 = load float, float* %3
%89 = call double @pow(float %88, double -1.070000e-01)
%90 = fmul double 8.790000e-01, %89
%91 = fptrunc double %90 to float
store float %91, float* %7
br label %94
92: ; preds = %84
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.9, i64 0, i64 0))
br label %94
94: ; preds = %92, %87
br label %95
95: ; preds = %94, %81
br label %96
96: ; preds = %95, %55
%97 = load i8, i8* %14
%98 = sext i8 %97 to i32
%99 = icmp eq i32 %98, 77
br i1 %99, label %100, label %130
100: ; preds = %96
%101 = load float, float* %3
%102 = fcmp ole float %101, 5.100000e+01
br i1 %102, label %103, label %115
103: ; preds = %100
%104 = load float, float* %3
%105 = fpext float %104 to double
%106 = fcmp oge double %105, 2.790000e+00
br i1 %106, label %107, label %112
107: ; preds = %103
%108 = load float, float* %3
%109 = call double @pow(float %108, double -1.070000e-01)
%110 = fmul double 1.240000e+00, %109
%111 = fptrunc double %110 to float
store float %111, float* %7
br label %114
112: ; preds = %103
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.10, i64 0, i64 0))
br label %114
114: ; preds = %112, %107
br label %115
115: ; preds = %114, %100
%116 = load float, float* %3
%117 = fcmp ole float %116, 2.540000e+02
br i1 %117, label %118, label %129
118: ; preds = %115
%119 = load float, float* %3
%120 = fcmp ogt float %119, 5.100000e+01
br i1 %120, label %121, label %126
121: ; preds = %118
%122 = load float, float* %3
%123 = call double @pow(float %122, double -1.570000e-01)
%124 = fmul double 1.510000e+00, %123
%125 = fptrunc double %124 to float
store float %125, float* %7
br label %128
126: ; preds = %118
%127 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.11, i64 0, i64 0))
br label %128
128: ; preds = %126, %121
br label %129
129: ; preds = %128, %115
br label %130
130: ; preds = %129, %96
%131 = load i8, i8* %15
%132 = sext i8 %131 to i32
%133 = icmp eq i32 %132, 66
br i1 %133, label %134, label %135
134: ; preds = %130
store float 1.000000e+00, float* %9
br label %143
135: ; preds = %130
%136 = load i8, i8* %15
%137 = sext i8 %136 to i32
%138 = icmp eq i32 %137, 84
br i1 %138, label %139, label %140
139: ; preds = %135
store float 0x3FE2E147A0000000, float* %9
br label %142
140: ; preds = %135
%141 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.12, i64 0, i64 0))
br label %142
142: ; preds = %140, %139
br label %143
143: ; preds = %142, %134
store float 1.000000e+00, float* %10
store float 1.000000e+00, float* %11
%144 = load float, float* %4
%145 = fcmp ole float %144, 5.000000e+01
br i1 %145, label %146, label %150
146: ; preds = %143
%147 = load float, float* %4
%148 = fcmp ogt float %147, 0.000000e+00
br i1 %148, label %149, label %150
149: ; preds = %146
store float 1.000000e+00, float* %12
br label %186
150: ; preds = %146, %143
%151 = load float, float* %4
%152 = fcmp ogt float %151, 5.000000e+01
br i1 %152, label %153, label %157
153: ; preds = %150
%154 = load float, float* %4
%155 = fcmp ole float %154, 9.000000e+01
br i1 %155, label %156, label %157
156: ; preds = %153
store float 0x3FECB43960000000, float* %12
br label %185
157: ; preds = %153, %150
%158 = load float, float* %4
%159 = fcmp ogt float %158, 9.000000e+01
br i1 %159, label %160, label %164
160: ; preds = %157
%161 = load float, float* %4
%162 = fcmp ole float %161, 9.500000e+01
br i1 %162, label %163, label %164
163: ; preds = %160
store float 0x3FEA0C49C0000000, float* %12
br label %184
164: ; preds = %160, %157
%165 = load float, float* %4
%166 = fcmp ogt float %165, 9.500000e+01
br i1 %166, label %167, label %172
167: ; preds = %164
%168 = load float, float* %4
%169 = fpext float %168 to double
%170 = fcmp ole double %169, 9.900000e+01
br i1 %170, label %171, label %172
171: ; preds = %167
store float 0x3FEA0C49C0000000, float* %12
br label %183
172: ; preds = %167, %164
%173 = load float, float* %4
%174 = fpext float %173 to double
%175 = fcmp ogt double %174, 9.900000e+01
br i1 %175, label %176, label %182
176: ; preds = %172
%177 = load float, float* %4
%178 = fpext float %177 to double
%179 = fcmp ole double %178, 9.990000e+01
br i1 %179, label %180, label %181
180: ; preds = %176
store float 0x3FE8189380000000, float* %12
br label %181
181: ; preds = %180, %176
br label %182
182: ; preds = %181, %172
br label %183
183: ; preds = %182, %171
br label %184
184: ; preds = %183, %163
br label %185
185: ; preds = %184, %156
br label %186
186: ; preds = %185, %149
%187 = load float, float* %8
%188 = load float, float* %7
%189 = fmul float %187, %188
%190 = load float, float* %9
%191 = fmul float %189, %190
%192 = load float, float* %10
%193 = fmul float %191, %192
%194 = load float, float* %12
%195 = fmul float %193, %194
%196 = load float, float* %11
%197 = fmul float %195, %196
store float %197, float* %2
%198 = load float, float* %2
%199 = fpext float %198 to double
%200 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.13, i64 0, i64 0), double %199)
%201 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [65 x i8] c"Please input the surface condition of a shaft: G, M, H, or A? > \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [42 x i8] c"Please input the diameter of the shaft > \00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [51 x i8] c"Please input the units of the diameter (I or M) > \00"
@.str.5 = [67 x i8] c"Please specify whether your shaft is bending (B) or torsion (T) > \00"
@.str.6 = [54 x i8] c"Please specify the reliability level in percentage > \00"
@.str.13 = [57 x i8] c"\0A\0AThe estimated endurance limit for this shaft is %.3f\0A\0A\00"
@str = [56 x i8] c"AYour inputs are wrong. So I gave you the wrong answers\00"
@str.15 = [56 x i8] c"FYour inputs are wrong. So I gave you the wrong answers\00"
@str.16 = [56 x i8] c"EYour inputs are wrong. So I gave you the wrong answers\00"
@str.17 = [56 x i8] c"DYour inputs are wrong. So I gave you the wrong answers\00"
@str.18 = [56 x i8] c"CYour inputs are wrong. So I gave you the wrong answers\00"
@str.19 = [56 x i8] c"BYour inputs are wrong. So I gave you the wrong answers\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = bitcast float* %1 to i8*
%7 = bitcast float* %2 to i8*
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%10 = call i32 (...) @getchar()
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %1)
%13 = call i32 (...) @getchar()
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.4, i64 0, i64 0))
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%16 = call i32 (...) @getchar()
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @.str.5, i64 0, i64 0))
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%19 = call i32 (...) @getchar()
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.6, i64 0, i64 0))
%21 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %2)
%22 = call i32 (...) @getchar()
%23 = load i8, i8* %3
switch i8 %23, label %27 [
i8 71, label %29
i8 77, label %24
i8 72, label %25
i8 65, label %26
]
24: ; preds = %0
br label %29
25: ; preds = %0
br label %29
26: ; preds = %0
br label %29
27: ; preds = %0
%28 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str, i64 0, i64 0))
unreachable
29: ; preds = %0, %24, %26, %25
%30 = phi double [ 0xBFD0F5C280000000, %24 ], [ 0xBFE6F9DB20000000, %25 ], [ 0xBFEFD70A40000000, %26 ], [ 0xBFB5C28F60000000, %0 ]
%31 = phi double [ 0x40059999A0000000, %24 ], [ 0x402CCCCCC0000000, %25 ], [ 0x4043F33340000000, %26 ], [ 0x3FF570A3E0000000, %0 ]
%32 = call double @pow(float 7.500000e+01, double %30)
%33 = load i8, i8* %4
%34 = icmp eq i8 %33, 73
br i1 %34, label %35, label %65
35: ; preds = %29
%36 = load float, float* %1
%37 = fcmp ugt float %36, 2.000000e+00
br i1 %37, label %50, label %38
38: ; preds = %35
%39 = fpext float %36 to double
%40 = fcmp ult double %39, 1.100000e-01
br i1 %40, label %45, label %41
41: ; preds = %38
%42 = call double @pow(float %36, double -1.070000e-01)
%43 = fmul double %42, 8.790000e-01
%44 = fptrunc double %43 to float
br label %47
45: ; preds = %38
%46 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.19, i64 0, i64 0))
br label %47
47: ; preds = %45, %41
%48 = phi float [ undef, %45 ], [ %44, %41 ]
%49 = load float, float* %1
br label %50
50: ; preds = %47, %35
%51 = phi float [ %49, %47 ], [ %36, %35 ]
%52 = phi float [ %48, %47 ], [ undef, %35 ]
%53 = fcmp ogt float %51, 2.000000e+00
br i1 %53, label %54, label %62
54: ; preds = %50
%55 = fcmp ugt float %51, 1.000000e+01
br i1 %55, label %60, label %56
56: ; preds = %54
%57 = call double @pow(float %51, double -1.070000e-01)
%58 = fmul double %57, 8.790000e-01
%59 = fptrunc double %58 to float
br label %62
60: ; preds = %54
%61 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.18, i64 0, i64 0))
br label %62
62: ; preds = %56, %60, %50
%63 = phi float [ %52, %50 ], [ %52, %60 ], [ %59, %56 ]
%64 = load i8, i8* %4
br label %65
65: ; preds = %62, %29
%66 = phi i8 [ %64, %62 ], [ %33, %29 ]
%67 = phi float [ %63, %62 ], [ undef, %29 ]
%68 = icmp eq i8 %66, 77
br i1 %68, label %69, label %96
69: ; preds = %65
%70 = load float, float* %1
%71 = fcmp ugt float %70, 5.100000e+01
br i1 %71, label %84, label %72
72: ; preds = %69
%73 = fpext float %70 to double
%74 = fcmp ult double %73, 2.790000e+00
br i1 %74, label %79, label %75
75: ; preds = %72
%76 = call double @pow(float %70, double -1.070000e-01)
%77 = fmul double %76, 1.240000e+00
%78 = fptrunc double %77 to float
br label %81
79: ; preds = %72
%80 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.17, i64 0, i64 0))
br label %81
81: ; preds = %79, %75
%82 = phi float [ %67, %79 ], [ %78, %75 ]
%83 = load float, float* %1
br label %84
84: ; preds = %81, %69
%85 = phi float [ %83, %81 ], [ %70, %69 ]
%86 = phi float [ %82, %81 ], [ %67, %69 ]
%87 = fcmp ugt float %85, 2.540000e+02
br i1 %87, label %96, label %88
88: ; preds = %84
%89 = fcmp ogt float %85, 5.100000e+01
br i1 %89, label %90, label %94
90: ; preds = %88
%91 = call double @pow(float %85, double -1.570000e-01)
%92 = fmul double %91, 1.510000e+00
%93 = fptrunc double %92 to float
br label %96
94: ; preds = %88
%95 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.16, i64 0, i64 0))
br label %96
96: ; preds = %84, %94, %90, %65
%97 = phi float [ %93, %90 ], [ %86, %94 ], [ %86, %84 ], [ %67, %65 ]
%98 = load i8, i8* %5
switch i8 %98, label %100 [
i8 66, label %102
i8 84, label %99
]
99: ; preds = %96
br label %102
100: ; preds = %96
%101 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.15, i64 0, i64 0))
br label %102
102: ; preds = %96, %99, %100
%103 = phi float [ 0x3FE2E147A0000000, %99 ], [ undef, %100 ], [ 1.000000e+00, %96 ]
%104 = load float, float* %2
%105 = fcmp ole float %104, 5.000000e+01
%106 = fcmp ogt float %104, 0.000000e+00
%107 = and i1 %105, %106
br i1 %107, label %121, label %108
108: ; preds = %102
%109 = fcmp ogt float %104, 5.000000e+01
%110 = fcmp ole float %104, 9.000000e+01
%111 = and i1 %109, %110
br i1 %111, label %121, label %112
112: ; preds = %108
%113 = fcmp ogt float %104, 9.000000e+01
%114 = fcmp ole float %104, 9.500000e+01
%115 = and i1 %113, %114
br i1 %115, label %121, label %116
116: ; preds = %112
%117 = fcmp ule float %104, 9.500000e+01
%118 = fcmp ugt float %104, 9.900000e+01
%119 = or i1 %117, %118
%120 = select i1 %119, float 0x3FE8189380000000, float 0x3FEA0C49C0000000
br label %121
121: ; preds = %116, %112, %108, %102
%122 = phi float [ 1.000000e+00, %102 ], [ 0x3FECB43960000000, %108 ], [ 0x3FEA0C49C0000000, %112 ], [ %120, %116 ]
%123 = fmul double %31, %32
%124 = fptrunc double %123 to float
%125 = fmul float %97, %124
%126 = fmul float %125, %103
%127 = fmul float %126, %122
%128 = fpext float %127 to double
%129 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.13, i64 0, i64 0), double %128)
%130 = call i32 @putchar(i32 10)
ret i32 0
}