Function at 0x591633f1
Capabilities:
Get thread local storage value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x18
push esi
mov esi, dword [ebp + 0x10]
push edi
xor edi, edi
mov dword [esi], edi
mov ecx, dword [0x591d5028]
mov eax, dword [ecx]
mov dword [ebp - 4], 0x8004000a
call dword [eax + 0x38]
test eax, eax
jne 0x59171740
call fcn.5911df30
test eax, eax
jne 0x5917174a
cmp dword [ebp + 0xc], edi
jne 0x59163441
cmp dword [0x591e8d58], edi
je 0x59163441
push 0x591e8d40
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push ebx
mov ebx, dword [ebp + 8]
mov eax, dword [ebx + 4]
cmp eax, edi
je 0x5916357b
cmp dword [0x591e8f1c], edi
jne 0x5917176b
xor ecx, ecx
cmp eax, 1
je 0x5917178b
add eax, 0xfffffffe
cmp eax, 1
ja 0x5917179a
cmp dword [0x591e8d3c], edi
je 0x5917177f
cmp dword [ebp + 0xc], edi
jne 0x59163494
call fcn.59162c19
cmp eax, edi
mov dword [ebp - 4], eax
jl 0x59171844
mov eax, dword [ebx + 4]
cmp eax, 2
mov dword [ebp - 0xc], edi
mov dword [ebp - 0x14], edi
mov dword [ebp - 8], edi
jne 0x591634ae
cmp dword [ebx + 0x10], edi
jne 0x5917179a
xor ecx, ecx
dec eax
inc ecx
cmp ecx, eax
mov eax, dword [ebx + 0xc]
sbb esi, esi
neg esi
sub eax, edi
jne 0x591717a6
push 0x1000
call dword [sym.imp.USER32.dll_GetSystemMetrics]
mov ebx, eax
neg ebx
sbb ebx, ebx
inc ebx
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x10]
test eax, eax
jne 0x591717b5
lea eax, [ebp - 0xc]
push eax
push ebx
push esi
push 0
call fcn.59163783
test eax, eax
jl 0x59171816
lea eax, [ebp - 8]
push eax
push dword [ebp + 0xc]
call fcn.591635d2
test eax, eax
mov dword [ebp - 4], eax
jl 0x5917181d
cmp dword [ebp + 0xc], 0
je 0x59163566
mov eax, dword [ebp - 8]
mov dword [0x591e8f0c], eax
test edi, edi
jne 0x5916358c
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0xc]
push dword [ebp + 8]
call fcn.59163324
test eax, eax
mov dword [ebp - 4], eax
jl 0x5917181d
mov edi, dword [ebp - 0x14]
cmp dword [ebp + 0xc], 0
jne 0x59163558
cmp dword [0x591e8d58], 0
je 0x59163558
push 0x591e8d40
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [ebp + 0x10]
mov dword [eax], edi
xor eax, eax
pop ebx
pop edi
pop esi
leave
ret 0xc
push dword [ebp - 8]
mov ecx, 0x591e8f1c
call fcn.59121db4
inc dword [0x591e8f10]
jmp 0x5916351d
cmp dword [0x591e8d3c], edi
jne 0x5916347f
jmp 0x59163494
mov ecx, edi
call fcn.59194d2e
jmp 0x5916353e
mov eax, 0x80070057
jmp 0x59163560
push dword [0x591d4f7c]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
inc dword [eax + 0x11a4]
mov eax, dword [eax + 0x1194]
mov dword [esi], eax
xor eax, eax
jmp 0x59163560
cmp dword [0x591e8f0c], edi
jne 0x5916345c
xor ecx, ecx
inc ecx
jmp 0x5916345e
mov dword [ebp - 4], 0x80040020
jmp 0x5917183f
cmp ecx, edi
jne 0x5917177f
mov dword [0x591e8d3c], edi
jmp 0x5916357b
mov dword [ebp - 4], 0x80070057
jmp 0x5917183f
xor ebx, ebx
dec eax
jne 0x591634d5
inc ebx
jmp 0x591634d5
push eax
call fcn.59194836
mov edi, eax
test edi, edi
jne 0x591717ca
mov dword [ebp - 4], 0x80070057
jmp 0x5917181d
and dword [ebp - 0x10], 0
mov ecx, edi
call fcn.5911de5d
cmp dword [edi + 0x38], 2
jne 0x591717eb
mov dword [ebp - 4], 0x80070057
mov dword [ebp - 0x10], 1
jmp 0x59171803
xor ecx, ecx
lea eax, [edi + 4]
inc ecx
lock xadd dword [eax], ecx
lea eax, [ebp - 0x18]
push eax
push ebx
push esi
push dword [edi + 0x28]
call fcn.59163783
mov ecx, edi
call fcn.5919485a
cmp dword [ebp - 0x10], 0
je 0x591634f8
jmp 0x5917181d
mov dword [ebp - 4], 0x8007000e
cmp dword [ebp - 8], 0
je 0x5917182f
push dword [ebp - 8]
call fcn.5916889f
and dword [ebp - 8], 0
cmp dword [ebp - 0xc], 0
je 0x5917183d
push dword [ebp - 0xc]
call fcn.591673ed
xor edi, edi
cmp dword [ebp + 0xc], edi
jne 0x59171857
cmp dword [0x591e8d58], edi
je 0x59171857
push 0x591e8d40
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [ebp - 4]
jmp 0x5916355f