#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*/ glBlendFunc(int, int);
int /*<<< orphan*/ glColor4f(float, float, float, float);
int /*<<< orphan*/ glDisable(int);
int /*<<< orphan*/ glEnable(int);
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int);
int /*<<< orphan*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glRectf(float, float, float, float);
void fade(float opacity) {
  glMatrixMode(0x1700);
  glLoadIdentity();
  glMatrixMode(0x1701);
  glPushMatrix();
  glLoadIdentity();
  glEnable(0x0BE2);
  glBlendFunc(0x0302, 0x0303);
  glColor4f(0.0f, 0.0f, 0.0f, opacity);
  glRectf(-1.0f, -1.0f, 1.0f, 1.0f);
  glDisable(0x0BE2);
  glPopMatrix();
  glMatrixMode(0x1700);
}


x86 assembly (clang, -O0):
<fade>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x1700,%edi
call   1050 <glMatrixMode@plt>
mov    $0x0,%al
call   1090 <glLoadIdentity@plt>
mov    $0x1701,%edi
call   1050 <glMatrixMode@plt>
mov    $0x0,%al
call   10a0 <glPushMatrix@plt>
mov    $0x0,%al
call   1090 <glLoadIdentity@plt>
mov    $0xbe2,%edi
call   1060 <glEnable@plt>
mov    $0x302,%edi
mov    $0x303,%esi
call   1030 <glBlendFunc@plt>
movss  -0x4(%rbp),%xmm3
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1040 <glColor4f@plt>
movss  0xe06(%rip),%xmm1
movss  0xe02(%rip),%xmm3
movaps %xmm1,%xmm0
movaps %xmm3,%xmm2
call   1070 <glRectf@plt>
mov    $0xbe2,%edi
call   10b0 <glDisable@plt>
mov    $0x0,%al
call   1080 <glPopMatrix@plt>
mov    $0x1700,%edi
call   1050 <glMatrixMode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fade>:
push   %rax
movss  %xmm0,0x4(%rsp)
mov    $0x1700,%edi
call   1050 <glMatrixMode@plt>
xor    %eax,%eax
call   1090 <glLoadIdentity@plt>
mov    $0x1701,%edi
call   1050 <glMatrixMode@plt>
xor    %eax,%eax
call   10a0 <glPushMatrix@plt>
xor    %eax,%eax
call   1090 <glLoadIdentity@plt>
mov    $0xbe2,%edi
call   1060 <glEnable@plt>
mov    $0x302,%edi
mov    $0x303,%esi
call   1030 <glBlendFunc@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
movss  0x4(%rsp),%xmm3
call   1040 <glColor4f@plt>
movss  0xe0b(%rip),%xmm0
movss  0xe07(%rip),%xmm2
movaps %xmm0,%xmm1
movaps %xmm2,%xmm3
call   1070 <glRectf@plt>
mov    $0xbe2,%edi
call   10b0 <glDisable@plt>
xor    %eax,%eax
call   1080 <glPopMatrix@plt>
mov    $0x1700,%edi
pop    %rax
jmp    1050 <glMatrixMode@plt>

LLVM IR (-O0):
define void @fade(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call i32 @glMatrixMode(i32 5888)
%4 = call i32 (...) @glLoadIdentity()
%5 = call i32 @glMatrixMode(i32 5889)
%6 = call i32 (...) @glPushMatrix()
%7 = call i32 (...) @glLoadIdentity()
%8 = call i32 @glEnable(i32 3042)
%9 = call i32 @glBlendFunc(i32 770, i32 771)
%10 = load float, float* %2
%11 = call i32 @glColor4f(float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float %10)
%12 = call i32 @glRectf(float -1.000000e+00, float -1.000000e+00, float 1.000000e+00, float 1.000000e+00)
%13 = call i32 @glDisable(i32 3042)
%14 = call i32 (...) @glPopMatrix()
%15 = call i32 @glMatrixMode(i32 5888)
ret void
}

LLVM IR (-O2):
define void @fade(float %0) {
%2 = tail call i32 @glMatrixMode(i32 5888)
%3 = tail call i32 (...) @glLoadIdentity()
%4 = tail call i32 @glMatrixMode(i32 5889)
%5 = tail call i32 (...) @glPushMatrix()
%6 = tail call i32 (...) @glLoadIdentity()
%7 = tail call i32 @glEnable(i32 3042)
%8 = tail call i32 @glBlendFunc(i32 770, i32 771)
%9 = tail call i32 @glColor4f(float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float %0)
%10 = tail call i32 @glRectf(float -1.000000e+00, float -1.000000e+00, float 1.000000e+00, float 1.000000e+00)
%11 = tail call i32 @glDisable(i32 3042)
%12 = tail call i32 (...) @glPopMatrix()
%13 = tail call i32 @glMatrixMode(i32 5888)
ret void
}