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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x419f38
push 0x414f80
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 8
mov eax, 0x204c
call fcn.00414fb0
mov eax, dword [0x4251a4]
xor eax, ebp
mov dword [ebp - 0x1c], eax
push ebx
push esi
push edi
mov dword [ebp - 0x18], esp
mov ebx, ecx
mov dword [ebp - 0x2030], ebx
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x2024], eax
mov ecx, dword [ebp + 0x10]
mov dword [ebp - 0x2054], ecx
mov edx, dword [ebp + 0x14]
mov dword [ebp - 0x2048], edx
mov eax, dword [ebp + 0x18]
test eax, eax
je 0x407e07
mov eax, dword [0x42504c]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
mov ecx, ebx
call fcn.00407c90
push esi
mov ecx, dword [0x42504c]
push ecx
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov eax, dword [ebx + 0x28]
test eax, eax
jne 0x407e19
mov eax, dword [ebx + 0x2c]
test eax, eax
je case.default.0x407f07
mov esi, dword [ebp + 8]
cmp esi, dword [ebx + 0x30]
jl case.default.0x407f07
mov word [ebp - 0x201c], 0
mov ecx, 0x7ff
xor eax, eax
lea edi, [ebp - 0x201a]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov word [ebp - 0x2040], 0
xor edx, edx
mov dword [ebp - 0x203e], edx
mov dword [ebp - 0x203a], edx
mov dword [ebp - 0x2036], edx
mov word [ebp - 0x2032], dx
mov eax, dword [0x425b58]
test eax, eax
jne 0x407e77
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov dword [0x425b58], eax
lea eax, [ebp - 0x2040]
push eax
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
mov eax, dword [ebx + 0xf0]
lea ecx, [eax + 1]
mov dword [ebx + 0xf0], ecx
mov edx, dword [0x425b58]
push edx
movzx ecx, word [ebp - 0x2032]
push ecx
movzx edx, word [ebp - 0x2034]
push edx
movzx ecx, word [ebp - 0x2036]
push ecx
movzx edx, word [ebp - 0x2038]
push edx
push eax
push str._08d_t_02d:_02d:_02d._03d_t__d_
push 0x100
lea eax, [ebp - 0x201c]
push eax
mov ebx, dword [sym.imp.MSVCR71.dll__snwprintf]
call ebx
add esp, 0x24
lea edi, [ebp + eax*2 - 0x201c]
mov dword [ebp - 0x2028], edi
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
push str.__d_
push 0x100
push edi
call ebx
add esp, 0x10
lea edi, [edi + eax*2]
cmp esi, 6
ja case.default.0x407f07
jmp dword [esi*4 + 0x4082b0]
call fcn.00401ef0
push eax
push str.TRACE____s_
jmp 0x407f67
call fcn.00401ef0
push eax
push str.DEBUG____s_
jmp 0x407f67
call fcn.00401ef0
push eax
push str.INFO_____s_
jmp 0x407f67
call fcn.00401ef0
push eax
push str.WARN_____s_
jmp 0x407f67
call fcn.00401ef0
push eax
push str.ERROR____s_
jmp 0x407f67
call fcn.00401ef0
push eax
push str.FATAL____s_
jmp 0x407f67
call fcn.00401ef0
push eax
push str.PROMPT___s_
push 0x100
push edi
call ebx
add esp, 0x10
lea edi, [edi + eax*2]
mov dword [ebp - 0x2020], edi
xor eax, eax
mov dword [ebp - 0x202c], eax
mov word [edi], 0x5b
mov dword [ebp - 4], eax
cmp dword [ebp + 0x18], eax
je 0x407f9d
mov ecx, dword [0x42504c]
push ecx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
mov dword [ebp - 0x205c], esi
mov eax, dword [ebp + 0x18]
test eax, eax
je 0x407fbb
mov edx, dword [0x425048]
push edx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
jmp 0x407fbd
xor eax, eax
mov dword [ebp - 0x202c], eax
test esi, esi
jne 0x407fd8
xor eax, eax
mov dword [ebp - 0x2050], eax
mov dword [ebp - 4], 0xffffffff
jmp 0x408054
push esi
call dword [sym.imp.MSVCR71.dll_wcslen]
add esp, 4
mov dword [ebp - 0x2050], 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 0x408054
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 - 0x202c]
test eax, eax
je 0x4080de
mov dword [ebp - 4], 1
mov dword [ebp - 0x2058], eax
mov dword [ebp - 4], 0xffffffff
jmp 0x4080a7
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 - 0x2054]
test eax, eax
jne 0x40811d
mov ecx, dword [ebp - 0x2024]
push ecx
push 0x419e04
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 - 0x2044], eax
jmp 0x40819a
push eax
mov edx, dword [ebp - 0x2024]
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 - 0x2044], eax
jmp 0x40819a
mov dword [ebp - 4], 0xffffffff
cmp eax, 0xffffffff
jne 0x4081b0
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 0x4081c9
cmp ax, 0xd
je 0x4081c9
cmp ax, 0xa
jne 0x4081d3
mov word [esi], 0
sub esi, 2
jmp 0x4081b4
rdtsc
mov dword [ebp - 0x2060], edx
add esi, 2
push 0x419d64
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 - 0x2030]
cmp eax, 6
je 0x408256
lea ebx, [edi + 0x34]
push 0x418930
mov ecx, ebx
call fcn.00403010
test eax, eax
jne 0x40822e
mov eax, dword [ebp - 0x2028]
push eax
mov ecx, ebx
call fcn.00403130
test eax, eax
je case.default.0x407f07
lea ebx, [edi + 0x88]
push 0x418930
mov ecx, ebx
call fcn.00403010
test eax, eax
jne case.default.0x407f07
mov ecx, dword [ebp - 0x2028]
push ecx
mov ecx, ebx
call fcn.00403130
test eax, eax
jne case.default.0x407f07
mov eax, dword [edi + 0x28]
test eax, eax
je 0x40826a
mov edx, dword [ebp - 0x2028]
push edx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
mov eax, dword [edi + 0x2c]
test eax, eax
je case.default.0x407f07
mov eax, dword [ebp - 0x2048]
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.00405040
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x1c]
xor ecx, ebp
call fcn.00414f09
mov esp, ebp
pop ebp
ret 0x14