#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_DISTANCE0;
int /*<<< orphan*/ GL_CLIP_DISTANCE1;
int /*<<< orphan*/ GL_CLIP_PLANE0;
int /*<<< orphan*/ GL_CLIP_PLANE1;
int /*<<< orphan*/ GL_COLOR_BUFFER_BIT;
int /*<<< orphan*/ glClear(int /*<<< orphan*/);
int /*<<< orphan*/ glClipPlane(int /*<<< orphan*/, double *);
int /*<<< orphan*/ glColor3f(double, double, double);
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*/ glutWireSphere(double, int, int);
void clip_display(void) {
  GLdouble eqn[4] = {0.0, 1.0, 0.0, 0.0};
  GLdouble eqn2[4] = {1.0, 0.0, 0.0, 0.0};
  glClear(GL_COLOR_BUFFER_BIT);
  glColor3f(1.0, 1.0, 1.0);
  glPushMatrix();
  glTranslatef(0.0, 0.0, -5.0);
  glClipPlane(GL_CLIP_PLANE0, eqn);
  glEnable(GL_CLIP_DISTANCE0);
  glClipPlane(GL_CLIP_PLANE1, eqn2);
  glEnable(GL_CLIP_DISTANCE1);
  glRotatef(90.0, 1.0, 0.0, 0.0);
  glutWireSphere(1.0, 20, 16);
  glPopMatrix();
  glFlush();
}


x86 assembly (clang, -O0):
<clip_display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0xe71(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe6e(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe6b(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xe68(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0xe65(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe62(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xe5f(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe5c(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0x2db9(%rip),%rax
mov    (%rax),%edi
call   1040 <glClear@plt>
movsd  0xdea(%rip),%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1070 <glColor3f@plt>
mov    $0x0,%al
call   1090 <glPushMatrix@plt>
xorps  %xmm1,%xmm1
movsd  0xddd(%rip),%xmm2
movaps %xmm1,%xmm0
call   10b0 <glTranslatef@plt>
mov    0x2d96(%rip),%rax
mov    (%rax),%edi
lea    -0x20(%rbp),%rsi
call   1030 <glClipPlane@plt>
mov    0x2d8c(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
mov    0x2d96(%rip),%rax
mov    (%rax),%edi
lea    -0x40(%rbp),%rsi
call   1030 <glClipPlane@plt>
mov    0x2d54(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
movsd  0xd85(%rip),%xmm0
movsd  0xd75(%rip),%xmm1
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm2
call   10c0 <glRotatef@plt>
movsd  0xd62(%rip),%xmm0
mov    $0x14,%edi
mov    $0x10,%esi
call   10a0 <glutWireSphere@plt>
mov    $0x0,%al
call   1060 <glPopMatrix@plt>
mov    $0x0,%al
call   1080 <glFlush@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clip_display>:
sub    $0x48,%rsp
movaps 0xe85(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe69(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe8d(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe71(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    0x2de6(%rip),%rax
mov    (%rax),%edi
call   1040 <glClear@plt>
movsd  0xe17(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1070 <glColor3f@plt>
xor    %eax,%eax
call   1090 <glPushMatrix@plt>
movsd  0xe05(%rip),%xmm2
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
call   10b0 <glTranslatef@plt>
mov    0x2dc3(%rip),%rax
mov    (%rax),%edi
lea    0x20(%rsp),%rsi
call   1030 <glClipPlane@plt>
mov    0x2db8(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
mov    0x2dc2(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <glClipPlane@plt>
mov    0x2d81(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
movsd  0xdba(%rip),%xmm0
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
movsd  0xd9c(%rip),%xmm1
call   10c0 <glRotatef@plt>
movsd  0xd8f(%rip),%xmm0
mov    $0x14,%edi
mov    $0x10,%esi
call   10a0 <glutWireSphere@plt>
xor    %eax,%eax
call   1060 <glPopMatrix@plt>
xor    %eax,%eax
call   1080 <glFlush@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.clip_display.eqn = [4 x double] [double 0.000000e+00, double 1.000000e+00, double 0.000000e+00, double 0.000000e+00]
@__const.clip_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_DISTANCE0 = global i32 0
@GL_CLIP_PLANE1 = global i32 0
@GL_CLIP_DISTANCE1 = global i32 0
define void @clip_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 = load i32, i32* @GL_COLOR_BUFFER_BIT
%6 = call i32 @glClear(i32 %5)
%7 = call i32 @glColor3f(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
%8 = call i32 (...) @glPushMatrix()
%9 = call i32 @glTranslatef(double 0.000000e+00, double 0.000000e+00, double -5.000000e+00)
%10 = load i32, i32* @GL_CLIP_PLANE0
%11 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%12 = call i32 @glClipPlane(i32 %10, double* %11)
%13 = load i32, i32* @GL_CLIP_DISTANCE0
%14 = call i32 @glEnable(i32 %13)
%15 = load i32, i32* @GL_CLIP_PLANE1
%16 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 0
%17 = call i32 @glClipPlane(i32 %15, double* %16)
%18 = load i32, i32* @GL_CLIP_DISTANCE1
%19 = call i32 @glEnable(i32 %18)
%20 = call i32 @glRotatef(double 9.000000e+01, double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%21 = call i32 @glutWireSphere(double 1.000000e+00, i32 20, i32 16)
%22 = call i32 (...) @glPopMatrix()
%23 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
@__const.clip_display.eqn = [4 x double] [double 0.000000e+00, double 1.000000e+00, double 0.000000e+00, double 0.000000e+00]
@__const.clip_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_DISTANCE0 = global i32 0
@GL_CLIP_PLANE1 = global i32 0
@GL_CLIP_DISTANCE1 = global i32 0
define void @clip_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 = load i32, i32* @GL_COLOR_BUFFER_BIT
%6 = tail call i32 @glClear(i32 %5)
%7 = tail call i32 @glColor3f(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
%8 = tail call i32 (...) @glPushMatrix()
%9 = tail call i32 @glTranslatef(double 0.000000e+00, double 0.000000e+00, double -5.000000e+00)
%10 = load i32, i32* @GL_CLIP_PLANE0
%11 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%12 = call i32 @glClipPlane(i32 %10, double* %11)
%13 = load i32, i32* @GL_CLIP_DISTANCE0
%14 = call i32 @glEnable(i32 %13)
%15 = load i32, i32* @GL_CLIP_PLANE1
%16 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 0
%17 = call i32 @glClipPlane(i32 %15, double* %16)
%18 = load i32, i32* @GL_CLIP_DISTANCE1
%19 = call i32 @glEnable(i32 %18)
%20 = call i32 @glRotatef(double 9.000000e+01, double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%21 = call i32 @glutWireSphere(double 1.000000e+00, i32 20, i32 16)
%22 = call i32 (...) @glPopMatrix()
%23 = call i32 (...) @glFlush()
ret void
}