#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 abs(int);
double discrim_quad(int, int, int);
int /*<<< orphan*/ getCoeff(int *, int *, int *);
int /*<<< orphan*/ imagine_root(int, int, double);
int /*<<< orphan*/ linear_root(int, int);
int /*<<< orphan*/ print_equation1(int, int, int);
int /*<<< orphan*/ print_equation2(int, int, int);
int /*<<< orphan*/ print_equation3(int, int, int);
int /*<<< orphan*/ print_equation4(int, int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ real_root(int, int, double);
int main(void) {
  int CoeffA;
  int CoeffB;
  int CoeffC;
  double discrim;
  getCoeff(&CoeffA, &CoeffB, &CoeffC);
  if (abs(CoeffB) == 1 && abs(CoeffA) == 1)
    print_equation2(CoeffA, CoeffB, CoeffC);
  else if (abs(CoeffB) == 1 && !(abs(CoeffA) == 1))
    print_equation3(CoeffA, CoeffB, CoeffC);
  else if (abs(CoeffA) == 1 && !(abs(CoeffB) == 1))
    print_equation4(CoeffA, CoeffB, CoeffC);
  else
    print_equation1(CoeffA, CoeffB, CoeffC);
  if (!(CoeffA == 0))
    discrim = discrim_quad(CoeffA, CoeffB, CoeffC);
  else if (!(CoeffB == 0) && CoeffA == 0)
    linear_root(CoeffB, CoeffC);
  else if (CoeffA == 0 && CoeffB == 0) {
    printf("The line has no zeros.");
    printf("\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n\n");
  }
  if (!(CoeffA == 0) && (discrim > 0 || discrim == 0))
    real_root(CoeffA, CoeffB, discrim);
  else if (!(CoeffA == 0) && discrim < 0)
    imagine_root(CoeffA, CoeffB, discrim);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   10d0 <getCoeff@plt>
mov    -0xc(%rbp),%edi
call   1050 <abs@plt>
cmp    $0x1,%eax
jne    1205 <main+0x55>
mov    -0x8(%rbp),%edi
call   1050 <abs@plt>
cmp    $0x1,%eax
jne    1205 <main+0x55>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   10c0 <print_equation2@plt>
jmp    1287 <main+0xd7>
mov    -0xc(%rbp),%edi
call   1050 <abs@plt>
cmp    $0x1,%eax
jne    123a <main+0x8a>
mov    -0x8(%rbp),%edi
call   1050 <abs@plt>
cmp    $0x1,%eax
je     123a <main+0x8a>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <print_equation3@plt>
jmp    1282 <main+0xd2>
mov    -0x8(%rbp),%edi
call   1050 <abs@plt>
cmp    $0x1,%eax
jne    126f <main+0xbf>
mov    -0xc(%rbp),%edi
call   1050 <abs@plt>
cmp    $0x1,%eax
je     126f <main+0xbf>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   10b0 <print_equation4@plt>
jmp    127d <main+0xcd>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <print_equation1@plt>
jmp    1282 <main+0xd2>
jmp    1287 <main+0xd7>
cmpl   $0x0,-0x8(%rbp)
je     12a9 <main+0xf9>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   10a0 <discrim_quad@plt>
movsd  %xmm0,-0x18(%rbp)
jmp    1303 <main+0x153>
cmpl   $0x0,-0xc(%rbp)
je     12cd <main+0x11d>
cmpl   $0x0,-0x8(%rbp)
jne    12cd <main+0x11d>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1080 <linear_root@plt>
jmp    12fe <main+0x14e>
cmpl   $0x0,-0x8(%rbp)
jne    12f9 <main+0x149>
cmpl   $0x0,-0xc(%rbp)
jne    12f9 <main+0x149>
lea    0xd18(%rip),%rdi
call   1070 <printf@plt>
lea    0xd23(%rip),%rdi
call   1070 <printf@plt>
jmp    12fe <main+0x14e>
jmp    1303 <main+0x153>
cmpl   $0x0,-0x8(%rbp)
je     134c <main+0x19c>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
ja     1337 <main+0x187>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    134c <main+0x19c>
jp     134c <main+0x19c>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
movsd  -0x18(%rbp),%xmm0
call   1060 <real_root@plt>
jmp    1379 <main+0x1c9>
cmpl   $0x0,-0x8(%rbp)
je     1374 <main+0x1c4>
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1374 <main+0x1c4>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
movsd  -0x18(%rbp),%xmm0
call   1090 <imagine_root@plt>
jmp    1379 <main+0x1c9>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rdi
lea    0xc(%rsp),%rsi
lea    0x10(%rsp),%rdx
call   10d0 <getCoeff@plt>
mov    0xc(%rsp),%esi
mov    %esi,%ecx
neg    %ecx
cmovs  %esi,%ecx
mov    0x14(%rsp),%edi
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
mov    0x10(%rsp),%edx
cmp    $0x1,%ecx
jne    11f3 <main+0x43>
cmp    $0x1,%eax
jne    11ff <main+0x4f>
call   10c0 <print_equation2@plt>
jmp    120b <main+0x5b>
cmp    $0x1,%eax
jne    1206 <main+0x56>
call   10b0 <print_equation4@plt>
jmp    120b <main+0x5b>
call   1030 <print_equation3@plt>
jmp    120b <main+0x5b>
call   1040 <print_equation1@plt>
mov    0x14(%rsp),%edi
mov    0xc(%rsp),%esi
test   %edi,%edi
je     123d <main+0x8d>
mov    0x10(%rsp),%edx
call   10a0 <discrim_quad@plt>
mov    0x14(%rsp),%edi
test   %edi,%edi
je     1250 <main+0xa0>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1250 <main+0xa0>
mov    0xc(%rsp),%esi
call   1060 <real_root@plt>
jmp    1281 <main+0xd1>
test   %esi,%esi
je     1269 <main+0xb9>
mov    0x10(%rsp),%eax
mov    %esi,%edi
mov    %eax,%esi
call   1080 <linear_root@plt>
jmp    1281 <main+0xd1>
test   %edi,%edi
je     1281 <main+0xd1>
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    1281 <main+0xd1>
mov    0xc(%rsp),%esi
call   1090 <imagine_root@plt>
jmp    1281 <main+0xd1>
lea    0xd90(%rip),%rdi
call   1070 <printf@plt>
lea    0xd9b(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"The line has no zeros.\00"
@.str.1 = [49 x i8] c"\0A-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 0, i32* %1
%6 = call i32 @getCoeff(i32* %2, i32* %3, i32* %4)
%7 = load i32, i32* %3
%8 = call i32 @abs(i32 %7)
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %19
10: ; preds = %0
%11 = load i32, i32* %2
%12 = call i32 @abs(i32 %11)
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %19
14: ; preds = %10
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = call i32 @print_equation2(i32 %15, i32 %16, i32 %17)
br label %52
19: ; preds = %10, %0
%20 = load i32, i32* %3
%21 = call i32 @abs(i32 %20)
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %32
23: ; preds = %19
%24 = load i32, i32* %2
%25 = call i32 @abs(i32 %24)
%26 = icmp eq i32 %25, 1
br i1 %26, label %32, label %27
27: ; preds = %23
%28 = load i32, i32* %2
%29 = load i32, i32* %3
%30 = load i32, i32* %4
%31 = call i32 @print_equation3(i32 %28, i32 %29, i32 %30)
br label %51
32: ; preds = %23, %19
%33 = load i32, i32* %2
%34 = call i32 @abs(i32 %33)
%35 = icmp eq i32 %34, 1
br i1 %35, label %36, label %45
36: ; preds = %32
%37 = load i32, i32* %3
%38 = call i32 @abs(i32 %37)
%39 = icmp eq i32 %38, 1
br i1 %39, label %45, label %40
40: ; preds = %36
%41 = load i32, i32* %2
%42 = load i32, i32* %3
%43 = load i32, i32* %4
%44 = call i32 @print_equation4(i32 %41, i32 %42, i32 %43)
br label %50
45: ; preds = %36, %32
%46 = load i32, i32* %2
%47 = load i32, i32* %3
%48 = load i32, i32* %4
%49 = call i32 @print_equation1(i32 %46, i32 %47, i32 %48)
br label %50
50: ; preds = %45, %40
br label %51
51: ; preds = %50, %27
br label %52
52: ; preds = %51, %14
%53 = load i32, i32* %2
%54 = icmp eq i32 %53, 0
br i1 %54, label %60, label %55
55: ; preds = %52
%56 = load i32, i32* %2
%57 = load i32, i32* %3
%58 = load i32, i32* %4
%59 = call double @discrim_quad(i32 %56, i32 %57, i32 %58)
store double %59, double* %5
br label %81
60: ; preds = %52
%61 = load i32, i32* %3
%62 = icmp eq i32 %61, 0
br i1 %62, label %70, label %63
63: ; preds = %60
%64 = load i32, i32* %2
%65 = icmp eq i32 %64, 0
br i1 %65, label %66, label %70
66: ; preds = %63
%67 = load i32, i32* %3
%68 = load i32, i32* %4
%69 = call i32 @linear_root(i32 %67, i32 %68)
br label %80
70: ; preds = %63, %60
%71 = load i32, i32* %2
%72 = icmp eq i32 %71, 0
br i1 %72, label %73, label %79
73: ; preds = %70
%74 = load i32, i32* %3
%75 = icmp eq i32 %74, 0
br i1 %75, label %76, label %79
76: ; preds = %73
%77 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%78 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
br label %79
79: ; preds = %76, %73, %70
br label %80
80: ; preds = %79, %66
br label %81
81: ; preds = %80, %55
%82 = load i32, i32* %2
%83 = icmp eq i32 %82, 0
br i1 %83, label %95, label %84
84: ; preds = %81
%85 = load double, double* %5
%86 = fcmp ogt double %85, 0.000000e+00
br i1 %86, label %90, label %87
87: ; preds = %84
%88 = load double, double* %5
%89 = fcmp oeq double %88, 0.000000e+00
br i1 %89, label %90, label %95
90: ; preds = %87, %84
%91 = load i32, i32* %2
%92 = load i32, i32* %3
%93 = load double, double* %5
%94 = call i32 @real_root(i32 %91, i32 %92, double %93)
br label %107
95: ; preds = %87, %81
%96 = load i32, i32* %2
%97 = icmp eq i32 %96, 0
br i1 %97, label %106, label %98
98: ; preds = %95
%99 = load double, double* %5
%100 = fcmp olt double %99, 0.000000e+00
br i1 %100, label %101, label %106
101: ; preds = %98
%102 = load i32, i32* %2
%103 = load i32, i32* %3
%104 = load double, double* %5
%105 = call i32 @imagine_root(i32 %102, i32 %103, double %104)
br label %106
106: ; preds = %101, %98, %95
br label %107
107: ; preds = %106, %90
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"The line has no zeros.\00"
@str = [48 x i8] c"\0A-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @getCoeff(i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %2
%9 = call i32 @llvm.abs.i32(i32 %8, i1 true)
%10 = icmp eq i32 %9, 1
%11 = load i32, i32* %1
%12 = call i32 @llvm.abs.i32(i32 %11, i1 true)
%13 = icmp eq i32 %12, 1
%14 = load i32, i32* %3
br i1 %10, label %15, label %20
15: ; preds = %0
br i1 %13, label %16, label %18
16: ; preds = %15
%17 = call i32 @print_equation2(i32 %11, i32 %8, i32 %14)
br label %25
18: ; preds = %15
%19 = call i32 @print_equation3(i32 %11, i32 %8, i32 %14)
br label %25
20: ; preds = %0
br i1 %13, label %21, label %23
21: ; preds = %20
%22 = call i32 @print_equation4(i32 %11, i32 %8, i32 %14)
br label %25
23: ; preds = %20
%24 = call i32 @print_equation1(i32 %11, i32 %8, i32 %14)
br label %25
25: ; preds = %18, %23, %21, %16
%26 = load i32, i32* %1
%27 = icmp eq i32 %26, 0
%28 = load i32, i32* %2
br i1 %27, label %29, label %37
29: ; preds = %25
%30 = icmp eq i32 %28, 0
br i1 %30, label %34, label %31
31: ; preds = %29
%32 = load i32, i32* %3
%33 = call i32 @linear_root(i32 %28, i32 %32)
br label %54
34: ; preds = %29
%35 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%36 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
br label %54
37: ; preds = %25
%38 = load i32, i32* %3
%39 = call double @discrim_quad(i32 %26, i32 %28, i32 %38)
%40 = load i32, i32* %1
%41 = icmp eq i32 %40, 0
%42 = fcmp ult double %39, 0.000000e+00
%43 = select i1 %41, i1 true, i1 %42
br i1 %43, label %47, label %44
44: ; preds = %37
%45 = load i32, i32* %2
%46 = call i32 @real_root(i32 %40, i32 %45, double %39)
br label %54
47: ; preds = %37
%48 = icmp ne i32 %40, 0
%49 = fcmp olt double %39, 0.000000e+00
%50 = select i1 %48, i1 %49, i1 false
br i1 %50, label %51, label %54
51: ; preds = %47
%52 = load i32, i32* %2
%53 = call i32 @imagine_root(i32 %40, i32 %52, double %39)
br label %54
54: ; preds = %31, %34, %47, %51, %44
ret i32 0
}