#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*/ GL_TRIANGLE_STRIP;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glVertex3f(double, double, double);
void renderQuadLine(int xSplines) {
  double stepX = 1.0 / xSplines;
  double x = -0.5;
  int i;
  glBegin(GL_TRIANGLE_STRIP);
  for (i = 0; i <= xSplines; ++i) {
    glVertex3f(x, 0.0, 0.0);
    glVertex3f(x, -1.0, 0.0);
    x += stepX;
  }
  glEnd();
}


x86 assembly (clang, -O0):
<renderQuadLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xec0(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xea7(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1050 <glBegin@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     11c1 <renderQuadLine+0x91>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm1
call   1030 <glVertex3f@plt>
movsd  -0x18(%rbp),%xmm0
movsd  0xe74(%rip),%xmm1
xorps  %xmm2,%xmm2
call   1030 <glVertex3f@plt>
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1173 <renderQuadLine+0x43>
mov    $0x0,%al
call   1040 <glEnd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<renderQuadLine>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
call   1050 <glBegin@plt>
test   %ebx,%ebx
js     11ab <renderQuadLine+0x7b>
cvtsi2sd %ebx,%xmm0
movsd  0xeab(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
add    $0x1,%ebx
movsd  0xe9e(%rip),%xmm0
nopw   0x0(%rax,%rax,1)
movsd  %xmm0,(%rsp)
xorpd  %xmm1,%xmm1
xorps  %xmm2,%xmm2
movsd  (%rsp),%xmm0
call   1030 <glVertex3f@plt>
xorps  %xmm2,%xmm2
movsd  (%rsp),%xmm0
movsd  0xe7a(%rip),%xmm1
call   1030 <glVertex3f@plt>
movsd  (%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0xffffffff,%ebx
jne    1170 <renderQuadLine+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <glEnd@plt>

LLVM IR (-O0):
@GL_TRIANGLE_STRIP = global i32 0
define void @renderQuadLine(i32 %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = sitofp i32 %6 to double
%8 = fdiv double 1.000000e+00, %7
store double %8, double* %3
store double -5.000000e-01, double* %4
%9 = load i32, i32* @GL_TRIANGLE_STRIP
%10 = call i32 @glBegin(i32 %9)
store i32 0, i32* %5
br label %11
11: ; preds = %23, %1
%12 = load i32, i32* %5
%13 = load i32, i32* %2
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %26
15: ; preds = %11
%16 = load double, double* %4
%17 = call i32 @glVertex3f(double %16, double 0.000000e+00, double 0.000000e+00)
%18 = load double, double* %4
%19 = call i32 @glVertex3f(double %18, double -1.000000e+00, double 0.000000e+00)
%20 = load double, double* %3
%21 = load double, double* %4
%22 = fadd double %21, %20
store double %22, double* %4
br label %23
23: ; preds = %15
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %11
26: ; preds = %11
%27 = call i32 (...) @glEnd()
ret void
}

LLVM IR (-O2):
@GL_TRIANGLE_STRIP = global i32 0
define void @renderQuadLine(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fdiv double 1.000000e+00, %2
%4 = load i32, i32* @GL_TRIANGLE_STRIP
%5 = tail call i32 @glBegin(i32 %4)
%6 = icmp slt i32 %0, 0
br i1 %6, label %15, label %7
7: ; preds = %1, %7
%8 = phi i32 [ %13, %7 ], [ 0, %1 ]
%9 = phi double [ %12, %7 ], [ -5.000000e-01, %1 ]
%10 = tail call i32 @glVertex3f(double %9, double 0.000000e+00, double 0.000000e+00)
%11 = tail call i32 @glVertex3f(double %9, double -1.000000e+00, double 0.000000e+00)
%12 = fadd double %3, %9
%13 = add nuw i32 %8, 1
%14 = icmp eq i32 %8, %0
br i1 %14, label %15, label %7
15: ; preds = %7, %1
%16 = tail call i32 (...) @glEnd()
ret void
}