#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 /*<<< orphan*/ GLushort;
typedef int /*<<< orphan*/ GLuint;
typedef int /*<<< orphan*/ GLubyte;
typedef int /*<<< orphan*/ GLshort;
typedef int /*<<< orphan*/ GLint;
typedef double GLfloat;
typedef int GLenum;
typedef int /*<<< orphan*/ GLbyte;

/* Variables and functions */
#define GL_BITMAP 147
#define GL_BYTE 146
#define GL_FLOAT 145
#define GL_INT 144
#define GL_SHORT 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
GLfloat bytes_per_element(GLenum type) {
  switch (type) {
  case GL_BITMAP:
    return 1.0 / 8.0;
  case GL_UNSIGNED_SHORT:
    return (sizeof(GLushort));
  case GL_SHORT:
    return (sizeof(GLshort));
  case GL_UNSIGNED_BYTE:
    return (sizeof(GLubyte));
  case GL_BYTE:
    return (sizeof(GLbyte));
  case GL_INT:
    return (sizeof(GLint));
  case GL_UNSIGNED_INT:
    return (sizeof(GLuint));
  case GL_FLOAT:
    return (sizeof(GLfloat));
  case GL_UNSIGNED_BYTE_3_3_2:
  case GL_UNSIGNED_BYTE_2_3_3_REV:
    return (sizeof(GLubyte));
  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:
    return (sizeof(GLushort));
  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:
    return (sizeof(GLuint));
  default:
    return 4;
  }
}


x86 assembly (clang, -O0):
<bytes_per_element>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x13,%eax
ja     11f6 <bytes_per_element+0xf6>
mov    -0x18(%rbp),%rax
lea    0xef1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movsd  0xed8(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1203 <bytes_per_element+0x103>
movsd  0xeb6(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1203 <bytes_per_element+0x103>
movsd  0xea4(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1203 <bytes_per_element+0x103>
movsd  0xe92(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1203 <bytes_per_element+0x103>
movsd  0xe80(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1203 <bytes_per_element+0x103>
movsd  0xe6e(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1203 <bytes_per_element+0x103>
movsd  0xe5c(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1203 <bytes_per_element+0x103>
movsd  0xe52(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1203 <bytes_per_element+0x103>
movsd  0xe38(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1203 <bytes_per_element+0x103>
movsd  0xe26(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1203 <bytes_per_element+0x103>
movsd  0xe14(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1203 <bytes_per_element+0x103>
movsd  0xe02(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytes_per_element>:
add    $0xffffff80,%edi
cmp    $0x13,%edi
ja     1118 <bytes_per_element+0x18>
movslq %edi,%rax
lea    0xef6(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
ret
movsd  0xee0(%rip),%xmm0
ret

LLVM IR (-O0):
define double @bytes_per_element(i32 %0) {
%2 = alloca double
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %16 [
i32 147, label %5
i32 134, label %6
i32 143, label %7
i32 142, label %8
i32 146, label %9
i32 144, label %10
i32 139, label %11
i32 145, label %12
i32 140, label %13
i32 141, label %13
i32 129, label %14
i32 128, label %14
i32 132, label %14
i32 131, label %14
i32 130, label %14
i32 133, label %14
i32 136, label %15
i32 135, label %15
i32 138, label %15
i32 137, label %15
]
5: ; preds = %1
store double 1.250000e-01, double* %2
br label %17
6: ; preds = %1
store double 4.000000e+00, double* %2
br label %17
7: ; preds = %1
store double 4.000000e+00, double* %2
br label %17
8: ; preds = %1
store double 4.000000e+00, double* %2
br label %17
9: ; preds = %1
store double 4.000000e+00, double* %2
br label %17
10: ; preds = %1
store double 4.000000e+00, double* %2
br label %17
11: ; preds = %1
store double 4.000000e+00, double* %2
br label %17
12: ; preds = %1
store double 8.000000e+00, double* %2
br label %17
13: ; preds = %1, %1
store double 4.000000e+00, double* %2
br label %17
14: ; preds = %1, %1, %1, %1, %1, %1
store double 4.000000e+00, double* %2
br label %17
15: ; preds = %1, %1, %1, %1
store double 4.000000e+00, double* %2
br label %17
16: ; preds = %1
store double 4.000000e+00, double* %2
br label %17
17: ; preds = %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%18 = load double, double* %2
ret double %18
}

LLVM IR (-O2):
@switch.table.bytes_per_element = [20 x double] [double 4.000000e+00, double 4.000000e+00, double 4.000000e+00, double 4.000000e+00, double 4.000000e+00, double 4.000000e+00, double 4.000000e+00, double 4.000000e+00, double 4.000000e+00, double 4.000000e+00, double 4.000000e+00, double 4.000000e+00, double 4.000000e+00, double 4.000000e+00, double 4.000000e+00, double 4.000000e+00, double 4.000000e+00, double 8.000000e+00, double 4.000000e+00, double 1.250000e-01]
define double @bytes_per_element(i32 %0) {
%2 = add i32 %0, -128
%3 = icmp ult i32 %2, 20
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [20 x double], [20 x double]* @switch.table.bytes_per_element, i64 0, i64 %5
%7 = load double, double* %6
br label %8
8: ; preds = %1, %4
%9 = phi double [ %7, %4 ], [ 4.000000e+00, %1 ]
ret double %9
}