#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_QUAD_STRIP;
int /*<<< orphan*/ GL_TRIANGLE_FAN;
float cos(float);
double fabs(float);
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glNormal3f(float, float, float);
int /*<<< orphan*/ glVertex4f(float, float, float, float);
float sin(float);
void draw_special_sphere(int tess) {
  float r = 1.0, r1, r2, z1, z2;
  float theta, phi;
  int nlon = tess, nlat = tess;
  int i, j;
  glBegin(GL_TRIANGLE_FAN);
  theta = 3.14159265358979323846 * 1.0 / nlat;
  r2 = r * sin(theta);
  z2 = r * cos(theta);
  glNormal3f(0.0, 0.0, 1.0);
  glVertex4f(0.0, 0.0, r * r, r);
  for (j = 0, phi = 0.0; j <= nlon;
       j++, phi = 2 * 3.14159265358979323846 * j / nlon) {
    glNormal3f(r2 * cos(phi), r2 * sin(phi), z2);
    glVertex4f(r2 * cos(phi) * z2, r2 * sin(phi) * z2, z2 * z2, z2);
  }
  glEnd();
  for (i = 2; i < nlat; i++) {
    theta = 3.14159265358979323846 * i / nlat;
    r1 = r * sin(3.14159265358979323846 * (i - 1) / nlat);
    z1 = r * cos(3.14159265358979323846 * (i - 1) / nlat);
    r2 = r * sin(theta);
    z2 = r * cos(theta);
    if (fabs(z1) < 0.01 || fabs(z2) < 0.01)
      break;
    glBegin(GL_QUAD_STRIP);
    for (j = 0, phi = 0; j <= nlat;
         j++, phi = 2 * 3.14159265358979323846 * j / nlon) {
      glNormal3f(r1 * cos(phi), r1 * sin(phi), z1);
      glVertex4f(r1 * cos(phi) * z1, r1 * sin(phi) * z1, z1 * z1, z1);
      glNormal3f(r2 * cos(phi), r2 * sin(phi), z2);
      glVertex4f(r2 * cos(phi) * z2, r2 * sin(phi) * z2, z2 * z2, z2);
    }
    glEnd();
  }
}


x86 assembly (clang, -O0):
<draw_special_sphere>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
movss  0xe7a(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    0x2e3a(%rip),%rax
mov    (%rax),%edi
call   1080 <glBegin@plt>
cvtsi2sdl -0x28(%rbp),%xmm1
movsd  0xe56(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x1c(%rbp),%xmm0
call   1060 <sin@plt>
movaps %xmm0,%xmm1
movss  -0x38(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x1c(%rbp),%xmm0
call   1070 <cos@plt>
movaps %xmm0,%xmm1
movss  -0x34(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
xorps  %xmm1,%xmm1
movss  0xdec(%rip),%xmm2
movaps %xmm1,%xmm0
call   1090 <glNormal3f@plt>
movss  -0x8(%rbp),%xmm2
mulss  -0x8(%rbp),%xmm2
movss  -0x8(%rbp),%xmm3
xorps  %xmm1,%xmm1
movaps %xmm1,%xmm0
call   1040 <glVertex4f@plt>
movl   $0x0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x24(%rbp),%eax
jg     133e <draw_special_sphere+0x1ce>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x50(%rbp)
movss  -0x20(%rbp),%xmm0
call   1070 <cos@plt>
movaps %xmm0,%xmm1
movss  -0x50(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x48(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4c(%rbp)
movss  -0x20(%rbp),%xmm0
call   1060 <sin@plt>
movss  -0x4c(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0x48(%rbp),%xmm0
mulss  %xmm2,%xmm1
movss  -0x18(%rbp),%xmm2
call   1090 <glNormal3f@plt>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x44(%rbp)
movss  -0x20(%rbp),%xmm0
call   1070 <cos@plt>
movaps %xmm0,%xmm1
movss  -0x44(%rbp),%xmm0
mulss  %xmm1,%xmm0
mulss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x40(%rbp)
movss  -0x20(%rbp),%xmm0
call   1060 <sin@plt>
movss  -0x40(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0x3c(%rbp),%xmm0
mulss  %xmm2,%xmm1
mulss  -0x18(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
mulss  -0x18(%rbp),%xmm2
movss  -0x18(%rbp),%xmm3
call   1040 <glVertex4f@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
cvtsi2sdl -0x30(%rbp),%xmm1
movsd  0xcf5(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x24(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
jmp    1245 <draw_special_sphere+0xd5>
mov    $0x0,%al
call   1030 <glEnd@plt>
movl   $0x2,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    168d <draw_special_sphere+0x51d>
cvtsi2sdl -0x2c(%rbp),%xmm1
movsd  0xca3(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x60(%rbp)
mov    -0x2c(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm1
movsd  0xc71(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1060 <sin@plt>
movaps %xmm0,%xmm1
movss  -0x60(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x5c(%rbp)
mov    -0x2c(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm1
movsd  0xc2e(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1070 <cos@plt>
movaps %xmm0,%xmm1
movss  -0x5c(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x58(%rbp)
movss  -0x1c(%rbp),%xmm0
call   1060 <sin@plt>
movaps %xmm0,%xmm1
movss  -0x58(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x54(%rbp)
movss  -0x1c(%rbp),%xmm0
call   1070 <cos@plt>
movaps %xmm0,%xmm1
movss  -0x54(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
call   1050 <fabs@plt>
movaps %xmm0,%xmm1
movsd  0xbb0(%rip),%xmm0
ucomisd %xmm1,%xmm0
ja     1489 <draw_special_sphere+0x319>
movss  -0x18(%rbp),%xmm0
call   1050 <fabs@plt>
movaps %xmm0,%xmm1
movsd  0xb91(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    148e <draw_special_sphere+0x31e>
jmp    168d <draw_special_sphere+0x51d>
mov    0x2b53(%rip),%rax
mov    (%rax),%edi
call   1080 <glBegin@plt>
movl   $0x0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x28(%rbp),%eax
jg     1678 <draw_special_sphere+0x508>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x90(%rbp)
ff
movss  -0x20(%rbp),%xmm0
call   1070 <cos@plt>
movaps %xmm0,%xmm1
movss  -0x90(%rbp),%xmm0
ff
mulss  %xmm1,%xmm0
movss  %xmm0,-0x88(%rbp)
ff
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x8c(%rbp)
ff
movss  -0x20(%rbp),%xmm0
call   1060 <sin@plt>
movss  -0x8c(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movss  -0x88(%rbp),%xmm0
ff
mulss  %xmm2,%xmm1
movss  -0x14(%rbp),%xmm2
call   1090 <glNormal3f@plt>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x84(%rbp)
ff
movss  -0x20(%rbp),%xmm0
call   1070 <cos@plt>
movaps %xmm0,%xmm1
movss  -0x84(%rbp),%xmm0
ff
mulss  %xmm1,%xmm0
mulss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x7c(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x80(%rbp)
movss  -0x20(%rbp),%xmm0
call   1060 <sin@plt>
movss  -0x80(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0x7c(%rbp),%xmm0
mulss  %xmm2,%xmm1
mulss  -0x14(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
mulss  -0x14(%rbp),%xmm2
movss  -0x14(%rbp),%xmm3
call   1040 <glVertex4f@plt>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x78(%rbp)
movss  -0x20(%rbp),%xmm0
call   1070 <cos@plt>
movaps %xmm0,%xmm1
movss  -0x78(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x70(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x74(%rbp)
movss  -0x20(%rbp),%xmm0
call   1060 <sin@plt>
movss  -0x74(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0x70(%rbp),%xmm0
mulss  %xmm2,%xmm1
movss  -0x18(%rbp),%xmm2
call   1090 <glNormal3f@plt>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x6c(%rbp)
movss  -0x20(%rbp),%xmm0
call   1070 <cos@plt>
movaps %xmm0,%xmm1
movss  -0x6c(%rbp),%xmm0
mulss  %xmm1,%xmm0
mulss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x64(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x68(%rbp)
movss  -0x20(%rbp),%xmm0
call   1060 <sin@plt>
movss  -0x68(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0x64(%rbp),%xmm0
mulss  %xmm2,%xmm1
mulss  -0x18(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
mulss  -0x18(%rbp),%xmm2
movss  -0x18(%rbp),%xmm3
call   1040 <glVertex4f@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
cvtsi2sdl -0x30(%rbp),%xmm1
movsd  0x9bb(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x24(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
jmp    14ab <draw_special_sphere+0x33b>
mov    $0x0,%al
call   1030 <glEnd@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    134c <draw_special_sphere+0x1dc>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_special_sphere>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x30,%rsp
mov    %edi,%r14d
mov    0x2e52(%rip),%rax
mov    (%rax),%edi
call   1080 <glBegin@plt>
cvtsi2sd %r14d,%xmm1
movsd  0xe66(%rip),%xmm0
movsd  %xmm1,0x20(%rsp)
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x10(%rsp)
call   1060 <sin@plt>
movss  %xmm0,0x8(%rsp)
movss  0x10(%rsp),%xmm0
call   1070 <cos@plt>
movss  %xmm0,0xc(%rsp)
movss  0xe46(%rip),%xmm2
xorps  %xmm0,%xmm0
xorpd  %xmm1,%xmm1
call   1090 <glNormal3f@plt>
xorps  %xmm0,%xmm0
xorpd  %xmm1,%xmm1
movss  0xe2b(%rip),%xmm2
movaps %xmm2,%xmm3
call   1040 <glVertex4f@plt>
test   %r14d,%r14d
js     1550 <draw_special_sphere+0x3e0>
movss  0xc(%rsp),%xmm0
mulss  %xmm0,%xmm0
movss  %xmm0,0x1c(%rsp)
mov    %r14d,%ebx
neg    %ebx
mov    $0x1,%ebp
xorps  %xmm0,%xmm0
nopl   0x0(%rax,%rax,1)
movss  %xmm0,0x10(%rsp)
call   1070 <cos@plt>
mulss  0x8(%rsp),%xmm0
movss  %xmm0,0x14(%rsp)
movss  0x10(%rsp),%xmm0
call   1060 <sin@plt>
movaps %xmm0,%xmm1
mulss  0x8(%rsp),%xmm1
movss  0x14(%rsp),%xmm0
movss  0xc(%rsp),%xmm2
call   1090 <glNormal3f@plt>
movss  0x10(%rsp),%xmm0
call   1070 <cos@plt>
mulss  0x8(%rsp),%xmm0
mulss  0xc(%rsp),%xmm0
movss  %xmm0,0x14(%rsp)
movss  0x10(%rsp),%xmm0
call   1060 <sin@plt>
movaps %xmm0,%xmm1
mulss  0x8(%rsp),%xmm1
movss  0xc(%rsp),%xmm3
mulss  %xmm3,%xmm1
movss  0x14(%rsp),%xmm0
movss  0x1c(%rsp),%xmm2
call   1040 <glVertex4f@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
mulsd  0xd51(%rip),%xmm0
divsd  0x20(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
lea    (%rbx,%rbp,1),%eax
add    $0x1,%eax
mov    %ebp,%ecx
add    $0x1,%ecx
mov    %ecx,%ebp
cmp    $0x2,%eax
jne    1220 <draw_special_sphere+0xb0>
xor    %eax,%eax
call   1030 <glEnd@plt>
cmp    $0x3,%r14d
jl     1543 <draw_special_sphere+0x3d3>
mov    $0x2,%r12d
mov    0x2cf3(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
xorps  %xmm0,%xmm0
cvtsi2sd %r12d,%xmm0
movsd  0xcf0(%rip),%xmm2
mulsd  %xmm2,%xmm0
movsd  0x20(%rsp),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x8(%rsp)
lea    -0x1(%r12),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  %xmm2,%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
call   1060 <sin@plt>
movss  %xmm0,0x10(%rsp)
movss  0xc(%rsp),%xmm0
call   1070 <cos@plt>
movss  %xmm0,0x14(%rsp)
movss  0x8(%rsp),%xmm0
call   1060 <sin@plt>
movss  %xmm0,0xc(%rsp)
movss  0x8(%rsp),%xmm0
call   1070 <cos@plt>
movss  %xmm0,0x1c(%rsp)
movss  0x14(%rsp),%xmm0
call   1050 <fabs@plt>
movsd  0xc79(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     1543 <draw_special_sphere+0x3d3>
movss  0x1c(%rsp),%xmm0
call   1050 <fabs@plt>
movsd  0xc5c(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     1543 <draw_special_sphere+0x3d3>
mov    (%r15),%edi
call   1080 <glBegin@plt>
movss  0x14(%rsp),%xmm0
mulss  %xmm0,%xmm0
movss  %xmm0,0x2c(%rsp)
movss  0x1c(%rsp),%xmm0
mulss  %xmm0,%xmm0
movss  %xmm0,0x28(%rsp)
xorps  %xmm0,%xmm0
mov    $0x1,%ebp
xchg   %ax,%ax
movss  %xmm0,0x8(%rsp)
call   1070 <cos@plt>
mulss  0x10(%rsp),%xmm0
movss  %xmm0,0x18(%rsp)
movss  0x8(%rsp),%xmm0
call   1060 <sin@plt>
movaps %xmm0,%xmm1
mulss  0x10(%rsp),%xmm1
movss  0x18(%rsp),%xmm0
movss  0x14(%rsp),%xmm2
call   1090 <glNormal3f@plt>
movss  0x8(%rsp),%xmm0
call   1070 <cos@plt>
mulss  0x10(%rsp),%xmm0
mulss  0x14(%rsp),%xmm0
movss  %xmm0,0x18(%rsp)
movss  0x8(%rsp),%xmm0
call   1060 <sin@plt>
movaps %xmm0,%xmm1
mulss  0x10(%rsp),%xmm1
movss  0x14(%rsp),%xmm3
mulss  %xmm3,%xmm1
movss  0x18(%rsp),%xmm0
movss  0x2c(%rsp),%xmm2
call   1040 <glVertex4f@plt>
movss  0x8(%rsp),%xmm0
call   1070 <cos@plt>
mulss  0xc(%rsp),%xmm0
movss  %xmm0,0x18(%rsp)
movss  0x8(%rsp),%xmm0
call   1060 <sin@plt>
movaps %xmm0,%xmm1
mulss  0xc(%rsp),%xmm1
movss  0x18(%rsp),%xmm0
movss  0x1c(%rsp),%xmm2
call   1090 <glNormal3f@plt>
movss  0x8(%rsp),%xmm0
call   1070 <cos@plt>
mulss  0xc(%rsp),%xmm0
mulss  0x1c(%rsp),%xmm0
movss  %xmm0,0x18(%rsp)
movss  0x8(%rsp),%xmm0
call   1060 <sin@plt>
movaps %xmm0,%xmm1
mulss  0xc(%rsp),%xmm1
movss  0x1c(%rsp),%xmm3
mulss  %xmm3,%xmm1
movss  0x18(%rsp),%xmm0
movss  0x28(%rsp),%xmm2
call   1040 <glVertex4f@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
mulsd  0xaf9(%rip),%xmm0
divsd  0x20(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
lea    (%rbx,%rbp,1),%eax
add    $0x1,%eax
mov    %ebp,%ecx
add    $0x1,%ecx
mov    %ecx,%ebp
cmp    $0x2,%eax
jne    13f0 <draw_special_sphere+0x280>
xor    %eax,%eax
call   1030 <glEnd@plt>
add    $0x1,%r12d
cmp    %r14d,%r12d
jne    1300 <draw_special_sphere+0x190>
add    $0x30,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <glEnd@plt>

LLVM IR (-O0):
@GL_TRIANGLE_FAN = global i32 0
@GL_QUAD_STRIP = global i32 0
define void @draw_special_sphere(i32 %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 %0, i32* %2
store float 1.000000e+00, float* %3
%14 = load i32, i32* %2
store i32 %14, i32* %10
%15 = load i32, i32* %2
store i32 %15, i32* %11
%16 = load i32, i32* @GL_TRIANGLE_FAN
%17 = call i32 @glBegin(i32 %16)
%18 = load i32, i32* %11
%19 = sitofp i32 %18 to double
%20 = fdiv double 0x400921FB54442D18, %19
%21 = fptrunc double %20 to float
store float %21, float* %8
%22 = load float, float* %3
%23 = load float, float* %8
%24 = call float @sin(float %23)
%25 = fmul float %22, %24
store float %25, float* %5
%26 = load float, float* %3
%27 = load float, float* %8
%28 = call float @cos(float %27)
%29 = fmul float %26, %28
store float %29, float* %7
%30 = call i32 @glNormal3f(float 0.000000e+00, float 0.000000e+00, float 1.000000e+00)
%31 = load float, float* %3
%32 = load float, float* %3
%33 = fmul float %31, %32
%34 = load float, float* %3
%35 = call i32 @glVertex4f(float 0.000000e+00, float 0.000000e+00, float %33, float %34)
store i32 0, i32* %13
store float 0.000000e+00, float* %9
br label %36
36: ; preds = %68, %1
%37 = load i32, i32* %13
%38 = load i32, i32* %10
%39 = icmp sle i32 %37, %38
br i1 %39, label %40, label %78
40: ; preds = %36
%41 = load float, float* %5
%42 = load float, float* %9
%43 = call float @cos(float %42)
%44 = fmul float %41, %43
%45 = load float, float* %5
%46 = load float, float* %9
%47 = call float @sin(float %46)
%48 = fmul float %45, %47
%49 = load float, float* %7
%50 = call i32 @glNormal3f(float %44, float %48, float %49)
%51 = load float, float* %5
%52 = load float, float* %9
%53 = call float @cos(float %52)
%54 = fmul float %51, %53
%55 = load float, float* %7
%56 = fmul float %54, %55
%57 = load float, float* %5
%58 = load float, float* %9
%59 = call float @sin(float %58)
%60 = fmul float %57, %59
%61 = load float, float* %7
%62 = fmul float %60, %61
%63 = load float, float* %7
%64 = load float, float* %7
%65 = fmul float %63, %64
%66 = load float, float* %7
%67 = call i32 @glVertex4f(float %56, float %62, float %65, float %66)
br label %68
68: ; preds = %40
%69 = load i32, i32* %13
%70 = add nsw i32 %69, 1
store i32 %70, i32* %13
%71 = load i32, i32* %13
%72 = sitofp i32 %71 to double
%73 = fmul double 0x401921FB54442D18, %72
%74 = load i32, i32* %10
%75 = sitofp i32 %74 to double
%76 = fdiv double %73, %75
%77 = fptrunc double %76 to float
store float %77, float* %9
br label %36
78: ; preds = %36
%79 = call i32 (...) @glEnd()
store i32 2, i32* %12
br label %80
80: ; preds = %204, %78
%81 = load i32, i32* %12
%82 = load i32, i32* %11
%83 = icmp slt i32 %81, %82
br i1 %83, label %84, label %207
84: ; preds = %80
%85 = load i32, i32* %12
%86 = sitofp i32 %85 to double
%87 = fmul double 0x400921FB54442D18, %86
%88 = load i32, i32* %11
%89 = sitofp i32 %88 to double
%90 = fdiv double %87, %89
%91 = fptrunc double %90 to float
store float %91, float* %8
%92 = load float, float* %3
%93 = load i32, i32* %12
%94 = sub nsw i32 %93, 1
%95 = sitofp i32 %94 to double
%96 = fmul double 0x400921FB54442D18, %95
%97 = load i32, i32* %11
%98 = sitofp i32 %97 to double
%99 = fdiv double %96, %98
%100 = fptrunc double %99 to float
%101 = call float @sin(float %100)
%102 = fmul float %92, %101
store float %102, float* %4
%103 = load float, float* %3
%104 = load i32, i32* %12
%105 = sub nsw i32 %104, 1
%106 = sitofp i32 %105 to double
%107 = fmul double 0x400921FB54442D18, %106
%108 = load i32, i32* %11
%109 = sitofp i32 %108 to double
%110 = fdiv double %107, %109
%111 = fptrunc double %110 to float
%112 = call float @cos(float %111)
%113 = fmul float %103, %112
store float %113, float* %6
%114 = load float, float* %3
%115 = load float, float* %8
%116 = call float @sin(float %115)
%117 = fmul float %114, %116
store float %117, float* %5
%118 = load float, float* %3
%119 = load float, float* %8
%120 = call float @cos(float %119)
%121 = fmul float %118, %120
store float %121, float* %7
%122 = load float, float* %6
%123 = call double @fabs(float %122)
%124 = fcmp olt double %123, 1.000000e-02
br i1 %124, label %129, label %125
125: ; preds = %84
%126 = load float, float* %7
%127 = call double @fabs(float %126)
%128 = fcmp olt double %127, 1.000000e-02
br i1 %128, label %129, label %130
129: ; preds = %125, %84
br label %207
130: ; preds = %125
%131 = load i32, i32* @GL_QUAD_STRIP
%132 = call i32 @glBegin(i32 %131)
store i32 0, i32* %13
store float 0.000000e+00, float* %9
br label %133
133: ; preds = %192, %130
%134 = load i32, i32* %13
%135 = load i32, i32* %11
%136 = icmp sle i32 %134, %135
br i1 %136, label %137, label %202
137: ; preds = %133
%138 = load float, float* %4
%139 = load float, float* %9
%140 = call float @cos(float %139)
%141 = fmul float %138, %140
%142 = load float, float* %4
%143 = load float, float* %9
%144 = call float @sin(float %143)
%145 = fmul float %142, %144
%146 = load float, float* %6
%147 = call i32 @glNormal3f(float %141, float %145, float %146)
%148 = load float, float* %4
%149 = load float, float* %9
%150 = call float @cos(float %149)
%151 = fmul float %148, %150
%152 = load float, float* %6
%153 = fmul float %151, %152
%154 = load float, float* %4
%155 = load float, float* %9
%156 = call float @sin(float %155)
%157 = fmul float %154, %156
%158 = load float, float* %6
%159 = fmul float %157, %158
%160 = load float, float* %6
%161 = load float, float* %6
%162 = fmul float %160, %161
%163 = load float, float* %6
%164 = call i32 @glVertex4f(float %153, float %159, float %162, float %163)
%165 = load float, float* %5
%166 = load float, float* %9
%167 = call float @cos(float %166)
%168 = fmul float %165, %167
%169 = load float, float* %5
%170 = load float, float* %9
%171 = call float @sin(float %170)
%172 = fmul float %169, %171
%173 = load float, float* %7
%174 = call i32 @glNormal3f(float %168, float %172, float %173)
%175 = load float, float* %5
%176 = load float, float* %9
%177 = call float @cos(float %176)
%178 = fmul float %175, %177
%179 = load float, float* %7
%180 = fmul float %178, %179
%181 = load float, float* %5
%182 = load float, float* %9
%183 = call float @sin(float %182)
%184 = fmul float %181, %183
%185 = load float, float* %7
%186 = fmul float %184, %185
%187 = load float, float* %7
%188 = load float, float* %7
%189 = fmul float %187, %188
%190 = load float, float* %7
%191 = call i32 @glVertex4f(float %180, float %186, float %189, float %190)
br label %192
192: ; preds = %137
%193 = load i32, i32* %13
%194 = add nsw i32 %193, 1
store i32 %194, i32* %13
%195 = load i32, i32* %13
%196 = sitofp i32 %195 to double
%197 = fmul double 0x401921FB54442D18, %196
%198 = load i32, i32* %10
%199 = sitofp i32 %198 to double
%200 = fdiv double %197, %199
%201 = fptrunc double %200 to float
store float %201, float* %9
br label %133
202: ; preds = %133
%203 = call i32 (...) @glEnd()
br label %204
204: ; preds = %202
%205 = load i32, i32* %12
%206 = add nsw i32 %205, 1
store i32 %206, i32* %12
br label %80
207: ; preds = %129, %80
ret void
}

LLVM IR (-O2):
@GL_TRIANGLE_FAN = global i32 0
@GL_QUAD_STRIP = global i32 0
define void @draw_special_sphere(i32 %0) {
%2 = load i32, i32* @GL_TRIANGLE_FAN
%3 = tail call i32 @glBegin(i32 %2)
%4 = sitofp i32 %0 to double
%5 = fdiv double 0x400921FB54442D18, %4
%6 = fptrunc double %5 to float
%7 = tail call float @sin(float %6)
%8 = tail call float @cos(float %6)
%9 = tail call i32 @glNormal3f(float 0.000000e+00, float 0.000000e+00, float 1.000000e+00)
%10 = tail call i32 @glVertex4f(float 0.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00)
%11 = icmp slt i32 %0, 0
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = tail call i32 (...) @glEnd()
br label %102
14: ; preds = %1
%15 = fmul float %8, %8
br label %16
16: ; preds = %14, %16
%17 = phi i32 [ 0, %14 ], [ %31, %16 ]
%18 = phi float [ 0.000000e+00, %14 ], [ %35, %16 ]
%19 = tail call float @cos(float %18)
%20 = fmul float %7, %19
%21 = tail call float @sin(float %18)
%22 = fmul float %7, %21
%23 = tail call i32 @glNormal3f(float %20, float %22, float %8)
%24 = tail call float @cos(float %18)
%25 = fmul float %7, %24
%26 = fmul float %8, %25
%27 = tail call float @sin(float %18)
%28 = fmul float %7, %27
%29 = fmul float %8, %28
%30 = tail call i32 @glVertex4f(float %26, float %29, float %15, float %8)
%31 = add nuw i32 %17, 1
%32 = sitofp i32 %31 to double
%33 = fmul double %32, 0x401921FB54442D18
%34 = fdiv double %33, %4
%35 = fptrunc double %34 to float
%36 = icmp eq i32 %17, %0
br i1 %36, label %37, label %16
37: ; preds = %16
%38 = tail call i32 (...) @glEnd()
%39 = icmp sgt i32 %0, 2
br i1 %39, label %40, label %102
40: ; preds = %37, %98
%41 = phi i32 [ %100, %98 ], [ 2, %37 ]
%42 = sitofp i32 %41 to double
%43 = fmul double %42, 0x400921FB54442D18
%44 = fdiv double %43, %4
%45 = fptrunc double %44 to float
%46 = add nsw i32 %41, -1
%47 = sitofp i32 %46 to double
%48 = fmul double %47, 0x400921FB54442D18
%49 = fdiv double %48, %4
%50 = fptrunc double %49 to float
%51 = tail call float @sin(float %50)
%52 = tail call float @cos(float %50)
%53 = tail call float @sin(float %45)
%54 = tail call float @cos(float %45)
%55 = tail call double @fabs(float %52)
%56 = fcmp olt double %55, 1.000000e-02
br i1 %56, label %102, label %57
57: ; preds = %40
%58 = tail call double @fabs(float %54)
%59 = fcmp olt double %58, 1.000000e-02
br i1 %59, label %102, label %60
60: ; preds = %57
%61 = load i32, i32* @GL_QUAD_STRIP
%62 = tail call i32 @glBegin(i32 %61)
%63 = fmul float %52, %52
%64 = fmul float %54, %54
br label %65
65: ; preds = %60, %65
%66 = phi i32 [ 0, %60 ], [ %92, %65 ]
%67 = phi float [ 0.000000e+00, %60 ], [ %96, %65 ]
%68 = tail call float @cos(float %67)
%69 = fmul float %51, %68
%70 = tail call float @sin(float %67)
%71 = fmul float %51, %70
%72 = tail call i32 @glNormal3f(float %69, float %71, float %52)
%73 = tail call float @cos(float %67)
%74 = fmul float %51, %73
%75 = fmul float %52, %74
%76 = tail call float @sin(float %67)
%77 = fmul float %51, %76
%78 = fmul float %52, %77
%79 = tail call i32 @glVertex4f(float %75, float %78, float %63, float %52)
%80 = tail call float @cos(float %67)
%81 = fmul float %53, %80
%82 = tail call float @sin(float %67)
%83 = fmul float %53, %82
%84 = tail call i32 @glNormal3f(float %81, float %83, float %54)
%85 = tail call float @cos(float %67)
%86 = fmul float %53, %85
%87 = fmul float %54, %86
%88 = tail call float @sin(float %67)
%89 = fmul float %53, %88
%90 = fmul float %54, %89
%91 = tail call i32 @glVertex4f(float %87, float %90, float %64, float %54)
%92 = add nuw i32 %66, 1
%93 = sitofp i32 %92 to double
%94 = fmul double %93, 0x401921FB54442D18
%95 = fdiv double %94, %4
%96 = fptrunc double %95 to float
%97 = icmp eq i32 %66, %0
br i1 %97, label %98, label %65
98: ; preds = %65
%99 = tail call i32 (...) @glEnd()
%100 = add nuw nsw i32 %41, 1
%101 = icmp eq i32 %100, %0
br i1 %101, label %102, label %40
102: ; preds = %98, %57, %40, %12, %37
ret void
}