Fun stuff, tried the IDA plugin on function CGPlayer_C::ClickToMove - pretty neat but it's clearly missing a great deal of instructions. I still prefer Hex-Rays.
Code:
struct s0 {
int32_t f0;
int32_t f4;
int32_t f8;
};
struct s1 {
int32_t f0;
int32_t f4;
};
struct s3 {
signed char[44] pad44;
int32_t f44;
signed char[264] pad312;
int32_t f312;
};
struct s4 {
int32_t f0;
int32_t f4;
uint32_t f8;
};
struct s5 {
signed char[72] pad72;
unsigned char f72;
};
struct s2 {
struct s3* f0;
signed char[4] pad8;
struct s4* f8;
signed char[204] pad216;
struct s5* f216;
};
int32_t gca1238 = -1;
int32_t gca123c = -1;
struct s0* gca11f4 = (struct s0*)0xffffffff;
/* FrameScript::SignalEvent */
void FrameScript_SignalEvent(int32_t a1, int32_t a2, int32_t a3, struct s0* a4);
int32_t PerformanceCounter(struct s0* a1, struct s0* a2, struct s1* a3, struct s0* a4);
int32_t gca11f8 = -1;
int32_t gca11fc = -1;
int32_t gca1200 = -1;
int32_t gca11d4 = -1;
/* ClickToMove::CanMoveTo */
signed char ClickToMove_CanMoveTo();
/* ClickToMove::GetInteractDistanceOfAction */
signed char ClickToMove_GetInteractDistanceOfAction();
int32_t gca11f0 = -1;
struct s6 {
int32_t f0;
int32_t f4;
int32_t f8;
};
/* CMovement::GetPosition */
struct s6* CMovement_GetPosition();
int32_t gca1258 = -1;
int32_t gca125c = -1;
int32_t gca1260 = -1;
int32_t gca1264 = -1;
int32_t gca1268 = -1;
int32_t gca126c = -1;
/* CGPlayer_C::TryChangeStandState */
void CGPlayer_C_TryChangeStandState(signed char a1);
/* CGPlayer_C::ClickToMove */
signed char CGPlayer_C_ClickToMove(struct s0* a1, struct s1* a2, struct s0* a3) {
struct s2* ebx4;
struct s2* ecx5;
struct s4* eax6;
struct s0* eax7;
int32_t v8;
struct s0* v9;
int32_t eax10;
struct s0* esi11;
signed char al12;
signed char al13;
struct s1* v14;
int32_t eax15;
int32_t eax16;
struct s6* eax17;
struct s1* eax18;
int32_t eax19;
uint32_t ecx20;
ebx4 = ecx5;
eax6 = ebx4->f8;
if (eax6->f0 == gca1238 && (eax6->f4 == gca123c && (eax7 = gca11f4, eax7 != 13))) {
if ((int1_t)(eax7 == 3)) {
FrameScript_SignalEvent(0x166, 0, v8, a1);
}
eax10 = PerformanceCounter(v9, a1, a2, a3);
__asm__("fldz ");
__asm__("fstp dword [0xca11d0]");
gca11f8 = 0;
gca11fc = 0;
gca1200 = 0;
gca11d4 = 0;
gca11f4 = (struct s0*)13;
}
esi11 = a3;
al12 = ClickToMove_CanMoveTo();
if (al12 == 0 || (al13 = ClickToMove_GetInteractDistanceOfAction(), al13 == 0)) {
return 0;
} else {
gca11f4 = a1;
eax15 = PerformanceCounter(a1, esi11, v14, a1);
gca11f0 = eax15;
eax16 = (int32_t)ebx4->f0->f44((int32_t)"intrinsic"() - 4 + -12);
eax17 = CMovement_GetPosition();
__asm__("fld dword [ebp+0x14]");
__asm__("fstp dword [0xca11ec]");
gca1258 = eax17->f0;
gca125c = eax17->f4;
gca1260 = eax17->f8;
eax18 = a2;
gca1264 = esi11->f0;
gca11f8 = eax18->f0;
gca1268 = esi11->f4;
gca11fc = eax18->f4;
gca126c = esi11->f8;
if ((ebx4->f216->f72 & 8) == 0) {
__asm__("fld dword [0x9e8d34]");
} else {
__asm__("fld dword [eax+0xac]");
}
__asm__("fstp dword [0xca11dc]");
gca11d4 = 0;
__asm__("fld dword [0xca11e0]");
__asm__("fsqrt ");
__asm__("fstp dword [0xca11e4]");
__asm__("fldz ");
__asm__("fst dword [0xca11d0]");
__asm__("fcomp dword [0xca11a4]");
__asm__("fnstsw ax");
if (!"intrinsic"()) {
__asm__("fld dword [ebx+0x81c]");
__asm__("fstp dword [0xca11a4]");
}
eax19 = (int32_t)ebx4->f0->f312();
if (eax19 != 0 && (ecx20 = ebx4->f8->f8 >> 4, (*(unsigned char*)&ecx20 & 1) != 0)) {
CGPlayer_C_TryChangeStandState(0);
}
return 1;
}
}