#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 */
float acos(float);
float cbrt(float);
float cos(float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
float sin(float);
float sqrt(int);
int main() {
  float a;
  float b;
  float c;
  float d;
  float f;
  float g;
  float h;
  float m;
  float m2;
  float n;
  float n2;
  float k;
  float r;
  float rc;
  float x1;
  float x2;
  float x2_part1;
  float x2_part2;
  float x2a, x2b, x2c;
  float x3;
  float x3_part1;
  float x3_part2;
  float theta = 0;
  float sign;
  float dans;
  printf(
      "A cubic function is a function of the form \"ax^3 + bx^2 + cx + d\"\n");
  printf("Now, Enter number a (which is nonzero): ");
  scanf("%f", &a);
  if (a == 0) {
    printf("Error: \"a\" must not be zero, try again: ");
    scanf("%f", &a);
  }
  printf("Enter number b: ");
  scanf("%f", &b);
  printf("Enter number c: ");
  scanf("%f", &c);
  printf("Enter number d: ");
  scanf("%f", &d);
  f = (((3 * c) / a) - ((b * b) / (a * a))) / 3;
  g = (((2 * b * b * b) / (a * a * a)) - ((9 * b * c) / (a * a)) +
       ((27 * d) / a)) /
      27;
  h = ((g * g) / 4) + ((f * f * f) / 27);
  if (h > 0) {
    m = (-g / 2) + sqrt(h);
    k = 1;
    if (m < 0) {
      k = -1;
    } else {
      k = 1;
    }
    m2 = cbrt(m * k);
    m2 = m2 * k;
    k = 1;
    n = (-g / 2) - sqrt(h);
    if (n < 0) {
      k = -1;
    } else {
      k = 1;
    }
    n2 = cbrt(n * k);
    n2 = n2 * k;
    k = 1;
    x1 = (m2 + n2) - (b / (3 * a));
    x2_part1 = ((-(m2 + n2)) / 2) - (b / (3 * a));
    x2_part2 = (((m2 - n2) / 2) * sqrt(3));
    x3_part1 = ((-(m2 + n2)) / 2) - (b / (3 * a));
    x3_part2 = ((m2 - n2) / 2) * (sqrt(3));
    printf("\nx1 = %f\n", x1);
    printf("x2 = %f", x2_part1);
    printf(" + %f", x2_part2);
    printf(" * i \n");
    printf("x3 = %f", x3_part1);
    printf(" - %f", x3_part2);
    printf(" * i \n");
  }
  if (h <= 0) {
    r = sqrt(((g * g) / 4) - h);
    k = 1;
    if (r < 0) {
      k = -1;
    }
    rc = cbrt(r * k) * k;
    k = 1;
    theta = acos((-g / (2 * r)));
    x1 = ((2 * (rc * (cos(theta / 3)))) - (b / (3 * a)));
    x2a = rc * (-1);
    x2b = cos(theta / 3);
    x2c = sqrt(3) * sin(theta / 3);
    x2 = ((x2a * (x2b + x2c)) - (b / (3 * a)));
    x3 = ((x2a * (x2b - x2c)) - (b / (3 * a)));
    printf("x1 = %f\nx2 = %f\nx3 = %f", x1, x2, x3);
  }
  if ((f + g + h) == 0) {
    if (d < 0)
      sign = -1;
    if (d >= 0)
      sign = 1;
    if (sign > 0) {
      dans = cbrt(d / a);
      dans = dans * (-1);
    }
    if (sign < 0) {
      d = d * (-1);
      dans = cbrt(d / a);
    }
    x1 = x2 = x3 = dans;
    printf("x1 = %f\nx2 = %f\nx3 = %f", x1, x2, x3);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x68(%rbp)
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf4c(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1070 <scanf@plt>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    11eb <main+0x7b>
jp     11eb <main+0x7b>
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf17(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1070 <scanf@plt>
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef9(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1070 <scanf@plt>
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1070 <scanf@plt>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebd(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1070 <scanf@plt>
movss  0xdc3(%rip),%xmm0
mulss  -0x10(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
mulss  -0xc(%rbp),%xmm1
movss  -0x8(%rbp),%xmm2
mulss  -0x8(%rbp),%xmm2
divss  %xmm2,%xmm1
subss  %xmm1,%xmm0
movss  0xd95(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  0xd80(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  0xd52(%rip),%xmm1
mulss  -0xc(%rbp),%xmm1
mulss  -0x10(%rbp),%xmm1
movss  -0x8(%rbp),%xmm2
mulss  -0x8(%rbp),%xmm2
divss  %xmm2,%xmm1
subss  %xmm1,%xmm0
movss  0xd26(%rip),%xmm1
mulss  -0x14(%rbp),%xmm1
divss  -0x8(%rbp),%xmm1
addss  %xmm1,%xmm0
movss  0xd10(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
mulss  -0x1c(%rbp),%xmm0
movss  0xcf9(%rip),%xmm1
divss  %xmm1,%xmm0
movss  -0x18(%rbp),%xmm1
mulss  -0x18(%rbp),%xmm1
mulss  -0x18(%rbp),%xmm1
movss  0xcda(%rip),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    162d <main+0x4bd>
movss  -0x1c(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xcae(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x74(%rbp)
cvttss2si -0x20(%rbp),%edi
call   1090 <sqrt@plt>
movaps %xmm0,%xmm1
movss  -0x74(%rbp),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  0xc8a(%rip),%xmm0
movss  %xmm0,-0x34(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x24(%rbp),%xmm0
jbe    13ae <main+0x23e>
movss  0xc74(%rip),%xmm0
movss  %xmm0,-0x34(%rbp)
jmp    13bb <main+0x24b>
movss  0xc5e(%rip),%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x24(%rbp),%xmm0
mulss  -0x34(%rbp),%xmm0
call   1060 <cbrt@plt>
movss  %xmm0,-0x28(%rbp)
movss  -0x28(%rbp),%xmm0
mulss  -0x34(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  0xc2e(%rip),%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x1c(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xc07(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x78(%rbp)
cvttss2si -0x20(%rbp),%edi
call   1090 <sqrt@plt>
movaps %xmm0,%xmm1
movss  -0x78(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x2c(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x2c(%rbp),%xmm0
jbe    1448 <main+0x2d8>
movss  0xbda(%rip),%xmm0
movss  %xmm0,-0x34(%rbp)
jmp    1455 <main+0x2e5>
movss  0xbc4(%rip),%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x2c(%rbp),%xmm0
mulss  -0x34(%rbp),%xmm0
call   1060 <cbrt@plt>
movss  %xmm0,-0x30(%rbp)
movss  -0x30(%rbp),%xmm0
mulss  -0x34(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
movss  0xb94(%rip),%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x28(%rbp),%xmm0
addss  -0x30(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  0xb74(%rip),%xmm2
mulss  -0x8(%rbp),%xmm2
divss  %xmm2,%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x40(%rbp)
movss  -0x28(%rbp),%xmm0
addss  -0x30(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xb3f(%rip),%xmm1
divss  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
movss  0xb32(%rip),%xmm2
mulss  -0x8(%rbp),%xmm2
divss  %xmm2,%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x48(%rbp)
movss  -0x28(%rbp),%xmm0
subss  -0x30(%rbp),%xmm0
movss  0xb0a(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x80(%rbp)
mov    $0x3,%edi
call   1090 <sqrt@plt>
movaps %xmm0,%xmm1
movss  -0x80(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x4c(%rbp)
movss  -0x28(%rbp),%xmm0
addss  -0x30(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xac7(%rip),%xmm1
divss  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
movss  0xaba(%rip),%xmm2
mulss  -0x8(%rbp),%xmm2
divss  %xmm2,%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x60(%rbp)
movss  -0x28(%rbp),%xmm0
subss  -0x30(%rbp),%xmm0
movss  0xa92(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x7c(%rbp)
mov    $0x3,%edi
call   1090 <sqrt@plt>
movaps %xmm0,%xmm1
movss  -0x7c(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x64(%rbp)
movss  -0x40(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xb36(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x48(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xb29(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x4c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xb1a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xb12(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x60(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xb18(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x64(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xaeb(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xad6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
ucomiss -0x20(%rbp),%xmm0
jb     184f <main+0x6df>
movss  -0x1c(%rbp),%xmm0
mulss  -0x1c(%rbp),%xmm0
movss  0x9b8(%rip),%xmm1
divss  %xmm1,%xmm0
subss  -0x20(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1090 <sqrt@plt>
movss  %xmm0,-0x38(%rbp)
movss  0x9a9(%rip),%xmm0
movss  %xmm0,-0x34(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x38(%rbp),%xmm0
jbe    168a <main+0x51a>
movss  0x993(%rip),%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x38(%rbp),%xmm0
mulss  -0x34(%rbp),%xmm0
call   1060 <cbrt@plt>
mulss  -0x34(%rbp),%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  0x969(%rip),%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x1c(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0x942(%rip),%xmm1
mulss  -0x38(%rbp),%xmm1
divss  %xmm1,%xmm0
call   1040 <acos@plt>
movss  %xmm0,-0x68(%rbp)
movss  -0x3c(%rbp),%xmm0
movss  %xmm0,-0x88(%rbp)
ff
movss  -0x68(%rbp),%xmm0
movss  0x919(%rip),%xmm1
divss  %xmm1,%xmm0
call   1080 <cos@plt>
movaps %xmm0,%xmm1
movss  -0x88(%rbp),%xmm0
ff
mulss  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
movss  0x8f4(%rip),%xmm2
mulss  -0x8(%rbp),%xmm2
divss  %xmm2,%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
addss  %xmm0,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x40(%rbp)
movss  0x8d1(%rip),%xmm0
mulss  -0x3c(%rbp),%xmm0
movss  %xmm0,-0x50(%rbp)
movss  -0x68(%rbp),%xmm0
movss  0x8b2(%rip),%xmm1
divss  %xmm1,%xmm0
call   1080 <cos@plt>
movss  %xmm0,-0x54(%rbp)
mov    $0x3,%edi
call   1090 <sqrt@plt>
movss  %xmm0,-0x84(%rbp)
ff
movss  -0x68(%rbp),%xmm0
movss  0x885(%rip),%xmm1
divss  %xmm1,%xmm0
call   1050 <sin@plt>
movaps %xmm0,%xmm1
movss  -0x84(%rbp),%xmm0
ff
mulss  %xmm1,%xmm0
movss  %xmm0,-0x58(%rbp)
movss  -0x50(%rbp),%xmm0
movss  -0x54(%rbp),%xmm2
addss  -0x58(%rbp),%xmm2
movss  -0xc(%rbp),%xmm1
movss  0x84c(%rip),%xmm3
mulss  -0x8(%rbp),%xmm3
divss  %xmm3,%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x44(%rbp)
movss  -0x50(%rbp),%xmm0
movss  -0x54(%rbp),%xmm2
subss  -0x58(%rbp),%xmm2
movss  -0xc(%rbp),%xmm1
movss  0x80d(%rip),%xmm3
mulss  -0x8(%rbp),%xmm3
divss  %xmm3,%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x5c(%rbp)
movss  -0x40(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x44(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x5c(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0x8c1(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movss  -0x18(%rbp),%xmm0
addss  -0x1c(%rbp),%xmm0
addss  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    194f <main+0x7df>
jp     194f <main+0x7df>
xorps  %xmm0,%xmm0
ucomiss -0x14(%rbp),%xmm0
jbe    188a <main+0x71a>
movss  0x793(%rip),%xmm0
movss  %xmm0,-0x6c(%rbp)
movss  -0x14(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     18a8 <main+0x738>
movss  0x771(%rip),%xmm0
movss  %xmm0,-0x6c(%rbp)
movss  -0x6c(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    18df <main+0x76f>
movss  -0x14(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
call   1060 <cbrt@plt>
movss  %xmm0,-0x70(%rbp)
movss  0x743(%rip),%xmm0
mulss  -0x70(%rbp),%xmm0
movss  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x6c(%rbp),%xmm0
jbe    1912 <main+0x7a2>
movss  0x724(%rip),%xmm0
mulss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
call   1060 <cbrt@plt>
movss  %xmm0,-0x70(%rbp)
movss  -0x70(%rbp),%xmm0
movss  %xmm0,-0x5c(%rbp)
movss  %xmm0,-0x44(%rbp)
movss  %xmm0,-0x40(%rbp)
movss  -0x40(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x44(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x5c(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0x7c1(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x90,%rsp
lea    0xf98(%rip),%rdi
call   1030 <puts@plt>
lea    0xed1(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf5d(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1080 <scanf@plt>
movss  0xc(%rsp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    11e2 <main+0x62>
jp     11e2 <main+0x62>
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf2e(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1080 <scanf@plt>
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf0f(%rip),%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1080 <scanf@plt>
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4c(%rsp),%rsi
mov    %rbx,%rdi
call   1080 <scanf@plt>
lea    0xeba(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1080 <scanf@plt>
movss  0x4c(%rsp),%xmm2
movss  0xc(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
movss  0xdec(%rip),%xmm3
mulss  %xmm1,%xmm3
mulss  %xmm2,%xmm3
unpcklps %xmm1,%xmm2
movaps 0xd9a(%rip),%xmm4
unpcklps %xmm1,%xmm4
mulps  %xmm2,%xmm4
movaps %xmm0,%xmm2
mulss  %xmm0,%xmm2
movaps %xmm0,%xmm5
unpcklps %xmm2,%xmm5
divps  %xmm5,%xmm4
movaps %xmm1,%xmm5
addss  %xmm1,%xmm5
mulss  %xmm1,%xmm5
movaps %xmm0,%xmm6
mulss  %xmm2,%xmm6
divss  %xmm2,%xmm3
movss  0x14(%rsp),%xmm2
unpcklps %xmm1,%xmm2
movaps 0xd6e(%rip),%xmm1
unpcklps %xmm5,%xmm1
mulps  %xmm2,%xmm1
unpcklps %xmm6,%xmm0
divps  %xmm0,%xmm1
unpcklps %xmm1,%xmm0
shufps $0x55,%xmm1,%xmm1
addss  %xmm3,%xmm1
movaps %xmm4,%xmm2
shufps $0x55,%xmm4,%xmm2
unpcklps %xmm1,%xmm1
addps  %xmm0,%xmm1
subps  %xmm2,%xmm4
shufps $0x1,%xmm4,%xmm1
shufps $0xe2,%xmm4,%xmm1
divps  0xd48(%rip),%xmm1
movaps %xmm1,%xmm0
mulps  %xmm1,%xmm0
movss  0xd5e(%rip),%xmm3
movlhps %xmm1,%xmm3
shufps $0xe2,%xmm1,%xmm3
mulps  %xmm0,%xmm3
movaps %xmm3,%xmm0
divss  0xd4d(%rip),%xmm0
shufps $0x55,%xmm3,%xmm3
addss  %xmm3,%xmm0
ucomiss 0xd56(%rip),%xmm0
movaps %xmm1,%xmm2
shufps $0x55,%xmm1,%xmm2
movaps %xmm1,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm2,0x50(%rsp)
jbe    1535 <main+0x3b5>
movaps %xmm2,%xmm4
mulss  0xd18(%rip),%xmm4
movaps %xmm4,0x20(%rsp)
cvttss2si %xmm0,%ebx
mov    %ebx,%edi
movaps %xmm3,0x60(%rsp)
call   10a0 <sqrt@plt>
addss  0x20(%rsp),%xmm0
xorps  %xmm1,%xmm1
movaps %xmm0,%xmm3
cmpltss %xmm1,%xmm3
movss  0xcee(%rip),%xmm2
movaps %xmm3,%xmm1
andps  %xmm2,%xmm1
movss  0xce4(%rip),%xmm2
andnps %xmm2,%xmm3
orps   %xmm1,%xmm3
movaps %xmm3,0x30(%rsp)
mulss  %xmm3,%xmm0
call   1070 <cbrt@plt>
mulss  0x30(%rsp),%xmm0
movss  %xmm0,0x30(%rsp)
mov    %ebx,%edi
call   10a0 <sqrt@plt>
movaps 0x20(%rsp),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm3
movaps %xmm1,%xmm0
cmpltss 0xcb1(%rip),%xmm3
movss  0xc99(%rip),%xmm1
andps  %xmm3,%xmm1
movss  0xc92(%rip),%xmm2
andnps %xmm2,%xmm3
orps   %xmm1,%xmm3
movaps %xmm3,0x20(%rsp)
mulss  %xmm3,%xmm0
call   1070 <cbrt@plt>
mulss  0x20(%rsp),%xmm0
movss  0x30(%rsp),%xmm4
movaps %xmm4,%xmm3
addss  %xmm0,%xmm3
movss  0x10(%rsp),%xmm1
movss  0xc(%rsp),%xmm2
mulss  0xc5b(%rip),%xmm2
divss  %xmm2,%xmm1
movaps %xmm3,%xmm2
subss  %xmm1,%xmm2
movss  %xmm2,0x48(%rsp)
mulss  0xc36(%rip),%xmm3
movss  %xmm3,0x20(%rsp)
subss  %xmm1,%xmm3
movss  %xmm3,0x1c(%rsp)
movaps %xmm4,%xmm1
subss  %xmm0,%xmm1
mulss  0xc27(%rip),%xmm1
movss  %xmm1,0x30(%rsp)
mov    $0x3,%edi
call   10a0 <sqrt@plt>
mulss  0x30(%rsp),%xmm0
movss  %xmm0,0x18(%rsp)
movss  0x10(%rsp),%xmm0
movss  0xbf9(%rip),%xmm1
mulss  0xc(%rsp),%xmm1
divss  %xmm1,%xmm0
movss  0x20(%rsp),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,0x20(%rsp)
mov    $0x3,%edi
call   10a0 <sqrt@plt>
mulss  0x30(%rsp),%xmm0
movss  %xmm0,0x30(%rsp)
movss  0x48(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc51(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x1c(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc43(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x18(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc33(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xc8b(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
movss  0x20(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc28(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x30(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xbfa(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
movaps 0x60(%rsp),%xmm3
movaps 0x50(%rsp),%xmm2
movaps 0x70(%rsp),%xmm0
movaps 0x80(%rsp),%xmm1
xorps  %xmm4,%xmm4
ucomiss %xmm0,%xmm4
jb     16a0 <main+0x520>
subss  %xmm0,%xmm3
cvttss2si %xmm3,%edi
call   10a0 <sqrt@plt>
movaps %xmm0,%xmm1
movss  %xmm0,0x20(%rsp)
xor    %eax,%eax
xorps  %xmm0,%xmm0
ucomiss %xmm1,%xmm0
seta   %al
lea    0xafb(%rip),%rcx
movss  (%rcx,%rax,4),%xmm2
movss  %xmm2,0x30(%rsp)
mulss  %xmm2,%xmm1
movaps %xmm1,%xmm0
call   1070 <cbrt@plt>
mulss  0x30(%rsp),%xmm0
movss  %xmm0,0x30(%rsp)
movaps 0x50(%rsp),%xmm0
xorps  0xa98(%rip),%xmm0
movss  0x20(%rsp),%xmm1
addss  %xmm1,%xmm1
divss  %xmm1,%xmm0
call   1050 <acos@plt>
divss  0xaa5(%rip),%xmm0
movss  %xmm0,0x20(%rsp)
call   1090 <cos@plt>
mulss  0x30(%rsp),%xmm0
movss  0x10(%rsp),%xmm2
movss  0xc(%rsp),%xmm1
mulss  0xa80(%rip),%xmm1
divss  %xmm1,%xmm2
addss  %xmm0,%xmm0
subss  %xmm2,%xmm0
movss  %xmm0,0x60(%rsp)
movss  0x20(%rsp),%xmm0
call   1090 <cos@plt>
movss  %xmm0,0x1c(%rsp)
mov    $0x3,%edi
call   10a0 <sqrt@plt>
movss  %xmm0,0x18(%rsp)
movss  0x20(%rsp),%xmm0
call   1060 <sin@plt>
mulss  0x18(%rsp),%xmm0
movss  0x1c(%rsp),%xmm5
movaps %xmm5,%xmm1
movss  0xa2b(%rip),%xmm3
mulss  0xc(%rsp),%xmm3
addss  %xmm0,%xmm1
movss  0x10(%rsp),%xmm2
xorps  0x9ec(%rip),%xmm2
divss  %xmm3,%xmm2
movss  0x30(%rsp),%xmm4
mulss  %xmm4,%xmm1
movaps %xmm2,%xmm3
subss  %xmm1,%xmm3
movaps %xmm5,%xmm1
subss  %xmm0,%xmm1
mulss  %xmm4,%xmm1
subss  %xmm1,%xmm2
movss  0x60(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm3,%xmm1
cvtss2sd %xmm2,%xmm2
lea    0xa8b(%rip),%rdi
mov    $0x3,%al
call   1040 <printf@plt>
xorps  %xmm4,%xmm4
movaps 0x50(%rsp),%xmm2
movaps 0x70(%rsp),%xmm0
movaps 0x80(%rsp),%xmm1
addss  %xmm2,%xmm1
addss  %xmm0,%xmm1
ucomiss %xmm4,%xmm1
jne    1738 <main+0x5b8>
jp     1738 <main+0x5b8>
movss  0x14(%rsp),%xmm1
xorps  %xmm2,%xmm2
xor    %eax,%eax
ucomiss %xmm2,%xmm1
setb   %al
lea    0x995(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
ucomiss %xmm2,%xmm0
jbe    16fd <main+0x57d>
movaps %xmm1,%xmm0
divss  0xc(%rsp),%xmm0
movss  %xmm1,0x50(%rsp)
call   1070 <cbrt@plt>
xorps  %xmm2,%xmm2
movss  0x50(%rsp),%xmm1
xorps  0x933(%rip),%xmm0
ucomiss %xmm2,%xmm1
jae    1720 <main+0x5a0>
movss  0x14(%rsp),%xmm0
xorps  0x921(%rip),%xmm0
movss  %xmm0,0x14(%rsp)
divss  0xc(%rsp),%xmm0
call   1070 <cbrt@plt>
cvtss2sd %xmm0,%xmm0
lea    0x9e4(%rip),%rdi
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
mov    $0x3,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [67 x i8] c"A cubic function is a function of the form \22ax^3 + bx^2 + cx + d\22\0A\00"
@.str.1 = [41 x i8] c"Now, Enter number a (which is nonzero): \00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [41 x i8] c"Error: \22a\22 must not be zero, try again: \00"
@.str.4 = [17 x i8] c"Enter number b: \00"
@.str.5 = [17 x i8] c"Enter number c: \00"
@.str.6 = [17 x i8] c"Enter number d: \00"
@.str.7 = [10 x i8] c"\0Ax1 = %f\0A\00"
@.str.8 = [8 x i8] c"x2 = %f\00"
@.str.9 = [6 x i8] c" + %f\00"
@.str.10 = [7 x i8] c" * i \0A\00"
@.str.11 = [8 x i8] c"x3 = %f\00"
@.str.12 = [6 x i8] c" - %f\00"
@.str.13 = [24 x i8] c"x1 = %f\0Ax2 = %f\0Ax3 = %f\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 float
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca float
%19 = alloca float
%20 = alloca float
%21 = alloca float
%22 = alloca float
%23 = alloca float
%24 = alloca float
%25 = alloca float
%26 = alloca float
%27 = alloca float
%28 = alloca float
store i32 0, i32* %1
store float 0.000000e+00, float* %26
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%31 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%32 = load float, float* %2
%33 = fcmp oeq float %32, 0.000000e+00
br i1 %33, label %34, label %37
34: ; preds = %0
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0))
%36 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
br label %37
37: ; preds = %34, %0
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
%39 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %3)
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
%41 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %4)
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
%43 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %5)
%44 = load float, float* %4
%45 = fmul float 3.000000e+00, %44
%46 = load float, float* %2
%47 = fdiv float %45, %46
%48 = load float, float* %3
%49 = load float, float* %3
%50 = fmul float %48, %49
%51 = load float, float* %2
%52 = load float, float* %2
%53 = fmul float %51, %52
%54 = fdiv float %50, %53
%55 = fsub float %47, %54
%56 = fdiv float %55, 3.000000e+00
store float %56, float* %6
%57 = load float, float* %3
%58 = fmul float 2.000000e+00, %57
%59 = load float, float* %3
%60 = fmul float %58, %59
%61 = load float, float* %3
%62 = fmul float %60, %61
%63 = load float, float* %2
%64 = load float, float* %2
%65 = fmul float %63, %64
%66 = load float, float* %2
%67 = fmul float %65, %66
%68 = fdiv float %62, %67
%69 = load float, float* %3
%70 = fmul float 9.000000e+00, %69
%71 = load float, float* %4
%72 = fmul float %70, %71
%73 = load float, float* %2
%74 = load float, float* %2
%75 = fmul float %73, %74
%76 = fdiv float %72, %75
%77 = fsub float %68, %76
%78 = load float, float* %5
%79 = fmul float 2.700000e+01, %78
%80 = load float, float* %2
%81 = fdiv float %79, %80
%82 = fadd float %77, %81
%83 = fdiv float %82, 2.700000e+01
store float %83, float* %7
%84 = load float, float* %7
%85 = load float, float* %7
%86 = fmul float %84, %85
%87 = fdiv float %86, 4.000000e+00
%88 = load float, float* %6
%89 = load float, float* %6
%90 = fmul float %88, %89
%91 = load float, float* %6
%92 = fmul float %90, %91
%93 = fdiv float %92, 2.700000e+01
%94 = fadd float %87, %93
store float %94, float* %8
%95 = load float, float* %8
%96 = fcmp ogt float %95, 0.000000e+00
br i1 %96, label %97, label %193
97: ; preds = %37
%98 = load float, float* %7
%99 = fneg float %98
%100 = fdiv float %99, 2.000000e+00
%101 = load float, float* %8
%102 = fptosi float %101 to i32
%103 = call float @sqrt(i32 %102)
%104 = fadd float %100, %103
store float %104, float* %9
store float 1.000000e+00, float* %13
%105 = load float, float* %9
%106 = fcmp olt float %105, 0.000000e+00
br i1 %106, label %107, label %108
107: ; preds = %97
store float -1.000000e+00, float* %13
br label %109
108: ; preds = %97
store float 1.000000e+00, float* %13
br label %109
109: ; preds = %108, %107
%110 = load float, float* %9
%111 = load float, float* %13
%112 = fmul float %110, %111
%113 = call float @cbrt(float %112)
store float %113, float* %10
%114 = load float, float* %10
%115 = load float, float* %13
%116 = fmul float %114, %115
store float %116, float* %10
store float 1.000000e+00, float* %13
%117 = load float, float* %7
%118 = fneg float %117
%119 = fdiv float %118, 2.000000e+00
%120 = load float, float* %8
%121 = fptosi float %120 to i32
%122 = call float @sqrt(i32 %121)
%123 = fsub float %119, %122
store float %123, float* %11
%124 = load float, float* %11
%125 = fcmp olt float %124, 0.000000e+00
br i1 %125, label %126, label %127
126: ; preds = %109
store float -1.000000e+00, float* %13
br label %128
127: ; preds = %109
store float 1.000000e+00, float* %13
br label %128
128: ; preds = %127, %126
%129 = load float, float* %11
%130 = load float, float* %13
%131 = fmul float %129, %130
%132 = call float @cbrt(float %131)
store float %132, float* %12
%133 = load float, float* %12
%134 = load float, float* %13
%135 = fmul float %133, %134
store float %135, float* %12
store float 1.000000e+00, float* %13
%136 = load float, float* %10
%137 = load float, float* %12
%138 = fadd float %136, %137
%139 = load float, float* %3
%140 = load float, float* %2
%141 = fmul float 3.000000e+00, %140
%142 = fdiv float %139, %141
%143 = fsub float %138, %142
store float %143, float* %16
%144 = load float, float* %10
%145 = load float, float* %12
%146 = fadd float %144, %145
%147 = fneg float %146
%148 = fdiv float %147, 2.000000e+00
%149 = load float, float* %3
%150 = load float, float* %2
%151 = fmul float 3.000000e+00, %150
%152 = fdiv float %149, %151
%153 = fsub float %148, %152
store float %153, float* %18
%154 = load float, float* %10
%155 = load float, float* %12
%156 = fsub float %154, %155
%157 = fdiv float %156, 2.000000e+00
%158 = call float @sqrt(i32 3)
%159 = fmul float %157, %158
store float %159, float* %19
%160 = load float, float* %10
%161 = load float, float* %12
%162 = fadd float %160, %161
%163 = fneg float %162
%164 = fdiv float %163, 2.000000e+00
%165 = load float, float* %3
%166 = load float, float* %2
%167 = fmul float 3.000000e+00, %166
%168 = fdiv float %165, %167
%169 = fsub float %164, %168
store float %169, float* %24
%170 = load float, float* %10
%171 = load float, float* %12
%172 = fsub float %170, %171
%173 = fdiv float %172, 2.000000e+00
%174 = call float @sqrt(i32 3)
%175 = fmul float %173, %174
store float %175, float* %25
%176 = load float, float* %16
%177 = fpext float %176 to double
%178 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), double %177)
%179 = load float, float* %18
%180 = fpext float %179 to double
%181 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), double %180)
%182 = load float, float* %19
%183 = fpext float %182 to double
%184 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), double %183)
%185 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%186 = load float, float* %24
%187 = fpext float %186 to double
%188 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0), double %187)
%189 = load float, float* %25
%190 = fpext float %189 to double
%191 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), double %190)
%192 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
br label %193
193: ; preds = %128, %37
%194 = load float, float* %8
%195 = fcmp ole float %194, 0.000000e+00
br i1 %195, label %196, label %269
196: ; preds = %193
%197 = load float, float* %7
%198 = load float, float* %7
%199 = fmul float %197, %198
%200 = fdiv float %199, 4.000000e+00
%201 = load float, float* %8
%202 = fsub float %200, %201
%203 = fptosi float %202 to i32
%204 = call float @sqrt(i32 %203)
store float %204, float* %14
store float 1.000000e+00, float* %13
%205 = load float, float* %14
%206 = fcmp olt float %205, 0.000000e+00
br i1 %206, label %207, label %208
207: ; preds = %196
store float -1.000000e+00, float* %13
br label %208
208: ; preds = %207, %196
%209 = load float, float* %14
%210 = load float, float* %13
%211 = fmul float %209, %210
%212 = call float @cbrt(float %211)
%213 = load float, float* %13
%214 = fmul float %212, %213
store float %214, float* %15
store float 1.000000e+00, float* %13
%215 = load float, float* %7
%216 = fneg float %215
%217 = load float, float* %14
%218 = fmul float 2.000000e+00, %217
%219 = fdiv float %216, %218
%220 = call float @acos(float %219)
store float %220, float* %26
%221 = load float, float* %15
%222 = load float, float* %26
%223 = fdiv float %222, 3.000000e+00
%224 = call float @cos(float %223)
%225 = fmul float %221, %224
%226 = load float, float* %3
%227 = load float, float* %2
%228 = fmul float 3.000000e+00, %227
%229 = fdiv float %226, %228
%230 = fneg float %229
%231 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %225, float %230)
store float %231, float* %16
%232 = load float, float* %15
%233 = fmul float %232, -1.000000e+00
store float %233, float* %20
%234 = load float, float* %26
%235 = fdiv float %234, 3.000000e+00
%236 = call float @cos(float %235)
store float %236, float* %21
%237 = call float @sqrt(i32 3)
%238 = load float, float* %26
%239 = fdiv float %238, 3.000000e+00
%240 = call float @sin(float %239)
%241 = fmul float %237, %240
store float %241, float* %22
%242 = load float, float* %20
%243 = load float, float* %21
%244 = load float, float* %22
%245 = fadd float %243, %244
%246 = load float, float* %3
%247 = load float, float* %2
%248 = fmul float 3.000000e+00, %247
%249 = fdiv float %246, %248
%250 = fneg float %249
%251 = call float @llvm.fmuladd.f32(float %242, float %245, float %250)
store float %251, float* %17
%252 = load float, float* %20
%253 = load float, float* %21
%254 = load float, float* %22
%255 = fsub float %253, %254
%256 = load float, float* %3
%257 = load float, float* %2
%258 = fmul float 3.000000e+00, %257
%259 = fdiv float %256, %258
%260 = fneg float %259
%261 = call float @llvm.fmuladd.f32(float %252, float %255, float %260)
store float %261, float* %23
%262 = load float, float* %16
%263 = fpext float %262 to double
%264 = load float, float* %17
%265 = fpext float %264 to double
%266 = load float, float* %23
%267 = fpext float %266 to double
%268 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.13, i64 0, i64 0), double %263, double %265, double %267)
br label %269
269: ; preds = %208, %193
%270 = load float, float* %6
%271 = load float, float* %7
%272 = fadd float %270, %271
%273 = load float, float* %8
%274 = fadd float %272, %273
%275 = fcmp oeq float %274, 0.000000e+00
br i1 %275, label %276, label %313
276: ; preds = %269
%277 = load float, float* %5
%278 = fcmp olt float %277, 0.000000e+00
br i1 %278, label %279, label %280
279: ; preds = %276
store float -1.000000e+00, float* %27
br label %280
280: ; preds = %279, %276
%281 = load float, float* %5
%282 = fcmp oge float %281, 0.000000e+00
br i1 %282, label %283, label %284
283: ; preds = %280
store float 1.000000e+00, float* %27
br label %284
284: ; preds = %283, %280
%285 = load float, float* %27
%286 = fcmp ogt float %285, 0.000000e+00
br i1 %286, label %287, label %294
287: ; preds = %284
%288 = load float, float* %5
%289 = load float, float* %2
%290 = fdiv float %288, %289
%291 = call float @cbrt(float %290)
store float %291, float* %28
%292 = load float, float* %28
%293 = fmul float %292, -1.000000e+00
store float %293, float* %28
br label %294
294: ; preds = %287, %284
%295 = load float, float* %27
%296 = fcmp olt float %295, 0.000000e+00
br i1 %296, label %297, label %304
297: ; preds = %294
%298 = load float, float* %5
%299 = fmul float %298, -1.000000e+00
store float %299, float* %5
%300 = load float, float* %5
%301 = load float, float* %2
%302 = fdiv float %300, %301
%303 = call float @cbrt(float %302)
store float %303, float* %28
br label %304
304: ; preds = %297, %294
%305 = load float, float* %28
store float %305, float* %23
store float %305, float* %17
store float %305, float* %16
%306 = load float, float* %16
%307 = fpext float %306 to double
%308 = load float, float* %17
%309 = fpext float %308 to double
%310 = load float, float* %23
%311 = fpext float %310 to double
%312 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.13, i64 0, i64 0), double %307, double %309, double %311)
br label %313
313: ; preds = %304, %269
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [41 x i8] c"Now, Enter number a (which is nonzero): \00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [41 x i8] c"Error: \22a\22 must not be zero, try again: \00"
@.str.4 = [17 x i8] c"Enter number b: \00"
@.str.5 = [17 x i8] c"Enter number c: \00"
@.str.6 = [17 x i8] c"Enter number d: \00"
@.str.7 = [10 x i8] c"\0Ax1 = %f\0A\00"
@.str.8 = [8 x i8] c"x2 = %f\00"
@.str.9 = [6 x i8] c" + %f\00"
@.str.11 = [8 x i8] c"x3 = %f\00"
@.str.12 = [6 x i8] c" - %f\00"
@.str.13 = [24 x i8] c"x1 = %f\0Ax2 = %f\0Ax3 = %f\00"
@str = [66 x i8] c"A cubic function is a function of the form \22ax^3 + bx^2 + cx + d\22\00"
@str.15 = [6 x i8] c" * i \00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = bitcast float* %1 to i8*
%6 = bitcast float* %2 to i8*
%7 = bitcast float* %3 to i8*
%8 = bitcast float* %4 to i8*
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str, i64 0, i64 0))
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %1)
%12 = load float, float* %1
%13 = fcmp oeq float %12, 0.000000e+00
br i1 %13, label %14, label %17
14: ; preds = %0
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %1)
br label %17
17: ; preds = %14, %0
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %3)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %4)
%24 = load float, float* %3
%25 = load float, float* %1
%26 = load float, float* %2
%27 = insertelement <2 x float> poison, float %24, i64 0
%28 = insertelement <2 x float> %27, float %26, i64 1
%29 = insertelement <2 x float> <float 3.000000e+00, float poison>, float %26, i64 1
%30 = fmul <2 x float> %28, %29
%31 = fmul float %25, %25
%32 = insertelement <2 x float> poison, float %25, i64 0
%33 = insertelement <2 x float> %32, float %31, i64 1
%34 = fdiv <2 x float> %30, %33
%35 = extractelement <2 x float> %34, i64 1
%36 = fmul float %26, 2.000000e+00
%37 = fmul float %26, %36
%38 = fmul float %25, %31
%39 = fmul float %26, 9.000000e+00
%40 = fmul float %24, %39
%41 = fdiv float %40, %31
%42 = load float, float* %4
%43 = insertelement <2 x float> poison, float %42, i64 0
%44 = insertelement <2 x float> %43, float %26, i64 1
%45 = insertelement <2 x float> <float 2.700000e+01, float poison>, float %37, i64 1
%46 = fmul <2 x float> %44, %45
%47 = insertelement <2 x float> %32, float %38, i64 1
%48 = fdiv <2 x float> %46, %47
%49 = extractelement <2 x float> %48, i64 1
%50 = fsub float %49, %41
%51 = shufflevector <2 x float> %34, <2 x float> %48, <2 x i32> <i32 0, i32 2>
%52 = insertelement <2 x float> poison, float %35, i64 0
%53 = insertelement <2 x float> %52, float %50, i64 1
%54 = fsub <2 x float> %51, %53
%55 = fadd <2 x float> %51, %53
%56 = shufflevector <2 x float> %54, <2 x float> %55, <2 x i32> <i32 0, i32 3>
%57 = fdiv <2 x float> %56, <float 3.000000e+00, float 2.700000e+01>
%58 = fmul <2 x float> %57, %57
%59 = insertelement <2 x float> %57, float 2.500000e-01, i64 1
%60 = fmul <2 x float> %58, %59
%61 = extractelement <2 x float> %60, i64 0
%62 = fdiv float %61, 2.700000e+01
%63 = extractelement <2 x float> %60, i64 1
%64 = fadd float %62, %63
%65 = fcmp ogt float %64, 0.000000e+00
br i1 %65, label %66, label %115
66: ; preds = %17
%67 = extractelement <2 x float> %57, i64 1
%68 = fmul float %67, -5.000000e-01
%69 = fptosi float %64 to i32
%70 = call float @sqrt(i32 %69)
%71 = fadd float %68, %70
%72 = fcmp olt float %71, 0.000000e+00
%73 = select i1 %72, float -1.000000e+00, float 1.000000e+00
%74 = fmul float %71, %73
%75 = call float @cbrt(float %74)
%76 = fmul float %75, %73
%77 = call float @sqrt(i32 %69)
%78 = fsub float %68, %77
%79 = fcmp olt float %78, 0.000000e+00
%80 = select i1 %79, float -1.000000e+00, float 1.000000e+00
%81 = fmul float %78, %80
%82 = call float @cbrt(float %81)
%83 = fmul float %82, %80
%84 = fadd float %76, %83
%85 = load float, float* %2
%86 = load float, float* %1
%87 = fmul float %86, 3.000000e+00
%88 = fdiv float %85, %87
%89 = fsub float %84, %88
%90 = fmul float %84, -5.000000e-01
%91 = fsub float %90, %88
%92 = fsub float %76, %83
%93 = fmul float %92, 5.000000e-01
%94 = call float @sqrt(i32 3)
%95 = fmul float %94, %93
%96 = load float, float* %2
%97 = load float, float* %1
%98 = fmul float %97, 3.000000e+00
%99 = fdiv float %96, %98
%100 = fsub float %90, %99
%101 = call float @sqrt(i32 3)
%102 = fmul float %93, %101
%103 = fpext float %89 to double
%104 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), double %103)
%105 = fpext float %91 to double
%106 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), double %105)
%107 = fpext float %95 to double
%108 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), double %107)
%109 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.15, i64 0, i64 0))
%110 = fpext float %100 to double
%111 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0), double %110)
%112 = fpext float %102 to double
%113 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), double %112)
%114 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.15, i64 0, i64 0))
br label %115
115: ; preds = %66, %17
%116 = fcmp ugt float %64, 0.000000e+00
br i1 %116, label %158, label %117
117: ; preds = %115
%118 = fsub float %63, %64
%119 = fptosi float %118 to i32
%120 = call float @sqrt(i32 %119)
%121 = fcmp olt float %120, 0.000000e+00
%122 = select i1 %121, float -1.000000e+00, float 1.000000e+00
%123 = fmul float %120, %122
%124 = call float @cbrt(float %123)
%125 = fmul float %124, %122
%126 = extractelement <2 x float> %57, i64 1
%127 = fneg float %126
%128 = fmul float %120, 2.000000e+00
%129 = fdiv float %127, %128
%130 = call float @acos(float %129)
%131 = fdiv float %130, 3.000000e+00
%132 = call float @cos(float %131)
%133 = fmul float %125, %132
%134 = load float, float* %2
%135 = load float, float* %1
%136 = fmul float %135, 3.000000e+00
%137 = fneg float %134
%138 = fdiv float %137, %136
%139 = call float @llvm.fmuladd.f32(float %133, float 2.000000e+00, float %138)
%140 = fneg float %125
%141 = call float @cos(float %131)
%142 = call float @sqrt(i32 3)
%143 = call float @sin(float %131)
%144 = fmul float %142, %143
%145 = fadd float %141, %144
%146 = load float, float* %2
%147 = load float, float* %1
%148 = fmul float %147, 3.000000e+00
%149 = fneg float %146
%150 = fdiv float %149, %148
%151 = call float @llvm.fmuladd.f32(float %140, float %145, float %150)
%152 = fsub float %141, %144
%153 = call float @llvm.fmuladd.f32(float %140, float %152, float %150)
%154 = fpext float %139 to double
%155 = fpext float %151 to double
%156 = fpext float %153 to double
%157 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.13, i64 0, i64 0), double %154, double %155, double %156)
br label %158
158: ; preds = %117, %115
%159 = shufflevector <2 x float> %57, <2 x float> poison, <2 x i32> <i32 1, i32 undef>
%160 = fadd <2 x float> %57, %159
%161 = extractelement <2 x float> %160, i64 0
%162 = fadd float %161, %64
%163 = fcmp oeq float %162, 0.000000e+00
br i1 %163, label %164, label %186
164: ; preds = %158
%165 = load float, float* %4
%166 = fcmp ult float %165, 0.000000e+00
%167 = select i1 %166, float -1.000000e+00, float 1.000000e+00
%168 = fcmp ogt float %167, 0.000000e+00
br i1 %168, label %169, label %174
169: ; preds = %164
%170 = load float, float* %1
%171 = fdiv float %165, %170
%172 = call float @cbrt(float %171)
%173 = fneg float %172
br label %174
174: ; preds = %169, %164
%175 = phi float [ %173, %169 ], [ undef, %164 ]
br i1 %166, label %176, label %182
176: ; preds = %174
%177 = load float, float* %4
%178 = fneg float %177
store float %178, float* %4
%179 = load float, float* %1
%180 = fdiv float %178, %179
%181 = call float @cbrt(float %180)
br label %182
182: ; preds = %176, %174
%183 = phi float [ %181, %176 ], [ %175, %174 ]
%184 = fpext float %183 to double
%185 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.13, i64 0, i64 0), double %184, double %184, double %184)
br label %186
186: ; preds = %182, %158
ret i32 0
}