// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/hlcsg/brush.cpp
// Function: TextureContents(char const*)
static contents_t TextureContents(const char* const name)
{
#ifdef HLCSG_CUSTOMCONTENT
	if (!strncasecmp(name, "contentsolid", 12))
		return CONTENTS_SOLID;
	if (!strncasecmp(name, "contentwater", 12))
		return CONTENTS_WATER;
	if (!strncasecmp(name, "contentempty", 12))
		return CONTENTS_TOEMPTY;
	if (!strncasecmp(name, "contentsky", 10))
		return CONTENTS_SKY;
#endif
    if (!strncasecmp(name, "sky", 3))
        return CONTENTS_SKY;

// =====================================================================================
//Cpt_Andrew - Env_Sky Check
// =====================================================================================
#ifdef HLCSG_TextureContents_FIX
    if (!strncasecmp(name, "env_sky", 7))
#else
    if (!strncasecmp(name, "env_sky", 3))
#endif
        return CONTENTS_SKY;
// =====================================================================================

    if (!strncasecmp(name + 1, "!lava", 5))
        return CONTENTS_LAVA;

    if (!strncasecmp(name + 1, "!slime", 6))
        return CONTENTS_SLIME;
#ifdef HLCSG_TextureContents_FIX
    if (!strncasecmp(name, "!lava", 5))
        return CONTENTS_LAVA;

    if (!strncasecmp(name, "!slime", 6))
        return CONTENTS_SLIME;
#endif

    if (name[0] == '!') //optimized -- don't check for current unless it's liquid (KGP)
	{
		if (!strncasecmp(name, "!cur_90", 7))
			return CONTENTS_CURRENT_90;
		if (!strncasecmp(name, "!cur_0", 6))
			return CONTENTS_CURRENT_0;
		if (!strncasecmp(name, "!cur_270", 8))
			return CONTENTS_CURRENT_270;
		if (!strncasecmp(name, "!cur_180", 8))
			return CONTENTS_CURRENT_180;
		if (!strncasecmp(name, "!cur_up", 7))
			return CONTENTS_CURRENT_UP;
		if (!strncasecmp(name, "!cur_dwn", 8))
			return CONTENTS_CURRENT_DOWN;
        return CONTENTS_WATER; //default for liquids
	}

    if (!strncasecmp(name, "origin", 6))
        return CONTENTS_ORIGIN;
#ifdef HLCSG_HLBSP_CUSTOMBOUNDINGBOX
	if (!strncasecmp(name, "boundingbox", 11))
		return CONTENTS_BOUNDINGBOX;
#endif

#ifndef HLCSG_CUSTOMHULL
    if (!strncasecmp(name, "clip", 4))
        return CONTENTS_CLIP;
#endif

#ifdef HLCSG_HLBSP_SOLIDHINT
	if (!strncasecmp(name, "solidhint", 9))
		return CONTENTS_NULL;
#endif
#ifdef HLCSG_NOSPLITBYHINT
	if (!strncasecmp(name, "splitface", 9))
		return CONTENTS_HINT;
	if (!strncasecmp(name, "hint", 4))
		return CONTENTS_TOEMPTY;
	if (!strncasecmp(name, "skip", 4))
		return CONTENTS_TOEMPTY;
#else
    if (!strncasecmp(name, "hint", 4))
        return CONTENTS_HINT;
    if (!strncasecmp(name, "skip", 4))
        return CONTENTS_HINT;
#endif

    if (!strncasecmp(name, "translucent", 11))
        return CONTENTS_TRANSLUCENT;

    if (name[0] == '@')
        return CONTENTS_TRANSLUCENT;

#ifdef ZHLT_NULLTEX // AJM:
	if (!strncasecmp(name, "null", 4))
        return CONTENTS_NULL;
#ifdef HLCSG_PRECISIONCLIP // KGP
	if(!strncasecmp(name,"bevel",5))
		return CONTENTS_NULL;
#endif //precisionclip
#endif //nulltex

    return CONTENTS_SOLID;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0xf0e0(%rip), %rsi      # 0x1fb17
movl $0xc, %edx
callq 0x4410
testl %eax, %eax
je 0x10c19
leaq 0xf0d4(%rip), %rsi      # 0x1fb24
movl $0xc, %edx
movq %rbx, %rdi
callq 0x4410
testl %eax, %eax
je 0x10c23
leaq 0xf0c5(%rip), %rsi      # 0x1fb31
movl $0xc, %edx
movq %rbx, %rdi
callq 0x4410
testl %eax, %eax
je 0x10d4a
leaq 0xf0b6(%rip), %rsi      # 0x1fb3e
movl $0xa, %edx
movq %rbx, %rdi
callq 0x4410
movl $0xfffffffa, %ebp       # imm = 0xFFFFFFFA
testl %eax, %eax
je 0x10d4f
leaq 0xf0a4(%rip), %rsi      # 0x1fb4d
movl $0x3, %edx
movq %rbx, %rdi
callq 0x4410
testl %eax, %eax
je 0x10d4f
leaq 0xf084(%rip), %rsi      # 0x1fb49
movl $0x7, %edx
movq %rbx, %rdi
callq 0x4410
testl %eax, %eax
je 0x10d4f
leaq 0x1(%rbx), %r14
leaq 0xf06c(%rip), %rsi      # 0x1fb51
movl $0x5, %edx
movq %r14, %rdi
callq 0x4410
movl $0xfffffffb, %ebp       # imm = 0xFFFFFFFB
testl %eax, %eax
je 0x10d4f
leaq 0xf051(%rip), %rsi      # 0x1fb57
movl $0x6, %edx
movq %r14, %rdi
callq 0x4410
testl %eax, %eax
je 0x10c2d
leaq 0xf02f(%rip), %rsi      # 0x1fb51
movl $0x5, %edx
movq %rbx, %rdi
callq 0x4410
testl %eax, %eax
je 0x10d4f
leaq 0xf019(%rip), %rsi      # 0x1fb57
movl $0x6, %edx
movq %rbx, %rdi
callq 0x4410
movl $0xfffffffc, %ebp       # imm = 0xFFFFFFFC
testl %eax, %eax
je 0x10d4f
movb (%rbx), %r14b
cmpb $0x21, %r14b
jne 0x10c37
leaq 0xeff2(%rip), %rsi      # 0x1fb5e
movl $0x7, %edx
movq %rbx, %rdi
callq 0x4410
testl %eax, %eax
je 0x10d56
leaq 0xefde(%rip), %rsi      # 0x1fb66
movl $0x6, %edx
movq %rbx, %rdi
callq 0x4410
testl %eax, %eax
je 0x10d64
leaq 0xefc9(%rip), %rsi      # 0x1fb6d
movl $0x8, %edx
movq %rbx, %rdi
callq 0x4410
testl %eax, %eax
je 0x10d72
leaq 0xefb6(%rip), %rsi      # 0x1fb76
movl $0x8, %edx
movq %rbx, %rdi
callq 0x4410
testl %eax, %eax
je 0x10d79
leaq 0xefa3(%rip), %rsi      # 0x1fb7f
movl $0x7, %edx
movq %rbx, %rdi
callq 0x4410
testl %eax, %eax
je 0x10d87
leaq 0xef8f(%rip), %rsi      # 0x1fb87
movl $0x8, %edx
movq %rbx, %rdi
callq 0x4410
testl %eax, %eax
movl $0xfffffff2, %eax       # imm = 0xFFFFFFF2
movl $0xfffffffd, %ebp       # imm = 0xFFFFFFFD
cmovel %eax, %ebp
jmp 0x10d4f
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
jmp 0x10d4f
movl $0xfffffffd, %ebp       # imm = 0xFFFFFFFD
jmp 0x10d4f
movl $0xfffffffc, %ebp       # imm = 0xFFFFFFFC
jmp 0x10d4f
leaq 0x10eba(%rip), %rsi     # 0x21af8
movl $0x6, %edx
movq %rbx, %rdi
callq 0x4410
testl %eax, %eax
je 0x10d5d
leaq 0xef36(%rip), %rsi      # 0x1fb90
movl $0xb, %edx
movq %rbx, %rdi
callq 0x4410
testl %eax, %eax
je 0x10d6b
leaq 0xef26(%rip), %rsi      # 0x1fb9c
movl $0x9, %edx
movq %rbx, %rdi
callq 0x4410
movl $0xffffffef, %ebp       # imm = 0xFFFFFFEF
testl %eax, %eax
je 0x10d4f
leaq 0xef0f(%rip), %rsi      # 0x1fba6
movl $0x9, %edx
movq %rbx, %rdi
callq 0x4410
testl %eax, %eax
je 0x10d80
leaq 0xeeee(%rip), %rsi      # 0x1fba1
movl $0x4, %edx
movq %rbx, %rdi
callq 0x4410
testl %eax, %eax
je 0x10d4a
leaq 0xebc2(%rip), %rsi      # 0x1f891
movl $0x4, %edx
movq %rbx, %rdi
callq 0x4410
movl $0xffffffe0, %ebp       # imm = 0xFFFFFFE0
testl %eax, %eax
je 0x10d4f
leaq 0xeec4(%rip), %rsi      # 0x1fbb0
movl $0xb, %edx
movq %rbx, %rdi
callq 0x4410
movl $0xfffffff1, %ebp       # imm = 0xFFFFFFF1
cmpb $0x40, %r14b
je 0x10d4f
testl %eax, %eax
je 0x10d4f
leaq 0xeead(%rip), %rsi      # 0x1fbbc
movl $0x4, %edx
movq %rbx, %rdi
callq 0x4410
movl $0xffffffef, %ebp       # imm = 0xFFFFFFEF
testl %eax, %eax
je 0x10d4f
leaq 0xee95(%rip), %rsi      # 0x1fbc1
movl $0x5, %edx
movq %rbx, %rdi
callq 0x4410
testl %eax, %eax
movl $0xffffffef, %eax       # imm = 0xFFFFFFEF
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
jmp 0x10c11
movl $0xffffffe0, %ebp       # imm = 0xFFFFFFE0
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
movl $0xfffffff6, %ebp       # imm = 0xFFFFFFF6
jmp 0x10d4f
movl $0xfffffff9, %ebp       # imm = 0xFFFFFFF9
jmp 0x10d4f
movl $0xfffffff7, %ebp       # imm = 0xFFFFFFF7
jmp 0x10d4f
movl $0xffffffed, %ebp       # imm = 0xFFFFFFED
jmp 0x10d4f
movl $0xfffffff4, %ebp       # imm = 0xFFFFFFF4
jmp 0x10d4f
movl $0xfffffff5, %ebp       # imm = 0xFFFFFFF5
jmp 0x10d4f
movl $0xfffffff0, %ebp       # imm = 0xFFFFFFF0
jmp 0x10d4f
movl $0xfffffff3, %ebp       # imm = 0xFFFFFFF3
jmp 0x10d4f