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

Disassembly:
push ebp
lea ebp, [esp - 0x2004]
mov eax, 0x2004
call fcn.00416810
push 0xfffffffffffffffe
push 0x436de0
push 0x415920
mov eax, dword fs:[0]
push eax
sub esp, 0x48
mov eax, dword [0x43b690]
xor dword [ebp - 8], eax
xor eax, ebp
mov dword [ebp + 0x2000], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0x10]
mov dword fs:[0], eax
mov dword [ebp - 0x18], esp
mov esi, ecx
mov dword [ebp - 0x34], esi
mov eax, dword [ebp + 0x2010]
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp + 0x2014]
mov dword [ebp - 0x4c], eax
mov eax, dword [ebp + 0x2018]
mov dword [ebp - 0x58], eax
cmp dword [ebp + 0x201c], 0
je 0x40b5d2
push dword [0x43b250]
mov edi, dword [sym.imp.KERNEL32.dll_TlsGetValue]
call edi
mov ebx, eax
push dword [0x43b254]
call edi
mov edi, eax
mov ecx, esi
call fcn.0040b459
push edi
push dword [0x43b254]
mov edi, dword [sym.imp.KERNEL32.dll_TlsSetValue]
call edi
push ebx
push dword [0x43b250]
call edi
cmp dword [esi + 0x28], 0
jne 0x40b5e2
cmp dword [esi + 0x2c], 0
je 0x40b9b7
mov ebx, dword [ebp + 0x200c]
cmp ebx, dword [esi + 0x30]
jl 0x40b9b7
xor eax, eax
mov word [ebp], ax
push 0x1ffe
push eax
lea eax, [ebp + 2]
push eax
call fcn.00415ab0
add esp, 0xc
xor eax, eax
mov word [ebp - 0x48], ax
lea edi, [ebp - 0x46]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosw word es:[edi], ax
cmp dword [0x43d64c], 0
jne 0x40b62b
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov dword [0x43d64c], eax
lea eax, [ebp - 0x48]
push eax
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
lea eax, [esi + 0xf0]
mov ecx, dword [eax]
lea edx, [ecx + 1]
mov dword [eax], edx
push dword [0x43d64c]
movzx eax, word [ebp - 0x3a]
push eax
movzx eax, word [ebp - 0x3c]
push eax
movzx eax, word [ebp - 0x3e]
push eax
movzx eax, word [ebp - 0x40]
push eax
push ecx
push str._08d_t_02d:_02d:_02d._03d_t__d_
mov esi, 0x100
push esi
lea eax, [ebp]
push eax
call fcn.004157ed
add esp, 0x24
lea edi, [ebp + eax*2]
mov dword [ebp - 0x28], edi
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
push str.__d_
push esi
push edi
call fcn.004157ed
add esp, 0x10
lea edi, [edi + eax*2]
mov eax, ebx
xor ebx, ebx
sub eax, ebx
je 0x40b700
dec eax
je 0x40b6f3
dec eax
je 0x40b6e6
dec eax
je 0x40b6d9
dec eax
je 0x40b6cc
dec eax
je 0x40b6bf
dec eax
jne 0x40b9b7
call fcn.00401880
push eax
push str.PROMPT___s_
jmp 0x40b70b
call fcn.00401880
push eax
push str.FATAL____s_
jmp 0x40b70b
call fcn.00401880
push eax
push str.ERROR____s_
jmp 0x40b70b
call fcn.00401880
push eax
push str.WARN_____s_
jmp 0x40b70b
call fcn.00401880
push eax
push str.INFO_____s_
jmp 0x40b70b
call fcn.00401880
push eax
push str.DEBUG____s_
jmp 0x40b70b
call fcn.00401880
push eax
push str.TRACE____s_
push esi
push edi
call fcn.004157ed
add esp, 0x10
lea edi, [edi + eax*2]
mov dword [ebp - 0x24], edi
mov dword [ebp - 0x20], ebx
push 0x5b
pop eax
mov word [edi], ax
mov dword [ebp - 4], ebx
cmp dword [ebp + 0x201c], ebx
je 0x40b740
push dword [0x43b250]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov dword [ebp - 0x1c], eax
jmp 0x40b743
mov dword [ebp - 0x1c], ebx
cmp dword [ebp + 0x201c], ebx
je 0x40b759
push dword [0x43b254]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
jmp 0x40b75b
xor eax, eax
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x1c], ebx
jne 0x40b768
mov dword [ebp - 0x38], ebx
jmp 0x40b788
push dword [ebp - 0x1c]
call fcn.00414010
mov ebx, eax
mov dword [ebp - 0x38], ebx
lea eax, [ebx + ebx]
push eax
push dword [ebp - 0x1c]
lea eax, [edi + 2]
push eax
call fcn.00415de0
add esp, 0x10
mov dword [ebp - 4], 0xfffffffe
jmp 0x40b7c8
push 0x5d
pop eax
mov word [edi + ebx*2 + 2], ax
push 0x20
pop eax
mov word [edi + ebx*2 + 4], ax
lea edi, [edi + ebx*2 + 6]
mov dword [ebp - 0x24], edi
cmp dword [ebp - 0x20], 0
je 0x40b85c
and dword [ebp - 0x1c], 0
mov dword [ebp - 4], 1
push 4
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0x1c]
push eax
call fcn.00415de0
add esp, 0xc
mov dword [ebp - 4], 0xfffffffe
jmp 0x40b825
push 0x5b
pop eax
mov word [edi], ax
push dword [ebp - 0x1c]
push str.0x_08x
push esi
lea eax, [edi + 2]
push eax
call fcn.004157ed
push edi
call fcn.00414010
add esp, 0x14
push 0x5d
pop ecx
mov word [edi + eax*2], cx
push 0x20
pop ecx
mov word [edi + eax*2 + 2], cx
lea edi, [edi + eax*2 + 4]
mov dword [ebp - 0x24], edi
mov dword [ebp - 4], 2
mov eax, edi
lea ecx, [ebp]
sub eax, ecx
sar eax, 1
mov ecx, 0xfbf
sub ecx, eax
cmp dword [ebp - 0x4c], 0
jne 0x40b88a
push dword [ebp - 0x2c]
push 0x42d6a8
push ecx
push edi
call fcn.004157ed
jmp 0x40b897
push dword [ebp - 0x4c]
push dword [ebp - 0x2c]
push ecx
push edi
call fcn.00417744
add esp, 0x10
jmp 0x40b8d5
mov dword [ebp - 0x30], eax
mov dword [ebp - 4], 0xfffffffe
cmp eax, 0xffffffff
jne 0x40b8eb
push edi
call fcn.00414010
pop ecx
lea edi, [edi + eax*2 - 2]
movzx eax, word [edi]
push 9
pop ecx
cmp cx, ax
je 0x40b90a
push 0xd
pop ecx
cmp cx, ax
je 0x40b90a
push 0xa
pop ecx
cmp cx, ax
jne 0x40b913
xor eax, eax
mov word [edi], ax
dec edi
dec edi
jmp 0x40b8ef
rdtsc
mov dword [ebp - 0x4c], edx
inc edi
inc edi
push 0x4304d4
movzx ecx, ax
push ecx
shr eax, 0x10
push eax
push str._t_hu__hu_s
push 0x20
push edi
call fcn.004157ed
add esp, 0x18
lea esi, [edi + eax*2]
mov edi, dword [ebp - 0x34]
cmp dword [ebp + 0x200c], 6
je 0x40b989
lea ecx, [edi + 0x34]
mov ebx, 0x42f5ac
push ebx
call fcn.004083ac
test eax, eax
jne 0x40b967
push dword [ebp - 0x28]
lea ecx, [edi + 0x34]
call fcn.00408453
test eax, eax
je 0x40b9b7
lea ecx, [edi + 0x88]
push ebx
call fcn.004083ac
test eax, eax
jne 0x40b9b7
push dword [ebp - 0x28]
lea ecx, [edi + 0x88]
call fcn.00408453
test eax, eax
jne 0x40b9b7
cmp dword [edi + 0x28], 0
je 0x40b998
push dword [ebp - 0x28]
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
cmp dword [edi + 0x2c], 0
je 0x40b9b7
push dword [ebp - 0x58]
lea eax, [ebp]
sub esi, eax
sar esi, 1
push esi
push eax
push dword [ebp + 0x200c]
mov ecx, edi
call fcn.004085a5
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x2000]
xor ecx, ebp
call fcn.00413ea6
add ebp, 0x2004
leave
ret 0x14