#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);
int /*<<< orphan*/ printf(char *, ...);
void print_equation2(int CoeffA, int CoeffB, int CoeffC) {
  printf("\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n");
  if (CoeffA == 1)
    printf("The equation is y = x^2 ");
  else if (CoeffA == -1)
    printf("The equation is y = -x^2 ");
  if (CoeffB == 1 && !(CoeffC == 0))
    printf("+ x ");
  else if (CoeffB == -1 && !(CoeffC == 0))
    printf("- x ");
  else if (CoeffB == 1 && CoeffC == 0)
    printf("+ x\n");
  else if (CoeffB == -1 && CoeffC == 0)
    printf("- x\n");
  if (CoeffC > 0)
    printf("+ %d\n", CoeffC);
  else if (CoeffC < 0)
    printf("- %d\n", abs(CoeffC));
  if (CoeffA > 0)
    printf("The parabola opens upward.\n");
  else if (CoeffA < 0)
    printf("The parabola opens downward.\n");
  return;
}


x86 assembly (clang, -O0):
<print_equation2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x1,-0x4(%rbp)
jne    115c <print_equation2+0x3c>
lea    0xee0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1179 <print_equation2+0x59>
cmpl   $0xffffffff,-0x4(%rbp)
jne    1174 <print_equation2+0x54>
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1179 <print_equation2+0x59>
cmpl   $0x1,-0x8(%rbp)
jne    11a0 <print_equation2+0x80>
cmpl   $0x0,-0xc(%rbp)
je     11a0 <print_equation2+0x80>
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    121f <print_equation2+0xff>
cmpl   $0xffffffff,-0x8(%rbp)
jne    11c7 <print_equation2+0xa7>
cmpl   $0x0,-0xc(%rbp)
je     11c7 <print_equation2+0xa7>
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    121a <print_equation2+0xfa>
cmpl   $0x1,-0x8(%rbp)
jne    11ee <print_equation2+0xce>
cmpl   $0x0,-0xc(%rbp)
jne    11ee <print_equation2+0xce>
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1215 <print_equation2+0xf5>
cmpl   $0xffffffff,-0x8(%rbp)
jne    1210 <print_equation2+0xf0>
cmpl   $0x0,-0xc(%rbp)
jne    1210 <print_equation2+0xf0>
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1215 <print_equation2+0xf5>
jmp    121a <print_equation2+0xfa>
jmp    121f <print_equation2+0xff>
cmpl   $0x0,-0xc(%rbp)
jle    123f <print_equation2+0x11f>
mov    -0xc(%rbp),%esi
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1266 <print_equation2+0x146>
cmpl   $0x0,-0xc(%rbp)
jge    1261 <print_equation2+0x141>
mov    -0xc(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%esi
lea    0xe23(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1266 <print_equation2+0x146>
cmpl   $0x0,-0x4(%rbp)
jle    1283 <print_equation2+0x163>
lea    0xe0c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    12a0 <print_equation2+0x180>
cmpl   $0x0,-0x4(%rbp)
jge    129b <print_equation2+0x17b>
lea    0xe0b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    12a0 <print_equation2+0x180>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_equation2>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %esi,%ebx
mov    %edi,%r14d
lea    0xf17(%rip),%rdi
call   1030 <puts@plt>
cmp    $0x1,%r14d
je     114c <print_equation2+0x2c>
cmp    $0xffffffff,%r14d
jne    115a <print_equation2+0x3a>
lea    0xecf(%rip),%rdi
jmp    1153 <print_equation2+0x33>
lea    0xead(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x1,%ebx
jne    116c <print_equation2+0x4c>
test   %ebp,%ebp
je     116c <print_equation2+0x4c>
lea    0xec9(%rip),%rdi
jmp    117c <print_equation2+0x5c>
cmp    $0xffffffff,%ebx
jne    11ab <print_equation2+0x8b>
test   %ebp,%ebp
je     11ab <print_equation2+0x8b>
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebp,%ebp
jle    119e <print_equation2+0x7e>
lea    0xeaf(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r14d,%r14d
jg     11c5 <print_equation2+0xa5>
jmp    11ef <print_equation2+0xcf>
jns    11c0 <print_equation2+0xa0>
neg    %ebp
lea    0xe9a(%rip),%rdi
jmp    118e <print_equation2+0x6e>
cmp    $0x1,%ebx
jne    11d5 <print_equation2+0xb5>
test   %ebp,%ebp
jne    11d5 <print_equation2+0xb5>
lea    0xef9(%rip),%rdi
call   1030 <puts@plt>
test   %r14d,%r14d
jle    11ef <print_equation2+0xcf>
lea    0xec9(%rip),%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <puts@plt>
cmp    $0xffffffff,%ebx
jne    1183 <print_equation2+0x63>
test   %ebp,%ebp
jne    1183 <print_equation2+0x63>
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
test   %r14d,%r14d
jg     11c5 <print_equation2+0xa5>
js     11f6 <print_equation2+0xd6>
pop    %rbx
pop    %r14
pop    %rbp
ret
lea    0xe7b(%rip),%rdi
jmp    11cc <print_equation2+0xac>

LLVM IR (-O0):
@.str = [48 x i8] c"\0A-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\0A\00"
@.str.1 = [25 x i8] c"The equation is y = x^2 \00"
@.str.2 = [26 x i8] c"The equation is y = -x^2 \00"
@.str.3 = [5 x i8] c"+ x \00"
@.str.4 = [5 x i8] c"- x \00"
@.str.5 = [5 x i8] c"+ x\0A\00"
@.str.6 = [5 x i8] c"- x\0A\00"
@.str.7 = [6 x i8] c"+ %d\0A\00"
@.str.8 = [6 x i8] c"- %d\0A\00"
@.str.9 = [28 x i8] c"The parabola opens upward.\0A\00"
@.str.10 = [30 x i8] c"The parabola opens downward.\0A\00"
define void @print_equation2(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
br label %18
12: ; preds = %3
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
br label %17
17: ; preds = %15, %12
br label %18
18: ; preds = %17, %10
%19 = load i32, i32* %5
%20 = icmp eq i32 %19, 1
br i1 %20, label %21, label %26
21: ; preds = %18
%22 = load i32, i32* %6
%23 = icmp eq i32 %22, 0
br i1 %23, label %26, label %24
24: ; preds = %21
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %53
26: ; preds = %21, %18
%27 = load i32, i32* %5
%28 = icmp eq i32 %27, -1
br i1 %28, label %29, label %34
29: ; preds = %26
%30 = load i32, i32* %6
%31 = icmp eq i32 %30, 0
br i1 %31, label %34, label %32
32: ; preds = %29
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %52
34: ; preds = %29, %26
%35 = load i32, i32* %5
%36 = icmp eq i32 %35, 1
br i1 %36, label %37, label %42
37: ; preds = %34
%38 = load i32, i32* %6
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %42
40: ; preds = %37
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %51
42: ; preds = %37, %34
%43 = load i32, i32* %5
%44 = icmp eq i32 %43, -1
br i1 %44, label %45, label %50
45: ; preds = %42
%46 = load i32, i32* %6
%47 = icmp eq i32 %46, 0
br i1 %47, label %48, label %50
48: ; preds = %45
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
br label %50
50: ; preds = %48, %45, %42
br label %51
51: ; preds = %50, %40
br label %52
52: ; preds = %51, %32
br label %53
53: ; preds = %52, %24
%54 = load i32, i32* %6
%55 = icmp sgt i32 %54, 0
br i1 %55, label %56, label %59
56: ; preds = %53
%57 = load i32, i32* %6
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i32 %57)
br label %67
59: ; preds = %53
%60 = load i32, i32* %6
%61 = icmp slt i32 %60, 0
br i1 %61, label %62, label %66
62: ; preds = %59
%63 = load i32, i32* %6
%64 = call i32 @abs(i32 %63)
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i32 %64)
br label %66
66: ; preds = %62, %59
br label %67
67: ; preds = %66, %56
%68 = load i32, i32* %4
%69 = icmp sgt i32 %68, 0
br i1 %69, label %70, label %72
70: ; preds = %67
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0))
br label %78
72: ; preds = %67
%73 = load i32, i32* %4
%74 = icmp slt i32 %73, 0
br i1 %74, label %75, label %77
75: ; preds = %72
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0))
br label %77
77: ; preds = %75, %72
br label %78
78: ; preds = %77, %70
ret void
}

LLVM IR (-O2):
@.str.1 = [25 x i8] c"The equation is y = x^2 \00"
@.str.2 = [26 x i8] c"The equation is y = -x^2 \00"
@.str.3 = [5 x i8] c"+ x \00"
@.str.4 = [5 x i8] c"- x \00"
@.str.7 = [6 x i8] c"+ %d\0A\00"
@.str.8 = [6 x i8] c"- %d\0A\00"
@str = [47 x i8] c"\0A-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\00"
@str.11 = [29 x i8] c"The parabola opens downward.\00"
@str.12 = [27 x i8] c"The parabola opens upward.\00"
@str.13 = [4 x i8] c"- x\00"
@str.14 = [4 x i8] c"+ x\00"
define void @print_equation2(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
switch i32 %0, label %9 [
i32 1, label %6
i32 -1, label %5
]
5: ; preds = %3
br label %6
6: ; preds = %3, %5
%7 = phi i8* [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), %5 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), %3 ]
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %7)
br label %9
9: ; preds = %6, %3
%10 = icmp ne i32 %1, 1
%11 = icmp eq i32 %2, 0
%12 = or i1 %10, %11
br i1 %12, label %13, label %26
13: ; preds = %9
%14 = icmp ne i32 %1, -1
%15 = or i1 %14, %11
br i1 %15, label %16, label %26
16: ; preds = %13
%17 = icmp eq i32 %1, 1
%18 = and i1 %17, %11
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.14, i64 0, i64 0))
br label %38
21: ; preds = %16
%22 = icmp eq i32 %1, -1
%23 = and i1 %22, %11
br i1 %23, label %24, label %29
24: ; preds = %21
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.13, i64 0, i64 0))
br label %38
26: ; preds = %13, %9
%27 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), %9 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), %13 ]
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %27)
br label %29
29: ; preds = %26, %21
%30 = icmp sgt i32 %2, 0
br i1 %30, label %31, label %33
31: ; preds = %29
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i32 %2)
br label %38
33: ; preds = %29
%34 = icmp slt i32 %2, 0
br i1 %34, label %35, label %38
35: ; preds = %33
%36 = sub nsw i32 0, %2
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i32 %36)
br label %38
38: ; preds = %24, %19, %33, %35, %31
%39 = icmp sgt i32 %0, 0
br i1 %39, label %42, label %40
40: ; preds = %38
%41 = icmp slt i32 %0, 0
br i1 %41, label %42, label %45
42: ; preds = %40, %38
%43 = phi i8* [ getelementptr inbounds ([27 x i8], [27 x i8]* @str.12, i64 0, i64 0), %38 ], [ getelementptr inbounds ([29 x i8], [29 x i8]* @str.11, i64 0, i64 0), %40 ]
%44 = tail call i32 @puts(i8* dereferenceable(1) %43)
br label %45
45: ; preds = %42, %40
ret void
}