#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 GLint;
typedef int /*<<< orphan*/ GLhandleARB;

/* Variables and functions */
int glGetUniformLocationARB(int /*<<< orphan*/, char *);
int /*<<< orphan*/ glUniform1fARB(int, float);
int /*<<< orphan*/ glUniform1iARB(int, int);
int /*<<< orphan*/ glUseProgramObjectARB(int /*<<< orphan*/);
void setUniformVariables(GLhandleARB programObj, int disttexture,
                         int reftexture, float texw, float texh) {
  GLint location_disttexture = -1;
  GLint location_reftexture = -1;
  GLint location_texw = -1;
  GLint location_texh = -1;
  glUseProgramObjectARB(programObj);
  location_disttexture = glGetUniformLocationARB(programObj, "disttexture");
  if (location_disttexture != -1)
    glUniform1iARB(location_disttexture, disttexture);
  location_reftexture = glGetUniformLocationARB(programObj, "reftexture");
  if (location_reftexture != -1)
    glUniform1iARB(location_reftexture, reftexture);
  location_texw = glGetUniformLocationARB(programObj, "texw");
  if (location_texw != -1)
    glUniform1fARB(location_texw, texw);
  location_texh = glGetUniformLocationARB(programObj, "texh");
  if (location_texh != -1)
    glUniform1fARB(location_texh, texh);
  glUseProgramObjectARB(0);
}


x86 assembly (clang, -O0):
<setUniformVariables>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movss  %xmm0,-0x10(%rbp)
movss  %xmm1,-0x14(%rbp)
movl   $0xffffffff,-0x18(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
movl   $0xffffffff,-0x20(%rbp)
movl   $0xffffffff,-0x24(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <glUseProgramObjectARB@plt>
mov    -0x4(%rbp),%edi
lea    0xe77(%rip),%rsi
call   1030 <glGetUniformLocationARB@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
je     11a6 <setUniformVariables+0x66>
mov    -0x18(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <glUniform1iARB@plt>
mov    -0x4(%rbp),%edi
lea    0xe5c(%rip),%rsi
call   1030 <glGetUniformLocationARB@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
je     11cd <setUniformVariables+0x8d>
mov    -0x1c(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <glUniform1iARB@plt>
mov    -0x4(%rbp),%edi
lea    0xe40(%rip),%rsi
call   1030 <glGetUniformLocationARB@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0xffffffff,-0x20(%rbp)
je     11f6 <setUniformVariables+0xb6>
mov    -0x20(%rbp),%edi
movss  -0x10(%rbp),%xmm0
call   1060 <glUniform1fARB@plt>
mov    -0x4(%rbp),%edi
lea    0xe1c(%rip),%rsi
call   1030 <glGetUniformLocationARB@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0xffffffff,-0x24(%rbp)
je     121f <setUniformVariables+0xdf>
mov    -0x24(%rbp),%edi
movss  -0x14(%rbp),%xmm0
call   1060 <glUniform1fARB@plt>
xor    %edi,%edi
call   1050 <glUseProgramObjectARB@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setUniformVariables>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
movss  %xmm1,0xc(%rsp)
movss  %xmm0,0x8(%rsp)
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
call   1050 <glUseProgramObjectARB@plt>
lea    0xe99(%rip),%rsi
mov    %ebx,%edi
call   1030 <glGetUniformLocationARB@plt>
cmp    $0xffffffff,%eax
je     117c <setUniformVariables+0x3c>
mov    %eax,%edi
mov    %ebp,%esi
call   1040 <glUniform1iARB@plt>
lea    0xe89(%rip),%rsi
mov    %ebx,%edi
call   1030 <glGetUniformLocationARB@plt>
cmp    $0xffffffff,%eax
je     1199 <setUniformVariables+0x59>
mov    %eax,%edi
mov    %r14d,%esi
call   1040 <glUniform1iARB@plt>
lea    0xe77(%rip),%rsi
mov    %ebx,%edi
call   1030 <glGetUniformLocationARB@plt>
cmp    $0xffffffff,%eax
je     11b9 <setUniformVariables+0x79>
mov    %eax,%edi
movss  0x8(%rsp),%xmm0
call   1060 <glUniform1fARB@plt>
lea    0xe5c(%rip),%rsi
mov    %ebx,%edi
call   1030 <glGetUniformLocationARB@plt>
cmp    $0xffffffff,%eax
je     11d9 <setUniformVariables+0x99>
mov    %eax,%edi
movss  0xc(%rsp),%xmm0
call   1060 <glUniform1fARB@plt>
xor    %edi,%edi
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <glUseProgramObjectARB@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"disttexture\00"
@.str.1 = [11 x i8] c"reftexture\00"
@.str.2 = [5 x i8] c"texw\00"
@.str.3 = [5 x i8] c"texh\00"
define void @setUniformVariables(i32 %0, i32 %1, i32 %2, float %3, float %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca float
%10 = alloca float
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store float %3, float* %9
store float %4, float* %10
store i32 -1, i32* %11
store i32 -1, i32* %12
store i32 -1, i32* %13
store i32 -1, i32* %14
%15 = load i32, i32* %6
%16 = call i32 @glUseProgramObjectARB(i32 %15)
%17 = load i32, i32* %6
%18 = call i32 @glGetUniformLocationARB(i32 %17, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i32 %18, i32* %11
%19 = load i32, i32* %11
%20 = icmp ne i32 %19, -1
br i1 %20, label %21, label %25
21: ; preds = %5
%22 = load i32, i32* %11
%23 = load i32, i32* %7
%24 = call i32 @glUniform1iARB(i32 %22, i32 %23)
br label %25
25: ; preds = %21, %5
%26 = load i32, i32* %6
%27 = call i32 @glGetUniformLocationARB(i32 %26, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
store i32 %27, i32* %12
%28 = load i32, i32* %12
%29 = icmp ne i32 %28, -1
br i1 %29, label %30, label %34
30: ; preds = %25
%31 = load i32, i32* %12
%32 = load i32, i32* %8
%33 = call i32 @glUniform1iARB(i32 %31, i32 %32)
br label %34
34: ; preds = %30, %25
%35 = load i32, i32* %6
%36 = call i32 @glGetUniformLocationARB(i32 %35, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
store i32 %36, i32* %13
%37 = load i32, i32* %13
%38 = icmp ne i32 %37, -1
br i1 %38, label %39, label %43
39: ; preds = %34
%40 = load i32, i32* %13
%41 = load float, float* %9
%42 = call i32 @glUniform1fARB(i32 %40, float %41)
br label %43
43: ; preds = %39, %34
%44 = load i32, i32* %6
%45 = call i32 @glGetUniformLocationARB(i32 %44, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
store i32 %45, i32* %14
%46 = load i32, i32* %14
%47 = icmp ne i32 %46, -1
br i1 %47, label %48, label %52
48: ; preds = %43
%49 = load i32, i32* %14
%50 = load float, float* %10
%51 = call i32 @glUniform1fARB(i32 %49, float %50)
br label %52
52: ; preds = %48, %43
%53 = call i32 @glUseProgramObjectARB(i32 0)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"disttexture\00"
@.str.1 = [11 x i8] c"reftexture\00"
@.str.2 = [5 x i8] c"texw\00"
@.str.3 = [5 x i8] c"texh\00"
define void @setUniformVariables(i32 %0, i32 %1, i32 %2, float %3, float %4) {
%6 = tail call i32 @glUseProgramObjectARB(i32 %0)
%7 = tail call i32 @glGetUniformLocationARB(i32 %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32 %7, -1
br i1 %8, label %11, label %9
9: ; preds = %5
%10 = tail call i32 @glUniform1iARB(i32 %7, i32 %1)
br label %11
11: ; preds = %9, %5
%12 = tail call i32 @glGetUniformLocationARB(i32 %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i32 %12, -1
br i1 %13, label %16, label %14
14: ; preds = %11
%15 = tail call i32 @glUniform1iARB(i32 %12, i32 %2)
br label %16
16: ; preds = %14, %11
%17 = tail call i32 @glGetUniformLocationARB(i32 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp eq i32 %17, -1
br i1 %18, label %21, label %19
19: ; preds = %16
%20 = tail call i32 @glUniform1fARB(i32 %17, float %3)
br label %21
21: ; preds = %19, %16
%22 = tail call i32 @glGetUniformLocationARB(i32 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%23 = icmp eq i32 %22, -1
br i1 %23, label %26, label %24
24: ; preds = %21
%25 = tail call i32 @glUniform1fARB(i32 %22, float %4)
br label %26
26: ; preds = %24, %21
%27 = tail call i32 @glUseProgramObjectARB(i32 0)
ret void
}