// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0xe4e7(%rip), %rsi      # 0x1ca77
pushq $0xc
popq %rdx
callq 0x4420
testl %eax, %eax
je 0xe74d
leaq 0xe4dd(%rip), %rsi      # 0x1ca84
pushq $0xc
popq %rdx
movq %rbx, %rdi
callq 0x4420
testl %eax, %eax
je 0xe751
leaq 0xe4d0(%rip), %rsi      # 0x1ca91
pushq $0xc
popq %rdx
movq %rbx, %rdi
callq 0x4420
pushq $-0x20
popq %r15
testl %eax, %eax
je 0xe865
leaq 0xe4bf(%rip), %rsi      # 0x1ca9e
pushq $0xa
popq %rdx
movq %rbx, %rdi
callq 0x4420
pushq $-0x6
popq %rbp
testl %eax, %eax
je 0xe754
leaq 0xe4b1(%rip), %rsi      # 0x1caad
pushq $0x3
popq %rdx
movq %rbx, %rdi
callq 0x4420
testl %eax, %eax
je 0xe754
leaq 0xe493(%rip), %rsi      # 0x1caa9
pushq $0x7
popq %rdx
movq %rbx, %rdi
callq 0x4420
testl %eax, %eax
je 0xe754
leaq 0x1(%rbx), %r14
leaq 0xe47d(%rip), %rsi      # 0x1cab1
pushq $0x5
popq %rdx
movq %r14, %rdi
callq 0x4420
pushq $-0x5
popq %rbp
testl %eax, %eax
je 0xe754
leaq 0xe466(%rip), %rsi      # 0x1cab7
pushq $0x6
popq %rdx
movq %r14, %rdi
callq 0x4420
pushq $-0x4
popq %r14
testl %eax, %eax
je 0xe75f
leaq 0xe442(%rip), %rsi      # 0x1cab1
pushq $0x5
popq %rdx
movq %rbx, %rdi
callq 0x4420
testl %eax, %eax
je 0xe754
leaq 0xe42e(%rip), %rsi      # 0x1cab7
pushq $0x6
popq %rdx
movq %rbx, %rdi
callq 0x4420
movl %r14d, %ebp
testl %eax, %eax
je 0xe754
movb (%rbx), %r14b
cmpb $0x21, %r14b
jne 0xe764
leaq 0xe40b(%rip), %rsi      # 0x1cabe
pushq $0x7
popq %rdx
movq %rbx, %rdi
callq 0x4420
testl %eax, %eax
je 0xe86d
leaq 0xe3f9(%rip), %rsi      # 0x1cac6
pushq $0x6
popq %rdx
movq %rbx, %rdi
callq 0x4420
testl %eax, %eax
je 0xe87b
leaq 0xe3e6(%rip), %rsi      # 0x1cacd
pushq $0x8
popq %rdx
movq %rbx, %rdi
callq 0x4420
testl %eax, %eax
je 0xe889
leaq 0xe3d5(%rip), %rsi      # 0x1cad6
pushq $0x8
popq %rdx
movq %rbx, %rdi
callq 0x4420
testl %eax, %eax
je 0xe898
leaq 0xe3c4(%rip), %rsi      # 0x1cadf
pushq $0x7
popq %rdx
movq %rbx, %rdi
callq 0x4420
testl %eax, %eax
je 0xe8a6
leaq 0xe3b2(%rip), %rsi      # 0x1cae7
pushq $0x8
popq %rdx
movq %rbx, %rdi
callq 0x4420
testl %eax, %eax
pushq $-0xe
popq %rax
pushq $-0x3
popq %rbp
cmovel %eax, %ebp
jmp 0xe754
pushq $-0x2
jmp 0xe753
pushq $-0x3
popq %rbp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl %r14d, %ebp
jmp 0xe754
leaq 0x102a2(%rip), %rsi     # 0x1ea0d
pushq $0x6
popq %rdx
movq %rbx, %rdi
callq 0x4420
testl %eax, %eax
je 0xe874
leaq 0xe36b(%rip), %rsi      # 0x1caf0
pushq $0xb
popq %rdx
movq %rbx, %rdi
callq 0x4420
testl %eax, %eax
je 0xe882
leaq 0xe35d(%rip), %rsi      # 0x1cafc
pushq $0x9
popq %rdx
movq %rbx, %rdi
callq 0x4420
pushq $-0x11
popq %r12
testl %eax, %eax
je 0xe890
leaq 0xe349(%rip), %rsi      # 0x1cb06
pushq $0x9
popq %rdx
movq %rbx, %rdi
callq 0x4420
testl %eax, %eax
je 0xe89f
leaq 0xe32a(%rip), %rsi      # 0x1cb01
pushq $0x4
popq %rdx
movq %rbx, %rdi
callq 0x4420
testl %eax, %eax
je 0xe865
leaq 0xe004(%rip), %rsi      # 0x1c7f1
pushq $0x4
popq %rdx
movq %rbx, %rdi
callq 0x4420
movl %r15d, %ebp
testl %eax, %eax
je 0xe754
leaq 0xe306(%rip), %rsi      # 0x1cb10
pushq $0xb
popq %rdx
movq %rbx, %rdi
callq 0x4420
pushq $-0xf
popq %rbp
cmpb $0x40, %r14b
je 0xe754
testl %eax, %eax
je 0xe754
leaq 0xe2eb(%rip), %rsi      # 0x1cb1c
pushq $0x4
popq %rdx
movq %rbx, %rdi
callq 0x4420
movl %r12d, %ebp
testl %eax, %eax
je 0xe754
leaq 0xe2d3(%rip), %rsi      # 0x1cb21
pushq $0x5
popq %rdx
movq %rbx, %rdi
callq 0x4420
testl %eax, %eax
pushq $-0x11
popq %rax
pushq $-0x2
jmp 0xe747
movl %r15d, %ebp
jmp 0xe754
pushq $-0xa
jmp 0xe753
pushq $-0x7
jmp 0xe753
pushq $-0x9
jmp 0xe753
pushq $-0x13
jmp 0xe753
pushq $-0xc
jmp 0xe753
movl %r12d, %ebp
jmp 0xe754
pushq $-0xb
jmp 0xe753
pushq $-0x10
jmp 0xe753
pushq $-0xd
jmp 0xe753