Function at 0x4be30f8f
Capabilities:
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffcc
push ebx
push esi
push edi
mov ebx, dword [ebp + 0xc]
mov eax, 0x4be573d0
call fcn.4be44284
mov word [ebp - 0x22], 0
xor edx, edx
mov dword [ebp - 0x28], edx
mov byte [ebp - 0x29], 0
mov word [ebp - 0x2c], 0
xor ecx, ecx
mov dword [ebp - 0x34], ecx
push 0
push 0
call sym.idapi32.dll_SysLock
mov dword [ebp - 0x34], 1
mov word [ebp - 0x10], 8
mov eax, dword [0x4be56de0]
push dword [eax + 0x606]
push 1
mov edx, dword [0x4be56de0]
mov cx, word [edx + 0x60a]
push ecx
call fcn.4be2fd6e
mov word [ebp - 0x2c], ax
cmp word [ebp - 0x2c], 0
jne 0x4be310c9
mov eax, dword [0x4be56de0]
movzx edx, word [eax + 0x60a]
add edx, 0x20
cmp edx, 0x3000
jle 0x4be3102c
mov word [ebp - 0x22], 0x2510
mov word [ebp - 0x10], 0
jmp 0x4be3146d
mov ecx, dword [0x4be56de0]
add word [ecx + 0x60a], 0x20
mov eax, dword [0x4be56de0]
movzx edx, word [eax + 0x60a]
push edx
mov ecx, dword [0x4be56de0]
push dword [ecx + 0x606]
call sym.idapi32.dll__OsReallocShared
add esp, 8
mov edx, dword [0x4be56de0]
mov dword [edx + 0x606], eax
test eax, eax
jne 0x4be3107c
mov word [ebp - 0x22], 0x2501
mov word [ebp - 0x10], 0
jmp 0x4be3146d
push 0x20
push 0
mov ecx, dword [0x4be56de0]
movzx eax, word [ecx + 0x60a]
mov edx, dword [0x4be56de0]
add eax, dword [edx + 0x606]
add eax, 0xffffffe0
push eax
call fcn.4be41c34
add esp, 0xc
mov ecx, dword [0x4be56de0]
push dword [ecx + 0x606]
push 1
mov eax, dword [0x4be56de0]
mov dx, word [eax + 0x60a]
push edx
call fcn.4be2fd6e
mov word [ebp - 0x2c], ax
mov ecx, dword [ebp + 8]
push dword [ecx + 0x37]
push 4
mov eax, dword [ebp + 8]
mov dx, word [eax + 0x214]
push edx
call fcn.4be2fd28
mov byte [ebp - 0x29], al
cmp byte [ebp - 0x29], 0
jne 0x4be31198
mov ecx, dword [ebp + 8]
movzx eax, word [ecx + 0x214]
add eax, 0x20
cmp eax, 0x100
jle 0x4be31113
mov word [ebp - 0x22], 0x2510
mov word [ebp - 0x10], 0
jmp 0x4be3146d
mov edx, dword [ebp + 8]
add word [edx + 0x214], 0x20
mov ecx, dword [ebp + 8]
movzx eax, word [ecx + 0x214]
shl eax, 2
push eax
mov edx, dword [ebp + 8]
push dword [edx + 0x37]
call sym.idapi32.dll__OsReallocShared
add esp, 8
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x37], eax
test eax, eax
jne 0x4be31155
mov word [ebp - 0x22], 0x2501
mov word [ebp - 0x10], 0
jmp 0x4be3146d
push 0x80
push 0
mov edx, dword [ebp + 8]
mov ecx, dword [edx + 0x37]
mov eax, dword [ebp + 8]
movzx edx, word [eax + 0x214]
add edx, 0xffffffe0
shl edx, 2
add ecx, edx
push ecx
call fcn.4be41c34
add esp, 0xc
mov ecx, dword [ebp + 8]
push dword [ecx + 0x37]
push 4
mov eax, dword [ebp + 8]
mov dx, word [eax + 0x214]
push edx
call fcn.4be2fd28
mov byte [ebp - 0x29], al
push 0xa96
push 1
call sym.idapi32.dll__OsCallocShared
add esp, 8
mov dword [ebp - 0x28], eax
test eax, eax
jne 0x4be311bf
mov word [ebp - 0x22], 0x2501
mov word [ebp - 0x10], 0
jmp 0x4be3146d
mov edx, dword [ebp - 0x28]
mov ecx, dword [ebp - 0x28]
mov dword [ecx + 4], edx
mov eax, dword [ebp - 0x28]
mov dword [eax + 8], 2
push 0x320
push 1
call sym.idapi32.dll__OsCalloc
add esp, 8
mov edx, dword [ebp - 0x28]
mov dword [edx + 0x13c], eax
test eax, eax
jne 0x4be311ff
mov word [ebp - 0x22], 0x2501
mov word [ebp - 0x10], 0
jmp 0x4be3146d
push 0x80
push 1
call sym.idapi32.dll__OsCallocShared
add esp, 8
mov edx, dword [ebp - 0x28]
mov dword [edx + 0x3c], eax
test eax, eax
jne 0x4be31229
mov word [ebp - 0x22], 0x2501
mov word [ebp - 0x10], 0
jmp 0x4be3146d
mov edx, dword [ebp - 0x28]
mov word [edx + 0x40], 0x20
mov ecx, dword [ebp - 0x28]
add ecx, 0x880
push ecx
push 0
push 0
call sym.idapi32.dll_OsMuxCreate
mov word [ebp - 0x22], ax
test ax, ax
je 0x4be31259
mov word [ebp - 0x10], 0
jmp 0x4be3146d
mov edx, dword [ebp - 0x28]
mov word [edx + 0x3a], 0xc8
test ebx, ebx
je 0x4be3127d
cmp byte [ebx], 0
je 0x4be3127d
push ebx
mov ecx, dword [ebp - 0x28]
add ecx, 0xc
push ecx
call fcn.4be41cfc
add esp, 8
jmp 0x4be31291
push 0xa
mov eax, dword [ebp - 0x28]
add eax, 0xc
push eax
xor edx, edx
mov dl, byte [ebp - 0x29]
push edx
call sym.idapi32.dll_SvItoA
mov cl, byte [ebp - 0x29]
mov eax, dword [ebp - 0x28]
mov byte [eax + 0x2c], cl
mov dx, word [ebp - 0x2c]
mov ecx, dword [ebp - 0x28]
mov word [ecx + 0xa22], dx
mov eax, dword [ebp - 0x28]
mov word [eax + 0x6c8], 0
mov edx, dword [ebp - 0x28]
mov dword [edx], 0x4be573c8
mov ecx, dword [ebp - 0x28]
xor eax, eax
mov dword [ecx + 0x6f7], eax
mov edx, dword [ebp + 8]
mov ecx, dword [ebp - 0x28]
mov dword [ecx + 0x2e], edx
mov eax, dword [ebp + 8]
inc word [eax + 0x35]
xor edx, edx
mov dl, byte [ebp - 0x29]
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 0x37]
mov ecx, dword [ebp - 0x28]
mov dword [eax + edx*4 - 4], ecx
movzx edx, word [ebp - 0x2c]
mov eax, dword [0x4be56de0]
mov ecx, dword [eax + 0x606]
mov byte [ecx + edx - 1], 1
push 0
push 0
call sym.idapi32.dll_SysUnlock
xor edx, edx
mov dword [ebp - 0x34], edx
push dword [ebp - 0x28]
mov eax, dword [0x4be576f0]
push dword [eax + 0x3b]
call sub.KERNEL32.dll_TlsSetValue
push dword [ebp - 0x28]
push dword [ebp + 0x10]
call fcn.4be32a4b
mov word [ebp - 0x22], ax
cmp word [ebp - 0x22], 0
je 0x4be3133d
mov word [ebp - 0x10], 0
jmp 0x4be3146d
lea edx, [ebp - 0x30]
push edx
push 0
push 0
push 0
push 0
push 0
push 0
push 0
call fcn.4bdfec63
test ax, ax
jne 0x4be3136d
push dword [ebp - 0x30]
push dword [ebp - 0x28]
call fcn.4be318d4
test ax, ax
jne 0x4be3136d
xor ecx, ecx
jmp 0x4be31372
mov ecx, 1
mov word [ebp - 0x22], cx
cmp word [ebp - 0x22], 0
je 0x4be313a9
cmp dword [ebp - 0x34], 0
je 0x4be3138c
push 0
push 0
call sym.idapi32.dll_SysUnlock
push dword [ebp - 0x28]
call fcn.4be314f9
mov ax, word [ebp - 0x22]
push eax
lea edx, [ebp - 0x20]
push edx
call fcn.4be43407
pop ecx
pop eax
jmp 0x4be314f0
mov edx, dword [ebp - 0x30]
mov ecx, dword [ebp - 0x30]
mov dword [edx + 4], ecx
mov eax, dword [ebp - 0x30]
mov dword [eax + 8], 4
push 9
mov edx, dword [0x4be56de0]
add edx, 0x40c
push edx
mov ecx, dword [ebp - 0x28]
add ecx, 0x6ca
push ecx
call fcn.4be41be8
add esp, 0xc
push 0x10
mov eax, dword [0x4be56de0]
add eax, 0x415
push eax
mov edx, dword [ebp - 0x28]
add edx, 0x6d7
push edx
call fcn.4be41be8
add esp, 0xc
push 4
mov ecx, dword [0x4be56de0]
add ecx, 0x425
push ecx
mov eax, dword [ebp - 0x28]
add eax, 0x6d3
push eax
call fcn.4be41be8
add esp, 0xc
mov edx, dword [0x4be56de0]
add edx, 0x435
push edx
mov ecx, dword [ebp - 0x28]
add ecx, 0x6fb
push ecx
call fcn.4be41cfc
add esp, 8
mov eax, dword [0x4be56de0]
add eax, 0x455
push eax
mov edx, dword [ebp - 0x28]
add edx, 0x888
push edx
call fcn.4be41cfc
add esp, 8
mov word [ebp - 0x10], 0
jmp 0x4be3146d
cmp word [ebp - 0x22], 0
je 0x4be314d3
cmp dword [ebp - 0x28], 0
je 0x4be314d3
mov ecx, dword [ebp - 0x28]
cmp byte [ecx + 0x2c], 0
je 0x4be314af
mov eax, dword [ebp + 8]
dec word [eax + 0x35]
xor edx, edx
mov dl, byte [ebp - 0x29]
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 0x37]
xor ecx, ecx
mov dword [eax + edx*4 - 4], ecx
movzx edx, word [ebp - 0x2c]
mov eax, dword [0x4be56de0]
mov ecx, dword [eax + 0x606]
mov byte [ecx + edx - 1], 0
mov edx, dword [ebp - 0x28]
push dword [edx + 0x13c]
call sym.idapi32.dll__OsFree
pop ecx
mov eax, dword [ebp - 0x28]
push dword [eax + 0x3c]
call sym.idapi32.dll__OsFreeShared
pop ecx
push dword [ebp - 0x28]
call sym.idapi32.dll__OsFreeShared
pop ecx
cmp dword [ebp - 0x34], 0
je 0x4be314e2
push 0
push 0
call sym.idapi32.dll_SysUnlock
mov ax, word [ebp - 0x22]
mov edx, dword [ebp - 0x20]
mov dword fs:[0], edx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc