Function at 0x4171b0
Capabilities:
Allocate thread local storage
Get thread local storage value
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0xd4
mov eax, dword [0x4bf6bc]
xor eax, esp
mov dword [esp + 0xd0], eax
mov eax, dword [ebp + 8]
push ebx
push esi
mov dword [esp + 0x18], eax
mov eax, dword [ebp + 0xc]
xor esi, esi
mov ebx, ecx
mov dword [esp + 0x14], eax
mov dword [eax], esi
mov eax, dword [ebx + 0x30]
push edi
mov edi, edx
mov dword [esp + 0x14], edi
mov dword [esp + 0x10], esi
cmp eax, 0xa029a697
jne 0x41728d
mov dword [ebx + 0x30], 0xf03b7906
cmp dword [ebx], esi
jle 0x41723a
mov dword [esp + 0xc], esi
jmp 0x417210
mov ecx, dword [ebx + 4]
mov edx, dword [esp + 0xc]
mov edi, dword [edx + ecx + 4]
test edi, edi
je 0x41722c
call fcn.00420ff0
test eax, eax
jne 0x4172b9
add dword [esp + 0xc], 0x18
inc esi
cmp esi, dword [ebx]
jl 0x417210
mov edi, dword [esp + 0x14]
push 0xb4
lea eax, [esp + 0x24]
push 0
push eax
call fcn.00483260
mov edx, dword [esp + 0x28]
add esp, 0xc
lea ecx, [esp + 0x10]
push ecx
push edx
lea eax, [esp + 0x28]
push eax
mov dword [esp + 0x2c], ebx
call fcn.0042ffe0
add esp, 0xc
cmp dword [0x4c3c38], 0
je 0x41732b
cmp dword [0x4c3c44], 0
jle 0x41732b
mov eax, 7
jmp 0x417336
cmp eax, 0xf03b7906
jne 0x41729f
or dword [ebx + 8], 4
mov dword [ebx + 0x30], 0xb5357930
mov eax, 0x15
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0xd0]
xor ecx, esp
call fcn.0047bd9c
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebx + 4]
lea eax, [esi + esi*2]
mov edx, dword [ecx + eax*8]
push edx
push str.database_schema_is_locked:__s
push 6
mov ecx, ebx
call fcn.004186f0
mov eax, dword [ebx + 0x30]
add esp, 0xc
cmp eax, 0xf03b7906
jne 0x4172ff
mov dword [ebx + 0x30], 0xa029a697
mov eax, 6
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0xd0]
xor ecx, esp
call fcn.0047bd9c
mov esp, ebp
pop ebp
ret
cmp eax, 0xa029a697
jne 0x417311
or dword [ebx + 8], 4
mov dword [ebx + 0x30], 0xb5357930
mov eax, 6
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0xd0]
xor ecx, esp
call fcn.0047bd9c
mov esp, ebp
pop ebp
ret
mov eax, dword [esp + 0x24]
cmp eax, 0x65
jne 0x41733a
xor eax, eax
mov dword [esp + 0x24], eax
cmp byte [esp + 0x32], 0
je 0x41735c
push ebx
call fcn.00416fb0
add esp, 4
test eax, eax
jne 0x417358
mov dword [esp + 0x24], 0x11
jmp 0x417361
mov eax, dword [esp + 0x24]
cmp eax, 0x11
jne 0x41736f
push 0
call fcn.00428770
mov eax, dword [esp + 0x28]
add esp, 4
test edi, edi
je 0x41737c
mov ecx, dword [esp + 0xc0]
mov dword [edi], ecx
mov edi, eax
test eax, eax
jne 0x417541
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x417545
mov cl, byte [esp + 0xa0]
test cl, cl
je 0x417545
push eax
cmp cl, 2
jne 0x417442
lea eax, [edi + 3]
call fcn.00425880
add esp, 4
cmp dword [0x4c3c38], edi
je 0x4173c6
cmp dword [0x4c3c44], edi
jg 0x4173e1
mov edx, dword [esp + 0x2c]
mov eax, dword [edx + 0x34]
push 0
push 1
push 0xffffffffffffffff
push str.order
push eax
call fcn.00424190
add esp, 0x14
cmp dword [0x4c3c38], 0
je 0x4173f3
cmp dword [0x4c3c44], 0
jg 0x417411
mov ecx, dword [esp + 0x2c]
mov edx, dword [ecx + 0x34]
push 0
push 1
push 0xffffffffffffffff
add edx, 0x40
push str.from
push edx
call fcn.00424190
add esp, 0x14
cmp dword [0x4c3c38], 0
je 0x417427
cmp dword [0x4c3c44], 0
jg 0x417541
mov eax, dword [esp + 0x2c]
mov ecx, dword [eax + 0x34]
push 0
push 1
push 0xffffffffffffffff
push str.detail
sub ecx, 0xffffff80
push ecx
jmp 0x417539
mov eax, 5
call fcn.00425880
add esp, 4
cmp dword [0x4c3c38], 0
je 0x417461
cmp dword [0x4c3c44], 0
jg 0x41747c
mov edx, dword [esp + 0x2c]
mov eax, dword [edx + 0x34]
push 0
push 1
push 0xffffffffffffffff
push str.addr
push eax
call fcn.00424190
add esp, 0x14
cmp dword [0x4c3c38], 0
je 0x41748e
cmp dword [0x4c3c44], 0
jg 0x4174ac
mov ecx, dword [esp + 0x2c]
mov edx, dword [ecx + 0x34]
push 0
push 1
push 0xffffffffffffffff
add edx, 0x40
push str.opcode
push edx
call fcn.00424190
add esp, 0x14
cmp dword [0x4c3c38], 0
je 0x4174be
cmp dword [0x4c3c44], 0
jg 0x4174dc
mov eax, dword [esp + 0x2c]
mov ecx, dword [eax + 0x34]
push 0
push 1
push 0xffffffffffffffff
sub ecx, 0xffffff80
push 0x4aef64
push ecx
call fcn.00424190
add esp, 0x14
cmp dword [0x4c3c38], 0
je 0x4174ee
cmp dword [0x4c3c44], 0
jg 0x41750e
mov edx, dword [esp + 0x2c]
mov eax, dword [edx + 0x34]
push 0
push 1
push 0xffffffffffffffff
add eax, 0xc0
push 0x4aef68
push eax
call fcn.00424190
add esp, 0x14
cmp dword [0x4c3c38], 0
je 0x417520
cmp dword [0x4c3c44], 0
jg 0x417541
mov ecx, dword [esp + 0x2c]
mov edx, dword [ecx + 0x34]
push 0
push 1
push 0xffffffffffffffff
push 0x4aef6c
add edx, 0x100
push edx
call fcn.00424190
add esp, 0x14
mov eax, dword [esp + 0x2c]
mov ecx, dword [ebx + 0x30]
cmp ecx, 0xf03b7906
jne 0x417563
mov dword [ebx + 0x30], 0xa029a697
test edi, edi
jne 0x41757b
mov ecx, dword [esp + 0x18]
mov dword [ecx], eax
jmp 0x4175aa
cmp ecx, 0xa029a697
jne 0x417576
or dword [ebx + 8], 4
mov dword [ebx + 0x30], 0xb5357930
mov edi, 0x15
test eax, eax
je 0x4175aa
mov ecx, dword [eax + 0x50]
mov esi, eax
cmp ecx, 0xbdf20da3
je 0x41759e
cmp ecx, 0x519c2973
je 0x41759e
cmp ecx, 0x26bceaa5
je 0x4175a3
jmp 0x4175aa
call fcn.00426090
mov eax, esi
call fcn.004261c0
mov eax, dword [esp + 0x10]
mov ecx, ebx
test eax, eax
je 0x4175d6
push eax
push 0x4aef70
push edi
call fcn.004186f0
mov eax, dword [esp + 0x1c]
add esp, 0xc
test eax, eax
je 0x4175e1
push eax
call fcn.0047c501
add esp, 4
jmp 0x4175e1
push 0
push edi
call fcn.004186f0
add esp, 8
cmp dword [0x4c3c38], 0
mov esi, 1
je 0x417619
cmp dword [0x4c3c44], 0
jle 0x417619
sub dword [0x4c3c44], esi
push 0
push 7
mov ecx, ebx
mov dword [0x4c3c38], 0
call fcn.004186f0
add esp, 8
lea edi, [esi + 6]
cmp dword [0x4c3c48], 0
jne 0x417646
add dword [0x4c3c44], esi
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
sub dword [0x4c3c44], esi
mov dword [0x4c38a4], eax
cmp eax, 0xffffffff
je 0x41768e
mov dword [0x4c3c48], esi
jmp 0x41764b
mov eax, dword [0x4c38a4]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
test eax, eax
je 0x41768e
mov ecx, 0x4ad1d4
mov esi, eax
mov edx, 0xc
sub esi, ecx
mov ebx, dword [esi + ecx]
cmp ebx, dword [ecx]
jne 0x41768e
sub edx, 4
add ecx, 4
cmp edx, 4
jae 0x417664
push eax
call fcn.0047c501
mov edx, dword [0x4c38a4]
add esp, 4
push 0
push edx
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov ecx, dword [esp + 0xdc]
mov eax, edi
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0047bd9c
mov esp, ebp
pop ebp
ret