Function at 0x570ed9
Capabilities:
Allocate thread local storage
Get system information on windows
Query environment variable
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x140
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
cmp byte [0x6b7ff0], 0
je 0x570efc
xor al, al
jmp 0x5714a5
push ebx
push esi
push edi
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
mov dword [0x6c5b60], eax
lea eax, [ebp - 0x140]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemInfo]
mov eax, dword [ebp - 0x13c]
mov ecx, dword [ebp - 0x12c]
mov dword [0x6b45e0], ecx
lea ecx, [eax - 1]
mov dword [0x6b45b0], eax
bsf eax, eax
mov dword [0x6b45b4], ecx
je 0x570f41
lea edi, [eax + 1]
jmp 0x570f43
xor edi, edi
mov esi, dword [0x6c5b68]
dec edi
and dword [ebp - 0x118], 0
mov dword [0x6b4530], edi
mov eax, dword [ebp - 0x118]
sub eax, 0
je 0x570f76
dec eax
je 0x57103b
dec eax
jne 0x570f76
mov ebx, dword [0x6f3028]
test ebx, ebx
jne 0x570f83
lea ebx, [ebp - 0x10c]
mov byte [ebp - 0x10c], 0
and dword [ebp - 0x110], 0
cmp byte [ebx], 0
je 0x571202
mov eax, ebx
mov al, byte [eax]
xor ecx, ecx
xor dl, dl
cmp al, 0x30
jl 0x570fc6
cmp al, 0x39
jg 0x570fc2
imul ecx, ecx, 0xa
inc dword [ebp - 0x110]
movsx eax, al
lea ecx, [ecx + eax - 0x30]
mov eax, dword [ebp - 0x110]
mov al, byte [eax + ebx]
mov dl, 1
cmp al, 0x30
jge 0x570f9f
test dl, dl
jne 0x570fc9
xor ecx, ecx
inc ecx
test ecx, ecx
je 0x5711eb
mov dword [ebp - 0x11c], ecx
mov eax, dword [ebp - 0x110]
mov cl, byte [eax + ebx]
movsx eax, cl
cmp eax, 0x61
jg 0x571117
je 0x57110b
cmp eax, 0x4e
jg 0x5710b7
je 0x5710ac
sub eax, 0x41
je 0x5710a0
dec eax
je 0x5711df
sub eax, 4
je 0x571076
dec eax
je 0x57106b
sub eax, 4
jne 0x571177
mov eax, dword [0x6c5b70]
inc eax
cmp eax, 0x20
jae 0x5711df
mov dword [0x6c5b70], eax
jmp 0x5711df
push 0x40
push 0x6b4558
push str.MALLOC_OPTIONS
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov edi, dword [0x6b4530]
mov esi, dword [0x6c5b68]
test eax, eax
je 0x570f76
mov ebx, 0x6b4558
jmp 0x570f83
inc dword [0x6b7ff8]
jmp 0x5711df
mov eax, dword [0x6c5b64]
test eax, eax
jne 0x57108e
mov dword [0x6c5b64], 1
jmp 0x5711df
add eax, eax
je 0x5711df
mov dword [0x6c5b64], eax
jmp 0x5711df
mov byte [0x6b7ff1], 1
jmp 0x5711df
inc dword [0x6b7ffc]
jmp 0x5711df
sub eax, 0x50
je 0x5710ff
dec eax
je 0x5710ee
dec eax
je 0x5710e3
dec eax
jne 0x571177
lea eax, [edi - 1]
cmp dword [0x6c5b6c], eax
jae 0x5711df
inc dword [0x6c5b6c]
jmp 0x5711df
inc dword [0x6b7ff4]
jmp 0x5711df
lea eax, [edi - 1]
cmp esi, eax
jae 0x5711df
inc esi
jmp 0x5711d0
mov byte [0x6b7ff2], 1
jmp 0x5711df
mov byte [0x6b7ff1], 0
jmp 0x5711df
cmp eax, 0x6e
jg 0x571169
je 0x571161
sub eax, 0x62
je 0x5711df
sub eax, 4
je 0x571159
dec eax
je 0x57114e
sub eax, 4
jne 0x571177
lea eax, [edi + 1]
cmp dword [0x6c5b70], eax
jbe 0x5711df
dec dword [0x6c5b70]
jmp 0x5711df
dec dword [0x6b7ff8]
jmp 0x5711df
shr dword [0x6c5b64], 1
jmp 0x5711df
dec dword [0x6b7ffc]
jmp 0x5711df
sub eax, 0x70
je 0x5711d8
dec eax
je 0x5711ca
dec eax
je 0x5711c2
dec eax
je 0x5711b1
push 0x67b970
lea eax, [ebp - 0x114]
push eax
push str.:__malloc__Unsupported_character_in_malloc_options:_
push str._jemalloc_
mov byte [ebp - 0x114], cl
mov byte [ebp - 0x113], 0
call dword [0x6c5b74]
mov edi, dword [0x6b4530]
mov esi, dword [0x6c5b68]
add esp, 0x10
jmp 0x5711df
cmp dword [0x6c5b6c], 4
jbe 0x5711df
dec dword [0x6c5b6c]
jmp 0x5711df
dec dword [0x6b7ff4]
jmp 0x5711df
cmp esi, 4
jbe 0x5711df
dec esi
mov dword [0x6c5b68], esi
jmp 0x5711df
mov byte [0x6b7ff2], 0
dec dword [ebp - 0x11c]
jne 0x570fd7
inc dword [ebp - 0x110]
mov eax, dword [ebp - 0x110]
add eax, ebx
cmp byte [eax], 0
jne 0x570f95
inc dword [ebp - 0x118]
cmp dword [ebp - 0x118], 3
jb 0x570f57
cmp dword [0x6c5b6c], esi
jae 0x571223
mov dword [0x6c5b6c], esi
mov ebx, dword [0x6c5b6c]
xor eax, eax
inc eax
mov ecx, ebx
shl eax, cl
mov ecx, dword [0x6b45b0]
shr ecx, 1
mov dword [0x6b4538], ecx
mov dword [0x6b45ec], eax
mov ecx, esi
shr eax, cl
lea edx, [esi - 1]
mov dword [0x6b4598], edx
mov dword [0x6b45a4], eax
mov eax, edi
sub eax, ebx
dec eax
mov dword [0x6b4524], eax
xor eax, eax
inc eax
shl eax, cl
xor ebx, ebx
lea ecx, [eax - 1]
mov dword [0x6b45dc], eax
mov dword [0x6b45a0], ecx
cmp edx, ebx
jbe 0x571282
shr eax, 1
inc eax
mov dword [0x6b44dc], eax
jmp 0x57128c
mov dword [0x6b44dc], 1
mov ecx, dword [0x6c5b70]
xor eax, eax
inc eax
shl eax, cl
push 0x6b4648
lea ecx, [eax - 1]
mov edx, eax
mov dword [0x6b44d4], ecx
mov ecx, edi
shr edx, cl
mov dword [0x6b4508], eax
mov edi, 0x6b4668
lea esi, [edx - 1]
imul esi, esi, 0xc
mov dword [0x6b45e4], edx
mov edx, dword [0x6b45b4]
add esi, 0x1c
and edx, esi
neg edx
sbb edx, edx
shr esi, cl
neg edx
add edx, esi
mov dword [0x6b452c], edx
shl edx, cl
sub eax, edx
mov dword [0x6b4528], eax
xor eax, eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
call fcn.0056d11f
mov eax, 0x6b460c
mov dword [0x6b4608], eax
mov dword [0x6b4614], eax
and eax, 0xfffffffe
mov dword [0x6b4618], eax
mov dword [0x6b45a8], ebx
mov dword [0x6b45ac], ebx
mov dword [0x6b45f0], ebx
mov dword [0x6b45f4], ebx
mov dword [0x6b4660], ebx
mov dword [0x6b4504], ebx
mov dword [0x6b44d8], ebx
mov dword [0x6b44e0], ebx
mov dword [esp], 0x6b450c
call fcn.0056d11f
xor edx, edx
inc edx
pop ecx
mov ecx, dword [0x6b7ffc]
mov eax, edx
mov dword [0x6b45d0], eax
cmp ecx, ebx
jle 0x57137d
mov esi, edx
shl esi, cl
cmp esi, edx
jbe 0x571367
mov eax, esi
mov dword [0x6b45d0], eax
mov ecx, dword [0x6b4508]
mov edx, eax
shl edx, 2
cmp edx, ecx
jbe 0x57139b
shr ecx, 2
mov eax, ecx
jmp 0x571396
jge 0x57139b
neg ecx
mov esi, edx
shr esi, cl
cmp esi, edx
jae 0x57139b
mov eax, esi
mov dword [0x6b45d0], eax
cmp eax, ebx
jne 0x57139b
mov eax, edx
mov dword [0x6b45d0], eax
shl eax, 2
mov dword [0x6b45d8], ebx
call fcn.0056d1be
mov dword [0x6b45e8], eax
cmp eax, ebx
je 0x571408
mov ecx, dword [0x6b45d0]
shl ecx, 2
push ecx
push ebx
push eax
call fcn.00402394
push ebx
call fcn.00570c72
mov eax, dword [0x6b45e8]
mov eax, dword [eax]
add esp, 0x10
cmp eax, ebx
je 0x571408
push eax
push dword [0x6c5b60]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
push 0x6b45b8
call fcn.0056d11f
push 0x20
pop eax
sub eax, dword [0x6c5b70]
push eax
call fcn.0056e09b
pop ecx
pop ecx
mov dword [0x6b4644], eax
cmp eax, ebx
jne 0x57140f
mov al, 1
jmp 0x5714a2
push 0x6b453c
call fcn.0056d11f
mov edx, dword [0x6b4508]
pop ecx
mov ecx, dword [0x6b7ff8]
mov dword [0x6b4554], ebx
mov dword [0x6b4600], ebx
mov dword [0x6b459c], ebx
cmp ecx, ebx
jl 0x571445
mov eax, edx
shl eax, cl
mov dword [0x6b459c], eax
mov ecx, dword [0x6b7ff4]
mov eax, 0x6b44e8
mov dword [0x6b44e4], eax
mov dword [0x6b44e8], eax
and eax, 0xfffffffe
mov dword [0x6b44ec], eax
mov eax, 0x6b462c
mov dword [0x6b4628], eax
mov dword [0x6b4634], eax
and eax, 0xfffffffe
inc ecx
mov dword [0x6b4624], ebx
mov dword [0x6b45f8], ebx
mov dword [0x6b45fc], ebx
mov dword [0x6b4638], eax
cmp ecx, ebx
jl 0x571499
shl edx, cl
mov ecx, edx
call fcn.005716ed
mov byte [0x6b7ff0], 1
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00403fc1
leave
ret