#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 */

/* Variables and functions */
int crc32(unsigned char *, int);
int N64GetCIC(unsigned char *data) {
  switch (crc32(&data[0x40], (0x1000 - 0x40))) {
  case 0x6170A4A1:
    return 6101;
  case 0x90BB6CB5:
    return 6102;
  case 0x0B050EE0:
    return 6103;
  case 0x98BC2C86:
    return 6105;
  case 0xACC8580A:
    return 6106;
  default:
    return 6102;
  }
  return 0;
}


x86 assembly (clang, -O0):
<N64GetCIC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x40,%rdi
mov    $0xfc0,%esi
call   1030 <crc32@plt>
mov    %eax,%ecx
mov    %ecx,-0x14(%rbp)
sub    $0x90bb6cb5,%eax
je     119b <N64GetCIC+0x8b>
jmp    1143 <N64GetCIC+0x33>
mov    -0x14(%rbp),%eax
sub    $0x98bc2c86,%eax
je     11b3 <N64GetCIC+0xa3>
jmp    1156 <N64GetCIC+0x46>
mov    -0x14(%rbp),%eax
sub    $0xacc8580a,%eax
je     11bf <N64GetCIC+0xaf>
jmp    1169 <N64GetCIC+0x59>
mov    -0x14(%rbp),%eax
sub    $0xb050ee0,%eax
je     11a7 <N64GetCIC+0x97>
jmp    117c <N64GetCIC+0x6c>
mov    -0x14(%rbp),%eax
sub    $0x6170a4a1,%eax
jne    11cb <N64GetCIC+0xbb>
jmp    118f <N64GetCIC+0x7f>
movl   $0x17d5,-0x4(%rbp)
jmp    11d2 <N64GetCIC+0xc2>
movl   $0x17d6,-0x4(%rbp)
jmp    11d2 <N64GetCIC+0xc2>
movl   $0x17d7,-0x4(%rbp)
jmp    11d2 <N64GetCIC+0xc2>
movl   $0x17d9,-0x4(%rbp)
jmp    11d2 <N64GetCIC+0xc2>
movl   $0x17da,-0x4(%rbp)
jmp    11d2 <N64GetCIC+0xc2>
movl   $0x17d6,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<N64GetCIC>:
push   %rax
add    $0x40,%rdi
mov    $0xfc0,%esi
call   1030 <crc32@plt>
mov    %eax,%ecx
cmp    $0xacc85809,%eax
jle    1147 <N64GetCIC+0x37>
cmp    $0xacc8580a,%ecx
je     1165 <N64GetCIC+0x55>
cmp    $0xb050ee0,%ecx
je     116c <N64GetCIC+0x5c>
mov    $0x17d5,%eax
cmp    $0x6170a4a1,%ecx
jne    115e <N64GetCIC+0x4e>
pop    %rcx
ret
cmp    $0x90bb6cb5,%ecx
je     115e <N64GetCIC+0x4e>
cmp    $0x98bc2c86,%ecx
jne    115e <N64GetCIC+0x4e>
mov    $0x17d9,%eax
pop    %rcx
ret
mov    $0x17d6,%eax
pop    %rcx
ret
mov    $0x17da,%eax
pop    %rcx
ret
mov    $0x17d7,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @N64GetCIC(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 64
%6 = call i32 @crc32(i8* %5, i32 4032)
switch i32 %6, label %12 [
i32 1634772129, label %7
i32 -1866765131, label %8
i32 184880864, label %9
i32 -1732498298, label %10
i32 -1396156406, label %11
]
7: ; preds = %1
store i32 6101, i32* %2
br label %13
8: ; preds = %1
store i32 6102, i32* %2
br label %13
9: ; preds = %1
store i32 6103, i32* %2
br label %13
10: ; preds = %1
store i32 6105, i32* %2
br label %13
11: ; preds = %1
store i32 6106, i32* %2
br label %13
12: ; preds = %1
store i32 6102, i32* %2
br label %13
13: ; preds = %12, %11, %10, %9, %8, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @N64GetCIC(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 64
%3 = tail call i32 @crc32(i8* %2, i32 4032)
switch i32 %3, label %8 [
i32 1634772129, label %9
i32 -1866765131, label %4
i32 184880864, label %5
i32 -1732498298, label %6
i32 -1396156406, label %7
]
4: ; preds = %1
br label %9
5: ; preds = %1
br label %9
6: ; preds = %1
br label %9
7: ; preds = %1
br label %9
8: ; preds = %1
br label %9
9: ; preds = %1, %8, %7, %6, %5, %4
%10 = phi i32 [ 6102, %8 ], [ 6106, %7 ], [ 6105, %6 ], [ 6103, %5 ], [ 6102, %4 ], [ 6101, %1 ]
ret i32 %10
}