Function at 0x51b880
Capabilities:
Get thread local storage value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
mov eax, dword [0x776138]
sub esp, 0x10
push ebx
push esi
mov esi, dword [ebp + 0xc]
xor ebx, ebx
cmp eax, ebx
push edi
jge 0x51b89d
xor eax, eax
jmp 0x51b8a4
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
cmp dword [eax + 0x10], ebx
je 0x51b8cc
mov ecx, dword [eax + 0x10]
cmp ecx, ebx
jne 0x51b8b6
xor ecx, ecx
mov edi, ecx
jmp 0x51b8da
mov edx, dword [ecx]
cmp edx, ebx
mov dword [eax + 0x10], edx
jne 0x51b8c2
mov dword [eax + 0x14], ebx
mov dword [ecx], 0xfefefefe
mov edi, ecx
jmp 0x51b8da
mov ecx, dword [eax + 0xc]
push 0x10
push 0x40
call fcn.007515ae
mov edi, eax
cmp edi, ebx
je 0x51b92c
mov edx, dword [ebp + 0x14]
or eax, 0xffffffff
mov dword [edi + 0x10], eax
mov dword [edi + 0x20], eax
xor ecx, ecx
xor eax, eax
cmp edx, ebx
mov dword [edi], ebx
mov dword [edi + 8], ebx
mov dword [edi + 0x38], ebx
mov dword [edi + 4], ebx
mov word [edi + 0x3c], bx
mov dword [edi + 0xc], ebx
mov word [edi + 0x3e], bx
mov dword [edi + 0x14], ebx
mov dword [edi + 0x18], ebx
mov dword [edi + 0x1c], ebx
mov dword [edi + 0x24], ebx
mov dword [edi + 0x30], ebx
mov dword [edi + 0x34], ebx
mov dword [ebp - 8], ecx
jbe 0x51b961
lea ecx, [ecx]
cmp byte [ebp + 0x18], 0
je 0x51b93a
cmp dword [esi + eax*4], 0xffffffff
jmp 0x51b950
mov eax, 0x8007000e
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14
mov ebx, dword [ebp + 8]
mov ebx, dword [ebx + 0xaa78]
mov ebx, dword [ebx + 0xc]
mov ebx, dword [ebx + eax*4]
mov ebx, dword [ebx + 0x2c]
cmp dword [esi + ebx*4], 0xffffffff
je 0x51b955
add ecx, 1
add eax, 1
cmp eax, edx
jb 0x51b920
mov dword [ebp - 8], ecx
xor ebx, ebx
cmp byte [ebp + 0x18], 0
mov edx, 1
jne 0x51b96e
mov edx, ecx
mov eax, dword [ebp + 8]
imul ecx, dword [ebp + 0x10]
mov eax, dword [eax + 0xaa78]
mov eax, dword [eax + 0x38]
and eax, 0xfff00000
or eax, dword [ebp - 8]
push ebx
push edi
call fcn.004cc5e0
mov ebx, eax
test ebx, ebx
jl 0x51baf5
cmp byte [ebp + 0x18], 0
mov ebx, dword [ebp + 8]
mov eax, dword [ebx + 0xaa78]
mov ecx, dword [eax + 0x30]
mov dword [edi + 0x30], ecx
mov edx, dword [eax + 0x34]
mov dword [edi + 0x34], edx
je 0x51b9bf
cmp dword [ebp - 8], 1
jne 0x51b9bf
mov dword [edi + 0x38], 0x20500001
xor ecx, ecx
cmp dword [ebp + 0x10], ecx
mov dword [ebp - 0xc], ecx
jbe 0x51ba86
xor eax, eax
cmp dword [ebp + 0x14], eax
mov dword [ebp - 4], eax
jbe 0x51ba77
jmp 0x51b9e0
cmp byte [ebp + 0x18], 0
je 0x51ba12
cmp dword [esi + eax*4], 0xffffffff
je 0x51ba68
mov esi, dword [ebx + 0xaa78]
mov esi, dword [esi + 4]
mov ebx, dword [edi + 4]
mov edx, ecx
imul ecx, dword [ebp - 8]
imul edx, dword [ebp + 0x14]
add edx, eax
add ecx, dword [ebp - 4]
mov edx, dword [esi + edx*4]
mov dword [ebx + ecx*4], edx
mov ecx, dword [ebp - 0xc]
jmp 0x51ba61
mov edx, dword [ebx + 0xaa78]
mov ebx, dword [edx + 0xc]
mov ebx, dword [ebx + eax*4]
mov ebx, dword [ebx + 0x2c]
cmp dword [esi + ebx*4], 0xffffffff
je 0x51ba68
mov edx, dword [edx + 4]
mov ebx, dword [edi + 4]
mov esi, ecx
imul ecx, dword [ebp - 8]
imul esi, dword [ebp + 0x14]
add ecx, dword [ebp - 4]
add esi, eax
mov edx, dword [edx + esi*4]
mov dword [ebx + ecx*4], edx
mov ecx, dword [ebp - 0xc]
test ecx, ecx
jne 0x51ba61
mov edx, dword [ebp + 8]
mov edx, dword [edx + 0xaa78]
mov edx, dword [edx + 0xc]
mov esi, dword [edi + 0xc]
mov edx, dword [edx + eax*4]
mov ebx, dword [ebp - 4]
mov dword [esi + ebx*4], edx
mov esi, dword [ebp + 0xc]
add dword [ebp - 4], 1
mov ebx, dword [ebp + 8]
add eax, 1
cmp eax, dword [ebp + 0x14]
jb 0x51b9e0
add ecx, 1
cmp ecx, dword [ebp + 0x10]
mov dword [ebp - 0xc], ecx
jb 0x51b9cd
cmp byte [ebp + 0x18], 0
je 0x51badb
mov eax, dword [ebx + 0xaa78]
fldz
mov ecx, dword [eax + 0xc]
mov eax, dword [ecx]
mov ecx, dword [ebx + 0x28fc]
mov edx, dword [ecx + 0x10]
sub esp, 8
lea esi, [edx + 1]
fstp qword [esp]
mov dword [ecx + 0x10], esi
mov ecx, dword [eax + 8]
mov eax, dword [eax + 0xc]
and eax, 0x1ff
push eax
and ecx, 0x80000000
push ecx
mov ecx, dword [ebx + 0x28fc]
push 0
push edx
mov edx, dword [edi + 0xc]
push ecx
push edx
push ebx
call fcn.004ca3c0
mov ebx, eax
test ebx, ebx
jl 0x51baf5
mov esi, dword [ebp + 8]
push edi
call fcn.004ca180
mov ebx, eax
test ebx, ebx
jl 0x51baf5
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14
xor ecx, ecx
cmp word [edi + 0x3c], cx
je 0x51bb42
mov eax, dword [0x776138]
cmp eax, ecx
jge 0x51bb0a
xor eax, eax
jmp 0x51bb11
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
movzx ecx, word [edi + 0x3c]
cmp ecx, dword [eax + 0x120]
ja 0x51bb39
mov edx, dword [edi + 4]
mov eax, dword [eax + 0x11c]
shl ecx, 4
test edx, edx
lea ecx, [ecx + eax - 0x10]
je 0x51bb39
mov eax, dword [ecx + 4]
mov dword [edx], eax
mov dword [ecx + 4], edx
xor ecx, ecx
mov word [edi + 0x3c], cx
mov dword [edi + 4], ecx
cmp word [edi + 0x3e], cx
je 0x51bb8d
mov eax, dword [0x776138]
cmp eax, ecx
jge 0x51bb55
xor eax, eax
jmp 0x51bb5c
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
movzx ecx, word [edi + 0x3e]
cmp ecx, dword [eax + 0x120]
ja 0x51bb84
mov edx, dword [edi + 0xc]
mov eax, dword [eax + 0x11c]
shl ecx, 4
test edx, edx
lea ecx, [ecx + eax - 0x10]
je 0x51bb84
mov eax, dword [ecx + 4]
mov dword [edx], eax
mov dword [ecx + 4], edx
xor ecx, ecx
mov word [edi + 0x3e], cx
mov dword [edi + 0xc], ecx
mov eax, dword [0x776138]
cmp eax, ecx
jl 0x51bbd6
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
test esi, esi
je 0x51bbd6
push 0x40
push 0xfe
push edi
call sub.msvcrt.dll_memset
mov dword [edi], 0
mov eax, dword [esi + 0x14]
add esp, 0xc
test eax, eax
je 0x51bbd0
mov dword [eax], edi
mov dword [esi + 0x14], edi
mov eax, ebx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14
mov dword [esi + 0x10], edi
mov dword [esi + 0x14], edi
pop edi
pop esi
mov eax, ebx
pop ebx
mov esp, ebp
pop ebp
ret 0x14