Function at 0x513bc0
Capabilities:
Get thread local storage value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x170
push ebx
push esi
mov esi, dword [ebp + 8]
mov eax, dword [esi + 0xaa78]
push edi
mov edi, dword [eax + 0x38]
xor ecx, ecx
and edi, 0xfffff
cmp dword [ebp + 0xc], ecx
mov dword [ebp - 0x10], ecx
sete bl
mov dword [ebp - 0x48], ecx
mov byte [ebp - 5], cl
lea ecx, [ebp - 0x48]
lea edx, [ebp - 0xec]
mov dword [ebp - 0x44], 1
mov dword [ebp - 0x40], 2
push ebx
push edi
push ecx
push edx
lea ecx, [ebp - 0x10]
push ecx
lea edx, [ebp - 0x16c]
push edx
push 0x4293a0
push eax
mov ecx, esi
mov dword [ebp - 0x3c], 3
mov dword [ebp - 0xc], edi
call fcn.004e14d0
cmp dword [ebp - 0x10], 0x20
ja 0x513c38
test eax, eax
je 0x513c83
push ebx
push edi
lea eax, [ebp - 0x48]
push eax
lea ecx, [ebp - 0xec]
push ecx
mov ecx, dword [esi + 0xaa78]
lea edx, [ebp - 0x10]
push edx
lea eax, [ebp - 0x16c]
push eax
push 0x429490
push ecx
mov ecx, esi
mov byte [ebp - 5], 1
call fcn.004e14d0
cmp dword [ebp - 0x10], 0x20
jbe 0x513c7b
mov eax, 0x80004005
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14
test eax, eax
jne 0x5140bf
fld qword [0x4689e8]
lea edx, [ebp - 0xdc]
lea eax, [ebp - 0xcc]
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x1c], edx
mov dword [ebp - 0x24], eax
lea ecx, [ebp - 0xbc]
lea edx, [ebp - 0xac]
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x30], ecx
mov dword [ebp - 0x18], edx
xor ebx, ebx
test edi, edi
jbe 0x513dcd
mov eax, dword [ebp - 0x24]
mov ecx, dword [ebp - 0x18]
mov edx, dword [ebp - 0x30]
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x20], ecx
mov dword [ebp - 0x28], edx
mov dword [ebp - 0x34], eax
mov ecx, dword [ebp - 0x34]
mov ecx, dword [ecx]
mov edx, dword [ebp - 0x28]
mov esi, dword [ebp + ebx*4 - 0xec]
mov edi, dword [edx]
or eax, 0xffffffff
cmp dword [ecx + 0x24], eax
jne 0x513d7c
cmp dword [esi + 0x24], eax
jne 0x513d7c
cmp dword [edi + 0x24], eax
jne 0x513d7c
mov eax, dword [ecx + 0x10]
mov eax, dword [eax + 8]
and eax, 0x100
xor edx, edx
or eax, edx
je 0x513d79
mov eax, dword [edi + 0x10]
mov eax, dword [eax + 8]
and eax, 0x100
or eax, edx
je 0x513d79
mov eax, dword [esi + 0x10]
mov eax, dword [eax + 8]
and eax, 0x100
or eax, edx
je 0x513d79
fld qword [edi + 0xa8]
fsub qword [ecx + 0xa8]
fsub qword [esi + 0xa8]
fabs
fcomp st(1)
fnstsw ax
test ah, 0x41
je 0x513d79
mov eax, dword [ebp - 0x2c]
mov ecx, dword [eax]
mov edx, dword [ebp - 0x20]
cmp ecx, dword [edx]
jne 0x513d79
mov eax, 4
add dword [ebp - 0x34], eax
add dword [ebp - 0x28], eax
add dword [ebp - 0x20], eax
add dword [ebp - 0x2c], eax
add ebx, 1
cmp ebx, dword [ebp - 0xc]
jb 0x513cdd
or eax, 0xffffffff
mov edi, dword [ebp - 0xc]
cmp ebx, edi
je 0x513dd2
mov eax, dword [ebp - 0x38]
mov ecx, 0x10
sub dword [ebp - 0x18], ecx
add dword [ebp - 0x30], ecx
add eax, 1
cmp eax, 2
mov dword [ebp - 0x38], eax
jb 0x513cbb
mov eax, dword [ebp - 0x14]
sub dword [ebp - 0x24], ecx
add dword [ebp - 0x1c], ecx
add eax, 1
cmp eax, 2
mov dword [ebp - 0x14], eax
jb 0x513ca2
mov dword [ebp - 0xc], 1
fstp st(0)
mov eax, dword [ebp - 0xc]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14
or eax, 0xffffffff
jmp 0x513d7f
mov ecx, dword [0x776138]
fstp st(0)
test ecx, ecx
jge 0x513de2
xor ecx, ecx
jmp 0x513dee
push ecx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ecx, eax
or eax, 0xffffffff
cmp dword [ecx + 0x10], 0
je 0x513e15
mov edx, dword [ecx + 0x10]
test edx, edx
jne 0x513dff
mov esi, edx
jmp 0x513e26
mov esi, dword [edx]
test esi, esi
mov dword [ecx + 0x10], esi
jne 0x513e0b
mov dword [ecx + 0x14], esi
mov dword [edx], 0xfefefefe
mov esi, edx
jmp 0x513e26
mov ecx, dword [ecx + 0xc]
push 0x10
push 0x40
call fcn.007515ae
mov esi, eax
or eax, 0xffffffff
xor edx, edx
cmp esi, edx
je 0x513e75
cmp byte [ebp - 5], dl
mov ebx, esi
mov dword [esi], edx
mov dword [esi + 8], edx
mov dword [esi + 0x10], eax
mov dword [esi + 0x38], edx
mov dword [esi + 4], edx
mov word [esi + 0x3c], dx
mov dword [esi + 0xc], edx
mov word [esi + 0x3e], dx
mov dword [esi + 0x14], edx
mov dword [esi + 0x18], edx
mov dword [esi + 0x1c], edx
mov dword [esi + 0x20], eax
mov dword [esi + 0x24], edx
mov dword [esi + 0x30], edx
mov dword [esi + 0x34], edx
mov dword [ebp - 0x14], ebx
je 0x513e96
cmp dword [ebp + 0xc], edx
je 0x513e88
mov dword [ebp - 0xc], 1
jmp 0x513f78
mov dword [ebp - 0xc], 0x8007000e
mov eax, dword [ebp - 0xc]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14
mov eax, edi
and eax, 0xfffff
or eax, 0x70c00000
jmp 0x513ea2
mov eax, edi
and eax, 0xfffff
or eax, 0x70b00000
push edx
push esi
mov edx, edi
lea ecx, [edi + edi]
call fcn.004cc5e0
test eax, eax
mov dword [ebp - 0xc], eax
jl 0x513f76
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 0xaa78]
mov edx, dword [eax + 0x30]
mov dword [esi + 0x30], edx
mov eax, dword [eax + 0x34]
mov dword [esi + 0x34], eax
mov ecx, dword [ecx + 0xaa78]
mov edx, dword [ecx + 0xc]
mov eax, dword [esi + 0xc]
lea ebx, [edi*4]
push ebx
push edx
push eax
call sub.msvcrt.dll_memcpy
mov edx, dword [esi + 4]
add esp, 0xc
push ebx
lea ecx, [ebp - 0xec]
push ecx
push edx
call sub.msvcrt.dll_memcpy
add esp, 0xc
cmp byte [ebp - 5], 0
push ebx
je 0x513f1e
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0xaa78]
mov edx, dword [ecx + 4]
mov eax, dword [esi + 4]
add edx, ebx
push edx
add eax, ebx
push eax
jmp 0x513f34
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0xaa78]
mov eax, dword [edx + 4]
mov edx, dword [esi + 4]
lea ecx, [eax + edi*8]
push ecx
add edx, ebx
push edx
call sub.msvcrt.dll_memcpy
mov eax, dword [esi + 4]
mov edx, dword [eax]
mov ebx, dword [eax + ebx]
mov eax, dword [esi + 0xc]
mov ecx, dword [eax]
add esp, 0xc
cmp byte [ebp + 0x18], 0
je 0x513f97
mov eax, dword [ecx + 0x10]
cmp eax, dword [edx + 0x10]
jne 0x513f5f
mov edi, dword [ecx + 0x28]
cmp edi, dword [edx + 0x28]
je 0x513f6c
cmp eax, dword [ebx + 0x10]
jne 0x513f97
mov ecx, dword [ecx + 0x28]
cmp ecx, dword [ebx + 0x28]
jne 0x513f97
mov ebx, dword [ebp - 0x14]
mov dword [ebp - 0xc], 1
xor edx, edx
cmp ebx, edx
je 0x5140bc
cmp word [ebx + 0x3c], dx
je 0x514027
mov eax, dword [0x776138]
cmp eax, edx
jge 0x513fef
xor eax, eax
jmp 0x513ff8
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x513fd3
mov edx, dword [ebp - 0x10]
mov dword [eax], esi
xor ebx, ebx
xor eax, eax
test edx, edx
jbe 0x513fc5
mov ecx, dword [ebp + 0x10]
lea ecx, [ecx + edx*4 - 4]
mov esi, dword [ebp + eax*4 - 0x16c]
mov dword [ecx], esi
add eax, 1
sub ecx, 4
cmp eax, edx
jb 0x513fb2
mov eax, dword [ebp + 0x14]
mov dword [eax], edx
mov dword [ebp - 0xc], 0
jmp 0x513f76
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0xaa78]
push esi
push edx
call fcn.004ccff0
mov ebx, dword [ebp - 0x14]
mov dword [ebp - 0xc], 0
jmp 0x513f76
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
xor edx, edx
movzx ecx, word [ebx + 0x3c]
cmp ecx, dword [eax + 0x120]
ja 0x514020
mov esi, dword [ebx + 4]
mov eax, dword [eax + 0x11c]
shl ecx, 4
cmp esi, edx
lea eax, [ecx + eax - 0x10]
je 0x514020
mov ecx, dword [eax + 4]
mov dword [esi], ecx
mov dword [eax + 4], esi
mov word [ebx + 0x3c], dx
mov dword [ebx + 4], edx
cmp word [ebx + 0x3e], dx
je 0x514072
mov eax, dword [0x776138]
cmp eax, edx
jge 0x51403a
xor eax, eax
jmp 0x514043
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
xor edx, edx
movzx ecx, word [ebx + 0x3e]
cmp ecx, dword [eax + 0x120]
ja 0x51406b
mov esi, dword [ebx + 0xc]
mov eax, dword [eax + 0x11c]
shl ecx, 4
cmp esi, edx
lea eax, [ecx + eax - 0x10]
je 0x51406b
mov ecx, dword [eax + 4]
mov dword [esi], ecx
mov dword [eax + 4], esi
mov word [ebx + 0x3e], dx
mov dword [ebx + 0xc], edx
mov eax, dword [0x776138]
cmp eax, edx
jl 0x5140bc
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
test esi, esi
je 0x5140bc
push 0x40
push 0xfe
push ebx
call sub.msvcrt.dll_memset
mov dword [ebx], 0
mov eax, dword [esi + 0x14]
add esp, 0xc
test eax, eax
je 0x5140b6
mov dword [eax], ebx
mov eax, dword [ebp - 0xc]
mov dword [esi + 0x14], ebx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14
mov dword [esi + 0x10], ebx
mov dword [esi + 0x14], ebx
mov eax, dword [ebp - 0xc]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14