#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 */

/* Variables and functions */
int /*<<< orphan*/ GL_BACK_LEFT;
int /*<<< orphan*/ GL_BACK_RIGHT;
int /*<<< orphan*/ GL_COLOR_BUFFER_BIT;
int /*<<< orphan*/ glClear(int /*<<< orphan*/);
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glDrawBuffer(int /*<<< orphan*/);
int /*<<< orphan*/ glutSwapBuffers();
void display(void) {
  glDrawBuffer(GL_BACK_LEFT);
  glClearColor(1.0, 0.0, 0.0, 1.0);
  glClear(GL_COLOR_BUFFER_BIT);
  glDrawBuffer(GL_BACK_RIGHT);
  glClearColor(0.0, 0.0, 1.0, 1.0);
  glClear(GL_COLOR_BUFFER_BIT);
  glutSwapBuffers();
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1050 <glDrawBuffer@plt>
movsd  0xea6(%rip),%xmm3
xorps  %xmm2,%xmm2
movaps %xmm3,%xmm0
movaps %xmm2,%xmm1
call   1060 <glClearColor@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
call   1050 <glDrawBuffer@plt>
xorps  %xmm1,%xmm1
movsd  0xe71(%rip),%xmm3
movaps %xmm1,%xmm0
movaps %xmm3,%xmm2
call   1060 <glClearColor@plt>
mov    0x2e2f(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
mov    $0x0,%al
call   1040 <glutSwapBuffers@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %rbx
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <glDrawBuffer@plt>
movsd  0xea9(%rip),%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
movaps %xmm0,%xmm3
call   1060 <glClearColor@plt>
mov    0x2e64(%rip),%rbx
mov    (%rbx),%edi
call   1030 <glClear@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
call   1050 <glDrawBuffer@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
movsd  0xe71(%rip),%xmm2
movaps %xmm2,%xmm3
call   1060 <glClearColor@plt>
mov    (%rbx),%edi
call   1030 <glClear@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <glutSwapBuffers@plt>

LLVM IR (-O0):
@GL_BACK_LEFT = global i32 0
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_BACK_RIGHT = global i32 0
define void @display() {
%1 = load i32, i32* @GL_BACK_LEFT
%2 = call i32 @glDrawBuffer(i32 %1)
%3 = call i32 @glClearColor(double 1.000000e+00, double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%4 = load i32, i32* @GL_COLOR_BUFFER_BIT
%5 = call i32 @glClear(i32 %4)
%6 = load i32, i32* @GL_BACK_RIGHT
%7 = call i32 @glDrawBuffer(i32 %6)
%8 = call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 1.000000e+00, double 1.000000e+00)
%9 = load i32, i32* @GL_COLOR_BUFFER_BIT
%10 = call i32 @glClear(i32 %9)
%11 = call i32 (...) @glutSwapBuffers()
ret void
}

LLVM IR (-O2):
@GL_BACK_LEFT = global i32 0
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_BACK_RIGHT = global i32 0
define void @display() {
%1 = load i32, i32* @GL_BACK_LEFT
%2 = tail call i32 @glDrawBuffer(i32 %1)
%3 = tail call i32 @glClearColor(double 1.000000e+00, double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%4 = load i32, i32* @GL_COLOR_BUFFER_BIT
%5 = tail call i32 @glClear(i32 %4)
%6 = load i32, i32* @GL_BACK_RIGHT
%7 = tail call i32 @glDrawBuffer(i32 %6)
%8 = tail call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 1.000000e+00, double 1.000000e+00)
%9 = load i32, i32* @GL_COLOR_BUFFER_BIT
%10 = tail call i32 @glClear(i32 %9)
%11 = tail call i32 (...) @glutSwapBuffers()
ret void
}