// File: /workspace/github_cpp_makefile_star2_O3/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 0xf570(%rip), %rsi      # 0x1fb07
movl $0xc, %edx
callq 0x4400
testl %eax, %eax
je 0x10779
leaq 0xf564(%rip), %rsi      # 0x1fb14
movl $0xc, %edx
movq %rbx, %rdi
callq 0x4400
testl %eax, %eax
je 0x10783
leaq 0xf555(%rip), %rsi      # 0x1fb21
movl $0xc, %edx
movq %rbx, %rdi
callq 0x4400
testl %eax, %eax
je 0x108aa
leaq 0xf546(%rip), %rsi      # 0x1fb2e
movl $0xa, %edx
movq %rbx, %rdi
callq 0x4400
movl $0xfffffffa, %ebp       # imm = 0xFFFFFFFA
testl %eax, %eax
je 0x108af
leaq 0xf534(%rip), %rsi      # 0x1fb3d
movl $0x3, %edx
movq %rbx, %rdi
callq 0x4400
testl %eax, %eax
je 0x108af
leaq 0xf514(%rip), %rsi      # 0x1fb39
movl $0x7, %edx
movq %rbx, %rdi
callq 0x4400
testl %eax, %eax
je 0x108af
leaq 0x1(%rbx), %r14
leaq 0xf4fc(%rip), %rsi      # 0x1fb41
movl $0x5, %edx
movq %r14, %rdi
callq 0x4400
movl $0xfffffffb, %ebp       # imm = 0xFFFFFFFB
testl %eax, %eax
je 0x108af
leaq 0xf4e1(%rip), %rsi      # 0x1fb47
movl $0x6, %edx
movq %r14, %rdi
callq 0x4400
testl %eax, %eax
je 0x1078d
leaq 0xf4bf(%rip), %rsi      # 0x1fb41
movl $0x5, %edx
movq %rbx, %rdi
callq 0x4400
testl %eax, %eax
je 0x108af
leaq 0xf4a9(%rip), %rsi      # 0x1fb47
movl $0x6, %edx
movq %rbx, %rdi
callq 0x4400
movl $0xfffffffc, %ebp       # imm = 0xFFFFFFFC
testl %eax, %eax
je 0x108af
movb (%rbx), %r14b
cmpb $0x21, %r14b
jne 0x10797
leaq 0xf482(%rip), %rsi      # 0x1fb4e
movl $0x7, %edx
movq %rbx, %rdi
callq 0x4400
testl %eax, %eax
je 0x108b6
leaq 0xf46e(%rip), %rsi      # 0x1fb56
movl $0x6, %edx
movq %rbx, %rdi
callq 0x4400
testl %eax, %eax
je 0x108c4
leaq 0xf459(%rip), %rsi      # 0x1fb5d
movl $0x8, %edx
movq %rbx, %rdi
callq 0x4400
testl %eax, %eax
je 0x108d2
leaq 0xf446(%rip), %rsi      # 0x1fb66
movl $0x8, %edx
movq %rbx, %rdi
callq 0x4400
testl %eax, %eax
je 0x108d9
leaq 0xf433(%rip), %rsi      # 0x1fb6f
movl $0x7, %edx
movq %rbx, %rdi
callq 0x4400
testl %eax, %eax
je 0x108e7
leaq 0xf41f(%rip), %rsi      # 0x1fb77
movl $0x8, %edx
movq %rbx, %rdi
callq 0x4400
testl %eax, %eax
movl $0xfffffff2, %eax       # imm = 0xFFFFFFF2
movl $0xfffffffd, %ebp       # imm = 0xFFFFFFFD
cmovel %eax, %ebp
jmp 0x108af
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
jmp 0x108af
movl $0xfffffffd, %ebp       # imm = 0xFFFFFFFD
jmp 0x108af
movl $0xfffffffc, %ebp       # imm = 0xFFFFFFFC
jmp 0x108af
leaq 0x1137f(%rip), %rsi     # 0x21b1d
movl $0x6, %edx
movq %rbx, %rdi
callq 0x4400
testl %eax, %eax
je 0x108bd
leaq 0xf3c6(%rip), %rsi      # 0x1fb80
movl $0xb, %edx
movq %rbx, %rdi
callq 0x4400
testl %eax, %eax
je 0x108cb
leaq 0xf3b6(%rip), %rsi      # 0x1fb8c
movl $0x9, %edx
movq %rbx, %rdi
callq 0x4400
movl $0xffffffef, %ebp       # imm = 0xFFFFFFEF
testl %eax, %eax
je 0x108af
leaq 0xf39f(%rip), %rsi      # 0x1fb96
movl $0x9, %edx
movq %rbx, %rdi
callq 0x4400
testl %eax, %eax
je 0x108e0
leaq 0xf37e(%rip), %rsi      # 0x1fb91
movl $0x4, %edx
movq %rbx, %rdi
callq 0x4400
testl %eax, %eax
je 0x108aa
leaq 0xf052(%rip), %rsi      # 0x1f881
movl $0x4, %edx
movq %rbx, %rdi
callq 0x4400
movl $0xffffffe0, %ebp       # imm = 0xFFFFFFE0
testl %eax, %eax
je 0x108af
leaq 0xf354(%rip), %rsi      # 0x1fba0
movl $0xb, %edx
movq %rbx, %rdi
callq 0x4400
movl $0xfffffff1, %ebp       # imm = 0xFFFFFFF1
cmpb $0x40, %r14b
je 0x108af
testl %eax, %eax
je 0x108af
leaq 0xf33d(%rip), %rsi      # 0x1fbac
movl $0x4, %edx
movq %rbx, %rdi
callq 0x4400
movl $0xffffffef, %ebp       # imm = 0xFFFFFFEF
testl %eax, %eax
je 0x108af
leaq 0xf325(%rip), %rsi      # 0x1fbb1
movl $0x5, %edx
movq %rbx, %rdi
callq 0x4400
testl %eax, %eax
movl $0xffffffef, %eax       # imm = 0xFFFFFFEF
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
jmp 0x10771
movl $0xffffffe0, %ebp       # imm = 0xFFFFFFE0
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
movl $0xfffffff6, %ebp       # imm = 0xFFFFFFF6
jmp 0x108af
movl $0xfffffff9, %ebp       # imm = 0xFFFFFFF9
jmp 0x108af
movl $0xfffffff7, %ebp       # imm = 0xFFFFFFF7
jmp 0x108af
movl $0xffffffed, %ebp       # imm = 0xFFFFFFED
jmp 0x108af
movl $0xfffffff4, %ebp       # imm = 0xFFFFFFF4
jmp 0x108af
movl $0xfffffff5, %ebp       # imm = 0xFFFFFFF5
jmp 0x108af
movl $0xfffffff0, %ebp       # imm = 0xFFFFFFF0
jmp 0x108af
movl $0xfffffff3, %ebp       # imm = 0xFFFFFFF3
jmp 0x108af