Function at 0x478f1b
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.0043c3b8
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 0x478f75
call dword [sym.imp.kernel32.dll_GetCurrentThreadId]
cmp eax, dword [0x4f2dd8]
jne 0x478f72
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 0x478f72
mov ecx, edi
call fcn.0047a17f
cmp eax, dword [ebp - 0x1c]
je 0x478f88
push 0x1c1449
call fcn.00486ea5
mov eax, dword [ebp - 0x10]
mov edi, dword [ebx + 8]
cmp eax, edi
je 0x478f90
push 0x1c139c
call fcn.00486ea5
jmp 0x478f90
mov eax, dword [edi + 0x2c]
jmp 0x478f75
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 0x478faf
test eax, eax
je 0x478faf
dec eax
shr ecx, 0xc
and ecx, 0x7f
sub eax, ecx
sub eax, 4
test eax, eax
jle 0x479065
cmp eax, 4
jbe 0x479060
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 0x478fed
cmp dword [ebp - 0x18], 0
jne 0x478fff
push edi
push 1
mov ecx, esi
call fcn.00479561
test al, al
jne 0x479132
mov esi, dword [esi + 4]
push dword [esi + 0x14]
call dword [sym.imp.kernel32.dll_TlsGetValue]
mov edi, eax
test edi, edi
jne 0x47904e
call dword [sym.imp.kernel32.dll_GetCurrentThreadId]
cmp eax, dword [0x4f2dd8]
jne 0x47904e
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 0x47904e
mov ecx, esi
call fcn.0047a17f
cmp eax, dword [ebp - 0x1c]
je 0x47904b
push 0x1c1449
call fcn.00486ea5
jmp 0x47904e
mov edi, dword [esi + 0x2c]
cmp edi, dword [ebx + 8]
je 0x47905d
push 0x1c139a
call fcn.00486ea5
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 0x479093
xor esi, esi
jmp 0x47909b
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 0x4791af
test edx, edx
jne 0x4791af
test byte [0x4f2e00], 0x20
je 0x4790dd
push dword [ebp - 0x10]
push ecx
push 0x42fb58
push dword [0x4f2e0c]
push dword [0x4f2e08]
call fcn.00486ea5
mov ecx, dword [ebp - 8]
test ecx, ecx
je 0x4790eb
push 0x1c13a3
call fcn.00486ea5
cmp esi, 0x102
je 0x4790fd
push 0x1c13c0
call fcn.00486ea5
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 0x47911f
cmp dword [ebp - 0x1c], 0
jne 0x47913f
push dword [ebx + 8]
mov esi, dword [ebp - 4]
push 1
mov ecx, esi
call fcn.00479561
test al, al
je 0x479142
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 0x479191
call dword [sym.imp.kernel32.dll_GetCurrentThreadId]
cmp eax, dword [0x4f2dd8]
jne 0x479191
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 0x479191
mov ecx, esi
call fcn.0047a17f
cmp eax, dword [ebp - 0x18]
je 0x47918e
push 0x1c1449
call fcn.00486ea5
jmp 0x479191
mov edi, dword [esi + 0x2c]
cmp edi, dword [ebx + 8]
mov esi, dword [ebp - 4]
mov edi, dword [ebx + 8]
je 0x478f90
push 0x1c139a
call fcn.00486ea5
jmp 0x478f90
test al, al
je 0x479284
test edx, edx
jne 0x4791cb
push 0x1c13c3
call fcn.00486ea5
mov ecx, dword [ebp - 8]
mov edx, dword [ebp - 0xc]
test byte [0x4f2e00], 0x10
je 0x4791f4
push dword [ebp - 0x10]
push ecx
push 0x42faf8
push dword [0x4f2e0c]
push dword [0x4f2e08]
call fcn.00486ea5
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.004789c1
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 0x479258
call dword [sym.imp.kernel32.dll_GetCurrentThreadId]
cmp eax, dword [0x4f2dd8]
jne 0x479255
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 0x479255
mov ecx, edi
call fcn.0047a17f
cmp eax, dword [ebp - 0x1c]
je 0x47927f
push 0x1c1449
call fcn.00486ea5
mov eax, dword [ebp - 0x14]
mov edi, dword [ebx + 8]
cmp eax, edi
je 0x479269
push 0x1c13c7
call fcn.00486ea5
mov eax, dword [ebp - 0x18]
cmp eax, 1
je 0x478f90
test eax, eax
je 0x479132
jmp 0x4792d2
mov eax, dword [edi + 0x2c]
jmp 0x479258
test byte [0x4f2e00], 0x10
je 0x4792ad
push dword [ebp - 0x10]
push ecx
push 0x42fb08
push dword [0x4f2e0c]
push dword [0x4f2e08]
call fcn.00486ea5
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.00478bfa
mov esi, eax
cmp esi, 1
je 0x478f8d
cmp esi, 2
jne 0x47936e
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.00486ea5
mov ecx, dword [ebp - 0x14]
test ecx, ecx
je 0x479361
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 0x479343
call dword [sym.imp.kernel32.dll_GetCurrentThreadId]
cmp eax, dword [0x4f2dd8]
jne 0x479343
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 0x479343
mov ecx, esi
call fcn.0047a17f
cmp eax, dword [ebp - 0x1c]
je 0x479340
push 0x1c1449
call fcn.00486ea5
jmp 0x479343
mov edi, dword [esi + 0x2c]
cmp edi, dword [ebx + 8]
je 0x479352
push 0x1c13d4
call fcn.00486ea5
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.00478e08
jmp 0x47926c
test esi, esi
je 0x479381
cmp esi, 3
je 0x479381
push 0x1c13ce
call fcn.00486ea5
pop edi
mov eax, esi
pop esi
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret 4