#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 /*<<< orphan*/ GLuint;
typedef double GLfloat;
typedef double GLdouble;
typedef int /*<<< orphan*/ GLUtriangulatorObj;

/* Variables and functions */
int /*<<< orphan*/ GLU_BEGIN;
int /*<<< orphan*/ GLU_END;
int /*<<< orphan*/ GLU_VERTEX;
int /*<<< orphan*/ GL_CCW;
int /*<<< orphan*/ GL_COMPILE;
int /*<<< orphan*/ GL_CW;
int /*<<< orphan*/ GL_FLAT;
int /*<<< orphan*/ GL_QUAD_STRIP;
int /*<<< orphan*/ GL_SMOOTH;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glCallList(int /*<<< orphan*/);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glEndList();
int /*<<< orphan*/ glFrontFace(int /*<<< orphan*/);
int /*<<< orphan*/ glNewList(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ glNormal3f(double, double, double);
int /*<<< orphan*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glShadeModel(int /*<<< orphan*/);
int /*<<< orphan*/ glTranslatef(double, double, double);
int /*<<< orphan*/ glVertex2fv();
int /*<<< orphan*/ glVertex3f(double, double, double);
int /*<<< orphan*/ gluBeginPolygon(int /*<<< orphan*/ *);
int /*<<< orphan*/ gluEndPolygon(int /*<<< orphan*/ *);
int /*<<< orphan*/ *gluNewTess();
int /*<<< orphan*/ gluTessCallback(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                   ...);
int /*<<< orphan*/ gluTessVertex(int /*<<< orphan*/ *, double *, double *);
double sqrt(double);
void extrudeSolidFromPolygon(GLfloat data[][2], unsigned int dataSize,
                             GLdouble thickness, GLuint side, GLuint edge,
                             GLuint whole) {
  static GLUtriangulatorObj *tobj = NULL;
  GLdouble vertex[3], dx, dy, len;
  int i;
  int count = dataSize / (int)(2 * sizeof(GLfloat));
  if (tobj == NULL) {
    tobj = gluNewTess();
    gluTessCallback(tobj, GLU_BEGIN, glBegin);
    gluTessCallback(tobj, GLU_VERTEX, glVertex2fv);
    gluTessCallback(tobj, GLU_END, glEnd);
  }
  glNewList(side, GL_COMPILE);
  glShadeModel(GL_SMOOTH);
  gluBeginPolygon(tobj);
  for (i = 0; i < count; i++) {
    vertex[0] = data[i][0];
    vertex[1] = data[i][1];
    vertex[2] = 0;
    gluTessVertex(tobj, vertex, data[i]);
  }
  gluEndPolygon(tobj);
  glEndList();
  glNewList(edge, GL_COMPILE);
  glShadeModel(GL_FLAT);
  glBegin(GL_QUAD_STRIP);
  for (i = 0; i <= count; i++) {
    glVertex3f(data[i % count][0], data[i % count][1], 0.0);
    glVertex3f(data[i % count][0], data[i % count][1], thickness);
    dx = data[(i + 1) % count][1] - data[i % count][1];
    dy = data[i % count][0] - data[(i + 1) % count][0];
    len = sqrt(dx * dx + dy * dy);
    glNormal3f(dx / len, dy / len, 0.0);
  }
  glEnd();
  glEndList();
  glNewList(whole, GL_COMPILE);
  glFrontFace(GL_CW);
  glCallList(edge);
  glNormal3f(0.0, 0.0, -1.0);
  glCallList(side);
  glPushMatrix();
  glTranslatef(0.0, 0.0, thickness);
  glFrontFace(GL_CCW);
  glNormal3f(0.0, 0.0, 1.0);
  glCallList(side);
  glPopMatrix();
  glEndList();
}


x86 assembly (clang, -O0):
<extrudeSolidFromPolygon>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x4,%eax
mov    %eax,-0x60(%rbp)
cmpq   $0x0,0x2e66(%rip)
jne    12b0 <extrudeSolidFromPolygon+0xa0>
mov    $0x0,%al
call   1030 <gluNewTess@plt>
mov    %rax,0x2e52(%rip)
mov    0x2e4b(%rip),%rdi
mov    0x2d44(%rip),%rax
mov    (%rax),%esi
mov    0x2d83(%rip),%rdx
mov    $0x0,%al
call   1110 <gluTessCallback@plt>
mov    0x2e2d(%rip),%rdi
mov    0x2d1e(%rip),%rax
mov    (%rax),%esi
mov    0x2d55(%rip),%rdx
mov    $0x0,%al
call   1110 <gluTessCallback@plt>
mov    0x2e0f(%rip),%rdi
mov    0x2d30(%rip),%rax
mov    (%rax),%esi
mov    0x2d0f(%rip),%rdx
mov    $0x0,%al
call   1110 <gluTessCallback@plt>
mov    -0x1c(%rbp),%edi
mov    0x2cde(%rip),%rax
mov    (%rax),%esi
call   1070 <glNewList@plt>
mov    0x2cc8(%rip),%rax
mov    (%rax),%edi
call   10f0 <glShadeModel@plt>
mov    0x2dd2(%rip),%rdi
call   1050 <gluBeginPolygon@plt>
movl   $0x0,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x60(%rbp),%eax
jge    1354 <extrudeSolidFromPolygon+0x144>
mov    -0x8(%rbp),%rax
movslq -0x5c(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x5c(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    0x2d7a(%rip),%rdi
lea    -0x40(%rbp),%rsi
mov    -0x8(%rbp),%rdx
movslq -0x5c(%rbp),%rax
shl    $0x4,%rax
add    %rax,%rdx
call   1040 <gluTessVertex@plt>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    12e2 <extrudeSolidFromPolygon+0xd2>
mov    0x2d4d(%rip),%rdi
call   1080 <gluEndPolygon@plt>
mov    $0x0,%al
call   1100 <glEndList@plt>
mov    -0x20(%rbp),%edi
mov    0x2c27(%rip),%rax
mov    (%rax),%esi
call   1070 <glNewList@plt>
mov    0x2c59(%rip),%rax
mov    (%rax),%edi
call   10f0 <glShadeModel@plt>
mov    0x2c3b(%rip),%rax
mov    (%rax),%edi
call   1138 <glBegin@plt>
movl   $0x0,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x60(%rbp),%eax
jg     153d <extrudeSolidFromPolygon+0x32d>
mov    -0x8(%rbp),%rax
mov    %rax,-0xa0(%rbp)
mov    -0x5c(%rbp),%eax
cltd
idivl  -0x60(%rbp)
mov    -0xa0(%rbp),%rax
movslq %edx,%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0x5c(%rbp),%eax
cltd
idivl  -0x60(%rbp)
mov    -0x98(%rbp),%rax
movslq %edx,%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movsd  0x8(%rax),%xmm1
xorps  %xmm2,%xmm2
call   1060 <glVertex3f@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    -0x5c(%rbp),%eax
cltd
idivl  -0x60(%rbp)
mov    -0x90(%rbp),%rax
movslq %edx,%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x5c(%rbp),%eax
cltd
idivl  -0x60(%rbp)
mov    -0x88(%rbp),%rax
movslq %edx,%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movsd  0x8(%rax),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1060 <glVertex3f@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
cltd
idivl  -0x60(%rbp)
mov    -0x80(%rbp),%rax
movslq %edx,%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x5c(%rbp),%eax
cltd
idivl  -0x60(%rbp)
mov    -0x78(%rbp),%rax
movslq %edx,%rcx
shl    $0x4,%rcx
add    %rcx,%rax
subsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x5c(%rbp),%eax
cltd
idivl  -0x60(%rbp)
mov    -0x70(%rbp),%rax
movslq %edx,%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
cltd
idivl  -0x60(%rbp)
mov    -0x68(%rbp),%rax
movslq %edx,%rcx
shl    $0x4,%rcx
add    %rcx,%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   10e0 <sqrt@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x48(%rbp),%xmm0
divsd  -0x58(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
divsd  -0x58(%rbp),%xmm1
xorps  %xmm2,%xmm2
call   1120 <glNormal3f@plt>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    139b <extrudeSolidFromPolygon+0x18b>
mov    $0x0,%al
call   1130 <glEnd@plt>
mov    $0x0,%al
call   1100 <glEndList@plt>
mov    -0x24(%rbp),%edi
mov    0x2a43(%rip),%rax
mov    (%rax),%esi
call   1070 <glNewList@plt>
mov    0x2a1d(%rip),%rax
mov    (%rax),%edi
call   10c0 <glFrontFace@plt>
mov    -0x20(%rbp),%edi
call   10b0 <glCallList@plt>
xorps  %xmm1,%xmm1
movsd  0xa8b(%rip),%xmm2
movaps %xmm1,%xmm0
call   1120 <glNormal3f@plt>
mov    -0x1c(%rbp),%edi
call   10b0 <glCallList@plt>
mov    $0x0,%al
call   10a0 <glPushMatrix@plt>
movsd  -0x18(%rbp),%xmm2
xorps  %xmm1,%xmm1
movaps %xmm1,%xmm0
call   10d0 <glTranslatef@plt>
mov    0x2a05(%rip),%rax
mov    (%rax),%edi
call   10c0 <glFrontFace@plt>
xorps  %xmm1,%xmm1
movsd  0xa43(%rip),%xmm2
movaps %xmm1,%xmm0
call   1120 <glNormal3f@plt>
mov    -0x1c(%rbp),%edi
call   10b0 <glCallList@plt>
mov    $0x0,%al
call   1090 <glPopMatrix@plt>
mov    $0x0,%al
call   1100 <glEndList@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extrudeSolidFromPolygon>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r8d,0x4(%rsp)
mov    %ecx,(%rsp)
mov    %edx,%r12d
movsd  %xmm0,0x8(%rsp)
mov    %esi,%ebx
mov    %rdi,%r13
cmpq   $0x0,0x2e6c(%rip)
jne    12a2 <extrudeSolidFromPolygon+0x92>
xor    %eax,%eax
call   1030 <gluNewTess@plt>
mov    %rax,0x2e5c(%rip)
mov    0x2d55(%rip),%rcx
mov    (%rcx),%esi
mov    0x2d94(%rip),%rdx
mov    %rax,%rdi
xor    %eax,%eax
call   1110 <gluTessCallback@plt>
mov    0x2e3b(%rip),%rdi
mov    0x2d2c(%rip),%rax
mov    (%rax),%esi
mov    0x2d63(%rip),%rdx
xor    %eax,%eax
call   1110 <gluTessCallback@plt>
mov    0x2e1d(%rip),%rdi
mov    0x2d3e(%rip),%rax
mov    (%rax),%esi
mov    0x2d1d(%rip),%rdx
xor    %eax,%eax
call   1110 <gluTessCallback@plt>
mov    %ebx,%r14d
shr    $0x4,%r14d
mov    0x2ce8(%rip),%rax
mov    (%rax),%esi
mov    %r12d,%edi
call   1070 <glNewList@plt>
mov    0x2ccf(%rip),%rax
mov    (%rax),%edi
call   10f0 <glShadeModel@plt>
mov    0x2dd9(%rip),%rdi
call   1050 <gluBeginPolygon@plt>
cmp    $0x10,%ebx
jb     1320 <extrudeSolidFromPolygon+0x110>
cmp    $0x2,%r14d
mov    $0x1,%ebx
cmovae %r14d,%ebx
lea    0x20(%rsp),%r15
mov    %r13,%rbp
xchg   %ax,%ax
movupd 0x0(%rbp),%xmm0
movapd %xmm0,0x20(%rsp)
movq   $0x0,0x30(%rsp)
mov    0x2d9d(%rip),%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
call   1040 <gluTessVertex@plt>
add    $0x10,%rbp
add    $0xffffffffffffffff,%rbx
jne    12f0 <extrudeSolidFromPolygon+0xe0>
mov    0x2d81(%rip),%rdi
call   1080 <gluEndPolygon@plt>
xor    %ebx,%ebx
xor    %eax,%eax
call   1100 <glEndList@plt>
mov    0x2c5c(%rip),%rax
mov    (%rax),%esi
mov    (%rsp),%edi
call   1070 <glNewList@plt>
mov    0x2c8b(%rip),%rax
mov    (%rax),%edi
call   10f0 <glShadeModel@plt>
mov    0x2c6d(%rip),%rax
mov    (%rax),%edi
call   1138 <glBegin@plt>
lea    0x1(%r14),%r15d
jmp    13ab <extrudeSolidFromPolygon+0x19b>
nopl   0x0(%rax,%rax,1)
movsd  %xmm3,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
call   10e0 <sqrt@plt>
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm3
divsd  %xmm0,%xmm3
divsd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
movapd %xmm3,%xmm0
call   1120 <glNormal3f@plt>
cmp    %ebx,%r15d
je     143c <extrudeSolidFromPolygon+0x22c>
mov    %ebx,%eax
xor    %edx,%edx
div    %r14d
mov    %edx,%ebp
shl    $0x4,%rbp
movsd  0x0(%r13,%rbp,1),%xmm0
movsd  0x8(%r13,%rbp,1),%xmm1
xorps  %xmm2,%xmm2
call   1060 <glVertex3f@plt>
movsd  0x0(%r13,%rbp,1),%xmm0
movsd  0x8(%r13,%rbp,1),%xmm1
movsd  0x8(%rsp),%xmm2
call   1060 <glVertex3f@plt>
add    $0x1,%ebx
mov    %ebx,%eax
xor    %edx,%edx
div    %r14d
shl    $0x4,%rdx
movsd  0x8(%r13,%rdx,1),%xmm3
subsd  0x8(%r13,%rbp,1),%xmm3
movsd  0x0(%r13,%rbp,1),%xmm1
subsd  0x0(%r13,%rdx,1),%xmm1
movapd %xmm1,%xmm2
mulsd  %xmm1,%xmm2
movapd %xmm3,%xmm0
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
ucomisd 0xbe3(%rip),%xmm0
jb     1370 <extrudeSolidFromPolygon+0x160>
sqrtsd %xmm0,%xmm0
jmp    138d <extrudeSolidFromPolygon+0x17d>
xor    %eax,%eax
call   1130 <glEnd@plt>
xor    %eax,%eax
call   1100 <glEndList@plt>
mov    0x2b47(%rip),%rax
mov    (%rax),%esi
mov    0x4(%rsp),%edi
call   1070 <glNewList@plt>
mov    0x2b1d(%rip),%rax
mov    (%rax),%edi
call   10c0 <glFrontFace@plt>
mov    (%rsp),%edi
call   10b0 <glCallList@plt>
movsd  0xb86(%rip),%xmm2
xorpd  %xmm0,%xmm0
xorpd  %xmm1,%xmm1
call   1120 <glNormal3f@plt>
mov    %r12d,%edi
call   10b0 <glCallList@plt>
xor    %eax,%eax
call   10a0 <glPushMatrix@plt>
xorpd  %xmm0,%xmm0
xorpd  %xmm1,%xmm1
movsd  0x8(%rsp),%xmm2
call   10d0 <glTranslatef@plt>
mov    0x2b00(%rip),%rax
mov    (%rax),%edi
call   10c0 <glFrontFace@plt>
movsd  0xb49(%rip),%xmm2
xorpd  %xmm0,%xmm0
xorpd  %xmm1,%xmm1
call   1120 <glNormal3f@plt>
mov    %r12d,%edi
call   10b0 <glCallList@plt>
xor    %eax,%eax
call   1090 <glPopMatrix@plt>
xor    %eax,%eax
call   1100 <glEndList@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@extrudeSolidFromPolygon.tobj = internal global i32* null
@GLU_BEGIN = global i32 0
@GLU_VERTEX = global i32 0
@GLU_END = global i32 0
@GL_COMPILE = global i32 0
@GL_SMOOTH = global i32 0
@GL_FLAT = global i32 0
@GL_QUAD_STRIP = global i32 0
@GL_CW = global i32 0
@GL_CCW = global i32 0
define void @extrudeSolidFromPolygon([2 x double]* %0, i32 %1, double %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca [2 x double]*
%8 = alloca i32
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca [3 x double]
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca i32
%18 = alloca i32
store [2 x double]* %0, [2 x double]** %7
store i32 %1, i32* %8
store double %2, double* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%19 = load i32, i32* %8
%20 = udiv i32 %19, 16
store i32 %20, i32* %18
%21 = load i32*, i32** @extrudeSolidFromPolygon.tobj
%22 = icmp eq i32* %21, null
br i1 %22, label %23, label %34
23: ; preds = %6
%24 = call i32* (...) @gluNewTess()
store i32* %24, i32** @extrudeSolidFromPolygon.tobj
%25 = load i32*, i32** @extrudeSolidFromPolygon.tobj
%26 = load i32, i32* @GLU_BEGIN
%27 = call i32 (i32*, i32, ...) @gluTessCallback(i32* %25, i32 %26, i32 (i32)* @glBegin)
%28 = load i32*, i32** @extrudeSolidFromPolygon.tobj
%29 = load i32, i32* @GLU_VERTEX
%30 = call i32 (i32*, i32, ...) @gluTessCallback(i32* %28, i32 %29, i32 (...)* @glVertex2fv)
%31 = load i32*, i32** @extrudeSolidFromPolygon.tobj
%32 = load i32, i32* @GLU_END
%33 = call i32 (i32*, i32, ...) @gluTessCallback(i32* %31, i32 %32, i32 (...)* @glEnd)
br label %34
34: ; preds = %23, %6
%35 = load i32, i32* %10
%36 = load i32, i32* @GL_COMPILE
%37 = call i32 @glNewList(i32 %35, i32 %36)
%38 = load i32, i32* @GL_SMOOTH
%39 = call i32 @glShadeModel(i32 %38)
%40 = load i32*, i32** @extrudeSolidFromPolygon.tobj
%41 = call i32 @gluBeginPolygon(i32* %40)
store i32 0, i32* %17
br label %42
42: ; preds = %70, %34
%43 = load i32, i32* %17
%44 = load i32, i32* %18
%45 = icmp slt i32 %43, %44
br i1 %45, label %46, label %73
46: ; preds = %42
%47 = load [2 x double]*, [2 x double]** %7
%48 = load i32, i32* %17
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [2 x double], [2 x double]* %47, i64 %49
%51 = getelementptr inbounds [2 x double], [2 x double]* %50, i64 0, i64 0
%52 = load double, double* %51
%53 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 0
store double %52, double* %53
%54 = load [2 x double]*, [2 x double]** %7
%55 = load i32, i32* %17
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [2 x double], [2 x double]* %54, i64 %56
%58 = getelementptr inbounds [2 x double], [2 x double]* %57, i64 0, i64 1
%59 = load double, double* %58
%60 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 1
store double %59, double* %60
%61 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 2
store double 0.000000e+00, double* %61
%62 = load i32*, i32** @extrudeSolidFromPolygon.tobj
%63 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 0
%64 = load [2 x double]*, [2 x double]** %7
%65 = load i32, i32* %17
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [2 x double], [2 x double]* %64, i64 %66
%68 = getelementptr inbounds [2 x double], [2 x double]* %67, i64 0, i64 0
%69 = call i32 @gluTessVertex(i32* %62, double* %63, double* %68)
br label %70
70: ; preds = %46
%71 = load i32, i32* %17
%72 = add nsw i32 %71, 1
store i32 %72, i32* %17
br label %42
73: ; preds = %42
%74 = load i32*, i32** @extrudeSolidFromPolygon.tobj
%75 = call i32 @gluEndPolygon(i32* %74)
%76 = call i32 (...) @glEndList()
%77 = load i32, i32* %11
%78 = load i32, i32* @GL_COMPILE
%79 = call i32 @glNewList(i32 %77, i32 %78)
%80 = load i32, i32* @GL_FLAT
%81 = call i32 @glShadeModel(i32 %80)
%82 = load i32, i32* @GL_QUAD_STRIP
%83 = call i32 @glBegin(i32 %82)
store i32 0, i32* %17
br label %84
84: ; preds = %174, %73
%85 = load i32, i32* %17
%86 = load i32, i32* %18
%87 = icmp sle i32 %85, %86
br i1 %87, label %88, label %177
88: ; preds = %84
%89 = load [2 x double]*, [2 x double]** %7
%90 = load i32, i32* %17
%91 = load i32, i32* %18
%92 = srem i32 %90, %91
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds [2 x double], [2 x double]* %89, i64 %93
%95 = getelementptr inbounds [2 x double], [2 x double]* %94, i64 0, i64 0
%96 = load double, double* %95
%97 = load [2 x double]*, [2 x double]** %7
%98 = load i32, i32* %17
%99 = load i32, i32* %18
%100 = srem i32 %98, %99
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds [2 x double], [2 x double]* %97, i64 %101
%103 = getelementptr inbounds [2 x double], [2 x double]* %102, i64 0, i64 1
%104 = load double, double* %103
%105 = call i32 @glVertex3f(double %96, double %104, double 0.000000e+00)
%106 = load [2 x double]*, [2 x double]** %7
%107 = load i32, i32* %17
%108 = load i32, i32* %18
%109 = srem i32 %107, %108
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds [2 x double], [2 x double]* %106, i64 %110
%112 = getelementptr inbounds [2 x double], [2 x double]* %111, i64 0, i64 0
%113 = load double, double* %112
%114 = load [2 x double]*, [2 x double]** %7
%115 = load i32, i32* %17
%116 = load i32, i32* %18
%117 = srem i32 %115, %116
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds [2 x double], [2 x double]* %114, i64 %118
%120 = getelementptr inbounds [2 x double], [2 x double]* %119, i64 0, i64 1
%121 = load double, double* %120
%122 = load double, double* %9
%123 = call i32 @glVertex3f(double %113, double %121, double %122)
%124 = load [2 x double]*, [2 x double]** %7
%125 = load i32, i32* %17
%126 = add nsw i32 %125, 1
%127 = load i32, i32* %18
%128 = srem i32 %126, %127
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds [2 x double], [2 x double]* %124, i64 %129
%131 = getelementptr inbounds [2 x double], [2 x double]* %130, i64 0, i64 1
%132 = load double, double* %131
%133 = load [2 x double]*, [2 x double]** %7
%134 = load i32, i32* %17
%135 = load i32, i32* %18
%136 = srem i32 %134, %135
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds [2 x double], [2 x double]* %133, i64 %137
%139 = getelementptr inbounds [2 x double], [2 x double]* %138, i64 0, i64 1
%140 = load double, double* %139
%141 = fsub double %132, %140
store double %141, double* %14
%142 = load [2 x double]*, [2 x double]** %7
%143 = load i32, i32* %17
%144 = load i32, i32* %18
%145 = srem i32 %143, %144
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds [2 x double], [2 x double]* %142, i64 %146
%148 = getelementptr inbounds [2 x double], [2 x double]* %147, i64 0, i64 0
%149 = load double, double* %148
%150 = load [2 x double]*, [2 x double]** %7
%151 = load i32, i32* %17
%152 = add nsw i32 %151, 1
%153 = load i32, i32* %18
%154 = srem i32 %152, %153
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds [2 x double], [2 x double]* %150, i64 %155
%157 = getelementptr inbounds [2 x double], [2 x double]* %156, i64 0, i64 0
%158 = load double, double* %157
%159 = fsub double %149, %158
store double %159, double* %15
%160 = load double, double* %14
%161 = load double, double* %14
%162 = load double, double* %15
%163 = load double, double* %15
%164 = fmul double %162, %163
%165 = call double @llvm.fmuladd.f64(double %160, double %161, double %164)
%166 = call double @sqrt(double %165)
store double %166, double* %16
%167 = load double, double* %14
%168 = load double, double* %16
%169 = fdiv double %167, %168
%170 = load double, double* %15
%171 = load double, double* %16
%172 = fdiv double %170, %171
%173 = call i32 @glNormal3f(double %169, double %172, double 0.000000e+00)
br label %174
174: ; preds = %88
%175 = load i32, i32* %17
%176 = add nsw i32 %175, 1
store i32 %176, i32* %17
br label %84
177: ; preds = %84
%178 = call i32 (...) @glEnd()
%179 = call i32 (...) @glEndList()
%180 = load i32, i32* %12
%181 = load i32, i32* @GL_COMPILE
%182 = call i32 @glNewList(i32 %180, i32 %181)
%183 = load i32, i32* @GL_CW
%184 = call i32 @glFrontFace(i32 %183)
%185 = load i32, i32* %11
%186 = call i32 @glCallList(i32 %185)
%187 = call i32 @glNormal3f(double 0.000000e+00, double 0.000000e+00, double -1.000000e+00)
%188 = load i32, i32* %10
%189 = call i32 @glCallList(i32 %188)
%190 = call i32 (...) @glPushMatrix()
%191 = load double, double* %9
%192 = call i32 @glTranslatef(double 0.000000e+00, double 0.000000e+00, double %191)
%193 = load i32, i32* @GL_CCW
%194 = call i32 @glFrontFace(i32 %193)
%195 = call i32 @glNormal3f(double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%196 = load i32, i32* %10
%197 = call i32 @glCallList(i32 %196)
%198 = call i32 (...) @glPopMatrix()
%199 = call i32 (...) @glEndList()
ret void
}

LLVM IR (-O2):
@extrudeSolidFromPolygon.tobj = internal unnamed_addr global i32* null
@GLU_BEGIN = global i32 0
@GLU_VERTEX = global i32 0
@GLU_END = global i32 0
@GL_COMPILE = global i32 0
@GL_SMOOTH = global i32 0
@GL_FLAT = global i32 0
@GL_QUAD_STRIP = global i32 0
@GL_CW = global i32 0
@GL_CCW = global i32 0
define void @extrudeSolidFromPolygon([2 x double]* %0, i32 %1, double %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca [3 x double]
%8 = bitcast [3 x double]* %7 to i8*
%9 = lshr i32 %1, 4
%10 = load i32*, i32** @extrudeSolidFromPolygon.tobj
%11 = icmp eq i32* %10, null
br i1 %11, label %12, label %22
12: ; preds = %6
%13 = tail call i32* (...) @gluNewTess()
store i32* %13, i32** @extrudeSolidFromPolygon.tobj
%14 = load i32, i32* @GLU_BEGIN
%15 = tail call i32 (i32*, i32, ...) @gluTessCallback(i32* %13, i32 %14, i32 (i32)* @glBegin)
%16 = load i32*, i32** @extrudeSolidFromPolygon.tobj
%17 = load i32, i32* @GLU_VERTEX
%18 = tail call i32 (i32*, i32, ...) @gluTessCallback(i32* %16, i32 %17, i32 (...)* @glVertex2fv)
%19 = load i32*, i32** @extrudeSolidFromPolygon.tobj
%20 = load i32, i32* @GLU_END
%21 = tail call i32 (i32*, i32, ...) @gluTessCallback(i32* %19, i32 %20, i32 (...)* @glEnd)
br label %22
22: ; preds = %12, %6
%23 = load i32, i32* @GL_COMPILE
%24 = tail call i32 @glNewList(i32 %3, i32 %23)
%25 = load i32, i32* @GL_SMOOTH
%26 = tail call i32 @glShadeModel(i32 %25)
%27 = load i32*, i32** @extrudeSolidFromPolygon.tobj
%28 = tail call i32 @gluBeginPolygon(i32* %27)
%29 = icmp ult i32 %1, 16
br i1 %29, label %45, label %30
30: ; preds = %22
%31 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%32 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 2
%33 = call i32 @llvm.umax.i32(i32 %9, i32 1)
%34 = zext i32 %33 to i64
%35 = bitcast [3 x double]* %7 to <2 x double>*
br label %36
36: ; preds = %30, %36
%37 = phi i64 [ 0, %30 ], [ %43, %36 ]
%38 = getelementptr inbounds [2 x double], [2 x double]* %0, i64 %37, i64 0
%39 = bitcast double* %38 to <2 x double>*
%40 = load <2 x double>, <2 x double>* %39
store <2 x double> %40, <2 x double>* %35
store double 0.000000e+00, double* %32
%41 = load i32*, i32** @extrudeSolidFromPolygon.tobj
%42 = call i32 @gluTessVertex(i32* %41, double* %31, double* %38)
%43 = add nuw nsw i64 %37, 1
%44 = icmp eq i64 %43, %34
br i1 %44, label %45, label %36
45: ; preds = %36, %22
%46 = load i32*, i32** @extrudeSolidFromPolygon.tobj
%47 = call i32 @gluEndPolygon(i32* %46)
%48 = call i32 (...) @glEndList()
%49 = load i32, i32* @GL_COMPILE
%50 = call i32 @glNewList(i32 %4, i32 %49)
%51 = load i32, i32* @GL_FLAT
%52 = call i32 @glShadeModel(i32 %51)
%53 = load i32, i32* @GL_QUAD_STRIP
%54 = call i32 @glBegin(i32 %53)
br label %55
55: ; preds = %45, %55
%56 = phi i32 [ 0, %45 ], [ %67, %55 ]
%57 = urem i32 %56, %9
%58 = zext i32 %57 to i64
%59 = getelementptr inbounds [2 x double], [2 x double]* %0, i64 %58, i64 0
%60 = load double, double* %59
%61 = getelementptr inbounds [2 x double], [2 x double]* %0, i64 %58, i64 1
%62 = load double, double* %61
%63 = call i32 @glVertex3f(double %60, double %62, double 0.000000e+00)
%64 = load double, double* %59
%65 = load double, double* %61
%66 = call i32 @glVertex3f(double %64, double %65, double %2)
%67 = add nuw nsw i32 %56, 1
%68 = urem i32 %67, %9
%69 = zext i32 %68 to i64
%70 = getelementptr inbounds [2 x double], [2 x double]* %0, i64 %69, i64 1
%71 = load double, double* %70
%72 = load double, double* %61
%73 = fsub double %71, %72
%74 = load double, double* %59
%75 = getelementptr inbounds [2 x double], [2 x double]* %0, i64 %69, i64 0
%76 = load double, double* %75
%77 = fsub double %74, %76
%78 = fmul double %77, %77
%79 = call double @llvm.fmuladd.f64(double %73, double %73, double %78)
%80 = call double @sqrt(double %79)
%81 = fdiv double %73, %80
%82 = fdiv double %77, %80
%83 = call i32 @glNormal3f(double %81, double %82, double 0.000000e+00)
%84 = icmp eq i32 %56, %9
br i1 %84, label %85, label %55
85: ; preds = %55
%86 = call i32 (...) @glEnd()
%87 = call i32 (...) @glEndList()
%88 = load i32, i32* @GL_COMPILE
%89 = call i32 @glNewList(i32 %5, i32 %88)
%90 = load i32, i32* @GL_CW
%91 = call i32 @glFrontFace(i32 %90)
%92 = call i32 @glCallList(i32 %4)
%93 = call i32 @glNormal3f(double 0.000000e+00, double 0.000000e+00, double -1.000000e+00)
%94 = call i32 @glCallList(i32 %3)
%95 = call i32 (...) @glPushMatrix()
%96 = call i32 @glTranslatef(double 0.000000e+00, double 0.000000e+00, double %2)
%97 = load i32, i32* @GL_CCW
%98 = call i32 @glFrontFace(i32 %97)
%99 = call i32 @glNormal3f(double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%100 = call i32 @glCallList(i32 %3)
%101 = call i32 (...) @glPopMatrix()
%102 = call i32 (...) @glEndList()
ret void
}