#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*/ addstr(char *);
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ move(float, float);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ sleep(int);
void drawThis(float e1, float e2, float ye1, float ye2) {
  float x1 = e1, y1 = ye1, x2 = e1, y2 = ye2;
  initscr();
  move(y1, x1);
  addstr("o");
  move(y2, x2);
  addstr("o");
  int i;
  float step = (y2 - y1) / (x2 - x1);
  if (x1 > x2) {
    for (i = 0; i >= (x2 - x1); i--) {
      move(y1 + (step * i), x1 + i);
      addstr("o");
    }
  } else {
    for (i = 0; i <= (x2 - x1); i++) {
      move(y1 + (step * i), x1 + i);
      addstr("o");
    }
  }
  refresh();
  sleep(3);
  endwin();
}


x86 assembly (clang, -O0):
<drawThis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
mov    $0x0,%al
call   1030 <initscr@plt>
movss  -0x18(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
call   1080 <move@plt>
lea    0xe3f(%rip),%rdi
call   1060 <addstr@plt>
movss  -0x20(%rbp),%xmm0
movss  -0x1c(%rbp),%xmm1
call   1080 <move@plt>
lea    0xe24(%rip),%rdi
call   1060 <addstr@plt>
movss  -0x20(%rbp),%xmm0
subss  -0x18(%rbp),%xmm0
movss  -0x1c(%rbp),%xmm1
subss  -0x14(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x14(%rbp),%xmm0
ucomiss -0x1c(%rbp),%xmm0
jbe    1275 <drawThis+0x115>
movl   $0x0,-0x24(%rbp)
cvtsi2ssl -0x24(%rbp),%xmm0
movss  -0x1c(%rbp),%xmm1
subss  -0x14(%rbp),%xmm1
ucomiss %xmm1,%xmm0
jb     1270 <drawThis+0x110>
movss  -0x18(%rbp),%xmm1
movss  -0x28(%rbp),%xmm0
cvtsi2ssl -0x24(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  -0x14(%rbp),%xmm1
cvtsi2ssl -0x24(%rbp),%xmm2
addss  %xmm2,%xmm1
call   1080 <move@plt>
lea    0xda3(%rip),%rdi
call   1060 <addstr@plt>
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    1214 <drawThis+0xb4>
jmp    12dd <drawThis+0x17d>
movl   $0x0,-0x24(%rbp)
cvtsi2ssl -0x24(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm0
subss  -0x14(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     12d8 <drawThis+0x178>
movss  -0x18(%rbp),%xmm1
movss  -0x28(%rbp),%xmm0
cvtsi2ssl -0x24(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  -0x14(%rbp),%xmm1
cvtsi2ssl -0x24(%rbp),%xmm2
addss  %xmm2,%xmm1
call   1080 <move@plt>
lea    0xd3b(%rip),%rdi
call   1060 <addstr@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    127c <drawThis+0x11c>
jmp    12dd <drawThis+0x17d>
mov    $0x0,%al
call   1040 <refresh@plt>
mov    $0x3,%edi
call   1070 <sleep@plt>
mov    $0x0,%al
call   1050 <endwin@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawThis>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
movss  %xmm3,0x8(%rsp)
movss  %xmm2,0x10(%rsp)
movss  %xmm0,0xc(%rsp)
xor    %eax,%eax
call   1030 <initscr@plt>
movss  0x10(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
call   1080 <move@plt>
lea    0xe69(%rip),%rbx
mov    %rbx,%rdi
call   1060 <addstr@plt>
movss  0x8(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
call   1080 <move@plt>
mov    %rbx,%rdi
call   1060 <addstr@plt>
movss  0xc(%rsp),%xmm2
movaps %xmm2,%xmm0
subss  %xmm2,%xmm0
xorps  %xmm1,%xmm1
movss  %xmm0,0x14(%rsp)
ucomiss %xmm1,%xmm0
jb     123c <drawThis+0xdc>
movss  0x8(%rsp),%xmm0
subss  0x10(%rsp),%xmm0
divss  0x14(%rsp),%xmm0
movss  %xmm0,0x8(%rsp)
mov    $0x1,%ebp
lea    0xe09(%rip),%rbx
nopw   0x0(%rax,%rax,1)
movss  0x8(%rsp),%xmm0
mulss  %xmm1,%xmm0
addss  0x10(%rsp),%xmm0
addss  %xmm2,%xmm1
call   1080 <move@plt>
mov    %rbx,%rdi
call   1060 <addstr@plt>
movss  0xc(%rsp),%xmm2
xorps  %xmm1,%xmm1
cvtsi2ss %ebp,%xmm1
add    $0x1,%ebp
movss  0x14(%rsp),%xmm0
ucomiss %xmm1,%xmm0
jae    1200 <drawThis+0xa0>
xor    %eax,%eax
call   1040 <refresh@plt>
mov    $0x3,%edi
call   1070 <sleep@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <endwin@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"o\00"
define void @drawThis(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 float
%13 = alloca i32
%14 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%15 = load float, float* %5
store float %15, float* %9
%16 = load float, float* %7
store float %16, float* %10
%17 = load float, float* %5
store float %17, float* %11
%18 = load float, float* %8
store float %18, float* %12
%19 = call i32 (...) @initscr()
%20 = load float, float* %10
%21 = load float, float* %9
%22 = call i32 @move(float %20, float %21)
%23 = call i32 @addstr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%24 = load float, float* %12
%25 = load float, float* %11
%26 = call i32 @move(float %24, float %25)
%27 = call i32 @addstr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%28 = load float, float* %12
%29 = load float, float* %10
%30 = fsub float %28, %29
%31 = load float, float* %11
%32 = load float, float* %9
%33 = fsub float %31, %32
%34 = fdiv float %30, %33
store float %34, float* %14
%35 = load float, float* %9
%36 = load float, float* %11
%37 = fcmp ogt float %35, %36
br i1 %37, label %38, label %62
38: ; preds = %4
store i32 0, i32* %13
br label %39
39: ; preds = %58, %38
%40 = load i32, i32* %13
%41 = sitofp i32 %40 to float
%42 = load float, float* %11
%43 = load float, float* %9
%44 = fsub float %42, %43
%45 = fcmp oge float %41, %44
br i1 %45, label %46, label %61
46: ; preds = %39
%47 = load float, float* %10
%48 = load float, float* %14
%49 = load i32, i32* %13
%50 = sitofp i32 %49 to float
%51 = call float @llvm.fmuladd.f32(float %48, float %50, float %47)
%52 = load float, float* %9
%53 = load i32, i32* %13
%54 = sitofp i32 %53 to float
%55 = fadd float %52, %54
%56 = call i32 @move(float %51, float %55)
%57 = call i32 @addstr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %58
58: ; preds = %46
%59 = load i32, i32* %13
%60 = add nsw i32 %59, -1
store i32 %60, i32* %13
br label %39
61: ; preds = %39
br label %86
62: ; preds = %4
store i32 0, i32* %13
br label %63
63: ; preds = %82, %62
%64 = load i32, i32* %13
%65 = sitofp i32 %64 to float
%66 = load float, float* %11
%67 = load float, float* %9
%68 = fsub float %66, %67
%69 = fcmp ole float %65, %68
br i1 %69, label %70, label %85
70: ; preds = %63
%71 = load float, float* %10
%72 = load float, float* %14
%73 = load i32, i32* %13
%74 = sitofp i32 %73 to float
%75 = call float @llvm.fmuladd.f32(float %72, float %74, float %71)
%76 = load float, float* %9
%77 = load i32, i32* %13
%78 = sitofp i32 %77 to float
%79 = fadd float %76, %78
%80 = call i32 @move(float %75, float %79)
%81 = call i32 @addstr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %82
82: ; preds = %70
%83 = load i32, i32* %13
%84 = add nsw i32 %83, 1
store i32 %84, i32* %13
br label %63
85: ; preds = %63
br label %86
86: ; preds = %85, %61
%87 = call i32 (...) @refresh()
%88 = call i32 @sleep(i32 3)
%89 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"o\00"
define void @drawThis(float %0, float %1, float %2, float %3) {
%5 = tail call i32 (...) @initscr()
%6 = tail call i32 @move(float %2, float %0)
%7 = tail call i32 @addstr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @move(float %3, float %0)
%9 = tail call i32 @addstr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = fsub float %3, %2
%11 = fsub float %0, %0
%12 = fdiv float %10, %11
%13 = fcmp ult float %11, 0.000000e+00
br i1 %13, label %24, label %14
14: ; preds = %4, %14
%15 = phi float [ %22, %14 ], [ 0.000000e+00, %4 ]
%16 = phi i32 [ %21, %14 ], [ 0, %4 ]
%17 = tail call float @llvm.fmuladd.f32(float %12, float %15, float %2)
%18 = fadd float %15, %0
%19 = tail call i32 @move(float %17, float %18)
%20 = tail call i32 @addstr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%21 = add nuw nsw i32 %16, 1
%22 = sitofp i32 %21 to float
%23 = fcmp ult float %11, %22
br i1 %23, label %24, label %14
24: ; preds = %14, %4
%25 = tail call i32 (...) @refresh()
%26 = tail call i32 @sleep(i32 3)
%27 = tail call i32 (...) @endwin()
ret void
}