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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x426098
push 0x415864
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 8
mov eax, 0x2040
call fcn.004167d0
mov eax, dword [0x42c17c]
mov dword [ebp - 0x1c], eax
push ebx
push esi
push edi
mov dword [ebp - 0x18], esp
mov ebx, ecx
mov dword [ebp - 0x202c], ebx
mov eax, dword [ebp + 0x18]
test eax, eax
je 0x40affa
mov eax, dword [0x42c0f0]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
mov ecx, ebx
call fcn.0040aea0
push esi
mov ecx, dword [0x42c0f0]
push ecx
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov eax, dword [ebx + 0x28]
test eax, eax
jne 0x40b00c
mov eax, dword [ebx + 0x2c]
test eax, eax
je case.default.0x40b0f9
mov esi, dword [ebp + 8]
cmp esi, dword [ebx + 0x30]
jl case.default.0x40b0f9
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
xor edi, edi
mov word [ebp - 0x203c], di
xor edx, edx
mov dword [ebp - 0x203a], edx
mov dword [ebp - 0x2036], edx
mov dword [ebp - 0x2032], edx
mov word [ebp - 0x202e], dx
cmp dword [0x42d96c], edi
jne 0x40b069
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov dword [0x42d96c], eax
lea eax, [ebp - 0x203c]
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 [0x42d96c]
push edx
movzx ecx, word [ebp - 0x202e]
push ecx
movzx edx, word [ebp - 0x2030]
push edx
movzx ecx, word [ebp - 0x2032]
push ecx
movzx edx, word [ebp - 0x2034]
push edx
push eax
push str._08d_t_02d:_02d:_02d._03d_t__d_
push 0x100
lea eax, [ebp - 0x201c]
push eax
call fcn.0041651d
add esp, 0x24
lea ebx, [ebp + eax*2 - 0x201c]
mov dword [ebp - 0x2024], ebx
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
push str.__d_
push 0x100
push ebx
call fcn.0041651d
add esp, 0x10
lea ebx, [ebx + eax*2]
cmp esi, 6
ja case.default.0x40b0f9
jmp dword [esi*4 + 0x40b458]
call fcn.004036f0
push eax
push str.TRACE____s_
jmp 0x40b159
call fcn.004036f0
push eax
push str.DEBUG____s_
jmp 0x40b159
call fcn.004036f0
push eax
push str.INFO_____s_
jmp 0x40b159
call fcn.004036f0
push eax
push str.WARN_____s_
jmp 0x40b159
call fcn.004036f0
push eax
push str.ERROR____s_
jmp 0x40b159
call fcn.004036f0
push eax
push str.FATAL____s_
jmp 0x40b159
call fcn.004036f0
push eax
push str.PROMPT___s_
push 0x100
push ebx
call fcn.0041651d
add esp, 0x10
lea ebx, [ebx + eax*2]
mov dword [ebp - 0x2020], ebx
mov dword [ebp - 0x2028], edi
mov word [ebx], 0x5b
mov dword [ebp - 4], edi
mov esi, dword [ebp + 0x18]
cmp esi, edi
je 0x40b194
mov ecx, dword [0x42c0f0]
push ecx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
jmp 0x40b196
xor eax, eax
mov edi, eax
mov dword [ebp - 0x2050], edi
test esi, esi
je 0x40b1b1
mov edx, dword [0x42c0ec]
push edx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
jmp 0x40b1b3
xor eax, eax
mov dword [ebp - 0x2028], eax
test edi, edi
jne 0x40b1c7
xor eax, eax
mov dword [ebp - 0x2044], eax
jmp 0x40b20c
push edi
call fcn.0041630e
mov dword [ebp - 0x2044], eax
mov esi, edi
jmp 0x40b1f5
lea ecx, [eax + eax]
mov edx, ecx
lea edi, [ebx + 2]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
add esp, 4
and ecx, 3
rep movsb byte es:[edi], byte [esi]
or edi, 0xffffffff
mov dword [ebp - 4], edi
mov word [ebx + eax*2 + 2], 0x5d
mov word [ebx + eax*2 + 4], 0x20
lea esi, [ebx + eax*2 + 6]
mov dword [ebp - 0x2020], esi
mov eax, dword [ebp - 0x2028]
test eax, eax
je 0x40b296
mov dword [ebp - 4], 1
mov dword [ebp - 0x204c], eax
mov dword [ebp - 4], edi
jmp 0x40b25d
mov word [esi], 0x5b
push eax
push str.0x_08x
push 0x100
lea eax, [esi + 2]
push eax
call fcn.0041651d
push esi
call fcn.0041630e
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 0x40b2d2
mov ecx, dword [ebp + 0xc]
push ecx
push 0x425f64
mov edx, esi
lea eax, [ebp - 0x201c]
sub edx, eax
sar edx, 1
mov ecx, 0xfbf
sub ecx, edx
push ecx
push esi
call fcn.0041651d
add esp, 0x10
mov dword [ebp - 0x2040], eax
jmp 0x40b348
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 fcn.004171a2
add esp, 0x10
mov dword [ebp - 0x2040], eax
jmp 0x40b348
mov dword [ebp - 4], edi
cmp eax, edi
jne 0x40b358
push esi
call fcn.0041630e
add esp, 4
lea esi, [esi + eax*2 - 2]
lea esp, [esp]
mov ax, word [esi]
cmp ax, 9
je 0x40b375
cmp ax, 0xd
je 0x40b375
cmp ax, 0xa
jne 0x40b37f
mov word [esi], 0
sub esi, 2
jmp 0x40b360
rdtsc
mov dword [ebp - 0x2054], edx
add esi, 2
push 0x425ec4
movzx edx, ax
push edx
shr eax, 0x10
push eax
push str._t_hu__hu_s
push 0x20
push esi
call fcn.0041651d
add esp, 0x18
lea esi, [esi + eax*2]
mov eax, dword [ebp + 8]
mov edi, dword [ebp - 0x202c]
cmp eax, 6
je 0x40b405
lea ebx, [edi + 0x34]
push 0x425070
mov ecx, ebx
call fcn.00407f00
test eax, eax
jne 0x40b3dd
mov eax, dword [ebp - 0x2024]
push eax
mov ecx, ebx
call fcn.00408070
test eax, eax
je case.default.0x40b0f9
lea ebx, [edi + 0x88]
push 0x425070
mov ecx, ebx
call fcn.00407f00
test eax, eax
jne case.default.0x40b0f9
mov ecx, dword [ebp - 0x2024]
push ecx
mov ecx, ebx
call fcn.00408070
test eax, eax
jne case.default.0x40b0f9
mov eax, dword [edi + 0x28]
test eax, eax
je 0x40b419
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.0x40b0f9
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.00408270
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
mov ecx, dword [ebp - 0x1c]
call fcn.0041575b
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14