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

/* Variables and functions */
#define GL_BGR 132
#define GL_BGRA 131
#define GL_LUMINANCE_ALPHA 130
#define GL_RGB 129
#define GL_RGBA 128
scalar_t__ GL_UNSIGNED_BYTE_2_3_3_REV;
scalar_t__ GL_UNSIGNED_BYTE_3_3_2;
scalar_t__ GL_UNSIGNED_INT_10_10_10_2;
scalar_t__ GL_UNSIGNED_INT_2_10_10_10_REV;
scalar_t__ GL_UNSIGNED_INT_8_8_8_8;
scalar_t__ GL_UNSIGNED_INT_8_8_8_8_REV;
scalar_t__ GL_UNSIGNED_SHORT_1_5_5_5_REV;
scalar_t__ GL_UNSIGNED_SHORT_4_4_4_4;
scalar_t__ GL_UNSIGNED_SHORT_4_4_4_4_REV;
scalar_t__ GL_UNSIGNED_SHORT_5_5_5_1;
scalar_t__ GL_UNSIGNED_SHORT_5_6_5;
scalar_t__ GL_UNSIGNED_SHORT_5_6_5_REV;
GLint elements_per_group(GLenum format, GLenum type) {
  if (type == GL_UNSIGNED_BYTE_3_3_2 || type == GL_UNSIGNED_BYTE_2_3_3_REV ||
      type == GL_UNSIGNED_SHORT_5_6_5 || type == GL_UNSIGNED_SHORT_5_6_5_REV ||
      type == GL_UNSIGNED_SHORT_4_4_4_4 ||
      type == GL_UNSIGNED_SHORT_4_4_4_4_REV ||
      type == GL_UNSIGNED_SHORT_5_5_5_1 ||
      type == GL_UNSIGNED_SHORT_1_5_5_5_REV ||
      type == GL_UNSIGNED_INT_8_8_8_8 || type == GL_UNSIGNED_INT_8_8_8_8_REV ||
      type == GL_UNSIGNED_INT_10_10_10_2 ||
      type == GL_UNSIGNED_INT_2_10_10_10_REV) {
    return 1;
  }
  switch (format) {
  case GL_RGB:
  case GL_BGR:
    return 3;
  case GL_LUMINANCE_ALPHA:
    return 2;
  case GL_RGBA:
  case GL_BGRA:
    return 4;
  default:
    return 1;
  }
}


x86 assembly (clang, -O0):
<elements_per_group>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x2ec1(%rip),%rcx
cmp    (%rcx),%rax
je     11fc <elements_per_group+0xfc>
mov    -0x18(%rbp),%rax
mov    0x2ea5(%rip),%rcx
cmp    (%rcx),%rax
je     11fc <elements_per_group+0xfc>
mov    -0x18(%rbp),%rax
mov    0x2e69(%rip),%rcx
cmp    (%rcx),%rax
je     11fc <elements_per_group+0xfc>
mov    -0x18(%rbp),%rax
mov    0x2e3d(%rip),%rcx
cmp    (%rcx),%rax
je     11fc <elements_per_group+0xfc>
mov    -0x18(%rbp),%rax
mov    0x2e19(%rip),%rcx
cmp    (%rcx),%rax
je     11fc <elements_per_group+0xfc>
mov    -0x18(%rbp),%rax
mov    0x2e35(%rip),%rcx
cmp    (%rcx),%rax
je     11fc <elements_per_group+0xfc>
mov    -0x18(%rbp),%rax
mov    0x2e51(%rip),%rcx
cmp    (%rcx),%rax
je     11fc <elements_per_group+0xfc>
mov    -0x18(%rbp),%rax
mov    0x2e1d(%rip),%rcx
cmp    (%rcx),%rax
je     11fc <elements_per_group+0xfc>
mov    -0x18(%rbp),%rax
mov    0x2de1(%rip),%rcx
cmp    (%rcx),%rax
je     11fc <elements_per_group+0xfc>
mov    -0x18(%rbp),%rax
mov    0x2dd5(%rip),%rcx
cmp    (%rcx),%rax
je     11fc <elements_per_group+0xfc>
mov    -0x18(%rbp),%rax
mov    0x2e11(%rip),%rcx
cmp    (%rcx),%rax
je     11fc <elements_per_group+0xfc>
mov    -0x18(%rbp),%rax
mov    0x2dd5(%rip),%rcx
cmp    (%rcx),%rax
jne    1208 <elements_per_group+0x108>
movl   $0x1,-0x4(%rbp)
jmp    125d <elements_per_group+0x15d>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffff80,%rax
mov    %rax,-0x20(%rbp)
sub    $0x4,%rax
ja     1256 <elements_per_group+0x156>
mov    -0x20(%rbp),%rax
lea    0xdd7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x3,-0x4(%rbp)
jmp    125d <elements_per_group+0x15d>
movl   $0x2,-0x4(%rbp)
jmp    125d <elements_per_group+0x15d>
movl   $0x4,-0x4(%rbp)
jmp    125d <elements_per_group+0x15d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<elements_per_group>:
mov    0x2ed1(%rip),%rcx
mov    $0x1,%eax
cmp    %rsi,(%rcx)
je     11b9 <elements_per_group+0xb9>
mov    0x2eb4(%rip),%rcx
cmp    %rsi,(%rcx)
je     11b9 <elements_per_group+0xb9>
mov    0x2e7c(%rip),%rcx
cmp    %rsi,(%rcx)
je     11b9 <elements_per_group+0xb9>
mov    0x2e54(%rip),%rcx
cmp    %rsi,(%rcx)
je     11b9 <elements_per_group+0xb9>
mov    0x2e38(%rip),%rcx
cmp    %rsi,(%rcx)
je     11b9 <elements_per_group+0xb9>
mov    0x2e5c(%rip),%rcx
cmp    %rsi,(%rcx)
je     11b9 <elements_per_group+0xb9>
mov    0x2e80(%rip),%rcx
cmp    %rsi,(%rcx)
je     11b9 <elements_per_group+0xb9>
mov    0x2e54(%rip),%rcx
cmp    %rsi,(%rcx)
je     11b9 <elements_per_group+0xb9>
mov    0x2e20(%rip),%rcx
cmp    %rsi,(%rcx)
je     11b9 <elements_per_group+0xb9>
mov    0x2e1c(%rip),%rcx
cmp    %rsi,(%rcx)
je     11b9 <elements_per_group+0xb9>
mov    0x2e60(%rip),%rcx
cmp    %rsi,(%rcx)
je     11b9 <elements_per_group+0xb9>
mov    0x2e2c(%rip),%rcx
cmp    %rsi,(%rcx)
je     11b9 <elements_per_group+0xb9>
lea    -0x80(%rdi),%rcx
cmp    $0x4,%rcx
ja     11b9 <elements_per_group+0xb9>
lea    0xe4e(%rip),%rax
mov    -0x200(%rax,%rdi,4),%eax
ret

LLVM IR (-O0):
@GL_UNSIGNED_BYTE_3_3_2 = global i64 0
@GL_UNSIGNED_BYTE_2_3_3_REV = global i64 0
@GL_UNSIGNED_SHORT_5_6_5 = global i64 0
@GL_UNSIGNED_SHORT_5_6_5_REV = global i64 0
@GL_UNSIGNED_SHORT_4_4_4_4 = global i64 0
@GL_UNSIGNED_SHORT_4_4_4_4_REV = global i64 0
@GL_UNSIGNED_SHORT_5_5_5_1 = global i64 0
@GL_UNSIGNED_SHORT_1_5_5_5_REV = global i64 0
@GL_UNSIGNED_INT_8_8_8_8 = global i64 0
@GL_UNSIGNED_INT_8_8_8_8_REV = global i64 0
@GL_UNSIGNED_INT_10_10_10_2 = global i64 0
@GL_UNSIGNED_INT_2_10_10_10_REV = global i64 0
define i32 @elements_per_group(i64 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = load i64, i64* @GL_UNSIGNED_BYTE_3_3_2
%8 = icmp eq i64 %6, %7
br i1 %8, label %53, label %9
9: ; preds = %2
%10 = load i64, i64* %5
%11 = load i64, i64* @GL_UNSIGNED_BYTE_2_3_3_REV
%12 = icmp eq i64 %10, %11
br i1 %12, label %53, label %13
13: ; preds = %9
%14 = load i64, i64* %5
%15 = load i64, i64* @GL_UNSIGNED_SHORT_5_6_5
%16 = icmp eq i64 %14, %15
br i1 %16, label %53, label %17
17: ; preds = %13
%18 = load i64, i64* %5
%19 = load i64, i64* @GL_UNSIGNED_SHORT_5_6_5_REV
%20 = icmp eq i64 %18, %19
br i1 %20, label %53, label %21
21: ; preds = %17
%22 = load i64, i64* %5
%23 = load i64, i64* @GL_UNSIGNED_SHORT_4_4_4_4
%24 = icmp eq i64 %22, %23
br i1 %24, label %53, label %25
25: ; preds = %21
%26 = load i64, i64* %5
%27 = load i64, i64* @GL_UNSIGNED_SHORT_4_4_4_4_REV
%28 = icmp eq i64 %26, %27
br i1 %28, label %53, label %29
29: ; preds = %25
%30 = load i64, i64* %5
%31 = load i64, i64* @GL_UNSIGNED_SHORT_5_5_5_1
%32 = icmp eq i64 %30, %31
br i1 %32, label %53, label %33
33: ; preds = %29
%34 = load i64, i64* %5
%35 = load i64, i64* @GL_UNSIGNED_SHORT_1_5_5_5_REV
%36 = icmp eq i64 %34, %35
br i1 %36, label %53, label %37
37: ; preds = %33
%38 = load i64, i64* %5
%39 = load i64, i64* @GL_UNSIGNED_INT_8_8_8_8
%40 = icmp eq i64 %38, %39
br i1 %40, label %53, label %41
41: ; preds = %37
%42 = load i64, i64* %5
%43 = load i64, i64* @GL_UNSIGNED_INT_8_8_8_8_REV
%44 = icmp eq i64 %42, %43
br i1 %44, label %53, label %45
45: ; preds = %41
%46 = load i64, i64* %5
%47 = load i64, i64* @GL_UNSIGNED_INT_10_10_10_2
%48 = icmp eq i64 %46, %47
br i1 %48, label %53, label %49
49: ; preds = %45
%50 = load i64, i64* %5
%51 = load i64, i64* @GL_UNSIGNED_INT_2_10_10_10_REV
%52 = icmp eq i64 %50, %51
br i1 %52, label %53, label %54
53: ; preds = %49, %45, %41, %37, %33, %29, %25, %21, %17, %13, %9, %2
store i32 1, i32* %3
br label %60
54: ; preds = %49
%55 = load i64, i64* %4
switch i64 %55, label %59 [
i64 129, label %56
i64 132, label %56
i64 130, label %57
i64 128, label %58
i64 131, label %58
]
56: ; preds = %54, %54
store i32 3, i32* %3
br label %60
57: ; preds = %54
store i32 2, i32* %3
br label %60
58: ; preds = %54, %54
store i32 4, i32* %3
br label %60
59: ; preds = %54
store i32 1, i32* %3
br label %60
60: ; preds = %59, %58, %57, %56, %53
%61 = load i32, i32* %3
ret i32 %61
}

LLVM IR (-O2):
@GL_UNSIGNED_BYTE_3_3_2 = global i64 0
@GL_UNSIGNED_BYTE_2_3_3_REV = global i64 0
@GL_UNSIGNED_SHORT_5_6_5 = global i64 0
@GL_UNSIGNED_SHORT_5_6_5_REV = global i64 0
@GL_UNSIGNED_SHORT_4_4_4_4 = global i64 0
@GL_UNSIGNED_SHORT_4_4_4_4_REV = global i64 0
@GL_UNSIGNED_SHORT_5_5_5_1 = global i64 0
@GL_UNSIGNED_SHORT_1_5_5_5_REV = global i64 0
@GL_UNSIGNED_INT_8_8_8_8 = global i64 0
@GL_UNSIGNED_INT_8_8_8_8_REV = global i64 0
@GL_UNSIGNED_INT_10_10_10_2 = global i64 0
@GL_UNSIGNED_INT_2_10_10_10_REV = global i64 0
@switch.table.elements_per_group = [5 x i32] [i32 4, i32 3, i32 2, i32 4, i32 3]
define i32 @elements_per_group(i64 %0, i64 %1) {
%3 = load i64, i64* @GL_UNSIGNED_BYTE_3_3_2
%4 = icmp eq i64 %3, %1
%5 = load i64, i64* @GL_UNSIGNED_BYTE_2_3_3_REV
%6 = icmp eq i64 %5, %1
%7 = select i1 %4, i1 true, i1 %6
%8 = load i64, i64* @GL_UNSIGNED_SHORT_5_6_5
%9 = icmp eq i64 %8, %1
%10 = select i1 %7, i1 true, i1 %9
%11 = load i64, i64* @GL_UNSIGNED_SHORT_5_6_5_REV
%12 = icmp eq i64 %11, %1
%13 = select i1 %10, i1 true, i1 %12
%14 = load i64, i64* @GL_UNSIGNED_SHORT_4_4_4_4
%15 = icmp eq i64 %14, %1
%16 = select i1 %13, i1 true, i1 %15
%17 = load i64, i64* @GL_UNSIGNED_SHORT_4_4_4_4_REV
%18 = icmp eq i64 %17, %1
%19 = select i1 %16, i1 true, i1 %18
%20 = load i64, i64* @GL_UNSIGNED_SHORT_5_5_5_1
%21 = icmp eq i64 %20, %1
%22 = select i1 %19, i1 true, i1 %21
%23 = load i64, i64* @GL_UNSIGNED_SHORT_1_5_5_5_REV
%24 = icmp eq i64 %23, %1
%25 = select i1 %22, i1 true, i1 %24
%26 = load i64, i64* @GL_UNSIGNED_INT_8_8_8_8
%27 = icmp eq i64 %26, %1
%28 = select i1 %25, i1 true, i1 %27
%29 = load i64, i64* @GL_UNSIGNED_INT_8_8_8_8_REV
%30 = icmp eq i64 %29, %1
%31 = select i1 %28, i1 true, i1 %30
%32 = load i64, i64* @GL_UNSIGNED_INT_10_10_10_2
%33 = icmp eq i64 %32, %1
%34 = select i1 %31, i1 true, i1 %33
%35 = load i64, i64* @GL_UNSIGNED_INT_2_10_10_10_REV
%36 = icmp eq i64 %35, %1
%37 = select i1 %34, i1 true, i1 %36
br i1 %37, label %44, label %38
38: ; preds = %2
%39 = add i64 %0, -128
%40 = icmp ult i64 %39, 5
br i1 %40, label %41, label %44
41: ; preds = %38
%42 = getelementptr inbounds [5 x i32], [5 x i32]* @switch.table.elements_per_group, i64 0, i64 %39
%43 = load i32, i32* %42
br label %44
44: ; preds = %38, %41, %2
%45 = phi i32 [ 1, %2 ], [ %43, %41 ], [ 1, %38 ]
ret i32 %45
}