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

Disassembly:
push ebp
mov ebp, esp
push 0xfffffffffffffffe
push 0x42c560
push 0x41ea3d
mov eax, dword fs:[0]
push eax
sub esp, 8
mov eax, 0x204c
call fcn.0041eb90
mov eax, dword [0x4300b8]
xor dword [ebp - 8], eax
xor eax, ebp
mov dword [ebp - 0x20], 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, edx
mov dword [ebp - 0x2038], esi
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x202c], eax
mov dword [ebp - 0x2060], ecx
cmp dword [ebp + 0x10], 0
je 0x4166b7
mov edx, dword [0x430468]
push edx
mov edi, dword [sym.imp.KERNEL32.dll_TlsGetValue]
call edi
mov ebx, eax
mov eax, dword [0x43046c]
push eax
call edi
mov edi, eax
call fcn.00415470
push edi
mov ecx, dword [0x43046c]
push ecx
mov edi, dword [sym.imp.KERNEL32.dll_TlsSetValue]
call edi
push ebx
mov edx, dword [0x430468]
push edx
call edi
cmp dword [esi + 0x28], 0
jne 0x4166c7
cmp dword [esi + 0x2c], 0
je case.default.0x4167b8
mov edi, dword [ebp + 8]
cmp edi, dword [esi + 0x30]
jl case.default.0x4167b8
xor eax, eax
mov word [ebp - 0x2024], ax
push 0x1ffe
push eax
lea ecx, [ebp - 0x2022]
push ecx
call sub.MSVCR90.dll_memset
add esp, 0xc
xor edx, edx
mov word [ebp - 0x204c], dx
xor eax, eax
mov dword [ebp - 0x204a], eax
mov dword [ebp - 0x2046], eax
mov dword [ebp - 0x2042], eax
mov word [ebp - 0x203e], ax
cmp dword [0x431538], eax
jne 0x416728
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov dword [0x431538], eax
lea eax, [ebp - 0x204c]
push eax
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
mov eax, dword [esi + 0xf0]
lea ecx, [eax + 1]
mov dword [esi + 0xf0], ecx
mov edx, dword [0x431538]
push edx
movzx ecx, word [ebp - 0x203e]
push ecx
movzx edx, word [ebp - 0x2040]
push edx
movzx ecx, word [ebp - 0x2042]
push ecx
movzx edx, word [ebp - 0x2044]
push edx
push eax
push str._08d_t_02d:_02d:_02d._03d_t__d_
push 0x100
lea eax, [ebp - 0x2024]
push eax
mov esi, dword [sym.imp.MSVCR90.dll__snwprintf]
call esi
add esp, 0x24
lea ebx, [ebp + eax*2 - 0x2024]
mov dword [ebp - 0x2030], ebx
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
push str.__d_
push 0x100
push ebx
call esi
add esp, 0x10
lea ebx, [ebx + eax*2]
cmp edi, 6
ja case.default.0x4167b8
jmp dword [edi*4 + 0x416b78]
call fcn.00415a50
push eax
push str.TRACE____s_
jmp 0x416818
call fcn.00415a50
push eax
push str.DEBUG____s_
jmp 0x416818
call fcn.00415a50
push eax
push str.INFO_____s_
jmp 0x416818
call fcn.00415a50
push eax
push str.WARN_____s_
jmp 0x416818
call fcn.00415a50
push eax
push str.ERROR____s_
jmp 0x416818
call fcn.00415a50
push eax
push str.FATAL____s_
jmp 0x416818
call fcn.00415a50
push eax
push str.PROMPT___s_
push 0x100
push ebx
call esi
add esp, 0x10
lea esi, [ebx + eax*2]
mov dword [ebp - 0x2028], esi
xor edi, edi
mov dword [ebp - 0x203c], edi
mov ecx, 0x5b
mov word [esi], cx
mov dword [ebp - 4], edi
cmp dword [ebp + 0x10], edi
je 0x416853
mov edx, dword [0x430468]
push edx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edi, eax
cmp dword [ebp + 0x10], 0
je 0x416867
mov eax, dword [0x43046c]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
jmp 0x416869
xor eax, eax
mov dword [ebp - 0x203c], eax
test edi, edi
jne 0x41687d
xor ebx, ebx
mov dword [ebp - 0x2050], ebx
jmp 0x4168d9
mov eax, edi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x416882
sub eax, edx
sar eax, 1
mov ebx, eax
mov dword [ebp - 0x2050], ebx
lea ecx, [ebx + ebx]
push ecx
push edi
lea edx, [esi + 2]
push edx
call sub.MSVCR90.dll_memcpy
add esp, 0xc
jmp 0x4168d9
mov edi, 0xfffffffe
mov dword [ebp - 4], edi
mov edx, 0x5d
mov word [esi + ebx*2 + 2], dx
mov eax, 0x20
mov word [esi + ebx*2 + 4], ax
lea ebx, [esi + ebx*2 + 6]
mov dword [ebp - 0x2028], ebx
mov eax, dword [ebp - 0x203c]
test eax, eax
je 0x416990
mov dword [ebp - 4], 1
mov dword [ebp - 0x2054], eax
mov dword [ebp - 4], edi
jmp 0x41693f
mov ecx, 0x5b
mov word [ebx], cx
push eax
push str.0x_08x
push 0x100
lea edx, [ebx + 2]
push edx
call dword [sym.imp.MSVCR90.dll__snwprintf]
add esp, 0x10
mov eax, ebx
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x416964
sub eax, edx
sar eax, 1
mov ecx, 0x5d
mov word [ebx + eax*2], cx
mov edx, 0x20
mov word [ebx + eax*2 + 2], dx
lea ebx, [ebx + eax*2 + 4]
mov dword [ebp - 0x2028], ebx
mov dword [ebp - 4], 2
mov eax, dword [ebp - 0x2060]
test eax, eax
jne 0x4169d9
mov eax, dword [ebp - 0x202c]
push eax
push 0x425700
mov ecx, ebx
lea edx, [ebp - 0x2024]
sub ecx, edx
sar ecx, 1
mov eax, 0xfbf
sub eax, ecx
push eax
push ebx
call dword [sym.imp.MSVCR90.dll__snwprintf]
mov dword [ebp - 0x2034], eax
add esp, 0x10
mov dword [ebp - 4], edi
jmp 0x416a64
push eax
mov ecx, dword [ebp - 0x202c]
push ecx
mov edx, ebx
lea eax, [ebp - 0x2024]
sub edx, eax
sar edx, 1
mov ecx, 0xfbf
sub ecx, edx
push ecx
push ebx
call dword [sym.imp.MSVCR90.dll__vsnwprintf]
mov dword [ebp - 0x2034], eax
add esp, 0x10
mov dword [ebp - 4], edi
jmp 0x416a64
cmp eax, 0xffffffff
jne 0x416a7f
mov eax, ebx
lea edx, [eax + 2]
mov edi, edi
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x416a70
sub eax, edx
sar eax, 1
lea ebx, [ebx + eax*2 - 2]
movzx eax, word [ebx]
mov ecx, 9
cmp cx, ax
je 0x416aa4
mov edx, 0xd
cmp dx, ax
je 0x416aa4
mov ecx, 0xa
cmp cx, ax
jne 0x416aae
xor edx, edx
mov word [ebx], dx
sub ebx, 2
jmp 0x416a83
rdtsc
mov dword [ebp - 0x2060], edx
add ebx, 2
push 0x426d44
movzx ecx, ax
push ecx
shr eax, 0x10
push eax
push str._t_hu__hu_s
push 0x20
push ebx
call dword [sym.imp.MSVCR90.dll__snwprintf]
add esp, 0x18
lea esi, [ebx + eax*2]
mov edi, dword [ebp - 0x2038]
cmp dword [ebp + 8], 6
je 0x416b25
lea ebx, [edi + 0x34]
push ebx
call fcn.00415560
test eax, eax
jne 0x416b04
mov edx, dword [ebp - 0x2030]
push edx
push ebx
call fcn.00415770
test eax, eax
je case.default.0x4167b8
lea ebx, [edi + 0x88]
push ebx
call fcn.00415560
test eax, eax
jne case.default.0x4167b8
mov eax, dword [ebp - 0x2030]
push eax
push ebx
call fcn.00415770
test eax, eax
jne case.default.0x4167b8
cmp dword [edi + 0x28], 0
je 0x416b38
mov ecx, dword [ebp - 0x2030]
push ecx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
cmp dword [edi + 0x2c], 0
je case.default.0x4167b8
lea edx, [ebp - 0x2024]
sub esi, edx
sar esi, 1
push esi
mov eax, edx
push eax
mov ecx, dword [ebp + 8]
push ecx
xor ecx, ecx
call fcn.00416210
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x20]
xor ecx, ebp
call fcn.0041e4d2
mov esp, ebp
pop ebp
ret 0xc