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

/* Variables and functions */
int /*<<< orphan*/ GLUT_CURSOR_INHERIT;
int /*<<< orphan*/ GLUT_CURSOR_WAIT;
int GL_ACCUM_BUFFER_BIT;
int GL_COLOR_BUFFER_BIT;
scalar_t__ GL_NO_ERROR;
int /*<<< orphan*/ acc_convolve();
int /*<<< orphan*/ glClear(int);
scalar_t__ glGetError();
char *gluErrorString(scalar_t__);
int /*<<< orphan*/ glutSetCursor(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void draw(void) {
  GLenum err;
  glutSetCursor(GLUT_CURSOR_WAIT);
  glClear(GL_COLOR_BUFFER_BIT | GL_ACCUM_BUFFER_BIT);
  acc_convolve();
  err = glGetError();
  if (err != GL_NO_ERROR)
    printf("Error:  %s\n", gluErrorString(err));
  glutSetCursor(GLUT_CURSOR_INHERIT);
}


x86 assembly (clang, -O0):
<draw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e49(%rip),%rax
mov    (%rax),%edi
call   1060 <glutSetCursor@plt>
mov    0x2e4b(%rip),%rax
mov    (%rax),%edi
mov    0x2e4a(%rip),%rax
or     (%rax),%edi
call   1030 <glClear@plt>
mov    $0x0,%al
call   1070 <acc_convolve@plt>
mov    $0x0,%al
call   1050 <glGetError@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2e36(%rip),%rcx
cmp    (%rcx),%rax
je     11cb <draw+0x6b>
mov    -0x8(%rbp),%rdi
call   1080 <gluErrorString@plt>
mov    %rax,%rsi
lea    0xe3a(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e26(%rip),%rax
mov    (%rax),%edi
call   1060 <glutSetCursor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw>:
push   %rax
mov    0x2e50(%rip),%rax
mov    (%rax),%edi
call   1060 <glutSetCursor@plt>
mov    0x2e52(%rip),%rax
mov    0x2e53(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
call   1030 <glClear@plt>
xor    %eax,%eax
call   1070 <acc_convolve@plt>
xor    %eax,%eax
call   1050 <glGetError@plt>
mov    0x2e45(%rip),%rcx
cmp    (%rcx),%rax
je     11b7 <draw+0x57>
mov    %rax,%rdi
call   1080 <gluErrorString@plt>
lea    0xe51(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    0x2e3a(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1060 <glutSetCursor@plt>

LLVM IR (-O0):
@GLUT_CURSOR_WAIT = global i32 0
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_ACCUM_BUFFER_BIT = global i32 0
@GL_NO_ERROR = global i64 0
@.str = [12 x i8] c"Error: %s\0A\00"
@GLUT_CURSOR_INHERIT = global i32 0
define void @draw() {
%1 = alloca i64
%2 = load i32, i32* @GLUT_CURSOR_WAIT
%3 = call i32 @glutSetCursor(i32 %2)
%4 = load i32, i32* @GL_COLOR_BUFFER_BIT
%5 = load i32, i32* @GL_ACCUM_BUFFER_BIT
%6 = or i32 %4, %5
%7 = call i32 @glClear(i32 %6)
%8 = call i32 (...) @acc_convolve()
%9 = call i64 (...) @glGetError()
store i64 %9, i64* %1
%10 = load i64, i64* %1
%11 = load i64, i64* @GL_NO_ERROR
%12 = icmp ne i64 %10, %11
br i1 %12, label %13, label %17
13: ; preds = %0
%14 = load i64, i64* %1
%15 = call i8* @gluErrorString(i64 %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %13, %0
%18 = load i32, i32* @GLUT_CURSOR_INHERIT
%19 = call i32 @glutSetCursor(i32 %18)
ret void
}

LLVM IR (-O2):
@GLUT_CURSOR_WAIT = global i32 0
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_ACCUM_BUFFER_BIT = global i32 0
@GL_NO_ERROR = global i64 0
@.str = [12 x i8] c"Error: %s\0A\00"
@GLUT_CURSOR_INHERIT = global i32 0
define void @draw() {
%1 = load i32, i32* @GLUT_CURSOR_WAIT
%2 = tail call i32 @glutSetCursor(i32 %1)
%3 = load i32, i32* @GL_COLOR_BUFFER_BIT
%4 = load i32, i32* @GL_ACCUM_BUFFER_BIT
%5 = or i32 %4, %3
%6 = tail call i32 @glClear(i32 %5)
%7 = tail call i32 (...) @acc_convolve()
%8 = tail call i64 (...) @glGetError()
%9 = load i64, i64* @GL_NO_ERROR
%10 = icmp eq i64 %8, %9
br i1 %10, label %14, label %11
11: ; preds = %0
%12 = tail call i8* @gluErrorString(i64 %8)
%13 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11, %0
%15 = load i32, i32* @GLUT_CURSOR_INHERIT
%16 = tail call i32 @glutSetCursor(i32 %15)
ret void
}