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

/* Variables and functions */
int /*<<< orphan*/ GL_QUADS;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glColor4f(double, double, double, double);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glVertex3f(int, int, double);
void drawPlanes(GLfloat halfLength) {
  glColor4f(0.3, 0.3, 0.3, 0.5);
  GLfloat l = halfLength * 2;
  glBegin(GL_QUADS);
  glVertex3f(l, l, 0.0);
  glVertex3f(l, -l, 0.0);
  glVertex3f(-l, -l, 0.0);
  glVertex3f(-l, l, 0.0);
  glEnd();
}


x86 assembly (clang, -O0):
<drawPlanes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movsd  0xead(%rip),%xmm2
movsd  0xead(%rip),%xmm3
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1030 <glColor4f@plt>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1060 <glBegin@plt>
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%esi
xorps  %xmm0,%xmm0
call   1040 <glVertex3f@plt>
mov    -0x8(%rbp),%edi
xor    %esi,%esi
sub    -0x8(%rbp),%esi
xorps  %xmm0,%xmm0
call   1040 <glVertex3f@plt>
xor    %edi,%edi
sub    -0x8(%rbp),%edi
xor    %esi,%esi
sub    -0x8(%rbp),%esi
xorps  %xmm0,%xmm0
call   1040 <glVertex3f@plt>
xor    %edi,%edi
sub    -0x8(%rbp),%edi
mov    -0x8(%rbp),%esi
xorps  %xmm0,%xmm0
call   1040 <glVertex3f@plt>
mov    $0x0,%al
call   1050 <glEnd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawPlanes>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
movsd  0xeb3(%rip),%xmm0
movsd  0xeb3(%rip),%xmm3
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1030 <glColor4f@plt>
add    %ebx,%ebx
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1060 <glBegin@plt>
xorps  %xmm0,%xmm0
mov    %ebx,%edi
mov    %ebx,%esi
call   1040 <glVertex3f@plt>
mov    %ebx,%ebp
neg    %ebp
xorps  %xmm0,%xmm0
mov    %ebx,%edi
mov    %ebp,%esi
call   1040 <glVertex3f@plt>
xorps  %xmm0,%xmm0
mov    %ebp,%edi
mov    %ebp,%esi
call   1040 <glVertex3f@plt>
xorps  %xmm0,%xmm0
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <glVertex3f@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <glEnd@plt>

LLVM IR (-O0):
@GL_QUADS = global i32 0
define void @drawPlanes(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @glColor4f(double 3.000000e-01, double 3.000000e-01, double 3.000000e-01, double 5.000000e-01)
%5 = load i32, i32* %2
%6 = mul nsw i32 %5, 2
store i32 %6, i32* %3
%7 = load i32, i32* @GL_QUADS
%8 = call i32 @glBegin(i32 %7)
%9 = load i32, i32* %3
%10 = load i32, i32* %3
%11 = call i32 @glVertex3f(i32 %9, i32 %10, double 0.000000e+00)
%12 = load i32, i32* %3
%13 = load i32, i32* %3
%14 = sub nsw i32 0, %13
%15 = call i32 @glVertex3f(i32 %12, i32 %14, double 0.000000e+00)
%16 = load i32, i32* %3
%17 = sub nsw i32 0, %16
%18 = load i32, i32* %3
%19 = sub nsw i32 0, %18
%20 = call i32 @glVertex3f(i32 %17, i32 %19, double 0.000000e+00)
%21 = load i32, i32* %3
%22 = sub nsw i32 0, %21
%23 = load i32, i32* %3
%24 = call i32 @glVertex3f(i32 %22, i32 %23, double 0.000000e+00)
%25 = call i32 (...) @glEnd()
ret void
}

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