// File: FreeSlave[P]vhlt/hlcsg/qcsg.cpp
// Function: Settings()
static void     Settings()
{
    char*           tmp;

    if (!g_info)
        return; 

    Log("\nCurrent %s Settings\n", g_Program);
    Log("Name                 |  Setting  |  Default\n"
        "---------------------|-----------|-------------------------\n");

    // ZHLT Common Settings
    if (DEFAULT_NUMTHREADS == -1)
    {
        Log("threads               [ %7d ] [  Varies ]\n", g_numthreads);
    }
    else
    {
        Log("threads               [ %7d ] [ %7d ]\n", g_numthreads, DEFAULT_NUMTHREADS);
    }

    Log("verbose               [ %7s ] [ %7s ]\n", g_verbose ? "on" : "off", DEFAULT_VERBOSE ? "on" : "off");
    Log("log                   [ %7s ] [ %7s ]\n", g_log ? "on" : "off", DEFAULT_LOG ? "on" : "off");
#ifdef HLCSG_KEEPLOG
    Log("reset logfile         [ %7s ] [ %7s ]\n", g_resetlog ? "on" : "off", DEFAULT_RESETLOG ? "on" : "off");
#endif

    Log("developer             [ %7d ] [ %7d ]\n", g_developer, DEFAULT_DEVELOPER);
    Log("chart                 [ %7s ] [ %7s ]\n", g_chart ? "on" : "off", DEFAULT_CHART ? "on" : "off");
    Log("estimate              [ %7s ] [ %7s ]\n", g_estimate ? "on" : "off", DEFAULT_ESTIMATE ? "on" : "off");
    Log("max texture memory    [ %7d ] [ %7d ]\n", g_max_map_miptex, DEFAULT_MAX_MAP_MIPTEX);
	Log("max lighting memory   [ %7d ] [ %7d ]\n", g_max_map_lightdata, DEFAULT_MAX_MAP_LIGHTDATA);

    switch (g_threadpriority)
    {
    case eThreadPriorityNormal:
    default:
        tmp = "Normal";
        break;
    case eThreadPriorityLow:
        tmp = "Low";
        break;
    case eThreadPriorityHigh:
        tmp = "High";
        break;
    }
    Log("priority              [ %7s ] [ %7s ]\n", tmp, "Normal");
    Log("\n");

    // HLCSG Specific Settings

    Log("noclip                [ %7s ] [ %7s ]\n", g_noclip          ? "on" : "off", DEFAULT_NOCLIP       ? "on" : "off");

#ifdef ZHLT_NULLTEX // AJM:
    Log("null texture stripping[ %7s ] [ %7s ]\n", g_bUseNullTex     ? "on" : "off", DEFAULT_NULLTEX      ? "on" : "off");
#endif

#ifdef ZHLT_DETAIL // AJM
    Log("detail brushes        [ %7s ] [ %7s ]\n", g_bDetailBrushes  ? "on" : "off", DEFAULT_DETAIL       ? "on" : "off");
#endif

#ifdef HLCSG_CLIPECONOMY // AJM
    Log("clipnode economy mode [ %7s ] [ %7s ]\n", g_bClipNazi       ? "on" : "off", DEFAULT_CLIPNAZI     ? "on" : "off");
#endif

#ifdef HLCSG_PRECISIONCLIP // KGP
	Log("clip hull type        [ %7s ] [ %7s ]\n", GetClipTypeString(g_cliptype), GetClipTypeString(DEFAULT_CLIPTYPE));
#endif

    Log("onlyents              [ %7s ] [ %7s ]\n", g_onlyents        ? "on" : "off", DEFAULT_ONLYENTS     ? "on" : "off");
    Log("wadtextures           [ %7s ] [ %7s ]\n", g_wadtextures     ? "on" : "off", DEFAULT_WADTEXTURES  ? "on" : "off");
    Log("skyclip               [ %7s ] [ %7s ]\n", g_skyclip         ? "on" : "off", DEFAULT_SKYCLIP      ? "on" : "off");
    Log("hullfile              [ %7s ] [ %7s ]\n", g_hullfile ? g_hullfile : "None", "None");
#ifdef HLCSG_WADCFG_NEW
	Log("wad configuration file[ %7s ] [ %7s ]\n", g_wadcfgfile? g_wadcfgfile: "None", "None");
	Log("wad.cfg group name    [ %7s ] [ %7s ]\n", g_wadconfigname? g_wadconfigname: "None", "None");
#endif
#ifdef HLCSG_NULLIFY_INVISIBLE // KGP
	Log("nullfile              [ %7s ] [ %7s ]\n", g_nullfile ? g_nullfile : "None", "None");
#endif
#ifdef HLCSG_NULLIFYAAATRIGGER
	Log("nullify trigger       [ %7s ] [ %7s ]\n", g_nullifytrigger? "on": "off", DEFAULT_NULLIFYTRIGGER? "on": "off");
#endif
    // calc min surface area
    {
        char            tiny_penetration[10];
        char            default_tiny_penetration[10];

        safe_snprintf(tiny_penetration, sizeof(tiny_penetration), "%3.3f", g_tiny_threshold);
        safe_snprintf(default_tiny_penetration, sizeof(default_tiny_penetration), "%3.3f", DEFAULT_TINY_THRESHOLD);
        Log("min surface area      [ %7s ] [ %7s ]\n", tiny_penetration, default_tiny_penetration);
    }

    // calc union threshold
    {
        char            brush_union[10];
        char            default_brush_union[10];

        safe_snprintf(brush_union, sizeof(brush_union), "%3.3f", g_BrushUnionThreshold);
        safe_snprintf(default_brush_union, sizeof(default_brush_union), "%3.3f", DEFAULT_BRUSH_UNION_THRESHOLD);
        Log("brush union threshold [ %7s ] [ %7s ]\n", brush_union, default_brush_union);
    }
#ifdef HLCSG_SCALESIZE
    {
        char            buf1[10];
        char            buf2[10];

		if (g_scalesize > 0)
			safe_snprintf(buf1, sizeof(buf1), "%3.3f", g_scalesize);
		else
			strcpy (buf1, "None");
		if (DEFAULT_SCALESIZE > 0)
			safe_snprintf(buf2, sizeof(buf2), "%3.3f", DEFAULT_SCALESIZE);
		else
			strcpy (buf2, "None");
        Log("map scaling           [ %7s ] [ %7s ]\n", buf1, buf2);
    }
#endif
#ifdef HLCSG_OPTIMIZELIGHTENTITY
    Log("light name optimize   [ %7s ] [ %7s ]\n", !g_nolightopt? "on" : "off", !DEFAULT_NOLIGHTOPT? "on" : "off");
#endif
#ifdef HLCSG_GAMETEXTMESSAGE_UTF8
	Log("convert game_text     [ %7s ] [ %7s ]\n", !g_noutf8? "on" : "off", !DEFAULT_NOUTF8? "on" : "off");
#endif

    Log("\n");
}

// Assembly:
subq $0x98, %rsp
testb $0x1, 0x14a55(%rip)     # 0x374b3
jne 0x22a65
jmp 0x2304c
leaq 0x13964(%rip), %rax     # 0x363d0
movq (%rax), %rsi
leaq 0xcb93(%rip), %rdi      # 0x2f609
xorl %eax, %eax
movl %eax, 0x34(%rsp)
movb %al, 0x4f(%rsp)
callq 0xb5d0
movb 0x4f(%rsp), %al
leaq 0xcb8f(%rip), %rdi      # 0x2f61f
callq 0xb5d0
movb 0x4f(%rsp), %al
leaq 0x14944(%rip), %rcx     # 0x373e4
movl (%rcx), %esi
leaq 0xcbdf(%rip), %rdi      # 0x2f688
callq 0xb5d0
movb 0x4f(%rsp), %al
leaq 0x20aaa0b(%rip), %rcx   # 0x20cd4c4
movb (%rcx), %sil
leaq 0xc150(%rip), %rcx      # 0x2ec13
movq %rcx, 0x40(%rsp)
leaq 0xbd50(%rip), %rdx      # 0x2e81f
movq %rdx, 0x38(%rsp)
testb $0x1, %sil
movq %rdx, %rsi
cmovneq %rcx, %rsi
leaq 0xcbcd(%rip), %rdi      # 0x2f6b3
callq 0xb5d0
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
movb 0x4f(%rsp), %al
leaq 0x148e0(%rip), %rcx     # 0x373e0
movb (%rcx), %cl
testb $0x1, %cl
cmovneq %rdx, %rsi
leaq 0xcbca(%rip), %rdi      # 0x2f6da
callq 0xb5d0
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
movb 0x4f(%rsp), %al
movb 0x1499f(%rip), %cl      # 0x374c8
testb $0x1, %cl
cmovneq %rdx, %rsi
leaq 0xcbca(%rip), %rdi      # 0x2f701
callq 0xb5d0
movl 0x34(%rsp), %edx
movb 0x4f(%rsp), %al
leaq 0x20aa975(%rip), %rcx   # 0x20cd4c0
movl (%rcx), %esi
leaq 0xcbd4(%rip), %rdi      # 0x2f728
callq 0xb5d0
movq 0x38(%rsp), %rdx
movq 0x40(%rsp), %rcx
movb 0x4f(%rsp), %al
movb 0x61b8b5c(%rip), %sil   # 0x61db6ca
testb $0x1, %sil
movq %rdx, %rsi
cmovneq %rcx, %rsi
leaq 0xcbcf(%rip), %rdi      # 0x2f74f
callq 0xb5d0
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
movb 0x4f(%rsp), %al
movb 0x14919(%rip), %cl      # 0x374b2
testb $0x1, %cl
cmovneq %rdx, %rsi
leaq 0xcbcf(%rip), %rdi      # 0x2f776
callq 0xb5d0
movb 0x4f(%rsp), %al
leaq 0x13809(%rip), %rcx     # 0x363c0
movl (%rcx), %esi
leaq 0xcbdd(%rip), %rdi      # 0x2f79d
movl $0x2000000, %edx        # imm = 0x2000000
callq 0xb5d0
movb 0x4f(%rsp), %al
leaq 0x137ef(%rip), %rcx     # 0x363c4
movl (%rcx), %esi
leaq 0xcbe6(%rip), %rdi      # 0x2f7c4
movl $0x3000000, %edx        # imm = 0x3000000
callq 0xb5d0
leaq 0x20b7a31(%rip), %rax   # 0x20da620
movl (%rax), %eax
movl %eax, 0x50(%rsp)
subl $-0x1, %eax
je 0x22c24
jmp 0x22bfc
movl 0x50(%rsp), %eax
testl %eax, %eax
je 0x22c11
jmp 0x22c06
movl 0x50(%rsp), %eax
subl $0x1, %eax
je 0x22c35
jmp 0x22c13
jmp 0x22c13
leaq 0xcbd1(%rip), %rax      # 0x2f7eb
movq %rax, 0x90(%rsp)
jmp 0x22c44
leaq 0xcbc7(%rip), %rax      # 0x2f7f2
movq %rax, 0x90(%rsp)
jmp 0x22c44
leaq 0xcbba(%rip), %rax      # 0x2f7f6
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rsi
leaq 0xcba8(%rip), %rdi      # 0x2f7fb
leaq 0xcb91(%rip), %rdx      # 0x2f7eb
movb $0x0, %al
callq 0xb5d0
leaq 0x90d0(%rip), %rdi      # 0x2bd38
movb $0x0, %al
callq 0xb5d0
movb 0x61b8a53(%rip), %cl    # 0x61db6c8
leaq 0xbba3(%rip), %rsi      # 0x2e81f
leaq 0xbf90(%rip), %rax      # 0x2ec13
testb $0x1, %cl
cmovneq %rax, %rsi
leaq 0xcb91(%rip), %rdi      # 0x2f822
leaq 0xbb87(%rip), %rdx      # 0x2e81f
movb $0x0, %al
callq 0xb5d0
movb 0x1480f(%rip), %cl      # 0x374b4
leaq 0xbb73(%rip), %rsi      # 0x2e81f
leaq 0xbf60(%rip), %rax      # 0x2ec13
testb $0x1, %cl
cmovneq %rax, %rsi
leaq 0xcb88(%rip), %rdi      # 0x2f849
leaq 0xbf4b(%rip), %rdx      # 0x2ec13
movb $0x0, %al
callq 0xb5d0
movb 0x61b8a1b(%rip), %cl    # 0x61db6f0
leaq 0xbb43(%rip), %rsi      # 0x2e81f
leaq 0xbf30(%rip), %rax      # 0x2ec13
testb $0x1, %cl
cmovneq %rax, %rsi
leaq 0xcb7f(%rip), %rdi      # 0x2f870
leaq 0xbb27(%rip), %rdx      # 0x2e81f
movb $0x0, %al
callq 0xb5d0
movl 0x147b3(%rip), %edi     # 0x374b8
callq 0x12bd0
movq %rax, 0x28(%rsp)
movl $0x2, %edi
callq 0x12bd0
movq 0x28(%rsp), %rsi
movq %rax, %rdx
leaq 0xcb6f(%rip), %rdi      # 0x2f897
movb $0x0, %al
callq 0xb5d0
movb 0x61b8994(%rip), %cl    # 0x61db6c9
leaq 0xbae3(%rip), %rsi      # 0x2e81f
leaq 0xbed0(%rip), %rax      # 0x2ec13
testb $0x1, %cl
cmovneq %rax, %rsi
leaq 0xcb6d(%rip), %rdi      # 0x2f8be
leaq 0xbac7(%rip), %rdx      # 0x2e81f
movb $0x0, %al
callq 0xb5d0
movb 0x1474b(%rip), %cl      # 0x374b0
leaq 0xbab3(%rip), %rsi      # 0x2e81f
leaq 0xbea0(%rip), %rax      # 0x2ec13
testb $0x1, %cl
cmovneq %rax, %rsi
leaq 0xcb64(%rip), %rdi      # 0x2f8e5
leaq 0xbe8b(%rip), %rdx      # 0x2ec13
movb $0x0, %al
callq 0xb5d0
movb 0x1471c(%rip), %cl      # 0x374b1
leaq 0xba83(%rip), %rsi      # 0x2e81f
leaq 0xbe70(%rip), %rax      # 0x2ec13
testb $0x1, %cl
cmovneq %rax, %rsi
leaq 0xcb5b(%rip), %rdi      # 0x2f90c
leaq 0xbe5b(%rip), %rdx      # 0x2ec13
movb $0x0, %al
callq 0xb5d0
cmpq $0x0, 0x61b8909(%rip)   # 0x61db6d0
je 0x22dd7
movq 0x61b8900(%rip), %rax   # 0x61db6d0
movq %rax, 0x20(%rsp)
jmp 0x22de5
leaq 0xcb7c(%rip), %rax      # 0x2f95a
movq %rax, 0x20(%rsp)
jmp 0x22de5
movq 0x20(%rsp), %rsi
leaq 0xcb42(%rip), %rdi      # 0x2f933
leaq 0xcb62(%rip), %rdx      # 0x2f95a
movb $0x0, %al
callq 0xb5d0
cmpq $0x0, 0x61b88d1(%rip)   # 0x61db6d8
je 0x22e17
movq 0x61b88c8(%rip), %rax   # 0x61db6d8
movq %rax, 0x18(%rsp)
jmp 0x22e25
leaq 0xcb3c(%rip), %rax      # 0x2f95a
movq %rax, 0x18(%rsp)
jmp 0x22e25
movq 0x18(%rsp), %rsi
leaq 0xcb2e(%rip), %rdi      # 0x2f95f
leaq 0xcb22(%rip), %rdx      # 0x2f95a
movb $0x0, %al
callq 0xb5d0
cmpq $0x0, 0x61b8899(%rip)   # 0x61db6e0
je 0x22e57
movq 0x61b8890(%rip), %rax   # 0x61db6e0
movq %rax, 0x10(%rsp)
jmp 0x22e65
leaq 0xcafc(%rip), %rax      # 0x2f95a
movq %rax, 0x10(%rsp)
jmp 0x22e65
movq 0x10(%rsp), %rsi
leaq 0xcb15(%rip), %rdi      # 0x2f986
leaq 0xcae2(%rip), %rdx      # 0x2f95a
movb $0x0, %al
callq 0xb5d0
cmpq $0x0, 0x61b8861(%rip)   # 0x61db6e8
je 0x22e97
movq 0x61b8858(%rip), %rax   # 0x61db6e8
movq %rax, 0x8(%rsp)
jmp 0x22ea5
leaq 0xcabc(%rip), %rax      # 0x2f95a
movq %rax, 0x8(%rsp)
jmp 0x22ea5
movq 0x8(%rsp), %rsi
leaq 0xcafc(%rip), %rdi      # 0x2f9ad
leaq 0xcaa2(%rip), %rdx      # 0x2f95a
movb $0x0, %al
callq 0xb5d0
movb 0x14604(%rip), %cl      # 0x374c9
leaq 0xb953(%rip), %rsi      # 0x2e81f
leaq 0xbd40(%rip), %rax      # 0x2ec13
testb $0x1, %cl
cmovneq %rax, %rsi
leaq 0xcaf3(%rip), %rdi      # 0x2f9d4
leaq 0xbd2b(%rip), %rdx      # 0x2ec13
movb $0x0, %al
callq 0xb5d0
leaq 0x86(%rsp), %rdi
movsd 0x61b87c1(%rip), %xmm0  # 0x61db6c0
movl $0xa, %esi
leaq 0xcaf0(%rip), %rdx      # 0x2f9fb
movb $0x1, %al
callq 0x99e0
leaq 0x7c(%rsp), %rdi
movl $0xa, %esi
leaq 0xcad8(%rip), %rdx      # 0x2f9fb
xorps %xmm0, %xmm0
movb $0x1, %al
callq 0x99e0
leaq 0x86(%rsp), %rsi
leaq 0x7c(%rsp), %rdx
leaq 0xcac0(%rip), %rdi      # 0x2fa01
movb $0x0, %al
callq 0xb5d0
leaq 0x72(%rsp), %rdi
leaq 0x30b86cc(%rip), %rax   # 0x30db620
movsd (%rax), %xmm0
movl $0xa, %esi
leaq 0xca97(%rip), %rdx      # 0x2f9fb
movb $0x1, %al
callq 0x99e0
leaq 0x68(%rsp), %rdi
movl $0xa, %esi
leaq 0xca7f(%rip), %rdx      # 0x2f9fb
xorps %xmm0, %xmm0
movb $0x1, %al
callq 0x99e0
leaq 0x72(%rsp), %rsi
leaq 0x68(%rsp), %rdx
leaq 0xca91(%rip), %rdi      # 0x2fa28
movb $0x0, %al
callq 0xb5d0
movsd 0x1451a(%rip), %xmm0    # 0x374c0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x22fd1
leaq 0x5e(%rsp), %rdi
movsd 0x14504(%rip), %xmm0    # 0x374c0
movl $0xa, %esi
leaq 0xca33(%rip), %rdx      # 0x2f9fb
movb $0x1, %al
callq 0x99e0
jmp 0x22fe2
leaq 0x5e(%rsp), %rdi
leaq 0xc97d(%rip), %rsi      # 0x2f95a
callq 0x4380
leaq 0x54(%rsp), %rdi
leaq 0xc96c(%rip), %rsi      # 0x2f95a
callq 0x4380
leaq 0x5e(%rsp), %rsi
leaq 0x54(%rsp), %rdx
leaq 0xca4b(%rip), %rdi      # 0x2fa4f
movb $0x0, %al
callq 0xb5d0
movb 0x61b86e1(%rip), %cl    # 0x61db6f2
xorb $-0x1, %cl
leaq 0xb804(%rip), %rsi      # 0x2e81f
leaq 0xbbf1(%rip), %rax      # 0x2ec13
testb $0x1, %cl
cmovneq %rax, %rsi
leaq 0xca46(%rip), %rdi      # 0x2fa76
leaq 0xbbdc(%rip), %rdx      # 0x2ec13
movb $0x0, %al
callq 0xb5d0
leaq 0x8cf3(%rip), %rdi      # 0x2bd38
movb $0x0, %al
callq 0xb5d0
addq $0x98, %rsp
retq
nopw %cs:(%rax,%rax)