#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 GL_COLOR_BUFFER_BIT;
int GL_DEPTH_BUFFER_BIT;
scalar_t__ GL_NO_ERROR;
int /*<<< orphan*/ GL_POLYGON_STIPPLE;
int /*<<< orphan*/ draw_cone();
int /*<<< orphan*/ draw_room();
int /*<<< orphan*/ draw_sphere(int);
int get_secs();
int /*<<< orphan*/ glClear(int);
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_POLYGON_STIPPLE);
  draw_sphere(secs * 360. / 10.);
  glDisable(GL_POLYGON_STIPPLE);
  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    0x2e09(%rip),%rax
mov    (%rax),%edi
mov    0x2e18(%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    0x2e0a(%rip),%rax
mov    (%rax),%edi
call   1080 <glEnable@plt>
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xe06(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdf2(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   10b0 <draw_sphere@plt>
mov    0x2dd6(%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    0x2d99(%rip),%rcx
cmp    (%rcx),%rax
je     1260 <draw+0xb0>
mov    -0x8(%rbp),%rdi
call   10c0 <gluErrorString@plt>
mov    %rax,%rsi
lea    0xdb5(%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   %r14
push   %rbx
push   %rax
mov    0x2e0d(%rip),%rax
mov    0x2e1e(%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    0x2e0f(%rip),%r14
mov    (%r14),%edi
call   1080 <glEnable@plt>
cvtsi2sd %ebx,%xmm0
mulsd  0xe03(%rip),%xmm0
divsd  0xe03(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   10b0 <draw_sphere@plt>
mov    (%r14),%edi
call   10d0 <glDisable@plt>
xor    %eax,%eax
call   10a0 <glGetError@plt>
mov    0x2db4(%rip),%rcx
cmp    (%rcx),%rax
je     1240 <draw+0x90>
mov    %rax,%rdi
call   10c0 <gluErrorString@plt>
lea    0xdd8(%rip),%rdi
mov    %rax,%rsi
call   1070 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1090 <glutSwapBuffers@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
@GL_POLYGON_STIPPLE = 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_POLYGON_STIPPLE
%11 = call i32 @glEnable(i32 %10)
%12 = load i32, i32* %2
%13 = sitofp i32 %12 to double
%14 = fmul double %13, 3.600000e+02
%15 = fdiv double %14, 1.000000e+01
%16 = fptosi double %15 to i32
%17 = call i32 @draw_sphere(i32 %16)
%18 = load i32, i32* @GL_POLYGON_STIPPLE
%19 = call i32 @glDisable(i32 %18)
%20 = call i64 (...) @glGetError()
store i64 %20, i64* %1
%21 = load i64, i64* %1
%22 = load i64, i64* @GL_NO_ERROR
%23 = icmp ne i64 %21, %22
br i1 %23, label %24, label %28
24: ; preds = %0
%25 = load i64, i64* %1
%26 = call i8* @gluErrorString(i64 %25)
%27 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %26)
br label %28
28: ; preds = %24, %0
%29 = call i32 (...) @glutSwapBuffers()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
@GL_POLYGON_STIPPLE = 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_POLYGON_STIPPLE
%9 = tail call i32 @glEnable(i32 %8)
%10 = sitofp i32 %7 to double
%11 = fmul double %10, 3.600000e+02
%12 = fdiv double %11, 1.000000e+01
%13 = fptosi double %12 to i32
%14 = tail call i32 @draw_sphere(i32 %13)
%15 = load i32, i32* @GL_POLYGON_STIPPLE
%16 = tail call i32 @glDisable(i32 %15)
%17 = tail call i64 (...) @glGetError()
%18 = load i64, i64* @GL_NO_ERROR
%19 = icmp eq i64 %17, %18
br i1 %19, label %23, label %20
20: ; preds = %0
%21 = tail call i8* @gluErrorString(i64 %17)
%22 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %21)
br label %23
23: ; preds = %20, %0
%24 = tail call i32 (...) @glutSwapBuffers()
ret void
}