Function at 0x100078900
Capabilities:
Allocate thread local storage

Disassembly:
mov rax, rsp
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rbp
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
push r12
sub rsp, 0x20
mov edi, 1
mov eax, edi
lock xadd dword [0x1000e2190], eax
add eax, edi
cmp eax, edi
jle 0x100078935
mov eax, edi
jmp 0x100078a14
mov dword [0x1000de26c], edi
mov dword [0x1000deaf8], 0x43
call qword [sym.imp.KERNEL32.dll_TlsAlloc]
or r12d, 0xffffffff
xor ebx, ebx
mov dword [0x1000de268], eax
cmp eax, r12d
jne 0x100078a2f
mov esi, 0x80040001
cmp byte [0x1000ded78], bl
je 0x100078980
lea rcx, [0x1000ded50]
mov byte [0x1000ded78], bl
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
cmp byte [0x1000dedc8], bl
je 0x10007899b
lea rcx, [0x1000deda0]
mov byte [0x1000dedc8], bl
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov rdi, qword [0x1000e1eb0]
cmp rdi, rbx
je 0x1000789ca
mov rcx, rdi
call fcn.10007a904
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, rdi
mov rcx, rax
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov qword [0x1000e1eb0], rbx
mov rcx, qword [0x1000e2198]
cmp rcx, rbx
je 0x1000789ea
mov qword [0x1000e21a0], rbx
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
mov qword [0x1000e2198], rbx
mov eax, dword [0x1000de268]
cmp eax, r12d
je 0x100078a04
mov ecx, eax
call qword [sym.imp.KERNEL32.dll_TlsFree]
mov dword [0x1000de268], r12d
lock add dword [0x1000e2190], 0xffffffff
xchg dword [0x1000e2194], ebx
mov eax, esi
mov rbx, qword [rsp + 0x30]
mov rbp, qword [rsp + 0x38]
mov rsi, qword [rsp + 0x40]
mov rdi, qword [rsp + 0x48]
add rsp, 0x20
pop r12
ret
lea rcx, [0x1000127b8]
call qword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov qword [0x1000e2198], rax
cmp rax, rbx
je 0x100078a78
lea rdx, [0x10000c410]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [0x1000e21a0], rax
cmp rax, rbx
jne 0x100078a78
mov rcx, qword [0x1000e2198]
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
mov qword [0x1000e2198], rbx
mov qword [0x1000e1eb0], rbx
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov edx, 8
lea r8d, [rdx + 0x18]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov rbp, rax
cmp rax, rbx
je 0x100078ad4
mov rcx, rax
call fcn.10007a59c
cmp eax, ebx
mov esi, eax
jl 0x100078ab6
mov qword [0x1000e1eb0], rbp
jmp 0x100078ad9
mov rcx, rbp
call fcn.10007a904
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, rbp
mov rcx, rax
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
jmp 0x100078ad9
mov esi, 0x8007000e
cmp esi, ebx
jl 0x100078965
or qword [0x1000ded80], 0xffffffffffffffff
cmp byte [0x1000ded78], bl
jne 0x100078b05
lea rcx, [0x1000ded50]
mov byte [0x1000ded78], dil
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
cmp byte [0x1000dedc8], bl
jne 0x100078b21
lea rcx, [0x1000deda0]
mov byte [0x1000dedc8], dil
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
cmp dword [0x1000de19c], r12d
jne 0x100078b51
call qword [sym.imp.KERNEL32.dll_TlsAlloc]
mov dword [0x1000de19c], eax
cmp eax, r12d
jne 0x100078b51
call qword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
cmp eax, ebx
cmovle esi, eax
jmp 0x100078b53
mov esi, ebx
cmp esi, ebx
jl 0x100078965
call fcn.10007cdf0
cmp eax, ebx
mov esi, eax
jl 0x100078965
mov byte [0x1000de208], dil
xchg dword [0x1000e2194], edi
xor eax, eax
jmp 0x100078a14