#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;
double cos(double);
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glColor3d(double, double, double);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glVertex3d(double, double, double);
double sin(double);
void sphere(double r, int m, int n) {
  double step1 = 3.1415926 / (n + 1);
  double step2 = 3.1415926 / (m + 1);
  double t, theta = 0, phi = 0;
  int i1 = 0, i2 = 0;
  double x1, y1, z1;
  double x2, y2, z2;
  double x3, y3;
  double x4, y4;
  glBegin(GL_QUAD_STRIP);
  for (theta = 0; theta <= 3.1415926; theta += step1) {
    z1 = r * cos(theta);
    z2 = -r * cos(theta + step1);
    if (i1 == 0) {
      i1 = 1;
    } else {
      i1 = 0;
    }
    for (phi = 0; phi <= 2 * 3.1415926; phi += step2) {
      if (i1 == 0) {
        glColor3d(1.0, 0.0, 0.0);
        i1 = 1;
      } else {
        glColor3d(1.0, 0.2, 1.0);
        i1 = 0;
      }
      x1 = r * cos(phi) * sin(theta);
      y1 = r * sin(theta) * sin(phi);
      x2 = r * cos(phi) * sin(theta + step1);
      y2 = r * sin(theta + step1) * sin(phi);
      x3 = r * cos(phi + step2) * sin(theta);
      y3 = r * sin(theta) * sin(phi + step2);
      x4 = r * cos(phi + step2) * sin(theta + step1);
      y4 = r * sin(theta + step1) * sin(phi + step2);
      glVertex3d(x1, y1, z1);
      glVertex3d(x2, y2, z2);
      glVertex3d(x3, y3, z1);
      glVertex3d(x4, y4, z2);
    }
  }
  glEnd();
}


x86 assembly (clang, -O0):
<sphere>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
movsd  0xe78(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
movsd  0xe5d(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
movl   $0x0,-0x40(%rbp)
mov    0x2e17(%rip),%rax
mov    (%rax),%edi
call   1080 <glBegin@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe18(%rip),%xmm0
ucomisd -0x30(%rbp),%xmm0
jb     15f6 <sphere+0x496>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
call   1070 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0xa0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
call   1070 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x98(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
cmpl   $0x0,-0x3c(%rbp)
jne    127b <sphere+0x11b>
movl   $0x1,-0x3c(%rbp)
jmp    1282 <sphere+0x122>
movl   $0x0,-0x3c(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xd76(%rip),%xmm0
ucomisd -0x38(%rbp),%xmm0
jb     15dd <sphere+0x47d>
cmpl   $0x0,-0x3c(%rbp)
jne    12c6 <sphere+0x166>
movsd  0xd61(%rip),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm1
call   1060 <glColor3d@plt>
movl   $0x1,-0x3c(%rbp)
jmp    12e5 <sphere+0x185>
movsd  0xd42(%rip),%xmm2
movsd  0xd42(%rip),%xmm1
movaps %xmm2,%xmm0
call   1060 <glColor3d@plt>
movl   $0x0,-0x3c(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x120(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
call   1070 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x120(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
call   1050 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x118(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x110(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
call   1050 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x110(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
call   1050 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x108(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
call   1070 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x100(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
call   1050 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0xf8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
call   1050 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0xf0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xe8(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1050 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0xe8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
call   1070 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0xe0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
call   1050 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0xd8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
call   1050 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0xd0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
call   1050 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0xc8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
call   1070 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0xc0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
call   1050 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0xb8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
call   1050 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0xb0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
call   1050 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0xa8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
call   1030 <glVertex3d@plt>
movsd  -0x60(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm2
call   1030 <glVertex3d@plt>
movsd  -0x78(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
call   1030 <glVertex3d@plt>
movsd  -0x88(%rbp),%xmm0
ff
movsd  -0x90(%rbp),%xmm1
ff
movsd  -0x70(%rbp),%xmm2
call   1030 <glVertex3d@plt>
movsd  -0x20(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    128a <sphere+0x12a>
jmp    15e2 <sphere+0x482>
movsd  -0x18(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    11e0 <sphere+0x80>
mov    $0x0,%al
call   1040 <glEnd@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sphere>:
push   %rbx
sub    $0xa0,%rsp
movaps %xmm0,0x40(%rsp)
add    $0x1,%esi
xorps  %xmm0,%xmm0
cvtsi2sd %esi,%xmm0
movsd  0xe81(%rip),%xmm2
movapd %xmm2,%xmm3
add    $0x1,%edi
cvtsi2sd %edi,%xmm1
divsd  %xmm0,%xmm3
movsd  %xmm3,0x60(%rsp)
divsd  %xmm1,%xmm2
movsd  %xmm2,0x68(%rsp)
mov    0x2e43(%rip),%rax
mov    (%rax),%edi
call   1080 <glBegin@plt>
movapd 0xe6c(%rip),%xmm0
xorpd  0x40(%rsp),%xmm0
movapd %xmm0,0x90(%rsp)
xor    %ebx,%ebx
xorpd  %xmm0,%xmm0
jmp    11ec <sphere+0x8c>
nopl   0x0(%rax,%rax,1)
movsd  0xe28(%rip),%xmm0
movsd  0x38(%rsp),%xmm1
ucomisd %xmm1,%xmm0
movapd %xmm1,%xmm0
jb     149a <sphere+0x33a>
movsd  %xmm0,0x30(%rsp)
call   1070 <cos@plt>
mulsd  0x40(%rsp),%xmm0
movsd  %xmm0,0x58(%rsp)
movsd  0x60(%rsp),%xmm0
addsd  0x30(%rsp),%xmm0
movsd  %xmm0,0x38(%rsp)
call   1070 <cos@plt>
mulsd  0x90(%rsp),%xmm0
movsd  %xmm0,0x50(%rsp)
xor    %eax,%eax
test   %ebx,%ebx
sete   %al
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %eax,%ebx
jmp    1473 <sphere+0x313>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  0xdb8(%rip),%xmm0
movsd  0xda8(%rip),%xmm1
movapd %xmm0,%xmm2
call   1060 <glColor3d@plt>
xor    %ebx,%ebx
movsd  0x8(%rsp),%xmm0
call   1070 <cos@plt>
mulsd  0x40(%rsp),%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0x30(%rsp),%xmm0
call   1050 <sin@plt>
mulsd  0x28(%rsp),%xmm0
movsd  %xmm0,0x88(%rsp)
movsd  0x30(%rsp),%xmm0
call   1050 <sin@plt>
mulsd  0x40(%rsp),%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <sin@plt>
movsd  0x28(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x28(%rsp)
movsd  0x8(%rsp),%xmm0
call   1070 <cos@plt>
mulsd  0x40(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x38(%rsp),%xmm0
call   1050 <sin@plt>
mulsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x80(%rsp)
movsd  0x38(%rsp),%xmm0
call   1050 <sin@plt>
mulsd  0x40(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <sin@plt>
movsd  0x20(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
addsd  0x68(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
call   1070 <cos@plt>
mulsd  0x40(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x30(%rsp),%xmm0
call   1050 <sin@plt>
mulsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x78(%rsp)
movsd  0x30(%rsp),%xmm0
call   1050 <sin@plt>
mulsd  0x40(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <sin@plt>
movsd  0x18(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
movsd  0x8(%rsp),%xmm0
call   1070 <cos@plt>
mulsd  0x40(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x38(%rsp),%xmm0
call   1050 <sin@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x70(%rsp)
movsd  0x38(%rsp),%xmm0
call   1050 <sin@plt>
mulsd  0x40(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <sin@plt>
movsd  0x10(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0x88(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
movsd  0x58(%rsp),%xmm2
call   1030 <glVertex3d@plt>
movsd  0x80(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
movsd  0x50(%rsp),%xmm2
call   1030 <glVertex3d@plt>
movsd  0x78(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movsd  0x58(%rsp),%xmm2
call   1030 <glVertex3d@plt>
movsd  0x70(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x50(%rsp),%xmm2
call   1030 <glVertex3d@plt>
movsd  0xbb1(%rip),%xmm0
ucomisd 0x8(%rsp),%xmm0
jb     11d0 <sphere+0x70>
test   %ebx,%ebx
jne    1250 <sphere+0xf0>
xorpd  %xmm1,%xmm1
xorpd  %xmm2,%xmm2
movsd  0xb85(%rip),%xmm0
call   1060 <glColor3d@plt>
mov    $0x1,%ebx
jmp    126b <sphere+0x10b>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbx
jmp    1040 <glEnd@plt>

LLVM IR (-O0):
@GL_QUAD_STRIP = global i32 0
define void @sphere(double %0, i32 %1, i32 %2) {
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca i32
%13 = alloca i32
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
store double %0, double* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
%26 = sitofp i32 %25 to double
%27 = fdiv double 0x400921FB4D12D84A, %26
store double %27, double* %7
%28 = load i32, i32* %5
%29 = add nsw i32 %28, 1
%30 = sitofp i32 %29 to double
%31 = fdiv double 0x400921FB4D12D84A, %30
store double %31, double* %8
store double 0.000000e+00, double* %10
store double 0.000000e+00, double* %11
store i32 0, i32* %12
store i32 0, i32* %13
%32 = load i32, i32* @GL_QUAD_STRIP
%33 = call i32 @glBegin(i32 %32)
store double 0.000000e+00, double* %10
br label %34
34: ; preds = %158, %3
%35 = load double, double* %10
%36 = fcmp ole double %35, 0x400921FB4D12D84A
br i1 %36, label %37, label %162
37: ; preds = %34
%38 = load double, double* %4
%39 = load double, double* %10
%40 = call double @cos(double %39)
%41 = fmul double %38, %40
store double %41, double* %16
%42 = load double, double* %4
%43 = fneg double %42
%44 = load double, double* %10
%45 = load double, double* %7
%46 = fadd double %44, %45
%47 = call double @cos(double %46)
%48 = fmul double %43, %47
store double %48, double* %19
%49 = load i32, i32* %12
%50 = icmp eq i32 %49, 0
br i1 %50, label %51, label %52
51: ; preds = %37
store i32 1, i32* %12
br label %53
52: ; preds = %37
store i32 0, i32* %12
br label %53
53: ; preds = %52, %51
store double 0.000000e+00, double* %11
br label %54
54: ; preds = %153, %53
%55 = load double, double* %11
%56 = fcmp ole double %55, 0x401921FB4D12D84A
br i1 %56, label %57, label %157
57: ; preds = %54
%58 = load i32, i32* %12
%59 = icmp eq i32 %58, 0
br i1 %59, label %60, label %62
60: ; preds = %57
%61 = call i32 @glColor3d(double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
store i32 1, i32* %12
br label %64
62: ; preds = %57
%63 = call i32 @glColor3d(double 1.000000e+00, double 2.000000e-01, double 1.000000e+00)
store i32 0, i32* %12
br label %64
64: ; preds = %62, %60
%65 = load double, double* %4
%66 = load double, double* %11
%67 = call double @cos(double %66)
%68 = fmul double %65, %67
%69 = load double, double* %10
%70 = call double @sin(double %69)
%71 = fmul double %68, %70
store double %71, double* %14
%72 = load double, double* %4
%73 = load double, double* %10
%74 = call double @sin(double %73)
%75 = fmul double %72, %74
%76 = load double, double* %11
%77 = call double @sin(double %76)
%78 = fmul double %75, %77
store double %78, double* %15
%79 = load double, double* %4
%80 = load double, double* %11
%81 = call double @cos(double %80)
%82 = fmul double %79, %81
%83 = load double, double* %10
%84 = load double, double* %7
%85 = fadd double %83, %84
%86 = call double @sin(double %85)
%87 = fmul double %82, %86
store double %87, double* %17
%88 = load double, double* %4
%89 = load double, double* %10
%90 = load double, double* %7
%91 = fadd double %89, %90
%92 = call double @sin(double %91)
%93 = fmul double %88, %92
%94 = load double, double* %11
%95 = call double @sin(double %94)
%96 = fmul double %93, %95
store double %96, double* %18
%97 = load double, double* %4
%98 = load double, double* %11
%99 = load double, double* %8
%100 = fadd double %98, %99
%101 = call double @cos(double %100)
%102 = fmul double %97, %101
%103 = load double, double* %10
%104 = call double @sin(double %103)
%105 = fmul double %102, %104
store double %105, double* %20
%106 = load double, double* %4
%107 = load double, double* %10
%108 = call double @sin(double %107)
%109 = fmul double %106, %108
%110 = load double, double* %11
%111 = load double, double* %8
%112 = fadd double %110, %111
%113 = call double @sin(double %112)
%114 = fmul double %109, %113
store double %114, double* %21
%115 = load double, double* %4
%116 = load double, double* %11
%117 = load double, double* %8
%118 = fadd double %116, %117
%119 = call double @cos(double %118)
%120 = fmul double %115, %119
%121 = load double, double* %10
%122 = load double, double* %7
%123 = fadd double %121, %122
%124 = call double @sin(double %123)
%125 = fmul double %120, %124
store double %125, double* %22
%126 = load double, double* %4
%127 = load double, double* %10
%128 = load double, double* %7
%129 = fadd double %127, %128
%130 = call double @sin(double %129)
%131 = fmul double %126, %130
%132 = load double, double* %11
%133 = load double, double* %8
%134 = fadd double %132, %133
%135 = call double @sin(double %134)
%136 = fmul double %131, %135
store double %136, double* %23
%137 = load double, double* %14
%138 = load double, double* %15
%139 = load double, double* %16
%140 = call i32 @glVertex3d(double %137, double %138, double %139)
%141 = load double, double* %17
%142 = load double, double* %18
%143 = load double, double* %19
%144 = call i32 @glVertex3d(double %141, double %142, double %143)
%145 = load double, double* %20
%146 = load double, double* %21
%147 = load double, double* %16
%148 = call i32 @glVertex3d(double %145, double %146, double %147)
%149 = load double, double* %22
%150 = load double, double* %23
%151 = load double, double* %19
%152 = call i32 @glVertex3d(double %149, double %150, double %151)
br label %153
153: ; preds = %64
%154 = load double, double* %8
%155 = load double, double* %11
%156 = fadd double %155, %154
store double %156, double* %11
br label %54
157: ; preds = %54
br label %158
158: ; preds = %157
%159 = load double, double* %7
%160 = load double, double* %10
%161 = fadd double %160, %159
store double %161, double* %10
br label %34
162: ; preds = %34
%163 = call i32 (...) @glEnd()
ret void
}

LLVM IR (-O2):
@GL_QUAD_STRIP = global i32 0
define void @sphere(double %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, 1
%5 = sitofp i32 %4 to double
%6 = fdiv double 0x400921FB4D12D84A, %5
%7 = add nsw i32 %1, 1
%8 = sitofp i32 %7 to double
%9 = fdiv double 0x400921FB4D12D84A, %8
%10 = load i32, i32* @GL_QUAD_STRIP
%11 = tail call i32 @glBegin(i32 %10)
%12 = fneg double %0
br label %15
13: ; preds = %33
%14 = fcmp ugt double %20, 0x400921FB4D12D84A
br i1 %14, label %73, label %15
15: ; preds = %3, %13
%16 = phi double [ 0.000000e+00, %3 ], [ %20, %13 ]
%17 = phi i32 [ 0, %3 ], [ %34, %13 ]
%18 = tail call double @cos(double %16)
%19 = fmul double %18, %0
%20 = fadd double %6, %16
%21 = tail call double @cos(double %20)
%22 = fmul double %21, %12
%23 = icmp eq i32 %17, 0
%24 = zext i1 %23 to i32
br label %25
25: ; preds = %15, %33
%26 = phi double [ 0.000000e+00, %15 ], [ %51, %33 ]
%27 = phi i32 [ %24, %15 ], [ %34, %33 ]
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %25
%30 = tail call i32 @glColor3d(double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
br label %33
31: ; preds = %25
%32 = tail call i32 @glColor3d(double 1.000000e+00, double 2.000000e-01, double 1.000000e+00)
br label %33
33: ; preds = %31, %29
%34 = phi i32 [ 1, %29 ], [ 0, %31 ]
%35 = tail call double @cos(double %26)
%36 = fmul double %35, %0
%37 = tail call double @sin(double %16)
%38 = fmul double %36, %37
%39 = tail call double @sin(double %16)
%40 = fmul double %39, %0
%41 = tail call double @sin(double %26)
%42 = fmul double %40, %41
%43 = tail call double @cos(double %26)
%44 = fmul double %43, %0
%45 = tail call double @sin(double %20)
%46 = fmul double %44, %45
%47 = tail call double @sin(double %20)
%48 = fmul double %47, %0
%49 = tail call double @sin(double %26)
%50 = fmul double %48, %49
%51 = fadd double %9, %26
%52 = tail call double @cos(double %51)
%53 = fmul double %52, %0
%54 = tail call double @sin(double %16)
%55 = fmul double %53, %54
%56 = tail call double @sin(double %16)
%57 = fmul double %56, %0
%58 = tail call double @sin(double %51)
%59 = fmul double %57, %58
%60 = tail call double @cos(double %51)
%61 = fmul double %60, %0
%62 = tail call double @sin(double %20)
%63 = fmul double %61, %62
%64 = tail call double @sin(double %20)
%65 = fmul double %64, %0
%66 = tail call double @sin(double %51)
%67 = fmul double %65, %66
%68 = tail call i32 @glVertex3d(double %38, double %42, double %19)
%69 = tail call i32 @glVertex3d(double %46, double %50, double %22)
%70 = tail call i32 @glVertex3d(double %55, double %59, double %19)
%71 = tail call i32 @glVertex3d(double %63, double %67, double %22)
%72 = fcmp ugt double %51, 0x401921FB4D12D84A
br i1 %72, label %13, label %25
73: ; preds = %13
%74 = tail call i32 (...) @glEnd()
ret void
}