Function at 0x403822
Capabilities:
Get thread local storage value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
mov eax, dword [0x4bb014]
xor eax, ebp
mov dword [ebp - 4], eax
and dword [ebp - 8], 0
push ebx
push esi
push edi
mov edi, edx
mov dword [ebp - 0x14], str.OpenGL_ES_CM
mov esi, ecx
mov dword [ebp - 0x20], edi
mov dword [ebp - 0x10], str.OpenGL_ES_CL
mov dword [ebp - 0xc], str.OpenGL_ES
mov eax, dword [edi + 4]
mov dword [esi + 0x1e8], eax
mov dword [esi + 0x1e4], 0x30001
push dword [0x4bd5d0]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ecx, esi
mov dword [ebp - 0x1c], eax
call fcn.00403bbd
push str.glGetIntegerv
call dword [esi + 0x22c]
mov dword [esi + 0x214], eax
mov dword [esp], str.glGetString
call dword [esi + 0x22c]
cmp dword [esi + 0x214], 0
pop ecx
mov dword [esi + 0x218], eax
je 0x403b48
test eax, eax
je 0x403b48
push 0x1f02
call eax
mov ebx, eax
test ebx, ebx
jne 0x4038de
cmp dword [edi], 0x30001
mov eax, str.OpenGL_ES_version_string_retrieval_is_broken
mov ecx, str.OpenGL_version_string_retrieval_is_broken
cmove eax, ecx
push eax
jmp 0x403b4d
and dword [ebp - 0x18], 0
mov ecx, str.OpenGL_ES_CM
mov edi, ecx
lea edx, [edi + 1]
mov al, byte [edi]
inc edi
test al, al
jne 0x4038ec
sub edi, edx
push edi
push ecx
push ebx
call fcn.00411760
add esp, 0xc
test eax, eax
je 0x403915
mov eax, dword [ebp - 0x18]
inc eax
mov dword [ebp - 0x18], eax
mov ecx, dword [ebp + eax*4 - 0x14]
test ecx, ecx
jne 0x4038e7
jmp 0x403921
add ebx, edi
mov dword [esi + 0x1e4], 0x30002
lea eax, [esi + 0x1f4]
push eax
lea ecx, [esi + 0x1f0]
push ecx
lea edi, [esi + 0x1ec]
push edi
push str._d._d._d
push ebx
call fcn.004034ad
add esp, 0x14
test eax, eax
jne 0x403961
cmp dword [esi + 0x1e4], 0x30001
mov eax, str.No_version_found_in_OpenGL_ES_version_string
mov ecx, str.No_version_found_in_OpenGL_version_string
jmp 0x4038d5
mov ebx, dword [ebp - 0x20]
mov ecx, dword [ebx + 8]
cmp dword [edi], ecx
jl 0x403b15
jne 0x403980
mov eax, dword [esi + 0x1f0]
cmp eax, dword [ebx + 0xc]
jl 0x403b15
cmp dword [edi], 3
jl 0x40399f
push str.glGetStringi
call dword [esi + 0x22c]
mov dword [esi + 0x210], eax
pop ecx
test eax, eax
je 0x403b48
cmp dword [esi + 0x1e4], 0x30001
jne 0x403a65
cmp dword [edi], 3
jl 0x403a07
lea eax, [ebp - 0x18]
push eax
push 0x821e
call dword [esi + 0x214]
mov eax, dword [ebp - 0x18]
test al, 1
je 0x4039d4
mov dword [esi + 0x1f8], 1
test al, 2
jne 0x4039ef
mov ecx, str.GL_ARB_debug_output
call fcn.00403ca0
test eax, eax
je 0x403a41
cmp dword [ebx + 0x14], 0
je 0x403a41
mov eax, dword [ebp - 0x18]
mov dword [esi + 0x1fc], 1
test al, 8
je 0x403a07
mov dword [esi + 0x200], 1
cmp dword [edi], 4
jge 0x403a1a
cmp dword [edi], 3
jne 0x403a5e
cmp dword [esi + 0x1f0], 2
jl 0x403a5e
lea eax, [ebp - 0x18]
push eax
push 0x9126
call dword [esi + 0x214]
test byte [ebp - 0x18], 2
jne 0x403a54
test byte [ebp - 0x18], 1
je 0x403a46
mov dword [esi + 0x204], 0x32001
jmp 0x403a5e
mov eax, dword [ebp - 0x18]
jmp 0x4039f9
mov ecx, str.GL_ARB_compatibility
call fcn.00403ca0
test eax, eax
je 0x403a5e
mov dword [esi + 0x204], 0x32002
mov ecx, str.GL_ARB_robustness
jmp 0x403a6a
mov ecx, str.GL_EXT_robustness
call fcn.00403ca0
test eax, eax
je 0x403aaa
lea eax, [ebp - 0x18]
push eax
push 0x8256
call dword [esi + 0x214]
cmp dword [ebp - 0x18], 0x8252
jne 0x403a97
mov dword [esi + 0x208], 0x31002
jmp 0x403aaa
cmp dword [ebp - 0x18], 0x8261
jne 0x403aaa
mov dword [esi + 0x208], 0x31001
mov ecx, str.GL_KHR_context_flush_control
call fcn.00403ca0
test eax, eax
je 0x403aec
lea eax, [ebp - 0x18]
push eax
push 0x82fb
call dword [esi + 0x214]
cmp dword [ebp - 0x18], 0
jne 0x403ad9
mov dword [esi + 0x20c], 0x35002
jmp 0x403aec
cmp dword [ebp - 0x18], 0x82fc
jne 0x403aec
mov dword [esi + 0x20c], 0x35001
push str.glClear
call dword [esi + 0x22c]
mov dword [esp], 0x4000
call eax
push esi
call dword [esi + 0x220]
pop ecx
mov ecx, dword [ebp - 0x1c]
call fcn.00403bbd
xor eax, eax
inc eax
jmp 0x403b63
push dword [esi + 0x1f0]
cmp dword [esi + 0x1e4], 0x30001
mov eax, str.Requested_OpenGL_ES_version__i._i__got_version__i._i
push dword [edi]
push dword [ebx + 0xc]
push ecx
mov ecx, str.Requested_OpenGL_version__i._i__got_version__i._i
cmove eax, ecx
push eax
push 0x10007
call fcn.00404b1d
add esp, 0x18
jmp 0x403b59
push str.Entry_point_retrieval_is_broken
push 0x10008
call fcn.00404b1d
pop ecx
pop ecx
mov ecx, dword [ebp - 0x1c]
call fcn.00403bbd
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040e4c9
leave
ret