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

/* Variables and functions */
int /*<<< orphan*/ GL_NEAREST;
int /*<<< orphan*/ GL_RGBA;
int /*<<< orphan*/ GL_TEXTURE_2D;
int /*<<< orphan*/ GL_TEXTURE_MAG_FILTER;
int /*<<< orphan*/ GL_TEXTURE_MIN_FILTER;
int /*<<< orphan*/ GL_UNSIGNED_BYTE;
int /*<<< orphan*/ glTexImage2D(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                int, int, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/, int *);
int /*<<< orphan*/ glTexParameteri(int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/);
void setNullTexture(void) {
  GLubyte texPixel[4] = {0xff, 0xff, 0xff, 0xff};
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
  glTexImage2D(GL_TEXTURE_2D, 0, 4, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE,
               texPixel);
}


x86 assembly (clang, -O0):
<setNullTexture>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
mov    0x2e92(%rip),%rax
mov    (%rax),%esi
mov    0x2e71(%rip),%rax
mov    (%rax),%edx
call   1030 <glTexParameteri@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
mov    0x2e4a(%rip),%rax
mov    (%rax),%esi
mov    0x2e51(%rip),%rax
mov    (%rax),%edx
call   1030 <glTexParameteri@plt>
mov    0x2e4b(%rip),%rax
mov    (%rax),%edi
mov    0x2e62(%rip),%rax
mov    (%rax),%r11d
mov    0x2e28(%rip),%rax
mov    (%rax),%r10d
lea    -0x10(%rbp),%rax
xor    %r9d,%r9d
mov    $0x4,%edx
mov    $0x1,%r8d
mov    %r9d,%esi
mov    %r8d,%ecx
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1040 <glTexImage2D@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setNullTexture>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movaps 0xed2(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    0x2e97(%rip),%rbx
mov    (%rbx),%edi
mov    0x2e9e(%rip),%rax
mov    (%rax),%esi
mov    0x2e7d(%rip),%r14
mov    (%r14),%edx
call   1030 <glTexParameteri@plt>
mov    (%rbx),%edi
mov    0x2e5c(%rip),%rax
mov    (%rax),%esi
mov    (%r14),%edx
call   1030 <glTexParameteri@plt>
mov    (%rbx),%edi
mov    0x2e81(%rip),%rax
mov    (%rax),%eax
mov    0x2e48(%rip),%rcx
mov    (%rcx),%ebx
sub    $0x8,%rsp
lea    0x8(%rsp),%r10
xor    %esi,%esi
mov    $0x4,%edx
mov    $0x1,%ecx
mov    $0x1,%r8d
xor    %r9d,%r9d
push   %r10
push   %rbx
push   %rax
call   1040 <glTexImage2D@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.setNullTexture.texPixel = [4 x i32] [i32 255, i32 255, i32 255, i32 255]
@GL_TEXTURE_2D = global i32 0
@GL_TEXTURE_MIN_FILTER = global i32 0
@GL_NEAREST = global i32 0
@GL_TEXTURE_MAG_FILTER = global i32 0
@GL_RGBA = global i32 0
@GL_UNSIGNED_BYTE = global i32 0
define void @setNullTexture() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = load i32, i32* @GL_TEXTURE_2D
%4 = load i32, i32* @GL_TEXTURE_MIN_FILTER
%5 = load i32, i32* @GL_NEAREST
%6 = call i32 @glTexParameteri(i32 %3, i32 %4, i32 %5)
%7 = load i32, i32* @GL_TEXTURE_2D
%8 = load i32, i32* @GL_TEXTURE_MAG_FILTER
%9 = load i32, i32* @GL_NEAREST
%10 = call i32 @glTexParameteri(i32 %7, i32 %8, i32 %9)
%11 = load i32, i32* @GL_TEXTURE_2D
%12 = load i32, i32* @GL_RGBA
%13 = load i32, i32* @GL_UNSIGNED_BYTE
%14 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%15 = call i32 @glTexImage2D(i32 %11, i32 0, i32 4, i32 1, i32 1, i32 0, i32 %12, i32 %13, i32* %14)
ret void
}

LLVM IR (-O2):
@__const.setNullTexture.texPixel = [4 x i32] [i32 255, i32 255, i32 255, i32 255]
@GL_TEXTURE_2D = global i32 0
@GL_TEXTURE_MIN_FILTER = global i32 0
@GL_NEAREST = global i32 0
@GL_TEXTURE_MAG_FILTER = global i32 0
@GL_RGBA = global i32 0
@GL_UNSIGNED_BYTE = global i32 0
define void @setNullTexture() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = load i32, i32* @GL_TEXTURE_2D
%4 = load i32, i32* @GL_TEXTURE_MIN_FILTER
%5 = load i32, i32* @GL_NEAREST
%6 = tail call i32 @glTexParameteri(i32 %3, i32 %4, i32 %5)
%7 = load i32, i32* @GL_TEXTURE_2D
%8 = load i32, i32* @GL_TEXTURE_MAG_FILTER
%9 = load i32, i32* @GL_NEAREST
%10 = tail call i32 @glTexParameteri(i32 %7, i32 %8, i32 %9)
%11 = load i32, i32* @GL_TEXTURE_2D
%12 = load i32, i32* @GL_RGBA
%13 = load i32, i32* @GL_UNSIGNED_BYTE
%14 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%15 = call i32 @glTexImage2D(i32 %11, i32 0, i32 4, i32 1, i32 1, i32 0, i32 %12, i32 %13, i32* %14)
ret void
}