// // gzungetc from 0x741184 to 0x741292 (270 bytes) // // 0 xrefs: // // This function is hookable on this platform! // // Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA // Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings // int __fastcall gzungetc(int a1, unsigned int *a2) { unsigned int v3; // r3 bool v4; // zf _BOOL4 v5; // r3 unsigned int v7; // r2 int v8; // r3 unsigned int v9; // r5 unsigned int v11; // r3 unsigned int v12; // r3 unsigned int v13; // r2 _BYTE *v14; // r5 unsigned int v15; // r3 signed int v16; // r5 signed int v17; // r3 unsigned int *v18; // r0 int i; // r2 int v20; // r1 unsigned int v21; // r0 signed int v22; // r2 unsigned int v23; // r1 unsigned int v24; // r3 unsigned int v25; // r1 unsigned int v26; // r3 unsigned int v27; // r2 char v28; // t1 if ( !a2 || a2[3] != 7247 ) return -1; v3 = a2[19]; v4 = v3 == 0; if ( v3 ) v4 = v3 == -5; v5 = !v4; if ( !v4 ) return -1; if ( a2[18] ) { v16 = a2[17]; a2[18] = v5; if ( v16 ) { while ( 1 ) { v17 = *a2; v18 = a2; for ( i = *a2 >> 31; *a2; i = *a2 >> 31 ) { v20 = v17 > v16 ? i | 1 : i; v21 = v17 - v16; v22 = v16; if ( v20 ) { v16 = 0; } else { v16 -= v17; v21 = 0; v22 = v17; } v23 = a2[2]; v24 = a2[1] + v22; *a2 = v21; a2[1] = v24; a2[2] = v22 + v23; if ( !v16 ) goto LABEL_11; v17 = *a2; v18 = a2; } if ( a2[13] && !a2[22] ) break; if ( sub_740ED8(v18) == -1 ) return -1; } if ( a1 < 0 ) return -1; goto LABEL_17; } } LABEL_11: if ( a1 < 0 ) return -1; v7 = *a2; if ( !*a2 ) { LABEL_17: v12 = a2[6]; v13 = a2[9]; *a2 = 1; v14 = (_BYTE *)(v13 + 2 * v12 - 1); a2[1] = (unsigned int)v14; *v14 = a1; v15 = a2[2]; a2[14] = 0; a2[2] = v15 - 1; return a1; } v8 = 2 * a2[6]; if ( v7 == v8 ) { sub_740B68(a2, -3, "out of room to push characters"); return -1; } v9 = a2[1]; if ( v9 == a2[9] ) { v25 = v9 + v7; v26 = v8 + v9; if ( v9 < v9 + v7 ) { v27 = v26 - 1; do { v28 = *(_BYTE *)--v25; v26 = v27--; *(_BYTE *)(v27 + 1) = v28; } while ( a2[9] < v25 ); v7 = *a2; } v9 = v26; } a2[1] = v9 - 1; *a2 = v7 + 1; *(_BYTE *)(v9 - 1) = a1; v11 = a2[2]; a2[14] = 0; a2[2] = v11 - 1; return a1; }
GD Web Decomp Icon

GD Web Decomp

Raw Source