#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_LINES;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glColor3f(double, double, double);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glVertex3f(double, double, float);
void axis(float size) {
  glBegin(GL_LINES);
  glColor3f(1.0, 0.0, 0.0);
  glVertex3f(-size, 0.0, 0.0);
  glVertex3f(size, 0.0, 0.0);
  glColor3f(0.0, 1.0, 0.0);
  glVertex3f(0.0, -size, 0.0);
  glVertex3f(0.0, size, 0.0);
  glColor3f(0.0, 0.0, 1.0);
  glVertex3f(0.0, 0.0, -size);
  glVertex3f(0.0, 0.0, size);
  glEnd();
}


x86 assembly (clang, -O0):
<axis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1060 <glBegin@plt>
movsd  0xe9d(%rip),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm1
call   1050 <glColor3f@plt>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1030 <glVertex3f@plt>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1030 <glVertex3f@plt>
xorps  %xmm2,%xmm2
movsd  0xe52(%rip),%xmm1
movaps %xmm2,%xmm0
call   1050 <glColor3f@plt>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
call   1030 <glVertex3f@plt>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
call   1030 <glVertex3f@plt>
xorps  %xmm1,%xmm1
movsd  0xe0a(%rip),%xmm2
movaps %xmm1,%xmm0
call   1050 <glColor3f@plt>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm2
xorps  %xmm1,%xmm1
movaps %xmm1,%xmm0
call   1030 <glVertex3f@plt>
movss  -0x4(%rbp),%xmm2
xorps  %xmm1,%xmm1
movaps %xmm1,%xmm0
call   1030 <glVertex3f@plt>
mov    $0x0,%al
call   1040 <glEnd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<axis>:
sub    $0x38,%rsp
movaps %xmm0,(%rsp)
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
call   1060 <glBegin@plt>
movsd  0xea2(%rip),%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1050 <glColor3f@plt>
movaps 0xea0(%rip),%xmm0
xorps  (%rsp),%xmm0
movaps %xmm0,0x20(%rsp)
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x18(%rsp)
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1030 <glVertex3f@plt>
movaps (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1030 <glVertex3f@plt>
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
movsd  0xe4b(%rip),%xmm1
call   1050 <glColor3f@plt>
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
movsd  0x18(%rsp),%xmm1
call   1030 <glVertex3f@plt>
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
movsd  0x10(%rsp),%xmm1
call   1030 <glVertex3f@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
movsd  0xe16(%rip),%xmm2
call   1050 <glColor3f@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
movaps 0x20(%rsp),%xmm2
call   1030 <glVertex3f@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
movaps (%rsp),%xmm2
call   1030 <glVertex3f@plt>
xor    %eax,%eax
add    $0x38,%rsp
jmp    1040 <glEnd@plt>

LLVM IR (-O0):
@GL_LINES = global i32 0
define void @axis(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load i32, i32* @GL_LINES
%4 = call i32 @glBegin(i32 %3)
%5 = call i32 @glColor3f(double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%6 = load float, float* %2
%7 = fneg float %6
%8 = fpext float %7 to double
%9 = call i32 @glVertex3f(double %8, double 0.000000e+00, float 0.000000e+00)
%10 = load float, float* %2
%11 = fpext float %10 to double
%12 = call i32 @glVertex3f(double %11, double 0.000000e+00, float 0.000000e+00)
%13 = call i32 @glColor3f(double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%14 = load float, float* %2
%15 = fneg float %14
%16 = fpext float %15 to double
%17 = call i32 @glVertex3f(double 0.000000e+00, double %16, float 0.000000e+00)
%18 = load float, float* %2
%19 = fpext float %18 to double
%20 = call i32 @glVertex3f(double 0.000000e+00, double %19, float 0.000000e+00)
%21 = call i32 @glColor3f(double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%22 = load float, float* %2
%23 = fneg float %22
%24 = call i32 @glVertex3f(double 0.000000e+00, double 0.000000e+00, float %23)
%25 = load float, float* %2
%26 = call i32 @glVertex3f(double 0.000000e+00, double 0.000000e+00, float %25)
%27 = call i32 (...) @glEnd()
ret void
}

LLVM IR (-O2):
@GL_LINES = global i32 0
define void @axis(float %0) {
%2 = load i32, i32* @GL_LINES
%3 = tail call i32 @glBegin(i32 %2)
%4 = tail call i32 @glColor3f(double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%5 = fneg float %0
%6 = fpext float %5 to double
%7 = tail call i32 @glVertex3f(double %6, double 0.000000e+00, float 0.000000e+00)
%8 = fpext float %0 to double
%9 = tail call i32 @glVertex3f(double %8, double 0.000000e+00, float 0.000000e+00)
%10 = tail call i32 @glColor3f(double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%11 = tail call i32 @glVertex3f(double 0.000000e+00, double %6, float 0.000000e+00)
%12 = tail call i32 @glVertex3f(double 0.000000e+00, double %8, float 0.000000e+00)
%13 = tail call i32 @glColor3f(double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%14 = tail call i32 @glVertex3f(double 0.000000e+00, double 0.000000e+00, float %5)
%15 = tail call i32 @glVertex3f(double 0.000000e+00, double 0.000000e+00, float %0)
%16 = tail call i32 (...) @glEnd()
ret void
}