#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 */
typedef int x1;
typedef int x0;

/* Variables and functions */
scalar_t__ fabs(float);
int /*<<< orphan*/ setPixel(int, int);
void drawLine(float x0, float y0, float x1, float y1) {
  float dx, dy;
  x0 = ((250 / 40.0) * (x0) + 250 / 2);
  x1 = ((250 / 40.0) * (x1) + 250 / 2);
  y0 = (250 / 2 - (250 / 40.0) * (y0));
  y1 = (250 / 2 - (250 / 40.0) * (y1));
  dx = x1 - x0;
  dy = y1 - y0;
  if (fabs(dx) >= fabs(dy)) {
    float dydx = dy / dx;
    int i, di, iend;
    if (dx > 0.0)
      di = 1;
    else {
      di = -1;
      dydx = -dydx;
    }
    i = (int)(x0 + 0.5);
    iend = (int)(x1 + 0.5);
    y0 += 0.5;
    while (i != iend) {
      setPixel(i, (int)y0);
      i += di;
      y0 += dydx;
    }
  } else {
    float dxdy = dx / dy;
    int j, dj, jend;
    if (dy > 0.0)
      dj = 1;
    else {
      dj = -1;
      dxdy = -dxdy;
    }
    j = (int)(y0 + 0.5);
    jend = (int)(y1 + 0.5);
    x0 += 0.5;
    while (j != jend) {
      setPixel((int)x0, j);
      j += dj;
      x0 += dxdy;
    }
  }
}


x86 assembly (clang, -O0):
<drawLine>:
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  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec3(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeaf(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe99(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe85(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe5f(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe5b(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe35(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe31(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
call   1040 <fabs@plt>
mov    %rax,-0x40(%rbp)
movss  -0x18(%rbp),%xmm0
call   1040 <fabs@plt>
mov    %rax,%rcx
mov    -0x40(%rbp),%rax
cmp    %rcx,%rax
jl     130a <drawLine+0x1ea>
movss  -0x18(%rbp),%xmm0
divss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    125b <drawLine+0x13b>
movl   $0x1,-0x24(%rbp)
jmp    1279 <drawLine+0x159>
movl   $0xffffffff,-0x24(%rbp)
movss  -0x1c(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd8e(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x20(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd72(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x28(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd56(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x28(%rbp),%eax
je     1305 <drawLine+0x1e5>
mov    -0x20(%rbp),%edi
cvttss2si -0x8(%rbp),%esi
call   1030 <setPixel@plt>
mov    -0x24(%rbp),%eax
add    -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
movss  -0x1c(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    12cf <drawLine+0x1af>
jmp    13ea <drawLine+0x2ca>
movss  -0x14(%rbp),%xmm0
divss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    133b <drawLine+0x21b>
movl   $0x1,-0x34(%rbp)
jmp    1359 <drawLine+0x239>
movl   $0xffffffff,-0x34(%rbp)
movss  -0x2c(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xcae(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x30(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xc92(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x38(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xc76(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x38(%rbp),%eax
je     13e5 <drawLine+0x2c5>
cvttss2si -0x4(%rbp),%edi
mov    -0x30(%rbp),%esi
call   1030 <setPixel@plt>
mov    -0x34(%rbp),%eax
add    -0x30(%rbp),%eax
mov    %eax,-0x30(%rbp)
movss  -0x2c(%rbp),%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    13af <drawLine+0x28f>
jmp    13ea <drawLine+0x2ca>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawLine>:
push   %rbp
push   %r14
push   %rbx
sub    $0x40,%rsp
unpcklps %xmm2,%xmm0
cvtps2pd %xmm0,%xmm0
mulpd  0xeca(%rip),%xmm0
movapd 0xed2(%rip),%xmm2
addpd  %xmm2,%xmm0
cvtpd2ps %xmm0,%xmm4
unpcklps %xmm3,%xmm1
cvtps2pd %xmm1,%xmm1
mulpd  0xecc(%rip),%xmm1
movapd %xmm4,%xmm0
addpd  %xmm2,%xmm1
cvtpd2ps %xmm1,%xmm1
shufps $0x55,%xmm4,%xmm0
movapd %xmm1,%xmm2
shufps $0x55,%xmm1,%xmm2
movaps %xmm4,0x20(%rsp)
subss  %xmm4,%xmm0
movaps %xmm1,0x10(%rsp)
subss  %xmm1,%xmm2
movaps %xmm2,(%rsp)
movaps %xmm0,0x30(%rsp)
call   1040 <fabs@plt>
mov    %rax,%rbx
movaps (%rsp),%xmm0
call   1040 <fabs@plt>
cmp    %rax,%rbx
jge    123a <drawLine+0x11a>
movaps 0x30(%rsp),%xmm1
movaps (%rsp),%xmm2
divss  %xmm2,%xmm1
xorps  %xmm0,%xmm0
xor    %eax,%eax
ucomiss %xmm0,%xmm2
seta   %cl
ja     11c2 <drawLine+0xa2>
xorps  0xe6e(%rip),%xmm1
movaps 0x10(%rsp),%xmm0
cvtps2pd %xmm0,%xmm0
addpd  0xe6e(%rip),%xmm0
cvttpd2dq %xmm0,%xmm0
movd   %xmm0,%ebx
pshufd $0x55,%xmm0,%xmm0
movd   %xmm0,%r14d
cmp    %r14d,%ebx
movaps 0x20(%rsp),%xmm0
je     12c4 <drawLine+0x1a4>
mov    %cl,%al
lea    (%rax,%rax,1),%ebp
add    $0xffffffff,%ebp
addss  0xe4e(%rip),%xmm0
movaps %xmm1,0x30(%rsp)
nopw   0x0(%rax,%rax,1)
movaps %xmm0,0x20(%rsp)
cvttss2si %xmm0,%edi
mov    %ebx,%esi
call   1030 <setPixel@plt>
movaps 0x30(%rsp),%xmm1
movaps 0x20(%rsp),%xmm0
add    %ebp,%ebx
addss  %xmm1,%xmm0
cmp    %ebx,%r14d
jne    1210 <drawLine+0xf0>
jmp    12c4 <drawLine+0x1a4>
movaps 0x30(%rsp),%xmm1
movaps (%rsp),%xmm2
divss  %xmm1,%xmm2
xorps  %xmm0,%xmm0
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %cl
movaps %xmm2,%xmm1
ja     125e <drawLine+0x13e>
xorps  0xdd2(%rip),%xmm1
movaps 0x20(%rsp),%xmm0
cvtps2pd %xmm0,%xmm0
addpd  0xdd2(%rip),%xmm0
cvttpd2dq %xmm0,%xmm0
movd   %xmm0,%ebx
pshufd $0x55,%xmm0,%xmm0
movd   %xmm0,%r14d
cmp    %r14d,%ebx
movaps 0x10(%rsp),%xmm0
je     12c4 <drawLine+0x1a4>
mov    %cl,%al
lea    (%rax,%rax,1),%ebp
add    $0xffffffff,%ebp
addss  0xdb6(%rip),%xmm0
movaps %xmm1,(%rsp)
xchg   %ax,%ax
movaps %xmm0,0x10(%rsp)
cvttss2si %xmm0,%esi
mov    %ebx,%edi
call   1030 <setPixel@plt>
movaps (%rsp),%xmm1
movaps 0x10(%rsp),%xmm0
add    %ebp,%ebx
addss  %xmm1,%xmm0
cmp    %ebx,%r14d
jne    12a0 <drawLine+0x180>
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @drawLine(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca float
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%19 = load float, float* %5
%20 = fpext float %19 to double
%21 = call double @llvm.fmuladd.f64(double 6.250000e+00, double %20, double 1.250000e+02)
%22 = fptrunc double %21 to float
store float %22, float* %5
%23 = load float, float* %7
%24 = fpext float %23 to double
%25 = call double @llvm.fmuladd.f64(double 6.250000e+00, double %24, double 1.250000e+02)
%26 = fptrunc double %25 to float
store float %26, float* %7
%27 = load float, float* %6
%28 = fpext float %27 to double
%29 = call double @llvm.fmuladd.f64(double -6.250000e+00, double %28, double 1.250000e+02)
%30 = fptrunc double %29 to float
store float %30, float* %6
%31 = load float, float* %8
%32 = fpext float %31 to double
%33 = call double @llvm.fmuladd.f64(double -6.250000e+00, double %32, double 1.250000e+02)
%34 = fptrunc double %33 to float
store float %34, float* %8
%35 = load float, float* %7
%36 = load float, float* %5
%37 = fsub float %35, %36
store float %37, float* %9
%38 = load float, float* %8
%39 = load float, float* %6
%40 = fsub float %38, %39
store float %40, float* %10
%41 = load float, float* %9
%42 = call i64 @fabs(float %41)
%43 = load float, float* %10
%44 = call i64 @fabs(float %43)
%45 = icmp sge i64 %42, %44
br i1 %45, label %46, label %86
46: ; preds = %4
%47 = load float, float* %10
%48 = load float, float* %9
%49 = fdiv float %47, %48
store float %49, float* %11
%50 = load float, float* %9
%51 = fpext float %50 to double
%52 = fcmp ogt double %51, 0.000000e+00
br i1 %52, label %53, label %54
53: ; preds = %46
store i32 1, i32* %13
br label %57
54: ; preds = %46
store i32 -1, i32* %13
%55 = load float, float* %11
%56 = fneg float %55
store float %56, float* %11
br label %57
57: ; preds = %54, %53
%58 = load float, float* %5
%59 = fpext float %58 to double
%60 = fadd double %59, 5.000000e-01
%61 = fptosi double %60 to i32
store i32 %61, i32* %12
%62 = load float, float* %7
%63 = fpext float %62 to double
%64 = fadd double %63, 5.000000e-01
%65 = fptosi double %64 to i32
store i32 %65, i32* %14
%66 = load float, float* %6
%67 = fpext float %66 to double
%68 = fadd double %67, 5.000000e-01
%69 = fptrunc double %68 to float
store float %69, float* %6
br label %70
70: ; preds = %74, %57
%71 = load i32, i32* %12
%72 = load i32, i32* %14
%73 = icmp ne i32 %71, %72
br i1 %73, label %74, label %85
74: ; preds = %70
%75 = load i32, i32* %12
%76 = load float, float* %6
%77 = fptosi float %76 to i32
%78 = call i32 @setPixel(i32 %75, i32 %77)
%79 = load i32, i32* %13
%80 = load i32, i32* %12
%81 = add nsw i32 %80, %79
store i32 %81, i32* %12
%82 = load float, float* %11
%83 = load float, float* %6
%84 = fadd float %83, %82
store float %84, float* %6
br label %70
85: ; preds = %70
br label %126
86: ; preds = %4
%87 = load float, float* %9
%88 = load float, float* %10
%89 = fdiv float %87, %88
store float %89, float* %15
%90 = load float, float* %10
%91 = fpext float %90 to double
%92 = fcmp ogt double %91, 0.000000e+00
br i1 %92, label %93, label %94
93: ; preds = %86
store i32 1, i32* %17
br label %97
94: ; preds = %86
store i32 -1, i32* %17
%95 = load float, float* %15
%96 = fneg float %95
store float %96, float* %15
br label %97
97: ; preds = %94, %93
%98 = load float, float* %6
%99 = fpext float %98 to double
%100 = fadd double %99, 5.000000e-01
%101 = fptosi double %100 to i32
store i32 %101, i32* %16
%102 = load float, float* %8
%103 = fpext float %102 to double
%104 = fadd double %103, 5.000000e-01
%105 = fptosi double %104 to i32
store i32 %105, i32* %18
%106 = load float, float* %5
%107 = fpext float %106 to double
%108 = fadd double %107, 5.000000e-01
%109 = fptrunc double %108 to float
store float %109, float* %5
br label %110
110: ; preds = %114, %97
%111 = load i32, i32* %16
%112 = load i32, i32* %18
%113 = icmp ne i32 %111, %112
br i1 %113, label %114, label %125
114: ; preds = %110
%115 = load float, float* %5
%116 = fptosi float %115 to i32
%117 = load i32, i32* %16
%118 = call i32 @setPixel(i32 %116, i32 %117)
%119 = load i32, i32* %17
%120 = load i32, i32* %16
%121 = add nsw i32 %120, %119
store i32 %121, i32* %16
%122 = load float, float* %15
%123 = load float, float* %5
%124 = fadd float %123, %122
store float %124, float* %5
br label %110
125: ; preds = %110
br label %126
126: ; preds = %125, %85
ret void
}

LLVM IR (-O2):
define void @drawLine(float %0, float %1, float %2, float %3) {
%5 = insertelement <2 x float> poison, float %0, i64 0
%6 = insertelement <2 x float> %5, float %2, i64 1
%7 = fpext <2 x float> %6 to <2 x double>
%8 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %7, <2 x double> <double 6.250000e+00, double 6.250000e+00>, <2 x double> <double 1.250000e+02, double 1.250000e+02>)
%9 = fptrunc <2 x double> %8 to <2 x float>
%10 = insertelement <2 x float> poison, float %1, i64 0
%11 = insertelement <2 x float> %10, float %3, i64 1
%12 = fpext <2 x float> %11 to <2 x double>
%13 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %12, <2 x double> <double -6.250000e+00, double -6.250000e+00>, <2 x double> <double 1.250000e+02, double 1.250000e+02>)
%14 = fptrunc <2 x double> %13 to <2 x float>
%15 = extractelement <2 x float> %9, i64 0
%16 = shufflevector <2 x float> %9, <2 x float> poison, <2 x i32> <i32 1, i32 undef>
%17 = fsub <2 x float> %16, %9
%18 = extractelement <2 x float> %17, i64 0
%19 = extractelement <2 x float> %14, i64 0
%20 = shufflevector <2 x float> %14, <2 x float> poison, <2 x i32> <i32 1, i32 undef>
%21 = fsub <2 x float> %20, %14
%22 = extractelement <2 x float> %21, i64 0
%23 = tail call i64 @fabs(float %18)
%24 = tail call i64 @fabs(float %22)
%25 = icmp slt i64 %23, %24
br i1 %25, label %48, label %26
26: ; preds = %4
%27 = fdiv float %22, %18
%28 = fcmp ogt float %18, 0.000000e+00
%29 = fneg float %27
%30 = select i1 %28, float %27, float %29
%31 = select i1 %28, i32 1, i32 -1
%32 = fpext <2 x float> %9 to <2 x double>
%33 = fadd <2 x double> %32, <double 5.000000e-01, double 5.000000e-01>
%34 = fptosi <2 x double> %33 to <2 x i32>
%35 = extractelement <2 x i32> %34, i64 0
%36 = extractelement <2 x i32> %34, i64 1
%37 = icmp eq i32 %35, %36
br i1 %37, label %70, label %38
38: ; preds = %26
%39 = fadd float %19, 5.000000e-01
br label %40
40: ; preds = %38, %40
%41 = phi float [ %46, %40 ], [ %39, %38 ]
%42 = phi i32 [ %45, %40 ], [ %35, %38 ]
%43 = fptosi float %41 to i32
%44 = tail call i32 @setPixel(i32 %42, i32 %43)
%45 = add nsw i32 %42, %31
%46 = fadd float %30, %41
%47 = icmp eq i32 %45, %36
br i1 %47, label %70, label %40
48: ; preds = %4
%49 = fdiv float %18, %22
%50 = fcmp ogt float %22, 0.000000e+00
%51 = fneg float %49
%52 = select i1 %50, float %49, float %51
%53 = select i1 %50, i32 1, i32 -1
%54 = fpext <2 x float> %14 to <2 x double>
%55 = fadd <2 x double> %54, <double 5.000000e-01, double 5.000000e-01>
%56 = fptosi <2 x double> %55 to <2 x i32>
%57 = extractelement <2 x i32> %56, i64 0
%58 = extractelement <2 x i32> %56, i64 1
%59 = icmp eq i32 %57, %58
br i1 %59, label %70, label %60
60: ; preds = %48
%61 = fadd float %15, 5.000000e-01
br label %62
62: ; preds = %60, %62
%63 = phi float [ %68, %62 ], [ %61, %60 ]
%64 = phi i32 [ %67, %62 ], [ %57, %60 ]
%65 = fptosi float %63 to i32
%66 = tail call i32 @setPixel(i32 %65, i32 %64)
%67 = add nsw i32 %64, %53
%68 = fadd float %52, %63
%69 = icmp eq i32 %67, %58
br i1 %69, label %70, label %62
70: ; preds = %40, %62, %26, %48
ret void
}