Function at 0x440240
Capabilities:
Get thread local storage value
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x114
mov eax, dword [0x4b1780]
xor eax, esp
mov dword [esp + 0x110], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
mov edi, ecx
mov dword [esp + 0xc], eax
mov eax, dword [ebp + 0xc]
lea esi, [edi + 0x1e4]
push dword [esi]
mov dword [esp + 0x2c], eax
mov eax, dword [ebp + 0x10]
mov dword [esp + 0x34], eax
mov eax, dword [ebp + 0x14]
mov dword [esp + 0x38], eax
mov dword [esp + 0x30], 0
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
test eax, eax
jne 0x4404e7
push esi
push dword [esi]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x4402ab
call fcn.0043ae90
lea ecx, [esp + 0x10]
call fcn.0042e910
mov ebx, dword [esp + 0x10]
sub ebx, dword [edi + 0x128]
mov eax, dword [esp + 0x14]
sbb eax, dword [edi + 0x12c]
mov dword [esp + 0x10], eax
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0xc]
mov dword [esp + 0x18], ebx
mov dword [esp + 0x100], 0xf
mov dword [esp + 0xfc], 0
test byte [eax], 1
mov byte [esp + 0xec], 0
je 0x44046b
push dword [esp + 0x34]
lea eax, [esp + 0x24]
mov dword [esp + 0x24], edi
push dword [esp + 0x34]
mov ecx, edi
mov byte [esp + 0x2c], 0
push eax
call fcn.00440a60
mov edx, eax
test edx, edx
je 0x440344
sub ebx, dword [edx]
mov eax, dword [esp + 0x10]
sbb eax, dword [edx + 4]
mov dword [edx + 0x14], eax
mov dword [edx + 0x10], ebx
mov ecx, dword [edx + 8]
mov eax, dword [edx + 0xc]
neg ecx
mov dword [edx + 0x18], ecx
adc eax, 0
neg eax
mov dword [edx + 0x1c], eax
mov eax, dword [edi + 0x16c]
test al, 8
je 0x4403d3
push edx
lea eax, [esp + 0x1c]
mov ecx, edi
push eax
push 0x45
lea eax, [esp + 0x110]
push eax
call fcn.0043fd60
mov ebx, eax
lea eax, [esp + 0xec]
cmp eax, ebx
je 0x4403ba
cmp dword [esp + 0x100], 0x10
jb 0x44038f
push dword [esp + 0xec]
call fcn.0048bc47
add esp, 4
push ebx
lea ecx, [esp + 0xf0]
mov dword [esp + 0x104], 0xf
mov dword [esp + 0x100], 0
mov byte [esp + 0xf0], 0
call fcn.00419a20
cmp dword [esp + 0x118], 0x10
jb 0x4403d3
push dword [esp + 0x104]
call fcn.0048bc47
add esp, 4
cmp byte [esp + 0x24], 0
je 0x4403e4
push dword [esp + 0x20]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp dword [esp + 0xfc], 0
je 0x44046b
cmp dword [0x4b7064], 2
jg 0x440459
mov ebx, 2
lea ecx, [esp + 0x40]
push 1
push ebx
mov dword [esp + 0x40], ebx
call fcn.0041f060
mov dword [esp + 0xdc], 0x413df0
mov dword [esp + 0xe0], 0x864
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x864
push 0x413df0
lea ecx, [esp + 0x40]
mov dword [esp + 0xec], eax
call fcn.0041ff70
lea eax, [esp + 0xec]
push eax
lea eax, [esp + 0x44]
push eax
call fcn.0041b5f0
add esp, 8
jmp 0x44045d
mov ebx, dword [esp + 0x2c]
test bl, 2
je 0x44046b
lea ecx, [esp + 0x38]
call fcn.0041fcf0
mov ebx, dword [esp + 0xc]
test byte [ebx], 4
je 0x44049d
mov eax, dword [edi + 0x40]
test eax, eax
je 0x44049d
push 0
push 0
push 0
push 0
push 0
push 0
push 0
push dword [esp + 0x44]
push ebx
push 0x45
push dword [esp + 0x44]
push dword [esp + 0x44]
call eax
add esp, 0x30
cmp dword [esp + 0x100], 0x10
jb 0x4404b6
push dword [esp + 0xec]
call fcn.0048bc47
add esp, 4
push 0
push dword [esi]
mov dword [esp + 0x108], 0xf
mov dword [esp + 0x104], 0
mov byte [esp + 0xf4], 0
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x4404e7
call fcn.0043ae90
mov ecx, dword [esp + 0x11c]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0048f991
mov esp, ebp
pop ebp
ret 0x10