Function at 0x40b8e0
Capabilities:
Get thread local storage value

Disassembly:
push ebp
mov ebp, ecx
push edi
push esi
push ebx
sub esp, 0x4c
mov ecx, dword [ecx]
mov eax, dword [esp + 0x60]
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x64]
mov dword [esp + 0x38], eax
test ecx, ecx
je 0x40bb5d
mov ebx, dword [ecx]
mov eax, ebx
add eax, 1
mov edx, eax
jo 0x40bb69
test eax, eax
js 0x40bb9a
mov dword [esp], edx
mov edx, 0x4a0280
call fcn.0040b370
sub esp, 4
mov edi, eax
mov dword [esp], ebp
call fcn.00406db0
test al, al
je 0x40baa8
sub ebx, 1
mov dword [ebp], edi
jno 0x40b9f9
jmp 0x40bb69
mov eax, dword [esi]
cmp edi, eax
jae 0x40bb7d
cmp ebx, eax
jae 0x40bb6e
mov edx, dword [esi + ebx*8 + 0xc]
test edx, edx
je 0x40b96e
add dword [edx - 8], 8
mov eax, dword [esi + edi*8 + 0xc]
test eax, eax
je 0x40b9e1
lea ecx, [eax - 8]
mov dword [esp + 0x28], ecx
mov ecx, dword [eax - 8]
sub ecx, 8
mov dword [eax - 8], ecx
cmp ecx, 7
ja 0x40b9e1
mov eax, dword [0x49c308]
mov dword [esp + 0x34], edx
mov dword [esp + 0x2c], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x2c]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
mov ecx, dword [esp + 0x30]
mov dword [esp + 0x2c], eax
mov dword [esp], ecx
call dword [sym.imp.KERNEL32.dll_SetLastError]
sub esp, 4
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0x28]
add eax, 0x2c
mov dword [esp + 4], ecx
mov dword [esp], eax
call fcn.00405190
mov edx, dword [esp + 0x34]
mov dword [esi + edi*8 + 0xc], edx
mov eax, dword [ebp]
mov edx, dword [eax + ebx*8 + 8]
sub ebx, 1
mov dword [eax + edi*8 + 8], edx
jo 0x40bb69
cmp ebx, dword [esp + 0x68]
jl 0x40ba30
mov edi, ebx
add edi, 1
jo 0x40bb69
mov esi, dword [ebp]
test esi, esi
jne 0x40b950
mov ecx, edi
mov eax, 0xffffffff
mov dword [esp + 4], eax
mov dword [esp], ecx
call fcn.0040a570
lea esi, [esi]
nop
mov ebx, dword [ebp]
mov eax, 0xffffffff
test ebx, ebx
je 0x40bb8a
mov eax, dword [ebx]
cmp eax, dword [esp + 0x68]
jbe 0x40bb87
mov eax, dword [esp + 0x38]
test eax, eax
je 0x40ba58
add dword [eax - 8], 8
mov eax, dword [esp + 0x68]
mov eax, dword [ebx + eax*8 + 0xc]
test eax, eax
je 0x40ba7d
mov esi, dword [eax - 8]
lea ecx, [eax - 8]
mov dword [esp + 0x28], ecx
lea edx, [esi - 8]
mov dword [eax - 8], edx
cmp edx, 7
jbe 0x40bb1d
mov eax, dword [esp + 0x68]
mov esi, dword [esp + 0x38]
mov edx, dword [esp + 0x3c]
mov dword [ebx + eax*8 + 0xc], esi
mov esi, dword [esp + 0x68]
mov eax, dword [ebp]
mov dword [eax + esi*8 + 8], edx
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret 0xc
test edi, edi
je 0x40bab0
add dword [edi - 8], 8
mov eax, dword [ebp]
cmp eax, 0xfff
jbe 0x40b93c
mov esi, dword [eax - 8]
lea ecx, [eax - 8]
mov dword [esp + 0x28], ecx
lea edx, [esi - 8]
mov dword [eax - 8], edx
cmp edx, 7
ja 0x40b93c
mov esi, dword [0x49c308]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x2c], eax
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
mov esi, eax
mov edx, dword [esp + 0x2c]
add esi, 0x2c
mov dword [esp], edx
call dword [sym.imp.KERNEL32.dll_SetLastError]
sub esp, 4
mov ecx, dword [esp + 0x28]
mov dword [esp], esi
mov dword [esp + 4], ecx
call fcn.00405190
jmp 0x40b93c
mov esi, dword [0x49c308]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
mov esi, eax
mov dword [esp], edi
add esi, 0x2c
call dword [sym.imp.KERNEL32.dll_SetLastError]
sub esp, 4
mov ecx, dword [esp + 0x28]
mov dword [esp], esi
mov dword [esp + 4], ecx
call fcn.00405190
jmp 0x40ba7d
xor ebx, ebx
mov edx, 1
jmp 0x40b91a
call fcn.00409ba0
sub eax, 1
mov dword [esp], ebx
mov dword [esp + 4], eax
call fcn.0040a570
mov ecx, edi
sub eax, 1
jmp 0x40ba1c
sub eax, 1
mov dword [esp + 4], eax
mov eax, dword [esp + 0x68]
mov dword [esp], eax
call fcn.0040a570
mov dword [esp], eax
sar eax, 0x1f
mov dword [esp + 0x10], 0x7fffffff
mov dword [esp + 0x14], 0
mov dword [esp + 8], 0
mov dword [esp + 0xc], 0
mov dword [esp + 4], eax
call fcn.0040b690
lea esi, [esi]
sub esp, 0xc
mov eax, 0x473b24
call fcn.00409aa0
lea esi, [esi]