#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*/ plotWrapper(float, float, float, float, float, float, float);
int /*<<< orphan*/ sysClear();
int /*<<< orphan*/ sysGetChar(char *);
int /*<<< orphan*/ sysPrintString(char *, int /*<<< orphan*/, int, int);
int graphMain(float a, float b, float c) {
  float x_r = 10;
  float x_l = -10;
  float y_d = x_l;
  float y_u = x_r;
  float x_offset = 0, y_offset = 0, ready_to_exit = 0, draw = 1;
  float factor = 1;
  char ch = 0;
  while (!ready_to_exit) {
    sysGetChar(&ch);
    if (ch == '\n') {
      sysClear();
      sysPrintString("Exited plot Successfully\n", 0, 255, 255);
      ready_to_exit = 1;
    }
    if (ch == '+') {
      factor /= 1.5;
      draw = 1;
    }
    if (ch == '-') {
      factor *= 1.5;
      draw = 1;
    }
    if (ch == 15) {
      y_offset += (5 * factor);
      draw = 1;
    }
    if (ch == 14) {
      y_offset -= (5 * factor);
      draw = 1;
    }
    if (ch == 13) {
      x_offset -= (5 * factor);
      draw = 1;
    }
    if (ch == 12) {
      x_offset += (5 * factor);
      draw = 1;
    }
    if (draw) {
      draw = 0;
      plotWrapper((x_l * factor) + x_offset, (x_r * factor) + x_offset,
                  (y_d * factor) + y_offset, (y_u * factor) + y_offset, a, b,
                  c);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<graphMain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  0xea9(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xe98(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  0xe5b(%rip),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  0xe4e(%rip),%xmm0
movss  %xmm0,-0x30(%rbp)
movb   $0x0,-0x31(%rbp)
movss  -0x28(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
xor    $0xff,%al
test   $0x1,%al
jne    11dd <graphMain+0x9d>
jmp    1409 <graphMain+0x2c9>
lea    -0x31(%rbp),%rdi
call   1050 <sysGetChar@plt>
movsbl -0x31(%rbp),%eax
cmp    $0xa,%eax
jne    121c <graphMain+0xdc>
mov    $0x0,%al
call   1060 <sysClear@plt>
lea    0xe1f(%rip),%rdi
xor    %esi,%esi
mov    $0xff,%ecx
mov    %ecx,%edx
call   1030 <sysPrintString@plt>
movss  0xde9(%rip),%xmm0
movss  %xmm0,-0x28(%rbp)
movsbl -0x31(%rbp),%eax
cmp    $0x2b,%eax
jne    1254 <graphMain+0x114>
movss  -0x30(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdde(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x30(%rbp)
movss  0xdb1(%rip),%xmm0
movss  %xmm0,-0x2c(%rbp)
movsbl -0x31(%rbp),%eax
cmp    $0x2d,%eax
jne    128c <graphMain+0x14c>
movss  -0x30(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xda6(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x30(%rbp)
movss  0xd79(%rip),%xmm0
movss  %xmm0,-0x2c(%rbp)
movsbl -0x31(%rbp),%eax
cmp    $0xf,%eax
jne    12c5 <graphMain+0x185>
movss  -0x30(%rbp),%xmm0
movss  -0x24(%rbp),%xmm1
movss  0xd61(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  0xd40(%rip),%xmm0
movss  %xmm0,-0x2c(%rbp)
movsbl -0x31(%rbp),%eax
cmp    $0xe,%eax
jne    12fe <graphMain+0x1be>
movss  -0x30(%rbp),%xmm0
movss  -0x24(%rbp),%xmm1
movss  0xd2c(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  0xd07(%rip),%xmm0
movss  %xmm0,-0x2c(%rbp)
movsbl -0x31(%rbp),%eax
cmp    $0xd,%eax
jne    1337 <graphMain+0x1f7>
movss  -0x30(%rbp),%xmm0
movss  -0x20(%rbp),%xmm1
movss  0xcf3(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  0xcce(%rip),%xmm0
movss  %xmm0,-0x2c(%rbp)
movsbl -0x31(%rbp),%eax
cmp    $0xc,%eax
jne    1370 <graphMain+0x230>
movss  -0x30(%rbp),%xmm0
movss  -0x20(%rbp),%xmm1
movss  0xcb6(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  0xc95(%rip),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    138c <graphMain+0x24c>
jp     138c <graphMain+0x24c>
jmp    1404 <graphMain+0x2c4>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x30(%rbp),%xmm2
movss  -0x20(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x30(%rbp),%xmm3
movss  -0x20(%rbp),%xmm2
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
movss  -0x18(%rbp),%xmm2
movss  -0x30(%rbp),%xmm4
movss  -0x24(%rbp),%xmm3
mulss  %xmm4,%xmm2
addss  %xmm3,%xmm2
movss  -0x1c(%rbp),%xmm3
movss  -0x30(%rbp),%xmm5
movss  -0x24(%rbp),%xmm4
mulss  %xmm5,%xmm3
addss  %xmm4,%xmm3
movss  -0x4(%rbp),%xmm4
movss  -0x8(%rbp),%xmm5
movss  -0xc(%rbp),%xmm6
call   1040 <plotWrapper@plt>
jmp    11bb <graphMain+0x7b>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<graphMain>:
push   %r14
push   %rbx
sub    $0x58,%rsp
movss  %xmm2,0x18(%rsp)
movss  %xmm1,0x14(%rsp)
movss  %xmm0,0x10(%rsp)
movb   $0x0,0xb(%rsp)
xorps  %xmm7,%xmm7
movss  0xe97(%rip),%xmm3
lea    0xb(%rsp),%rbx
lea    0xeeb(%rip),%r14
movaps %xmm3,%xmm8
movaps %xmm3,%xmm6
xorps  %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
jmp    11a9 <graphMain+0x69>
nopw   0x0(%rax,%rax,1)
movss  0xc(%rsp),%xmm0
ucomiss 0xe73(%rip),%xmm0
jne    1340 <graphMain+0x200>
jp     1340 <graphMain+0x200>
movss  %xmm6,0x1c(%rsp)
movaps %xmm8,0x30(%rsp)
movaps %xmm7,0x20(%rsp)
mov    %rbx,%rdi
call   1050 <sysGetChar@plt>
movzbl 0xb(%rsp),%ecx
cmp    $0xa,%cl
jne    11fa <graphMain+0xba>
xor    %eax,%eax
call   1060 <sysClear@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0xff,%edx
mov    $0xff,%ecx
call   1030 <sysPrintString@plt>
movzbl 0xb(%rsp),%ecx
movss  0xe0c(%rip),%xmm0
movss  %xmm0,0xc(%rsp)
lea    -0xc(%rcx),%eax
cmp    $0x2b,%cl
movaps 0x30(%rsp),%xmm8
jne    1211 <graphMain+0xd1>
divss  0xdf3(%rip),%xmm8
movd   0xde7(%rip),%xmm6
movaps 0x20(%rsp),%xmm7
movdqa %xmm6,%xmm3
je     122a <graphMain+0xea>
movd   0x1c(%rsp),%xmm3
cmp    $0x2d,%cl
jne    1238 <graphMain+0xf8>
mulss  0xdcc(%rip),%xmm8
movzbl %cl,%ecx
movd   %ecx,%xmm1
punpcklbw %xmm1,%xmm1
movdqa %xmm1,%xmm4
pcmpeqb 0xdd1(%rip),%xmm4
movdqa %xmm4,0x40(%rsp)
movaps %xmm8,%xmm0
shufps $0x0,%xmm8,%xmm0
movaps %xmm0,%xmm2
mulps  0xdc8(%rip),%xmm2
mulps  0xde1(%rip),%xmm0
movdqa %xmm6,%xmm5
je     1279 <graphMain+0x139>
movdqa %xmm3,%xmm5
testb  $0x1,0x40(%rsp)
movdqa %xmm6,%xmm3
jne    1288 <graphMain+0x148>
movdqa %xmm5,%xmm3
cmp    $0x3,%al
jb     1290 <graphMain+0x150>
movdqa %xmm3,%xmm6
punpcklbw %xmm4,%xmm3
punpcklwd %xmm3,%xmm3
psrad  $0x18,%xmm3
addps  %xmm7,%xmm2
andps  %xmm3,%xmm2
andnps %xmm7,%xmm3
orps   %xmm2,%xmm3
pcmpeqb 0xd8f(%rip),%xmm1
punpcklbw %xmm1,%xmm1
punpcklwd %xmm1,%xmm7
psrad  $0x18,%xmm7
addps  %xmm3,%xmm0
andps  %xmm7,%xmm0
andnps %xmm3,%xmm7
orps   %xmm0,%xmm7
ucomiss 0xd3f(%rip),%xmm6
jne    12d9 <graphMain+0x199>
jnp    1190 <graphMain+0x50>
movaps %xmm7,%xmm1
shufps $0x55,%xmm7,%xmm1
movaps %xmm8,%xmm2
mulss  0xd1c(%rip),%xmm2
movaps %xmm2,%xmm0
addss  %xmm1,%xmm0
movaps %xmm8,%xmm3
mulss  0xd0d(%rip),%xmm3
addss  %xmm3,%xmm1
addss  %xmm7,%xmm2
addss  %xmm7,%xmm3
movd   0x10(%rsp),%xmm4
movd   0x14(%rsp),%xmm5
movss  0x18(%rsp),%xmm6
movaps %xmm7,0x20(%rsp)
movaps %xmm8,0x30(%rsp)
call   1040 <plotWrapper@plt>
movaps 0x30(%rsp),%xmm8
movaps 0x20(%rsp),%xmm7
xorps  %xmm6,%xmm6
jmp    1190 <graphMain+0x50>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Exited plot Successfully\0A\00"
define i32 @graphMain(float %0, float %1, float %2) {
%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 i8
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
store float 1.000000e+01, float* %7
store float -1.000000e+01, float* %8
%17 = load float, float* %8
store float %17, float* %9
%18 = load float, float* %7
store float %18, float* %10
store float 0.000000e+00, float* %11
store float 0.000000e+00, float* %12
store float 0.000000e+00, float* %13
store float 1.000000e+00, float* %14
store float 1.000000e+00, float* %15
store i8 0, i8* %16
br label %19
19: ; preds = %105, %3
%20 = load float, float* %13
%21 = fcmp une float %20, 0.000000e+00
%22 = xor i1 %21, true
br i1 %22, label %23, label %106
23: ; preds = %19
%24 = call i32 @sysGetChar(i8* %16)
%25 = load i8, i8* %16
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 10
br i1 %27, label %28, label %31
28: ; preds = %23
%29 = call i32 (...) @sysClear()
%30 = call i32 @sysPrintString(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 0, i32 255, i32 255)
store float 1.000000e+00, float* %13
br label %31
31: ; preds = %28, %23
%32 = load i8, i8* %16
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 43
br i1 %34, label %35, label %40
35: ; preds = %31
%36 = load float, float* %15
%37 = fpext float %36 to double
%38 = fdiv double %37, 1.500000e+00
%39 = fptrunc double %38 to float
store float %39, float* %15
store float 1.000000e+00, float* %14
br label %40
40: ; preds = %35, %31
%41 = load i8, i8* %16
%42 = sext i8 %41 to i32
%43 = icmp eq i32 %42, 45
br i1 %43, label %44, label %49
44: ; preds = %40
%45 = load float, float* %15
%46 = fpext float %45 to double
%47 = fmul double %46, 1.500000e+00
%48 = fptrunc double %47 to float
store float %48, float* %15
store float 1.000000e+00, float* %14
br label %49
49: ; preds = %44, %40
%50 = load i8, i8* %16
%51 = sext i8 %50 to i32
%52 = icmp eq i32 %51, 15
br i1 %52, label %53, label %57
53: ; preds = %49
%54 = load float, float* %15
%55 = load float, float* %12
%56 = call float @llvm.fmuladd.f32(float 5.000000e+00, float %54, float %55)
store float %56, float* %12
store float 1.000000e+00, float* %14
br label %57
57: ; preds = %53, %49
%58 = load i8, i8* %16
%59 = sext i8 %58 to i32
%60 = icmp eq i32 %59, 14
br i1 %60, label %61, label %65
61: ; preds = %57
%62 = load float, float* %15
%63 = load float, float* %12
%64 = call float @llvm.fmuladd.f32(float -5.000000e+00, float %62, float %63)
store float %64, float* %12
store float 1.000000e+00, float* %14
br label %65
65: ; preds = %61, %57
%66 = load i8, i8* %16
%67 = sext i8 %66 to i32
%68 = icmp eq i32 %67, 13
br i1 %68, label %69, label %73
69: ; preds = %65
%70 = load float, float* %15
%71 = load float, float* %11
%72 = call float @llvm.fmuladd.f32(float -5.000000e+00, float %70, float %71)
store float %72, float* %11
store float 1.000000e+00, float* %14
br label %73
73: ; preds = %69, %65
%74 = load i8, i8* %16
%75 = sext i8 %74 to i32
%76 = icmp eq i32 %75, 12
br i1 %76, label %77, label %81
77: ; preds = %73
%78 = load float, float* %15
%79 = load float, float* %11
%80 = call float @llvm.fmuladd.f32(float 5.000000e+00, float %78, float %79)
store float %80, float* %11
store float 1.000000e+00, float* %14
br label %81
81: ; preds = %77, %73
%82 = load float, float* %14
%83 = fcmp une float %82, 0.000000e+00
br i1 %83, label %84, label %105
84: ; preds = %81
store float 0.000000e+00, float* %14
%85 = load float, float* %8
%86 = load float, float* %15
%87 = load float, float* %11
%88 = call float @llvm.fmuladd.f32(float %85, float %86, float %87)
%89 = load float, float* %7
%90 = load float, float* %15
%91 = load float, float* %11
%92 = call float @llvm.fmuladd.f32(float %89, float %90, float %91)
%93 = load float, float* %9
%94 = load float, float* %15
%95 = load float, float* %12
%96 = call float @llvm.fmuladd.f32(float %93, float %94, float %95)
%97 = load float, float* %10
%98 = load float, float* %15
%99 = load float, float* %12
%100 = call float @llvm.fmuladd.f32(float %97, float %98, float %99)
%101 = load float, float* %4
%102 = load float, float* %5
%103 = load float, float* %6
%104 = call i32 @plotWrapper(float %88, float %92, float %96, float %100, float %101, float %102, float %103)
br label %105
105: ; preds = %84, %81
br label %19
106: ; preds = %19
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Exited plot Successfully\0A\00"
define i32 @graphMain(float %0, float %1, float %2) {
%4 = alloca i8
store i8 0, i8* %4
br label %5
5: ; preds = %3, %52
%6 = phi float [ 1.000000e+00, %3 ], [ %26, %52 ]
%7 = phi float [ 1.000000e+00, %3 ], [ %53, %52 ]
%8 = phi float [ 0.000000e+00, %3 ], [ %19, %52 ]
%9 = phi <2 x float> [ zeroinitializer, %3 ], [ %38, %52 ]
%10 = call i32 @sysGetChar(i8* %4)
%11 = load i8, i8* %4
%12 = icmp eq i8 %11, 10
br i1 %12, label %13, label %17
13: ; preds = %5
%14 = call i32 (...) @sysClear()
%15 = call i32 @sysPrintString(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 0, i32 255, i32 255)
%16 = load i8, i8* %4
br label %17
17: ; preds = %13, %5
%18 = phi i8 [ %16, %13 ], [ %11, %5 ]
%19 = phi float [ 1.000000e+00, %13 ], [ %8, %5 ]
%20 = icmp eq i8 %18, 43
%21 = fdiv float %6, 1.500000e+00
%22 = select i1 %20, float %21, float %6
%23 = icmp eq i8 %18, 45
%24 = fmul float %22, 1.500000e+00
%25 = or i1 %23, %20
%26 = select i1 %23, float %24, float %22
%27 = insertelement <2 x i8> poison, i8 %18, i64 0
%28 = shufflevector <2 x i8> %27, <2 x i8> poison, <2 x i32> zeroinitializer
%29 = icmp eq <2 x i8> %28, <i8 15, i8 13>
%30 = extractelement <2 x i1> %29, i64 0
%31 = or i1 %30, %25
%32 = insertelement <2 x float> poison, float %26, i64 0
%33 = shufflevector <2 x float> %32, <2 x float> poison, <2 x i32> zeroinitializer
%34 = call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %33, <2 x float> <float 5.000000e+00, float -5.000000e+00>, <2 x float> %9)
%35 = select <2 x i1> %29, <2 x float> %34, <2 x float> %9
%36 = icmp eq <2 x i8> %28, <i8 14, i8 12>
%37 = call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %33, <2 x float> <float -5.000000e+00, float 5.000000e+00>, <2 x float> %35)
%38 = select <2 x i1> %36, <2 x float> %37, <2 x float> %35
%39 = add i8 %18, -12
%40 = icmp ult i8 %39, 3
%41 = select i1 %40, i1 true, i1 %31
%42 = select i1 %41, float 1.000000e+00, float %7
%43 = fcmp une float %42, 0.000000e+00
br i1 %43, label %44, label %52
44: ; preds = %17
%45 = extractelement <2 x float> %38, i64 1
%46 = call float @llvm.fmuladd.f32(float %26, float -1.000000e+01, float %45)
%47 = call float @llvm.fmuladd.f32(float %26, float 1.000000e+01, float %45)
%48 = extractelement <2 x float> %38, i64 0
%49 = call float @llvm.fmuladd.f32(float %26, float -1.000000e+01, float %48)
%50 = call float @llvm.fmuladd.f32(float %26, float 1.000000e+01, float %48)
%51 = call i32 @plotWrapper(float %46, float %47, float %49, float %50, float %0, float %1, float %2)
br label %52
52: ; preds = %44, %17
%53 = phi float [ 0.000000e+00, %44 ], [ %42, %17 ]
%54 = fcmp oeq float %19, 0.000000e+00
br i1 %54, label %5, label %55
55: ; preds = %52
ret i32 0
}