Function at 0x4aaad4
Capabilities:
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffec
push ebx
push esi
push edi
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
cmp byte [eax + 0x1f], 0
je 0x4aac97
mov eax, dword [ebp - 8]
movzx eax, word [eax + 4]
sub ax, 4
jae 0x4aac97
mov eax, dword [ebp - 8]
movzx eax, word [eax + 4]
sub ax, 2
jb 0x4aab16
sub ax, 2
jb 0x4aab37
jmp 0x4aab5d
mov eax, dword [ebp - 4]
movzx ebx, word [eax + 8]
mov eax, ebx
mov edx, dword [ebp - 4]
mov ecx, dword [edx + 0x40]
cdq
idiv ecx
mov dword [ebp - 0xc], eax
mov eax, ebx
cdq
idiv ecx
mov dword [ebp - 0x10], edx
mov edi, ecx
jmp 0x4aab69
mov eax, dword [ebp - 4]
movzx eax, word [eax + 0xa]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 4]
mov ebx, dword [eax + 0x3c]
mov eax, dword [ebp - 0xc]
cdq
idiv ebx
mov dword [ebp - 0x10], edx
mov eax, dword [ebp - 0xc]
cdq
idiv ebx
mov dword [ebp - 0xc], eax
mov edi, ebx
jmp 0x4aab69
xor edi, edi
xor eax, eax
mov dword [ebp - 0xc], eax
xor eax, eax
mov dword [ebp - 0x10], eax
xor eax, eax
mov dword [ebp - 0x14], eax
test edi, edi
jle 0x4aac17
call fcn.0040be88
mov ebx, eax
mov esi, ebx
sub esi, dword [ebp - 0x14]
mov eax, dword [ebp - 4]
cmp esi, dword [eax + 0x20]
jae 0x4aab98
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x20]
sub eax, esi
push eax
call sub.KERNEL32.DLL_TlsSetValue
mov dword [ebp - 0x14], ebx
mov eax, dword [ebp - 8]
movzx eax, word [eax + 4]
sub ax, 1
jb 0x4aabb6
je 0x4aabc9
dec ax
je 0x4aabdc
dec ax
je 0x4aabef
jmp 0x4aac00
mov eax, dword [ebp - 4]
mov edx, dword [eax + 0xc]
sub edx, dword [ebp - 0xc]
mov eax, dword [ebp - 4]
call fcn.004aae48
jmp 0x4aac00
mov eax, dword [ebp - 4]
mov edx, dword [eax + 0xc]
add edx, dword [ebp - 0xc]
mov eax, dword [ebp - 4]
call fcn.004aae48
jmp 0x4aac00
mov eax, dword [ebp - 4]
mov edx, dword [eax + 0xc]
sub edx, dword [ebp - 0xc]
mov eax, dword [ebp - 4]
call fcn.004aae48
jmp 0x4aac00
mov eax, dword [ebp - 4]
mov edx, dword [eax + 0xc]
add edx, dword [ebp - 0xc]
mov eax, dword [ebp - 4]
call fcn.004aae48
mov eax, dword [ebp - 4]
mov eax, dword [eax + 4]
mov edx, dword [eax]
call dword [edx + 0x9c]
dec edi
test edi, edi
jg 0x4aab76
cmp dword [ebp - 0x10], 0
jle case.default.0x4aaca7
mov eax, dword [ebp - 8]
movzx eax, word [eax + 4]
sub ax, 1
jb 0x4aac3f
je 0x4aac55
dec ax
je 0x4aac6b
dec ax
je 0x4aac81
jmp case.default.0x4aaca7
mov eax, dword [ebp - 4]
mov edx, dword [eax + 0xc]
sub edx, dword [ebp - 0x10]
mov eax, dword [ebp - 4]
call fcn.004aae48
jmp case.default.0x4aaca7
mov eax, dword [ebp - 4]
mov edx, dword [eax + 0xc]
add edx, dword [ebp - 0x10]
mov eax, dword [ebp - 4]
call fcn.004aae48
jmp case.default.0x4aaca7
mov eax, dword [ebp - 4]
mov edx, dword [eax + 0xc]
sub edx, dword [ebp - 0x10]
mov eax, dword [ebp - 4]
call fcn.004aae48
jmp case.default.0x4aaca7
mov eax, dword [ebp - 4]
mov edx, dword [eax + 0xc]
add edx, dword [ebp - 0x10]
mov eax, dword [ebp - 4]
call fcn.004aae48
jmp case.default.0x4aaca7
mov eax, dword [ebp - 8]
movsx eax, word [eax + 4]
cmp eax, 7
ja case.default.0x4aaca7
jmp dword [eax*4 + 0x4aacae]
mov eax, dword [ebp - 4]
mov edx, dword [eax + 0xc]
mov eax, dword [ebp - 4]
movzx eax, word [eax + 8]
sub edx, eax
mov eax, dword [ebp - 4]
call fcn.004aae48
jmp case.default.0x4aaca7
mov eax, dword [ebp - 4]
mov edx, dword [eax + 0xc]
mov eax, dword [ebp - 4]
movzx eax, word [eax + 8]
add edx, eax
mov eax, dword [ebp - 4]
call fcn.004aae48
jmp case.default.0x4aaca7
xor ecx, ecx
mov dl, 1
mov eax, dword [ebp - 4]
call fcn.004aa9d0
mov edx, dword [ebp - 4]
mov edx, dword [edx + 0xc]
sub edx, eax
mov eax, dword [ebp - 4]
call fcn.004aae48
jmp case.default.0x4aaca7
xor ecx, ecx
mov dl, 1
mov eax, dword [ebp - 4]
call fcn.004aa9d0
mov edx, eax
mov eax, dword [ebp - 4]
add edx, dword [eax + 0xc]
mov eax, dword [ebp - 4]
call fcn.004aae48
jmp case.default.0x4aaca7
mov eax, dword [ebp - 4]
cmp dword [eax + 0x14], 0x7fff
jle 0x4aad67
push ebp
call fcn.004aaa78
pop ecx
mov edx, eax
mov eax, dword [ebp - 4]
call fcn.004aae48
jmp case.default.0x4aaca7
mov edx, dword [ebp - 8]
movsx edx, word [edx + 6]
mov eax, dword [ebp - 4]
call fcn.004aae48
jmp case.default.0x4aaca7
mov eax, dword [ebp - 4]
cmp byte [eax + 0x1d], 0
je case.default.0x4aaca7
mov eax, dword [ebp - 4]
cmp dword [eax + 0x14], 0x7fff
jle 0x4aada0
push ebp
call fcn.004aaa78
pop ecx
mov edx, eax
mov eax, dword [ebp - 4]
call fcn.004aae48
jmp case.default.0x4aaca7
mov edx, dword [ebp - 8]
movsx edx, word [edx + 6]
mov eax, dword [ebp - 4]
call fcn.004aae48
jmp case.default.0x4aaca7
xor edx, edx
mov eax, dword [ebp - 4]
call fcn.004aae48
jmp case.default.0x4aaca7
mov eax, dword [ebp - 4]
mov edx, dword [eax + 0x14]
mov eax, dword [ebp - 4]
call fcn.004aae48
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret