#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 /*<<< orphan*/ strToUtf8(char *, char *, int, int, int /*<<< orphan*/ *);
scalar_t__ strcmpi(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ stricmp(char *, char *);
unsigned int FileExtensionToClassCode(char *extension, int wide) {
  char tempExtension[10], temp2[10];
  unsigned int retVal;
  if (wide) {
    strToUtf8(temp2, extension, 10, 1, NULL);
    extension = temp2;
  }
  if (extension[0] != '.') {
    tempExtension[0] = '.';
    strcpy(tempExtension + 1, extension);
    extension = tempExtension;
  }
  if (stricmp(extension, ".mp3") == 0) {
    retVal = (0x00000001 | 0x02000000);
  } else if (stricmp(extension, ".wma") == 0) {
    retVal = (0x00000001 | 0x02000000);
  } else if (stricmp(extension, ".ogg") == 0) {
    retVal = (0x00000001 | 0x02000000);
  } else if (stricmp(extension, ".asf") == 0) {
    retVal = (0x00000001 | 0x03000000);
  } else if (stricmp(extension, ".wmv") == 0) {
    retVal = (0x00000001 | 0x03000000);
  } else if (stricmp(extension, ".mpg") == 0) {
    retVal = (0x00000001 | 0x03000000);
  } else if (stricmp(extension, ".mov") == 0) {
    retVal = (0x00000001 | 0x03000000);
  } else if (stricmp(extension, ".jpg") == 0) {
    retVal = (0x00000001 | 0x01000000);
  } else if (stricmp(extension, ".jpeg") == 0) {
    retVal = (0x00000001 | 0x01000000);
  } else if (stricmp(extension, ".bmp") == 0) {
    retVal = (0x00000001 | 0x01000000);
  } else if (strcmpi(extension, ".m3u") == 0) {
    retVal = (0x00000002 | 0x07000000);
  } else if (strcmpi(extension, ".asx") == 0) {
    retVal = (0x00000002 | 0x07000000);
  } else {
    retVal = (0x00000001);
  }
  return retVal;
}


x86 assembly (clang, -O0):
<FileExtensionToClassCode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     117d <FileExtensionToClassCode+0x3d>
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0xa,%edx
mov    $0x1,%ecx
xor    %eax,%eax
mov    %eax,%r8d
call   1060 <strToUtf8@plt>
lea    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
je     11aa <FileExtensionToClassCode+0x6a>
movb   $0x2e,-0x16(%rbp)
lea    -0x16(%rbp),%rdi
add    $0x1,%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x16(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe4b(%rip),%rsi
call   1040 <stricmp@plt>
cmp    $0x0,%rax
jne    11d0 <FileExtensionToClassCode+0x90>
movl   $0x2000001,-0x24(%rbp)
jmp    13b0 <FileExtensionToClassCode+0x270>
mov    -0x8(%rbp),%rdi
lea    0xe2a(%rip),%rsi
call   1040 <stricmp@plt>
cmp    $0x0,%rax
jne    11f6 <FileExtensionToClassCode+0xb6>
movl   $0x2000001,-0x24(%rbp)
jmp    13ab <FileExtensionToClassCode+0x26b>
mov    -0x8(%rbp),%rdi
lea    0xe09(%rip),%rsi
call   1040 <stricmp@plt>
cmp    $0x0,%rax
jne    121c <FileExtensionToClassCode+0xdc>
movl   $0x2000001,-0x24(%rbp)
jmp    13a6 <FileExtensionToClassCode+0x266>
mov    -0x8(%rbp),%rdi
lea    0xde8(%rip),%rsi
call   1040 <stricmp@plt>
cmp    $0x0,%rax
jne    1242 <FileExtensionToClassCode+0x102>
movl   $0x3000001,-0x24(%rbp)
jmp    13a1 <FileExtensionToClassCode+0x261>
mov    -0x8(%rbp),%rdi
lea    0xdc7(%rip),%rsi
call   1040 <stricmp@plt>
cmp    $0x0,%rax
jne    1268 <FileExtensionToClassCode+0x128>
movl   $0x3000001,-0x24(%rbp)
jmp    139c <FileExtensionToClassCode+0x25c>
mov    -0x8(%rbp),%rdi
lea    0xda6(%rip),%rsi
call   1040 <stricmp@plt>
cmp    $0x0,%rax
jne    128e <FileExtensionToClassCode+0x14e>
movl   $0x3000001,-0x24(%rbp)
jmp    1397 <FileExtensionToClassCode+0x257>
mov    -0x8(%rbp),%rdi
lea    0xd85(%rip),%rsi
call   1040 <stricmp@plt>
cmp    $0x0,%rax
jne    12b4 <FileExtensionToClassCode+0x174>
movl   $0x3000001,-0x24(%rbp)
jmp    1392 <FileExtensionToClassCode+0x252>
mov    -0x8(%rbp),%rdi
lea    0xd64(%rip),%rsi
call   1040 <stricmp@plt>
cmp    $0x0,%rax
jne    12da <FileExtensionToClassCode+0x19a>
movl   $0x1000001,-0x24(%rbp)
jmp    138d <FileExtensionToClassCode+0x24d>
mov    -0x8(%rbp),%rdi
lea    0xd43(%rip),%rsi
call   1040 <stricmp@plt>
cmp    $0x0,%rax
jne    1300 <FileExtensionToClassCode+0x1c0>
movl   $0x1000001,-0x24(%rbp)
jmp    1388 <FileExtensionToClassCode+0x248>
mov    -0x8(%rbp),%rdi
lea    0xd23(%rip),%rsi
call   1040 <stricmp@plt>
cmp    $0x0,%rax
jne    1326 <FileExtensionToClassCode+0x1e6>
movl   $0x1000001,-0x24(%rbp)
jmp    1383 <FileExtensionToClassCode+0x243>
mov    -0x8(%rbp),%rdi
lea    0xd02(%rip),%rsi
call   1050 <strcmpi@plt>
cmp    $0x0,%rax
jne    134c <FileExtensionToClassCode+0x20c>
movl   $0x7000002,-0x24(%rbp)
jmp    137e <FileExtensionToClassCode+0x23e>
mov    -0x8(%rbp),%rdi
lea    0xce1(%rip),%rsi
call   1050 <strcmpi@plt>
cmp    $0x0,%rax
jne    1372 <FileExtensionToClassCode+0x232>
movl   $0x7000002,-0x24(%rbp)
jmp    1379 <FileExtensionToClassCode+0x239>
movl   $0x1,-0x24(%rbp)
jmp    137e <FileExtensionToClassCode+0x23e>
jmp    1383 <FileExtensionToClassCode+0x243>
jmp    1388 <FileExtensionToClassCode+0x248>
jmp    138d <FileExtensionToClassCode+0x24d>
jmp    1392 <FileExtensionToClassCode+0x252>
jmp    1397 <FileExtensionToClassCode+0x257>
jmp    139c <FileExtensionToClassCode+0x25c>
jmp    13a1 <FileExtensionToClassCode+0x261>
jmp    13a6 <FileExtensionToClassCode+0x266>
jmp    13ab <FileExtensionToClassCode+0x26b>
jmp    13b0 <FileExtensionToClassCode+0x270>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FileExtensionToClassCode>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
test   %esi,%esi
je     116d <FileExtensionToClassCode+0x2d>
lea    0xe(%rsp),%rbp
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0xa,%edx
mov    $0x1,%ecx
xor    %r8d,%r8d
call   1060 <strToUtf8@plt>
mov    %rbp,%rbx
cmpb   $0x2e,(%rbx)
je     118c <FileExtensionToClassCode+0x4c>
lea    0x4(%rsp),%rbp
movb   $0x2e,0x4(%rsp)
lea    0x5(%rsp),%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbp,%rbx
lea    0xe6d(%rip),%rsi
mov    %rbx,%rdi
call   1040 <stricmp@plt>
mov    $0x2000001,%ebp
test   %rax,%rax
je     12b5 <FileExtensionToClassCode+0x175>
lea    0xe55(%rip),%rsi
mov    %rbx,%rdi
call   1040 <stricmp@plt>
test   %rax,%rax
je     12b5 <FileExtensionToClassCode+0x175>
lea    0xe42(%rip),%rsi
mov    %rbx,%rdi
call   1040 <stricmp@plt>
test   %rax,%rax
je     12b5 <FileExtensionToClassCode+0x175>
lea    0xe2f(%rip),%rsi
mov    %rbx,%rdi
call   1040 <stricmp@plt>
mov    $0x3000001,%ebp
test   %rax,%rax
je     12b5 <FileExtensionToClassCode+0x175>
lea    0xe17(%rip),%rsi
mov    %rbx,%rdi
call   1040 <stricmp@plt>
test   %rax,%rax
je     12b5 <FileExtensionToClassCode+0x175>
lea    0xe04(%rip),%rsi
mov    %rbx,%rdi
call   1040 <stricmp@plt>
test   %rax,%rax
je     12b5 <FileExtensionToClassCode+0x175>
lea    0xdf1(%rip),%rsi
mov    %rbx,%rdi
call   1040 <stricmp@plt>
test   %rax,%rax
je     12b5 <FileExtensionToClassCode+0x175>
lea    0xde2(%rip),%rsi
mov    %rbx,%rdi
call   1040 <stricmp@plt>
mov    $0x1000001,%ebp
test   %rax,%rax
je     12b5 <FileExtensionToClassCode+0x175>
lea    0xdce(%rip),%rsi
mov    %rbx,%rdi
call   1040 <stricmp@plt>
test   %rax,%rax
je     12b5 <FileExtensionToClassCode+0x175>
lea    0xdc0(%rip),%rsi
mov    %rbx,%rdi
call   1040 <stricmp@plt>
test   %rax,%rax
je     12b5 <FileExtensionToClassCode+0x175>
lea    0xdb1(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmpi@plt>
test   %rax,%rax
je     12b0 <FileExtensionToClassCode+0x170>
lea    0xda2(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmpi@plt>
test   %rax,%rax
mov    $0x7000002,%eax
mov    $0x1,%ebp
cmove  %eax,%ebp
jmp    12b5 <FileExtensionToClassCode+0x175>
mov    $0x7000002,%ebp
mov    %ebp,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c".mp3\00"
@.str.1 = [5 x i8] c".wma\00"
@.str.2 = [5 x i8] c".ogg\00"
@.str.3 = [5 x i8] c".asf\00"
@.str.4 = [5 x i8] c".wmv\00"
@.str.5 = [5 x i8] c".mpg\00"
@.str.6 = [5 x i8] c".mov\00"
@.str.7 = [5 x i8] c".jpg\00"
@.str.8 = [6 x i8] c".jpeg\00"
@.str.9 = [5 x i8] c".bmp\00"
@.str.10 = [5 x i8] c".m3u\00"
@.str.11 = [5 x i8] c".asx\00"
define i32 @FileExtensionToClassCode(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [10 x i8]
%6 = alloca [10 x i8]
%7 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%12 = load i8*, i8** %3
%13 = call i32 @strToUtf8(i8* %11, i8* %12, i32 10, i32 1, i32* null)
%14 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
store i8* %14, i8** %3
br label %15
15: ; preds = %10, %2
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 0
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 46
br i1 %20, label %21, label %28
21: ; preds = %15
%22 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
store i8 46, i8* %22
%23 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%24 = getelementptr inbounds i8, i8* %23, i64 1
%25 = load i8*, i8** %3
%26 = call i32 @strcpy(i8* %24, i8* %25)
%27 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
store i8* %27, i8** %3
br label %28
28: ; preds = %21, %15
%29 = load i8*, i8** %3
%30 = call i64 @stricmp(i8* %29, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %33
32: ; preds = %28
store i32 33554433, i32* %7
br label %100
33: ; preds = %28
%34 = load i8*, i8** %3
%35 = call i64 @stricmp(i8* %34, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %38
37: ; preds = %33
store i32 33554433, i32* %7
br label %99
38: ; preds = %33
%39 = load i8*, i8** %3
%40 = call i64 @stricmp(i8* %39, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %43
42: ; preds = %38
store i32 33554433, i32* %7
br label %98
43: ; preds = %38
%44 = load i8*, i8** %3
%45 = call i64 @stricmp(i8* %44, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%46 = icmp eq i64 %45, 0
br i1 %46, label %47, label %48
47: ; preds = %43
store i32 50331649, i32* %7
br label %97
48: ; preds = %43
%49 = load i8*, i8** %3
%50 = call i64 @stricmp(i8* %49, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%51 = icmp eq i64 %50, 0
br i1 %51, label %52, label %53
52: ; preds = %48
store i32 50331649, i32* %7
br label %96
53: ; preds = %48
%54 = load i8*, i8** %3
%55 = call i64 @stricmp(i8* %54, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%56 = icmp eq i64 %55, 0
br i1 %56, label %57, label %58
57: ; preds = %53
store i32 50331649, i32* %7
br label %95
58: ; preds = %53
%59 = load i8*, i8** %3
%60 = call i64 @stricmp(i8* %59, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%61 = icmp eq i64 %60, 0
br i1 %61, label %62, label %63
62: ; preds = %58
store i32 50331649, i32* %7
br label %94
63: ; preds = %58
%64 = load i8*, i8** %3
%65 = call i64 @stricmp(i8* %64, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%66 = icmp eq i64 %65, 0
br i1 %66, label %67, label %68
67: ; preds = %63
store i32 16777217, i32* %7
br label %93
68: ; preds = %63
%69 = load i8*, i8** %3
%70 = call i64 @stricmp(i8* %69, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%71 = icmp eq i64 %70, 0
br i1 %71, label %72, label %73
72: ; preds = %68
store i32 16777217, i32* %7
br label %92
73: ; preds = %68
%74 = load i8*, i8** %3
%75 = call i64 @stricmp(i8* %74, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%76 = icmp eq i64 %75, 0
br i1 %76, label %77, label %78
77: ; preds = %73
store i32 16777217, i32* %7
br label %91
78: ; preds = %73
%79 = load i8*, i8** %3
%80 = call i64 @strcmpi(i8* %79, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%81 = icmp eq i64 %80, 0
br i1 %81, label %82, label %83
82: ; preds = %78
store i32 117440514, i32* %7
br label %90
83: ; preds = %78
%84 = load i8*, i8** %3
%85 = call i64 @strcmpi(i8* %84, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%86 = icmp eq i64 %85, 0
br i1 %86, label %87, label %88
87: ; preds = %83
store i32 117440514, i32* %7
br label %89
88: ; preds = %83
store i32 1, i32* %7
br label %89
89: ; preds = %88, %87
br label %90
90: ; preds = %89, %82
br label %91
91: ; preds = %90, %77
br label %92
92: ; preds = %91, %72
br label %93
93: ; preds = %92, %67
br label %94
94: ; preds = %93, %62
br label %95
95: ; preds = %94, %57
br label %96
96: ; preds = %95, %52
br label %97
97: ; preds = %96, %47
br label %98
98: ; preds = %97, %42
br label %99
99: ; preds = %98, %37
br label %100
100: ; preds = %99, %32
%101 = load i32, i32* %7
ret i32 %101
}

LLVM IR (-O2):
@.str = [5 x i8] c".mp3\00"
@.str.1 = [5 x i8] c".wma\00"
@.str.2 = [5 x i8] c".ogg\00"
@.str.3 = [5 x i8] c".asf\00"
@.str.4 = [5 x i8] c".wmv\00"
@.str.5 = [5 x i8] c".mpg\00"
@.str.6 = [5 x i8] c".mov\00"
@.str.7 = [5 x i8] c".jpg\00"
@.str.8 = [6 x i8] c".jpeg\00"
@.str.9 = [5 x i8] c".bmp\00"
@.str.10 = [5 x i8] c".m3u\00"
@.str.11 = [5 x i8] c".asx\00"
define i32 @FileExtensionToClassCode(i8* %0, i32 %1) {
%3 = alloca [10 x i8]
%4 = alloca [10 x i8]
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%7 = icmp eq i32 %1, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = call i32 @strToUtf8(i8* %6, i8* %0, i32 10, i32 1, i32* null)
br label %10
10: ; preds = %8, %2
%11 = phi i8* [ %6, %8 ], [ %0, %2 ]
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 46
br i1 %13, label %17, label %14
14: ; preds = %10
store i8 46, i8* %5
%15 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 1
%16 = call i32 @strcpy(i8* %15, i8* %11)
br label %17
17: ; preds = %14, %10
%18 = phi i8* [ %5, %14 ], [ %11, %10 ]
%19 = call i64 @stricmp(i8* %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %55, label %21
21: ; preds = %17
%22 = call i64 @stricmp(i8* %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %55, label %24
24: ; preds = %21
%25 = call i64 @stricmp(i8* %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %55, label %27
27: ; preds = %24
%28 = call i64 @stricmp(i8* %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %55, label %30
30: ; preds = %27
%31 = call i64 @stricmp(i8* %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%32 = icmp eq i64 %31, 0
br i1 %32, label %55, label %33
33: ; preds = %30
%34 = call i64 @stricmp(i8* %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %55, label %36
36: ; preds = %33
%37 = call i64 @stricmp(i8* %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%38 = icmp eq i64 %37, 0
br i1 %38, label %55, label %39
39: ; preds = %36
%40 = call i64 @stricmp(i8* %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%41 = icmp eq i64 %40, 0
br i1 %41, label %55, label %42
42: ; preds = %39
%43 = call i64 @stricmp(i8* %18, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
br i1 %44, label %55, label %45
45: ; preds = %42
%46 = call i64 @stricmp(i8* %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%47 = icmp eq i64 %46, 0
br i1 %47, label %55, label %48
48: ; preds = %45
%49 = call i64 @strcmpi(i8* %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%50 = icmp eq i64 %49, 0
br i1 %50, label %55, label %51
51: ; preds = %48
%52 = call i64 @strcmpi(i8* %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%53 = icmp eq i64 %52, 0
%54 = select i1 %53, i32 117440514, i32 1
br label %55
55: ; preds = %51, %48, %45, %42, %39, %36, %33, %30, %27, %24, %21, %17
%56 = phi i32 [ 33554433, %17 ], [ 33554433, %21 ], [ 33554433, %24 ], [ 50331649, %27 ], [ 50331649, %30 ], [ 50331649, %33 ], [ 50331649, %36 ], [ 16777217, %39 ], [ 16777217, %42 ], [ 16777217, %45 ], [ 117440514, %48 ], [ %54, %51 ]
ret i32 %56
}