Function at 0x431880
Capabilities:
Get thread local storage value

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x704
push ebx
push esi
mov esi, ecx
xor ebx, ebx
mov dword [esp + 0xc], ebx
push edi
mov dword [esp + 0xc], esi
lea edi, [ebx + 1]
mov dword [esi], 0x62068c
cmp byte [esi + 0x24], bl
je 0x4318ec
mov ecx, 0xa3c244
mov dword [esp + 0x2c], 0xffffffff
call fcn.004269c0
mov esi, eax
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp byte [0xa3c260], bl
mov eax, 4
cmovne eax, edi
sub dword [0xa3c270], edi
jne 0x4318e1
push eax
call dword [sym.imp.WINMM.dll_timeEndPeriod]
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov esi, dword [esp + 0xc]
xor edi, edi
mov dword [esp + 0x14], edi
mov ecx, esi
call fcn.00432920
cmp dword [esi + 0x1c], 0
jne 0x431963
mov edi, dword [esi + 0xb4]
lea eax, [esi + 0xc]
mov dword [esp + 0x10], edi
mov dword [esp + 0x28], eax
test bl, 8
je 0x431921
lea ecx, [esp + 0x30]
and ebx, 0xfffffff7
call fcn.0041f860
lea esi, [edi + 0xc]
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [edi + 0x34], 0
jne 0x431937
mov byte [edi + 0x40], 0
jmp 0x431943
push dword [esp + 0x28]
lea ecx, [edi + 0x24]
call fcn.00437ef0
mov eax, dword [esp + 0x10]
mov edi, dword [edi + 8]
push esi
mov dword [eax + 8], 0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov esi, dword [esp + 0xc]
add dword [esi + 0x20], edi
mov edi, dword [esp + 0x14]
mov ecx, esi
call fcn.00432920
test al, al
je 0x43197c
inc edi
mov dword [esp + 0x14], edi
cmp edi, 0x64
jl 0x4318f2
test bl, 4
je 0x431990
lea ecx, [esp + 0xe0]
and ebx, 0xfffffffb
call fcn.0041f860
mov eax, dword [esi + 0x5c]
sub eax, dword [esi + 0x58]
test eax, 0xfffffffc
je 0x431b0d
lea eax, [esi + 0x54]
push eax
lea ecx, [esp + 0x1c]
call fcn.004335e0
mov edi, dword [esp + 0x18]
mov esi, dword [esp + 0x20]
test edi, edi
je 0x431b0d
test bl, 0x10
je 0x4319d2
lea ecx, [esp + 0x190]
and ebx, 0xffffffef
call fcn.0041f860
cmp byte [edi + 5], 0
je 0x431a47
cmp dword [esp + 0x1c], 0
je 0x431a47
test bl, 0x20
je 0x4319f3
lea ecx, [esp + 0x240]
and ebx, 0xffffffdf
call fcn.0041f860
test bl, bl
jns 0x431a09
lea ecx, [esp + 0x2f0]
and ebx, 0xffffff7f
call fcn.0041f860
mov ecx, dword [esp + 0x24]
xor eax, eax
cmp byte [edi + 5], al
cmovne eax, dword [esp + 0x1c]
mov edx, dword [eax + 4]
mov eax, dword [eax + 8]
sub eax, edx
sar eax, 2
cmp eax, ecx
mov dword [esp + 0x10], eax
cmovb ecx, eax
cmp esi, ecx
jae 0x431a47
lea eax, [edx + esi*4]
cmp dword [eax], 0
jne 0x431c30
inc esi
add eax, 4
mov dword [esp + 0x20], esi
cmp esi, ecx
jb 0x431a32
test edi, edi
je 0x431b0d
test ebx, 0x100
je 0x431a69
lea ecx, [esp + 0x3a0]
and ebx, 0xfffffeff
call fcn.0041f860
cmp byte [edi + 5], 0
je 0x431af8
mov esi, dword [esp + 0x1c]
test esi, esi
je 0x431af8
test ebx, 0x200
je 0x431a95
lea ecx, [esp + 0x450]
and ebx, 0xfffffdff
call fcn.0041f860
test ebx, 0x800
je 0x431aaf
lea ecx, [esp + 0x500]
and ebx, 0xfffff7ff
call fcn.0041f860
xor eax, eax
cmp byte [edi + 5], al
cmovne eax, esi
add dword [eax + 0x10], 0xffffffff
jne 0x431af8
test ebx, 0x1000
je 0x431ad7
lea ecx, [esp + 0x5b0]
and ebx, 0xffffefff
call fcn.0041f860
test ebx, 0x4000
je 0x431aeb
lea ecx, [esp + 0x660]
call fcn.0041f860
xor ecx, ecx
cmp byte [edi + 5], cl
cmovne ecx, esi
call fcn.00433570
or eax, 0xffffffff
lock xadd dword [edi], eax
sub eax, 1
jne 0x431b0d
push edi
call fcn.004c2207
add esp, 4
mov ebx, dword [esp + 0xc]
mov esi, dword [ebx + 0xc0]
mov dword [ebx + 0xc0], 0
test esi, esi
je 0x431b35
mov ecx, esi
call fcn.0043c8e0
push esi
call fcn.004c2207
add esp, 4
mov edi, dword [ebx + 0xb4]
lea esi, [edi + 0xc]
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push esi
mov dword [edi + 0x38], 0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [ebx + 0xb4]
or edi, 0xffffffff
mov dword [ebx + 0xb4], 0
test ecx, ecx
je 0x431b87
lea edx, [ecx + 4]
mov eax, edi
lock xadd dword [edx], eax
sub eax, 1
jne 0x431b87
test edx, edx
cmove ecx, eax
test ecx, ecx
je 0x431b87
mov eax, dword [ecx]
push 1
call dword [eax]
mov ecx, dword [ebx + 0xb8]
mov dword [ebx + 0xb8], 0
test ecx, ecx
je 0x431bb3
lea edx, [ecx + 4]
mov eax, edi
lock xadd dword [edx], eax
sub eax, 1
jne 0x431bb3
test edx, edx
cmove ecx, eax
mov eax, dword [ecx]
call dword [eax + 0xc]
mov ecx, dword [ebx + 0xbc]
mov dword [ebx + 0xbc], 0
test ecx, ecx
je 0x431bdf
lea edx, [ecx + 4]
mov eax, edi
lock xadd dword [edx], eax
sub eax, 1
jne 0x431bdf
test edx, edx
cmove ecx, eax
mov eax, dword [ecx]
call dword [eax + 0xc]
call fcn.00432f00
push dword [eax]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
cmp eax, ebx
jne 0x431c6f
mov eax, dword [0xa3c340]
test eax, 0xfffffffe
jne 0x431c60
mov edx, 0xa3c340
xor eax, eax
mov ecx, 1
lock cmpxchg dword [edx], ecx
test eax, eax
je 0x431c51
mov eax, dword [0xa3c340]
cmp eax, 1
jne 0x431c60
mov esi, dword [sym.imp.KERNEL32.dll_Sleep]
push 0
call esi
mov eax, dword [0xa3c340]
cmp eax, 1
je 0x431c20
jmp 0x431c60
cmp esi, ecx
jae 0x431a47
mov ecx, dword [edx + esi*4]
inc esi
mov dword [esp + 0x20], esi
test ecx, ecx
je 0x431a47
mov eax, dword [ecx]
call dword [eax]
jmp 0x4319b6
mov ecx, 0xa3c344
call fcn.00433130
mov dword [0xa3c340], eax
mov ecx, dword [0xa3c340]
xor edx, edx
mov ecx, dword [ecx]
call fcn.00438500
mov esi, dword [ebx + 0xc0]
mov dword [ebx + 0xc0], 0
test esi, esi
je 0x431c93
mov ecx, esi
call fcn.0043c8e0
push esi
call fcn.004c2207
add esp, 4
mov edx, dword [ebx + 0xbc]
test edx, edx
je 0x431cb7
lea esi, [edx + 4]
mov eax, edi
lock xadd dword [esi], eax
sub eax, 1
jne 0x431cb7
xor ecx, ecx
test esi, esi
cmovne ecx, edx
mov eax, dword [ecx]
call dword [eax + 0xc]
mov edx, dword [ebx + 0xb8]
test edx, edx
je 0x431cdb
lea esi, [edx + 4]
mov eax, edi
lock xadd dword [esi], eax
sub eax, 1
jne 0x431cdb
xor ecx, ecx
test esi, esi
cmovne ecx, edx
mov eax, dword [ecx]
call dword [eax + 0xc]
mov ecx, dword [ebx + 0xb4]
test ecx, ecx
je 0x431d01
lea edx, [ecx + 4]
mov eax, edi
lock xadd dword [edx], eax
sub eax, 1
jne 0x431d01
test edx, edx
je 0x431d01
test ecx, ecx
je 0x431d01
mov eax, dword [ecx]
push 1
call dword [eax]
lea ecx, [ebx + 0x98]
call fcn.004330a0
lea ecx, [ebx + 0x78]
call fcn.004051e0
mov eax, dword [ebx + 0x70]
test eax, eax
je 0x431d2d
lock xadd dword [eax], edi
sub edi, 1
jne 0x431d2d
push eax
mov eax, dword [eax + 4]
call eax
add esp, 4
lea ecx, [ebx + 0x54]
call fcn.004330a0
lea ecx, [ebx + 0x40]
call fcn.00433180
push dword [ebx + 0x40]
call fcn.004c2207
mov dword [ebx + 0x40], 0
add esp, 4
mov ecx, dword [ebx + 0x28]
test ecx, ecx
je 0x431d9b
push dword [esp + 0x2c]
mov edx, dword [ebx + 0x2c]
push ecx
call fcn.00433a00
mov esi, dword [ebx + 0x28]
mov eax, 0x2aaaaaab
mov ecx, dword [ebx + 0x30]
add esp, 8
sub ecx, esi
imul ecx
sar edx, 3
mov eax, edx
shr eax, 0x1f
add eax, edx
push eax
push esi
call fcn.00422400
mov dword [ebx + 0x28], 0
mov dword [ebx + 0x2c], 0
mov dword [ebx + 0x30], 0
lea ecx, [ebx + 0xc]
call fcn.00433180
push dword [ebx + 0xc]
call fcn.004c2207
mov dword [ebx + 0xc], 0
add esp, 4
mov ecx, dword [ebx + 4]
mov dword [ebx + 4], 0
test ecx, ecx
je 0x431dc9
mov eax, dword [ecx]
push 1
call dword [eax]
pop edi
pop esi
mov dword [ebx], 0x62067c
pop ebx
mov esp, ebp
pop ebp
ret