#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 = (int)(dataSize / (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,%rax
mov    %eax,-0x60(%rbp)
cmpq   $0x0,0x2e65(%rip)
jne    12b1 <extrudeSolidFromPolygon+0xa1>
mov    $0x0,%al
call   1030 <gluNewTess@plt>
mov    %rax,0x2e51(%rip)
mov    0x2e4a(%rip),%rdi
mov    0x2d43(%rip),%rax
mov    (%rax),%esi
mov    0x2d82(%rip),%rdx
mov    $0x0,%al
call   1110 <gluTessCallback@plt>
mov    0x2e2c(%rip),%rdi
mov    0x2d1d(%rip),%rax
mov    (%rax),%esi
mov    0x2d54(%rip),%rdx
mov    $0x0,%al
call   1110 <gluTessCallback@plt>
mov    0x2e0e(%rip),%rdi
mov    0x2d2f(%rip),%rax
mov    (%rax),%esi
mov    0x2d0e(%rip),%rdx
mov    $0x0,%al
call   1110 <gluTessCallback@plt>
mov    -0x1c(%rbp),%edi
mov    0x2cdd(%rip),%rax
mov    (%rax),%esi
call   1070 <glNewList@plt>
mov    0x2cc7(%rip),%rax
mov    (%rax),%edi
call   10f0 <glShadeModel@plt>
mov    0x2dd1(%rip),%rdi
call   1050 <gluBeginPolygon@plt>
movl   $0x0,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x60(%rbp),%eax
jge    1355 <extrudeSolidFromPolygon+0x145>
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    0x2d79(%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    12e3 <extrudeSolidFromPolygon+0xd3>
mov    0x2d4c(%rip),%rdi
call   1080 <gluEndPolygon@plt>
mov    $0x0,%al
call   1100 <glEndList@plt>
mov    -0x20(%rbp),%edi
mov    0x2c26(%rip),%rax
mov    (%rax),%esi
call   1070 <glNewList@plt>
mov    0x2c58(%rip),%rax
mov    (%rax),%edi
call   10f0 <glShadeModel@plt>
mov    0x2c3a(%rip),%rax
mov    (%rax),%edi
call   1138 <glBegin@plt>
movl   $0x0,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x60(%rbp),%eax
jg     153e <extrudeSolidFromPolygon+0x32e>
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    139c <extrudeSolidFromPolygon+0x18c>
mov    $0x0,%al
call   1130 <glEnd@plt>
mov    $0x0,%al
call   1100 <glEndList@plt>
mov    -0x24(%rbp),%edi
mov    0x2a42(%rip),%rax
mov    (%rax),%esi
call   1070 <glNewList@plt>
mov    0x2a1c(%rip),%rax
mov    (%rax),%edi
call   10c0 <glFrontFace@plt>
mov    -0x20(%rbp),%edi
call   10b0 <glCallList@plt>
xorps  %xmm1,%xmm1
movsd  0xa8a(%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    0x2a04(%rip),%rax
mov    (%rax),%edi
call   10c0 <glFrontFace@plt>
xorps  %xmm1,%xmm1
movsd  0xa42(%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 = zext i32 %19 to i64
%21 = udiv i64 %20, 16
%22 = trunc i64 %21 to i32
store i32 %22, i32* %18
%23 = load i32*, i32** @extrudeSolidFromPolygon.tobj
%24 = icmp eq i32* %23, null
br i1 %24, label %25, label %36
25: ; preds = %6
%26 = call i32* (...) @gluNewTess()
store i32* %26, i32** @extrudeSolidFromPolygon.tobj
%27 = load i32*, i32** @extrudeSolidFromPolygon.tobj
%28 = load i32, i32* @GLU_BEGIN
%29 = call i32 (i32*, i32, ...) @gluTessCallback(i32* %27, i32 %28, i32 (i32)* @glBegin)
%30 = load i32*, i32** @extrudeSolidFromPolygon.tobj
%31 = load i32, i32* @GLU_VERTEX
%32 = call i32 (i32*, i32, ...) @gluTessCallback(i32* %30, i32 %31, i32 (...)* @glVertex2fv)
%33 = load i32*, i32** @extrudeSolidFromPolygon.tobj
%34 = load i32, i32* @GLU_END
%35 = call i32 (i32*, i32, ...) @gluTessCallback(i32* %33, i32 %34, i32 (...)* @glEnd)
br label %36
36: ; preds = %25, %6
%37 = load i32, i32* %10
%38 = load i32, i32* @GL_COMPILE
%39 = call i32 @glNewList(i32 %37, i32 %38)
%40 = load i32, i32* @GL_SMOOTH
%41 = call i32 @glShadeModel(i32 %40)
%42 = load i32*, i32** @extrudeSolidFromPolygon.tobj
%43 = call i32 @gluBeginPolygon(i32* %42)
store i32 0, i32* %17
br label %44
44: ; preds = %72, %36
%45 = load i32, i32* %17
%46 = load i32, i32* %18
%47 = icmp slt i32 %45, %46
br i1 %47, label %48, label %75
48: ; preds = %44
%49 = load [2 x double]*, [2 x double]** %7
%50 = load i32, i32* %17
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [2 x double], [2 x double]* %49, i64 %51
%53 = getelementptr inbounds [2 x double], [2 x double]* %52, i64 0, i64 0
%54 = load double, double* %53
%55 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 0
store double %54, double* %55
%56 = load [2 x double]*, [2 x double]** %7
%57 = load i32, i32* %17
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [2 x double], [2 x double]* %56, i64 %58
%60 = getelementptr inbounds [2 x double], [2 x double]* %59, i64 0, i64 1
%61 = load double, double* %60
%62 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 1
store double %61, double* %62
%63 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 2
store double 0.000000e+00, double* %63
%64 = load i32*, i32** @extrudeSolidFromPolygon.tobj
%65 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 0
%66 = load [2 x double]*, [2 x double]** %7
%67 = load i32, i32* %17
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [2 x double], [2 x double]* %66, i64 %68
%70 = getelementptr inbounds [2 x double], [2 x double]* %69, i64 0, i64 0
%71 = call i32 @gluTessVertex(i32* %64, double* %65, double* %70)
br label %72
72: ; preds = %48
%73 = load i32, i32* %17
%74 = add nsw i32 %73, 1
store i32 %74, i32* %17
br label %44
75: ; preds = %44
%76 = load i32*, i32** @extrudeSolidFromPolygon.tobj
%77 = call i32 @gluEndPolygon(i32* %76)
%78 = call i32 (...) @glEndList()
%79 = load i32, i32* %11
%80 = load i32, i32* @GL_COMPILE
%81 = call i32 @glNewList(i32 %79, i32 %80)
%82 = load i32, i32* @GL_FLAT
%83 = call i32 @glShadeModel(i32 %82)
%84 = load i32, i32* @GL_QUAD_STRIP
%85 = call i32 @glBegin(i32 %84)
store i32 0, i32* %17
br label %86
86: ; preds = %176, %75
%87 = load i32, i32* %17
%88 = load i32, i32* %18
%89 = icmp sle i32 %87, %88
br i1 %89, label %90, label %179
90: ; preds = %86
%91 = load [2 x double]*, [2 x double]** %7
%92 = load i32, i32* %17
%93 = load i32, i32* %18
%94 = srem i32 %92, %93
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds [2 x double], [2 x double]* %91, i64 %95
%97 = getelementptr inbounds [2 x double], [2 x double]* %96, i64 0, i64 0
%98 = load double, double* %97
%99 = load [2 x double]*, [2 x double]** %7
%100 = load i32, i32* %17
%101 = load i32, i32* %18
%102 = srem i32 %100, %101
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds [2 x double], [2 x double]* %99, i64 %103
%105 = getelementptr inbounds [2 x double], [2 x double]* %104, i64 0, i64 1
%106 = load double, double* %105
%107 = call i32 @glVertex3f(double %98, double %106, double 0.000000e+00)
%108 = load [2 x double]*, [2 x double]** %7
%109 = load i32, i32* %17
%110 = load i32, i32* %18
%111 = srem i32 %109, %110
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds [2 x double], [2 x double]* %108, i64 %112
%114 = getelementptr inbounds [2 x double], [2 x double]* %113, i64 0, i64 0
%115 = load double, double* %114
%116 = load [2 x double]*, [2 x double]** %7
%117 = load i32, i32* %17
%118 = load i32, i32* %18
%119 = srem i32 %117, %118
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds [2 x double], [2 x double]* %116, i64 %120
%122 = getelementptr inbounds [2 x double], [2 x double]* %121, i64 0, i64 1
%123 = load double, double* %122
%124 = load double, double* %9
%125 = call i32 @glVertex3f(double %115, double %123, double %124)
%126 = load [2 x double]*, [2 x double]** %7
%127 = load i32, i32* %17
%128 = add nsw i32 %127, 1
%129 = load i32, i32* %18
%130 = srem i32 %128, %129
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds [2 x double], [2 x double]* %126, i64 %131
%133 = getelementptr inbounds [2 x double], [2 x double]* %132, i64 0, i64 1
%134 = load double, double* %133
%135 = load [2 x double]*, [2 x double]** %7
%136 = load i32, i32* %17
%137 = load i32, i32* %18
%138 = srem i32 %136, %137
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds [2 x double], [2 x double]* %135, i64 %139
%141 = getelementptr inbounds [2 x double], [2 x double]* %140, i64 0, i64 1
%142 = load double, double* %141
%143 = fsub double %134, %142
store double %143, double* %14
%144 = load [2 x double]*, [2 x double]** %7
%145 = load i32, i32* %17
%146 = load i32, i32* %18
%147 = srem i32 %145, %146
%148 = sext i32 %147 to i64
%149 = getelementptr inbounds [2 x double], [2 x double]* %144, i64 %148
%150 = getelementptr inbounds [2 x double], [2 x double]* %149, i64 0, i64 0
%151 = load double, double* %150
%152 = load [2 x double]*, [2 x double]** %7
%153 = load i32, i32* %17
%154 = add nsw i32 %153, 1
%155 = load i32, i32* %18
%156 = srem i32 %154, %155
%157 = sext i32 %156 to i64
%158 = getelementptr inbounds [2 x double], [2 x double]* %152, i64 %157
%159 = getelementptr inbounds [2 x double], [2 x double]* %158, i64 0, i64 0
%160 = load double, double* %159
%161 = fsub double %151, %160
store double %161, double* %15
%162 = load double, double* %14
%163 = load double, double* %14
%164 = load double, double* %15
%165 = load double, double* %15
%166 = fmul double %164, %165
%167 = call double @llvm.fmuladd.f64(double %162, double %163, double %166)
%168 = call double @sqrt(double %167)
store double %168, double* %16
%169 = load double, double* %14
%170 = load double, double* %16
%171 = fdiv double %169, %170
%172 = load double, double* %15
%173 = load double, double* %16
%174 = fdiv double %172, %173
%175 = call i32 @glNormal3f(double %171, double %174, double 0.000000e+00)
br label %176
176: ; preds = %90
%177 = load i32, i32* %17
%178 = add nsw i32 %177, 1
store i32 %178, i32* %17
br label %86
179: ; preds = %86
%180 = call i32 (...) @glEnd()
%181 = call i32 (...) @glEndList()
%182 = load i32, i32* %12
%183 = load i32, i32* @GL_COMPILE
%184 = call i32 @glNewList(i32 %182, i32 %183)
%185 = load i32, i32* @GL_CW
%186 = call i32 @glFrontFace(i32 %185)
%187 = load i32, i32* %11
%188 = call i32 @glCallList(i32 %187)
%189 = call i32 @glNormal3f(double 0.000000e+00, double 0.000000e+00, double -1.000000e+00)
%190 = load i32, i32* %10
%191 = call i32 @glCallList(i32 %190)
%192 = call i32 (...) @glPushMatrix()
%193 = load double, double* %9
%194 = call i32 @glTranslatef(double 0.000000e+00, double 0.000000e+00, double %193)
%195 = load i32, i32* @GL_CCW
%196 = call i32 @glFrontFace(i32 %195)
%197 = call i32 @glNormal3f(double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%198 = load i32, i32* %10
%199 = call i32 @glCallList(i32 %198)
%200 = call i32 (...) @glPopMatrix()
%201 = 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
}