#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(void) {
  GLfloat p[3][6] = {{1.0, 0.0, 0.0, 3.0, 0.0, 0.0},
                     {0.0, 1.0, 0.0, 0.0, 3.0, 0.0},
                     {0.0, 0.0, 1.0, 0.0, 0.0, 3.0}};
  for (int i = 0; i < 3; i++) {
    glBegin(GL_LINES);
    glColor3f(1.0, 1.0, 1.0);
    glVertex3f(0.0, 0.0, 0.0);
    glColor3f(p[i][0], p[i][1], p[i][2]);
    glVertex3f(p[i][3], p[i][4], p[i][5]);
    glEnd();
  }
}


x86 assembly (clang, -O0):
<drawAxes>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x90,%edx
call   1040 <memset@plt>
movsd  0xe92(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  0xe7a(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0xe75(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xe60(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe5b(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe46(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movl   $0x0,-0x94(%rbp)
cmpl   $0x3,-0x94(%rbp)
jge    12c5 <drawAxes+0x175>
mov    0x2e13(%rip),%rax
mov    (%rax),%edi
call   1070 <glBegin@plt>
movsd  0xe1c(%rip),%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1060 <glColor3f@plt>
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1030 <glVertex3f@plt>
movslq -0x94(%rbp),%rcx
lea    -0x90(%rbp),%rax
imul   $0x30,%rcx,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm0
movslq -0x94(%rbp),%rcx
lea    -0x90(%rbp),%rax
imul   $0x30,%rcx,%rcx
add    %rcx,%rax
movsd  0x8(%rax),%xmm1
movslq -0x94(%rbp),%rcx
lea    -0x90(%rbp),%rax
imul   $0x30,%rcx,%rcx
add    %rcx,%rax
movsd  0x10(%rax),%xmm2
call   1060 <glColor3f@plt>
movslq -0x94(%rbp),%rcx
lea    -0x90(%rbp),%rax
imul   $0x30,%rcx,%rcx
add    %rcx,%rax
movsd  0x18(%rax),%xmm0
movslq -0x94(%rbp),%rcx
lea    -0x90(%rbp),%rax
imul   $0x30,%rcx,%rcx
add    %rcx,%rax
movsd  0x20(%rax),%xmm1
movslq -0x94(%rbp),%rcx
lea    -0x90(%rbp),%rax
imul   $0x30,%rcx,%rcx
add    %rcx,%rax
movsd  0x28(%rax),%xmm2
call   1030 <glVertex3f@plt>
mov    $0x0,%al
call   1050 <glEnd@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    11c9 <drawAxes+0x79>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawAxes>:
push   %rbx
mov    0x2ea8(%rip),%rbx
mov    (%rbx),%edi
call   1060 <glBegin@plt>
movsd  0xea9(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1050 <glColor3f@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1030 <glVertex3f@plt>
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
movsd  0xe82(%rip),%xmm0
call   1050 <glColor3f@plt>
movsd  0xe7d(%rip),%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1030 <glVertex3f@plt>
xor    %eax,%eax
call   1040 <glEnd@plt>
mov    (%rbx),%edi
call   1060 <glBegin@plt>
movsd  0xe54(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1050 <glColor3f@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1030 <glVertex3f@plt>
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
movsd  0xe2d(%rip),%xmm1
call   1050 <glColor3f@plt>
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
movsd  0xe22(%rip),%xmm1
call   1030 <glVertex3f@plt>
xor    %eax,%eax
call   1040 <glEnd@plt>
mov    (%rbx),%edi
call   1060 <glBegin@plt>
movsd  0xdff(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1050 <glColor3f@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1030 <glVertex3f@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
movsd  0xdd8(%rip),%xmm2
call   1050 <glColor3f@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
movsd  0xdcd(%rip),%xmm2
call   1030 <glVertex3f@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <glEnd@plt>

LLVM IR (-O0):
@GL_LINES = global i32 0
define void @drawAxes() {
%1 = alloca [3 x [6 x double]]
%2 = alloca i32
%3 = bitcast [3 x [6 x double]]* %1 to i8*
%4 = bitcast i8* %3 to [3 x [6 x double]]*
%5 = getelementptr inbounds [3 x [6 x double]], [3 x [6 x double]]* %4, i32 0, i32 0
%6 = getelementptr inbounds [6 x double], [6 x double]* %5, i32 0, i32 0
store double 1.000000e+00, double* %6
%7 = getelementptr inbounds [6 x double], [6 x double]* %5, i32 0, i32 3
store double 3.000000e+00, double* %7
%8 = getelementptr inbounds [3 x [6 x double]], [3 x [6 x double]]* %4, i32 0, i32 1
%9 = getelementptr inbounds [6 x double], [6 x double]* %8, i32 0, i32 1
store double 1.000000e+00, double* %9
%10 = getelementptr inbounds [6 x double], [6 x double]* %8, i32 0, i32 4
store double 3.000000e+00, double* %10
%11 = getelementptr inbounds [3 x [6 x double]], [3 x [6 x double]]* %4, i32 0, i32 2
%12 = getelementptr inbounds [6 x double], [6 x double]* %11, i32 0, i32 2
store double 1.000000e+00, double* %12
%13 = getelementptr inbounds [6 x double], [6 x double]* %11, i32 0, i32 5
store double 3.000000e+00, double* %13
store i32 0, i32* %2
br label %14
14: ; preds = %55, %0
%15 = load i32, i32* %2
%16 = icmp slt i32 %15, 3
br i1 %16, label %17, label %58
17: ; preds = %14
%18 = load i32, i32* @GL_LINES
%19 = call i32 @glBegin(i32 %18)
%20 = call i32 @glColor3f(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
%21 = call i32 @glVertex3f(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%22 = load i32, i32* %2
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [3 x [6 x double]], [3 x [6 x double]]* %1, i64 0, i64 %23
%25 = getelementptr inbounds [6 x double], [6 x double]* %24, i64 0, i64 0
%26 = load double, double* %25
%27 = load i32, i32* %2
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [3 x [6 x double]], [3 x [6 x double]]* %1, i64 0, i64 %28
%30 = getelementptr inbounds [6 x double], [6 x double]* %29, i64 0, i64 1
%31 = load double, double* %30
%32 = load i32, i32* %2
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [3 x [6 x double]], [3 x [6 x double]]* %1, i64 0, i64 %33
%35 = getelementptr inbounds [6 x double], [6 x double]* %34, i64 0, i64 2
%36 = load double, double* %35
%37 = call i32 @glColor3f(double %26, double %31, double %36)
%38 = load i32, i32* %2
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [3 x [6 x double]], [3 x [6 x double]]* %1, i64 0, i64 %39
%41 = getelementptr inbounds [6 x double], [6 x double]* %40, i64 0, i64 3
%42 = load double, double* %41
%43 = load i32, i32* %2
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [3 x [6 x double]], [3 x [6 x double]]* %1, i64 0, i64 %44
%46 = getelementptr inbounds [6 x double], [6 x double]* %45, i64 0, i64 4
%47 = load double, double* %46
%48 = load i32, i32* %2
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [3 x [6 x double]], [3 x [6 x double]]* %1, i64 0, i64 %49
%51 = getelementptr inbounds [6 x double], [6 x double]* %50, i64 0, i64 5
%52 = load double, double* %51
%53 = call i32 @glVertex3f(double %42, double %47, double %52)
%54 = call i32 (...) @glEnd()
br label %55
55: ; preds = %17
%56 = load i32, i32* %2
%57 = add nsw i32 %56, 1
store i32 %57, i32* %2
br label %14
58: ; preds = %14
ret void
}

LLVM IR (-O2):
@GL_LINES = global i32 0
define void @drawAxes() {
%1 = load i32, i32* @GL_LINES
%2 = tail call i32 @glBegin(i32 %1)
%3 = tail call i32 @glColor3f(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
%4 = tail call i32 @glVertex3f(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%5 = tail call i32 @glColor3f(double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%6 = tail call i32 @glVertex3f(double 3.000000e+00, double 0.000000e+00, double 0.000000e+00)
%7 = tail call i32 (...) @glEnd()
%8 = load i32, i32* @GL_LINES
%9 = tail call i32 @glBegin(i32 %8)
%10 = tail call i32 @glColor3f(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
%11 = tail call i32 @glVertex3f(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%12 = tail call i32 @glColor3f(double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%13 = tail call i32 @glVertex3f(double 0.000000e+00, double 3.000000e+00, double 0.000000e+00)
%14 = tail call i32 (...) @glEnd()
%15 = load i32, i32* @GL_LINES
%16 = tail call i32 @glBegin(i32 %15)
%17 = tail call i32 @glColor3f(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
%18 = tail call i32 @glVertex3f(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%19 = tail call i32 @glColor3f(double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%20 = tail call i32 @glVertex3f(double 0.000000e+00, double 0.000000e+00, double 3.000000e+00)
%21 = tail call i32 (...) @glEnd()
ret void
}