Function at 0x405bc0
Capabilities:
Get thread local storage value
Print debug messages
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x411ea0
push 0x40e740
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 8
mov eax, 0x2040
call fcn.0040e7a0
mov eax, dword [0x418110]
mov dword [ebp - 0x1c], eax
push ebx
push esi
push edi
mov dword [ebp - 0x18], esp
mov esi, ecx
mov dword [ebp - 0x202c], esi
xor ebx, ebx
cmp dword [ebp + 0x18], ebx
je 0x405c2a
mov eax, dword [0x41804c]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edi, eax
mov ecx, esi
call fcn.00405ad0
push edi
mov ecx, dword [0x41804c]
push ecx
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
cmp dword [esi + 0x28], ebx
jne 0x405c38
cmp dword [esi + 0x2c], ebx
je case.default.0x405d24
mov edx, dword [ebp + 8]
cmp edx, dword [esi + 0x30]
jl case.default.0x405d24
mov word [ebp - 0x201c], bx
mov ecx, 0x7ff
xor eax, eax
lea edi, [ebp - 0x201a]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov word [ebp - 0x203c], bx
xor eax, eax
mov dword [ebp - 0x203a], eax
mov dword [ebp - 0x2036], eax
mov dword [ebp - 0x2032], eax
mov word [ebp - 0x202e], ax
cmp dword [0x418a60], ebx
jne 0x405c91
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov dword [0x418a60], eax
lea ecx, [ebp - 0x203c]
push ecx
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
mov eax, dword [esi + 0xf0]
lea edx, [eax + 1]
mov dword [esi + 0xf0], edx
mov ecx, dword [0x418a60]
push ecx
movzx edx, word [ebp - 0x202e]
push edx
movzx ecx, word [ebp - 0x2030]
push ecx
movzx edx, word [ebp - 0x2032]
push edx
movzx ecx, word [ebp - 0x2034]
push ecx
push eax
push str._08d_t_02d:_02d:_02d._03d_t__d_
push 0x100
lea edx, [ebp - 0x201c]
push edx
mov ebx, dword [sym.imp.MSVCR71.dll__snwprintf]
call ebx
add esp, 0x24
lea esi, [ebp + eax*2 - 0x201c]
mov dword [ebp - 0x2024], esi
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
push str.__d_
push 0x100
push esi
call ebx
add esp, 0x10
lea esi, [esi + eax*2]
mov eax, dword [ebp + 8]
cmp eax, 6
ja case.default.0x405d24
jmp dword [eax*4 + 0x4060bc]
call fcn.00401800
push eax
push str.TRACE____s_
jmp 0x405d84
call fcn.00401800
push eax
push str.DEBUG____s_
jmp 0x405d84
call fcn.00401800
push eax
push str.INFO_____s_
jmp 0x405d84
call fcn.00401800
push eax
push str.WARN_____s_
jmp 0x405d84
call fcn.00401800
push eax
push str.ERROR____s_
jmp 0x405d84
call fcn.00401800
push eax
push str.FATAL____s_
jmp 0x405d84
call fcn.00401800
push eax
push str.PROMPT___s_
push 0x100
push esi
call ebx
add esp, 0x10
lea edi, [esi + eax*2]
mov dword [ebp - 0x2020], edi
xor eax, eax
mov dword [ebp - 0x2028], eax
mov word [edi], 0x5b
mov dword [ebp - 4], eax
cmp dword [ebp + 0x18], eax
je 0x405db9
mov eax, dword [0x41804c]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
mov dword [ebp - 0x2050], esi
mov eax, dword [ebp + 0x18]
test eax, eax
je 0x405dd7
mov ecx, dword [0x418048]
push ecx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
jmp 0x405dd9
xor eax, eax
mov dword [ebp - 0x2028], eax
test esi, esi
jne 0x405df4
xor eax, eax
mov dword [ebp - 0x2044], eax
mov dword [ebp - 4], 0xffffffff
jmp 0x405e70
push esi
call dword [sym.imp.MSVCR71.dll_wcslen]
add esp, 4
mov dword [ebp - 0x2044], eax
lea ecx, [eax + eax]
add edi, 2
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [ebp - 0x2020]
mov dword [ebp - 4], 0xffffffff
jmp 0x405e70
mov word [edi + eax*2 + 2], 0x5d
mov word [edi + eax*2 + 4], 0x20
lea esi, [edi + eax*2 + 6]
mov dword [ebp - 0x2020], esi
mov eax, dword [ebp - 0x2028]
test eax, eax
je 0x405efa
mov dword [ebp - 4], 1
mov dword [ebp - 0x204c], eax
mov dword [ebp - 4], 0xffffffff
jmp 0x405ec3
mov word [esi], 0x5b
push eax
push str.0x_08x
push 0x100
lea eax, [esi + 2]
push eax
call ebx
push esi
call dword [sym.imp.MSVCR71.dll_wcslen]
add esp, 0x14
mov word [esi + eax*2], 0x5d
mov word [esi + eax*2 + 2], 0x20
lea esi, [esi + eax*2 + 4]
mov dword [ebp - 0x2020], esi
mov dword [ebp - 4], 2
mov eax, dword [ebp + 0x10]
test eax, eax
jne 0x405f33
mov ecx, dword [ebp + 0xc]
push ecx
push 0x410528
mov edx, esi
lea eax, [ebp - 0x201c]
sub edx, eax
sar edx, 1
mov ecx, 0xfbf
sub ecx, edx
push ecx
push esi
call ebx
add esp, 0x10
mov dword [ebp - 0x2040], eax
jmp 0x405faa
push eax
mov edx, dword [ebp + 0xc]
push edx
mov eax, esi
lea ecx, [ebp - 0x201c]
sub eax, ecx
sar eax, 1
mov edx, 0xfbf
sub edx, eax
push edx
push esi
call dword [sym.imp.MSVCR71.dll__vsnwprintf]
add esp, 0x10
mov dword [ebp - 0x2040], eax
jmp 0x405faa
mov dword [ebp - 4], 0xffffffff
cmp eax, 0xffffffff
jne 0x405fc0
push esi
call dword [sym.imp.MSVCR71.dll_wcslen]
add esp, 4
lea esi, [esi + eax*2 - 2]
mov ax, word [esi]
cmp ax, 9
je 0x405fd9
cmp ax, 0xd
je 0x405fd9
cmp ax, 0xa
jne 0x405fe3
mov word [esi], 0
sub esi, 2
jmp 0x405fc4
rdtsc
mov dword [ebp - 0x2054], edx
add esi, 2
push 0x411cd4
movzx edx, ax
push edx
shr eax, 0x10
push eax
push str._t_hu__hu_s
push 0x20
push esi
call ebx
add esp, 0x18
lea esi, [esi + eax*2]
mov eax, dword [ebp + 8]
mov edi, dword [ebp - 0x202c]
cmp eax, 6
je 0x406066
lea ebx, [edi + 0x34]
push 0x4108b8
mov ecx, ebx
call fcn.00402200
test eax, eax
jne 0x40603e
mov eax, dword [ebp - 0x2024]
push eax
mov ecx, ebx
call fcn.00402300
test eax, eax
je case.default.0x405d24
lea ebx, [edi + 0x88]
push 0x4108b8
mov ecx, ebx
call fcn.00402200
test eax, eax
jne case.default.0x405d24
mov ecx, dword [ebp - 0x2024]
push ecx
mov ecx, ebx
call fcn.00402300
test eax, eax
jne case.default.0x405d24
mov eax, dword [edi + 0x28]
test eax, eax
je 0x40607a
mov edx, dword [ebp - 0x2024]
push edx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
mov eax, dword [edi + 0x2c]
test eax, eax
je case.default.0x405d24
mov eax, dword [ebp + 0x14]
push eax
lea ecx, [ebp - 0x201c]
sub esi, ecx
sar esi, 1
push esi
mov edx, ecx
push edx
mov eax, dword [ebp + 8]
push eax
mov ecx, edi
call fcn.004037e0
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
mov ecx, dword [ebp - 0x1c]
call fcn.0040e783
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14