#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 GLenum;

/* Variables and functions */
#define GL_PIXEL_MAP_A_TO_A 137
int GL_PIXEL_MAP_A_TO_A_SIZE;
#define GL_PIXEL_MAP_B_TO_B 136
int GL_PIXEL_MAP_B_TO_B_SIZE;
#define GL_PIXEL_MAP_G_TO_G 135
int GL_PIXEL_MAP_G_TO_G_SIZE;
#define GL_PIXEL_MAP_I_TO_A 134
int GL_PIXEL_MAP_I_TO_A_SIZE;
#define GL_PIXEL_MAP_I_TO_B 133
int GL_PIXEL_MAP_I_TO_B_SIZE;
#define GL_PIXEL_MAP_I_TO_G 132
int GL_PIXEL_MAP_I_TO_G_SIZE;
#define GL_PIXEL_MAP_I_TO_I 131
int GL_PIXEL_MAP_I_TO_I_SIZE;
#define GL_PIXEL_MAP_I_TO_R 130
int GL_PIXEL_MAP_I_TO_R_SIZE;
#define GL_PIXEL_MAP_R_TO_R 129
int GL_PIXEL_MAP_R_TO_R_SIZE;
#define GL_PIXEL_MAP_S_TO_S 128
int GL_PIXEL_MAP_S_TO_S_SIZE;
int /*<<< orphan*/ glGetIntegerv(int, int *);
GLint __glGetPixelMap_size(GLenum map) {
  GLint size;
  GLenum query;
  switch (map) {
  case GL_PIXEL_MAP_I_TO_I:
    query = GL_PIXEL_MAP_I_TO_I_SIZE;
    break;
  case GL_PIXEL_MAP_S_TO_S:
    query = GL_PIXEL_MAP_S_TO_S_SIZE;
    break;
  case GL_PIXEL_MAP_I_TO_R:
    query = GL_PIXEL_MAP_I_TO_R_SIZE;
    break;
  case GL_PIXEL_MAP_I_TO_G:
    query = GL_PIXEL_MAP_I_TO_G_SIZE;
    break;
  case GL_PIXEL_MAP_I_TO_B:
    query = GL_PIXEL_MAP_I_TO_B_SIZE;
    break;
  case GL_PIXEL_MAP_I_TO_A:
    query = GL_PIXEL_MAP_I_TO_A_SIZE;
    break;
  case GL_PIXEL_MAP_R_TO_R:
    query = GL_PIXEL_MAP_R_TO_R_SIZE;
    break;
  case GL_PIXEL_MAP_G_TO_G:
    query = GL_PIXEL_MAP_G_TO_G_SIZE;
    break;
  case GL_PIXEL_MAP_B_TO_B:
    query = GL_PIXEL_MAP_B_TO_B_SIZE;
    break;
  case GL_PIXEL_MAP_A_TO_A:
    query = GL_PIXEL_MAP_A_TO_A_SIZE;
    break;
  default:
    return -1;
  }
  glGetIntegerv(query, &size);
  return size;
}


x86 assembly (clang, -O0):
<__glGetPixelMap_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x9,%eax
ja     11ee <__glGetPixelMap_size+0xde>
mov    -0x18(%rbp),%rax
lea    0xec5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2e65(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
jmp    11fa <__glGetPixelMap_size+0xea>
mov    0x2e3c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
jmp    11fa <__glGetPixelMap_size+0xea>
mov    0x2e53(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
jmp    11fa <__glGetPixelMap_size+0xea>
mov    0x2e72(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
jmp    11fa <__glGetPixelMap_size+0xea>
mov    0x2e41(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
jmp    11fa <__glGetPixelMap_size+0xea>
mov    0x2e28(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
jmp    11fa <__glGetPixelMap_size+0xea>
mov    0x2e27(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
jmp    11fa <__glGetPixelMap_size+0xea>
mov    0x2e36(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
jmp    11fa <__glGetPixelMap_size+0xea>
mov    0x2dd5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
jmp    11fa <__glGetPixelMap_size+0xea>
mov    0x2dac(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
jmp    11fa <__glGetPixelMap_size+0xea>
movl   $0xffffffff,-0x4(%rbp)
jmp    120c <__glGetPixelMap_size+0xfc>
mov    -0x10(%rbp),%edi
lea    -0xc(%rbp),%rsi
call   1030 <glGetIntegerv@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__glGetPixelMap_size>:
add    $0xffffff80,%edi
mov    $0xffffffff,%eax
cmp    $0x9,%edi
ja     1140 <__glGetPixelMap_size+0x30>
push   %rax
movslq %edi,%rax
lea    0x2ca8(%rip),%rcx
mov    (%rcx,%rax,8),%rax
mov    (%rax),%edi
lea    0x4(%rsp),%rsi
call   1030 <glGetIntegerv@plt>
mov    0x4(%rsp),%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@GL_PIXEL_MAP_I_TO_I_SIZE = global i32 0
@GL_PIXEL_MAP_S_TO_S_SIZE = global i32 0
@GL_PIXEL_MAP_I_TO_R_SIZE = global i32 0
@GL_PIXEL_MAP_I_TO_G_SIZE = global i32 0
@GL_PIXEL_MAP_I_TO_B_SIZE = global i32 0
@GL_PIXEL_MAP_I_TO_A_SIZE = global i32 0
@GL_PIXEL_MAP_R_TO_R_SIZE = global i32 0
@GL_PIXEL_MAP_G_TO_G_SIZE = global i32 0
@GL_PIXEL_MAP_B_TO_B_SIZE = global i32 0
@GL_PIXEL_MAP_A_TO_A_SIZE = global i32 0
define i32 @__glGetPixelMap_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
switch i32 %6, label %27 [
i32 131, label %7
i32 128, label %9
i32 130, label %11
i32 132, label %13
i32 133, label %15
i32 134, label %17
i32 129, label %19
i32 135, label %21
i32 136, label %23
i32 137, label %25
]
7: ; preds = %1
%8 = load i32, i32* @GL_PIXEL_MAP_I_TO_I_SIZE
store i32 %8, i32* %5
br label %28
9: ; preds = %1
%10 = load i32, i32* @GL_PIXEL_MAP_S_TO_S_SIZE
store i32 %10, i32* %5
br label %28
11: ; preds = %1
%12 = load i32, i32* @GL_PIXEL_MAP_I_TO_R_SIZE
store i32 %12, i32* %5
br label %28
13: ; preds = %1
%14 = load i32, i32* @GL_PIXEL_MAP_I_TO_G_SIZE
store i32 %14, i32* %5
br label %28
15: ; preds = %1
%16 = load i32, i32* @GL_PIXEL_MAP_I_TO_B_SIZE
store i32 %16, i32* %5
br label %28
17: ; preds = %1
%18 = load i32, i32* @GL_PIXEL_MAP_I_TO_A_SIZE
store i32 %18, i32* %5
br label %28
19: ; preds = %1
%20 = load i32, i32* @GL_PIXEL_MAP_R_TO_R_SIZE
store i32 %20, i32* %5
br label %28
21: ; preds = %1
%22 = load i32, i32* @GL_PIXEL_MAP_G_TO_G_SIZE
store i32 %22, i32* %5
br label %28
23: ; preds = %1
%24 = load i32, i32* @GL_PIXEL_MAP_B_TO_B_SIZE
store i32 %24, i32* %5
br label %28
25: ; preds = %1
%26 = load i32, i32* @GL_PIXEL_MAP_A_TO_A_SIZE
store i32 %26, i32* %5
br label %28
27: ; preds = %1
store i32 -1, i32* %2
br label %32
28: ; preds = %25, %23, %21, %19, %17, %15, %13, %11, %9, %7
%29 = load i32, i32* %5
%30 = call i32 @glGetIntegerv(i32 %29, i32* %4)
%31 = load i32, i32* %4
store i32 %31, i32* %2
br label %32
32: ; preds = %28, %27
%33 = load i32, i32* %2
ret i32 %33
}

LLVM IR (-O2):
@GL_PIXEL_MAP_I_TO_I_SIZE = global i32 0
@GL_PIXEL_MAP_S_TO_S_SIZE = global i32 0
@GL_PIXEL_MAP_I_TO_R_SIZE = global i32 0
@GL_PIXEL_MAP_I_TO_G_SIZE = global i32 0
@GL_PIXEL_MAP_I_TO_B_SIZE = global i32 0
@GL_PIXEL_MAP_I_TO_A_SIZE = global i32 0
@GL_PIXEL_MAP_R_TO_R_SIZE = global i32 0
@GL_PIXEL_MAP_G_TO_G_SIZE = global i32 0
@GL_PIXEL_MAP_B_TO_B_SIZE = global i32 0
@GL_PIXEL_MAP_A_TO_A_SIZE = global i32 0
@switch.table.__glGetPixelMap_size = [10 x i32*] [i32* @GL_PIXEL_MAP_S_TO_S_SIZE, i32* @GL_PIXEL_MAP_R_TO_R_SIZE, i32* @GL_PIXEL_MAP_I_TO_R_SIZE, i32* @GL_PIXEL_MAP_I_TO_I_SIZE, i32* @GL_PIXEL_MAP_I_TO_G_SIZE, i32* @GL_PIXEL_MAP_I_TO_B_SIZE, i32* @GL_PIXEL_MAP_I_TO_A_SIZE, i32* @GL_PIXEL_MAP_G_TO_G_SIZE, i32* @GL_PIXEL_MAP_B_TO_B_SIZE, i32* @GL_PIXEL_MAP_A_TO_A_SIZE]
define i32 @__glGetPixelMap_size(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = add i32 %0, -128
%5 = icmp ult i32 %4, 10
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = sext i32 %4 to i64
%8 = getelementptr inbounds [10 x i32*], [10 x i32*]* @switch.table.__glGetPixelMap_size, i64 0, i64 %7
%9 = load i32*, i32** %8
%10 = load i32, i32* %9
%11 = call i32 @glGetIntegerv(i32 %10, i32* %2)
%12 = load i32, i32* %2
br label %13
13: ; preds = %1, %6
%14 = phi i32 [ %12, %6 ], [ -1, %1 ]
ret i32 %14
}