SHARE
TWEET

Untitled

a guest Aug 13th, 2018 118 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. signed int __fastcall Aska::TriListComp::DecompressTriangleList(Aska::TriListComp *this, const signed __int8 *a2, unsigned __int16 *a3, unsigned int a4, unsigned int a5)
  2. {
  3.   int v5; // r6
  4.   unsigned int v6; // r4
  5.   unsigned int v7; // r1
  6.   signed int v8; // r11
  7.   int v9; // r7
  8.   unsigned int v10; // r9
  9.   unsigned int v11; // r8
  10.   int v12; // r2
  11.   unsigned __int16 v13; // r0
  12.   unsigned int v14; // r3
  13.   unsigned __int16 v15; // r1
  14.   unsigned int v16; // r5
  15.   __int16 v17; // r2
  16.   unsigned __int16 v18; // r2
  17.   __int16 v19; // r3
  18.   unsigned __int16 v20; // r5
  19.   unsigned int v21; // r0
  20.   int v22; // r6
  21.   unsigned int v23; // r7
  22.   int v24; // r2
  23.   __int16 v25; // r2
  24.   __int16 v26; // r3
  25.   unsigned int *v27; // r0
  26.   unsigned int *v28; // r0
  27.   unsigned __int16 v30; // [sp+6h] [bp-3Ah]
  28.   unsigned __int16 v31; // [sp+8h] [bp-38h]
  29.   __int16 v32; // [sp+Ah] [bp-36h]
  30.   unsigned __int16 v33; // [sp+Ch] [bp-34h]
  31.   __int16 v34; // [sp+Eh] [bp-32h]
  32.   unsigned __int16 v35; // [sp+10h] [bp-30h]
  33.   unsigned __int16 v36; // [sp+12h] [bp-2Eh]
  34.   unsigned __int16 v37; // [sp+14h] [bp-2Ch]
  35.   __int16 v38; // [sp+16h] [bp-2Ah]
  36.   _DWORD (__fastcall **v39)(Aska::StaticStream *__hidden); // [sp+18h] [bp-28h]
  37.   __int64 v40; // [sp+1Ch] [bp-24h]
  38.   __int64 v41; // [sp+24h] [bp-1Ch]
  39.   int v42; // [sp+2Ch] [bp-14h]
  40.   int v43; // [sp+3Ch] [bp-4h]
  41.   int (**v44)(); // [sp+40h] [bp+0h]
  42.   __int64 v45; // [sp+44h] [bp+4h]
  43.   __int64 v46; // [sp+4Ch] [bp+Ch]
  44.   int v47; // [sp+54h] [bp+14h]
  45.   __int16 v48; // [sp+58h] [bp+18h]
  46.   __int16 v49; // [sp+5Ah] [bp+1Ah]
  47.  
  48.   v5 = *(unsigned __int16 *)this;
  49.   v44 = &off_1FE0FC0;
  50.   v47 = 8;
  51.   v48 = 0;
  52.   v49 = 0;
  53.   v45 = (unsigned int)this + 2;
  54.   v6 = ((unsigned int)a3 >> 1) - 1;
  55.   v39 = off_1FE09A0;
  56.   HIDWORD(v45) = ((unsigned int)a3 >> 1) - 1;
  57.   v46 = v6;
  58.   v40 = 0LL;
  59.   v41 = 0LL;
  60.   v42 = 0;
  61.   Aska::StaticStream::Open((Aska::StaticStream *)&v39, a2, a4);
  62.   v8 = 1;
  63.   if ( v5 == 0xFFFF )
  64.   {
  65.     if ( v6 )
  66.     {
  67.       v22 = v45;
  68.       v23 = 0;
  69.       do
  70.       {
  71.         v24 = v22 + 2 * v23;
  72.         v36 = *(_WORD *)(v22 + 2 * v23);
  73.         v37 = *(_WORD *)(v24 + 2);
  74.         v25 = *(_WORD *)(v24 + 4);
  75.         v38 = v25;
  76.         if ( v36 >= (unsigned int)v37 )
  77.         {
  78.           v23 += 3;
  79.           if ( Aska::StaticStream::Write((Aska::StaticStream *)&v39, &v36, 2u, 3u) != 3 )
  80.           {
  81. LABEL_26:
  82.             v43 = 0;
  83.             v8 = 0;
  84.             break;
  85.           }
  86.         }
  87.         else
  88.         {
  89.           v26 = *(_WORD *)(v22 + 2 * (v23 + 3));
  90.           v30 = v36;
  91.           v31 = v37;
  92.           v32 = v25;
  93.           v33 = v36;
  94.           v34 = v26;
  95.           v35 = v37;
  96.           if ( Aska::StaticStream::Write((Aska::StaticStream *)&v39, &v30, 2u, 6u) != 6 )
  97.             goto LABEL_26;
  98.           v23 += 4;
  99.         }
  100.       }
  101.       while ( v23 < v6 );
  102.     }
  103.   }
  104.   else if ( v6 )
  105.   {
  106.     v9 = v45;
  107.     LOWORD(v10) = v5 - 1;
  108.     v11 = 0;
  109.     do
  110.     {
  111.       v12 = v9 + 2 * v11;
  112.       v13 = v10 - *(_WORD *)(v9 + 2 * v11);
  113.       v36 = v13;
  114.       v14 = v5 + v13;
  115.       if ( (unsigned __int16)v10 > v14 )
  116.         LOWORD(v14) = v10;
  117.       v15 = v14 - *(_WORD *)(v12 + 2);
  118.       v37 = v15;
  119.       v16 = v5 + v15;
  120.       v17 = *(_WORD *)(v12 + 4);
  121.       if ( (unsigned __int16)v14 > v16 )
  122.         LOWORD(v16) = v14;
  123.       v18 = v16 - v17;
  124.       v38 = v18;
  125.       v10 = v5 + v18;
  126.       if ( (unsigned __int16)v16 > v10 )
  127.         LOWORD(v10) = v16;
  128.       if ( v13 >= (unsigned int)v15 )
  129.       {
  130.         v11 += 3;
  131.         if ( Aska::StaticStream::Write((Aska::StaticStream *)&v39, &v36, 2u, 3u) != 3 )
  132.           goto LABEL_26;
  133.       }
  134.       else
  135.       {
  136.         v19 = *(_WORD *)(v9 + 2 * (v11 + 3));
  137.         v30 = v13;
  138.         v31 = v15;
  139.         v20 = v10 - v19;
  140.         v32 = v18;
  141.         v33 = v13;
  142.         v34 = v10 - v19;
  143.         v35 = v15;
  144.         if ( Aska::StaticStream::Write((Aska::StaticStream *)&v39, &v30, 2u, 6u) != 6 )
  145.           goto LABEL_26;
  146.         v21 = v5 + v20;
  147.         v7 = (unsigned __int16)v10;
  148.         v11 += 4;
  149.         if ( (unsigned __int16)v10 > v21 )
  150.           LOWORD(v21) = v10;
  151.         LOWORD(v10) = v21;
  152.       }
  153.     }
  154.     while ( v11 < v6 );
  155.     v8 = 1;
  156.   }
  157.   v39 = off_1FE09A0;
  158.   v27 = (unsigned int *)HIDWORD(v41);
  159.   if ( !HIDWORD(v41) )
  160.     goto LABEL_46;
  161.   __dmb(0xBu);
  162.   do
  163.     v7 = __ldrex(v27);
  164.   while ( __strex(v7 - 1, v27) );
  165.   __dmb(0xBu);
  166.   if ( v7 == 1 )
  167.   {
  168. LABEL_46:
  169.     if ( (_DWORD)v41 )
  170.       operator delete[]((void *)v41);
  171.     if ( HIDWORD(v41) )
  172.       Aska::TSharedPointerCode::DeleteCounter((Aska::TSharedPointerCode *)HIDWORD(v41), (int *)v7);
  173.   }
  174.   v41 = 0LL;
  175.   v28 = (unsigned int *)HIDWORD(v40);
  176.   if ( !HIDWORD(v40) )
  177.     goto LABEL_47;
  178.   __dmb(0xBu);
  179.   do
  180.     v7 = __ldrex(v28);
  181.   while ( __strex(v7 - 1, v28) );
  182.   __dmb(0xBu);
  183.   if ( v7 == 1 )
  184.   {
  185. LABEL_47:
  186.     if ( (_DWORD)v40 )
  187.       operator delete[]((void *)v40);
  188.     if ( HIDWORD(v40) )
  189.       Aska::TSharedPointerCode::DeleteCounter((Aska::TSharedPointerCode *)HIDWORD(v40), (int *)v7);
  190.   }
  191.   return v8;
  192. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top