Function at 0x401e10
Capabilities:
Create thread

Disassembly:
push esi
mov esi, ecx
push esi
call fcn.0040a3d0
mov ecx, eax
call fcn.00409cf0
mov eax, dword [esi + 0xbc]
push eax
call fcn.00407630
mov ecx, eax
call fcn.00406dd0
call fcn.00407b40
mov ecx, eax
call fcn.00407900
push eax
call fcn.00407b40
mov ecx, eax
call fcn.00407910
push eax
call fcn.00407b40
mov ecx, eax
call fcn.004078f0
push eax
call fcn.00407b40
mov ecx, eax
call fcn.004078e0
push eax
call fcn.00407b40
mov ecx, eax
call fcn.004078d0
push eax
call fcn.00407b40
mov ecx, eax
call fcn.004078c0
push eax
call fcn.00407630
mov ecx, eax
call fcn.00406e00
cmp eax, 0xffffffff
jne 0x401eb1
call fcn.00405c70
mov ecx, dword [eax]
push str.ERROR:User_db_open_failed
push eax
call dword [ecx + 4]
add esp, 8
mov byte [esi + 0x8e], 0
or eax, 0xffffffff
pop esi
ret
call fcn.00407b40
mov ecx, eax
call fcn.00407960
push eax
call fcn.00407b40
mov ecx, eax
call fcn.00407970
push eax
call fcn.00407b40
mov ecx, eax
call fcn.00407950
push eax
call fcn.00407b40
mov ecx, eax
call fcn.00407940
push eax
call fcn.00407b40
mov ecx, eax
call fcn.00407930
push eax
call fcn.00407b40
mov ecx, eax
call fcn.00407920
push eax
call fcn.00407630
mov ecx, eax
call fcn.00406eb0
cmp eax, 0xffffffff
jne 0x401f2f
call fcn.00405c70
mov edx, dword [eax]
push str.ERROR:Log_db_open_failed
push eax
call dword [edx + 4]
add esp, 8
mov byte [esi + 0x8e], 0
or eax, 0xffffffff
pop esi
ret
mov eax, dword [esi + 0xbc]
cmp eax, 5
je 0x401f3f
cmp eax, 8
jne 0x401fbd
call fcn.00407b40
mov ecx, eax
call fcn.004079c0
push eax
call fcn.00407b40
mov ecx, eax
call fcn.004079d0
push eax
call fcn.00407b40
mov ecx, eax
call fcn.004079b0
push eax
call fcn.00407b40
mov ecx, eax
call fcn.004079a0
push eax
call fcn.00407b40
mov ecx, eax
call fcn.00407990
push eax
call fcn.00407b40
mov ecx, eax
call fcn.00407980
push eax
call fcn.00407630
mov ecx, eax
call fcn.00406f60
cmp eax, 0xffffffff
jne 0x401fbd
call fcn.00405c70
mov ecx, dword [eax]
push str.ERROR:Terra_db_open_failed
push eax
call dword [ecx + 4]
add esp, 8
mov byte [esi + 0x8e], 0
or eax, 0xffffffff
pop esi
ret
cmp dword [esi + 0xbc], 7
jne 0x402044
call fcn.00407b40
mov ecx, eax
call fcn.00407a20
push eax
call fcn.00407b40
mov ecx, eax
call fcn.00407a30
push eax
call fcn.00407b40
mov ecx, eax
call fcn.00407a10
push eax
call fcn.00407b40
mov ecx, eax
call fcn.00407a00
push eax
call fcn.00407b40
mov ecx, eax
call fcn.004079f0
push eax
call fcn.00407b40
mov ecx, eax
call fcn.004079e0
push eax
call fcn.00407630
mov ecx, eax
call fcn.00407010
cmp eax, 0xffffffff
jne 0x402044
call fcn.00405c70
mov edx, dword [eax]
push str.ERROR:Gsp_db_open_failed
push eax
call dword [edx + 4]
add esp, 8
mov byte [esi + 0x8e], 0
or eax, 0xffffffff
pop esi
ret
cmp dword [esi + 0xbc], 6
jne 0x4020e2
call fcn.00407b40
mov ecx, eax
call fcn.004079c0
push eax
call fcn.00407b40
mov ecx, eax
call fcn.004079d0
push eax
call fcn.00407b40
mov ecx, eax
call fcn.004079b0
push eax
call fcn.00407b40
mov ecx, eax
call fcn.004079a0
push eax
call fcn.00407b40
mov ecx, eax
call fcn.00407990
push eax
call fcn.00407b40
mov ecx, eax
call fcn.00407980
push eax
call fcn.00407630
mov ecx, eax
call fcn.004070c0
cmp eax, 0xffffffff
jne 0x4020cf
push str.ERROR:Thai_DB_Open_Error
call fcn.00405c70
push eax
call fcn.00405d00
add esp, 8
mov byte [esi + 0x8e], 0
or eax, 0xffffffff
pop esi
ret
push str.Thai_DB_Open_OK
call fcn.00405c70
push eax
call fcn.00405d00
add esp, 8
mov ecx, esi
pop esi
jmp 0x404bb0
push ecx
push esi
lea eax, [esp + 4]
push eax
push 0
push ecx
push 0x404660
push 0
push 0
call dword [sym.imp.MSVCR71.dll__beginthreadex]
mov esi, eax
add esp, 0x18
test esi, esi
jne 0x404bf6
push edi
call fcn.00405c70
mov esi, eax
mov edi, dword [esi]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Database_Thread_Create_Error_code_:__d
push esi
call dword [edi + 4]
add esp, 0xc
pop edi
or eax, 0xffffffff
pop esi
pop ecx
ret
call fcn.00405c70
mov ecx, dword [eax]
push str.Database_Thread_Create_OK
push eax
call dword [ecx + 4]
add esp, 8
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, 1
pop esi
pop ecx
ret