Function at 0x43b163
Capabilities:
Set thread local storage value

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x3c
lea eax, [ecx + ecx*2]
lea ecx, [ecx + ecx*2 - 1]
mov ebp, edx
bsr ecx, ecx
xor esi, esi
dec esi
not ecx
shr esi, cl
inc esi
xor ebx, ebx
inc ebx
cmp eax, 2
cmovb esi, ebx
call fcn.00451560
test esi, esi
mov dword [esp + 0x1c], eax
mov dword [esp + 0x18], edx
mov dword [esp + 0x14], ecx
mov dword [esp + 0x10], esi
je 0x43b033
cmp esi, 0x1ffffff
ja 0x43b0ab
mov edi, esi
mov dword [esp + 0xc], ebp
shl edi, 6
js 0x43b0ab
mov al, byte [0x48fdb4]
lea edx, [edi + 0x40]
xor ecx, ecx
xor ebp, ebp
call fcn.0045a4d0
test eax, eax
je 0x43b0bf
mov ecx, eax
mov edx, esp
xor edi, edi
and ecx, 0xffffffc0
mov dword [ecx + 0x3c], eax
mov dword [edx], esi
add ecx, 0x40
neg esi
mov dword [edx + 4], ecx
mov dword [edx + 8], 0
cmp edi, dword [esp]
jne 0x43af92
mov ecx, esp
mov edx, edi
call 0x43b0cb
mov ecx, dword [esp + 4]
mov edi, dword [esp + 8]
mov edx, dword [esp + 0x18]
mov eax, edi
inc edi
shl eax, 6
mov dword [ecx + eax + 4], edx
mov edx, dword [esp + 0x1c]
mov dword [ecx + eax], edx
mov edx, dword [esp + 0x14]
mov dword [ecx + eax + 8], edx
mov dword [ecx + eax + 0x10], ebx
mov dword [ecx + eax + 0x18], ebp
mov dword [ecx + eax + 0x1c], ebp
mov dword [ecx + eax + 0x20], ebp
movsd xmm0, qword [esp + 0x20]
movsd xmm1, qword [esp + 0x28]
movsd qword [ecx + eax + 0x24], xmm0
movsd qword [ecx + eax + 0x2c], xmm1
movsd xmm0, qword [esp + 0x30]
movsd qword [ecx + eax + 0x34], xmm0
mov edx, dword [esp + 0x38]
mov dword [ecx + eax + 0x3c], edx
lea edx, [esi + ebx + 1]
inc ebx
mov dword [esp + 8], edi
cmp edx, 1
jne 0x43af7c
mov edx, dword [esp]
mov esi, dword [esp + 4]
cmp edx, edi
jbe 0x43b04b
mov ebp, dword [esp + 0xc]
test edi, edi
je 0x43b051
mov ebx, edi
shl edx, 6
mov ecx, esi
shl ebx, 6
push ebx
push 0x40
call fcn.004133e0
add esp, 8
mov esi, eax
test eax, eax
jne 0x43b067
mov ecx, 0x40
mov edx, ebx
call fcn.0046d190
xor edi, edi
mov esi, 0x40
mov dword [esp], edi
mov dword [esp + 4], 0x40
mov dword [esp + 8], edi
jmp 0x43b067
mov ebp, dword [esp + 0xc]
jmp 0x43b067
push dword [esi - 4]
push 0
push dword [0x48fd58]
call dword [sym.imp.kernel32.dll_HeapFree]
mov esi, 0x40
mov al, byte [0x48fdb4]
xor ecx, ecx
mov edx, 0x10
call fcn.0045a4d0
test eax, eax
je 0x43b0b0
mov ecx, dword [esp + 0x10]
test ecx, ecx
je 0x43b08c
bsr ecx, ecx
xor ecx, 0x1f
jmp 0x43b091
mov ecx, 0x20
mov edx, 0x1f
mov dword [eax], esi
mov dword [eax + 4], edi
sub edx, ecx
mov dword [eax + 8], edx
mov dword [eax + 0xc], ebp
add esp, 0x3c
pop esi
pop edi
pop ebx
pop ebp
ret
call fcn.00414380
mov ecx, 4
mov edx, 0x10
call fcn.0046d190
mov ecx, 0x40
mov edx, edi
call fcn.0046d190
push ebp
push ebx
push edi
push esi
sub esp, 0x18
inc edx
je 0x43b148
mov esi, ecx
mov ecx, dword [ecx]
mov ebx, 4
lea eax, [ecx + ecx]
cmp eax, edx
cmova edx, eax
cmp edx, 5
cmovae ebx, edx
xor edx, edx
cmp ebx, 0x2000000
mov eax, ebx
setb dl
shl eax, 6
shl edx, 6
test ecx, ecx
je 0x43b11a
mov edi, dword [esi + 4]
shl ecx, 6
mov dword [esp], edi
mov dword [esp + 4], 0x40
mov dword [esp + 8], ecx
jmp 0x43b122
mov dword [esp + 4], 0
lea edi, [esp + 0xc]
mov ebp, esp
mov ecx, edi
push ebp
push eax
call fcn.0042149e
add esp, 8
cmp dword [edi], 0
mov ecx, dword [edi + 4]
je 0x43b14d
cmp ecx, 0x80000001
je 0x43b152
test ecx, ecx
jne 0x43b15a
call fcn.00414380
mov dword [esi + 4], ecx
mov dword [esi], ebx
add esp, 0x18
pop esi
pop edi
pop ebx
pop ebp
ret
mov edx, dword [esp + 0x14]
call fcn.0046d190
push edi
push esi
mov edi, dword [esp + 0xc]
mov esi, dword [edi]
mov eax, dword [esi]
test eax, eax
je 0x43b1aa
dec eax
push 1
push eax
call dword [sym.imp.kernel32.dll_TlsSetValue]
cmp dword [edi + 4], 0
je 0x43b188
lock dec dword [0x48fcc4]
push edi
push 0
push dword [0x48fd58]
call dword [sym.imp.kernel32.dll_HeapFree]
mov eax, dword [esi]
test eax, eax
je 0x43b1b3
dec eax
push 0
push eax
call dword [sym.imp.kernel32.dll_TlsSetValue]
pop esi
pop edi
ret
mov ecx, esi
call fcn.00471a40
jmp 0x43b172
mov ecx, esi
call fcn.00471a40
jmp 0x43b19e