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

Disassembly:
push ebx
mov ebx, esp
sub esp, 8
and esp, 0xfffffff8
add esp, 4
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
sub esp, 0x20
push esi
mov esi, ecx
push edi
mov dword [ebp - 4], esi
call fcn.1005402f
mov edi, dword [esi + 4]
push dword [edi + 0x14]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov dword [ebp - 0x10], eax
test eax, eax
jne 0x1005583d
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp eax, dword [0x100a5dd4]
jne 0x1005583a
mov eax, dword [edi + 0x2c]
push eax
push dword [edi + 0x14]
mov dword [ebp - 0x1c], eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
je 0x1005583a
mov ecx, edi
call fcn.10056a47
cmp eax, dword [ebp - 0x1c]
je 0x10055850
push 0x1c1449
call fcn.10042c89
mov eax, dword [ebp - 0x10]
mov edi, dword [ebx + 8]
cmp eax, edi
je 0x10055858
push 0x1c139c
call fcn.10042c89
jmp 0x10055858
mov eax, dword [edi + 0x2c]
jmp 0x1005583d
mov esi, dword [ebp - 4]
mov ecx, dword [esi + 8]
mov eax, dword [esi + 0xc]
mov dword [ebp - 0x1c], eax
mov eax, ecx
shr eax, 0x13
or edx, 0xffffffff
and eax, 0x7ff
test ecx, ecx
jns 0x10055877
test eax, eax
je 0x10055877
dec eax
shr ecx, 0xc
and ecx, 0x7f
sub eax, ecx
sub eax, 4
test eax, eax
jle 0x1005592d
cmp eax, 4
jbe 0x10055928
lea eax, [ebp - 0x18]
push eax
mov dword [ebp - 0x18], 0
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
push eax
call dword [sym.imp.KERNEL32.dll_GetThreadIOPendingFlag]
test eax, eax
je 0x100558b5
cmp dword [ebp - 0x18], 0
jne 0x100558c7
push edi
push 1
mov ecx, esi
call fcn.10055e29
test al, al
jne 0x100559fa
mov esi, dword [esi + 4]
push dword [esi + 0x14]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edi, eax
test edi, edi
jne 0x10055916
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp eax, dword [0x100a5dd4]
jne 0x10055916
mov eax, dword [esi + 0x2c]
push eax
push dword [esi + 0x14]
mov dword [ebp - 0x1c], eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
je 0x10055916
mov ecx, esi
call fcn.10056a47
cmp eax, dword [ebp - 0x1c]
je 0x10055913
push 0x1c1449
call fcn.10042c89
jmp 0x10055916
mov edi, dword [esi + 0x2c]
cmp edi, dword [ebx + 8]
je 0x10055925
push 0x1c139a
call fcn.10042c89
mov esi, dword [ebp - 4]
mov edx, 0x1770
push edx
lea eax, [ebp - 0xc]
push eax
lea eax, [ebp - 8]
push eax
lea eax, [ebp - 0x10]
push eax
push dword [esi + 0x50]
mov dword [ebp - 8], 0
mov dword [ebp - 0xc], 0
call dword [sym.imp.KERNEL32.dll_GetQueuedCompletionStatus]
mov edi, eax
test edi, edi
je 0x1005595b
xor esi, esi
jmp 0x10055963
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov ecx, dword [ebp - 8]
mov edx, dword [ebp - 0xc]
cmp ecx, 4
setae al
test edi, edi
jne 0x10055a77
test edx, edx
jne 0x10055a77
test byte [0x100a5dc0], 0x20
je 0x100559a5
push dword [ebp - 0x10]
push ecx
push 0x1001d1a0
push dword [0x100a5dcc]
push dword [0x100a5dc8]
call fcn.100571d9
mov ecx, dword [ebp - 8]
test ecx, ecx
je 0x100559b3
push 0x1c13a3
call fcn.10042c89
cmp esi, 0x102
je 0x100559c5
push 0x1c13c0
call fcn.10042c89
lea eax, [ebp - 0x1c]
push eax
mov dword [ebp - 0x1c], 0
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
push eax
call dword [sym.imp.KERNEL32.dll_GetThreadIOPendingFlag]
test eax, eax
je 0x100559e7
cmp dword [ebp - 0x1c], 0
jne 0x10055a07
push dword [ebx + 8]
mov esi, dword [ebp - 4]
push 1
mov ecx, esi
call fcn.10055e29
test al, al
je 0x10055a0a
xor eax, eax
pop edi
pop esi
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret 4
mov esi, dword [ebp - 4]
mov esi, dword [esi + 4]
push dword [esi + 0x14]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edi, eax
test edi, edi
jne 0x10055a59
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp eax, dword [0x100a5dd4]
jne 0x10055a59
mov eax, dword [esi + 0x2c]
push eax
push dword [esi + 0x14]
mov dword [ebp - 0x18], eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
je 0x10055a59
mov ecx, esi
call fcn.10056a47
cmp eax, dword [ebp - 0x18]
je 0x10055a56
push 0x1c1449
call fcn.10042c89
jmp 0x10055a59
mov edi, dword [esi + 0x2c]
cmp edi, dword [ebx + 8]
mov esi, dword [ebp - 4]
mov edi, dword [ebx + 8]
je 0x10055858
push 0x1c139a
call fcn.10042c89
jmp 0x10055858
test al, al
je 0x10055b4c
test edx, edx
jne 0x10055a93
push 0x1c13c3
call fcn.10042c89
mov ecx, dword [ebp - 8]
mov edx, dword [ebp - 0xc]
test byte [0x100a5dc0], 0x10
je 0x10055abc
push dword [ebp - 0x10]
push ecx
push 0x1001d140
push dword [0x100a5dcc]
push dword [0x100a5dc8]
call fcn.100571d9
mov ecx, dword [ebp - 8]
mov edx, dword [ebp - 0xc]
push dword [ebx + 8]
push esi
push dword [ebp - 0x10]
mov esi, dword [ebp - 4]
push ecx
push edx
mov ecx, esi
call fcn.10055289
mov edi, dword [esi + 4]
push dword [edi + 0x14]
mov dword [ebp - 0x18], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov dword [ebp - 0x14], eax
test eax, eax
jne 0x10055b20
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp eax, dword [0x100a5dd4]
jne 0x10055b1d
mov eax, dword [edi + 0x2c]
push eax
push dword [edi + 0x14]
mov dword [ebp - 0x1c], eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
je 0x10055b1d
mov ecx, edi
call fcn.10056a47
cmp eax, dword [ebp - 0x1c]
je 0x10055b47
push 0x1c1449
call fcn.10042c89
mov eax, dword [ebp - 0x14]
mov edi, dword [ebx + 8]
cmp eax, edi
je 0x10055b31
push 0x1c13c7
call fcn.10042c89
mov eax, dword [ebp - 0x18]
cmp eax, 1
je 0x10055858
test eax, eax
je 0x100559fa
jmp 0x10055b9a
mov eax, dword [edi + 0x2c]
jmp 0x10055b20
test byte [0x100a5dc0], 0x10
je 0x10055b75
push dword [ebp - 0x10]
push ecx
push 0x1001d150
push dword [0x100a5dcc]
push dword [0x100a5dc8]
call fcn.100571d9
mov ecx, dword [ebp - 8]
mov edx, dword [ebp - 0xc]
mov edi, dword [ebx + 8]
push edi
push ecx
mov ecx, dword [ebp - 4]
push edx
call fcn.100554c2
mov esi, eax
cmp esi, 1
je 0x10055855
cmp esi, 2
jne 0x10055c36
mov esi, dword [ebp - 4]
lea ecx, [ebp - 0x14]
lea eax, [esi + 0x58]
push ecx
mov ecx, eax
mov dword [ebp - 0x14], 0
call fcn.1005983b
mov ecx, dword [ebp - 0x14]
test ecx, ecx
je 0x10055c29
mov eax, dword [ecx]
push edi
call dword [eax + 0x78]
mov esi, dword [esi + 4]
push dword [esi + 0x14]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edi, eax
test edi, edi
jne 0x10055c0b
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp eax, dword [0x100a5dd4]
jne 0x10055c0b
mov eax, dword [esi + 0x2c]
push eax
push dword [esi + 0x14]
mov dword [ebp - 0x1c], eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
je 0x10055c0b
mov ecx, esi
call fcn.10056a47
cmp eax, dword [ebp - 0x1c]
je 0x10055c08
push 0x1c1449
call fcn.10042c89
jmp 0x10055c0b
mov edi, dword [esi + 0x2c]
cmp edi, dword [ebx + 8]
je 0x10055c1a
push 0x1c13d4
call fcn.10042c89
mov eax, dword [ebp - 0x14]
mov ecx, dword [eax]
push eax
call dword [ecx + 8]
mov esi, dword [ebp - 4]
mov edi, dword [ebx + 8]
push edi
mov ecx, esi
call fcn.100556d0
jmp 0x10055b34
test esi, esi
je 0x10055c49
cmp esi, 3
je 0x10055c49
push 0x1c13ce
call fcn.10042c89
pop edi
mov eax, esi
pop esi
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret 4