#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 half_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 / 2; 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):
<half_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  0xe20(%rip),%xmm0
ucomisd -0x30(%rbp),%xmm0
jbe    15df <half_sphere+0x47f>
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
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    1264 <half_sphere+0x104>
movl   $0x1,-0x3c(%rbp)
jmp    126b <half_sphere+0x10b>
movl   $0x0,-0x3c(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xd95(%rip),%xmm0
ucomisd -0x38(%rbp),%xmm0
jb     15c6 <half_sphere+0x466>
cmpl   $0x0,-0x3c(%rbp)
jne    12af <half_sphere+0x14f>
movsd  0xd80(%rip),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm1
call   1060 <glColor3d@plt>
movl   $0x1,-0x3c(%rbp)
jmp    12ce <half_sphere+0x16e>
movsd  0xd61(%rip),%xmm2
movsd  0xd61(%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)
ff
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    1273 <half_sphere+0x113>
jmp    15cb <half_sphere+0x46b>
movsd  -0x18(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    11e0 <half_sphere+0x80>
mov    $0x0,%al
call   1040 <glEnd@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<half_sphere>:
push   %rbx
sub    $0x80,%rsp
movsd  %xmm0,(%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,0x50(%rsp)
divsd  %xmm1,%xmm2
movsd  %xmm2,0x58(%rsp)
mov    0x2e43(%rip),%rax
mov    (%rax),%edi
call   1080 <glBegin@plt>
xor    %ebx,%ebx
xorpd  %xmm0,%xmm0
jmp    11dc <half_sphere+0x7c>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  0xe58(%rip),%xmm0
movsd  0x38(%rsp),%xmm1
ucomisd %xmm1,%xmm0
movapd %xmm1,%xmm0
jbe    1466 <half_sphere+0x306>
movsd  %xmm0,0x30(%rsp)
call   1070 <cos@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,0x48(%rsp)
movsd  0x50(%rsp),%xmm0
addsd  0x30(%rsp),%xmm0
movsd  %xmm0,0x38(%rsp)
call   1070 <cos@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,0x40(%rsp)
xor    %eax,%eax
test   %ebx,%ebx
sete   %al
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %eax,%ebx
jmp    143f <half_sphere+0x2df>
nopl   0x0(%rax)
movsd  0xdd8(%rip),%xmm0
movsd  0xdc8(%rip),%xmm1
movapd %xmm0,%xmm2
call   1060 <glColor3d@plt>
xor    %ebx,%ebx
movsd  0x8(%rsp),%xmm0
call   1070 <cos@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0x30(%rsp),%xmm0
call   1050 <sin@plt>
mulsd  0x28(%rsp),%xmm0
movsd  %xmm0,0x78(%rsp)
movsd  0x30(%rsp),%xmm0
call   1050 <sin@plt>
mulsd  (%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  (%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x38(%rsp),%xmm0
call   1050 <sin@plt>
mulsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x70(%rsp)
movsd  0x38(%rsp),%xmm0
call   1050 <sin@plt>
mulsd  (%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  0x58(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
call   1070 <cos@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x30(%rsp),%xmm0
call   1050 <sin@plt>
mulsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x68(%rsp)
movsd  0x30(%rsp),%xmm0
call   1050 <sin@plt>
mulsd  (%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  (%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x38(%rsp),%xmm0
call   1050 <sin@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x60(%rsp)
movsd  0x38(%rsp),%xmm0
call   1050 <sin@plt>
mulsd  (%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  0x78(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
movsd  0x48(%rsp),%xmm2
call   1030 <glVertex3d@plt>
movsd  0x70(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
movsd  0x40(%rsp),%xmm2
call   1030 <glVertex3d@plt>
movsd  0x68(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movsd  0x48(%rsp),%xmm2
call   1030 <glVertex3d@plt>
movsd  0x60(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x40(%rsp),%xmm2
call   1030 <glVertex3d@plt>
movsd  0xbe5(%rip),%xmm0
ucomisd 0x8(%rsp),%xmm0
jb     11c0 <half_sphere+0x60>
test   %ebx,%ebx
jne    1230 <half_sphere+0xd0>
xorpd  %xmm1,%xmm1
xorpd  %xmm2,%xmm2
movsd  0xbb9(%rip),%xmm0
call   1060 <glColor3d@plt>
mov    $0x1,%ebx
jmp    124b <half_sphere+0xeb>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
jmp    1040 <glEnd@plt>

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

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