#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 double GLdouble;

/* Variables and functions */
int /*<<< orphan*/ GL_CLIP_PLANE0;
int /*<<< orphan*/ GL_CLIP_PLANE1;
int /*<<< orphan*/ GL_COLOR_BUFFER_BIT;
int /*<<< orphan*/ drawAxes(double);
int /*<<< orphan*/ glClear(int /*<<< orphan*/);
int /*<<< orphan*/ glClipPlane(int /*<<< orphan*/, double *);
int /*<<< orphan*/ glColor3f(double, double, double);
int /*<<< orphan*/ glDisable(int /*<<< orphan*/);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
int /*<<< orphan*/ glFlush();
int /*<<< orphan*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glRotatef(double, double, double, double);
int /*<<< orphan*/ glTranslatef(double, double, double);
int /*<<< orphan*/ gluLookAt(double, double, double, double, double, double,
                             double, double, double);
int /*<<< orphan*/ glutWireSphere(double, int, int);
void display(void) {
  GLdouble eqn[4] = {0.0, 1.0, 0.5, 0.0};
  GLdouble eqn2[4] = {1.0, 0.0, 0.0, 0.0};
  gluLookAt(-3.0, 3.0, 3.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
  glClear(GL_COLOR_BUFFER_BIT);
  glColor3f(0.6, 0.6, 0.8);
  glPushMatrix();
  glTranslatef(0.0, 0.0, -5.0);
  glClipPlane(GL_CLIP_PLANE0, eqn);
  glEnable(GL_CLIP_PLANE0);
  glClipPlane(GL_CLIP_PLANE1, eqn2);
  glEnable(GL_CLIP_PLANE1);
  glRotatef(90.0, 1.0, 0.0, 0.0);
  glutWireSphere(2.0, 30, 16);
  glPopMatrix();
  glDisable(GL_CLIP_PLANE0);
  glDisable(GL_CLIP_PLANE1);
  drawAxes(2.0);
  glFlush();
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0xe61(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe5e(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe5b(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xe58(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0xe55(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe52(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xe4f(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe4c(%rip),%rax
mov    %rax,-0x28(%rbp)
movsd  0xdf8(%rip),%xmm0
movsd  0xdf8(%rip),%xmm2
xorps  %xmm8,%xmm8
movsd  0xdc4(%rip),%xmm7
movaps %xmm2,%xmm1
movaps %xmm8,%xmm3
movaps %xmm8,%xmm4
movaps %xmm8,%xmm5
movaps %xmm8,%xmm6
movsd  %xmm8,(%rsp)
call   1030 <gluLookAt@plt>
mov    0x2d5f(%rip),%rax
mov    (%rax),%edi
call   1050 <glClear@plt>
movsd  0xda0(%rip),%xmm1
movsd  0xda0(%rip),%xmm2
movaps %xmm1,%xmm0
call   1080 <glColor3f@plt>
mov    $0x0,%al
call   10b0 <glPushMatrix@plt>
xorps  %xmm1,%xmm1
movsd  0xd76(%rip),%xmm2
movaps %xmm1,%xmm0
call   10d0 <glTranslatef@plt>
mov    0x2d2f(%rip),%rax
mov    (%rax),%edi
lea    -0x20(%rbp),%rsi
call   1040 <glClipPlane@plt>
mov    0x2d1d(%rip),%rax
mov    (%rax),%edi
call   1060 <glEnable@plt>
mov    0x2d27(%rip),%rax
mov    (%rax),%edi
lea    -0x40(%rbp),%rsi
call   1040 <glClipPlane@plt>
mov    0x2d15(%rip),%rax
mov    (%rax),%edi
call   1060 <glEnable@plt>
movsd  0xd16(%rip),%xmm0
movsd  0xd16(%rip),%xmm1
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm2
call   10f0 <glRotatef@plt>
movsd  0xcf3(%rip),%xmm0
mov    $0x1e,%edi
mov    $0x10,%esi
call   10c0 <glutWireSphere@plt>
mov    $0x0,%al
call   1070 <glPopMatrix@plt>
mov    0x2cb6(%rip),%rax
mov    (%rax),%edi
call   10e0 <glDisable@plt>
mov    0x2cc0(%rip),%rax
mov    (%rax),%edi
call   10e0 <glDisable@plt>
movsd  0xcb9(%rip),%xmm0
call   10a0 <drawAxes@plt>
mov    $0x0,%al
call   1090 <glFlush@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %r14
push   %rbx
sub    $0x58,%rsp
movaps 0xe72(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xe56(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe7a(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe5e(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movq   $0x0,(%rsp)
movsd  0xde9(%rip),%xmm0
movsd  0xde9(%rip),%xmm1
movsd  0xde9(%rip),%xmm7
xorps  %xmm3,%xmm3
xorps  %xmm4,%xmm4
xorps  %xmm5,%xmm5
xorps  %xmm6,%xmm6
movaps %xmm1,%xmm2
call   1030 <gluLookAt@plt>
mov    0x2d8e(%rip),%rax
mov    (%rax),%edi
call   1050 <glClear@plt>
movsd  0xdc7(%rip),%xmm0
movsd  0xdc7(%rip),%xmm2
movaps %xmm0,%xmm1
call   1080 <glColor3f@plt>
xor    %eax,%eax
call   10b0 <glPushMatrix@plt>
movsd  0xdb8(%rip),%xmm2
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
call   10d0 <glTranslatef@plt>
mov    0x2d5e(%rip),%r14
mov    (%r14),%edi
lea    0x30(%rsp),%rsi
call   1040 <glClipPlane@plt>
mov    (%r14),%edi
call   1060 <glEnable@plt>
mov    0x2d5a(%rip),%rbx
mov    (%rbx),%edi
lea    0x10(%rsp),%rsi
call   1040 <glClipPlane@plt>
mov    (%rbx),%edi
call   1060 <glEnable@plt>
movsd  0xd77(%rip),%xmm0
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
movsd  0xd49(%rip),%xmm1
call   10f0 <glRotatef@plt>
movsd  0xd64(%rip),%xmm0
mov    $0x1e,%edi
mov    $0x10,%esi
call   10c0 <glutWireSphere@plt>
xor    %eax,%eax
call   1070 <glPopMatrix@plt>
mov    (%r14),%edi
call   10e0 <glDisable@plt>
mov    (%rbx),%edi
call   10e0 <glDisable@plt>
movsd  0xd37(%rip),%xmm0
call   10a0 <drawAxes@plt>
xor    %eax,%eax
call   1090 <glFlush@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.display.eqn = [4 x double] [double 0.000000e+00, double 1.000000e+00, double 5.000000e-01, double 0.000000e+00]
@__const.display.eqn2 = [4 x double] [double 1.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00]
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_CLIP_PLANE0 = global i32 0
@GL_CLIP_PLANE1 = global i32 0
define void @display() {
%1 = alloca [4 x double]
%2 = alloca [4 x double]
%3 = bitcast [4 x double]* %1 to i8*
%4 = bitcast [4 x double]* %2 to i8*
%5 = call i32 @gluLookAt(double -3.000000e+00, double 3.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%6 = load i32, i32* @GL_COLOR_BUFFER_BIT
%7 = call i32 @glClear(i32 %6)
%8 = call i32 @glColor3f(double 6.000000e-01, double 6.000000e-01, double 8.000000e-01)
%9 = call i32 (...) @glPushMatrix()
%10 = call i32 @glTranslatef(double 0.000000e+00, double 0.000000e+00, double -5.000000e+00)
%11 = load i32, i32* @GL_CLIP_PLANE0
%12 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%13 = call i32 @glClipPlane(i32 %11, double* %12)
%14 = load i32, i32* @GL_CLIP_PLANE0
%15 = call i32 @glEnable(i32 %14)
%16 = load i32, i32* @GL_CLIP_PLANE1
%17 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 0
%18 = call i32 @glClipPlane(i32 %16, double* %17)
%19 = load i32, i32* @GL_CLIP_PLANE1
%20 = call i32 @glEnable(i32 %19)
%21 = call i32 @glRotatef(double 9.000000e+01, double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%22 = call i32 @glutWireSphere(double 2.000000e+00, i32 30, i32 16)
%23 = call i32 (...) @glPopMatrix()
%24 = load i32, i32* @GL_CLIP_PLANE0
%25 = call i32 @glDisable(i32 %24)
%26 = load i32, i32* @GL_CLIP_PLANE1
%27 = call i32 @glDisable(i32 %26)
%28 = call i32 @drawAxes(double 2.000000e+00)
%29 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
@__const.display.eqn = [4 x double] [double 0.000000e+00, double 1.000000e+00, double 5.000000e-01, double 0.000000e+00]
@__const.display.eqn2 = [4 x double] [double 1.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00]
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_CLIP_PLANE0 = global i32 0
@GL_CLIP_PLANE1 = global i32 0
define void @display() {
%1 = alloca [4 x double]
%2 = alloca [4 x double]
%3 = bitcast [4 x double]* %1 to i8*
%4 = bitcast [4 x double]* %2 to i8*
%5 = tail call i32 @gluLookAt(double -3.000000e+00, double 3.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%6 = load i32, i32* @GL_COLOR_BUFFER_BIT
%7 = tail call i32 @glClear(i32 %6)
%8 = tail call i32 @glColor3f(double 6.000000e-01, double 6.000000e-01, double 8.000000e-01)
%9 = tail call i32 (...) @glPushMatrix()
%10 = tail call i32 @glTranslatef(double 0.000000e+00, double 0.000000e+00, double -5.000000e+00)
%11 = load i32, i32* @GL_CLIP_PLANE0
%12 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%13 = call i32 @glClipPlane(i32 %11, double* %12)
%14 = load i32, i32* @GL_CLIP_PLANE0
%15 = call i32 @glEnable(i32 %14)
%16 = load i32, i32* @GL_CLIP_PLANE1
%17 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 0
%18 = call i32 @glClipPlane(i32 %16, double* %17)
%19 = load i32, i32* @GL_CLIP_PLANE1
%20 = call i32 @glEnable(i32 %19)
%21 = call i32 @glRotatef(double 9.000000e+01, double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%22 = call i32 @glutWireSphere(double 2.000000e+00, i32 30, i32 16)
%23 = call i32 (...) @glPopMatrix()
%24 = load i32, i32* @GL_CLIP_PLANE0
%25 = call i32 @glDisable(i32 %24)
%26 = load i32, i32* @GL_CLIP_PLANE1
%27 = call i32 @glDisable(i32 %26)
%28 = call i32 @drawAxes(double 2.000000e+00)
%29 = call i32 (...) @glFlush()
ret void
}