Code:
/* decompiler.
Copyright (c) 2009
Detected compiler: Visual C++
*/
#include <windows.h>
#include <defs.h>
//-------------------------------------------------------------------------
// Data declarations
extern int dword_CC0020[13587448]; // weak
extern _UNKNOWN sub_4098F00; // weak
extern char byte_40A9B04[]; // idb
extern const WCHAR SrcStr; // idb
extern int dword_40A9B10[6]; // weak
extern int dword_40A9B28[3]; // weak
extern const CHAR byte_40AB408; // idb
extern char ProcName[2]; // idb
extern char ModuleName[6]; // idb
extern int dword_40AB444[495]; // weak
extern int dword_40AC148[10]; // weak
extern int dword_40AC4CC[5]; // weak
extern int dword_40AC4E0; // weak
extern int dword_40AC6EC; // weak
extern int dword_40AC700; // weak
extern int (__cdecl *dword_40AC704)(_DWORD, _DWORD, _DWORD); // weak
extern int dword_40AC720; // weak
extern int (*dword_40AC77C)(void); // weak
extern int (__stdcall *dword_40AC7AC)(_DWORD); // weak
extern int (__stdcall *dword_40AC828)(_DWORD); // weak
extern int (__stdcall *dword_40AC874)(_DWORD); // weak
extern int (__stdcall *dword_40AC87C)(_DWORD); // weak
extern int (__stdcall *dword_40AC884)(_DWORD, _DWORD); // weak
extern int (__stdcall *dword_40AC888)(_DWORD, _DWORD); // weak
extern int (__stdcall *dword_40AC88C)(_DWORD, _DWORD, _DWORD); // weak
extern int (__stdcall *dword_40AC890)(_DWORD, _DWORD); // weak
extern int (__stdcall *dword_40AC894)(_DWORD); // weak
extern int (__stdcall *dword_40AC898)(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD); // weak
extern int (__stdcall *dword_40AC89C)(_DWORD, _DWORD); // weak
extern int (__stdcall *dword_40AC8A0)(_DWORD); // weak
extern int (__stdcall *dword_40AC8A4)(_DWORD); // weak
extern int (__stdcall *dword_40AC8A8)(_DWORD); // weak
extern int (__stdcall *dword_40AC8AC)(_DWORD); // weak
extern int (__stdcall *dword_40AC8B0)(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD); // weak
extern int (__stdcall *dword_40AC8B4)(_DWORD, _DWORD, _DWORD, _DWORD); // weak
extern int (__stdcall *dword_40AC8B8)(_DWORD); // weak
extern int (__stdcall *dword_40AC8BC)(_DWORD); // weak
extern int (__stdcall *dword_40AC8C0)(_DWORD); // weak
extern int (__stdcall *dword_40AC8C4)(_DWORD, _DWORD); // weak
extern struct _RTL_CRITICAL_SECTION stru_40AC9B8; // idb
extern struct _RTL_CRITICAL_SECTION CriticalSection; // idb
extern _DWORD dword_40B0AD8; // idb
extern _DWORD dword_40B0ADC; // idb
extern int dword_40B0AE8; // weak
extern int dword_40B0AF0; // weak
extern int dword_40B0AFC; // weak
extern int dword_40B0B10; // weak
extern int dword_40B1170; // weak
extern LCID Locale; // idb
extern int dword_40B118C; // weak
extern int dword_40B1194; // weak
//-------------------------------------------------------------------------
// Function declarations
#define __thiscall __cdecl // Test compile in C mode
// void __usercall sub_4097060(int a1<esi>);
bool __thiscall sub_40970D6(int this, int a2, int *a3);
LRESULT __stdcall sub_409715E(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
signed int __stdcall sub_4097216(int a1, int a2);
int __stdcall sub_4097271(int a1);
int __cdecl sub_4097454(int a1);
int __cdecl loc_409746C(int); // weak
signed int __cdecl sub_4097474(int a1, int a2, int a3, int a4);
// int __usercall sub_4097496<eax>(int a1<ebp>, int a2, int a3);
// int __userpurge sub_409752A<eax>(int result<eax>, int a2<ebp>, int a3);
// signed int __usercall sub_409754C<eax>(int a1<ebp>);
int __thiscall sub_409786E(int this, int CharType);
// int __usercall sub_40979EA<eax>(int a1<ecx>, int a2<ebx>, int a3<esi>, signed int *a4);
// int __usercall sub_4097A80<eax>(int a1<eax>, int a2<ebx>, int a3<edi>, int a4<esi>, LCID Locale, DWORD dwMapFlags, LPCSTR lpMultiByteStr, int cbMultiByte, LPSTR lpDestStr, int cchDest, UINT CodePage, int a12);
int __cdecl sub_4097CA4(int a1, int a2);
// BOOL __usercall sub_4097CCF<eax>(int a1<ecx>, int a2<ebx>, int a3<edi>, int a4<esi>, signed int CharType, int a6);
// BOOL __usercall sub_4097DBF<eax>(int a1<eax>, int a2<ebx>, int a3<edi>, int a4<esi>, DWORD dwInfoType, LPCSTR lpMultiByteStr, int cbMultiByte, LPWORD lpCharType, UINT CodePage, LCID Locale, int a11);
void *__cdecl sub_4097F10(void *a1, unsigned __int8 a2, unsigned int a3);
// int __stdcall RtlUnwind(_DWORD, _DWORD, _DWORD, _DWORD); weak
int __cdecl sub_409800C(unsigned int a1, int a2, unsigned int a3);
int __thiscall sub_4098130(int this, int a2, int a3, int a4, int a5);
signed int __thiscall sub_40982F0(int this);
int __fastcall sub_4098330(int a1, char a2);
// void __usercall sub_4098380(int a1<ebx>, int a2, int a3);
// void __usercall sub_4099380(unsigned __int8 a1<al>, int _EBX<ebx>, int a3<esi>);
// double __usercall sub_40A06A6<st0>(unsigned int a1<eax>, int _EDX<edx>, signed int a3<ecx>, int _EBX<ebx>, int _EBP<ebp>, int a6<edi>, int a7<esi>, double a8<st0>);
double loc_40A06F5(); // weak
// void __stdcall InitializeCriticalSection(LPCRITICAL_SECTION lpCriticalSection);
// FARPROC __stdcall GetProcAddress(HMODULE hModule, LPCSTR lpProcName);
// HLOCAL __stdcall LocalFree(HLOCAL hMem);
// void __stdcall RaiseException(DWORD dwExceptionCode, DWORD dwExceptionFlags, DWORD nNumberOfArguments, const ULONG_PTR *lpArguments);
// HLOCAL __stdcall LocalAlloc(UINT uFlags, SIZE_T uBytes);
// HMODULE __stdcall GetModuleHandleA(LPCSTR lpModuleName);
// void __stdcall LeaveCriticalSection(LPCRITICAL_SECTION lpCriticalSection);
// BOOL __stdcall GetStringTypeA(LCID Locale, DWORD dwInfoType, LPCSTR lpSrcStr, int cchSrc, LPWORD lpCharType);
// int __stdcall LCMapStringW(LCID Locale, DWORD dwMapFlags, LPCWSTR lpSrcStr, int cchSrc, LPWSTR lpDestStr, int cchDest);
// int __stdcall LCMapStringA(LCID Locale, DWORD dwMapFlags, LPCSTR lpSrcStr, int cchSrc, LPSTR lpDestStr, int cchDest);
// int __stdcall WideCharToMultiByte(UINT CodePage, DWORD dwFlags, LPCWSTR lpWideCharStr, int cchWideChar, LPSTR lpMultiByteStr, int cbMultiByte, LPCSTR lpDefaultChar, LPBOOL lpUsedDefaultChar);
// int __stdcall MultiByteToWideChar(UINT CodePage, DWORD dwFlags, LPCSTR lpMultiByteStr, int cbMultiByte, LPWSTR lpWideCharStr, int cchWideChar);
// BOOL __stdcall GetStringTypeW(DWORD dwInfoType, LPCWSTR lpSrcStr, int cchSrc, LPWORD lpCharType);
// LRESULT __stdcall DefWindowProcA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
// BOOL __stdcall AdjustWindowRectEx(LPRECT lpRect, DWORD dwStyle, BOOL bMenu, DWORD dwExStyle);
//----- (04097060) --------------------------------------------------------
void __usercall sub_4097060(int a1<esi>)
{
LeaveCriticalSection((LPCRITICAL_SECTION)(a1 + 16));
}
//----- (040970D6) --------------------------------------------------------
bool __thiscall sub_40970D6(int this, int a2, int *a3)
{
int v3; // eax@1
int v4; // ebx@1
int *v5; // esi@1
int v6; // edi@2
int v7; // eax@4
int v8; // ecx@4
bool result; // eax@8
int v10; // edi@11
int v11; // esi@14
int v12; // [sp+18h] [bp+Ch]@4
v4 = a2;
v5 = a3;
LOBYTE(v3) = *(_BYTE *)a2;
if ( *(_BYTE *)a2 )
{
while ( 1 )
{
v6 = *(_BYTE *)v5;
v3 = (char)v3;
++v4;
if ( (char)v3 == 42 )
break;
if ( v3 == 63 )
{
if ( !*(_BYTE *)v5 )
return 0;
}
else
{
v12 = sub_409786E(this, v3);
v7 = sub_409786E(v8, v6);
this = v12;
if ( v7 != v12 )
return 0;
}
LOBYTE(v3) = *(_BYTE *)v4;
v5 = (int *)((char *)v5 + 1);
if ( !*(_BYTE *)v4 )
goto LABEL_8;
}
v10 = 0;
if ( *(_BYTE *)v5 )
{
do
++v10;
while ( *((_BYTE *)v5 + v10) );
if ( v10 < 0 )
return 0;
}
v11 = (int)((char *)v5 + v10);
while ( !sub_40970D6(v4, v11) )
{
--v10;
--v11;
if ( v10 < 0 )
return 0;
}
result = 1;
}
else
{
LABEL_8:
result = *(_BYTE *)v5 == 0;
}
return result;
}
//----- (0409715E) --------------------------------------------------------
LRESULT __stdcall sub_409715E(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
LRESULT result; // eax@2
int v5; // [sp+4h] [bp-60h]@2
int v6; // [sp+44h] [bp-20h]@2
int v7; // [sp+48h] [bp-1Ch]@2
int v8; // [sp+4Ch] [bp-18h]@2
int v9; // [sp+50h] [bp-14h]@2
int v10; // [sp+54h] [bp-10h]@2
int v11; // [sp+58h] [bp-Ch]@2
int v12; // [sp+5Ch] [bp-8h]@2
int v13; // [sp+60h] [bp-4h]@2
if ( Msg == 15 )
{
v6 = 0;
v7 = 0;
v8 = 0;
v9 = 0;
v10 = 0;
v11 = 0;
dword_40AC88C(dword_40B0AD8, 24, &v6);
dword_40AC884(hWnd, &v5);
v12 = dword_40AC874(v5);
v13 = dword_40AC890(v12, dword_40B0AD8);
dword_40AC898(v5, 0, 0, v7, v8, v12, 0, 0, dword_CC0020);
dword_40AC890(v12, v13);
dword_40AC87C(v12);
dword_40AC888(hWnd, &v5);
result = 0;
}
else
{
result = DefWindowProcA(hWnd, Msg, wParam, lParam);
}
return result;
}
// CC0020: using guessed type int dword_CC0020[13587448];
// 40AC874: using guessed type int (__stdcall *dword_40AC874)(_DWORD);
// 40AC87C: using guessed type int (__stdcall *dword_40AC87C)(_DWORD);
// 40AC884: using guessed type int (__stdcall *dword_40AC884)(_DWORD, _DWORD);
// 40AC888: using guessed type int (__stdcall *dword_40AC888)(_DWORD, _DWORD);
// 40AC88C: using guessed type int (__stdcall *dword_40AC88C)(_DWORD, _DWORD, _DWORD);
// 40AC890: using guessed type int (__stdcall *dword_40AC890)(_DWORD, _DWORD);
// 40AC898: using guessed type int (__stdcall *dword_40AC898)(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
// 40B0AD8: using guessed type int dword_40B0AD8;
//----- (04097216) --------------------------------------------------------
signed int __stdcall sub_4097216(int a1, int a2)
{
signed int result; // eax@3
int v3; // [sp+0h] [bp-4h]@1
v3 = 0;
dword_40AC89C(a1, &v3);
if ( v3 != dword_40AC77C() || a1 == dword_40B0ADC )
{
result = 1;
}
else
{
dword_40AC8C0(dword_40B0ADC);
dword_40B0ADC = 0;
dword_40AC8A0(a1);
dword_40AC8A4(a1);
result = 0;
}
return result;
}
// 40AC77C: using guessed type int (*dword_40AC77C)(void);
// 40AC89C: using guessed type int (__stdcall *dword_40AC89C)(_DWORD, _DWORD);
// 40AC8A0: using guessed type int (__stdcall *dword_40AC8A0)(_DWORD);
// 40AC8A4: using guessed type int (__stdcall *dword_40AC8A4)(_DWORD);
// 40AC8C0: using guessed type int (__stdcall *dword_40AC8C0)(_DWORD);
// 40B0ADC: using guessed type int dword_40B0ADC;
//----- (04097271) --------------------------------------------------------
int __stdcall sub_4097271(int a1)
{
int v2; // [sp+8h] [bp-54h]@2
int v3; // [sp+Ch] [bp-50h]@4
int v4; // [sp+24h] [bp-38h]@1
int v5; // [sp+28h] [bp-34h]@1
int v6; // [sp+2Ch] [bp-30h]@1
int v7; // [sp+30h] [bp-2Ch]@1
int v8; // [sp+34h] [bp-28h]@1
int v9; // [sp+38h] [bp-24h]@1
int v10; // [sp+3Ch] [bp-20h]@1
int i; // [sp+40h] [bp-1Ch]@7
int v12; // [sp+44h] [bp-18h]@1
struct tagRECT Rect; // [sp+48h] [bp-14h]@1
int v14; // [sp+58h] [bp-4h]@1
dword_40B0AD8 = a1;
v4 = 0;
v5 = 0;
v6 = 0;
v7 = 0;
v8 = 0;
v9 = 0;
dword_40AC88C(a1, 24, &v4);
dword_40B0AE8 = 48;
dword_40B0AF0 = (int)sub_409715E;
dword_40B0B10 = (int)dword_40AC148;
dword_40B0AFC = dword_40AC7AC(0);
dword_40AC8A8(&dword_40B0AE8);
v10 = dword_40AC8AC(16);
v12 = dword_40AC8AC(17);
Rect.left = (v10 - v5) / 2;
Rect.top = (v12 - v6) / 2;
Rect.right = v5 + (v10 - v5) / 2;
Rect.bottom = v6 + Rect.top;
AdjustWindowRectEx(&Rect, 0x98800000u, 0, 0);
v14 = dword_40AC8B0(
0,
dword_40AC148,
&dword_40AC700,
-1736441856,
Rect.left,
Rect.top,
Rect.right - Rect.left,
Rect.bottom - Rect.top,
0,
0,
0,
0);
dword_40B0ADC = v14;
while ( dword_40AC8B4(&v2, v14, 0, 0) && (v2 != v14 || v3) )
{
dword_40AC8B8(&v2);
dword_40AC8BC(&v2);
}
dword_40AC828(100);
for ( i = 0; i < 100; ++i )
{
dword_40AC8C4(sub_4097216, 0);
if ( !dword_40B0ADC )
break;
dword_40AC828(100);
}
dword_40AC894(a1);
return 0;
}
// 40AC148: using guessed type int dword_40AC148[10];
// 40AC700: using guessed type int dword_40AC700;
// 40AC7AC: using guessed type int (__stdcall *dword_40AC7AC)(_DWORD);
// 40AC828: using guessed type int (__stdcall *dword_40AC828)(_DWORD);
// 40AC88C: using guessed type int (__stdcall *dword_40AC88C)(_DWORD, _DWORD, _DWORD);
// 40AC894: using guessed type int (__stdcall *dword_40AC894)(_DWORD);
// 40AC8A8: using guessed type int (__stdcall *dword_40AC8A8)(_DWORD);
// 40AC8AC: using guessed type int (__stdcall *dword_40AC8AC)(_DWORD);
// 40AC8B0: using guessed type int (__stdcall *dword_40AC8B0)(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
// 40AC8B4: using guessed type int (__stdcall *dword_40AC8B4)(_DWORD, _DWORD, _DWORD, _DWORD);
// 40AC8B8: using guessed type int (__stdcall *dword_40AC8B8)(_DWORD);
// 40AC8BC: using guessed type int (__stdcall *dword_40AC8BC)(_DWORD);
// 40AC8C4: using guessed type int (__stdcall *dword_40AC8C4)(_DWORD, _DWORD);
// 40B0AE8: using guessed type int dword_40B0AE8;
// 40B0AF0: using guessed type int dword_40B0AF0;
// 40B0AFC: using guessed type int dword_40B0AFC;
// 40B0B10: using guessed type int dword_40B0B10;
//----- (04097454) --------------------------------------------------------
int __cdecl sub_4097454(int a1)
{
return RtlUnwind(a1, loc_409746C, 0, 0);
}
// 409746C: using guessed type int __cdecl loc_409746C(int);
// 4097F70: using guessed type int __stdcall RtlUnwind(_DWORD, _DWORD, _DWORD, _DWORD);
//----- (04097474) --------------------------------------------------------
signed int __cdecl sub_4097474(int a1, int a2, int a3, int a4)
{
signed int result; // eax@1
result = 1;
if ( *(_DWORD *)(a1 + 4) & 6 )
{
*(_DWORD *)a4 = a2;
result = 3;
}
return result;
}
//----- (04097496) --------------------------------------------------------
int __usercall sub_4097496<eax>(int a1<ebp>, int a2, int a3)
{
int result; // eax@1
int v4; // ebx@1
int v5; // esi@1
int v6; // esi@3
while ( 1 )
{
result = a2;
v4 = *(_DWORD *)(a2 + 8);
v5 = *(_DWORD *)(a2 + 12);
if ( v5 == -1 )
break;
if ( v5 == a3 )
break;
v6 = 3 * v5;
*(_DWORD *)(a2 + 12) = *(_DWORD *)(v4 + 4 * v6);
if ( !*(_DWORD *)(v4 + 4 * v6 + 4) )
{
sub_409752A(*(_DWORD *)(v4 + 4 * v6 + 8), a1, 257);
(*(void (**)(void))(v4 + 4 * v6 + 8))();
}
}
return result;
}
//----- (0409752A) --------------------------------------------------------
int __userpurge sub_409752A<eax>(int result<eax>, int a2<ebp>, int a3)
{
dword_40AC4CC[2] = *(_DWORD *)(a2 + 8);
dword_40AC4CC[1] = result;
dword_40AC4CC[3] = a2;
return result;
}
// 40AC4CC: using guessed type int dword_40AC4CC[5];
//----- (0409754C) --------------------------------------------------------
signed int __usercall sub_409754C<eax>(int a1<ebp>)
{
int v1; // eax@1
int v2; // ebx@1
int v3; // edi@2
int v4; // esi@2
int v5; // eax@5
int v6; // edi@7
int v7; // ecx@7
signed int result; // eax@9
int v9; // [sp-8h] [bp-20h]@5
v2 = *(_DWORD *)(a1 + 12);
v1 = *(_DWORD *)(a1 + 8);
if ( *(_DWORD *)(v1 + 4) & 6 )
{
sub_4097496(v2 + 16, v2, -1);
result = 1;
}
else
{
*(_DWORD *)(a1 - 8) = v1;
*(_DWORD *)(a1 - 4) = *(_DWORD *)(a1 + 16);
*(_DWORD *)(v2 - 4) = a1 - 8;
v4 = *(_DWORD *)(v2 + 12);
v3 = *(_DWORD *)(v2 + 8);
while ( v4 != -1 )
{
if ( *(_DWORD *)(v3 + 12 * v4 + 4) )
{
v9 = a1;
v5 = (*(int (__thiscall **)(int))(v3 + 12 * v4 + 4))(3 * v4);
a1 = v9;
v2 = *(_DWORD *)(v9 + 12);
if ( v5 )
{
if ( v5 < 0 )
return 0;
v6 = *(_DWORD *)(v2 + 8);
sub_4097454(*(_DWORD *)(v9 + 12));
a1 = v2 + 16;
sub_4097496(v2 + 16, v2, v4);
sub_409752A(*(_DWORD *)(v6 + 12 * v4 + 8), v2 + 16, 1);
*(_DWORD *)(v2 + 12) = *(_DWORD *)(v6 + 4 * v7);
(*(void (**)(void))(v6 + 4 * v7 + 8))();
}
}
v3 = *(_DWORD *)(v2 + 8);
v4 = *(_DWORD *)(v3 + 12 * v4);
}
result = 1;
}
return result;
}
//----- (0409786E) --------------------------------------------------------
int __thiscall sub_409786E(int this, int CharType)
{
int result; // eax@2
int v3; // ebx@5
int v4; // eax@7
int v5; // eax@11
int v6; // eax@12
int v7; // eax@14
CHAR DestStr; // [sp+Ch] [bp-4h]@14
unsigned __int8 v9; // [sp+Dh] [bp-3h]@17
if ( Locale )
{
v3 = CharType;
if ( (CharType >= 256
|| (dword_40AC6EC <= 1 ? (v4 = *(_BYTE *)(dword_40AC4E0 + 2 * CharType) & 1) : (v4 = sub_4097CCF(
this,
CharType,
256,
1,
CharType,
1)),
v4))
&& ((v5 = v3 >> 8, !(*(_BYTE *)(dword_40AC4E0 + 2 * BYTE1(v3) + 1) & 0x80)) ? (BYTE1(CharType) = 0,
LOBYTE(CharType) = v3,
v6 = 1) : (BYTE2(CharType) = 0,
LOBYTE(CharType) = v5,
BYTE1(CharType) = v3,
v6 = 2),
(v7 = sub_4097A80((int)&CharType, v3, 256, 1, Locale, 0x100u, (LPCSTR)&CharType, v6, &DestStr, 3, 0, 1)) != 0) )
{
if ( v7 == 1 )
result = (unsigned __int8)DestStr;
else
result = (unsigned __int8)DestStr | (v9 << 8);
}
else
{
result = v3;
}
}
else
{
result = CharType;
if ( CharType >= 65 )
{
if ( CharType <= 90 )
result = CharType + 32;
}
}
return result;
}
// 40AC4E0: using guessed type int dword_40AC4E0;
// 40AC6EC: using guessed type int dword_40AC6EC;
//----- (040979EA) --------------------------------------------------------
int __usercall sub_40979EA<eax>(int a1<ecx>, int a2<ebx>, int a3<esi>, signed int *a4)
{
signed int *i; // edi@1
int v5; // eax@3
int v6; // ST04_4@3
int v7; // ebp@7
int v8; // edi@7
int v9; // esi@7
int v10; // ebx@10
int v11; // eax@12
int v12; // ST04_4@12
int result; // eax@16
for ( i = a4; ; i = (signed int *)((char *)i + 1) )
{
if ( dword_40AC6EC <= 1 )
{
a1 = dword_40AC4E0;
v5 = *(_BYTE *)(dword_40AC4E0 + 2 * *(_BYTE *)i) & 8;
}
else
{
v5 = sub_4097CCF(a1, a2, (int)i, a3, *(_BYTE *)i, 8);
a1 = v6;
}
if ( !v5 )
break;
}
v9 = *(_BYTE *)i;
v8 = (int)((char *)i + 1);
v7 = v9;
if ( v9 == 45 || v9 == 43 )
v9 = *(_BYTE *)v8++;
v10 = 0;
while ( 1 )
{
if ( dword_40AC6EC <= 1 )
{
v11 = *(_BYTE *)(dword_40AC4E0 + 2 * v9) & 4;
}
else
{
v11 = sub_4097CCF(a1, v10, v8, v9, v9, 4);
a1 = v12;
}
if ( !v11 )
break;
v10 = v9 + 10 * v10 - 48;
v9 = *(_BYTE *)v8++;
}
result = v10;
if ( v7 == 45 )
result = -v10;
return result;
}
// 40AC4E0: using guessed type int dword_40AC4E0;
// 40AC6EC: using guessed type int dword_40AC6EC;
//----- (04097A80) --------------------------------------------------------
int __usercall sub_4097A80<eax>(int a1<eax>, int a2<ebx>, int a3<edi>, int a4<esi>, LCID Locale, DWORD dwMapFlags, LPCSTR lpMultiByteStr, int cbMultiByte, LPSTR lpDestStr, int cchDest, UINT CodePage, int a12)
{
int v13; // eax@13
int v14; // ebx@13
int v15; // eax@14
void *v16; // esp@14
int v17; // eax@16
int v18; // esi@16
int v19; // eax@23
void *v20; // esp@23
CHAR *v21; // [sp-20h] [bp-48h]@26
int v22; // [sp-1Ch] [bp-44h]@26
int v23; // [sp-10h] [bp-38h]@1
int v24; // [sp-Ch] [bp-34h]@1
int v25; // [sp-8h] [bp-30h]@1
int v26; // [sp+0h] [bp-28h]@16
LPWSTR lpSrcStr; // [sp+4h] [bp-24h]@14
int *v28; // [sp+8h] [bp-20h]@23
int cchSrc; // [sp+Ch] [bp-1Ch]@13
int *v30; // [sp+10h] [bp-18h]@1
int v31; // [sp+18h] [bp-10h]@1
signed int (__usercall *v32)<eax>(int<ebp>); // [sp+1Ch] [bp-Ch]@1
int v33; // [sp+20h] [bp-8h]@1
int v34; // [sp+24h] [bp-4h]@1
v34 = -1;
v33 = (int)dword_40A9B10;
v32 = sub_409754C;
v31 = a1;
v25 = a2;
v24 = a4;
v23 = a3;
v30 = &v23;
if ( !dword_40B1170 )
{
if ( LCMapStringW(0, 0x100u, &SrcStr, 1, 0, 0) )
{
dword_40B1170 = 1;
}
else
{
if ( !LCMapStringA(0, 0x100u, byte_40A9B04, 1, 0, 0) )
return 0;
dword_40B1170 = 2;
}
}
if ( cbMultiByte > 0 )
cbMultiByte = sub_4097CA4((int)lpMultiByteStr, cbMultiByte);
if ( dword_40B1170 == 2 )
return LCMapStringA(Locale, dwMapFlags, lpMultiByteStr, cbMultiByte, lpDestStr, cchDest);
if ( dword_40B1170 != 1 )
return 0;
if ( !CodePage )
CodePage = dword_40B118C;
v13 = MultiByteToWideChar(CodePage, a12 != 0 ? 9 : 1, lpMultiByteStr, cbMultiByte, 0, 0);
v14 = v13;
cchSrc = v13;
if ( !v13
|| (v15 = 2 * v13 + 3,
LOBYTE(v15) = v15 & 0xFC,
v16 = alloca(v15),
v30 = &v23,
lpSrcStr = (LPWSTR)&v23,
v34 = -1,
!&v23)
|| !MultiByteToWideChar(CodePage, 1u, lpMultiByteStr, cbMultiByte, lpSrcStr, v14)
|| (v17 = LCMapStringW(Locale, dwMapFlags, lpSrcStr, v14, 0, 0), v18 = v17, v26 = v17, !v17) )
return 0;
if ( BYTE1(dwMapFlags) & 4 )
{
if ( cchDest && (v17 > cchDest || !LCMapStringW(Locale, dwMapFlags, lpSrcStr, v14, (LPWSTR)lpDestStr, cchDest)) )
return 0;
}
else
{
v19 = 2 * v17 + 3;
LOBYTE(v19) = v19 & 0xFC;
v20 = alloca(v19);
v30 = &v23;
v28 = &v23;
v34 = -1;
if ( !&v23
|| !LCMapStringW(Locale, dwMapFlags, lpSrcStr, cchSrc, (LPWSTR)&v23, v18)
|| (cchDest ? (v22 = cchDest, v21 = lpDestStr) : (v22 = 0, v21 = 0),
v18 = WideCharToMultiByte(CodePage, 0x220u, (LPCWSTR)&v23, v18, v21, v22, 0, 0),
!v18) )
return 0;
}
return v18;
}
// 4097A80: could not find valid save-restore pair for ebx
// 4097A80: could not find valid save-restore pair for edi
// 4097A80: could not find valid save-restore pair for esi
// 40A9B10: using guessed type int dword_40A9B10[6];
// 40B1170: using guessed type int dword_40B1170;
// 40B118C: using guessed type int dword_40B118C;
//----- (04097CA4) --------------------------------------------------------
int __cdecl sub_4097CA4(int a1, int a2)
{
int v2; // eax@1
int v3; // ecx@1
int v4; // esi@3
int result; // eax@5
v2 = a1;
v3 = a2 - 1;
if ( a2 )
{
do
{
if ( !*(_BYTE *)v2 )
break;
++v2;
v4 = v3--;
}
while ( v4 );
}
if ( *(_BYTE *)v2 )
result = a2;
else
result = v2 - a1;
return result;
}
//----- (04097CCF) --------------------------------------------------------
BOOL __usercall sub_4097CCF<eax>(int a1<ecx>, int a2<ebx>, int a3<edi>, int a4<esi>, signed int CharType, int a6)
{
int v6; // eax@2
signed int v7; // ecx@3
BOOL result; // eax@6
int v9; // [sp-4h] [bp-8h]@4
int MultiByteStr; // [sp+0h] [bp-4h]@1
MultiByteStr = a1;
if ( (unsigned int)(CharType + 1) <= 0x100 )
{
v6 = *(_WORD *)(dword_40AC4E0 + 2 * CharType);
return a6 & v6;
}
v7 = CharType >> 8;
if ( *(_BYTE *)(dword_40AC4E0 + 2 * BYTE1(CharType) + 1) & 0x80 )
{
LOBYTE(MultiByteStr) = v7;
*(_WORD *)((char *)&MultiByteStr + 1) = (unsigned __int8)CharType;
v9 = 2;
}
else
{
LOWORD(MultiByteStr) = (unsigned __int8)CharType;
v9 = 1;
}
result = sub_4097DBF((int)&MultiByteStr, a2, a3, a4, 1u, (LPCSTR)&MultiByteStr, v9, (LPWORD)&CharType + 1, 0, 0, 1);
if ( result )
{
v6 = HIWORD(CharType);
return a6 & v6;
}
return result;
}
// 40AC4E0: using guessed type int dword_40AC4E0;
//----- (04097DBF) --------------------------------------------------------
BOOL __usercall sub_4097DBF<eax>(int a1<eax>, int a2<ebx>, int a3<edi>, int a4<esi>, DWORD dwInfoType, LPCSTR lpMultiByteStr, int cbMultiByte, LPWORD lpCharType, UINT CodePage, LCID Locale, int a11)
{
signed int v11; // eax@1
LCID v12; // eax@8
int v14; // eax@14
unsigned int v15; // edi@15
int v16; // eax@15
void *v17; // esp@15
int v18; // eax@16
int v19; // [sp-10h] [bp-34h]@1
int v20; // [sp-Ch] [bp-30h]@1
int v21; // [sp-8h] [bp-2Ch]@1
int *v22; // [sp+0h] [bp-24h]@15
int cchWideChar; // [sp+4h] [bp-20h]@14
WORD CharType; // [sp+8h] [bp-1Ch]@2
int *v25; // [sp+Ch] [bp-18h]@1
int v26; // [sp+14h] [bp-10h]@1
signed int (__usercall *v27)<eax>(int<ebp>); // [sp+18h] [bp-Ch]@1
int v28; // [sp+1Ch] [bp-8h]@1
int v29; // [sp+20h] [bp-4h]@1
v29 = -1;
v28 = (int)dword_40A9B28;
v27 = sub_409754C;
v26 = a1;
v21 = a2;
v20 = a4;
v19 = a3;
v25 = &v19;
v11 = dword_40B1194;
if ( !dword_40B1194 )
{
if ( GetStringTypeW(1u, &SrcStr, 1, &CharType) )
{
v11 = 1;
}
else
{
if ( !GetStringTypeA(0, 1u, byte_40A9B04, 1, &CharType) )
return 0;
v11 = 2;
}
dword_40B1194 = v11;
}
if ( v11 != 2 )
{
if ( v11 == 1 )
{
if ( !CodePage )
CodePage = dword_40B118C;
v14 = MultiByteToWideChar(CodePage, a11 != 0 ? 9 : 1, lpMultiByteStr, cbMultiByte, 0, 0);
cchWideChar = v14;
if ( v14 )
{
v29 = 0;
v15 = 2 * v14;
v16 = 2 * v14 + 3;
LOBYTE(v16) = v16 & 0xFC;
v17 = alloca(v16);
v25 = &v19;
v22 = &v19;
sub_4097F10(&v19, 0, v15);
v29 = -1;
if ( &v19 )
{
v18 = MultiByteToWideChar(CodePage, 1u, lpMultiByteStr, cbMultiByte, (LPWSTR)&v19, cchWideChar);
if ( v18 )
return GetStringTypeW(dwInfoType, (LPCWSTR)&v19, v18, lpCharType);
}
}
}
return 0;
}
v12 = Locale;
if ( !Locale )
v12 = ::Locale;
return GetStringTypeA(v12, dwInfoType, lpMultiByteStr, cbMultiByte, lpCharType);
}
// 4097DBF: could not find valid save-restore pair for ebx
// 4097DBF: could not find valid save-restore pair for edi
// 4097DBF: could not find valid save-restore pair for esi
// 40A9B28: using guessed type int dword_40A9B28[3];
// 40B118C: using guessed type int dword_40B118C;
// 40B1194: using guessed type int dword_40B1194;
//----- (04097F10) --------------------------------------------------------
void *__cdecl sub_4097F10(void *a1, unsigned __int8 a2, unsigned int a3)
{
int v3; // edx@1
int v4; // eax@2
void *v5; // edi@2
int v6; // ecx@3
unsigned int v7; // ecx@6
unsigned int v8; // ecx@6
void *result; // eax@9
v3 = a3;
if ( a3 )
{
LOBYTE(v4) = a2;
v5 = a1;
if ( a3 < 4 )
goto LABEL_13;
v6 = -(signed int)a1 & 3;
if ( v6 )
{
v3 = a3 - v6;
do
{
*(_BYTE *)v5 = a2;
v5 = (char *)v5 + 1;
--v6;
}
while ( v6 );
}
v4 = 16843009 * a2;
v8 = v3;
v3 &= 3u;
v7 = v8 >> 2;
if ( !v7 || (memset(v5, v4, 4 * v7), v5 = (char *)v5 + 4 * v7, v3) )
{
LABEL_13:
do
{
*(_BYTE *)v5 = v4;
v5 = (char *)v5 + 1;
--v3;
}
while ( v3 );
}
result = a1;
}
else
{
result = a1;
}
return result;
}
//----- (0409800C) --------------------------------------------------------
int __cdecl sub_409800C(unsigned int a1, int a2, unsigned int a3)
{
int v3; // ecx@1
unsigned int v4; // edi@1
unsigned int v5; // esi@1
int result; // eax@2
unsigned int v7; // edx@4
unsigned int v8; // eax@7
int v9; // esi@8
int v10; // edi@8
int v11; // esi@8
int v12; // edi@8
int v13; // esi@8
int v14; // edi@8
int v15; // esi@8
int v16; // edi@8
int v17; // esi@8
int v18; // edi@8
int v19; // esi@8
int v20; // edi@8
int v21; // esi@8
int v22; // edi@8
int v23; // esi@8
int v24; // edi@8
int v25; // esi@8
int v26; // edi@8
int v27; // esi@8
int v28; // edi@8
int v29; // esi@8
int v30; // edi@8
int v31; // esi@8
int v32; // edi@8
int v33; // esi@8
int v34; // edi@8
int v35; // esi@8
int v36; // edi@8
int v37; // esi@8
int v38; // edi@8
v3 = a2;
v5 = (unsigned __int16)a1;
v4 = a1 >> 16;
if ( a2 )
{
for ( ; a3; v4 %= 0xFFF1u )
{
v7 = 5552;
if ( a3 < 0x15B0 )
v7 = a3;
a3 -= v7;
if ( (signed int)v7 >= 16 )
{
v8 = v7 >> 4;
v7 += -16 * (v7 >> 4);
do
{
v9 = *(_BYTE *)v3 + v5;
v10 = v9 + v4;
v11 = *(_BYTE *)(v3 + 1) + v9;
v12 = v11 + v10;
v13 = *(_BYTE *)(v3 + 2) + v11;
v14 = v13 + v12;
v15 = *(_BYTE *)(v3 + 3) + v13;
v16 = v15 + v14;
v17 = *(_BYTE *)(v3 + 4) + v15;
v18 = v17 + v16;
v19 = *(_BYTE *)(v3 + 5) + v17;
v20 = v19 + v18;
v21 = *(_BYTE *)(v3 + 6) + v19;
v22 = v21 + v20;
v23 = *(_BYTE *)(v3 + 7) + v21;
v24 = v23 + v22;
v25 = *(_BYTE *)(v3 + 8) + v23;
v26 = v25 + v24;
v27 = *(_BYTE *)(v3 + 9) + v25;
v28 = v27 + v26;
v29 = *(_BYTE *)(v3 + 10) + v27;
v30 = v29 + v28;
v31 = *(_BYTE *)(v3 + 11) + v29;
v32 = v31 + v30;
v33 = *(_BYTE *)(v3 + 12) + v31;
v34 = v33 + v32;
v35 = *(_BYTE *)(v3 + 13) + v33;
v36 = v35 + v34;
v37 = *(_BYTE *)(v3 + 14) + v35;
v38 = v37 + v36;
v5 = *(_BYTE *)(v3 + 15) + v37;
v4 = v5 + v38;
v3 += 16;
--v8;
}
while ( v8 );
}
for ( ; v7; --v7 )
{
v5 += *(_BYTE *)v3++;
v4 += v5;
}
v5 %= 0xFFF1u;
}
result = v5 | (v4 << 16);
}
else
{
result = 1;
}
return result;
}
//----- (04098130) --------------------------------------------------------
int __thiscall sub_4098130(int this, int a2, int a3, int a4, int a5)
{
signed int v5; // edx@8
char v6; // ST10_1@19
int v8; // [sp+0h] [bp-1Ch]@1
int j; // [sp+4h] [bp-18h]@17
signed int v10; // [sp+8h] [bp-14h]@15
int v11; // [sp+8h] [bp-14h]@17
signed int i; // [sp+Ch] [bp-10h]@1
signed int v13; // [sp+Ch] [bp-10h]@13
int v14; // [sp+Ch] [bp-10h]@17
signed int v15; // [sp+10h] [bp-Ch]@6
signed int v16; // [sp+10h] [bp-Ch]@10
int v17; // [sp+14h] [bp-8h]@4
unsigned int v18; // [sp+18h] [bp-4h]@4
v8 = this;
*(_DWORD *)this = a2;
*(_DWORD *)(this + 4) = a4;
*(_DWORD *)(this + 8) = a3;
*(_DWORD *)(this + 12) = a5;
*(_DWORD *)(this + 20) = 0;
*(_DWORD *)(this + 16) = 0;
for ( i = 0; i < 4078; ++i )
*(_BYTE *)(i + this + 24) = 32;
v17 = 4078;
v18 = 0;
while ( 1 )
{
while ( 1 )
{
v18 >>= 1;
if ( !(v18 & 0x100) )
{
v15 = sub_40982F0(v8);
if ( v15 == -1 )
return *(_DWORD *)(v8 + 16);
v5 = v15;
BYTE1(v5) = -1;
v18 = v5;
}
if ( !(v18 & 1) )
break;
v16 = sub_40982F0(v8);
if ( v16 == -1 )
return *(_DWORD *)(v8 + 16);
sub_4098330(v8, v16);
*(_BYTE *)(v17 + v8 + 24) = v16;
v17 = ((_WORD)v17 + 1) & 0xFFF;
}
v13 = sub_40982F0(v8);
if ( v13 == -1 )
break;
v10 = sub_40982F0(v8);
if ( v10 == -1 )
break;
v14 = 16 * (unsigned __int8)(v10 & 0xF0) | v13;
v11 = (v10 & 0xF) + 2;
for ( j = 0; j <= v11; ++j )
{
v6 = *(_BYTE *)(v8 + ((j + v14) & 0xFFF) + 24);
sub_4098330(v8, *(_BYTE *)(v8 + ((j + v14) & 0xFFF) + 24));
*(_BYTE *)(v17 + v8 + 24) = v6;
v17 = ((_WORD)v17 + 1) & 0xFFF;
}
}
return *(_DWORD *)(v8 + 16);
}
//----- (040982F0) --------------------------------------------------------
signed int __thiscall sub_40982F0(int this)
{
signed int result; // eax@2
if ( *(_DWORD *)(this + 20) < *(_DWORD *)(this + 8) )
result = *(_BYTE *)(*(_DWORD *)this + *(_DWORD *)(this + 20)++);
else
result = -1;
return result;
}
//----- (04098330) --------------------------------------------------------
int __fastcall sub_4098330(int a1, char a2)
{
int result; // eax@1
result = a1;
if ( *(_DWORD *)(a1 + 16) < *(_DWORD *)(a1 + 12) )
{
*(_BYTE *)(*(_DWORD *)(a1 + 4) + *(_DWORD *)(a1 + 16)) = a2;
result = a1;
++*(_DWORD *)(a1 + 16);
}
return result;
}
//----- (04098380) --------------------------------------------------------
void __usercall sub_4098380(int a1<ebx>, int a2, int a3)
{
int v3; // ST30_4@19
int v4; // eax@21
int v5; // esi@27
const void *v6; // esi@27
int v7; // ecx@27
unsigned __int8 v8; // al@31
signed int v9; // [sp+10h] [bp-68h]@18
int i; // [sp+14h] [bp-64h]@21
int v11; // [sp+18h] [bp-60h]@24
int v12; // [sp+1Ch] [bp-5Ch]@24
int v13; // [sp+24h] [bp-54h]@19
unsigned int v14; // [sp+28h] [bp-50h]@24
int v15; // [sp+2Ch] [bp-4Ch]@21
HLOCAL v16; // [sp+30h] [bp-48h]@24
signed int v17; // [sp+34h] [bp-44h]@1
int v18; // [sp+38h] [bp-40h]@2
unsigned int v19; // [sp+40h] [bp-38h]@7
int v20; // [sp+44h] [bp-34h]@7
int v21; // [sp+48h] [bp-30h]@2
int v22; // [sp+4Ch] [bp-2Ch]@2
unsigned int v23; // [sp+50h] [bp-28h]@7
int v24; // [sp+54h] [bp-24h]@7
int v25; // [sp+58h] [bp-20h]@4
HLOCAL v26; // [sp+5Ch] [bp-1Ch]@7
HMODULE v27; // [sp+60h] [bp-18h]@1
int (*v28)(void); // [sp+64h] [bp-14h]@16
int v29; // [sp+68h] [bp-10h]@1
HMODULE v30; // [sp+6Ch] [bp-Ch]@14
HLOCAL v31; // [sp+70h] [bp-8h]@1
int v32; // [sp+74h] [bp-4h]@1
v27 = GetModuleHandleA(0);
v31 = LocalAlloc(0x40u, 0xD440u);
v32 = a3 - 1018;
v29 = a3 - 1022;
v17 = 1;
while ( 1 )
{
do
{
v21 = 40 * *(_DWORD *)v29 + v32 - 40 * v17++;
v18 = (int)((char *)v27 + *(_DWORD *)(v21 + 12));
v22 = (int)((char *)v27 + *(_DWORD *)(v21 + 12) + *(_DWORD *)(v21 + 8));
}
while ( v18 > (unsigned int)dword_40AB444 );
if ( (unsigned int)dword_40AB444 < v22 )
{
v25 = (int)((char *)v27 + *(_DWORD *)(v21 + 12));
while ( v18 < (unsigned int)v22 )
{
v25 = 1664525 * v25 + 1013904245;
*(_DWORD *)v18 ^= v25;
v18 += 4;
}
v24 = (int)((char *)v27 + *(_DWORD *)(v21 + 12));
v23 = *(_DWORD *)v24;
v19 = *(_DWORD *)(v24 + 4);
v20 = *(_DWORD *)(v24 + 8);
v26 = LocalAlloc(0x40u, *(_DWORD *)(v24 + 4));
if ( !v26 || v19 > 0x10000 )
RaiseException(0xEF0000FEu, 0, 0, 0);
memcpy(v26, (const void *)(v24 + 12), v19);
if ( sub_4098130((int)v31, (int)v26, v19, v24, v23) != v23 )
RaiseException(0xEF0000F8u, 0, 0, 0);
if ( sub_409800C(0, v24, v23) != v20 )
RaiseException(0xEF0000FAu, 0, 0, 0);
LocalFree(v26);
v30 = GetModuleHandleA("“.rïªÆ");
if ( !v30 )
RaiseException(0xEF0000FDu, 0, 0, 0);
dword_40AC704 = (int (__cdecl *)(_DWORD, _DWORD, _DWORD))GetProcAddress(v30, "›¿");
v28 = GetProcAddress(v30, &byte_40AB408);
if ( !dword_40AC704 )
RaiseException(0xEF0000FCu, 0, 0, 0);
dword_40AC720 = v28();
v9 = 3;
while ( 1 )
{
do
{
v3 = 40 * *(_DWORD *)v29 + v32 - 40 * v9++;
v13 = (int)((char *)v27 + *(_DWORD *)(v3 + 12) + *(_DWORD *)(v3 + 8));
}
while ( (unsigned int)((char *)v27 + *(_DWORD *)(v3 + 12)) >= a2 );
if ( a2 < (unsigned int)v13 )
{
v15 = a2;
v4 = a2 + 12;
LOBYTE(v4) = (a2 + 12) & 0xFC;
for ( i = v4; i < (unsigned int)v13; i += 4 )
{
v15 = 1664525 * v15 + 1013904245;
*(_DWORD *)i ^= v15;
}
v14 = *(_DWORD *)a2;
v11 = *(_DWORD *)(a2 + 4);
v12 = *(_DWORD *)(a2 + 8);
v16 = LocalAlloc(0x40u, *(_DWORD *)(a2 + 4));
if ( !v16 || (unsigned int)v11 > 0x10000 )
RaiseException(0xEF0000FFu, 0, 0, 0);
memcpy(v16, (const void *)(a2 + 12), 4 * ((unsigned int)v11 >> 2));
v6 = (const void *)(a2 + 12 + 4 * ((unsigned int)v11 >> 2));
v7 = v11 & 3;
memcpy((char *)v16 + 4 * ((unsigned int)v11 >> 2), v6, v7);
v5 = (int)((char *)v6 + v7);
if ( sub_4098130((int)v31, (int)v16, v11, a2, v14) != v14 )
RaiseException(0xEF0000F9u, 0, 0, 0);
if ( sub_409800C(0, a2, v14) != v12 )
RaiseException(0xEF0000FBu, 0, 0, 0);
dword_40AC704(dword_40AC720, a2, v14);
LocalFree(v16);
LocalFree(v31);
InitializeCriticalSection(&CriticalSection);
InitializeCriticalSection(&stru_40AC9B8);
sub_4099380(v8, a1, v5);
}
}
}
}
}
// 40AB444: using guessed type int[495];
// 40AC704: using guessed type int (__cdecl *dword_40AC704)(_DWORD, _DWORD, _DWORD);
// 40AC720: using guessed type int dword_40AC720;
//----- (04098F00) --------------------------------------------------------
#error "4098F07: call analysis failed (funcsize=3)"
//----- (04099380) --------------------------------------------------------
void __usercall sub_4099380(unsigned __int8 a1<al>, int _EBX<ebx>, int a3<esi>)
{
int v3; // esi@1
char v4; // cf@2
char v7; // t0@2
v3 = a3 + 1;
__asm { into }
v4 = a1 < (unsigned __int8)(((unsigned __int8)((unsigned __int64)(265331699i64 * *(_DWORD *)(v3 + 1232466341)) >> 32) != 0)
- 98);
_AL = a1 - (((unsigned __int8)((unsigned __int64)(265331699i64 * *(_DWORD *)(v3 + 1232466341)) >> 32) != 0) - 98);
BYTE1(_EBX) = 30;
__asm { xlat }
v7 = __RCL__(v277eb34e, v4);
v277eb34e = v7;
JUMPOUT(v98b1264a);
}
//----- (040A06A6) --------------------------------------------------------
double __usercall sub_40A06A6<st0>(unsigned int a1<eax>, int _EDX<edx>, signed int a3<ecx>, int _EBX<ebx>, int _EBP<ebp>, int a6<edi>, int a7<esi>, double a8<st0>)
{
char v8; // t0@4
unsigned __int8 v13; // pf@1
double result; // st7@5
int v15; // [sp-1h] [bp-1h]@1
while ( 1 )
{
_OF = 0;
_CF = 0;
_ZF = (BYTE1(a1) | *(_BYTE *)(_EDX + 1015541671)) == 0;
_SF = (BYTE1(a1) | *(_BYTE *)(_EDX + 1015541671)) < 0;
*(_BYTE *)(_EDX + 1015541671) |= BYTE1(a1);
BYTE1(_EDX) = 54;
__asm { pushf }
++a7;
++a6;
_EBX |= _EBP;
JUMPOUT(_EBX >= 0, *(unsigned int *)((char *)loc_40A06F5 + 3));
v15 += 905969664;
--a1;
__asm { arpl [ebp+1271CF74h], dx }
v13 = __SETP__(*(_DWORD *)a7 + 99, 0);
*(_DWORD *)a7 += 99;
do
LOWORD(a3) = a3 - 1;
while ( (_WORD)a3 );
if ( !v13 )
break;
a3 = 1876962779;
v8 = __ROL__(*(_BYTE *)(a1 - 1249390667), 1);
*(_BYTE *)(a1 - 1249390667) = v8;
__asm { arpl [ebp-7Bh], dx }
}
*(_BYTE *)(a1 + 109) += a3 + (*(_DWORD *)a6 < a1);
__asm { setalc }
result = a8 * *(double *)a3;
__asm { rcr byte ptr [ebx+5Dh], 0B1h }
return result;
}
// 40A06F5: using guessed type double();