#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_422_AVERAGE_EXT 166
#define GL_422_EXT 165
#define GL_422_REV_AVERAGE_EXT 164
#define GL_422_REV_EXT 163
#define GL_ABGR_EXT 162
#define GL_ALPHA 161
#define GL_BGR 160
#define GL_BGRA 159
#define GL_BLUE 158
#define GL_COLOR_INDEX 157
#define GL_DEPTH_COMPONENT 156
#define GL_GREEN 155
#define GL_INTENSITY 154
#define GL_LUMINANCE 153
#define GL_LUMINANCE_ALPHA 152
#define GL_RED 151
#define GL_RGB 150
#define GL_RGBA 149
#define GL_STENCIL_INDEX 148
#define GL_UNSIGNED_BYTE_2_3_3_REV 147
#define GL_UNSIGNED_BYTE_3_3_2 146
#define GL_UNSIGNED_INT_10_10_10_2 145
#define GL_UNSIGNED_INT_24_8_MESA 144
#define GL_UNSIGNED_INT_24_8_NV 143
#define GL_UNSIGNED_INT_2_10_10_10_REV 142
#define GL_UNSIGNED_INT_8_24_REV_MESA 141
#define GL_UNSIGNED_INT_8_8_8_8 140
#define GL_UNSIGNED_INT_8_8_8_8_REV 139
#define GL_UNSIGNED_SHORT_15_1_MESA 138
#define GL_UNSIGNED_SHORT_1_15_REV_MESA 137
#define GL_UNSIGNED_SHORT_1_5_5_5_REV 136
#define GL_UNSIGNED_SHORT_4_4_4_4 135
#define GL_UNSIGNED_SHORT_4_4_4_4_REV 134
#define GL_UNSIGNED_SHORT_5_5_5_1 133
#define GL_UNSIGNED_SHORT_5_6_5 132
#define GL_UNSIGNED_SHORT_5_6_5_REV 131
#define GL_UNSIGNED_SHORT_8_8_APPLE 130
#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 129
#define GL_YCBCR_422_APPLE 128
GLint __glElementsPerGroup(GLenum format, GLenum type) {
  switch (type) {
  case GL_UNSIGNED_BYTE_3_3_2:
  case GL_UNSIGNED_BYTE_2_3_3_REV:
  case GL_UNSIGNED_SHORT_5_6_5:
  case GL_UNSIGNED_SHORT_5_6_5_REV:
  case GL_UNSIGNED_SHORT_4_4_4_4:
  case GL_UNSIGNED_SHORT_4_4_4_4_REV:
  case GL_UNSIGNED_SHORT_5_5_5_1:
  case GL_UNSIGNED_SHORT_1_5_5_5_REV:
  case GL_UNSIGNED_SHORT_8_8_APPLE:
  case GL_UNSIGNED_SHORT_8_8_REV_APPLE:
  case GL_UNSIGNED_SHORT_15_1_MESA:
  case GL_UNSIGNED_SHORT_1_15_REV_MESA:
  case GL_UNSIGNED_INT_8_8_8_8:
  case GL_UNSIGNED_INT_8_8_8_8_REV:
  case GL_UNSIGNED_INT_10_10_10_2:
  case GL_UNSIGNED_INT_2_10_10_10_REV:
  case GL_UNSIGNED_INT_24_8_NV:
  case GL_UNSIGNED_INT_24_8_MESA:
  case GL_UNSIGNED_INT_8_24_REV_MESA:
    return 1;
  default:
    break;
  }
  switch (format) {
  case GL_RGB:
  case GL_BGR:
    return 3;
  case GL_422_EXT:
  case GL_422_REV_EXT:
  case GL_422_AVERAGE_EXT:
  case GL_422_REV_AVERAGE_EXT:
  case GL_YCBCR_422_APPLE:
  case GL_LUMINANCE_ALPHA:
    return 2;
  case GL_RGBA:
  case GL_BGRA:
  case GL_ABGR_EXT:
    return 4;
  case GL_COLOR_INDEX:
  case GL_STENCIL_INDEX:
  case GL_DEPTH_COMPONENT:
  case GL_RED:
  case GL_GREEN:
  case GL_BLUE:
  case GL_ALPHA:
  case GL_LUMINANCE:
  case GL_INTENSITY:
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<__glElementsPerGroup>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffff7f,%eax
sub    $0x12,%eax
ja     112c <__glElementsPerGroup+0x2c>
jmp    1120 <__glElementsPerGroup+0x20>
movl   $0x1,-0x4(%rbp)
jmp    1191 <__glElementsPerGroup+0x91>
jmp    1131 <__glElementsPerGroup+0x31>
mov    -0x8(%rbp),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x26,%eax
ja     118a <__glElementsPerGroup+0x8a>
mov    -0x18(%rbp),%rax
lea    0xeaf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x3,-0x4(%rbp)
jmp    1191 <__glElementsPerGroup+0x91>
movl   $0x2,-0x4(%rbp)
jmp    1191 <__glElementsPerGroup+0x91>
movl   $0x4,-0x4(%rbp)
jmp    1191 <__glElementsPerGroup+0x91>
movl   $0x1,-0x4(%rbp)
jmp    1191 <__glElementsPerGroup+0x91>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__glElementsPerGroup>:
add    $0xffffff7f,%esi
mov    $0x1,%eax
cmp    $0x13,%esi
jb     1127 <__glElementsPerGroup+0x27>
add    $0xffffff80,%edi
xor    %eax,%eax
cmp    $0x26,%edi
ja     1127 <__glElementsPerGroup+0x27>
movslq %edi,%rax
lea    0xedc(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @__glElementsPerGroup(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
switch i32 %6, label %8 [
i32 146, label %7
i32 147, label %7
i32 132, label %7
i32 131, label %7
i32 135, label %7
i32 134, label %7
i32 133, label %7
i32 136, label %7
i32 130, label %7
i32 129, label %7
i32 138, label %7
i32 137, label %7
i32 140, label %7
i32 139, label %7
i32 145, label %7
i32 142, label %7
i32 143, label %7
i32 144, label %7
i32 141, label %7
]
7: ; preds = %2, %2, %2, %2, %2, %2, %2, %2, %2, %2, %2, %2, %2, %2, %2, %2, %2, %2, %2
store i32 1, i32* %3
br label %16
8: ; preds = %2
br label %9
9: ; preds = %8
%10 = load i32, i32* %4
switch i32 %10, label %15 [
i32 150, label %11
i32 160, label %11
i32 165, label %12
i32 163, label %12
i32 166, label %12
i32 164, label %12
i32 128, label %12
i32 152, label %12
i32 149, label %13
i32 159, label %13
i32 162, label %13
i32 157, label %14
i32 148, label %14
i32 156, label %14
i32 151, label %14
i32 155, label %14
i32 158, label %14
i32 161, label %14
i32 153, label %14
i32 154, label %14
]
11: ; preds = %9, %9
store i32 3, i32* %3
br label %16
12: ; preds = %9, %9, %9, %9, %9, %9
store i32 2, i32* %3
br label %16
13: ; preds = %9, %9, %9
store i32 4, i32* %3
br label %16
14: ; preds = %9, %9, %9, %9, %9, %9, %9, %9, %9
store i32 1, i32* %3
br label %16
15: ; preds = %9
store i32 0, i32* %3
br label %16
16: ; preds = %15, %14, %13, %12, %11, %7
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@switch.table.__glElementsPerGroup = [39 x i32] [i32 2, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 4, i32 3, i32 1, i32 2, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 4, i32 3, i32 1, i32 4, i32 2, i32 2, i32 2, i32 2]
define i32 @__glElementsPerGroup(i32 %0, i32 %1) {
%3 = add i32 %1, -129
%4 = icmp ult i32 %3, 19
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = add i32 %0, -128
%7 = icmp ult i32 %6, 39
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = sext i32 %6 to i64
%10 = getelementptr inbounds [39 x i32], [39 x i32]* @switch.table.__glElementsPerGroup, i64 0, i64 %9
%11 = load i32, i32* %10
br label %12
12: ; preds = %5, %8, %2
%13 = phi i32 [ 1, %2 ], [ %11, %8 ], [ 0, %5 ]
ret i32 %13
}