#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 double GLfloat;

/* Variables and functions */
int /*<<< orphan*/ GL_LINES;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glColor3f(double, double, double);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glVertex3f(double, double, double);
void drawAxes(GLfloat length) {
  glColor3f(0.5, 0.5, 0.5);
  glBegin(GL_LINES);
  glVertex3f(0.0, 0.0, 0.0);
  glVertex3f(0.0, length, 0.0);
  glVertex3f(0.0, 0.0, 0.0);
  glVertex3f(0.0, 0.0, length);
  glVertex3f(0.0, 0.0, 0.0);
  glVertex3f(length, 0.0, 0.0);
  glEnd();
}


x86 assembly (clang, -O0):
<drawAxes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeab(%rip),%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1050 <glColor3f@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1060 <glBegin@plt>
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1030 <glVertex3f@plt>
movsd  -0x8(%rbp),%xmm1
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm0
call   1030 <glVertex3f@plt>
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1030 <glVertex3f@plt>
movsd  -0x8(%rbp),%xmm2
xorps  %xmm1,%xmm1
movaps %xmm1,%xmm0
call   1030 <glVertex3f@plt>
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1030 <glVertex3f@plt>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm1
call   1030 <glVertex3f@plt>
mov    $0x0,%al
call   1040 <glEnd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawAxes>:
push   %rax
movsd  %xmm0,(%rsp)
movsd  0xeb2(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1050 <glColor3f@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1060 <glBegin@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1030 <glVertex3f@plt>
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
movsd  (%rsp),%xmm1
call   1030 <glVertex3f@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1030 <glVertex3f@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
movsd  (%rsp),%xmm2
call   1030 <glVertex3f@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1030 <glVertex3f@plt>
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
movsd  (%rsp),%xmm0
call   1030 <glVertex3f@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glEnd@plt>

LLVM IR (-O0):
@GL_LINES = global i32 0
define void @drawAxes(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 @glColor3f(double 5.000000e-01, double 5.000000e-01, double 5.000000e-01)
%4 = load i32, i32* @GL_LINES
%5 = call i32 @glBegin(i32 %4)
%6 = call i32 @glVertex3f(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%7 = load double, double* %2
%8 = call i32 @glVertex3f(double 0.000000e+00, double %7, double 0.000000e+00)
%9 = call i32 @glVertex3f(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%10 = load double, double* %2
%11 = call i32 @glVertex3f(double 0.000000e+00, double 0.000000e+00, double %10)
%12 = call i32 @glVertex3f(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%13 = load double, double* %2
%14 = call i32 @glVertex3f(double %13, double 0.000000e+00, double 0.000000e+00)
%15 = call i32 (...) @glEnd()
ret void
}

LLVM IR (-O2):
@GL_LINES = global i32 0
define void @drawAxes(double %0) {
%2 = tail call i32 @glColor3f(double 5.000000e-01, double 5.000000e-01, double 5.000000e-01)
%3 = load i32, i32* @GL_LINES
%4 = tail call i32 @glBegin(i32 %3)
%5 = tail call i32 @glVertex3f(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%6 = tail call i32 @glVertex3f(double 0.000000e+00, double %0, double 0.000000e+00)
%7 = tail call i32 @glVertex3f(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%8 = tail call i32 @glVertex3f(double 0.000000e+00, double 0.000000e+00, double %0)
%9 = tail call i32 @glVertex3f(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%10 = tail call i32 @glVertex3f(double %0, double 0.000000e+00, double 0.000000e+00)
%11 = tail call i32 (...) @glEnd()
ret void
}