Okay, well I'm going to clean it up some, as your the copyright holder now: (none of it was pointers and it still needs know it's sign!)

3 views
Skip to first unread message

Nicholas Forystek

unread,
Jan 6, 2017, 5:46:42 AM1/6/17
to
//
// This file was generated by the Retargetable Decompiler
// Website: https://retdec.com
// Copyright (c) 2017 Retargetable Decompiler <in...@retdec.com>
//

#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

// ----------------- Float Types Definitions ------------------

typedef float float32_t;
typedef long double float80_t;

// ------------------- Function Prototypes --------------------

int32_t Collision(int32_t a1, uint32_t a2, int32_t * a3, float32_t * a4,
float32_t * a5, int32_t * a6, int32_t a7, int32_t * a8, int32_t * a9);
int32_t Forystek(uint32_t a1, int32_t a2, int32_t * a3, int32_t * a4,
int32_t * a5, int32_t * a6, int32_t * a7, int32_t * a8, int32_t * a9,
int32_t * a10, int32_t * a11, int32_t a12, int32_t a13, int32_t a14, int32_t
a15);
void PointBehindPoly(void);
int32_t PointInPoly(int32_t a1, int32_t a2, int32_t * a3, int32_t * a4,
int32_t a5);
int32_t Test(int32_t a1, int32_t a2, int32_t a3);
int32_t tri_tri_intersect(float32_t * a1, float32_t * a2, float32_t * a3,
float32_t * a4, float32_t * a5, float32_t * a6, int32_t a7);

// --------------------- Global Variables ---------------------

int32_t g1 = 0; // edi

// ------------------------ Functions -------------------------

// Address range: 0x10001c60 - 0x1000237f
int32_t tri_tri_intersect(float32_t * a1, float32_t * a2, float32_t * a3,
float32_t * a4, float32_t * a5, float32_t * a6, int32_t a7) {
float80_t v1 = 0.0L; // st7
float80_t v2 = 0.0L; // st0
int32_t v3 = (int32_t)a1;
int32_t v4 = (int32_t)a2;
int32_t v5 = (int32_t)a3;
int32_t v6 = (int32_t)a4;
float80_t v7 = (float80_t)*a2 - (float80_t)*a1; // 0x10001c79
float32_t * v8 = (float32_t *)(v3 + 4); // 0x10001c7e_0
float80_t v9 = (float80_t)*(float32_t *)(v4 + 4) - (float80_t)*v8; //
0x10001c7e
float32_t * v10 = (float32_t *)(v3 + 8); // 0x10001c84_0
float80_t v11 = (float80_t)*(float32_t *)(v4 + 8) - (float80_t)*v10; //
0x10001c84
int32_t v12 = (int32_t)a5;
int32_t v13 = (int32_t)a6;
float80_t v14 = (float80_t)*(float32_t *)(v5 + 8) - (float80_t)*v10; //
0x10001ca4
float80_t v15 = (float80_t)(*(float32_t *)(v5 + 4) - *v8);
float80_t v16 = v9 * v14 - v11 * v15; // 0x10001cb1
float32_t v17 = v16; // bp-36
float80_t v18 = (float80_t)(*a3 - *a1);
float80_t v19 = v11 * v18 - v7 * v14; // 0x10001cc1
float80_t v20 = v7 * v15 - v9 * v18; // 0x10001cd5
float32_t v21 = *a1; // 0x10001ce3
float32_t v22 = *v8; // 0x10001ce9
float32_t v23 = *v10; // 0x10001cf2
float80_t v24 = -((v20 * (float80_t)v23 + (float80_t)v21 * v16 +
(float80_t)v22 * v19)); // 0x10001cf7
float32_t v25 = *(float32_t *)(v6 + 8); // 0x10001cfd
float32_t v26 = *(float32_t *)(v6 + 4); // 0x10001d04
float32_t v27 = *a4; // 0x10001d0d
float32_t v28 = *(float32_t *)(v12 + 8); // 0x10001d1b
float32_t v29 = *(float32_t *)(v12 + 4); // 0x10001d22
float32_t v30 = *a5; // 0x10001d2b
float32_t v31 = v24 + v20 * (float80_t)v28 + v19 * (float80_t)v29 + v16
* (float80_t)v30; // 0x10001d31
float32_t v32 = *a6; // 0x10001d39
float32_t v33 = *(float32_t *)(v13 + 8); // 0x10001d40
float32_t v34 = *(float32_t *)(v13 + 4); // 0x10001d49
float32_t v35 = v24 + v16 * (float80_t)v32 + v20 * (float80_t)v33 + v19
* (float80_t)v34; // 0x10001d50
float80_t v36 = fabsl(v24 + v20 * (float80_t)v25 + v19 * (float80_t)v26
+ v16 * (float80_t)v27); // 0x10001d5a
float80_t v37;
float32_t * v38; // 0x10001de7_0
float32_t * v39; // 0x10001dec_0
float32_t * v40; // 0x10001df2_0
float80_t v41; // st6
int32_t v42;
float32_t v43;
float80_t v44;
int32_t v45;
float80_t v46;
float80_t v47;
float80_t v48;
float32_t v49;
float32_t * v50;
int32_t v51; // 0x10001de5
int32_t v52; // 0x10001de7
int32_t v53; // 0x10001e64
int32_t v54; // 0x10001e82
int32_t v55; // 0x10002004
int32_t v56; // 0x10001df5
int32_t v57; // 0x10001ea0
float80_t v58; // 0x10001d75
float80_t v59; // 0x10001e5e
float80_t v60; // 0x10001eba
float80_t v61; // 0x10001ed5
float80_t v62; // 0x10001ffe
float32_t v63; // 0x10001e5a
float32_t v64; // 0x10001e64
float32_t v65; // 0x10001e82
float32_t v66; // 0x10001eb0
float80_t v67; // 0x10001de7
float32_t v68; // 0x10001dec
float32_t v69; // 0x10001e4a
float32_t v70; // 0x10001e51
float32_t v71; // 0x10001e6a
float32_t v72; // 0x10001e73
float32_t v73; // 0x10001e88
float32_t v74; // 0x10001e91
float32_t v75; // 0x10001e98
float32_t v76; // 0x10001ea0
float32_t v77; // 0x10001ea7
float80_t v78; // 0x10001fd4
float80_t v79; // 0x10001fdb
float80_t v80; // 0x10001fe2
float80_t v81; // 0x10002013
float80_t v82; // 0x10001df2
float80_t v83; // 0x10001e18
float80_t v84; // 0x10001e28
float80_t v85; // 0x10001e3c
float80_t v86; // 0x10001dec
float80_t v87; // 0x10001df2
float80_t v88; // 0x10001e0b
if (v36 <= 9.9999999e-7L) {
// if_10001d5c_1_false
if (v36 >= 9.9999999e-7L) {
// if_10001d5c_2_false
// branch -> after_if_10001d5c_1
}
// after_if_10001d5c_1
v58 = fabsl((float80_t)v31);
if (v58 <= 9.9999999e-7L) {
// if_10001d77_1_false
if (v58 >= 9.9999999e-7L) {
// if_10001d77_2_false
// branch -> after_if_10001d77_1
}
}
// after_if_10001d77_1
fabsl((float80_t)v35);
v51 = v12;
v52 = v6;
v38 = (float32_t *)v52;
v67 = (float80_t)*(float32_t *)v51 - (float80_t)*v38;
v39 = (float32_t *)(v52 + 4);
v68 = *v39;
v86 = (float80_t)*(float32_t *)(v51 + 4) - (float80_t)v68;
v40 = (float32_t *)(v52 + 8);
v82 = (float80_t)*v40;
v87 = (float80_t)*(float32_t *)(v51 + 8) - v82;
v56 = v13;
v88 = (float80_t)*(float32_t *)(v56 + 8) - v82;
v46 = (float80_t)(*(float32_t *)(v56 + 4) - v68);
v83 = v86 * v88 - v87 * v46;
v47 = (float80_t)(*(float32_t *)v56 - *v38);
v84 = v87 * v47 - v67 * v88;
v85 = v67 * v46 - v86 * v47;
v69 = *v40;
v70 = *v39;
v63 = *v38;
v59 = -(((float80_t)v63 * v83 + (float80_t)v69 * v85 +
(float80_t)v70 * v84));
v53 = v3;
v64 = *(float32_t *)v53;
v71 = *(float32_t *)(v53 + 4);
v72 = *(float32_t *)(v53 + 8);
v54 = v4;
v65 = *(float32_t *)v54;
v73 = *(float32_t *)(v54 + 4);
v74 = *(float32_t *)(v54 + 8);
v75 = v59 + v83 * (float80_t)v65 + v84 * (float80_t)v73 + v85 *
(float80_t)v74;
v57 = v5;
v76 = *(float32_t *)(v57 + 8);
v77 = *(float32_t *)(v57 + 4);
v66 = *(float32_t *)v57;
v41 = v59 + v85 * (float80_t)v76 + v84 * (float80_t)v77 + v83 *
(float80_t)v66;
v60 = fabsl(v59 + v83 * (float80_t)v64 + v84 * (float80_t)v71 + v85
* (float80_t)v72);
if (v60 <= 9.9999999e-7L) {
// if_10001ebc_1_false
if (v60 >= 9.9999999e-7L) {
// if_10001ebc_2_false
// branch -> after_if_10001ebc_1
}
}
// after_if_10001ebc_1
v61 = fabsl((float80_t)v75);
if (v61 <= 9.9999999e-7L) {
// if_10001ed7_1_false
if (v61 >= 9.9999999e-7L) {
// if_10001ed7_2_false
// branch -> after_if_10001ed7_1
}
}
// after_if_10001ed7_1
fabsl(v41);
v48 = v17;
fabsl(v19 * v85 - v20 * v84);
fabsl(v20 * v83 - v85 * v48);
fabsl(v84 * v48 - v19 * v83);
fabsl(v84 * v48 - v19 * v83);
v78 = (float80_t)*(float32_t *)v3;
v79 = (float80_t)*(float32_t *)v4;
v80 = (float80_t)*(float32_t *)v5;
v62 = v1;
v42 = 0;
v45 = 0;
v55 = 0;
if (v62 <= 0.0L) {
// if_10001ffe_1_false
if (v62 >= 0.0L) {
// if_10001ffe_2_false
v42 = v62 != 0.0L ? 1024 : 0;
v45 = v62 != 0.0L ? 256 : 0;
v55 = 0x4000;
// branch -> after_if_10001ffe_1
} else {
v42 = 0;
v45 = 256;
v55 = 0;
}
}
// after_if_10001ffe_1
if ((v42 || v55 || v45) == 0x4100) {
// 0x1000200b
v81 = v2;
v37 = v80 + (v78 - v80) * v81 / v81;
v44 = v80 + (v79 - v80) * v81 / v81;
// branch -> after_if_100021b9_1
} else {
// 0x10002165
v37 = v78;
v44 = v78;
// branch -> after_if_100021b9_1
}
// after_if_100021b9_1
v49 = v37;
v43 = v44;
v50 = NULL;
if ((float32_t)(int32_t)v50 <= 0.0f) {
// if_10002231_1_false
if ((float32_t)(int32_t)v50 >= 0.0f) {
// if_10002231_2_false
// branch -> after_if_10002231_1
}
}
// after_if_10002231_1
if (false || v49 > v43) {
// 0x100022be
return 0;
}
// if_10002315_1_false
if (v49 >= v43) {
// if_10002315_2_false
// branch -> after_if_10002315_1
}
// after_if_10002315_1
return 0;
}
// after_if_10001d5c_1
v58 = fabsl((float80_t)v31);
if (v58 <= 9.9999999e-7L) {
// if_10001d77_1_false
if (v58 >= 9.9999999e-7L) {
// if_10001d77_2_false
// branch -> after_if_10001d77_1
}
// after_if_10001d77_1
fabsl((float80_t)v35);
v51 = v12;
v52 = v6;
v38 = (float32_t *)v52;
v67 = (float80_t)*(float32_t *)v51 - (float80_t)*v38;
v39 = (float32_t *)(v52 + 4);
v68 = *v39;
v86 = (float80_t)*(float32_t *)(v51 + 4) - (float80_t)v68;
v40 = (float32_t *)(v52 + 8);
v82 = (float80_t)*v40;
v87 = (float80_t)*(float32_t *)(v51 + 8) - v82;
v56 = v13;
v88 = (float80_t)*(float32_t *)(v56 + 8) - v82;
v46 = (float80_t)(*(float32_t *)(v56 + 4) - v68);
v83 = v86 * v88 - v87 * v46;
v47 = (float80_t)(*(float32_t *)v56 - *v38);
v84 = v87 * v47 - v67 * v88;
v85 = v67 * v46 - v86 * v47;
v69 = *v40;
v70 = *v39;
v63 = *v38;
v59 = -(((float80_t)v63 * v83 + (float80_t)v69 * v85 +
(float80_t)v70 * v84));
v53 = v3;
v64 = *(float32_t *)v53;
v71 = *(float32_t *)(v53 + 4);
v72 = *(float32_t *)(v53 + 8);
v54 = v4;
v65 = *(float32_t *)v54;
v73 = *(float32_t *)(v54 + 4);
v74 = *(float32_t *)(v54 + 8);
v75 = v59 + v83 * (float80_t)v65 + v84 * (float80_t)v73 + v85 *
(float80_t)v74;
v57 = v5;
v76 = *(float32_t *)(v57 + 8);
v77 = *(float32_t *)(v57 + 4);
v66 = *(float32_t *)v57;
v41 = v59 + v85 * (float80_t)v76 + v84 * (float80_t)v77 + v83 *
(float80_t)v66;
v60 = fabsl(v59 + v83 * (float80_t)v64 + v84 * (float80_t)v71 + v85
* (float80_t)v72);
if (v60 <= 9.9999999e-7L) {
// if_10001ebc_1_false
if (v60 >= 9.9999999e-7L) {
// if_10001ebc_2_false
// branch -> after_if_10001ebc_1
}
}
// after_if_10001ebc_1
v61 = fabsl((float80_t)v75);
if (v61 <= 9.9999999e-7L) {
// if_10001ed7_1_false
if (v61 >= 9.9999999e-7L) {
// if_10001ed7_2_false
// branch -> after_if_10001ed7_1
}
}
// after_if_10001ed7_1
fabsl(v41);
v48 = v17;
fabsl(v19 * v85 - v20 * v84);
fabsl(v20 * v83 - v85 * v48);
fabsl(v84 * v48 - v19 * v83);
fabsl(v84 * v48 - v19 * v83);
v78 = (float80_t)*(float32_t *)v3;
v79 = (float80_t)*(float32_t *)v4;
v80 = (float80_t)*(float32_t *)v5;
v62 = v1;
v42 = 0;
v45 = 0;
v55 = 0;
if (v62 <= 0.0L) {
// if_10001ffe_1_false
if (v62 >= 0.0L) {
// if_10001ffe_2_false
v42 = v62 != 0.0L ? 1024 : 0;
v45 = v62 != 0.0L ? 256 : 0;
v55 = 0x4000;
// branch -> after_if_10001ffe_1
} else {
v42 = 0;
v45 = 256;
v55 = 0;
}
}
// after_if_10001ffe_1
if ((v42 || v55 || v45) == 0x4100) {
// 0x1000200b
v81 = v2;
v37 = v80 + (v78 - v80) * v81 / v81;
v44 = v80 + (v79 - v80) * v81 / v81;
// branch -> after_if_100021b9_1
} else {
// 0x10002165
v37 = v78;
v44 = v78;
// branch -> after_if_100021b9_1
}
// after_if_100021b9_1
v49 = v37;
v43 = v44;
v50 = NULL;
if ((float32_t)(int32_t)v50 <= 0.0f) {
// if_10002231_1_false
if ((float32_t)(int32_t)v50 >= 0.0f) {
// if_10002231_2_false
// branch -> after_if_10002231_1
}
}
// after_if_10002231_1
if (false || v49 > v43) {
// 0x100022be
return 0;
}
// if_10002315_1_false
if (v49 >= v43) {
// if_10002315_2_false
// branch -> after_if_10002315_1
}
// after_if_10002315_1
return 0;
}
float32_t * v89 = NULL;
fabsl((float80_t)v35);
v51 = v12;
v52 = v6;
v38 = (float32_t *)v52;
v67 = (float80_t)*(float32_t *)v51 - (float80_t)*v38;
v39 = (float32_t *)(v52 + 4);
v68 = *v39;
v86 = (float80_t)*(float32_t *)(v51 + 4) - (float80_t)v68;
v40 = (float32_t *)(v52 + 8);
v82 = (float80_t)*v40;
v87 = (float80_t)*(float32_t *)(v51 + 8) - v82;
v56 = v13;
v88 = (float80_t)*(float32_t *)(v56 + 8) - v82;
v46 = (float80_t)(*(float32_t *)(v56 + 4) - v68);
v83 = v86 * v88 - v87 * v46;
v47 = (float80_t)(*(float32_t *)v56 - *v38);
v84 = v87 * v47 - v67 * v88;
v85 = v67 * v46 - v86 * v47;
v69 = *v40;
v70 = *v39;
v63 = *v38;
v59 = -(((float80_t)v63 * v83 + (float80_t)v69 * v85 + (float80_t)v70 *
v84));
v53 = v3;
v64 = *(float32_t *)v53;
v71 = *(float32_t *)(v53 + 4);
v72 = *(float32_t *)(v53 + 8);
v54 = v4;
v65 = *(float32_t *)v54;
v73 = *(float32_t *)(v54 + 4);
v74 = *(float32_t *)(v54 + 8);
v75 = v59 + v83 * (float80_t)v65 + v84 * (float80_t)v73 + v85 *
(float80_t)v74;
v57 = v5;
v76 = *(float32_t *)(v57 + 8);
v77 = *(float32_t *)(v57 + 4);
v66 = *(float32_t *)v57;
v41 = v59 + v85 * (float80_t)v76 + v84 * (float80_t)v77 + v83 *
(float80_t)v66;
v60 = fabsl(v59 + v83 * (float80_t)v64 + v84 * (float80_t)v71 + v85 *
(float80_t)v72);
if (v60 <= 9.9999999e-7L) {
// if_10001ebc_1_false
if (v60 >= 9.9999999e-7L) {
// if_10001ebc_2_false
// branch -> after_if_10001ebc_1
}
// after_if_10001ebc_1
v61 = fabsl((float80_t)v75);
if (v61 <= 9.9999999e-7L) {
// if_10001ed7_1_false
if (v61 >= 9.9999999e-7L) {
// if_10001ed7_2_false
// branch -> after_if_10001ed7_1
}
}
// after_if_10001ed7_1
fabsl(v41);
v48 = v17;
fabsl(v19 * v85 - v20 * v84);
fabsl(v20 * v83 - v85 * v48);
fabsl(v84 * v48 - v19 * v83);
fabsl(v84 * v48 - v19 * v83);
v78 = (float80_t)*(float32_t *)v3;
v79 = (float80_t)*(float32_t *)v4;
v80 = (float80_t)*(float32_t *)v5;
v62 = v1;
v42 = 0;
v45 = 0;
v55 = 0;
if (v62 <= 0.0L) {
// if_10001ffe_1_false
if (v62 >= 0.0L) {
// if_10001ffe_2_false
v42 = v62 != 0.0L ? 1024 : 0;
v45 = v62 != 0.0L ? 256 : 0;
v55 = 0x4000;
// branch -> after_if_10001ffe_1
} else {
v42 = 0;
v45 = 256;
v55 = 0;
}
}
// after_if_10001ffe_1
if ((v42 || v55 || v45) == 0x4100) {
// 0x1000200b
v81 = v2;
v37 = v80 + (v78 - v80) * v81 / v81;
v44 = v80 + (v79 - v80) * v81 / v81;
// branch -> after_if_100021b9_1
} else {
// 0x10002165
v37 = v78;
v44 = v78;
// branch -> after_if_100021b9_1
}
// after_if_100021b9_1
v49 = v37;
v43 = v44;
v50 = v89;
if ((float32_t)(int32_t)v50 <= 0.0f) {
// if_10002231_1_false
if ((float32_t)(int32_t)v50 >= 0.0f) {
// if_10002231_2_false
// branch -> after_if_10002231_1
}
}
// after_if_10002231_1
if (false || v49 > v43) {
// 0x100022be
return 0;
}
// if_10002315_1_false
if (v49 >= v43) {
// if_10002315_2_false
// branch -> after_if_10002315_1
}
// after_if_10002315_1
return 0;
}
// after_if_10001ebc_1
v61 = fabsl((float80_t)v75);
if (v61 <= 9.9999999e-7L) {
// if_10001ed7_1_false
if (v61 >= 9.9999999e-7L) {
// if_10001ed7_2_false
// branch -> after_if_10001ed7_1
}
// after_if_10001ed7_1
fabsl(v41);
v48 = v17;
fabsl(v19 * v85 - v20 * v84);
fabsl(v20 * v83 - v85 * v48);
fabsl(v84 * v48 - v19 * v83);
fabsl(v84 * v48 - v19 * v83);
v78 = (float80_t)*(float32_t *)v3;
v79 = (float80_t)*(float32_t *)v4;
v80 = (float80_t)*(float32_t *)v5;
v62 = v1;
v42 = 0;
v45 = 0;
v55 = 0;
if (v62 <= 0.0L) {
// if_10001ffe_1_false
if (v62 >= 0.0L) {
// if_10001ffe_2_false
v42 = v62 != 0.0L ? 1024 : 0;
v45 = v62 != 0.0L ? 256 : 0;
v55 = 0x4000;
// branch -> after_if_10001ffe_1
} else {
v42 = 0;
v45 = 256;
v55 = 0;
}
}
// after_if_10001ffe_1
if ((v42 || v55 || v45) == 0x4100) {
// 0x1000200b
v81 = v2;
v37 = v80 + (v78 - v80) * v81 / v81;
v44 = v80 + (v79 - v80) * v81 / v81;
// branch -> after_if_100021b9_1
} else {
// 0x10002165
v37 = v78;
v44 = v78;
// branch -> after_if_100021b9_1
}
// after_if_100021b9_1
v49 = v37;
v43 = v44;
v50 = v89;
if ((float32_t)(int32_t)v50 <= 0.0f) {
// if_10002231_1_false
if ((float32_t)(int32_t)v50 >= 0.0f) {
// if_10002231_2_false
// branch -> after_if_10002231_1
}
}
// after_if_10002231_1
if (false || v49 > v43) {
// 0x100022be
return 0;
}
// if_10002315_1_false
if (v49 >= v43) {
// if_10002315_2_false
// branch -> after_if_10002315_1
}
// after_if_10002315_1
return 0;
}
// after_if_10001ed7_1
fabsl(v41);
v48 = v17;
fabsl(v19 * v85 - v20 * v84);
fabsl(v20 * v83 - v85 * v48);
fabsl(v84 * v48 - v19 * v83);
fabsl(v84 * v48 - v19 * v83);
v78 = (float80_t)*(float32_t *)v3;
v79 = (float80_t)*(float32_t *)v4;
v80 = (float80_t)*(float32_t *)v5;
v62 = v1;
if (v62 > 0.0L) {
// 0x10002165
v37 = v78;
v44 = v78;
// branch -> after_if_100021b9_1
// after_if_100021b9_1
v49 = v37;
v43 = v44;
v50 = v89;
if ((float32_t)(int32_t)v50 > 0.0f) {
// after_if_10002231_1
if (false || v49 > v43) {
// 0x100022be
return 0;
}
// if_10002315_1_false
if (v49 >= v43) {
// if_10002315_2_false
// branch -> after_if_10002315_1
}
// after_if_10002315_1
return 0;
}
// if_10002231_1_false
if ((float32_t)(int32_t)v50 >= 0.0f) {
// if_10002231_2_false
// branch -> after_if_10002231_1
}
// after_if_10002231_1
if (false || v49 > v43) {
// 0x100022be
return 0;
}
// if_10002315_1_false
if (v49 >= v43) {
// if_10002315_2_false
// branch -> after_if_10002315_1
}
// after_if_10002315_1
return 0;
}
// if_10001ffe_1_false
if (v62 >= 0.0L) {
// if_10001ffe_2_false
v42 = v62 != 0.0L ? 1024 : 0;
v45 = v62 != 0.0L ? 256 : 0;
v55 = 0x4000;
// branch -> after_if_10001ffe_1
} else {
v42 = 0;
v45 = 256;
v55 = 0;
}
// after_if_10001ffe_1
if ((v42 || v55 || v45) == 0x4100) {
// 0x1000200b
v81 = v2;
v37 = v80 + (v78 - v80) * v81 / v81;
v44 = v80 + (v79 - v80) * v81 / v81;
// branch -> after_if_100021b9_1
} else {
// 0x10002165
v37 = v78;
v44 = v78;
// branch -> after_if_100021b9_1
}
// after_if_100021b9_1
v49 = v37;
v43 = v44;
v50 = v89;
if ((float32_t)(int32_t)v50 <= 0.0f) {
// if_10002231_1_false
if ((float32_t)(int32_t)v50 >= 0.0f) {
// if_10002231_2_false
// branch -> after_if_10002231_1
}
}
// after_if_10002231_1
if (false || v49 > v43) {
// 0x100022be
return 0;
}
// if_10002315_1_false
if (v49 >= v43) {
// if_10002315_2_false
// branch -> after_if_10002315_1
}
// after_if_10002315_1
return 0;
}

// Address range: 0x10002390 - 0x100023af
int32_t Test(int32_t a1, int32_t a2, int32_t a3) {
// 0x10002390
return (bool)((int32_t)(bool)(a1 != a2) != a3);
}

// Address range: 0x10002530 - 0x1000256f
void PointBehindPoly(void) {
int32_t v1;
int32_t v2;
int32_t v3;
int32_t v4;
int32_t v5;
int32_t v6;
int32_t v7;
function_100024d0((int32_t)&v6, (int32_t)&v7, (int32_t)&v1,
(int32_t)&v2, (int32_t)&v3, (int32_t)&v4, (int32_t)&v5);
}

// Address range: 0x10002630 - 0x1000265f
int32_t PointInPoly(int32_t a1, int32_t a2, int32_t * a3, int32_t * a4,
int32_t a5) {
int32_t v1 = *(int32_t *)(*a4 + 12); // 0x10002643
return function_10002570(a1, a2, *(int32_t *)(*a3 + 12), v1, a5);
}

// Address range: 0x10002710 - 0x10002e5f
int32_t Forystek(uint32_t a1, int32_t a2, int32_t * a3, int32_t * a4,
int32_t * a5, int32_t * a6, int32_t * a7, int32_t * a8, int32_t * a9,
int32_t * a10, int32_t * a11, int32_t a12, int32_t a13, int32_t a14, int32_t
a15) {
int32_t v1 = *(int32_t *)(*a3 + 12); // esi
int32_t v2 = *(int32_t *)(*a4 + 12); // 0x10002740
int32_t v3 = *(int32_t *)(*a5 + 12); // edi
int32_t v4 = *(int32_t *)(*a6 + 12); // 0x1000275c
int32_t v5 = *(int32_t *)(*a7 + 12); // 0x1000276f
int32_t v6 = *(int32_t *)(*a8 + 12); // 0x10002782
int32_t v7 = *(int32_t *)(*a9 + 12); // 0x10002795
int32_t v8 = *(int32_t *)(*a10 + 12); // 0x100027a5
int32_t v9 = *(int32_t *)(*a11 + 12); // 0x100027b5
int32_t v10 = a2 - 1 + 2 * a2; // 0x100027b8
int32_t v11 = v10; // eax
int32_t v12 = 4 * v10; // 0x100027c0
function_10003269(v12);
int32_t v13 = v11; // 0x100027ce
function_10003269(v12);
float80_t v14 = (float80_t)*(float32_t *)(v1 + 8); // 0x100027e0
int32_t v15 = v11; // 0x100027ea
float80_t v16 = (float32_t)*(int32_t *)(v1 + 32);
float80_t v17 = (float32_t)*(int32_t *)(v1 + 28);
float80_t v18 = (float32_t)*(int32_t *)(v1 + 20);
float80_t v19 = (float32_t)*(int32_t *)(v1 + 16);
float80_t v20 = (float32_t)*(int32_t *)(v1 + 4);
float80_t v21 = v14 * v20 + v17 * v16 + v19 * v18; // 0x10002822
float80_t v22 = v14 - v20 * v21; // 0x1000282c
float80_t v23 = v18 - v19 * v21; // 0x1000283c
float80_t v24 = v16 - v17 * v21; // 0x1000285d
int32_t v25 = 0; // 0x10002e33
int32_t v26 = 0; // 0x10002e4e96
int32_t result; // 0x10002e4e93
if (a2 >= 1) {
float80_t v27 = v17 * v22 - v20 * v24; // 0x10002887
float80_t v28 = v19 * v24 - v17 * v23; // 0x10002871
float32_t v29 = v13; // bp-184
int32_t v30 = v9 + 12; // 0x100028c0
int32_t v31 = v4 - v3; // 0x100028f3
int32_t v32 = v5 - v3; // 0x10002900
int32_t v33 = 4 - v3; // 0x10002915
int32_t v34 = v2 + 12; // 0x1000292c
v11 = v34;
int32_t v35 = v3 + 4; // 0x10002939
float80_t v36 = a1; // 0x10002d8c
float80_t v37 = v20 * v23 - v19 * v22;
int32_t v38 = v4;
int32_t v39 = v9 + 8;
int32_t v40 = v30;
int32_t v41 = 0; // 0x10002e06110
int32_t v42 = v5 + 8;
int32_t v43 = 0; // 0x10002e2b104
int32_t v44 = v2 + 8;
int32_t v45 = 12; // 0x10002db597
int32_t v46 = 0; // 0x10002e4e95
// branch -> 0x10002965
while (true) {
int32_t v47 = v35 + -4 - v3; // ebp
int32_t v48 = v42 + -4 - v5; // 0x1000296c
int32_t * v49 = (int32_t *)v34; // 0x1000296e_0
*v49 = 0;
int32_t v50 = v35; // 0x10002974
int32_t v51 = *(int32_t *)(v50 - 4); // 0x10002974
int32_t v52 = *(int32_t *)(v50 + 4); // 0x1000297b
int32_t v53 = *(int32_t *)v50; // 0x1000297f
int32_t v54 = *(int32_t *)v1; // 0x10002982
int32_t v55 = *(int32_t *)(v44 - 8); // 0x1000298b
function_10002660(v55, v54, v51, v53, v52, v11, g1);
int32_t v56 = *(int32_t *)(v42 + v4 - v5); // 0x100029a4
int32_t v57 = *(int32_t *)(v35 + v31); // 0x100029b6
int32_t v58 = *(int32_t *)v38; // 0x100029b9
int32_t v59 = *(int32_t *)(v1 + 12); // 0x100029c0
int32_t v60 = *(int32_t *)(v44 - 4); // 0x100029c4
function_10002660(v60, v59, v58, v57, v56, v34, v55);
int32_t v61 = *(int32_t *)v42; // 0x100029de
int32_t v62 = *(int32_t *)(v42 - 8); // 0x100029e0
int32_t v63 = *(int32_t *)(v35 + v32); // 0x100029e4
int32_t v64 = *(int32_t *)(v1 + 24); // 0x100029e7
int32_t v65 = *(int32_t *)v44; // 0x100029f1
function_10002660(v65, v64, v62, v63, v61, v34, v60);
int32_t v66; // 0x10002ddb
int32_t v67; // 0x10002db7
int32_t v68;
int32_t v69; // 0x10002e2b103
int32_t v70; // 0x10002e4e94
if (a1 < 2) {
float80_t v71 = (float80_t)*(float32_t *)v34; // 0x10002d97
if (v36 <= v71) {
// if_10002d97_1_false
if (v36 >= v71) {
// if_10002d97_2_false
// branch -> after_if_10002d97_1
}
}
// after_if_10002d97_1
// branch -> 0x10002da0
lab_0x10002da0:
// 0x10002da0
v68 = v40;
v69 = v43;
v70 = v46 + 1;
// branch -> 0x10002da4
} else {
// 0x10002a0c
if (*v49 == 0x3f800000) {
int32_t v72 = (int32_t)v29 + v3 - v13; // 0x10002a2f
int32_t v73 = v6 - v3; // 0x10002a40
int32_t v74 = v7 - v3; // 0x10002a4d
float32_t v75 = 4.20389539e-45f;
// branch -> 0x10002a6c
while (true) {
// 0x10002a6c
*(int32_t *)(v15 - v3 + v72) = 0;
int32_t v76 = v72; // 0x10002a7a
float32_t v77 = *(float32_t *)v1; // 0x10002a7c
float80_t v78 = (float80_t)*(float32_t *)v76 -
(float80_t)v77; // 0x10002a7c
float32_t v79 = *(float32_t *)(v76 + v31); //
0x10002a82
float32_t v80 = *(float32_t *)(v1 + 12); //
0x10002a85
float80_t v81 = (float80_t)v79 - (float80_t)v80; //
0x10002a85
float32_t v82 = *(float32_t *)(v76 + v32); //
0x10002a93
float32_t v83 = *(float32_t *)(v1 + 24); //
0x10002a96
float80_t v84 = (float80_t)v82 - (float80_t)v83; //
0x10002a96
float80_t v85 = v20 * v78 + v19 * v81 + v17 * v84;
// 0x10002ada
*(float32_t *)(v73 + v76) = (float32_t)(800.0L *
(v28 * v78 + v27 * v81 + v37 * v84) / v85);
*(float32_t *)(v74 + v72) =
(float32_t)(799.998046875L * (v22 * v78 + v23 * v81 + v24 * v84) / v85);
*(float32_t *)(v72 + v8 - v3) = (float32_t)v85;
int32_t v86 = v72 + 4; // 0x10002b54
v72 = v86;
int32_t v87 = (int32_t)v75 - 1; // 0x10002b57
if (v87 != 0) {
//
after_if_10002b2d_1.dec_label_pc_10002a6c_crit_edge
v72 = v86;
v75 = v87;
// branch -> 0x10002a6c
continue;
}
}
}
// 0x10002b62
if (a1 < 3) {
float80_t v88 = (float80_t)*(float32_t *)(v45 + v2); //
0x10002d80
if (v36 <= v88) {
// if_10002d80_1_false
if (v36 >= v88) {
// if_10002d80_2_false
// branch -> after_if_10002d80_1
}
}
// after_if_10002d80_1
// branch -> 0x10002da0
goto lab_0x10002da0;
} else {
int32_t * v89 = (int32_t *)(v45 + v2); // 0x10002b78_0
if (*v89 == 0x40000000) {
int32_t v90 = v35 + v33; // 0x10002b90
int32_t v91 = v48 + v6; // 0x10002bb4
int32_t v92 = v47; // 0x10002bbf
function_10002400((int32_t)v29, v92 + v6, v92 + v7,
v92 + v8, v91, v48 + v7, v48 + v8, v90 + v6, v90 + v7, v90 + v8, g1);
int32_t v93 = v35 + v33; // 0x10002be7
float32_t v94 = *(float32_t *)(v3 + v93); //
0x10002bf1
float32_t v95 = *(float32_t *)(v3 + v48); //
0x10002bf4
int32_t v96 = v47; // 0x10002bf7
float32_t v97 = *(float32_t *)(v96 + v3); //
0x10002bf7
float32_t v98 = *(float32_t *)(v93 + v4); //
0x10002c00
float32_t v99 = *(float32_t *)(v48 + v4); //
0x10002c03
float32_t v100 = *(float32_t *)(v96 + v4); //
0x10002c06
float32_t v101 = *(float32_t *)(v93 + v5); //
0x10002c1a
float32_t v102 = *(float32_t *)(v48 + v5); //
0x10002c1d
float32_t v103 = *(float32_t *)(v96 + v5); //
0x10002c20
float32_t v104 = *(float32_t *)v1; // 0x10002c2d
float80_t v105 = 0.333333343267440795898L *
((float80_t)v94 + (float80_t)v95 + (float80_t)v97) - (float80_t)v104; //
0x10002c2d
float32_t v106 = *(float32_t *)(v1 + 12); //
0x10002c33
float80_t v107 = 0.333333343267440795898L *
((float80_t)v98 + (float80_t)v99 + (float80_t)v100) - (float80_t)v106; //
0x10002c33
float32_t v108 = *(float32_t *)(v1 + 24); //
0x10002c3a
float80_t v109 = 0.333333343267440795898L *
((float80_t)v101 + (float80_t)v102 + (float80_t)v103) - (float80_t)v108; //
0x10002c3a
v11 = v39;
v47 = 0;
float80_t v110 = v20 * v105 + v19 * v107 + v17 *
v109; // 0x10002c74
*(float32_t *)(v39 - 8) = (float32_t)(800.0L * (v28
* v105 + v27 * v107 + v37 * v109) / v110);
*(int32_t *)(v11 - 4) =
(int32_t)(float32_t)(799.998046875L * (v22 * v105 + v23 * v107 + v24 * v109)
/ v110);
*(int32_t *)v11 = (int32_t)(float32_t)v110;
if (v43 >= 1) {
// 0x10002cc2
__ftol();
// branch -> 0x10002d0e
}
int32_t v111 = v47; // 0x10002d0e
int32_t v112 = v43; // 0x10002d47
if (v43 != v111) {
// 0x10002d12
if (v43 - 1 >= v111) {
int32_t v113 = v40; // 0x10002d28
*(int32_t *)v113 = *(int32_t *)(v113 - 16);
int32_t v114 = v40 - 16; // 0x10002d31
int32_t v115 = v43 - v111 - 1; // 0x10002d34
// branch -> 0x10002d28
while (v115 != 0) {
// 0x10002d28
v113 = v114;
*(int32_t *)v113 = *(int32_t *)(v113 -
16);
v114 -= 16;
v115--;
// continue -> 0x10002d28
}
// 0x10002d3b
v112 = v47;
// branch -> 0x10002d3b
} else {
v112 = v111;
}
}
// 0x10002d3b
*(float32_t *)(16 * v112 + v30) = (float32_t)v41;
*v89 = 0x40400000;
v68 = v40 + 16;
v69 = v43 + 1;
v70 = v46;
// branch -> 0x10002da4
} else {
v68 = v40;
v69 = v43;
v70 = v46;
}
}
// 0x10002da4
v67 = v34 + 24;
v66 = v41 + 1;
v29 = (int32_t)v29 + 12;
if (v66 >= a2) {
v25 = v69;
v26 = v70;
// 0x10002e1b
if (a1 >= 3) {
// 0x10002e2b
result = (v25 > 0 ? v25 : 0) + v26;
// branch -> 0x10002e37
} else {
result = v26;
}
// 0x10002e37
function_1000325e(v13);
function_1000325e(v15);
return result;
}
lab_0x10002953:
// 0x10002953
v11 = v67;
v35 += 12;
v38 += 12;
v39 += 16;
v40 = v68;
v41 = v66;
v42 += 12;
v43 = v69;
v44 += 24;
v45 += 24;
v46 = v70;
v34 = v67;
// branch -> 0x10002965
continue;
}
// 0x10002da4
v67 = v34 + 24;
v66 = v41 + 1;
v29 = (int32_t)v29 + 12;
if (v66 < a2) {
goto lab_0x10002953;
}
v25 = v69;
v26 = v70;
// 0x10002e1b
if (a1 >= 3) {
// 0x10002e2b
result = (v25 > 0 ? v25 : 0) + v26;
// branch -> 0x10002e37
} else {
result = v26;
}
// 0x10002e37
function_1000325e(v13);
function_1000325e(v15);
return result;
}
}
// 0x10002e1b
if (a1 >= 3) {
// 0x10002e2b
result = (v25 > 0 ? v25 : 0) + v26;
// branch -> 0x10002e37
} else {
result = v26;
}
// 0x10002e37
function_1000325e(v13);
function_1000325e(v15);
return result;
}

// Address range: 0x10002e60 - 0x1000306f
int32_t Collision(int32_t a1, uint32_t a2, int32_t * a3, float32_t * a4,
float32_t * a5, int32_t * a6, int32_t a7, int32_t * a8, int32_t * a9) {
// 0x10002e60
*a8 = 0;
*a9 = 0;
// branch -> 0x10002f44
for (int32_t i = 0; i < a2; i++) {
// continue -> 0x10002f44
}
// 0x10003005
return 0;
}

// --------------- Statically Linked Functions ----------------

// void __ftol(void);

// --------------- Instruction-Idiom Functions ----------------

// long double fabsl(long double);

// --------------------- Meta-Information ---------------------

// Detected compiler/packer: msvc
// Detected language: C++
// Detected functions: 6
// Decompiler release: v2.2.1 (2016-09-07)
// Decompilation date: 2017-01-05 23:25:57


Reply all
Reply to author
Forward
0 new messages