#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 /*<<< orphan*/ GLuint;

/* Variables and functions */
int /*<<< orphan*/ GL_CLAMP_TO_EDGE;
int /*<<< orphan*/ GL_LINEAR;
int /*<<< orphan*/ GL_TEXTURE1;
int /*<<< orphan*/ GL_TEXTURE_2D;
int /*<<< orphan*/ GL_TEXTURE_MAG_FILTER;
int /*<<< orphan*/ GL_TEXTURE_MIN_FILTER;
int /*<<< orphan*/ GL_TEXTURE_WRAP_S;
int /*<<< orphan*/ GL_TEXTURE_WRAP_T;
int /*<<< orphan*/ glActiveTextureARB(int /*<<< orphan*/);
int /*<<< orphan*/ glBindTexture(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ glTexParameteri(int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/);
void loadRefTexture(char *filename, GLuint texID) {
  glActiveTextureARB(GL_TEXTURE1);
  glBindTexture(GL_TEXTURE_2D, texID);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
}


x86 assembly (clang, -O0):
<loadRefTexture>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
call   1030 <glActiveTextureARB@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%esi
call   1050 <glBindTexture@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
mov    0x2e7a(%rip),%rax
mov    (%rax),%esi
mov    0x2e69(%rip),%rax
mov    (%rax),%edx
call   1040 <glTexParameteri@plt>
mov    0x2e43(%rip),%rax
mov    (%rax),%edi
mov    0x2e22(%rip),%rax
mov    (%rax),%esi
mov    0x2e49(%rip),%rax
mov    (%rax),%edx
call   1040 <glTexParameteri@plt>
mov    0x2e23(%rip),%rax
mov    (%rax),%edi
mov    0x2e2a(%rip),%rax
mov    (%rax),%esi
mov    0x2e01(%rip),%rax
mov    (%rax),%edx
call   1040 <glTexParameteri@plt>
mov    0x2e03(%rip),%rax
mov    (%rax),%edi
mov    0x2dd2(%rip),%rax
mov    (%rax),%esi
mov    0x2de1(%rip),%rax
mov    (%rax),%edx
call   1040 <glTexParameteri@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loadRefTexture>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1030 <glActiveTextureARB@plt>
mov    0x2e7d(%rip),%r14
mov    (%r14),%edi
mov    %ebx,%esi
call   1050 <glBindTexture@plt>
mov    (%r14),%edi
mov    0x2e89(%rip),%rax
mov    (%rax),%esi
mov    0x2e78(%rip),%rbx
mov    (%rbx),%edx
call   1040 <glTexParameteri@plt>
mov    (%r14),%edi
mov    0x2e37(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
call   1040 <glTexParameteri@plt>
mov    (%r14),%edi
mov    0x2e4c(%rip),%rax
mov    (%rax),%esi
mov    0x2e23(%rip),%rbx
mov    (%rbx),%edx
call   1040 <glTexParameteri@plt>
mov    (%r14),%edi
mov    0x2dfa(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <glTexParameteri@plt>

LLVM IR (-O0):
@GL_TEXTURE1 = global i32 0
@GL_TEXTURE_2D = global i32 0
@GL_TEXTURE_MIN_FILTER = global i32 0
@GL_LINEAR = global i32 0
@GL_TEXTURE_MAG_FILTER = global i32 0
@GL_TEXTURE_WRAP_S = global i32 0
@GL_CLAMP_TO_EDGE = global i32 0
@GL_TEXTURE_WRAP_T = global i32 0
define void @loadRefTexture(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @GL_TEXTURE1
%6 = call i32 @glActiveTextureARB(i32 %5)
%7 = load i32, i32* @GL_TEXTURE_2D
%8 = load i32, i32* %4
%9 = call i32 @glBindTexture(i32 %7, i32 %8)
%10 = load i32, i32* @GL_TEXTURE_2D
%11 = load i32, i32* @GL_TEXTURE_MIN_FILTER
%12 = load i32, i32* @GL_LINEAR
%13 = call i32 @glTexParameteri(i32 %10, i32 %11, i32 %12)
%14 = load i32, i32* @GL_TEXTURE_2D
%15 = load i32, i32* @GL_TEXTURE_MAG_FILTER
%16 = load i32, i32* @GL_LINEAR
%17 = call i32 @glTexParameteri(i32 %14, i32 %15, i32 %16)
%18 = load i32, i32* @GL_TEXTURE_2D
%19 = load i32, i32* @GL_TEXTURE_WRAP_S
%20 = load i32, i32* @GL_CLAMP_TO_EDGE
%21 = call i32 @glTexParameteri(i32 %18, i32 %19, i32 %20)
%22 = load i32, i32* @GL_TEXTURE_2D
%23 = load i32, i32* @GL_TEXTURE_WRAP_T
%24 = load i32, i32* @GL_CLAMP_TO_EDGE
%25 = call i32 @glTexParameteri(i32 %22, i32 %23, i32 %24)
ret void
}

LLVM IR (-O2):
@GL_TEXTURE1 = global i32 0
@GL_TEXTURE_2D = global i32 0
@GL_TEXTURE_MIN_FILTER = global i32 0
@GL_LINEAR = global i32 0
@GL_TEXTURE_MAG_FILTER = global i32 0
@GL_TEXTURE_WRAP_S = global i32 0
@GL_CLAMP_TO_EDGE = global i32 0
@GL_TEXTURE_WRAP_T = global i32 0
define void @loadRefTexture(i8* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @GL_TEXTURE1
%4 = tail call i32 @glActiveTextureARB(i32 %3)
%5 = load i32, i32* @GL_TEXTURE_2D
%6 = tail call i32 @glBindTexture(i32 %5, i32 %1)
%7 = load i32, i32* @GL_TEXTURE_2D
%8 = load i32, i32* @GL_TEXTURE_MIN_FILTER
%9 = load i32, i32* @GL_LINEAR
%10 = tail call i32 @glTexParameteri(i32 %7, i32 %8, i32 %9)
%11 = load i32, i32* @GL_TEXTURE_2D
%12 = load i32, i32* @GL_TEXTURE_MAG_FILTER
%13 = load i32, i32* @GL_LINEAR
%14 = tail call i32 @glTexParameteri(i32 %11, i32 %12, i32 %13)
%15 = load i32, i32* @GL_TEXTURE_2D
%16 = load i32, i32* @GL_TEXTURE_WRAP_S
%17 = load i32, i32* @GL_CLAMP_TO_EDGE
%18 = tail call i32 @glTexParameteri(i32 %15, i32 %16, i32 %17)
%19 = load i32, i32* @GL_TEXTURE_2D
%20 = load i32, i32* @GL_TEXTURE_WRAP_T
%21 = load i32, i32* @GL_CLAMP_TO_EDGE
%22 = tail call i32 @glTexParameteri(i32 %19, i32 %20, i32 %21)
ret void
}