Function at 0x10012730
Capabilities:
Allocate thread local storage
Get system information on windows
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x160
cmp dword [0x1002eaa4], 0
je 0x10012748
xor eax, eax
mov esp, ebp
pop ebp
ret
push esi
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
mov esi, dword [sym.imp.KERNEL32.dll_GetSystemInfo]
mov dword [0x1002e658], eax
lea eax, [ebp - 0x58]
push eax
call esi
lea eax, [ebp - 0x34]
push eax
call esi
mov eax, dword [ebp - 0x20]
xor edx, edx
mov dword [0x1002e9e8], eax
mov eax, 0x1000
div dword [ebp - 0x54]
test edx, edx
je 0x100127a0
push 0x10026aaa
push 0x10026aaa
push str.Compile_time_page_size_does_not_divide_the_runtime_one._n
call fcn.1000d5a0
push eax
call dword [sym.mozglue.dll__malloc_message]
add esp, 0x10
call dword [0x10029a50]
mov eax, dword [0x1002e65c]
xor esi, esi
push edi
mov edi, dword [0x1002eab0]
push ebx
mov dword [ebp - 0xc], esi
mov ecx, esi
sub ecx, 0
je 0x10012a56
sub ecx, 1
je 0x100127f1
sub ecx, 1
je 0x100127d3
mov byte [ebp - 0x160], 0
jmp 0x10012969
mov edx, dword [sym.mozglue.dll__malloc_options]
mov dword [ebp - 4], edx
test edx, edx
jne 0x10012821
mov byte [ebp - 0x160], dl
lea edx, [ebp - 0x160]
mov dword [ebp - 4], edx
jmp 0x10012821
push str.MALLOC_OPTIONS
call fcn.10012eb0
mov edx, eax
mov dword [ebp - 4], eax
add esp, 4
test edx, edx
jne 0x10012816
lea edx, [ebp - 0x160]
mov byte [ebp - 0x160], al
mov dword [ebp - 4], edx
mov eax, dword [0x1002e65c]
mov edi, dword [0x1002eab0]
mov cl, byte [edx]
xor ebx, ebx
test cl, cl
je 0x10012969
nop dword [eax]
movsx edx, cl
xor esi, esi
lea ecx, [edx - 0x30]
cmp ecx, 9
ja case.default.0x10012849
mov edi, dword [ebp - 4]
mov eax, esi
movzx ecx, byte [ecx + 0x10012bb8]
jmp dword [ecx*4 + 0x10012bb4]
lea ecx, [esi - 6]
inc ebx
lea ecx, [esi + ecx*4]
mov eax, 1
lea esi, [edx + ecx*2]
movsx edx, byte [ebx + edi]
lea ecx, [edx - 0x30]
cmp ecx, 9
jbe 0x10012842
mov edi, dword [0x1002eab0]
test eax, eax
mov eax, dword [0x1002e65c]
je case.default.0x10012849
test esi, esi
je 0x10012957
jmp 0x10012890
mov esi, 1
nop dword [eax]
mov ecx, dword [ebp - 4]
mov dl, byte [ebx + ecx]
movsx ecx, dl
add ecx, 0xffffffbf
cmp ecx, 0x2f
ja case.0x100128a8.67
movzx ecx, byte [ecx + 0x10012bec]
jmp dword [ecx*4 + 0x10012bc4]
mov dword [0x1002eaa8], 0
jmp case.0x100128a8.66
mov dword [0x1002eaa8], 1
jmp case.0x100128a8.66
shr eax, 1
mov dword [0x1002e65c], eax
jmp case.0x100128a8.66
test eax, eax
jne 0x100128e6
mov eax, 1
mov dword [0x1002e65c], eax
jmp case.0x100128a8.66
lea ecx, [eax + eax]
test ecx, ecx
je case.0x100128a8.66
mov eax, ecx
mov dword [0x1002e65c], eax
jmp case.0x100128a8.66
dec edi
mov dword [0x1002eab0], edi
jmp case.0x100128a8.66
inc edi
mov dword [0x1002eab0], edi
jmp case.0x100128a8.66
mov dword [0x1002eaac], 0
jmp case.0x100128a8.66
mov dword [0x1002eaac], 1
jmp case.0x100128a8.66
push 0x10028d14
lea eax, [ebp - 8]
mov byte [ebp - 8], dl
push eax
push str.:__malloc__Unsupported_character_in_malloc_options:_
push str._jemalloc_
mov byte [ebp - 7], 0
call dword [sym.mozglue.dll__malloc_message]
mov eax, dword [0x1002e65c]
add esp, 0x10
mov edi, dword [0x1002eab0]
sub esi, 1
jne 0x10012890
mov ecx, dword [ebp - 4]
inc ebx
mov cl, byte [ebx + ecx]
test cl, cl
jne 0x10012830
mov esi, dword [ebp - 0xc]
inc esi
mov dword [ebp - 0xc], esi
cmp esi, 3
jb 0x100127b2
push 0x1002e9f4
mov dword [0x1002e9ec], 0
call fcn.10012c20
push 0x1002e9f8
call fcn.1000d800
push 0x1002ea18
call fcn.10010c60
push 0x1002ea38
call fcn.10012c20
push 0x1002ea3c
call fcn.10010c60
xorps xmm0, xmm0
mov dword [0x1002ea5c], 0
push 0x1002ea88
movlpd qword [0x1002ea60], xmm0
movlpd qword [0x1002ea68], xmm0
mov dword [0x1002ea70], 0
mov dword [0x1002ea8c], 0
mov dword [0x1002ea90], 0
mov dword [0x1002ea84], 0
call fcn.10012c20
mov edx, dword [0x1002e9e8]
add esp, 0x18
mov ecx, dword [0x1002eab0]
cmp edx, 1
jbe 0x10012a1e
add ecx, 2
mov dword [0x1002eab0], ecx
mov dword [0x1002ea98], edx
test ecx, ecx
jle 0x10012a63
mov eax, edx
shl eax, cl
cmp eax, edx
jbe 0x10012a37
mov dword [0x1002ea98], eax
mov edx, eax
lea eax, [edx*4]
cmp eax, 0x100000
jbe 0x10012a89
mov dword [0x1002ea98], 0x40000
mov edx, 0x40000
jmp 0x10012a89
mov byte [ebp - 0x160], 0
inc esi
jmp 0x100127af
jns 0x10012a89
neg ecx
mov eax, edx
shr eax, cl
cmp eax, edx
jae 0x10012a76
mov dword [0x1002ea98], eax
mov edx, eax
test edx, edx
jne 0x10012a89
mov dword [0x1002ea98], 1
mov edx, 1
lea eax, [edx*4]
mov dword [0x1002ea9c], 0
push eax
call fcn.10010380
add esp, 4
mov dword [0x1002ea94], eax
test eax, eax
je 0x10012ba5
mov ecx, dword [0x1002ea98]
shl ecx, 2
push ecx
push 0
push eax
call fcn.1000641a
push 0
call fcn.10010310
mov eax, dword [0x1002ea94]
add esp, 0x10
mov eax, dword [eax]
test eax, eax
je 0x10012ba5
push eax
push dword [0x1002e658]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
push 0x1002eaa0
call fcn.10012c20
mov eax, 0x1000
xor edx, edx
bsf eax, eax
mov edi, eax
mov dword [ebp - 4], eax
mov eax, 0xc
mov dword [ebp - 0xc], edi
div edi
xor edx, edx
mov ecx, eax
mov eax, 0xc
div edi
lea ebx, [ecx + 1]
test edx, edx
mov dword [ebp - 0x10], edx
cmove ebx, ecx
lea eax, [ebx*4 + 0xc]
push eax
push 1
call fcn.10010420
mov esi, eax
add esp, 0xc
test esi, esi
je 0x10012b9b
push esi
call fcn.10012c20
mov eax, ebx
mov dword [esi + 8], ebx
imul eax, edi
add esp, 4
cmp eax, 0xc
mov eax, dword [ebp - 0x10]
cmovbe eax, edi
mov dword [esi + 0xc], eax
cmp ebx, 1
jbe 0x10012b66
mov eax, dword [ebp - 0xc]
lea edi, [esi + 0x10]
lea ecx, [ebx - 1]
rep stosd dword es:[edi], eax
mov ecx, dword [esi + 0xc]
mov eax, 4
shl eax, cl
push eax
push 1
call fcn.10010420
add esp, 8
mov dword [esi + 4], eax
test eax, eax
je 0x10012b9b
pop ebx
mov dword [0x1002e9f0], esi
xor eax, eax
pop edi
mov dword [0x1002eaa4], 1
pop esi
mov esp, ebp
pop ebp
ret
mov dword [0x1002e9f0], 0
pop ebx
pop edi
mov eax, 1
pop esi
mov esp, ebp
pop ebp
ret