Function at 0x4a59b0
Capabilities:
Get thread local storage value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x50
push ebx
mov eax, dword [ebp + 8]
push eax
call fcn.004a5370
pop ecx
test eax, eax
je 0x4a5c71
mov eax, dword [ebp + 8]
mov eax, dword [eax + 8]
mov dword [ebp - 0x3c], eax
lea eax, [ebp - 0x3c]
push eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x10]
push eax
call fcn.004a5750
add esp, 8
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x2c], 1
mov word [ebp - 0x10], 0x3f
mov dword [ebp - 0x28], 1
mov dword [ebp - 4], 0
movzx eax, byte [ebp + 0x10]
and eax, 0x40
je 0x4a5a14
mov ebx, dword [0x7bf1f4]
jmp 0x4a5a1a
movzx eax, byte [ebp + 0x10]
mov ebx, eax
mov dword [ebp - 0x20], ebx
movzx eax, byte [ebp + 0xc]
test eax, eax
je 0x4a5a36
or dword [ebp - 0x2c], 0x20
movzx eax, byte [ebp + 0xc]
cmp eax, 0x2c
jne 0x4a5a36
or dword [ebp - 0x2c], 0x10
mov eax, dword [ebp - 0x44]
push eax
call fcn.004a9b80
pop ecx
mov dword [ebp - 0x40], eax
mov eax, dword [ebp - 0x44]
mov edx, dword [ebp + 8]
mov edx, dword [edx + 0x10]
cmp eax, edx
je 0x4a5a5a
mov eax, dword [ebp - 0x44]
push eax
call fcn.0049b640
pop ecx
mov eax, dword [ebp - 0x3c]
push eax
mov eax, dword [ebp - 0x40]
push eax
lea eax, [ebp - 0x38]
push eax
call fcn.004a5280
add esp, 0xc
mov dword [ebp - 0x48], eax
cmp dword [ebp - 0x48], 0
jne 0x4a5a7f
mov eax, dword [ebp - 0x28]
and eax, 1
jne 0x4a5a91
mov eax, dword [ebp - 0x40]
push eax
lea eax, [ebp - 0x38]
push eax
call fcn.004a5550
add esp, 8
jmp 0x4a5ad1
cmp byte [ebp + 0xc], 0
je 0x4a5ad1
mov eax, dword [0x7d8230]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
cmp dword [eax + 0x13e4], 0x40
je 0x4a5ac1
mov eax, dword [0x7d8230]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
cmp dword [eax + 0x15e8], 0x40
jl 0x4a5ad1
mov eax, dword [ebp - 0x40]
push eax
lea eax, [ebp - 0x38]
push eax
call fcn.004a5550
add esp, 8
mov eax, dword [ebp - 0x40]
push eax
call fcn.0049b640
pop ecx
mov eax, dword [0x7d8230]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov eax, dword [eax + 4]
mov eax, dword [eax - 4]
mov eax, dword [eax]
and eax, 0xf405
je 0x4a5b11
mov eax, dword [0x7d8230]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov eax, dword [eax + 4]
mov eax, dword [eax - 4]
push eax
call fcn.004a45e0
pop ecx
jmp 0x4a5b29
mov eax, dword [0x7d8230]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov eax, dword [eax + 4]
mov eax, dword [eax - 4]
mov dword [eax], 0
mov eax, dword [0x7d8230]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
lea eax, [eax + 4]
mov edx, dword [eax]
lea edx, [edx - 4]
mov dword [ebp - 0x4c], edx
mov dword [eax], edx
mov eax, dword [0x7d8230]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edx, dword [ebp - 0x4c]
mov eax, dword [eax]
cmp edx, eax
jae 0x4a5b6a
push 0
push 0
push 0
push 0x233b
call fcn.00492ef0
add esp, 0x10
cmp dword [ebp - 0x48], 0
jne 0x4a5c71
mov eax, dword [ebp - 0x28]
and eax, 1
je 0x4a5c71
lea eax, [ebp - 0x38]
push eax
call fcn.004a5500
pop ecx
movzx eax, byte [ebp + 0xc]
test eax, eax
je 0x4a5c71
cmp dword [ebp - 4], 0
jle 0x4a5c71
movzx eax, byte [ebp + 0xc]
cmp eax, 0x29
jne 0x4a5c10
mov eax, dword [0x7d8230]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov dword [ebp - 0x4c], eax
mov edx, dword [0x7d8230]
push edx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edx, dword [ebp - 0x4c]
mov edx, dword [edx + 0x13e4]
mov ecx, dword [ebp - 4]
mov dword [eax + edx*4 + 0x12e4], ecx
mov eax, dword [0x7d8230]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
lea eax, [eax + 0x13e4]
mov edx, dword [eax]
mov dword [ebp - 0x50], edx
lea ecx, [edx + 1]
mov dword [eax], ecx
mov eax, dword [0x7d8230]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edx, dword [ebp - 0x50]
mov dword [eax + edx*4 + 0x13e8], 0
jmp 0x4a5c71
movzx eax, byte [ebp + 0xc]
cmp eax, 0x2a
jne 0x4a5c53
mov eax, dword [0x7d8230]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov dword [ebp - 0x4c], eax
mov edx, dword [0x7d8230]
push edx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edx, dword [ebp - 0x4c]
mov edx, dword [edx + 0x15e8]
lea edx, [edx*4 - 4]
lea eax, [eax + edx + 0x14e8]
mov edx, dword [ebp - 4]
add dword [eax], edx
jmp 0x4a5c71
movzx eax, byte [ebp + 0xc]
cmp eax, 0x2b
jne 0x4a5c71
mov eax, dword [0x7d8230]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edx, dword [ebp - 4]
mov dword [eax + 0x15f0], edx
pop ebx
mov esp, ebp
pop ebp
ret