#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_NEAREST;
int /*<<< orphan*/ GL_TEXTURE0;
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 loadDistTexture(char *filename, GLuint texID, int *texw, int *texh) {
  glActiveTextureARB(GL_TEXTURE0);
  glBindTexture(GL_TEXTURE_2D, texID);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
  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):
<loadDistTexture>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1030 <glActiveTextureARB@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%esi
call   1050 <glBindTexture@plt>
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
mov    0x2e72(%rip),%rax
mov    (%rax),%esi
mov    0x2e41(%rip),%rax
mov    (%rax),%edx
call   1040 <glTexParameteri@plt>
mov    0x2e3b(%rip),%rax
mov    (%rax),%edi
mov    0x2e1a(%rip),%rax
mov    (%rax),%esi
mov    0x2e21(%rip),%rax
mov    (%rax),%edx
call   1040 <glTexParameteri@plt>
mov    0x2e1b(%rip),%rax
mov    (%rax),%edi
mov    0x2e22(%rip),%rax
mov    (%rax),%esi
mov    0x2df9(%rip),%rax
mov    (%rax),%edx
call   1040 <glTexParameteri@plt>
mov    0x2dfb(%rip),%rax
mov    (%rax),%edi
mov    0x2dca(%rip),%rax
mov    (%rax),%esi
mov    0x2dd9(%rip),%rax
mov    (%rax),%edx
call   1040 <glTexParameteri@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loadDistTexture>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    0x2ea3(%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    0x2e58(%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_TEXTURE0 = global i32 0
@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_TEXTURE_WRAP_S = global i32 0
@GL_CLAMP_TO_EDGE = global i32 0
@GL_TEXTURE_WRAP_T = global i32 0
define void @loadDistTexture(i8* %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32, i32* @GL_TEXTURE0
%10 = call i32 @glActiveTextureARB(i32 %9)
%11 = load i32, i32* @GL_TEXTURE_2D
%12 = load i32, i32* %6
%13 = call i32 @glBindTexture(i32 %11, i32 %12)
%14 = load i32, i32* @GL_TEXTURE_2D
%15 = load i32, i32* @GL_TEXTURE_MIN_FILTER
%16 = load i32, i32* @GL_NEAREST
%17 = call i32 @glTexParameteri(i32 %14, i32 %15, i32 %16)
%18 = load i32, i32* @GL_TEXTURE_2D
%19 = load i32, i32* @GL_TEXTURE_MAG_FILTER
%20 = load i32, i32* @GL_NEAREST
%21 = call i32 @glTexParameteri(i32 %18, i32 %19, i32 %20)
%22 = load i32, i32* @GL_TEXTURE_2D
%23 = load i32, i32* @GL_TEXTURE_WRAP_S
%24 = load i32, i32* @GL_CLAMP_TO_EDGE
%25 = call i32 @glTexParameteri(i32 %22, i32 %23, i32 %24)
%26 = load i32, i32* @GL_TEXTURE_2D
%27 = load i32, i32* @GL_TEXTURE_WRAP_T
%28 = load i32, i32* @GL_CLAMP_TO_EDGE
%29 = call i32 @glTexParameteri(i32 %26, i32 %27, i32 %28)
ret void
}

LLVM IR (-O2):
@GL_TEXTURE0 = global i32 0
@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_TEXTURE_WRAP_S = global i32 0
@GL_CLAMP_TO_EDGE = global i32 0
@GL_TEXTURE_WRAP_T = global i32 0
define void @loadDistTexture(i8* nocapture readnone %0, i32 %1, i32* nocapture readnone %2, i32* nocapture readnone %3) {
%5 = load i32, i32* @GL_TEXTURE0
%6 = tail call i32 @glActiveTextureARB(i32 %5)
%7 = load i32, i32* @GL_TEXTURE_2D
%8 = tail call i32 @glBindTexture(i32 %7, i32 %1)
%9 = load i32, i32* @GL_TEXTURE_2D
%10 = load i32, i32* @GL_TEXTURE_MIN_FILTER
%11 = load i32, i32* @GL_NEAREST
%12 = tail call i32 @glTexParameteri(i32 %9, i32 %10, i32 %11)
%13 = load i32, i32* @GL_TEXTURE_2D
%14 = load i32, i32* @GL_TEXTURE_MAG_FILTER
%15 = load i32, i32* @GL_NEAREST
%16 = tail call i32 @glTexParameteri(i32 %13, i32 %14, i32 %15)
%17 = load i32, i32* @GL_TEXTURE_2D
%18 = load i32, i32* @GL_TEXTURE_WRAP_S
%19 = load i32, i32* @GL_CLAMP_TO_EDGE
%20 = tail call i32 @glTexParameteri(i32 %17, i32 %18, i32 %19)
%21 = load i32, i32* @GL_TEXTURE_2D
%22 = load i32, i32* @GL_TEXTURE_WRAP_T
%23 = load i32, i32* @GL_CLAMP_TO_EDGE
%24 = tail call i32 @glTexParameteri(i32 %21, i32 %22, i32 %23)
ret void
}