#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_QUADS;
int /*<<< orphan*/ GL_QUAD_STRIP;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glNormal3d(double, double, double);
int /*<<< orphan*/ glVertex3d(double, double, double);
void cuboid(double a, double b, double c) {
  glBegin(GL_QUADS);
  glNormal3d(0.0, 0.0, -1.0);
  glVertex3d(0.0, 0.0, 0.0);
  glVertex3d(0.0, b, 0.0);
  glVertex3d(a, b, 0.0);
  glVertex3d(a, 0.0, 0.0);
  glNormal3d(0.0, 0.0, 1.0);
  glVertex3d(0.0, 0.0, c);
  glVertex3d(a, 0.0, c);
  glVertex3d(a, b, c);
  glVertex3d(0.0, b, c);
  glEnd();
  glBegin(GL_QUAD_STRIP);
  glNormal3d(0.0, -1.0, 0.0);
  glVertex3d(0.0, 0.0, c);
  glVertex3d(0.0, 0.0, 0.0);
  glVertex3d(a, 0.0, c);
  glVertex3d(a, 0.0, 0.0);
  glNormal3d(1.0, 0.0, 0.0);
  glVertex3d(a, b, c);
  glVertex3d(a, b, 0.0);
  glNormal3d(0.0, 1.0, 0.0);
  glVertex3d(0.0, b, c);
  glVertex3d(0.0, b, 0.0);
  glNormal3d(-1.0, 0.0, 0.0);
  glVertex3d(0.0, 0.0, c);
  glVertex3d(0.0, 0.0, 0.0);
  glEnd();
}


x86 assembly (clang, -O0):
<cuboid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1060 <glBegin@plt>
xorps  %xmm1,%xmm1
movsd  0xe90(%rip),%xmm2
movaps %xmm1,%xmm0
call   1030 <glNormal3d@plt>
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1040 <glVertex3d@plt>
movsd  -0x10(%rbp),%xmm1
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm0
call   1040 <glVertex3d@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
xorps  %xmm2,%xmm2
call   1040 <glVertex3d@plt>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm1
call   1040 <glVertex3d@plt>
xorps  %xmm1,%xmm1
movsd  0xe45(%rip),%xmm2
movaps %xmm1,%xmm0
call   1030 <glNormal3d@plt>
movsd  -0x18(%rbp),%xmm2
xorps  %xmm1,%xmm1
movaps %xmm1,%xmm0
call   1040 <glVertex3d@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
xorps  %xmm1,%xmm1
call   1040 <glVertex3d@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1040 <glVertex3d@plt>
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
xorps  %xmm0,%xmm0
call   1040 <glVertex3d@plt>
mov    $0x0,%al
call   1050 <glEnd@plt>
mov    0x2dbf(%rip),%rax
mov    (%rax),%edi
call   1060 <glBegin@plt>
xorps  %xmm2,%xmm2
movsd  0xdcd(%rip),%xmm1
movaps %xmm2,%xmm0
call   1030 <glNormal3d@plt>
movsd  -0x18(%rbp),%xmm2
xorps  %xmm1,%xmm1
movaps %xmm1,%xmm0
call   1040 <glVertex3d@plt>
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1040 <glVertex3d@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
xorps  %xmm1,%xmm1
call   1040 <glVertex3d@plt>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm1
call   1040 <glVertex3d@plt>
movsd  0xd85(%rip),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm1
call   1030 <glNormal3d@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1040 <glVertex3d@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
xorps  %xmm2,%xmm2
call   1040 <glVertex3d@plt>
xorps  %xmm2,%xmm2
movsd  0xd49(%rip),%xmm1
movaps %xmm2,%xmm0
call   1030 <glNormal3d@plt>
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
xorps  %xmm0,%xmm0
call   1040 <glVertex3d@plt>
movsd  -0x10(%rbp),%xmm1
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm0
call   1040 <glVertex3d@plt>
movsd  0xd0f(%rip),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm1
call   1030 <glNormal3d@plt>
movsd  -0x18(%rbp),%xmm2
xorps  %xmm1,%xmm1
movaps %xmm1,%xmm0
call   1040 <glVertex3d@plt>
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1040 <glVertex3d@plt>
mov    $0x0,%al
call   1050 <glEnd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cuboid>:
sub    $0x18,%rsp
movsd  %xmm2,(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1060 <glBegin@plt>
movsd  0xe95(%rip),%xmm2
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
call   1030 <glNormal3d@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1040 <glVertex3d@plt>
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
movsd  0x10(%rsp),%xmm1
call   1040 <glVertex3d@plt>
xorps  %xmm2,%xmm2
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1040 <glVertex3d@plt>
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
movsd  0x8(%rsp),%xmm0
call   1040 <glVertex3d@plt>
movsd  0xe46(%rip),%xmm2
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
call   1030 <glNormal3d@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
movsd  (%rsp),%xmm2
call   1040 <glVertex3d@plt>
xorps  %xmm1,%xmm1
movsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm2
call   1040 <glVertex3d@plt>
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  (%rsp),%xmm2
call   1040 <glVertex3d@plt>
xorps  %xmm0,%xmm0
movsd  0x10(%rsp),%xmm1
movsd  (%rsp),%xmm2
call   1040 <glVertex3d@plt>
xor    %eax,%eax
call   1050 <glEnd@plt>
mov    0x2db9(%rip),%rax
mov    (%rax),%edi
call   1060 <glBegin@plt>
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
movsd  0xdc4(%rip),%xmm1
call   1030 <glNormal3d@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
movsd  (%rsp),%xmm2
call   1040 <glVertex3d@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1040 <glVertex3d@plt>
xorps  %xmm1,%xmm1
movsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm2
call   1040 <glVertex3d@plt>
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
movsd  0x8(%rsp),%xmm0
call   1040 <glVertex3d@plt>
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
movsd  0xd77(%rip),%xmm0
call   1030 <glNormal3d@plt>
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  (%rsp),%xmm2
call   1040 <glVertex3d@plt>
xorps  %xmm2,%xmm2
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1040 <glVertex3d@plt>
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
movsd  0xd3a(%rip),%xmm1
call   1030 <glNormal3d@plt>
xorps  %xmm0,%xmm0
movsd  0x10(%rsp),%xmm1
movsd  (%rsp),%xmm2
call   1040 <glVertex3d@plt>
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
movsd  0x10(%rsp),%xmm1
call   1040 <glVertex3d@plt>
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
movsd  0xcfb(%rip),%xmm0
call   1030 <glNormal3d@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
movsd  (%rsp),%xmm2
call   1040 <glVertex3d@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1040 <glVertex3d@plt>
xor    %eax,%eax
add    $0x18,%rsp
jmp    1050 <glEnd@plt>

LLVM IR (-O0):
@GL_QUADS = global i32 0
@GL_QUAD_STRIP = global i32 0
define void @cuboid(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load i32, i32* @GL_QUADS
%8 = call i32 @glBegin(i32 %7)
%9 = call i32 @glNormal3d(double 0.000000e+00, double 0.000000e+00, double -1.000000e+00)
%10 = call i32 @glVertex3d(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%11 = load double, double* %5
%12 = call i32 @glVertex3d(double 0.000000e+00, double %11, double 0.000000e+00)
%13 = load double, double* %4
%14 = load double, double* %5
%15 = call i32 @glVertex3d(double %13, double %14, double 0.000000e+00)
%16 = load double, double* %4
%17 = call i32 @glVertex3d(double %16, double 0.000000e+00, double 0.000000e+00)
%18 = call i32 @glNormal3d(double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%19 = load double, double* %6
%20 = call i32 @glVertex3d(double 0.000000e+00, double 0.000000e+00, double %19)
%21 = load double, double* %4
%22 = load double, double* %6
%23 = call i32 @glVertex3d(double %21, double 0.000000e+00, double %22)
%24 = load double, double* %4
%25 = load double, double* %5
%26 = load double, double* %6
%27 = call i32 @glVertex3d(double %24, double %25, double %26)
%28 = load double, double* %5
%29 = load double, double* %6
%30 = call i32 @glVertex3d(double 0.000000e+00, double %28, double %29)
%31 = call i32 (...) @glEnd()
%32 = load i32, i32* @GL_QUAD_STRIP
%33 = call i32 @glBegin(i32 %32)
%34 = call i32 @glNormal3d(double 0.000000e+00, double -1.000000e+00, double 0.000000e+00)
%35 = load double, double* %6
%36 = call i32 @glVertex3d(double 0.000000e+00, double 0.000000e+00, double %35)
%37 = call i32 @glVertex3d(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%38 = load double, double* %4
%39 = load double, double* %6
%40 = call i32 @glVertex3d(double %38, double 0.000000e+00, double %39)
%41 = load double, double* %4
%42 = call i32 @glVertex3d(double %41, double 0.000000e+00, double 0.000000e+00)
%43 = call i32 @glNormal3d(double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%44 = load double, double* %4
%45 = load double, double* %5
%46 = load double, double* %6
%47 = call i32 @glVertex3d(double %44, double %45, double %46)
%48 = load double, double* %4
%49 = load double, double* %5
%50 = call i32 @glVertex3d(double %48, double %49, double 0.000000e+00)
%51 = call i32 @glNormal3d(double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%52 = load double, double* %5
%53 = load double, double* %6
%54 = call i32 @glVertex3d(double 0.000000e+00, double %52, double %53)
%55 = load double, double* %5
%56 = call i32 @glVertex3d(double 0.000000e+00, double %55, double 0.000000e+00)
%57 = call i32 @glNormal3d(double -1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%58 = load double, double* %6
%59 = call i32 @glVertex3d(double 0.000000e+00, double 0.000000e+00, double %58)
%60 = call i32 @glVertex3d(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%61 = call i32 (...) @glEnd()
ret void
}

LLVM IR (-O2):
@GL_QUADS = global i32 0
@GL_QUAD_STRIP = global i32 0
define void @cuboid(double %0, double %1, double %2) {
%4 = load i32, i32* @GL_QUADS
%5 = tail call i32 @glBegin(i32 %4)
%6 = tail call i32 @glNormal3d(double 0.000000e+00, double 0.000000e+00, double -1.000000e+00)
%7 = tail call i32 @glVertex3d(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%8 = tail call i32 @glVertex3d(double 0.000000e+00, double %1, double 0.000000e+00)
%9 = tail call i32 @glVertex3d(double %0, double %1, double 0.000000e+00)
%10 = tail call i32 @glVertex3d(double %0, double 0.000000e+00, double 0.000000e+00)
%11 = tail call i32 @glNormal3d(double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%12 = tail call i32 @glVertex3d(double 0.000000e+00, double 0.000000e+00, double %2)
%13 = tail call i32 @glVertex3d(double %0, double 0.000000e+00, double %2)
%14 = tail call i32 @glVertex3d(double %0, double %1, double %2)
%15 = tail call i32 @glVertex3d(double 0.000000e+00, double %1, double %2)
%16 = tail call i32 (...) @glEnd()
%17 = load i32, i32* @GL_QUAD_STRIP
%18 = tail call i32 @glBegin(i32 %17)
%19 = tail call i32 @glNormal3d(double 0.000000e+00, double -1.000000e+00, double 0.000000e+00)
%20 = tail call i32 @glVertex3d(double 0.000000e+00, double 0.000000e+00, double %2)
%21 = tail call i32 @glVertex3d(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%22 = tail call i32 @glVertex3d(double %0, double 0.000000e+00, double %2)
%23 = tail call i32 @glVertex3d(double %0, double 0.000000e+00, double 0.000000e+00)
%24 = tail call i32 @glNormal3d(double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%25 = tail call i32 @glVertex3d(double %0, double %1, double %2)
%26 = tail call i32 @glVertex3d(double %0, double %1, double 0.000000e+00)
%27 = tail call i32 @glNormal3d(double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%28 = tail call i32 @glVertex3d(double 0.000000e+00, double %1, double %2)
%29 = tail call i32 @glVertex3d(double 0.000000e+00, double %1, double 0.000000e+00)
%30 = tail call i32 @glNormal3d(double -1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%31 = tail call i32 @glVertex3d(double 0.000000e+00, double 0.000000e+00, double %2)
%32 = tail call i32 @glVertex3d(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%33 = tail call i32 (...) @glEnd()
ret void
}