#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 scalar_t__ GLenum;
typedef int GLdouble;

/* Variables and functions */
int /*<<< orphan*/ GL_BACK;
int /*<<< orphan*/ GL_BLEND;
int GL_COLOR_BUFFER_BIT;
int /*<<< orphan*/ GL_CULL_FACE;
int GL_DEPTH_BUFFER_BIT;
int /*<<< orphan*/ GL_FRONT;
scalar_t__ GL_NO_ERROR;
int /*<<< orphan*/ draw_cone();
int /*<<< orphan*/ draw_room();
int /*<<< orphan*/ draw_sphere(int);
int get_secs();
int /*<<< orphan*/ glClear(int);
int /*<<< orphan*/ glCullFace(int /*<<< orphan*/);
int /*<<< orphan*/ glDisable(int /*<<< orphan*/);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
scalar_t__ glGetError();
char *gluErrorString(scalar_t__);
int /*<<< orphan*/ glutSwapBuffers();
int /*<<< orphan*/ printf(char *, char *);
void draw(void) {
  GLenum err;
  GLdouble secs;
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  draw_room();
  draw_cone();
  secs = get_secs();
  glEnable(GL_BLEND);
  glEnable(GL_CULL_FACE);
  glCullFace(GL_FRONT);
  draw_sphere(secs * 360. / 10.);
  glCullFace(GL_BACK);
  draw_sphere(secs * 360. / 10.);
  glDisable(GL_CULL_FACE);
  glDisable(GL_BLEND);
  err = glGetError();
  if (err != GL_NO_ERROR)
    printf("Error:  %s\n", gluErrorString(err));
  glutSwapBuffers();
}


x86 assembly (clang, -O0):
<draw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2de1(%rip),%rax
mov    (%rax),%edi
mov    0x2e00(%rip),%rax
or     (%rax),%edi
call   1060 <glClear@plt>
mov    $0x0,%al
call   1040 <draw_room@plt>
mov    $0x0,%al
call   1050 <draw_cone@plt>
mov    $0x0,%al
call   1030 <get_secs@plt>
mov    %eax,-0xc(%rbp)
mov    0x2de2(%rip),%rax
mov    (%rax),%edi
call   1080 <glEnable@plt>
mov    0x2dac(%rip),%rax
mov    (%rax),%edi
call   1080 <glEnable@plt>
mov    0x2dce(%rip),%rax
mov    (%rax),%edi
call   10e0 <glCullFace@plt>
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xdda(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdc6(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   10b0 <draw_sphere@plt>
mov    0x2d72(%rip),%rax
mov    (%rax),%edi
call   10e0 <glCullFace@plt>
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xda6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd92(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   10b0 <draw_sphere@plt>
mov    0x2d36(%rip),%rax
mov    (%rax),%edi
call   10d0 <glDisable@plt>
mov    0x2d50(%rip),%rax
mov    (%rax),%edi
call   10d0 <glDisable@plt>
mov    $0x0,%al
call   10a0 <glGetError@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2d23(%rip),%rcx
cmp    (%rcx),%rax
je     12ce <draw+0x10e>
mov    -0x8(%rbp),%rdi
call   10c0 <gluErrorString@plt>
mov    %rax,%rsi
lea    0xd47(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1090 <glutSwapBuffers@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw>:
push   %r15
push   %r14
push   %rbx
mov    0x2de4(%rip),%rax
mov    0x2e05(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
call   1060 <glClear@plt>
xor    %eax,%eax
call   1040 <draw_room@plt>
xor    %eax,%eax
call   1050 <draw_cone@plt>
xor    %eax,%eax
call   1030 <get_secs@plt>
mov    %eax,%ebx
mov    0x2de6(%rip),%r14
mov    (%r14),%edi
call   1080 <glEnable@plt>
mov    0x2daf(%rip),%r15
mov    (%r15),%edi
call   1080 <glEnable@plt>
mov    0x2dd0(%rip),%rax
mov    (%rax),%edi
call   10e0 <glCullFace@plt>
cvtsi2sd %ebx,%xmm0
mulsd  0xdd5(%rip),%xmm0
divsd  0xdd5(%rip),%xmm0
cvttsd2si %xmm0,%ebx
mov    %ebx,%edi
call   10b0 <draw_sphere@plt>
mov    0x2d7b(%rip),%rax
mov    (%rax),%edi
call   10e0 <glCullFace@plt>
mov    %ebx,%edi
call   10b0 <draw_sphere@plt>
mov    (%r15),%edi
call   10d0 <glDisable@plt>
mov    (%r14),%edi
call   10d0 <glDisable@plt>
xor    %eax,%eax
call   10a0 <glGetError@plt>
mov    0x2d5f(%rip),%rcx
cmp    (%rcx),%rax
je     128d <draw+0xcd>
mov    %rax,%rdi
call   10c0 <gluErrorString@plt>
lea    0xd8b(%rip),%rdi
mov    %rax,%rsi
call   1070 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1090 <glutSwapBuffers@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
@GL_BLEND = global i32 0
@GL_CULL_FACE = global i32 0
@GL_FRONT = global i32 0
@GL_BACK = global i32 0
@GL_NO_ERROR = global i64 0
@.str = [12 x i8] c"Error: %s\0A\00"
define void @draw() {
%1 = alloca i64
%2 = alloca i32
%3 = load i32, i32* @GL_COLOR_BUFFER_BIT
%4 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%5 = or i32 %3, %4
%6 = call i32 @glClear(i32 %5)
%7 = call i32 (...) @draw_room()
%8 = call i32 (...) @draw_cone()
%9 = call i32 (...) @get_secs()
store i32 %9, i32* %2
%10 = load i32, i32* @GL_BLEND
%11 = call i32 @glEnable(i32 %10)
%12 = load i32, i32* @GL_CULL_FACE
%13 = call i32 @glEnable(i32 %12)
%14 = load i32, i32* @GL_FRONT
%15 = call i32 @glCullFace(i32 %14)
%16 = load i32, i32* %2
%17 = sitofp i32 %16 to double
%18 = fmul double %17, 3.600000e+02
%19 = fdiv double %18, 1.000000e+01
%20 = fptosi double %19 to i32
%21 = call i32 @draw_sphere(i32 %20)
%22 = load i32, i32* @GL_BACK
%23 = call i32 @glCullFace(i32 %22)
%24 = load i32, i32* %2
%25 = sitofp i32 %24 to double
%26 = fmul double %25, 3.600000e+02
%27 = fdiv double %26, 1.000000e+01
%28 = fptosi double %27 to i32
%29 = call i32 @draw_sphere(i32 %28)
%30 = load i32, i32* @GL_CULL_FACE
%31 = call i32 @glDisable(i32 %30)
%32 = load i32, i32* @GL_BLEND
%33 = call i32 @glDisable(i32 %32)
%34 = call i64 (...) @glGetError()
store i64 %34, i64* %1
%35 = load i64, i64* %1
%36 = load i64, i64* @GL_NO_ERROR
%37 = icmp ne i64 %35, %36
br i1 %37, label %38, label %42
38: ; preds = %0
%39 = load i64, i64* %1
%40 = call i8* @gluErrorString(i64 %39)
%41 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %40)
br label %42
42: ; preds = %38, %0
%43 = call i32 (...) @glutSwapBuffers()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
@GL_BLEND = global i32 0
@GL_CULL_FACE = global i32 0
@GL_FRONT = global i32 0
@GL_BACK = global i32 0
@GL_NO_ERROR = global i64 0
@.str = [12 x i8] c"Error: %s\0A\00"
define void @draw() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %2, %1
%4 = tail call i32 @glClear(i32 %3)
%5 = tail call i32 (...) @draw_room()
%6 = tail call i32 (...) @draw_cone()
%7 = tail call i32 (...) @get_secs()
%8 = load i32, i32* @GL_BLEND
%9 = tail call i32 @glEnable(i32 %8)
%10 = load i32, i32* @GL_CULL_FACE
%11 = tail call i32 @glEnable(i32 %10)
%12 = load i32, i32* @GL_FRONT
%13 = tail call i32 @glCullFace(i32 %12)
%14 = sitofp i32 %7 to double
%15 = fmul double %14, 3.600000e+02
%16 = fdiv double %15, 1.000000e+01
%17 = fptosi double %16 to i32
%18 = tail call i32 @draw_sphere(i32 %17)
%19 = load i32, i32* @GL_BACK
%20 = tail call i32 @glCullFace(i32 %19)
%21 = tail call i32 @draw_sphere(i32 %17)
%22 = load i32, i32* @GL_CULL_FACE
%23 = tail call i32 @glDisable(i32 %22)
%24 = load i32, i32* @GL_BLEND
%25 = tail call i32 @glDisable(i32 %24)
%26 = tail call i64 (...) @glGetError()
%27 = load i64, i64* @GL_NO_ERROR
%28 = icmp eq i64 %26, %27
br i1 %28, label %32, label %29
29: ; preds = %0
%30 = tail call i8* @gluErrorString(i64 %26)
%31 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %30)
br label %32
32: ; preds = %29, %0
%33 = tail call i32 (...) @glutSwapBuffers()
ret void
}