#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*/ Q_strncasecmp(char *, char *, int);
int HL_TextureContents(char *name) {
  if (!Q_strncasecmp(name, "sky", 3)) {
    return 1;
  }
  if (!Q_strncasecmp(name + 1, "!lava", 5)) {
    return 8;
  }
  if (!Q_strncasecmp(name + 1, "!slime", 6)) {
    return 16;
  }
  if (name[0] == '!') {
    return 32;
  }
  return 1;
}


x86 assembly (clang, -O0):
<HL_TextureContents>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x3,%edx
call   1030 <Q_strncasecmp@plt>
cmp    $0x0,%eax
jne    1146 <HL_TextureContents+0x36>
movl   $0x1,-0x4(%rbp)
jmp    11c5 <HL_TextureContents+0xb5>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
lea    0xeaf(%rip),%rsi
mov    $0x5,%edx
call   1030 <Q_strncasecmp@plt>
cmp    $0x0,%eax
jne    1174 <HL_TextureContents+0x64>
movl   $0x8,-0x4(%rbp)
jmp    11c5 <HL_TextureContents+0xb5>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
lea    0xe87(%rip),%rsi
mov    $0x6,%edx
call   1030 <Q_strncasecmp@plt>
cmp    $0x0,%eax
jne    11a2 <HL_TextureContents+0x92>
movl   $0x10,-0x4(%rbp)
jmp    11c5 <HL_TextureContents+0xb5>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x21,%eax
jne    11be <HL_TextureContents+0xae>
movl   $0x20,-0x4(%rbp)
jmp    11c5 <HL_TextureContents+0xb5>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HL_TextureContents>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee2(%rip),%rsi
mov    $0x3,%edx
call   1030 <Q_strncasecmp@plt>
test   %eax,%eax
je     1172 <HL_TextureContents+0x62>
lea    0x1(%rbx),%r14
lea    0xecd(%rip),%rsi
mov    %r14,%rdi
mov    $0x5,%edx
call   1030 <Q_strncasecmp@plt>
test   %eax,%eax
je     1179 <HL_TextureContents+0x69>
lea    0xebb(%rip),%rsi
mov    %r14,%rdi
mov    $0x6,%edx
call   1030 <Q_strncasecmp@plt>
test   %eax,%eax
je     1180 <HL_TextureContents+0x70>
cmpb   $0x21,(%rbx)
mov    $0x20,%ecx
mov    $0x1,%eax
cmove  %ecx,%eax
jmp    1185 <HL_TextureContents+0x75>
mov    $0x1,%eax
jmp    1185 <HL_TextureContents+0x75>
mov    $0x8,%eax
jmp    1185 <HL_TextureContents+0x75>
mov    $0x10,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"sky\00"
@.str.1 = [6 x i8] c"!lava\00"
@.str.2 = [7 x i8] c"!slime\00"
define i32 @HL_TextureContents(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @Q_strncasecmp(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 1, i32* %2
br label %28
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = call i32 @Q_strncasecmp(i8* %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 5)
%12 = icmp ne i32 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %8
store i32 8, i32* %2
br label %28
14: ; preds = %8
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = call i32 @Q_strncasecmp(i8* %16, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 6)
%18 = icmp ne i32 %17, 0
br i1 %18, label %20, label %19
19: ; preds = %14
store i32 16, i32* %2
br label %28
20: ; preds = %14
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i64 0
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 33
br i1 %25, label %26, label %27
26: ; preds = %20
store i32 32, i32* %2
br label %28
27: ; preds = %20
store i32 1, i32* %2
br label %28
28: ; preds = %27, %26, %19, %13, %7
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
@.str = [4 x i8] c"sky\00"
@.str.1 = [6 x i8] c"!lava\00"
@.str.2 = [7 x i8] c"!slime\00"
define i32 @HL_TextureContents(i8* %0) {
%2 = tail call i32 @Q_strncasecmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%3 = icmp eq i32 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = tail call i32 @Q_strncasecmp(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %15, label %8
8: ; preds = %4
%9 = tail call i32 @Q_strncasecmp(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 6)
%10 = icmp eq i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %8
%12 = load i8, i8* %0
%13 = icmp eq i8 %12, 33
%14 = select i1 %13, i32 32, i32 1
br label %15
15: ; preds = %11, %8, %4, %1
%16 = phi i32 [ 1, %1 ], [ 8, %4 ], [ 16, %8 ], [ %14, %11 ]
ret i32 %16
}