Function at 0x40bfc0
Capabilities:
Get thread local storage value

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x4c
mov esi, dword [ecx + 4]
add esi, 1
jo 0x40c13d
imul esi, esi, 2
jo 0x40c13d
imul edx, esi, 8
jo 0x40c13d
mov ebp, edx
add ebp, 8
jo 0x40c13d
test ebp, ebp
js 0x40c152
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x30], edx
mov edi, ecx
mov ebx, dword [0x49c308]
mov dword [esp + 0x38], eax
call eax
mov dword [esp], ebx
mov dword [esp + 0x2c], eax
mov eax, dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov dword [esp + 0x34], eax
call eax
sub esp, 4
mov ebx, eax
mov eax, dword [sym.imp.KERNEL32.dll_SetLastError]
mov ecx, dword [esp + 0x2c]
mov dword [esp + 0x3c], eax
mov dword [esp], ecx
call eax
lea ecx, [ebx + 0x54]
sub esp, 4
mov edx, dword [esp + 0x30]
add edx, 0x10
call fcn.00404070
lea ebx, [eax + 8]
mov dword [eax + 4], 1
mov dword [esp + 8], ebp
mov dword [esp + 4], 0
mov dword [esp], ebx
mov dword [esp + 0x2c], eax
call sub.msvcrt.dll_memset
mov edx, dword [esp + 0x2c]
mov eax, dword [edi]
mov dword [edx + 8], eax
xor edx, edx
add esi, 0xffffffff
seto dl
jo 0x40c13d
mov dword [ebx + 4], esi
mov ecx, dword [edi + 4]
mov ebp, edx
test ecx, ecx
js 0x40c100
nop
mov eax, dword [edi + ebp*8 + 8]
test eax, eax
je 0x40c0d4
sar eax, 8
jmp 0x40c0a9
add eax, 1
jo 0x40c13d
mov ecx, esi
and ecx, eax
cmp ecx, 0xfffffe
ja 0x40c142
mov edx, dword [ebx + ecx*8 + 8]
test edx, edx
jne 0x40c0a0
mov eax, dword [edi + ebp*8 + 8]
mov edx, dword [edi + ebp*8 + 0xc]
mov dword [ebx + ecx*8 + 8], eax
mov dword [ebx + ecx*8 + 0xc], edx
mov ecx, dword [edi + 4]
add ebp, 1
cmp ecx, ebp
jl 0x40c100
cmp ebp, 0xffffff
jne 0x40c090
mov dword [esp + 4], 0xfffffe
mov dword [esp], 0xffffff
call fcn.0040a570
lea esi, [esi]
nop
mov esi, dword [0x49c308]
mov eax, dword [esp + 0x38]
call eax
mov ebp, eax
mov dword [esp], esi
mov eax, dword [esp + 0x34]
call eax
sub esp, 4
mov esi, eax
mov dword [esp], ebp
mov eax, dword [esp + 0x3c]
call eax
lea edx, [edi - 8]
lea ecx, [esi + 0x54]
sub esp, 4
call fcn.00404df0
add esp, 0x4c
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
call fcn.00409ba0
mov dword [esp + 4], 0xfffffe
mov dword [esp], ecx
call fcn.0040a570
mov dword [esp], ebp
sar ebp, 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], ebp
call fcn.0040b690
lea esi, [esi]
lea esi, [esi]
nop
push edi
push esi
push ebx
mov ebx, ecx
sub esp, 0x10
mov ecx, dword [ecx]
mov edi, dword [ecx + 4]
mov eax, edi
add eax, 1
jo 0x40c20d
imul eax, eax, 2
jo 0x40c20d
mov esi, edx
imul edx, dword [ecx], 3
jo 0x40c20d
cmp eax, edx
jge 0x40c1c0
call fcn.0040bfc0
mov dword [ebx], eax
mov edi, dword [eax + 4]
mov ecx, eax
mov eax, esi
sar eax, 8
jmp 0x40c1d5
add eax, 1
jo 0x40c20d
mov edx, edi
and edx, eax
cmp edx, 0xfffffe
ja 0x40c212
cmp dword [ecx + edx*8 + 8], 0
jne 0x40c1d0
mov dword [ecx + edx*8 + 8], esi
mov edx, dword [ebx]
mov ecx, dword [esp + 0x20]
and eax, dword [edx + 4]
mov dword [edx + eax*8 + 0xc], ecx
mov edx, dword [ebx]
mov eax, dword [edx]
add eax, 1
jo 0x40c20d
mov dword [edx], eax
add esp, 0x10
pop ebx
pop esi
pop edi
ret 4
call fcn.00409ba0
mov dword [esp + 4], 0xfffffe
mov dword [esp], edx
call fcn.0040a570
lea esi, [esi]
lea esi, [esi]
push ebp
push edi
push esi
mov esi, ecx
push ebx
mov ebx, edx
sub esp, 0x3c
mov eax, dword [esp + 0x54]
mov edi, dword [esp + 0x50]
mov dword [esp + 0x20], eax
movzx eax, byte [edi + 8]
sub eax, 4
cmp al, 0x18
ja case.0x40c255.1
movzx eax, al
jmp dword [eax*4 + 0x47354c]
mov eax, dword [edi + 0xc]
test eax, eax
je 0x40c570
mov ecx, dword [esp + 0x20]
mov dword [esp], eax
mov edx, ebx
mov dword [esp + 4], ecx
mov ecx, esi
call 0x40c230
sub esp, 8
mov eax, dword [esp + 0x20]
mov edx, ebx
mov ecx, esi
mov dword [esp + 0x54], eax
mov eax, dword [edi + 0x10]
mov dword [esp + 0x50], eax
add esp, 0x3c
pop ebx
pop esi
pop edi
pop ebp
jmp 0x40c5d0
mov eax, dword [edi]
test eax, eax
js 0x40c5a0
mov dword [esp + 8], eax
mov dword [esp + 4], ebx
mov dword [esp], esi
call sub.msvcrt.dll_memcpy
add esp, 0x3c
pop ebx
pop esi
pop edi
pop ebp
ret 8
mov eax, dword [edi + 0xc]
mov ecx, dword [eax]
test ecx, ecx
je 0x40c59b
mov eax, dword [edi]
cmp eax, 0x80000000
jne 0x40c4f0
cmp ecx, 0xffffffff
jne 0x40c4f0
call fcn.00409ba0
lea esi, [esi]
nop
mov ecx, dword [ebx]
test ecx, ecx
je 0x40c4e0
mov eax, dword [edi + 0xc]
mov eax, dword [eax + 0x1c]
test eax, eax
je 0x40c4e0
call eax
mov dword [esi], eax
jmp 0x40c2c2
mov ebx, dword [ebx]
test ebx, ebx
je 0x40c4d0
mov eax, dword [edi + 0xc]
mov eax, dword [eax + 0x1c]
test eax, eax
jne 0x40c579
mov eax, dword [esp + 0x20]
mov ecx, dword [eax]
mov eax, ebx
sar eax, 8
mov edi, dword [ecx + 4]
jmp 0x40c35d
cmp ebx, ebp
je 0x40c550
add eax, 1
jo 0x40c2f3
mov edx, edi
and edx, eax
cmp edx, 0xfffffe
ja 0x40c58b
mov ebp, dword [ecx + edx*8 + 8]
test ebp, ebp
jne 0x40c350
mov edi, dword [ebx - 4]
mov eax, dword [edi + 0xc]
mov eax, dword [eax]
mov dword [esp], edi
mov dword [esp + 4], eax
call fcn.00408420
mov ecx, esi
mov ebp, eax
mov edx, eax
call fcn.00406e10
mov dword [esp], ebp
mov ecx, dword [esp + 0x20]
mov edx, ebx
mov esi, ebp
call 0x40c190
mov edi, dword [edi + 0xc]
sub esp, 4
jmp 0x40c247
mov edi, dword [ebx]
test edi, edi
je 0x40c4d0
mov ebp, dword [edi]
mov eax, 7
mov ecx, 0x472020
cmp ebp, eax
cmovl ebp, eax
add edi, 8
lea edx, [ebp + 9]
call fcn.00408da0
mov dword [eax + 4], ebp
mov ebx, eax
mov dword [eax], 0
mov eax, dword [edi - 8]
lea edx, [ebx + 8]
mov dword [ebx], eax
add eax, 1
mov dword [esp], edx
mov dword [esp + 8], eax
mov dword [esp + 4], edi
call sub.msvcrt.dll_memcpy
mov edx, ebx
mov ecx, esi
call fcn.00406e10
jmp 0x40c2c2
mov ebp, dword [ebx]
test ebp, ebp
je 0x40c4d0
mov edx, dword [ebp]
mov ecx, edi
call fcn.00409ca0
mov ecx, esi
mov edx, eax
call fcn.00406e10
mov eax, dword [esi]
mov esi, dword [ebp]
sub esi, 1
mov dword [esp + 0x28], eax
seto bl
mov dword [esp + 0x24], esi
movzx ebx, bl
jo 0x40c2f3
add eax, 8
mov dword [esp + 0x2c], eax
jmp 0x40c4a1
sub eax, 1
jo 0x40c2f3
mov edx, eax
add edx, 8
jo 0x40c2f3
not eax
mov esi, dword [esp + 0x28]
and eax, edx
mov edx, dword [ecx]
imul edx, ebx
add esi, edx
add esi, eax
add eax, edx
mov dword [esp], ecx
mov ecx, esi
lea edx, [ebp + eax]
mov eax, dword [esp + 0x20]
mov dword [esp + 4], eax
call 0x40c230
sub esp, 8
add ebx, 1
jo 0x40c2f3
cmp dword [esp + 0x24], ebx
jl 0x40c2c2
mov ecx, dword [edi + 0xc]
mov eax, dword [ecx + 4]
test eax, eax
jne 0x40c458
mov edx, dword [ecx]
mov eax, dword [esp + 0x2c]
imul edx, ebx
lea esi, [eax + edx]
mov eax, 8
jmp 0x40c47d
xor edx, edx
mov ecx, esi
call fcn.00406e10
jmp 0x40c2c2
mov dword [esi], ecx
jmp 0x40c2c2
cdq
idiv ecx
sub eax, 1
mov dword [esp + 0x24], eax
seto al
movzx eax, al
mov ebp, eax
jo 0x40c2f3
mov dword [esp + 0x28], ebx
jmp 0x40c53d
mov eax, dword [edi + 0xc]
mov ebx, dword [esp + 0x28]
mov ecx, dword [eax]
mov dword [esp], eax
imul ecx, ebp
lea edx, [ebx + ecx]
mov ebx, dword [esp + 0x20]
add ecx, esi
mov dword [esp + 4], ebx
call 0x40c230
sub esp, 8
add ebp, 1
jo 0x40c2f3
cmp dword [esp + 0x24], ebp
jge 0x40c510
jmp 0x40c2c2
mov edx, dword [ecx + edx*8 + 0xc]
test edx, edx
je 0x40c375
mov ecx, esi
call fcn.00406e10
jmp 0x40c2c2
mov eax, dword [ebx]
mov dword [esi], eax
jmp case.0x40c255.14
mov ecx, ebx
call eax
mov ecx, esi
mov edx, eax
call fcn.00406e10
jmp 0x40c2c2
mov dword [esp + 4], 0xfffffe
mov dword [esp], edx
call fcn.0040a570
call fcn.0040b7a0
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
nop
push ebp
push edi
mov edi, ecx
push esi
mov esi, edx
push ebx
sub esp, 0x3c
mov eax, dword [esp + 0x54]
mov ebx, dword [esp + 0x50]
mov dword [esp + 0x28], eax
movzx eax, byte [ebx]
cmp al, 2
je 0x40c608
cmp al, 3
je 0x40c6a0
cmp al, 1
je 0x40c678
add esp, 0x3c
pop ebx
pop esi
pop edi
pop ebp
ret 8
mov eax, dword [ebx + 0x10]
sub eax, 1
mov dword [esp + 0x2c], eax
seto al
movzx eax, al
mov ebp, eax
jo 0x40c72d
mov eax, dword [esp + 0x2c]
test eax, eax
js 0x40c5fa
lea esi, [esi]
nop
mov eax, dword [esp + 0x28]
mov ecx, edi
mov dword [esp + 4], eax
mov edx, dword [ebx + 0x14]
mov edx, dword [edx + ebp*4]
add ebp, 1
mov dword [esp], edx
mov edx, esi
call 0x40c5d0
sub esp, 8
cmp dword [esp + 0x2c], ebp
jl 0x40c5fa
cmp ebp, 0x7fff
jne 0x40c630
mov dword [esp + 4], 0x7ffe
mov dword [esp], 0x7fff
call fcn.0040a570
lea esi, [esi]
mov eax, dword [esp + 0x28]
add esi, dword [ebx + 4]
mov ecx, dword [ebx + 4]
mov edx, esi
mov dword [esp + 0x54], eax
mov eax, dword [ebx + 8]
add ecx, edi
mov dword [esp + 0x50], eax
add esp, 0x3c
pop ebx
pop esi
pop edi
pop ebp
jmp 0x40c230
mov edx, ebx
mov ecx, edi
call fcn.00405640
mov edx, ebx
mov ecx, esi
mov dword [esp + 0x2c], eax
call fcn.00405640
mov ebp, eax
mov eax, dword [esp + 0x2c]
cmp eax, ebp
je 0x40c6cd
test eax, eax
je 0x40c6cd
mov edx, eax
mov ecx, edi
call fcn.0040a850
mov eax, dword [ebx + 4]
lea edx, [edi + eax]
lea ecx, [esi + eax]
mov eax, dword [ebx + 8]
mov eax, dword [eax]
test eax, eax
js 0x40c6fe
mov dword [esp + 8], eax
mov dword [esp + 4], ecx
mov dword [esp], edx
call sub.msvcrt.dll_memcpy
test ebp, ebp
je 0x40c5fa
mov ebx, ebp
jmp 0x40c5e7
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
call fcn.00409ba0
lea esi, [esi]
lea esi, [esi]