#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 */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int member_0;
  int member_1;
  int member_2;
  int member_3;
};
typedef TYPE_1__ GLfloat;

/* Variables and functions */
int /*<<< orphan*/ GL_TEXTURE_ENV;
int /*<<< orphan*/ GL_TEXTURE_ENV_COLOR;
int /*<<< orphan*/ glTexEnvfv(int /*<<< orphan*/, int /*<<< orphan*/,
                              TYPE_1__ *);
void texenv(int env) {
  GLfloat colors[3][4] = {
      {
          0.,
          0.,
          0.,
          0.,
      },
      {
          .1,
          .1,
          .1,
          0.,
      },
      {
          1.,
          1.,
          1.,
          0.,
      },
  };
  glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, colors[env]);
}


x86 assembly (clang, -O0):
<texenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    %edi,-0x4(%rbp)
lea    -0xd0(%rbp),%rdi
xor    %esi,%esi
mov    $0xc0,%edx
call   1030 <memset@plt>
movl   $0x1,-0x50(%rbp)
movl   $0x1,-0x4c(%rbp)
movl   $0x1,-0x48(%rbp)
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
mov    0x2e72(%rip),%rax
mov    (%rax),%esi
movslq -0x4(%rbp),%rax
lea    -0xd0(%rbp),%rdx
shl    $0x6,%rax
add    %rax,%rdx
call   1040 <glTexEnvfv@plt>
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<texenv>:
sub    $0xc8,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movabs $0x100000001,%rax
mov    %rax,0x80(%rsp)
movl   $0x1,0x88(%rsp)
mov    0x2e63(%rip),%rax
mov    (%rax),%eax
mov    0x2e4a(%rip),%rcx
mov    (%rcx),%esi
movslq %edi,%rcx
shl    $0x6,%rcx
lea    (%rsp,%rcx,1),%rdx
mov    %eax,%edi
call   1030 <glTexEnvfv@plt>
add    $0xc8,%rsp
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32, i32, i32 }
@GL_TEXTURE_ENV = global i32 0
@GL_TEXTURE_ENV_COLOR = global i32 0
define void @texenv(i32 %0) {
%2 = alloca i32
%3 = alloca [3 x [4 x %struct.TYPE_3__]]
store i32 %0, i32* %2
%4 = bitcast [3 x [4 x %struct.TYPE_3__]]* %3 to i8*
%5 = bitcast i8* %4 to [3 x [4 x %struct.TYPE_3__]]*
%6 = getelementptr inbounds [3 x [4 x %struct.TYPE_3__]], [3 x [4 x %struct.TYPE_3__]]* %5, i32 0, i32 2
%7 = getelementptr inbounds [4 x %struct.TYPE_3__], [4 x %struct.TYPE_3__]* %6, i32 0, i32 0
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i32 0, i32 0
store i32 1, i32* %8
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i32 0, i32 1
store i32 1, i32* %9
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i32 0, i32 2
store i32 1, i32* %10
%11 = load i32, i32* @GL_TEXTURE_ENV
%12 = load i32, i32* @GL_TEXTURE_ENV_COLOR
%13 = load i32, i32* %2
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [3 x [4 x %struct.TYPE_3__]], [3 x [4 x %struct.TYPE_3__]]* %3, i64 0, i64 %14
%16 = getelementptr inbounds [4 x %struct.TYPE_3__], [4 x %struct.TYPE_3__]* %15, i64 0, i64 0
%17 = call i32 @glTexEnvfv(i32 %11, i32 %12, %struct.TYPE_3__* %16)
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i32, i32, i32 }
@GL_TEXTURE_ENV = global i32 0
@GL_TEXTURE_ENV_COLOR = global i32 0
define void @texenv(i32 %0) {
%2 = alloca [3 x [4 x %struct.TYPE_3__]]
%3 = bitcast [3 x [4 x %struct.TYPE_3__]]* %2 to i8*
%4 = getelementptr inbounds [3 x [4 x %struct.TYPE_3__]], [3 x [4 x %struct.TYPE_3__]]* %2, i64 0, i64 2, i64 0, i32 0
store i32 1, i32* %4
%5 = getelementptr inbounds [3 x [4 x %struct.TYPE_3__]], [3 x [4 x %struct.TYPE_3__]]* %2, i64 0, i64 2, i64 0, i32 1
store i32 1, i32* %5
%6 = getelementptr inbounds [3 x [4 x %struct.TYPE_3__]], [3 x [4 x %struct.TYPE_3__]]* %2, i64 0, i64 2, i64 0, i32 2
store i32 1, i32* %6
%7 = load i32, i32* @GL_TEXTURE_ENV
%8 = load i32, i32* @GL_TEXTURE_ENV_COLOR
%9 = sext i32 %0 to i64
%10 = getelementptr inbounds [3 x [4 x %struct.TYPE_3__]], [3 x [4 x %struct.TYPE_3__]]* %2, i64 0, i64 %9, i64 0
%11 = call i32 @glTexEnvfv(i32 %7, i32 %8, %struct.TYPE_3__* %10)
ret void
}