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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x9c
push ebx
push esi
push edi
mov esi, ecx
xor ebx, ebx
lea edi, [esp + 0x28]
mov dword [esp + 0xc], esi
mov dword [esp + 0x18], ebx
call fcn.004100c0
push esi
mov dword [esp + 0x24], ebx
mov dword [esp + 0x28], ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [ebp + 0xc]
cmp byte [eax], bl
jne 0x4154cd
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x34
mov ecx, dword [esi + 0x3c]
sub ecx, dword [esi + 0x38]
lea ebx, [esi + 0x2c]
sar ecx, 6
cmp ecx, 0x7a120
jae 0x4154ba
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edx, dword [0x5f5838]
push edx
mov dword [esp + 0x1c], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edi, eax
mov dword [esp + 0x1c], edi
call fcn.00415fe0
mov eax, dword [eax]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
cmp edi, eax
je 0x415696
test edi, edi
je 0x415696
cmp byte [edi], 0
je 0x415696
call fcn.00415fe0
mov ecx, dword [eax]
push edi
push ecx
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x41553d
call fcn.0041e7e0
lea edx, [esp + 0x18]
push edx
lea ecx, [esp + 0x34]
lea eax, [esi + 0x9c]
push ecx
push eax
call fcn.00415e60
mov edx, dword [esi + 0xb8]
mov eax, dword [esi + 0xa4]
lea esi, [esp + 0x10]
lea edi, [esp + 0x30]
mov dword [esp + 0x14], edx
mov dword [esp + 0x10], eax
call fcn.00415c10
test al, al
je 0x4155a0
mov ecx, dword [esp + 0x1c]
mov eax, dword [esp + 0xc]
push ecx
push ecx
lea edx, [esp + 0x20]
push edx
add eax, 0x9c
call fcn.00415a00
add esp, 4
mov ecx, eax
call fcn.004158f0
jmp 0x415692
lea esi, [esp + 0x40]
call fcn.00415c30
push 0x56d850
lea ecx, [esp + 0x14]
call fcn.004021d0
lea esi, [esp + 0x30]
call fcn.00415be0
add eax, 4
push eax
lea ecx, [esp + 0x3c]
call fcn.0040aac0
lea eax, [esp + 0x40]
push eax
lea ecx, [esp + 0x14]
push ecx
lea edx, [esp + 0x40]
push edx
call fcn.00404410
add esp, 0xc
lea esi, [esp + 0x38]
lea edi, [esp + 0x40]
call fcn.00406c60
mov ecx, dword [eax]
mov edx, dword [eax + 4]
lea esi, [esp + 0x58]
mov dword [esp + 0x10], ecx
mov dword [esp + 0x14], edx
call fcn.00406c40
mov esi, dword [eax]
mov ecx, dword [eax + 4]
mov eax, dword [esp + 0x14]
push eax
lea eax, [esp + 0x20]
call fcn.00416af0
mov dword [esp + 0x14], esi
add esp, 4
lea esi, [esp + 0x60]
mov dword [esp + 0x14], eax
call fcn.00406c60
mov esi, eax
lea edi, [esp + 0x10]
call fcn.004089c0
test al, al
jne 0x415666
push 0x2c
lea esi, [esp + 0x34]
call fcn.00415be0
mov ecx, eax
add ecx, 4
call fcn.00405220
mov ecx, dword [esp + 0x1c]
push ecx
call fcn.00415be0
mov ecx, eax
add ecx, 4
call fcn.00410890
mov eax, dword [esp + 0x4c]
xor esi, esi
cmp eax, esi
je 0x415679
push eax
call fcn.00455c1a
add esp, 4
mov edx, dword [esp + 0x40]
push edx
mov dword [esp + 0x50], esi
mov dword [esp + 0x54], esi
mov dword [esp + 0x58], esi
call fcn.00455c1a
add esp, 4
mov esi, dword [esp + 0xc]
mov edi, dword [ebp + 0x2c]
cmp edi, 0xffffffff
jle 0x415736
mov eax, dword [ebx + 0x10]
sub eax, dword [ebx + 0xc]
sar eax, 6
cmp edi, eax
jb 0x4156cb
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea eax, [esp + 0x20]
call fcn.0040f6f0
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x34
mov ecx, dword [ebx + 0x10]
sub ecx, dword [ebx + 0xc]
sar ecx, 6
cmp edi, ecx
jb 0x4156dd
call fcn.004560b9
mov edx, dword [esp + 0x28]
mov eax, edi
shl eax, 6
add eax, dword [ebx + 0xc]
mov ecx, dword [eax]
mov eax, dword [eax + 4]
sub edx, ecx
mov ecx, dword [esp + 0x2c]
sbb ecx, eax
cmp ecx, dword [ebp + 0x34]
jg 0x415736
jl 0x415702
cmp edx, dword [ebp + 0x30]
jae 0x415736
lea edx, [esp + 0x60]
push edx
lea esi, [esp + 0x5c]
mov edi, ebx
call fcn.00406c40
mov ecx, dword [ebp + 0x2c]
call fcn.00415c60
mov ecx, dword [eax + 4]
mov edx, dword [eax]
push ecx
push edx
lea edi, [esp + 0x40]
mov esi, ebx
call fcn.00415990
mov eax, dword [esp + 0xc]
push eax
jmp 0x4156b0
mov eax, dword [ebp + 0x38]
test al, 4
je 0x41574f
mov ecx, dword [esi + 0xe8]
mov edx, dword [esi + 0xec]
xor dword [ebp + 0x14], ecx
xor dword [ebp + 0x18], edx
mov ecx, dword [ebp + 0x24]
mov edx, dword [ebp + 0x20]
push eax
mov eax, dword [ebp + 0x28]
push eax
mov eax, dword [ebp + 0x1c]
mov esi, dword [ebx + 0x10]
push ecx
mov ecx, dword [ebp + 0x18]
sub esi, dword [ebx + 0xc]
push edx
mov edx, dword [ebp + 0x14]
push eax
mov eax, dword [ebp + 0x10]
push ecx
mov ecx, dword [ebp + 0xc]
push edx
mov edx, dword [ebp + 8]
push eax
mov eax, dword [esp + 0x4c]
push ecx
mov ecx, dword [esp + 0x4c]
push edx
mov edx, dword [esp + 0x40]
push eax
push ecx
push edx
lea eax, [esp + 0x9c]
push eax
sar esi, 6
call fcn.00414b80
push ebx
call fcn.00415920
lea eax, [esp + 0x68]
call fcn.00414f90
mov ecx, dword [ebx + 0x10]
sub ecx, dword [ebx + 0xc]
and ecx, 0xffffffc0
cmp ecx, 0x1e84800
jne 0x4157ca
mov edx, dword [esp + 0xc]
add edx, 0x24
push edx
lea edi, [esp + 0x24]
call fcn.00414fc0
mov eax, dword [esp + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov edi, dword [esp + 0x20]
test edi, edi
je 0x415809
push edi
call dword [esp + 0x28]
add esp, 4
push 0xffffffffffffffff
add edi, 4
push edi
call dword [sym.imp.KERNEL32.dll_InterlockedExchangeAdd]
sub eax, 1
jne 0x415809
test edi, edi
je 0x415809
lea ecx, [edi - 4]
test ecx, ecx
je 0x415809
mov edx, dword [ecx]
mov eax, dword [edx]
push 1
call eax
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x34