Function at 0x4e9960
Capabilities:
Get thread local storage value

Disassembly:
sub esp, 0x114
push ebx
push ebp
mov ebp, dword [esp + 0x124]
push esi
push edi
xor edi, edi
mov ebx, str.Global
mov esi, ebp
mov dword [esp + 0x14], edi
call fcn.004fac30
test al, al
je 0x4e9a7b
mov esi, dword [esp + 0x128]
lea eax, [esi + 0x44]
push eax
mov edi, str.WaterLevel
mov ebx, ebp
call fcn.004fadb0
lea ecx, [esi + 0x4c]
push ecx
mov edi, str.ShadowMaps
call fcn.004fad20
lea edx, [esi + 0x50]
push edx
mov edi, str.ShadowResolution
call fcn.004fad20
lea eax, [esi + 0x48]
push eax
mov edi, str.StraddleHeight
call fcn.004fad20
lea ecx, [esp + 0x10]
push ecx
mov edi, str.SurfEnabled
call fcn.004fad20
mov ebx, dword [esp + 0x10]
test ebx, ebx
lea eax, [esp + 0x10]
setne dl
push eax
mov edi, str.FadingEnabled
mov ebx, ebp
mov byte [esi + 0x7b], dl
call fcn.004fad20
lea ecx, [esp + 0x24]
push ecx
push str.CausticImages
mov edi, ebp
call fcn.004fae40
test al, al
je 0x4e9a38
lea edx, [esp + 0x10]
push edx
mov edi, str.NumCausticImages
call fcn.004fad20
test al, al
je 0x4e9a38
mov esi, dword [esp + 0x10]
test esi, esi
jle 0x4e9a3e
lea eax, [esp + 0x24]
push esi
push eax
call fcn.004ed720
add esp, 8
jmp 0x4e9a3c
mov esi, dword [esp + 0x10]
test esi, esi
mov esi, dword [esp + 0x128]
lea edx, [esi + 0x40]
setne cl
push edx
mov edi, str.NAVTextureScaling
mov ebx, ebp
mov byte [esi + 0x7a], cl
call fcn.004fadb0
lea eax, [esi + 0x3c]
push eax
mov edi, str.LBTextureScaling
call fcn.004fadb0
add esi, 0x38
push esi
mov edi, str.LPTextureScaling
call fcn.004fadb0
mov edi, dword [esp + 0x14]
mov ebx, str.Canopy
mov esi, ebp
call fcn.004fac30
test al, al
je 0x4e9b9f
lea ecx, [esp + 0x10]
push ecx
mov edi, str.CanopyPoolSize
mov ebx, ebp
call fcn.004fad20
lea edx, [esp + 0x24]
push edx
push str.CanopyModel
mov edi, ebp
call fcn.004fae40
lea eax, [esp + 0x18]
push eax
mov edi, str.CanopyDimX
call fcn.004fadb0
lea ecx, [esp + 0x1c]
push ecx
mov edi, str.CanopyDimY
call fcn.004fadb0
lea edx, [esp + 0x20]
push edx
mov edi, str.CanopyScale
call fcn.004fadb0
lea edi, [esp + 0x24]
call fcn.00501dd0
mov edi, eax
test edi, edi
je 0x4e9b84
mov ebx, dword [edi + 4]
inc ebx
push 0x18
mov dword [esp + 0x18], edi
mov dword [edi + 4], ebx
call fcn.005354b8
mov ebx, dword [esp + 0x14]
add esp, 4
test eax, eax
je 0x4e9b3c
mov ecx, dword [edi + 0xc0]
test ecx, ecx
ja 0x4e9b1c
xor ecx, ecx
jmp 0x4e9b24
mov ecx, dword [edi + 0xb8]
mov ecx, dword [ecx]
test ecx, ecx
push ebx
push ecx
mov edx, esp
mov dword [edx], ecx
je 0x4e9b31
inc dword [ecx + 4]
mov esi, eax
call fcn.004ef920
mov ecx, eax
jmp 0x4e9b3e
xor ecx, ecx
test ebx, ebx
mov esi, dword [esp + 0x128]
mov dword [esi + 0x84], ecx
jne 0x4e9b56
mov eax, 0x14
jmp 0x4e9b5d
mov eax, ebx
cdq
sub eax, edx
sar eax, 1
push eax
push ecx
call fcn.004ef860
mov edx, dword [esp + 0x20]
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x18]
push edx
mov edx, dword [esi + 0x84]
push eax
push ecx
push edx
call fcn.004eac50
add esp, 0x10
jmp 0x4e9b9b
lea eax, [esp + 0x24]
push eax
push str.Error_loading_canopy_model:__s
mov eax, 1
call fcn.004fa160
add esp, 8
mov edi, dword [esp + 0x14]
mov ebx, str.TerrainPaging
mov esi, ebp
call fcn.004fac30
test al, al
je 0x4e9d69
xor esi, esi
mov dword [esp + 0x10], esi
lea esp, [esp]
xor ebp, ebp
cmp esi, 5
ja case.default.0x4e9bcb
jmp dword [esi*4 + 0x4e9d88]
mov ecx, dword [str.Recalc_]
mov edx, dword [0x712138]
mov dword [esp + 0x24], ecx
mov dword [esp + 0x28], edx
jmp case.default.0x4e9bcb
mov eax, dword [str.CreateCell_]
mov ecx, dword [0x71212c]
mov edx, dword [0x712130]
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], ecx
mov dword [esp + 0x2c], edx
jmp case.default.0x4e9bcb
mov eax, dword [str.StreamCell_]
mov ecx, dword [0x712120]
mov edx, dword [0x712124]
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], ecx
mov dword [esp + 0x2c], edx
jmp case.default.0x4e9bcb
mov eax, dword [str.UnstreamCell_]
mov ecx, dword [0x712110]
mov edx, dword [0x712114]
mov dword [esp + 0x24], eax
mov ax, word [0x712118]
mov dword [esp + 0x28], ecx
mov dword [esp + 0x2c], edx
mov word [esp + 0x30], ax
jmp case.default.0x4e9bcb
mov ecx, dword [str.StreamMap_]
mov edx, dword [0x712104]
mov ax, word [0x712108]
mov dword [esp + 0x24], ecx
mov cl, byte [0x71210a]
mov dword [esp + 0x28], edx
mov word [esp + 0x2c], ax
mov byte [esp + 0x2e], cl
jmp case.default.0x4e9bcb
mov edx, dword [str.UnstreamMap_]
mov eax, dword [0x7120f4]
mov ecx, dword [0x7120f8]
mov dword [esp + 0x24], edx
mov dl, byte [0x7120fc]
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], ecx
mov byte [esp + 0x30], dl
test ebp, ebp
jne 0x4e9cd4
lea edi, [esp + 0x24]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x4e9cb1
mov eax, dword [str.RADIUS]
mov cx, word [0x7120ec]
mov dl, byte [0x7120ee]
mov dword [edi], eax
mov word [edi + 4], cx
mov byte [edi + 6], dl
mov ebx, dword [esp + 0x12c]
lea eax, [esp + 0x18]
push eax
lea edi, [esp + 0x28]
call fcn.004fadb0
test al, al
je 0x4e9d4d
mov eax, dword [0x728c28]
cmp eax, 0xffffffff
mov ecx, dword [esp + 0x128]
mov edi, dword [ecx + 0x88]
mov esi, dword [0x72905c]
je 0x4e9d21
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
test eax, eax
je 0x4e9d21
or edx, 0xffffffff
mov ecx, esi
call fcn.004fc390
jmp 0x4e9d2a
push 0xffffffffffffffff
push esi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov edx, dword [esp + 0x10]
fld dword [esp + 0x18]
lea eax, [edx + ebp]
fstp dword [edi + eax*4 + 0xa4]
mov ecx, dword [0x72905c]
push ecx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov esi, dword [esp + 0x10]
inc ebp
cmp ebp, 1
jb 0x4e9bc2
inc esi
cmp esi, 6
mov dword [esp + 0x10], esi
jb 0x4e9bc0
mov edi, dword [esp + 0x14]
test edi, edi
je 0x4e9d7a
dec dword [edi + 4]
jne 0x4e9d7a
mov edx, dword [edi]
push 1
mov ecx, edi
call dword [edx]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x114
ret 8