Function at 0x10013ec0
Capabilities:
Allocate thread local storage

Disassembly:
sub esp, 0x18
push ebx
mov ebx, dword [esp + 0x24]
push ebp
push esi
push edi
mov edi, dword [esp + 0x38]
test edi, edi
jne 0x10013f1b
test ebx, ebx
jne 0x10013ee3
mov ebp, dword [esp + 0x34]
test ebp, ebp
je 0x10013f71
mov eax, dword [section..data]
cmp eax, 0xffffffff
jne 0x10013ef7
call sub.KERNEL32.dll_TlsAlloc
mov dword [section..data], eax
push eax
call fcn.1002e140
add esp, 4
test eax, eax
jne 0x10013f09
call fcn.100079f0
pop edi
pop esi
pop ebp
mov dword [eax], 0x3009
xor eax, eax
pop ebx
add esp, 0x18
ret 0x10
mov ebp, dword [esp + 0x34]
test ebx, ebx
jne 0x10013f50
test ebp, ebp
jne 0x10013f50
lea eax, [esp + 0x10]
mov dword [esp + 0x10], 0x3009
push eax
mov dword [esp + 0x18], ebp
mov dword [esp + 0x1c], ebp
call fcn.10016980
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret 0x10
xor ecx, ecx
test ebx, ebx
sete cl
xor eax, eax
test ebp, ebp
sete al
cmp eax, ecx
je 0x10013f71
push str.read_and_draw_must_both_be_valid_surfaces__or_both_be_EGL_NO_SURFACE
push 0x3009
jmp 0x10014238
mov esi, dword [esp + 0x2c]
test esi, esi
je 0x1001422e
push esi
call fcn.100280c0
add esp, 4
test al, al
je 0x1001422e
mov ecx, esi
call fcn.10028060
test al, al
jne 0x10013fc7
test edi, edi
jne 0x10013fa5
test ebx, ebx
jne 0x10013fa5
test ebp, ebp
je 0x10013fff
push str.dpy_not_initialized
lea eax, [esp + 0x14]
push 0x3001
push eax
call fcn.10131350
push eax
call fcn.10016980
add esp, 0x10
jmp 0x10014271
test edi, edi
je 0x10013fff
push edi
lea eax, [esp + 0x14]
push esi
push eax
call fcn.100b23d0
add esp, 0xc
cmp dword [esp + 0x10], 0x3000
je 0x10013ff6
lea eax, [esp + 0x10]
push eax
call fcn.10016980
add esp, 4
jmp 0x10014271
lea ecx, [esp + 0x18]
call fcn.100016b0
mov ecx, esi
call fcn.10028060
test al, al
je 0x10014046
mov ecx, esi
call fcn.10028bd0
test al, al
je 0x10014046
lea eax, [esp + 0x10]
mov dword [esp + 0x10], 0x300e
push eax
mov dword [esp + 0x18], 0
mov dword [esp + 0x1c], 0
call fcn.10016980
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret 0x10
test ebx, ebx
je 0x1001406c
push ebx
lea eax, [esp + 0x14]
push esi
push eax
call fcn.100b8a20
add esp, 0xc
cmp dword [esp + 0x10], 0x3000
jne 0x10013fe4
lea ecx, [esp + 0x18]
call fcn.100016b0
test ebp, ebp
je 0x100140de
push ebp
lea eax, [esp + 0x14]
push esi
push eax
call fcn.100b8a20
add esp, 0xc
cmp dword [esp + 0x10], 0x3000
jne 0x10013fe4
lea ecx, [esp + 0x18]
call fcn.100016b0
mov ecx, ebp
call fcn.1007a410
mov ecx, dword [esp + 0x38]
mov edi, eax
call fcn.101207b0
mov ecx, ebp
mov esi, eax
call fcn.10055fa0
push edi
push esi
mov esi, dword [esp + 0x34]
push ebp
push eax
lea eax, [esp + 0x20]
push esi
push eax
call fcn.100b2240
add esp, 0x18
cmp dword [esp + 0x10], 0x3000
jne 0x10013fe4
lea ecx, [esp + 0x18]
call fcn.100016b0
cmp ebx, ebp
je 0x1001412e
test ebx, ebx
je 0x1001412e
mov ecx, ebx
call fcn.1007a410
mov ecx, dword [esp + 0x38]
mov edi, eax
call fcn.101207b0
mov ecx, ebx
mov esi, eax
call fcn.10055fa0
push edi
push esi
mov esi, dword [esp + 0x34]
push ebx
push eax
lea eax, [esp + 0x20]
push esi
push eax
call fcn.100b2240
add esp, 0x18
cmp dword [esp + 0x10], 0x3000
jne 0x10013fe4
lea ecx, [esp + 0x18]
call fcn.100016b0
mov edi, dword [esp + 0x38]
lea eax, [esp + 0x1c]
push edi
push ebp
push ebx
push eax
mov ecx, esi
call fcn.10028250
cmp dword [esp + 0x1c], 0x3000
je 0x1001416f
lea eax, [esp + 0x1c]
push eax
call fcn.10016980
add esp, 4
lea ecx, [esp + 0x24]
xor esi, esi
call fcn.100016b0
pop edi
mov eax, esi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret 0x10
call fcn.1000f530
push esi
mov dword [esp + 0x3c], eax
call fcn.10016950
mov eax, dword [section..data]
add esp, 4
cmp eax, 0xffffffff
jne 0x10014195
call sub.KERNEL32.dll_TlsAlloc
mov dword [section..data], eax
push eax
call fcn.1002e140
add esp, 4
test eax, eax
jne 0x100141a7
call fcn.100079f0
mov dword [eax + 0xc], ebx
mov eax, dword [section..data]
cmp eax, 0xffffffff
jne 0x100141be
call sub.KERNEL32.dll_TlsAlloc
mov dword [section..data], eax
push eax
call fcn.1002e140
add esp, 4
test eax, eax
jne 0x100141d0
call fcn.100079f0
push edi
mov dword [eax + 0x10], ebp
call fcn.10016920
mov eax, dword [esp + 0x3c]
add esp, 4
test eax, eax
je 0x100141ef
cmp edi, eax
je 0x100141ef
mov ecx, eax
call fcn.10128790
lea eax, [esp + 0x10]
mov dword [esp + 0x10], 0x3000
push eax
mov dword [esp + 0x18], 0
mov dword [esp + 0x1c], 0
call fcn.10016980
add esp, 4
lea ecx, [esp + 0x24]
mov esi, 1
call fcn.100016b0
pop edi
mov eax, esi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret 0x10
push str.dpy_not_a_valid_EGLDisplay_handle
push 0x3008
lea eax, [esp + 0x18]
push eax
call fcn.10131350
mov esi, eax
add esp, 0xc
mov eax, dword [section..data]
cmp eax, 0xffffffff
jne 0x1001425b
call sub.KERNEL32.dll_TlsAlloc
mov dword [section..data], eax
push eax
call fcn.1002e140
add esp, 4
test eax, eax
jne 0x1001426d
call fcn.100079f0
mov ecx, dword [esi]
mov dword [eax], ecx
lea ecx, [esp + 0x18]
call fcn.100016b0
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x18
ret 0x10