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

/* Variables and functions */
int /*<<< orphan*/ GL_COLOR_BUFFER_BIT;
int /*<<< orphan*/ draw();
int /*<<< orphan*/ glClear(int /*<<< orphan*/);
int /*<<< orphan*/ glFlush();
int /*<<< orphan*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glRotatef(double, double, double, double);
int /*<<< orphan*/ glutSwapBuffers();
void display(void) {
  static GLfloat rot = 0.0;
  glClear(GL_COLOR_BUFFER_BIT);
  glPushMatrix();
  glRotatef(rot, 1.0, 1.0, 1.0);
  rot += 4.0;
  draw();
  glPopMatrix();
  glFlush();
  glutSwapBuffers();
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
call   1040 <glClear@plt>
mov    $0x0,%al
call   1080 <glPushMatrix@plt>
movsd  0x2ecf(%rip),%xmm0
movsd  0xe6f(%rip),%xmm3
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1090 <glRotatef@plt>
movsd  0xe54(%rip),%xmm0
addsd  0x2eac(%rip),%xmm0
movsd  %xmm0,0x2ea4(%rip)
mov    $0x0,%al
call   1030 <draw@plt>
mov    $0x0,%al
call   1060 <glPopMatrix@plt>
mov    $0x0,%al
call   1070 <glFlush@plt>
mov    $0x0,%al
call   1050 <glutSwapBuffers@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %rax
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1040 <glClear@plt>
xor    %eax,%eax
call   1080 <glPushMatrix@plt>
movsd  0x2ed2(%rip),%xmm0
movsd  0xe6a(%rip),%xmm1
movaps %xmm1,%xmm2
movaps %xmm1,%xmm3
call   1090 <glRotatef@plt>
movsd  0x2eb7(%rip),%xmm0
addsd  0xe57(%rip),%xmm0
movsd  %xmm0,0x2ea7(%rip)
xor    %eax,%eax
call   1030 <draw@plt>
xor    %eax,%eax
call   1060 <glPopMatrix@plt>
xor    %eax,%eax
call   1070 <glFlush@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <glutSwapBuffers@plt>

LLVM IR (-O0):
@display.rot = internal global double 0.000000e+00
@GL_COLOR_BUFFER_BIT = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = call i32 @glClear(i32 %1)
%3 = call i32 (...) @glPushMatrix()
%4 = load double, double* @display.rot
%5 = call i32 @glRotatef(double %4, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
%6 = load double, double* @display.rot
%7 = fadd double %6, 4.000000e+00
store double %7, double* @display.rot
%8 = call i32 (...) @draw()
%9 = call i32 (...) @glPopMatrix()
%10 = call i32 (...) @glFlush()
%11 = call i32 (...) @glutSwapBuffers()
ret void
}

LLVM IR (-O2):
@display.rot = internal unnamed_addr global double 0.000000e+00
@GL_COLOR_BUFFER_BIT = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = tail call i32 @glClear(i32 %1)
%3 = tail call i32 (...) @glPushMatrix()
%4 = load double, double* @display.rot
%5 = tail call i32 @glRotatef(double %4, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
%6 = load double, double* @display.rot
%7 = fadd double %6, 4.000000e+00
store double %7, double* @display.rot
%8 = tail call i32 (...) @draw()
%9 = tail call i32 (...) @glPopMatrix()
%10 = tail call i32 (...) @glFlush()
%11 = tail call i32 (...) @glutSwapBuffers()
ret void
}