Function at 0x4088d0
Capabilities:
Get thread local storage value

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x3c
mov eax, dword [esp + 0x54]
mov ebx, dword [esp + 0x50]
mov dword [esp + 0x24], ecx
mov ecx, dword [ecx]
mov dword [esp + 0x2c], eax
test ecx, ecx
je 0x408b68
mov eax, dword [ecx]
mov dword [esp + 0x28], eax
lea edx, [eax + 0x20]
call fcn.00408790
mov dword [esp + 0x20], eax
mov edi, eax
mov eax, dword [esp + 0x24]
mov dword [esp], eax
call fcn.00406db0
test al, al
jne 0x408940
test edi, edi
je 0x40891d
add dword [edi - 8], 8
mov eax, dword [esp + 0x24]
mov eax, dword [eax]
cmp eax, 0xfff
jbe 0x408940
mov esi, dword [eax - 8]
lea edi, [eax - 8]
lea edx, [esi - 8]
mov dword [eax - 8], edx
cmp edx, 7
jbe 0x408bd0
nop
mov edi, dword [esp + 0x20]
mov eax, dword [esp + 0x24]
mov esi, ebx
xor ebp, ebp
mov dword [eax], edi
mov edi, dword [esp + 0x2c]
jmp 0x40898c
mov ebx, dword [esp + 0x20]
mov edi, dword [esp + 0x18]
add edx, 0x30
mov esi, dword [esp + 0x28]
sub edx, ecx
add ebx, ebp
or edi, eax
mov byte [esi + ebx + 8], dl
lea ebx, [ebp + 1]
je 0x408a5b
mov edi, dword [esp + 0x24]
mov esi, eax
mov ebp, ebx
mov edi, dword [edi]
mov dword [esp + 0x20], edi
mov edi, dword [esp + 0x18]
mov ecx, esi
mov ebx, edi
mov edx, esi
mov eax, edi
shrd ecx, ebx, 0x1c
and edx, 0xfffffff
sar eax, 0x1f
and ecx, 0xfffffff
mov dword [esp + 0x18], eax
and eax, 3
add ecx, edx
mov edx, edi
shr edx, 0x18
add ecx, edx
add ecx, eax
mov eax, 0xcccccccd
mul ecx
mov eax, dword [esp + 0x18]
and eax, 0xfffffffc
mov ebx, edx
and edx, 0x7ffffffc
shr ebx, 2
add edx, ebx
sub ecx, edx
mov edx, edi
add ecx, eax
mov eax, esi
mov ebx, ecx
sar ebx, 0x1f
sub eax, ecx
sbb edx, ebx
mov dword [esp + 0x18], eax
mov eax, 0xcccccccd
xor ebx, ebx
imul ecx, edx, 0xcccccccd
mov dword [esp + 0x1c], edx
imul edx, dword [esp + 0x18], 0xcccccccc
add ecx, edx
mul dword [esp + 0x18]
add edx, ecx
mov ecx, edx
shr ecx, 0x1f
add ecx, eax
adc ebx, edx
mov edx, esi
shrd ecx, ebx, 1
sar ebx, 1
mov eax, ecx
mov dword [esp + 0x18], ebx
lea ecx, [ecx + ecx*4]
lea ebx, [eax + eax*4]
add ecx, ecx
add ebx, ebx
sub esi, ebx
test esi, esi
jg 0x408958
mov esi, dword [esp + 0x20]
mov ebx, 0x30
mov edi, dword [esp + 0x28]
sub ebx, edx
add ebx, ecx
add esi, ebp
mov byte [edi + esi + 8], bl
mov edi, dword [esp + 0x18]
lea ebx, [ebp + 1]
or edi, eax
jne 0x40897a
mov eax, dword [esp + 0x24]
mov esi, dword [esp + 0x28]
mov edx, dword [esp + 0x2c]
mov ecx, dword [eax]
lea edi, [esi + ebx]
test edx, edx
jns 0x408aa8
mov ebx, ebp
mov byte [ecx + edi + 8], 0x2d
mov ecx, dword [eax]
add ebx, 2
lea edi, [esi + ebx]
mov esi, eax
mov edx, edi
call fcn.00408790
mov dword [esp], esi
mov ebp, eax
call fcn.00406db0
test al, al
je 0x408ac1
mov eax, dword [esp + 0x24]
sar ebx, 1
sub ebx, 1
mov dword [eax], ebp
jmp 0x408afe
mov edx, edi
call fcn.00408790
mov ebp, eax
mov eax, dword [esp + 0x24]
mov dword [esp], eax
call fcn.00406db0
test al, al
jne 0x408aef
test ebp, ebp
je 0x408ac9
add dword [ebp - 8], 8
mov eax, dword [esp + 0x24]
mov eax, dword [eax]
cmp eax, 0xfff
jbe 0x408aef
mov esi, dword [eax - 8]
lea ecx, [eax - 8]
mov dword [esp + 0x18], ecx
lea edx, [esi - 8]
mov dword [eax - 8], edx
cmp edx, 7
jbe 0x408b80
mov eax, dword [esp + 0x24]
mov dword [eax], ebp
mov eax, ebx
sar eax, 1
lea ebx, [eax - 1]
je 0x408b5a
mov esi, dword [esp + 0x28]
movzx ecx, byte [ebp + edi + 7]
movzx edx, byte [ebp + esi + 8]
mov byte [ebp + esi + 8], cl
lea eax, [esi + 1]
sub esi, 1
mov ecx, dword [esp + 0x24]
add esi, edi
mov ecx, dword [ecx]
mov byte [ecx + edi + 7], dl
lea ecx, [eax + ebx]
test ebx, ebx
je 0x408b5a
mov edi, dword [esp + 0x24]
mov ebp, ecx
nop
mov edx, dword [edi]
mov ebx, esi
sub ebx, eax
movzx ecx, byte [edx + eax + 8]
mov byte [esp + 0x18], cl
movzx ecx, byte [edx + ebx + 8]
mov byte [edx + eax + 8], cl
movzx ecx, byte [esp + 0x18]
add eax, 1
mov edx, dword [edi]
mov byte [edx + ebx + 8], cl
cmp eax, ebp
jne 0x408b30
add esp, 0x3c
pop ebx
pop esi
pop edi
pop ebp
ret 8
mov dword [esp + 0x28], 0
mov edx, 0x20
jmp 0x4088fa
mov esi, dword [0x49c308]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x20], eax
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
mov esi, eax
mov edx, dword [esp + 0x20]
add esi, 0x2c
mov dword [esp], edx
call dword [sym.imp.KERNEL32.dll_SetLastError]
sub esp, 4
mov ecx, dword [esp + 0x18]
mov dword [esp], esi
mov dword [esp + 4], ecx
call fcn.00405190
jmp 0x408aef
mov esi, dword [0x49c308]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebp, eax
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
mov esi, eax
mov dword [esp], ebp
add esi, 0x2c
call dword [sym.imp.KERNEL32.dll_SetLastError]
sub esp, 4
mov dword [esp + 4], edi
mov dword [esp], esi
call fcn.00405190
jmp 0x408940