/* This file has been generated by the Hex-Rays decompiler.
Copyright (c) 2007-2011 Hex-Rays <info@hex-rays.com>
Detected compiler: Visual C++
*/
#include <windows.h>
#include <defs.h>
//-------------------------------------------------------------------------
// Data declarations
extern _UNKNOWN unk_413000; // weak
extern _UNKNOWN unk_413208; // weak
extern _UNKNOWN unk_41330C; // weak
extern _UNKNOWN unk_41371C; // weak
extern int off_41387C[2]; // weak
extern _UNKNOWN unk_413B94; // weak
extern _UNKNOWN unk_413C94; // weak
extern _UNKNOWN unk_413FA0; // weak
extern _UNKNOWN unk_413FC0; // weak
extern _UNKNOWN unk_413FE0; // weak
extern char *Format; // idb
extern int dword_415004; // weak
extern int dword_415010; // weak
extern int __security_cookie; // weak
extern int dword_41501C; // weak
extern int dword_415128; // weak
extern int dword_41512C; // weak
extern int dword_415130; // weak
extern int dword_415134; // weak
extern int dword_415138; // weak
extern int dword_41513C; // weak
extern int dword_415140; // weak
extern int dword_415144; // weak
extern int dword_415150; // weak
extern int dword_415154; // weak
extern int dword_415158; // weak
extern int dword_41515C; // weak
extern int dword_415160; // weak
extern int dword_415164; // weak
extern int dword_41516C; // weak
extern int dword_415170; // weak
extern int dword_415174; // weak
extern int dword_4151B0; // weak
extern __int16 word_41523C; // weak
extern __int16 word_415240; // weak
extern __int16 word_415244; // weak
extern __int16 word_415248; // weak
extern int dword_41524C; // weak
extern int dword_415250; // weak
extern int dword_415254; // weak
extern int dword_415258; // weak
extern int dword_41525C; // weak
extern int dword_415260; // weak
extern int dword_415264; // weak
extern int dword_415268; // weak
extern __int16 word_41526C; // weak
extern int dword_415270; // weak
extern int dword_415274; // weak
extern __int16 word_415278; // weak
extern int dword_41547C; // weak
extern _UNKNOWN unk_415520; // weak
extern int dword_415530; // weak
extern PVOID dword_415534; // idb
extern PVOID Ptr; // idb
extern int (__cdecl *dword_415548)(_DWORD, _DWORD, _DWORD); // weak
// extern void *_initenv; weak
// extern int fmode;
// extern void *commode; weak
//-------------------------------------------------------------------------
// Function declarations
#define __thiscall __cdecl // Test compile in C mode
int sub_411005(void); // weak
int sub_41100F(void); // weak
int __cdecl j___crtSetUnhandledExceptionFilter(_DWORD); // weak
_DWORD __cdecl sub_411019(_DWORD); // weak
int sub_411028(); // weak
int sub_411032(void); // weak
_DWORD __cdecl sub_41103C(_DWORD); // weak
int sub_411041(); // weak
int __cdecl j__lock(_DWORD); // weak
_DWORD __cdecl sub_41104B(char); // weak
void __cdecl terminate(); // idb
int __cdecl j__initterm(_DWORD, _DWORD); // weak
int __cdecl j___crtTerminateProcess(_DWORD); // weak
_DWORD __cdecl sub_411078(_DWORD, _DWORD); // weak
int __cdecl j__crt_debugger_hook(_DWORD); // weak
_DWORD __cdecl sub_411087(_DWORD); // weak
int __cdecl sub_41108C(_DWORD); // weak
int __cdecl j___crtUnhandledException(_DWORD); // weak
int __stdcall sub_4110A5(); // weak
int j___SEH_epilog4(void); // weak
int __cdecl j__unlock(_DWORD); // weak
int __cdecl sub_4110C8(_DWORD, _DWORD, _DWORD); // weak
int sub_4110D2(void); // weak
_DWORD __cdecl j___SEH_prolog4(_DWORD, _DWORD); // weak
_DWORD __cdecl sub_4110F5(_DWORD); // weak
int __cdecl j__amsg_exit(_DWORD); // weak
int __cdecl j__XcptFilter(_DWORD, _DWORD); // weak
int sub_41110E(); // weak
BOOL __stdcall j_IsProcessorFeaturePresent(DWORD ProcessorFeature);
int __cdecl j___dllonexit(_DWORD, _DWORD, _DWORD); // weak
int __cdecl j__initterm_e(_DWORD, _DWORD); // weak
int __cdecl sub_411253();
int __cdecl sub_41127E();
int __cdecl sub_411365();
// int __usercall sub_4114DE<eax>(int a1<ebp>);
// void __usercall sub_4114F2(int a1<ebp>);
int loc_41150D(); // weak
// int __usercall start_0<eax>(int a1<ebp>);
int __stdcall sub_4115EA(int a1);
int __cdecl sub_41163B();
int __cdecl sub_411658();
int __cdecl sub_411670(int a1, unsigned int a2);
// unsigned int __usercall sub_4116D0<eax>(int a1<eax>, int a2);
bool __cdecl sub_4117C0(int a1);
signed int __cdecl sub_411810();
int __cdecl sub_4118D3();
signed int __cdecl sub_4118D6();
// int __usercall sub_411921<eax>(int a1<ebp>);
int __cdecl sub_4119C1();
int __cdecl sub_4119F4(int a1);
void __cdecl sub_411A0E();
int __thiscall sub_411B9A(void *this, char a2);
int __cdecl sub_411BB2(int a1);
// int __usercall sub_411BFE<eax>(int a1<ebx>, int a2<edi>, int a3<esi>, char a4);
// int __usercall sub_411D46<eax>(int a1<ebx>, int a2<edi>, int a3<esi>, int a4);
// BOOL __stdcall IsDebuggerPresent();
// PVOID __stdcall DecodePointer(PVOID Ptr);
// void __stdcall GetSystemTimeAsFileTime(LPFILETIME lpSystemTimeAsFileTime);
// DWORD __stdcall GetCurrentThreadId();
// DWORD __stdcall GetCurrentProcessId();
// BOOL __stdcall QueryPerformanceCounter(LARGE_INTEGER *lpPerformanceCount);
// PVOID __stdcall EncodePointer(PVOID Ptr);
// int __cdecl _setusermatherr(_DWORD); weak
// int __cdecl configthreadlocale(_DWORD); weak
// int __cdecl calloc_crt(_DWORD, _DWORD); weak
// _onexit_t __cdecl onexit(_onexit_t Func);
// int cexit(void); weak
// void __cdecl exit(int Code);
// void __cdecl exit(int Code);
// int __cdecl _set_app_type(_DWORD); weak
// int __cdecl _getmainargs(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD); weak
// int printf(const char *Format, ...);
//----- (00411253) --------------------------------------------------------
int __cdecl sub_411253()
{
return printf(Format);
}
//----- (0041127E) --------------------------------------------------------
int __cdecl sub_41127E()
{
int v0; // eax@2
if ( v400000 != 23117 || *(_DWORD *)(v40003C + 4194304) != 17744 || *(_WORD *)(v40003C + 4194328) != 267 )
{
v0 = 0;
}
else
{
v0 = 0;
if ( *(_DWORD *)(v40003C + 4194420) > 0xEu )
LOBYTE(v0) = *(_DWORD *)(v40003C + 4194536) != 0;
}
dword_415130 = v0;
_set_app_type(1);
dword_415534 = EncodePointer((PVOID)0xFFFFFFFF);
Ptr = dword_415534;
fmode = dword_41515C;
commode = (void *)dword_415150;
sub_4110D2();
sub_41100F();
if ( !dword_415004 )
_setusermatherr(sub_41110E);
sub_411005();
if ( dword_415010 == -1 )
configthreadlocale(-1);
return 0;
}
// 411005: using guessed type int sub_411005(void);
// 41100F: using guessed type int sub_41100F(void);
// 4110D2: using guessed type int sub_4110D2(void);
// 41110E: using guessed type int sub_41110E();
// 415004: using guessed type int dword_415004;
// 415010: using guessed type int dword_415010;
// 415130: using guessed type int dword_415130;
// 415150: using guessed type int dword_415150;
// 41515C: using guessed type int dword_41515C;
// 416050: using guessed type int __cdecl _setusermatherr(_DWORD);
// 416064: using guessed type void *commode;
// 416070: using guessed type int __cdecl configthreadlocale(_DWORD);
// 4160A8: using guessed type int __cdecl _set_app_type(_DWORD);
//----- (00411365) --------------------------------------------------------
int __cdecl sub_411365()
{
int result; // eax@1
sub_41103C(sub_411028);
dword_415144 = dword_415158;
result = _getmainargs(&dword_415134, &dword_415138, &dword_41513C, dword_415154, &dword_415144);
dword_415140 = result;
if ( result < 0 )
result = j__amsg_exit(8);
return result;
}
// 411028: using guessed type int sub_411028();
// 41103C: using guessed type _DWORD __cdecl sub_41103C(_DWORD);
// 4110FA: using guessed type int __cdecl j__amsg_exit(_DWORD);
// 415134: using guessed type int dword_415134;
// 415138: using guessed type int dword_415138;
// 41513C: using guessed type int dword_41513C;
// 415140: using guessed type int dword_415140;
// 415144: using guessed type int dword_415144;
// 415154: using guessed type int dword_415154;
// 415158: using guessed type int dword_415158;
// 4160AC: using guessed type int __cdecl _getmainargs(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
//----- (004114DE) --------------------------------------------------------
int __usercall sub_4114DE<eax>(int a1<ebp>)
{
int v1; // ecx@1
int v2; // eax@1
v1 = *(_DWORD *)(a1 - 20);
v2 = **(_DWORD **)v1;
*(_DWORD *)(a1 - 28) = v2;
return j__XcptFilter(v2, v1);
}
// 4110FF: using guessed type int __cdecl j__XcptFilter(_DWORD, _DWORD);
//----- (004114F2) --------------------------------------------------------
void __usercall sub_4114F2(int a1<ebp>)
{
int v1; // eax@1
v1 = *(_DWORD *)(a1 - 28);
dword_41512C = *(_DWORD *)(a1 - 28);
JUMPOUT(dword_415130, 0, loc_41150D);
exit(v1);
}
// 41150D: using guessed type int loc_41150D();
// 41512C: using guessed type int dword_41512C;
// 415130: using guessed type int dword_415130;
//----- (004115DE) --------------------------------------------------------
int __usercall start_0<eax>(int a1<ebp>)
{
signed __int32 v1; // edx@1
signed int v2; // edi@1
signed __int32 v3; // eax@2
signed int v4; // esi@4
int v5; // eax@19
sub_411032();
j___SEH_prolog4(&unk_413FA0, 12);
*(_DWORD *)(a1 - 4) = 0;
v1 = *(_DWORD *)(__readfsdword(24) + 4);
v2 = 0;
while ( 1 )
{
v3 = _InterlockedCompareExchange((signed __int32 *)&unk_415520, v1, 0);
if ( !v3 )
break;
if ( v3 == v1 )
{
v4 = 1;
v2 = 1;
goto LABEL_6;
}
}
v4 = 1;
LABEL_6:
if ( dword_415530 == v4 )
{
j__amsg_exit(31);
}
else
{
if ( dword_415530 )
{
dword_415128 = v4;
}
else
{
dword_415530 = v4;
if ( j__initterm_e(&unk_41330C, &unk_41371C) )
{
*(_DWORD *)(a1 - 4) = -2;
return j___SEH_epilog4();
}
}
}
if ( dword_415530 == v4 )
{
j__initterm(&unk_413000, &unk_413208);
dword_415530 = 2;
}
if ( !v2 )
_InterlockedExchange((signed __int32 *)&unk_415520, 0);
if ( dword_415548 && sub_4110F5(&dword_415548) )
dword_415548(0, 2, 0);
_initenv = (void *)dword_41513C;
v5 = sub_4110C8(dword_415134, dword_415138, dword_41513C);
dword_41512C = v5;
if ( !dword_415130 )
exit(v5);
if ( !dword_415128 )
cexit();
*(_DWORD *)(a1 - 4) = -2;
return j___SEH_epilog4();
}
// 411032: using guessed type int sub_411032(void);
// 41105F: using guessed type int __cdecl j__initterm(_DWORD, _DWORD);
// 4110B4: using guessed type int j___SEH_epilog4(void);
// 4110C8: using guessed type int __cdecl sub_4110C8(_DWORD, _DWORD, _DWORD);
// 4110D7: using guessed type _DWORD __cdecl j___SEH_prolog4(_DWORD, _DWORD);
// 4110F5: using guessed type _DWORD __cdecl sub_4110F5(_DWORD);
// 4110FA: using guessed type int __cdecl j__amsg_exit(_DWORD);
// 411127: using guessed type int __cdecl j__initterm_e(_DWORD, _DWORD);
// 415128: using guessed type int dword_415128;
// 41512C: using guessed type int dword_41512C;
// 415130: using guessed type int dword_415130;
// 415134: using guessed type int dword_415134;
// 415138: using guessed type int dword_415138;
// 41513C: using guessed type int dword_41513C;
// 415530: using guessed type int dword_415530;
// 415548: using guessed type int (__cdecl *dword_415548)(_DWORD, _DWORD, _DWORD);
// 41605C: using guessed type void *_initenv;
// 41609C: using guessed type int cexit(void);
//----- (004115EA) --------------------------------------------------------
int __stdcall sub_4115EA(int a1)
{
_DWORD *v1; // eax@1
int v2; // eax@3
v1 = *(_DWORD **)a1;
if ( **(_DWORD **)a1 == -529697949 )
{
if ( v1[4] == 3 )
{
v2 = v1[5];
if ( v2 == 429065504 || v2 == 429065505 || v2 == 429065506 || v2 == 26820608 )
terminate();
}
}
return 0;
}
//----- (0041163B) --------------------------------------------------------
int __cdecl sub_41163B()
{
j___crtSetUnhandledExceptionFilter(sub_4110A5);
return 0;
}
// 411014: using guessed type int __cdecl j___crtSetUnhandledExceptionFilter(_DWORD);
// 4110A5: using guessed type int __stdcall sub_4110A5();
//----- (00411658) --------------------------------------------------------
int __cdecl sub_411658()
{
return 0;
}
//----- (00411670) --------------------------------------------------------
int __cdecl sub_411670(int a1, unsigned int a2)
{
unsigned int v2; // edx@1
int v3; // ecx@1
int result; // eax@1
unsigned int v5; // esi@2
v2 = 0;
v3 = a1 + *(_DWORD *)(a1 + 60);
result = v3 + *(_WORD *)(v3 + 20) + 24;
if ( *(_WORD *)(v3 + 6) )
{
while ( 1 )
{
v5 = *(_DWORD *)(result + 12);
if ( a2 >= v5 )
{
if ( a2 < v5 + *(_DWORD *)(result + 8) )
break;
}
++v2;
result += 40;
if ( v2 >= *(_WORD *)(v3 + 6) )
goto LABEL_5;
}
}
else
{
LABEL_5:
result = 0;
}
return result;
}
//----- (004116D0) --------------------------------------------------------
unsigned int __usercall sub_4116D0<eax>(int a1<eax>, int a2)
{
int v2; // eax@2
unsigned int result; // eax@3
unsigned int v4; // [sp-10h] [bp-28h]@1
unsigned int *v5; // [sp+0h] [bp-18h]@1
int v6; // [sp+8h] [bp-10h]@1
int (*v7)(); // [sp+Ch] [bp-Ch]@1
unsigned int v8; // [sp+10h] [bp-8h]@1
int v9; // [sp+14h] [bp-4h]@1
int v10; // [sp+18h] [bp+0h]@1
v7 = sub_411041;
v6 = a1;
v8 = __security_cookie ^ (unsigned int)&unk_413FC0;
v4 = (unsigned int)&v10 ^ __security_cookie;
v5 = &v4;
v9 = 0;
if ( sub_411087(4194304) && (v2 = sub_411078(4194304, a2 - 4194304)) != 0 )
{
result = ~(unsigned __int8)(*(_DWORD *)(v2 + 36) >> 31) & 1;
v9 = -2;
}
else
{
result = 0;
}
return result;
}
// 411041: using guessed type int sub_411041();
// 411078: using guessed type _DWORD __cdecl sub_411078(_DWORD, _DWORD);
// 411087: using guessed type _DWORD __cdecl sub_411087(_DWORD);
// 415018: using guessed type int __security_cookie;
//----- (004117C0) --------------------------------------------------------
bool __cdecl sub_4117C0(int a1)
{
bool result; // al@2
int v2; // ecx@3
if ( *(_WORD *)a1 == 23117 )
{
v2 = a1 + *(_DWORD *)(a1 + 60);
result = 0;
if ( *(_DWORD *)v2 == 17744 )
result = *(_WORD *)(v2 + 24) == 267;
}
else
{
result = 0;
}
return result;
}
//----- (00411810) --------------------------------------------------------
signed int __cdecl sub_411810()
{
signed int result; // eax@3
DWORD v1; // ecx@4
LARGE_INTEGER PerformanceCount; // [sp+8h] [bp-14h]@4
struct _FILETIME SystemTimeAsFileTime; // [sp+10h] [bp-Ch]@1
DWORD v4; // [sp+18h] [bp-4h]@4
SystemTimeAsFileTime.dwLowDateTime = 0;
SystemTimeAsFileTime.dwHighDateTime = 0;
if ( __security_cookie != -1153374642 && __security_cookie & 0xFFFF0000 )
{
result = ~__security_cookie;
dword_41501C = ~__security_cookie;
}
else
{
GetSystemTimeAsFileTime(&SystemTimeAsFileTime);
v4 = SystemTimeAsFileTime.dwLowDateTime ^ SystemTimeAsFileTime.dwHighDateTime;
v4 = GetCurrentThreadId() ^ SystemTimeAsFileTime.dwLowDateTime ^ SystemTimeAsFileTime.dwHighDateTime;
v4 ^= GetCurrentProcessId();
QueryPerformanceCounter(&PerformanceCount);
result = (signed int)&v4;
v1 = (unsigned int)&v4 ^ v4 ^ PerformanceCount.s.LowPart ^ PerformanceCount.s.HighPart;
if ( v1 == -1153374642 )
{
v1 = -1153374641;
}
else
{
if ( !(v1 & 0xFFFF0000) )
{
result = (v1 | 0x4711) << 16;
v1 |= result;
}
}
__security_cookie = v1;
dword_41501C = ~v1;
}
return result;
}
// 415018: using guessed type int __security_cookie;
// 41501C: using guessed type int dword_41501C;
//----- (004118D3) --------------------------------------------------------
int __cdecl sub_4118D3()
{
return 0;
}
//----- (004118D6) --------------------------------------------------------
signed int __cdecl sub_4118D6()
{
signed int result; // eax@2
void *v1; // esi@3
if ( Ptr )
{
result = 0;
}
else
{
v1 = (void *)calloc_crt(32, 4);
Ptr = EncodePointer(v1);
dword_415534 = Ptr;
if ( v1 )
{
*(_DWORD *)v1 = 0;
result = 0;
}
else
{
result = 24;
}
}
return result;
}
// 416078: using guessed type int __cdecl calloc_crt(_DWORD, _DWORD);
//----- (00411921) --------------------------------------------------------
int __usercall sub_411921<eax>(int a1<ebp>)
{
PVOID v1; // eax@1
PVOID v2; // eax@3
j___SEH_prolog4(&unk_413FE0, 20);
*(_DWORD *)(a1 - 36) = 0;
v1 = DecodePointer(Ptr);
*(_DWORD *)(a1 - 28) = v1;
if ( v1 == (PVOID)-1 )
{
onexit(*(_onexit_t *)(a1 + 8));
}
else
{
j__lock(8);
*(_DWORD *)(a1 - 4) = 0;
*(_DWORD *)(a1 - 28) = DecodePointer(Ptr);
*(_DWORD *)(a1 - 32) = DecodePointer(dword_415534);
v2 = EncodePointer(*(PVOID *)(a1 + 8));
*(_DWORD *)(a1 - 36) = j___dllonexit(v2, a1 - 28, a1 - 32);
Ptr = EncodePointer(*(PVOID *)(a1 - 28));
dword_415534 = EncodePointer(*(PVOID *)(a1 - 32));
*(_DWORD *)(a1 - 4) = -2;
sub_4119C1();
}
return j___SEH_epilog4();
}
// 411046: using guessed type int __cdecl j__lock(_DWORD);
// 4110B4: using guessed type int j___SEH_epilog4(void);
// 4110D7: using guessed type _DWORD __cdecl j___SEH_prolog4(_DWORD, _DWORD);
// 411122: using guessed type int __cdecl j___dllonexit(_DWORD, _DWORD, _DWORD);
//----- (004119C1) --------------------------------------------------------
int __cdecl sub_4119C1()
{
return j__unlock(8);
}
// 4110B9: using guessed type int __cdecl j__unlock(_DWORD);
//----- (004119F4) --------------------------------------------------------
int __cdecl sub_4119F4(int a1)
{
return (sub_41108C(a1) != 0) - 1;
}
// 41108C: using guessed type int __cdecl sub_41108C(_DWORD);
//----- (00411A0E) --------------------------------------------------------
void __cdecl sub_411A0E()
{
unsigned int i; // esi@1
for ( i = (unsigned int)&unk_413B94; i < (unsigned int)&unk_413C94; i += 4 )
{
if ( *(_DWORD *)i )
(*(void (**)(void))i)();
}
}
//----- (00411B9A) --------------------------------------------------------
int __thiscall sub_411B9A(void *this, char a2)
{
if ( this == (void *)__security_cookie )
__asm { rep retn }
return sub_41104B(a2);
}
// 41104B: using guessed type _DWORD __cdecl sub_41104B(char);
// 415018: using guessed type int __security_cookie;
//----- (00411BB2) --------------------------------------------------------
int __cdecl sub_411BB2(int a1)
{
dword_41547C = IsDebuggerPresent();
j__crt_debugger_hook(1);
j___crtUnhandledException(a1);
if ( !dword_41547C )
j__crt_debugger_hook(1);
return j___crtTerminateProcess(-1073740791);
}
// 411064: using guessed type int __cdecl j___crtTerminateProcess(_DWORD);
// 411082: using guessed type int __cdecl j__crt_debugger_hook(_DWORD);
// 4110A0: using guessed type int __cdecl j___crtUnhandledException(_DWORD);
// 41547C: using guessed type int dword_41547C;
//----- (00411BFE) --------------------------------------------------------
int __usercall sub_411BFE<eax>(int a1<ebx>, int a2<edi>, int a3<esi>, char a4)
{
BOOL v4; // eax@1
int v5; // edx@1
signed int v6; // ecx@1
int v12; // [sp-4h] [bp-328h]@1
int v13; // [sp+324h] [bp+0h]@0
int v14; // [sp+328h] [bp+4h]@3
v4 = j_IsProcessorFeaturePresent(0x17u);
_CF = 0;
_OF = 0;
_ZF = v4 == 0;
_SF = v4 < 0;
if ( v4 )
{
v6 = 2;
__asm { int 29h ; DOS 2+ internal - FAST PUTCHAR }
}
dword_415260 = v4;
dword_41525C = v6;
dword_415258 = v5;
dword_415254 = a1;
dword_415250 = a3;
dword_41524C = a2;
word_415278 = __SS__;
word_41526C = __CS__;
word_415248 = __DS__;
word_415244 = __ES__;
word_415240 = __FS__;
word_41523C = __GS__;
__asm { pushf }
dword_415270 = v12;
dword_415264 = v13;
dword_415268 = v14;
dword_415274 = (int)&a4;
dword_4151B0 = 65537;
dword_41516C = v14;
dword_415160 = -1073740791;
dword_415164 = 1;
dword_415170 = 1;
dword_415174 = 2;
return sub_411019(off_41387C);
}
// 411019: using guessed type _DWORD __cdecl sub_411019(_DWORD);
// 41387C: using guessed type int off_41387C[2];
// 415160: using guessed type int dword_415160;
// 415164: using guessed type int dword_415164;
// 41516C: using guessed type int dword_41516C;
// 415170: using guessed type int dword_415170;
// 415174: using guessed type int dword_415174;
// 4151B0: using guessed type int dword_4151B0;
// 41523C: using guessed type __int16 word_41523C;
// 415240: using guessed type __int16 word_415240;
// 415244: using guessed type __int16 word_415244;
// 415248: using guessed type __int16 word_415248;
// 41524C: using guessed type int dword_41524C;
// 415250: using guessed type int dword_415250;
// 415254: using guessed type int dword_415254;
// 415258: using guessed type int dword_415258;
// 41525C: using guessed type int dword_41525C;
// 415260: using guessed type int dword_415260;
// 415264: using guessed type int dword_415264;
// 415268: using guessed type int dword_415268;
// 41526C: using guessed type __int16 word_41526C;
// 415270: using guessed type int dword_415270;
// 415274: using guessed type int dword_415274;
// 415278: using guessed type __int16 word_415278;
//----- (00411D46) --------------------------------------------------------
int __usercall sub_411D46<eax>(int a1<ebx>, int a2<edi>, int a3<esi>, int a4)
{
BOOL v4; // eax@1
int v5; // edx@1
int v6; // ecx@1
int v12; // [sp-4h] [bp-320h]@1
int v13; // [sp+31Ch] [bp+0h]@0
int v14; // [sp+320h] [bp+4h]@3
v4 = j_IsProcessorFeaturePresent(0x17u);
_CF = 0;
_OF = 0;
_ZF = v4 == 0;
_SF = v4 < 0;
if ( v4 )
{
v6 = a4;
__asm { int 29h ; DOS 2+ internal - FAST PUTCHAR }
}
dword_415260 = v4;
dword_41525C = v6;
dword_415258 = v5;
dword_415254 = a1;
dword_415250 = a3;
dword_41524C = a2;
word_415278 = __SS__;
word_41526C = __CS__;
word_415248 = __DS__;
word_415244 = __ES__;
word_415240 = __FS__;
word_41523C = __GS__;
__asm { pushf }
dword_415270 = v12;
dword_415264 = v13;
dword_415268 = v14;
dword_415274 = (int)&a4;
dword_41516C = v14;
dword_415160 = -1073740791;
dword_415164 = 1;
dword_415170 = 1;
dword_415174 = a4;
return sub_411019(off_41387C);
}
// 411019: using guessed type _DWORD __cdecl sub_411019(_DWORD);
// 41387C: using guessed type int off_41387C[2];
// 415160: using guessed type int dword_415160;
// 415164: using guessed type int dword_415164;
// 41516C: using guessed type int dword_41516C;
// 415170: using guessed type int dword_415170;
// 415174: using guessed type int dword_415174;
// 41523C: using guessed type __int16 word_41523C;
// 415240: using guessed type __int16 word_415240;
// 415244: using guessed type __int16 word_415244;
// 415248: using guessed type __int16 word_415248;
// 41524C: using guessed type int dword_41524C;
// 415250: using guessed type int dword_415250;
// 415254: using guessed type int dword_415254;
// 415258: using guessed type int dword_415258;
// 41525C: using guessed type int dword_41525C;
// 415260: using guessed type int dword_415260;
// 415264: using guessed type int dword_415264;
// 415268: using guessed type int dword_415268;
// 41526C: using guessed type __int16 word_41526C;
// 415270: using guessed type int dword_415270;
// 415274: using guessed type int dword_415274;
// 415278: using guessed type __int16 word_415278;
// ALL OK, 23 function(s) have been successfully decompiled