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

/* Variables and functions */
#define GL_2_BYTES 137
#define GL_3_BYTES 136
#define GL_4_BYTES 135
#define GL_BYTE 134
#define GL_FLOAT 133
#define GL_INT 132
#define GL_SHORT 131
#define GL_UNSIGNED_BYTE 130
#define GL_UNSIGNED_INT 129
#define GL_UNSIGNED_SHORT 128
GLint __glCallLists_size(GLsizei n, GLenum type) {
  GLint size;
  if (n < 0)
    return 0;
  switch (type) {
  case GL_BYTE:
    size = 1;
    break;
  case GL_UNSIGNED_BYTE:
    size = 1;
    break;
  case GL_SHORT:
    size = 2;
    break;
  case GL_UNSIGNED_SHORT:
    size = 2;
    break;
  case GL_INT:
    size = 4;
    break;
  case GL_UNSIGNED_INT:
    size = 4;
    break;
  case GL_FLOAT:
    size = 4;
    break;
  case GL_2_BYTES:
    size = 2;
    break;
  case GL_3_BYTES:
    size = 3;
    break;
  case GL_4_BYTES:
    size = 4;
    break;
  default:
    return 0;
  }
  return n * size;
}


x86 assembly (clang, -O0):
<__glCallLists_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1120 <__glCallLists_size+0x20>
movl   $0x0,-0x4(%rbp)
jmp    11d7 <__glCallLists_size+0xd7>
mov    -0xc(%rbp),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x9,%eax
ja     11c1 <__glCallLists_size+0xc1>
mov    -0x18(%rbp),%rax
lea    0xec0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x10(%rbp)
jmp    11cd <__glCallLists_size+0xcd>
movl   $0x1,-0x10(%rbp)
jmp    11cd <__glCallLists_size+0xcd>
movl   $0x2,-0x10(%rbp)
jmp    11cd <__glCallLists_size+0xcd>
movl   $0x2,-0x10(%rbp)
jmp    11cd <__glCallLists_size+0xcd>
movl   $0x4,-0x10(%rbp)
jmp    11cd <__glCallLists_size+0xcd>
movl   $0x4,-0x10(%rbp)
jmp    11cd <__glCallLists_size+0xcd>
movl   $0x4,-0x10(%rbp)
jmp    11cd <__glCallLists_size+0xcd>
movl   $0x2,-0x10(%rbp)
jmp    11cd <__glCallLists_size+0xcd>
movl   $0x3,-0x10(%rbp)
jmp    11cd <__glCallLists_size+0xcd>
movl   $0x4,-0x10(%rbp)
jmp    11cd <__glCallLists_size+0xcd>
movl   $0x0,-0x4(%rbp)
jmp    11d7 <__glCallLists_size+0xd7>
mov    -0x8(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__glCallLists_size>:
xor    %eax,%eax
test   %edi,%edi
js     111e <__glCallLists_size+0x1e>
add    $0xffffff80,%esi
cmp    $0x9,%esi
ja     111e <__glCallLists_size+0x1e>
movslq %esi,%rax
lea    0xee8(%rip),%rcx
imul   (%rcx,%rax,4),%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @__glCallLists_size(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %27
10: ; preds = %2
%11 = load i32, i32* %5
switch i32 %11, label %22 [
i32 134, label %12
i32 130, label %13
i32 131, label %14
i32 128, label %15
i32 132, label %16
i32 129, label %17
i32 133, label %18
i32 137, label %19
i32 136, label %20
i32 135, label %21
]
12: ; preds = %10
store i32 1, i32* %6
br label %23
13: ; preds = %10
store i32 1, i32* %6
br label %23
14: ; preds = %10
store i32 2, i32* %6
br label %23
15: ; preds = %10
store i32 2, i32* %6
br label %23
16: ; preds = %10
store i32 4, i32* %6
br label %23
17: ; preds = %10
store i32 4, i32* %6
br label %23
18: ; preds = %10
store i32 4, i32* %6
br label %23
19: ; preds = %10
store i32 2, i32* %6
br label %23
20: ; preds = %10
store i32 3, i32* %6
br label %23
21: ; preds = %10
store i32 4, i32* %6
br label %23
22: ; preds = %10
store i32 0, i32* %3
br label %27
23: ; preds = %21, %20, %19, %18, %17, %16, %15, %14, %13, %12
%24 = load i32, i32* %4
%25 = load i32, i32* %6
%26 = mul nsw i32 %24, %25
store i32 %26, i32* %3
br label %27
27: ; preds = %23, %22, %9
%28 = load i32, i32* %3
ret i32 %28
}

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