#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*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glScalef(double, double, double);
int /*<<< orphan*/ glTranslatef(double, double, double);
int /*<<< orphan*/ renderQuadLine(int);
void renderQuad(int xSplines, int ySplines) {
  int i;
  glPushMatrix();
  glTranslatef(0.0, 0.5, 0.0);
  glScalef(1.0, 1.0 / ySplines, 1.0);
  for (i = 0; i < ySplines; ++i) {
    renderQuadLine(xSplines);
    glTranslatef(0.0, -1.0, 0.0);
  }
  glPopMatrix();
}


x86 assembly (clang, -O0):
<renderQuad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <glPushMatrix@plt>
xorps  %xmm2,%xmm2
movsd  0xe98(%rip),%xmm1
movaps %xmm2,%xmm0
call   1070 <glTranslatef@plt>
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xe7b(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  0xe6f(%rip),%xmm2
movaps %xmm2,%xmm0
call   1040 <glScalef@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11d5 <renderQuad+0x85>
mov    -0x4(%rbp),%edi
call   1060 <renderQuadLine@plt>
xorps  %xmm2,%xmm2
movsd  0xe51(%rip),%xmm1
movaps %xmm2,%xmm0
call   1070 <glTranslatef@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11a0 <renderQuad+0x50>
mov    $0x0,%al
call   1030 <glPopMatrix@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<renderQuad>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1050 <glPushMatrix@plt>
movsd  0xe9a(%rip),%xmm1
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
call   1070 <glTranslatef@plt>
xorps  %xmm2,%xmm2
cvtsi2sd %ebx,%xmm2
movsd  0xe88(%rip),%xmm0
movapd %xmm0,%xmm1
divsd  %xmm2,%xmm1
movapd %xmm0,%xmm2
call   1040 <glScalef@plt>
test   %ebx,%ebx
jle    11c1 <renderQuad+0x71>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebp,%edi
call   1060 <renderQuadLine@plt>
xorpd  %xmm0,%xmm0
xorpd  %xmm2,%xmm2
movsd  0xe59(%rip),%xmm1
call   1070 <glTranslatef@plt>
add    $0xffffffff,%ebx
jne    11a0 <renderQuad+0x50>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <glPopMatrix@plt>

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

LLVM IR (-O2):
define void @renderQuad(i32 %0, i32 %1) {
%3 = tail call i32 (...) @glPushMatrix()
%4 = tail call i32 @glTranslatef(double 0.000000e+00, double 5.000000e-01, double 0.000000e+00)
%5 = sitofp i32 %1 to double
%6 = fdiv double 1.000000e+00, %5
%7 = tail call i32 @glScalef(double 1.000000e+00, double %6, double 1.000000e+00)
%8 = icmp sgt i32 %1, 0
br i1 %8, label %9, label %15
9: ; preds = %2, %9
%10 = phi i32 [ %13, %9 ], [ 0, %2 ]
%11 = tail call i32 @renderQuadLine(i32 %0)
%12 = tail call i32 @glTranslatef(double 0.000000e+00, double -1.000000e+00, double 0.000000e+00)
%13 = add nuw nsw i32 %10, 1
%14 = icmp eq i32 %13, %1
br i1 %14, label %15, label %9
15: ; preds = %9, %2
%16 = tail call i32 (...) @glPopMatrix()
ret void
}