#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 GLsizei;
typedef int GLenum;

/* Variables and functions */
#define GL_2_BYTES 150
#define GL_3_BYTES 149
#define GL_4_BYTES 148
#define GL_DOUBLE 147
#define GL_FLOAT 146
#define GL_INT 145
#define GL_LUMINANCE 144
#define GL_LUMINANCE_ALPHA 143
#define GL_UNSIGNED_BYTE 142
#define GL_UNSIGNED_BYTE_2_3_3_REV 141
#define GL_UNSIGNED_BYTE_3_3_2 140
#define GL_UNSIGNED_INT 139
#define GL_UNSIGNED_INT_10_10_10_2 138
#define GL_UNSIGNED_INT_2_10_10_10_REV 137
#define GL_UNSIGNED_INT_8_8_8_8 136
#define GL_UNSIGNED_INT_8_8_8_8_REV 135
#define GL_UNSIGNED_SHORT 134
#define GL_UNSIGNED_SHORT_1_5_5_5_REV 133
#define GL_UNSIGNED_SHORT_4_4_4_4 132
#define GL_UNSIGNED_SHORT_4_4_4_4_REV 131
#define GL_UNSIGNED_SHORT_5_5_5_1 130
#define GL_UNSIGNED_SHORT_5_6_5 129
#define GL_UNSIGNED_SHORT_5_6_5_REV 128
int /*<<< orphan*/ printf(char *, int);
const GLsizei gl_sizeof(GLenum type) {
  switch (type) {
  case GL_DOUBLE:
    return 8;
  case GL_FLOAT:
  case GL_INT:
  case GL_UNSIGNED_INT:
  case GL_UNSIGNED_INT_10_10_10_2:
  case GL_UNSIGNED_INT_2_10_10_10_REV:
  case GL_UNSIGNED_INT_8_8_8_8:
  case GL_UNSIGNED_INT_8_8_8_8_REV:
  case GL_4_BYTES:
    return 4;
  case GL_3_BYTES:
    return 3;
  case GL_LUMINANCE_ALPHA:
  case GL_UNSIGNED_SHORT:
  case GL_UNSIGNED_SHORT_1_5_5_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_5_6_5:
  case GL_UNSIGNED_SHORT_5_6_5_REV:
  case GL_2_BYTES:
    return 2;
  case GL_LUMINANCE:
  case GL_UNSIGNED_BYTE:
  case GL_UNSIGNED_BYTE_2_3_3_REV:
  case GL_UNSIGNED_BYTE_3_3_2:
    return 1;
  }
  printf("gl_sizeof(): Unknown data type 0x%x\n", type);
  return 0;
}


x86 assembly (clang, -O0):
<gl_sizeof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x16,%eax
ja     1180 <gl_sizeof+0x70>
mov    -0x10(%rbp),%rax
lea    0xec5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x8,-0x4(%rbp)
jmp    1196 <gl_sizeof+0x86>
movl   $0x4,-0x4(%rbp)
jmp    1196 <gl_sizeof+0x86>
movl   $0x3,-0x4(%rbp)
jmp    1196 <gl_sizeof+0x86>
movl   $0x2,-0x4(%rbp)
jmp    1196 <gl_sizeof+0x86>
movl   $0x1,-0x4(%rbp)
jmp    1196 <gl_sizeof+0x86>
mov    -0x8(%rbp),%esi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gl_sizeof>:
push   %rax
mov    %edi,%esi
lea    -0x80(%rsi),%eax
cmp    $0x17,%eax
jae    1129 <gl_sizeof+0x19>
cltq
lea    0xf04(%rip),%rcx
mov    (%rcx,%rax,4),%eax
pop    %rcx
ret
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"gl_sizeof(): Unknown data type 0x%x\0A\00"
define i32 @gl_sizeof(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %10 [
i32 147, label %5
i32 146, label %6
i32 145, label %6
i32 139, label %6
i32 138, label %6
i32 137, label %6
i32 136, label %6
i32 135, label %6
i32 148, label %6
i32 149, label %7
i32 143, label %8
i32 134, label %8
i32 133, label %8
i32 132, label %8
i32 131, label %8
i32 130, label %8
i32 129, label %8
i32 128, label %8
i32 150, label %8
i32 144, label %9
i32 142, label %9
i32 141, label %9
i32 140, label %9
]
5: ; preds = %1
store i32 8, i32* %2
br label %13
6: ; preds = %1, %1, %1, %1, %1, %1, %1, %1
store i32 4, i32* %2
br label %13
7: ; preds = %1
store i32 3, i32* %2
br label %13
8: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 2, i32* %2
br label %13
9: ; preds = %1, %1, %1, %1
store i32 1, i32* %2
br label %13
10: ; preds = %1
%11 = load i32, i32* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %11)
store i32 0, i32* %2
br label %13
13: ; preds = %10, %9, %8, %7, %6, %5
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [37 x i8] c"gl_sizeof(): Unknown data type 0x%x\0A\00"
@switch.table.gl_sizeof = [23 x i32] [i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 4, i32 4, i32 4, i32 4, i32 4, i32 1, i32 1, i32 1, i32 2, i32 1, i32 4, i32 4, i32 8, i32 4, i32 3, i32 2]
define i32 @gl_sizeof(i32 %0) {
%2 = add i32 %0, -128
%3 = icmp ult i32 %2, 23
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %10
6: ; preds = %1
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds [23 x i32], [23 x i32]* @switch.table.gl_sizeof, i64 0, i64 %7
%9 = load i32, i32* %8
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ 0, %4 ], [ %9, %6 ]
ret i32 %11
}