#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 absFloat(scalar_t__);
scalar_t__ fxFloat(float, float, float, float);
int /*<<< orphan*/ sysPaintPixel(int, int, int, int, int /*<<< orphan*/);
void plotFunction(float x_left_boundary, float x_right_boundary,
                  float y_down_boundary, float y_up_boundary, float a, float b,
                  float c) {
  float x_val, y_val;
  float diff;
  float differential = (x_right_boundary - x_left_boundary) * 0.1 / 20;
  for (int i = 0; i < 1024; i++) {
    for (int j = 0; j < 768; j++) {
      x_val =
          x_left_boundary + (i * (x_right_boundary - x_left_boundary)) / 1024;
      y_val = y_up_boundary - (j * (y_up_boundary - y_down_boundary)) / 768;
      diff = absFloat(fxFloat(x_val, a, b, c) - y_val);
      if (diff < differential) {
        sysPaintPixel(i, j, 255, 255, 0);
      }
    }
  }
}


x86 assembly (clang, -O0):
<plotFunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  %xmm6,-0x1c(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe97(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe83(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
cmpl   $0x400,-0x30(%rbp)
jge    128c <plotFunction+0x15c>
movl   $0x0,-0x34(%rbp)
cmpl   $0x300,-0x34(%rbp)
jge    1279 <plotFunction+0x149>
movss  -0x4(%rbp),%xmm0
cvtsi2ssl -0x30(%rbp),%xmm1
movss  -0x8(%rbp),%xmm2
subss  -0x4(%rbp),%xmm2
mulss  %xmm2,%xmm1
movss  0xe42(%rip),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x10(%rbp),%xmm0
cvtsi2ssl -0x34(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
subss  -0xc(%rbp),%xmm2
mulss  %xmm2,%xmm1
movss  0xe11(%rip),%xmm2
divss  %xmm2,%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x20(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
movss  -0x1c(%rbp),%xmm3
call   1040 <fxFloat@plt>
cvtsi2ss %rax,%xmm0
subss  -0x24(%rbp),%xmm0
cvttss2si %xmm0,%rdi
call   1030 <absFloat@plt>
movss  %xmm0,-0x28(%rbp)
movss  -0x28(%rbp),%xmm1
movss  -0x2c(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1266 <plotFunction+0x136>
mov    -0x30(%rbp),%edi
mov    -0x34(%rbp),%esi
mov    $0xff,%ecx
xor    %r8d,%r8d
mov    %ecx,%edx
call   1050 <sysPaintPixel@plt>
jmp    126b <plotFunction+0x13b>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11a5 <plotFunction+0x75>
jmp    127e <plotFunction+0x14e>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1191 <plotFunction+0x61>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plotFunction>:
push   %rbp
push   %rbx
sub    $0x28,%rsp
movss  %xmm6,0x1c(%rsp)
movss  %xmm5,0x18(%rsp)
movss  %xmm4,0x14(%rsp)
movss  %xmm0,(%rsp)
subss  %xmm0,%xmm1
movss  %xmm1,0x4(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
mulsd  0xe9a(%rip),%xmm0
divsd  0xe9a(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
movss  %xmm3,0x10(%rsp)
subss  %xmm2,%xmm3
movss  %xmm3,0x8(%rsp)
xor    %ebx,%ebx
jmp    119f <plotFunction+0x6f>
nopl   0x0(%rax)
add    $0x1,%ebx
cmp    $0x400,%ebx
je     125b <plotFunction+0x12b>
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
mulss  0x4(%rsp),%xmm0
mulss  0xe5c(%rip),%xmm0
addss  (%rsp),%xmm0
movss  %xmm0,0x20(%rsp)
xor    %ebp,%ebp
jmp    11db <plotFunction+0xab>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%ebp
cmp    $0x300,%ebp
je     1190 <plotFunction+0x60>
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
mulss  0x8(%rsp),%xmm0
divss  0xe24(%rip),%xmm0
movss  %xmm0,0x24(%rsp)
movss  0x20(%rsp),%xmm0
movss  0x14(%rsp),%xmm1
movss  0x18(%rsp),%xmm2
movss  0x1c(%rsp),%xmm3
call   1040 <fxFloat@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  0x24(%rsp),%xmm1
subss  0x10(%rsp),%xmm1
addss  %xmm0,%xmm1
cvttss2si %xmm1,%rdi
call   1030 <absFloat@plt>
movss  0xc(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jbe    11d0 <plotFunction+0xa0>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0xff,%edx
mov    $0xff,%ecx
xor    %r8d,%r8d
call   1050 <sysPaintPixel@plt>
jmp    11d0 <plotFunction+0xa0>
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @plotFunction(float %0, float %1, float %2, float %3, float %4, float %5, float %6) {
%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 i32
%20 = alloca i32
store float %0, float* %8
store float %1, float* %9
store float %2, float* %10
store float %3, float* %11
store float %4, float* %12
store float %5, float* %13
store float %6, float* %14
%21 = load float, float* %9
%22 = load float, float* %8
%23 = fsub float %21, %22
%24 = fpext float %23 to double
%25 = fmul double %24, 1.000000e-01
%26 = fdiv double %25, 2.000000e+01
%27 = fptrunc double %26 to float
store float %27, float* %18
store i32 0, i32* %19
br label %28
28: ; preds = %76, %7
%29 = load i32, i32* %19
%30 = icmp slt i32 %29, 1024
br i1 %30, label %31, label %79
31: ; preds = %28
store i32 0, i32* %20
br label %32
32: ; preds = %72, %31
%33 = load i32, i32* %20
%34 = icmp slt i32 %33, 768
br i1 %34, label %35, label %75
35: ; preds = %32
%36 = load float, float* %8
%37 = load i32, i32* %19
%38 = sitofp i32 %37 to float
%39 = load float, float* %9
%40 = load float, float* %8
%41 = fsub float %39, %40
%42 = fmul float %38, %41
%43 = fdiv float %42, 1.024000e+03
%44 = fadd float %36, %43
store float %44, float* %15
%45 = load float, float* %11
%46 = load i32, i32* %20
%47 = sitofp i32 %46 to float
%48 = load float, float* %11
%49 = load float, float* %10
%50 = fsub float %48, %49
%51 = fmul float %47, %50
%52 = fdiv float %51, 7.680000e+02
%53 = fsub float %45, %52
store float %53, float* %16
%54 = load float, float* %15
%55 = load float, float* %12
%56 = load float, float* %13
%57 = load float, float* %14
%58 = call i64 @fxFloat(float %54, float %55, float %56, float %57)
%59 = sitofp i64 %58 to float
%60 = load float, float* %16
%61 = fsub float %59, %60
%62 = fptosi float %61 to i64
%63 = call float @absFloat(i64 %62)
store float %63, float* %17
%64 = load float, float* %17
%65 = load float, float* %18
%66 = fcmp olt float %64, %65
br i1 %66, label %67, label %71
67: ; preds = %35
%68 = load i32, i32* %19
%69 = load i32, i32* %20
%70 = call i32 @sysPaintPixel(i32 %68, i32 %69, i32 255, i32 255, i32 0)
br label %71
71: ; preds = %67, %35
br label %72
72: ; preds = %71
%73 = load i32, i32* %20
%74 = add nsw i32 %73, 1
store i32 %74, i32* %20
br label %32
75: ; preds = %32
br label %76
76: ; preds = %75
%77 = load i32, i32* %19
%78 = add nsw i32 %77, 1
store i32 %78, i32* %19
br label %28
79: ; preds = %28
ret void
}

LLVM IR (-O2):
define void @plotFunction(float %0, float %1, float %2, float %3, float %4, float %5, float %6) {
%8 = fsub float %1, %0
%9 = fpext float %8 to double
%10 = fmul double %9, 1.000000e-01
%11 = fdiv double %10, 2.000000e+01
%12 = fptrunc double %11 to float
%13 = fsub float %3, %2
br label %14
14: ; preds = %7, %21
%15 = phi i32 [ 0, %7 ], [ %22, %21 ]
%16 = sitofp i32 %15 to float
%17 = fmul float %8, %16
%18 = fmul float %17, 0x3F50000000000000
%19 = fadd float %18, %0
br label %24
20: ; preds = %21
ret void
21: ; preds = %38
%22 = add nuw nsw i32 %15, 1
%23 = icmp eq i32 %22, 1024
br i1 %23, label %20, label %14
24: ; preds = %14, %38
%25 = phi i32 [ 0, %14 ], [ %39, %38 ]
%26 = sitofp i32 %25 to float
%27 = fmul float %13, %26
%28 = fdiv float %27, 7.680000e+02
%29 = tail call i64 @fxFloat(float %19, float %4, float %5, float %6)
%30 = sitofp i64 %29 to float
%31 = fsub float %28, %3
%32 = fadd float %31, %30
%33 = fptosi float %32 to i64
%34 = tail call float @absFloat(i64 %33)
%35 = fcmp olt float %34, %12
br i1 %35, label %36, label %38
36: ; preds = %24
%37 = tail call i32 @sysPaintPixel(i32 %15, i32 %25, i32 255, i32 255, i32 0)
br label %38
38: ; preds = %24, %36
%39 = add nuw nsw i32 %25, 1
%40 = icmp eq i32 %39, 768
br i1 %40, label %21, label %24
}