decompiled_code:
__int64 __fastcall cblas_ctrsv(unsigned int a1, unsigned int a2, unsigned int a3, __int64 a4, int a5, __int64 a6, char a7, _DWORD *a8, int a9)
{
unsigned int v10; // ebp
int v11; // edx
int v12; // ebp
_DWORD *v13; // rax
__int64 v14; // rdx
_DWORD *v15; // r13
_DWORD *v16; // rbx
__int64 result; // rax
__int64 v18; // rbp
int v19[4]; // [rsp+Ch] [rbp-3Ch] BYREF
char v20; // [rsp+1Dh] [rbp-2Bh] BYREF
char v21; // [rsp+1Eh] [rbp-2Ah] BYREF
char v22[41]; // [rsp+1Fh] [rbp-29h] BYREF

RowMajorStrg = 0;
v19[0] = a5;
CBLAS_CallFromC = 1;
if ( a1 == 102 )
{
if ( a2 == 121 )
{
v21 = 85;
}
else
{
if ( a2 != 122 )
goto LABEL_26;
v21 = 76;
}
switch ( a3 )
{
case 'o':
v20 = 78;
break;
case 'p':
v20 = 84;
break;
case 'q':
v20 = 67;
break;
default:
goto LABEL_42;
}
if ( (_DWORD)a4 == 132 )
{
v22[0] = 85;
}
else
{
if ( (_DWORD)a4 != 131 )
{
LABEL_29:
result = cblas_xerbla(4LL, "cblas_ctrsv", "Illegal Diag setting, %d\n", a4);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
v22[0] = 78;
}
result = ctrsv_(&v21, &v20, v22, v19, a6, &a7, a8, &a9);
LABEL_14:
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
if ( a1 != 101 )
{
result = cblas_xerbla(1LL, "cblas_ctrsv", "Illegal Order setting, %d\n", a1);
goto LABEL_14;
}
RowMajorStrg = 1;
if ( a2 != 121 )
{
if ( a2 == 122 )
{
v21 = 85;
goto LABEL_6;
}
LABEL_26:
result = cblas_xerbla(2LL, "cblas_ctrsv", "Illegal Uplo setting, %d\n", a2);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
v21 = 76;
LABEL_6:
switch ( a3 )
{
case 'o':
v20 = 84;
v16 = a8;
v15 = 0LL;
v12 = 0;
LABEL_32:
if ( (_DWORD)a4 == 132 )
{
v22[0] = 85;
goto LABEL_35;
}
if ( (_DWORD)a4 == 131 )
{
v22[0] = 78;
LABEL_35:
result = ctrsv_(&v21, &v20, v22, v19, a6, &a7, a8, &a9);
if ( a3 == 113 )
{
result = (unsigned int)v19[0];
if ( v19[0] > 0 )
{
v18 = 4LL * v12;
do
{
*v16 ^= LC4;
v16 = (_DWORD *)((char *)v16 + v18);
}
while ( v15 != v16 );
}
}
goto LABEL_14;
}
goto LABEL_29;
case 'p':
v20 = 78;
v16 = a8;
v15 = 0LL;
v12 = 0;
goto LABEL_32;
case 'q':
v20 = 78;
if ( v19[0] <= 0 )
{
v16 = a8;
v15 = 0LL;
v12 = 0;
}
else
{
v10 = abs32(a9);
v11 = v10 * v19[0];
v12 = 2 * v10;
v13 = a8 + 1;
v14 = 8LL * v11;
v15 = &a8[(unsigned __int64)v14 / 4 + 1];
do
{
*v13 ^= LC4;
v13 += v12;
}
while ( v15 != v13 );
v16 = &v15[v14 / 0xFFFFFFFFFFFFFFFCLL];
}
goto LABEL_32;
}
LABEL_42:
result = cblas_xerbla(3LL, "cblas_ctrsv", "Illegal TransA setting, %d\n", a3);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(unsigned int a1, unsigned int a2, unsigned int a3, __int64 a4, int a5, __int64 a6, char a7, _DWORD *a8, int a9)
{
unsigned int v10; // ebp
int v11; // edx
int v12; // ebp
_DWORD *v13; // rax
__int64 v14; // rdx
_DWORD *v15; // r13
_DWORD *v16; // rbx
__int64 result; // rax
__int64 v18; // rbp
int v19[4]; // [rsp+Ch] [rbp-3Ch] BYREF
char v20; // [rsp+1Dh] [rbp-2Bh] BYREF
char v21; // [rsp+1Eh] [rbp-2Ah] BYREF
char v22[41]; // [rsp+1Fh] [rbp-29h] BYREF

RowMajorStrg = 0;
v19[0] = a5;
CBLAS_CallFromC = 1;
if ( a1 == 102 )
{
if ( a2 == 121 )
{
v21 = 85;
}
else
{
if ( a2 != 122 )
goto LABEL_26;
v21 = 76;
}
switch ( a3 )
{
case 'o':
v20 = 78;
break;
case 'p':
v20 = 84;
break;
case 'q':
v20 = 67;
break;
default:
goto LABEL_42;
}
if ( (_DWORD)a4 == 132 )
{
v22[0] = 85;
}
else
{
if ( (_DWORD)a4 != 131 )
{
LABEL_29:
result = cblas_xerbla(4LL, "cblas_ctrsv", "Illegal Diag setting, %d\n", a4);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
v22[0] = 78;
}
result = ctrsv_(&v21, &v20, v22, v19, a6, &a7, a8, &a9);
LABEL_14:
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
if ( a1 != 101 )
{
result = cblas_xerbla(1LL, "cblas_ctrsv", "Illegal Order setting, %d\n", a1);
goto LABEL_14;
}
RowMajorStrg = 1;
if ( a2 != 121 )
{
if ( a2 == 122 )
{
v21 = 85;
goto LABEL_6;
}
LABEL_26:
result = cblas_xerbla(2LL, "cblas_ctrsv", "Illegal Uplo setting, %d\n", a2);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
v21 = 76;
LABEL_6:
switch ( a3 )
{
case 'o':
v20 = 84;
v16 = a8;
v15 = 0LL;
v12 = 0;
LABEL_32:
if ( (_DWORD)a4 == 132 )
{
v22[0] = 85;
goto LABEL_35;
}
if ( (_DWORD)a4 == 131 )
{
v22[0] = 78;
LABEL_35:
result = ctrsv_(&v21, &v20, v22, v19, a6, &a7, a8, &a9);
if ( a3 == 113 )
{
result = (unsigned int)v19[0];
if ( v19[0] > 0 )
{
v18 = 4LL * v12;
do
{
*v16 ^= LC4;
v16 = (_DWORD *)((char *)v16 + v18);
}
while ( v15 != v16 );
}
}
goto LABEL_14;
}
goto LABEL_29;
case 'p':
v20 = 78;
v16 = a8;
v15 = 0LL;
v12 = 0;
goto LABEL_32;
case 'q':
v20 = 78;
if ( v19[0] <= 0 )
{
v16 = a8;
v15 = 0LL;
v12 = 0;
}
else
{
v10 = abs32(a9);
v11 = v10 * v19[0];
v12 = 2 * v10;
v13 = a8 + 1;
v14 = 8LL * v11;
v15 = &a8[(unsigned __int64)v14 / 4 + 1];
do
{
*v13 ^= LC4;
v13 += v12;
}
while ( v15 != v13 );
v16 = &v15[v14 / 0xFFFFFFFFFFFFFFFCLL];
}
goto LABEL_32;
}
LABEL_42:
result = cblas_xerbla(3LL, "cblas_ctrsv", "Illegal TransA setting, %d\n", a3);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}

original_code:
void cblas_ctrsv(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo,
                 const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag,
                 const int N, const void *A, const int lda, void *X,
                 const int incX)
{
   char TA;
   char UL;
   char DI;
   int n, i=0, tincX;
   float *st=0,*x=(float *)X;
   extern int CBLAS_CallFromC;
   extern int RowMajorStrg;
   RowMajorStrg = 0;
   CBLAS_CallFromC = 1;
   if (order == CblasColMajor)
   {
      if (Uplo == CblasUpper) UL = 'U';
      else if (Uplo == CblasLower) UL = 'L';
      else
      {
         cblas_xerbla(2, "cblas_ctrsv","Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (TransA == CblasNoTrans) TA = 'N';
      else if (TransA == CblasTrans) TA = 'T';
      else if (TransA == CblasConjTrans) TA = 'C';
      else
      {
         cblas_xerbla(3, "cblas_ctrsv","Illegal TransA setting, %d\n", TransA);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (Diag == CblasUnit) DI = 'U';
      else if (Diag == CblasNonUnit) DI = 'N';
      else
      {
         cblas_xerbla(4, "cblas_ctrsv","Illegal Diag setting, %d\n", Diag);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      ctrsv_( &UL, &TA, &DI, &N, A, &lda, X,
                      &incX);
   }
   else if (order == CblasRowMajor)
   {
      RowMajorStrg = 1;
      if (Uplo == CblasUpper) UL = 'L';
      else if (Uplo == CblasLower) UL = 'U';
      else
      {
         cblas_xerbla(2, "cblas_ctrsv","Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (TransA == CblasNoTrans) TA = 'T';
      else if (TransA == CblasTrans) TA = 'N';
      else if (TransA == CblasConjTrans)
      {
         TA = 'N';
         if ( N > 0)
         {
            if ( incX > 0 )
               tincX = incX;
            else
               tincX = -incX;
            n = N*2*(tincX);
            x++;
            st=x+n;
            i = tincX << 1;
            do
            {
               *x = -(*x);
               x+=i;
            }
            while (x != st);
            x -= n;
         }
      }
      else
      {
         cblas_xerbla(3, "cblas_ctrsv","Illegal TransA setting, %d\n", TransA);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (Diag == CblasUnit) DI = 'U';
      else if (Diag == CblasNonUnit) DI = 'N';
      else
      {
         cblas_xerbla(4, "cblas_ctrsv","Illegal Diag setting, %d\n", Diag);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      ctrsv_( &UL, &TA, &DI, &N, A, &lda, X,
                      &incX);
      if (TransA == CblasConjTrans)
      {
         if (N > 0)
         {
            do
            {
               *x = -(*x);
               x += i;
            }
            while (x != st);
         }
      }
   }
   else cblas_xerbla(1, "cblas_ctrsv", "Illegal Order setting, %d\n", order);
   CBLAS_CallFromC = 0;
   RowMajorStrg = 0;
   return;
}

canonical_original_code:
void cblas_ctrsv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA, enum CBLAS_DIAG Diag, int N, void *A, int lda, void *X, int incX)
{
   char TA;
   char UL;
   char DI;
   int n; int i = 0; int tincX;
   float *st = 0; float *x = (float *)X;
   extern int CBLAS_CallFromC;
   extern int RowMajorStrg;
   RowMajorStrg = 0;
   CBLAS_CallFromC = 1;
   if (order == CblasColMajor)
   {
      if (Uplo == CblasUpper) UL = 'U';
      else if (Uplo == CblasLower) UL = 'L';
      else
      {
         cblas_xerbla(2, "cblas_ctrsv","Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (TransA == CblasNoTrans) TA = 'N';
      else if (TransA == CblasTrans) TA = 'T';
      else if (TransA == CblasConjTrans) TA = 'C';
      else
      {
         cblas_xerbla(3, "cblas_ctrsv","Illegal TransA setting, %d\n", TransA);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (Diag == CblasUnit) DI = 'U';
      else if (Diag == CblasNonUnit) DI = 'N';
      else
      {
         cblas_xerbla(4, "cblas_ctrsv","Illegal Diag setting, %d\n", Diag);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      ctrsv_( &UL, &TA, &DI, &N, A, &lda, X,
                      &incX);
   }
   else if (order == CblasRowMajor)
   {
      RowMajorStrg = 1;
      if (Uplo == CblasUpper) UL = 'L';
      else if (Uplo == CblasLower) UL = 'U';
      else
      {
         cblas_xerbla(2, "cblas_ctrsv","Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (TransA == CblasNoTrans) TA = 'T';
      else if (TransA == CblasTrans) TA = 'N';
      else if (TransA == CblasConjTrans)
      {
         TA = 'N';
         if ( N > 0)
         {
            if ( incX > 0 )
               tincX = incX;
            else
               tincX = -incX;
            n = N*2*(tincX);
            x++;
            st=x+n;
            i = tincX << 1;
            do
            {
               *x = -(*x);
               x+=i;
            }
            while (x != st);
            x -= n;
         }
      }
      else
      {
         cblas_xerbla(3, "cblas_ctrsv","Illegal TransA setting, %d\n", TransA);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (Diag == CblasUnit) DI = 'U';
      else if (Diag == CblasNonUnit) DI = 'N';
      else
      {
         cblas_xerbla(4, "cblas_ctrsv","Illegal Diag setting, %d\n", Diag);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      ctrsv_( &UL, &TA, &DI, &N, A, &lda, X,
                      &incX);
      if (TransA == CblasConjTrans)
      {
         if (N > 0)
         {
            do
            {
               *x = -(*x);
               x += i;
            }
            while (x != st);
         }
      }
   }
   else cblas_xerbla(1, "cblas_ctrsv", "Illegal Order setting, %d\n", order);
   CBLAS_CallFromC = 0;
   RowMajorStrg = 0;
   return;
}

variable_types: enum CBLAS_DIAG { CblasNonUnit=131, CblasUnit=132 }

variable_types: N int

variable_types:
X
void *

variable_types: TA char

variable_types: UL char

variable_types: DI char

variable_types: n int

variable_types: i int

variable_types: tincX int

variable_types:
st
float *

variable_types:
x
float *

variable_types: RowMajorStrg int


repo: ivanjimenez/ipaap

decompiled_code:
__int64 __fastcall cblas_ztrsm(unsigned int a1, unsigned int a2, unsigned int a3, __int64 a4, unsigned int a5, int a6, char a7, __int64 a8, __int64 a9, char a10, __int64 a11, char a12)
{
__int64 result; // rax
int v13[4]; // [rsp+Ch] [rbp-1Ch] BYREF
char v14; // [rsp+1Ch] [rbp-Ch] BYREF
char v15; // [rsp+1Dh] [rbp-Bh] BYREF
char v16; // [rsp+1Eh] [rbp-Ah] BYREF
char v17[9]; // [rsp+1Fh] [rbp-9h] BYREF

RowMajorStrg = 0;
v13[0] = a6;
CBLAS_CallFromC = 1;
if ( a1 == 102 )
{
if ( a2 == 142 )
{
v16 = 82;
}
else
{
if ( a2 != 141 )
goto LABEL_34;
v16 = 76;
}
if ( a3 == 121 )
{
v14 = 85;
}
else
{
if ( a3 != 122 )
goto LABEL_36;
v14 = 76;
}
switch ( (_DWORD)a4 )
{
case 'p':
v15 = 84;
break;
case 'q':
v15 = 67;
break;
case 'o':
v15 = 78;
break;
default:
goto LABEL_45;
}
if ( a5 == 132 )
{
v17[0] = 85;
}
else
{
if ( a5 != 131 )
{
LABEL_40:
result = cblas_xerbla(5LL, "cblas_ztrsm", "Illegal Diag setting, %d\n", a5);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
v17[0] = 78;
}
result = ztrsm_(&v16, &v14, &v15, v17, v13, &a7, a8, a9, &a10, a11, &a12);
goto LABEL_18;
}
if ( a1 != 101 )
{
result = cblas_xerbla(1LL, "cblas_ztrsm", "Illegal Order setting, %d\n", a1);
goto LABEL_18;
}
RowMajorStrg = 1;
if ( a2 != 142 )
{
if ( a2 == 141 )
{
v16 = 82;
goto LABEL_6;
}
LABEL_34:
result = cblas_xerbla(2LL, "cblas_ztrsm", "Illegal Side setting, %d\n", a2);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
v16 = 76;
LABEL_6:
if ( a3 == 121 )
{
v14 = 76;
goto LABEL_9;
}
if ( a3 != 122 )
{
LABEL_36:
result = cblas_xerbla(3LL, "cblas_ztrsm", "Illegal Uplo setting, %d\n", a3);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
v14 = 85;
LABEL_9:
switch ( (_DWORD)a4 )
{
case 'p':
v15 = 84;
goto LABEL_13;
case 'q':
v15 = 67;
goto LABEL_13;
case 'o':
v15 = 78;
LABEL_13:
if ( a5 == 132 )
{
v17[0] = 85;
goto LABEL_16;
}
if ( a5 == 131 )
{
v17[0] = 78;
LABEL_16:
result = ztrsm_(&v16, &v14, &v15, v17, &a7, v13, a8, a9, &a10, a11, &a12);
LABEL_18:
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
goto LABEL_40;
}
LABEL_45:
result = cblas_xerbla(4LL, "cblas_ztrsm", "Illegal Trans setting, %d\n", a4);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(unsigned int a1, unsigned int a2, unsigned int a3, __int64 a4, unsigned int a5, int a6, char a7, __int64 a8, __int64 a9, char a10, __int64 a11, char a12)
{
__int64 result; // rax
int v13[4]; // [rsp+Ch] [rbp-1Ch] BYREF
char v14; // [rsp+1Ch] [rbp-Ch] BYREF
char v15; // [rsp+1Dh] [rbp-Bh] BYREF
char v16; // [rsp+1Eh] [rbp-Ah] BYREF
char v17[9]; // [rsp+1Fh] [rbp-9h] BYREF

RowMajorStrg = 0;
v13[0] = a6;
CBLAS_CallFromC = 1;
if ( a1 == 102 )
{
if ( a2 == 142 )
{
v16 = 82;
}
else
{
if ( a2 != 141 )
goto LABEL_34;
v16 = 76;
}
if ( a3 == 121 )
{
v14 = 85;
}
else
{
if ( a3 != 122 )
goto LABEL_36;
v14 = 76;
}
switch ( (_DWORD)a4 )
{
case 'p':
v15 = 84;
break;
case 'q':
v15 = 67;
break;
case 'o':
v15 = 78;
break;
default:
goto LABEL_45;
}
if ( a5 == 132 )
{
v17[0] = 85;
}
else
{
if ( a5 != 131 )
{
LABEL_40:
result = cblas_xerbla(5LL, "cblas_ztrsm", "Illegal Diag setting, %d\n", a5);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
v17[0] = 78;
}
result = ztrsm_(&v16, &v14, &v15, v17, v13, &a7, a8, a9, &a10, a11, &a12);
goto LABEL_18;
}
if ( a1 != 101 )
{
result = cblas_xerbla(1LL, "cblas_ztrsm", "Illegal Order setting, %d\n", a1);
goto LABEL_18;
}
RowMajorStrg = 1;
if ( a2 != 142 )
{
if ( a2 == 141 )
{
v16 = 82;
goto LABEL_6;
}
LABEL_34:
result = cblas_xerbla(2LL, "cblas_ztrsm", "Illegal Side setting, %d\n", a2);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
v16 = 76;
LABEL_6:
if ( a3 == 121 )
{
v14 = 76;
goto LABEL_9;
}
if ( a3 != 122 )
{
LABEL_36:
result = cblas_xerbla(3LL, "cblas_ztrsm", "Illegal Uplo setting, %d\n", a3);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
v14 = 85;
LABEL_9:
switch ( (_DWORD)a4 )
{
case 'p':
v15 = 84;
goto LABEL_13;
case 'q':
v15 = 67;
goto LABEL_13;
case 'o':
v15 = 78;
LABEL_13:
if ( a5 == 132 )
{
v17[0] = 85;
goto LABEL_16;
}
if ( a5 == 131 )
{
v17[0] = 78;
LABEL_16:
result = ztrsm_(&v16, &v14, &v15, v17, &a7, v13, a8, a9, &a10, a11, &a12);
LABEL_18:
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
goto LABEL_40;
}
LABEL_45:
result = cblas_xerbla(4LL, "cblas_ztrsm", "Illegal Trans setting, %d\n", a4);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}

original_code:
void cblas_ztrsm(const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side,
                 const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA,
                 const enum CBLAS_DIAG Diag, const int M, const int N,
                 const void *alpha, const void *A, const int lda,
                 void *B, const int ldb)
{
   char UL, TA, SD, DI;
   extern int CBLAS_CallFromC;
   extern int RowMajorStrg;
   RowMajorStrg = 0;
   CBLAS_CallFromC = 1;
   if( Order == CblasColMajor )
   {
      if( Side == CblasRight) SD='R';
      else if ( Side == CblasLeft ) SD='L';
      else
      {
         cblas_xerbla(2, "cblas_ztrsm", "Illegal Side setting, %d\n", Side);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if( Uplo == CblasUpper) UL='U';
      else if ( Uplo == CblasLower ) UL='L';
      else
      {
         cblas_xerbla(3, "cblas_ztrsm", "Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if( TransA == CblasTrans) TA ='T';
      else if ( TransA == CblasConjTrans ) TA='C';
      else if ( TransA == CblasNoTrans ) TA='N';
      else
      {
         cblas_xerbla(4, "cblas_ztrsm", "Illegal Trans setting, %d\n", TransA);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if( Diag == CblasUnit ) DI='U';
      else if ( Diag == CblasNonUnit ) DI='N';
      else
      {
         cblas_xerbla(5, "cblas_ztrsm", "Illegal Diag setting, %d\n", Diag);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      ztrsm_(&SD, &UL, &TA, &DI, &M, &N, alpha, A,
                &lda, B, &ldb);
   } else if (Order == CblasRowMajor)
   {
      RowMajorStrg = 1;
      if( Side == CblasRight) SD='L';
      else if ( Side == CblasLeft ) SD='R';
      else
      {
         cblas_xerbla(2, "cblas_ztrsm", "Illegal Side setting, %d\n", Side);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if( Uplo == CblasUpper) UL='L';
      else if ( Uplo == CblasLower ) UL='U';
      else
      {
         cblas_xerbla(3, "cblas_ztrsm", "Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if( TransA == CblasTrans) TA ='T';
      else if ( TransA == CblasConjTrans ) TA='C';
      else if ( TransA == CblasNoTrans ) TA='N';
      else
      {
         cblas_xerbla(4, "cblas_ztrsm", "Illegal Trans setting, %d\n", TransA);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if( Diag == CblasUnit ) DI='U';
      else if ( Diag == CblasNonUnit ) DI='N';
      else
      {
         cblas_xerbla(5, "cblas_ztrsm", "Illegal Diag setting, %d\n", Diag);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      ztrsm_(&SD, &UL, &TA, &DI, &N, &M, alpha, A,
                &lda, B, &ldb);
   }
   else cblas_xerbla(1, "cblas_ztrsm", "Illegal Order setting, %d\n", Order);
   CBLAS_CallFromC = 0;
   RowMajorStrg = 0;
   return;
}

canonical_original_code:
void cblas_ztrsm(enum CBLAS_ORDER Order, enum CBLAS_SIDE Side, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA, enum CBLAS_DIAG Diag, int M, int N, void *alpha, void *A, int lda, void *B, int ldb)
{
   char UL; char TA; char SD; char DI;
   extern int CBLAS_CallFromC;
   extern int RowMajorStrg;
   RowMajorStrg = 0;
   CBLAS_CallFromC = 1;
   if( Order == CblasColMajor )
   {
      if( Side == CblasRight) SD='R';
      else if ( Side == CblasLeft ) SD='L';
      else
      {
         cblas_xerbla(2, "cblas_ztrsm", "Illegal Side setting, %d\n", Side);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if( Uplo == CblasUpper) UL='U';
      else if ( Uplo == CblasLower ) UL='L';
      else
      {
         cblas_xerbla(3, "cblas_ztrsm", "Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if( TransA == CblasTrans) TA ='T';
      else if ( TransA == CblasConjTrans ) TA='C';
      else if ( TransA == CblasNoTrans ) TA='N';
      else
      {
         cblas_xerbla(4, "cblas_ztrsm", "Illegal Trans setting, %d\n", TransA);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if( Diag == CblasUnit ) DI='U';
      else if ( Diag == CblasNonUnit ) DI='N';
      else
      {
         cblas_xerbla(5, "cblas_ztrsm", "Illegal Diag setting, %d\n", Diag);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      ztrsm_(&SD, &UL, &TA, &DI, &M, &N, alpha, A,
                &lda, B, &ldb);
   } else if (Order == CblasRowMajor)
   {
      RowMajorStrg = 1;
      if( Side == CblasRight) SD='L';
      else if ( Side == CblasLeft ) SD='R';
      else
      {
         cblas_xerbla(2, "cblas_ztrsm", "Illegal Side setting, %d\n", Side);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if( Uplo == CblasUpper) UL='L';
      else if ( Uplo == CblasLower ) UL='U';
      else
      {
         cblas_xerbla(3, "cblas_ztrsm", "Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if( TransA == CblasTrans) TA ='T';
      else if ( TransA == CblasConjTrans ) TA='C';
      else if ( TransA == CblasNoTrans ) TA='N';
      else
      {
         cblas_xerbla(4, "cblas_ztrsm", "Illegal Trans setting, %d\n", TransA);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if( Diag == CblasUnit ) DI='U';
      else if ( Diag == CblasNonUnit ) DI='N';
      else
      {
         cblas_xerbla(5, "cblas_ztrsm", "Illegal Diag setting, %d\n", Diag);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      ztrsm_(&SD, &UL, &TA, &DI, &N, &M, alpha, A,
                &lda, B, &ldb);
   }
   else cblas_xerbla(1, "cblas_ztrsm", "Illegal Order setting, %d\n", Order);
   CBLAS_CallFromC = 0;
   RowMajorStrg = 0;
   return;
}

variable_types: enum CBLAS_ORDER { CblasRowMajor=101, CblasColMajor=102 }

variable_types: enum CBLAS_SIDE { CblasLeft=141, CblasRight=142 }

variable_types: enum CBLAS_UPLO { CblasUpper=121, CblasLower=122 }

variable_types: enum CBLAS_TRANSPOSE { CblasNoTrans=111, CblasTrans=112, CblasConjTrans=113 }

variable_types: M int

variable_types:
alpha
void *

variable_types:
A
void *

variable_types: lda int

variable_types:
B
void *

variable_types: ldb int

variable_types: SD char

return_type: void

user_defined_types: enum CBLAS_DIAG { CblasNonUnit=131, CblasUnit=132 }


decompiled_code:
__int64 __fastcall cblas_zdotc_sub(int a1, __int64 a2, int a3, __int64 a4, int a5)
{
int v6; // [rsp+4h] [rbp-14h] BYREF
int v7; // [rsp+8h] [rbp-10h] BYREF
int v8[3]; // [rsp+Ch] [rbp-Ch] BYREF

v8[0] = a1;
v7 = a3;
v6 = a5;
return zdotcsub_(v8, a2, &v7, a4, &v6);
}

canonical_decompiled_code:
__int64 __fastcall func0(int a1, __int64 a2, int a3, __int64 a4, int a5)
{
int v6; // [rsp+4h] [rbp-14h] BYREF
int v7; // [rsp+8h] [rbp-10h] BYREF
int v8[3]; // [rsp+Ch] [rbp-Ch] BYREF

v8[0] = a1;
v7 = a3;
v6 = a5;
return zdotcsub_(v8, a2, &v7, a4, &v6);
}

original_code:
void cblas_zdotc_sub( const int N, const void *X, const int incX,
                    const void *Y, const int incY, void *dotc)
{
   zdotcsub_( &N, X, &incX, Y, &incY, dotc);
   return;
}

canonical_original_code:
void cblas_zdotc_sub(int N, void *X, int incX, void *Y, int incY, void *dotc)
{
   zdotcsub_( &N, X, &incX, Y, &incY, dotc);
   return;
}

variable_types: N int

variable_types:
X
void *

variable_types: incX int

variable_types:
Y
void *

variable_types: incY int

variable_types:
dotc
void *


decompiled_code:
__int64 __fastcall cblas_zaxpy(int a1, __int64 a2, __int64 a3, int a4, __int64 a5, int a6)
{
int v7; // [rsp+4h] [rbp-14h] BYREF
int v8; // [rsp+8h] [rbp-10h] BYREF
int v9[3]; // [rsp+Ch] [rbp-Ch] BYREF

v9[0] = a1;
v8 = a4;
v7 = a6;
return zaxpy_(v9, a2, a3, &v8, a5, &v7);
}

canonical_decompiled_code:
__int64 __fastcall func0(int a1, __int64 a2, __int64 a3, int a4, __int64 a5, int a6)
{
int v7; // [rsp+4h] [rbp-14h] BYREF
int v8; // [rsp+8h] [rbp-10h] BYREF
int v9[3]; // [rsp+Ch] [rbp-Ch] BYREF

v9[0] = a1;
v8 = a4;
v7 = a6;
return zaxpy_(v9, a2, a3, &v8, a5, &v7);
}

original_code:
void cblas_zaxpy( const int N, const void *alpha, const void *X,
                       const int incX, void *Y, const int incY)
{
   zaxpy_( &N, alpha, X, &incX, Y, &incY);
}

canonical_original_code:
void cblas_zaxpy(int N, void *alpha, void *X, int incX, void *Y, int incY)
{
   zaxpy_( &N, alpha, X, &incX, Y, &incY);
}


decompiled_code:
__int64 __fastcall cblas_csscal(int a1, __int64 a2, int a3, float a4)
{
int v5; // [rsp+4h] [rbp-14h] BYREF
float v6; // [rsp+8h] [rbp-10h] BYREF
int v7[3]; // [rsp+Ch] [rbp-Ch] BYREF

v7[0] = a1;
v5 = a3;
v6 = a4;
return csscal_(v7, &v6, a2, &v5);
}

canonical_decompiled_code:
__int64 __fastcall func0(int a1, __int64 a2, int a3, float a4)
{
int v5; // [rsp+4h] [rbp-14h] BYREF
float v6; // [rsp+8h] [rbp-10h] BYREF
int v7[3]; // [rsp+Ch] [rbp-Ch] BYREF

v7[0] = a1;
v5 = a3;
v6 = a4;
return csscal_(v7, &v6, a2, &v5);
}

original_code:
void cblas_csscal( const int N, const float alpha, void *X,
                       const int incX)
{
   csscal_( &N, &alpha, X, &incX);
}

canonical_original_code:
void cblas_csscal(int N, float alpha, void *X, int incX)
{
   csscal_( &N, &alpha, X, &incX);
}

variable_types: alpha float


decompiled_code:
__int64 __fastcall cblas_ctrmv(unsigned int a1, unsigned int a2, unsigned int a3, __int64 a4, int a5, __int64 a6, char a7, __int64 a8, int a9)
{
signed int v10; // ebp
__int64 v11; // rax
__int64 v12; // rsi
__int64 v13; // r13
__int64 v14; // rbx
__int64 result; // rax
__int64 v16; // rbp
int v17[4]; // [rsp+Ch] [rbp-3Ch] BYREF
char v18; // [rsp+1Dh] [rbp-2Bh] BYREF
char v19; // [rsp+1Eh] [rbp-2Ah] BYREF
char v20[41]; // [rsp+1Fh] [rbp-29h] BYREF

RowMajorStrg = 0;
v17[0] = a5;
CBLAS_CallFromC = 1;
if ( a1 == 102 )
{
if ( a2 == 121 )
{
v19 = 85;
}
else
{
if ( a2 != 122 )
goto LABEL_26;
v19 = 76;
}
switch ( a3 )
{
case 'o':
v18 = 78;
break;
case 'p':
v18 = 84;
break;
case 'q':
v18 = 67;
break;
default:
goto LABEL_42;
}
if ( (_DWORD)a4 == 132 )
{
v20[0] = 85;
}
else
{
if ( (_DWORD)a4 != 131 )
{
LABEL_29:
result = cblas_xerbla(4LL, "cblas_ctrmv", "Illegal Diag setting, %d\n", a4);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
v20[0] = 78;
}
result = ctrmv_(&v19, &v18, v20, v17, a6, &a7, a8, &a9);
LABEL_14:
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
if ( a1 != 101 )
{
result = cblas_xerbla(1LL, "cblas_ctrmv", "Illegal Order setting, %d\n", a1);
goto LABEL_14;
}
RowMajorStrg = 1;
if ( a2 != 121 )
{
if ( a2 == 122 )
{
v19 = 85;
goto LABEL_6;
}
LABEL_26:
result = cblas_xerbla(2LL, "cblas_ctrmv", "Illegal Uplo setting, %d\n", a2);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
v19 = 76;
LABEL_6:
switch ( a3 )
{
case 'o':
v18 = 84;
v14 = a8;
v13 = 0LL;
v10 = 0;
LABEL_32:
if ( (_DWORD)a4 == 132 )
{
v20[0] = 85;
goto LABEL_35;
}
if ( (_DWORD)a4 == 131 )
{
v20[0] = 78;
LABEL_35:
result = ctrmv_(&v19, &v18, v20, v17, a6, &a7, a8, &a9);
if ( a3 == 113 )
{
result = (unsigned int)v17[0];
if ( v17[0] > 0 )
{
v16 = 4LL * v10;
do
{
*(_DWORD *)(v14 + 4) ^= LC4;
v14 += v16;
}
while ( v13 != v14 );
}
}
goto LABEL_14;
}
goto LABEL_29;
case 'p':
v18 = 78;
v14 = a8;
v13 = 0LL;
v10 = 0;
goto LABEL_32;
case 'q':
v18 = 78;
if ( v17[0] <= 0 )
{
v14 = a8;
v13 = 0LL;
v10 = 0;
}
else
{
v10 = 2 * abs32(a9);
v11 = a8;
v12 = 4LL * v10 * v17[0];
v13 = v12 + a8;
do
{
*(_DWORD *)(v11 + 4) ^= LC4;
v11 += 4LL * v10;
}
while ( v13 != v11 );
v14 = v13 - v12;
}
goto LABEL_32;
}
LABEL_42:
result = cblas_xerbla(3LL, "cblas_ctrmv", "Illegal TransA setting, %d\n", a3);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(unsigned int a1, unsigned int a2, unsigned int a3, __int64 a4, int a5, __int64 a6, char a7, __int64 a8, int a9)
{
signed int v10; // ebp
__int64 v11; // rax
__int64 v12; // rsi
__int64 v13; // r13
__int64 v14; // rbx
__int64 result; // rax
__int64 v16; // rbp
int v17[4]; // [rsp+Ch] [rbp-3Ch] BYREF
char v18; // [rsp+1Dh] [rbp-2Bh] BYREF
char v19; // [rsp+1Eh] [rbp-2Ah] BYREF
char v20[41]; // [rsp+1Fh] [rbp-29h] BYREF

RowMajorStrg = 0;
v17[0] = a5;
CBLAS_CallFromC = 1;
if ( a1 == 102 )
{
if ( a2 == 121 )
{
v19 = 85;
}
else
{
if ( a2 != 122 )
goto LABEL_26;
v19 = 76;
}
switch ( a3 )
{
case 'o':
v18 = 78;
break;
case 'p':
v18 = 84;
break;
case 'q':
v18 = 67;
break;
default:
goto LABEL_42;
}
if ( (_DWORD)a4 == 132 )
{
v20[0] = 85;
}
else
{
if ( (_DWORD)a4 != 131 )
{
LABEL_29:
result = cblas_xerbla(4LL, "cblas_ctrmv", "Illegal Diag setting, %d\n", a4);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
v20[0] = 78;
}
result = ctrmv_(&v19, &v18, v20, v17, a6, &a7, a8, &a9);
LABEL_14:
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
if ( a1 != 101 )
{
result = cblas_xerbla(1LL, "cblas_ctrmv", "Illegal Order setting, %d\n", a1);
goto LABEL_14;
}
RowMajorStrg = 1;
if ( a2 != 121 )
{
if ( a2 == 122 )
{
v19 = 85;
goto LABEL_6;
}
LABEL_26:
result = cblas_xerbla(2LL, "cblas_ctrmv", "Illegal Uplo setting, %d\n", a2);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
v19 = 76;
LABEL_6:
switch ( a3 )
{
case 'o':
v18 = 84;
v14 = a8;
v13 = 0LL;
v10 = 0;
LABEL_32:
if ( (_DWORD)a4 == 132 )
{
v20[0] = 85;
goto LABEL_35;
}
if ( (_DWORD)a4 == 131 )
{
v20[0] = 78;
LABEL_35:
result = ctrmv_(&v19, &v18, v20, v17, a6, &a7, a8, &a9);
if ( a3 == 113 )
{
result = (unsigned int)v17[0];
if ( v17[0] > 0 )
{
v16 = 4LL * v10;
do
{
*(_DWORD *)(v14 + 4) ^= LC4;
v14 += v16;
}
while ( v13 != v14 );
}
}
goto LABEL_14;
}
goto LABEL_29;
case 'p':
v18 = 78;
v14 = a8;
v13 = 0LL;
v10 = 0;
goto LABEL_32;
case 'q':
v18 = 78;
if ( v17[0] <= 0 )
{
v14 = a8;
v13 = 0LL;
v10 = 0;
}
else
{
v10 = 2 * abs32(a9);
v11 = a8;
v12 = 4LL * v10 * v17[0];
v13 = v12 + a8;
do
{
*(_DWORD *)(v11 + 4) ^= LC4;
v11 += 4LL * v10;
}
while ( v13 != v11 );
v14 = v13 - v12;
}
goto LABEL_32;
}
LABEL_42:
result = cblas_xerbla(3LL, "cblas_ctrmv", "Illegal TransA setting, %d\n", a3);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}

original_code:
void cblas_ctrmv(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo,
                 const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag,
                 const int N, const void *A, const int lda,
                 void *X, const int incX)
{
   char TA;
   char UL;
   char DI;
   int n, i=0, tincX;
   float *st=0,*x=(float *)X;
   extern int CBLAS_CallFromC;
   extern int RowMajorStrg;
   RowMajorStrg = 0;
   CBLAS_CallFromC = 1;
   if (order == CblasColMajor)
   {
      if (Uplo == CblasUpper) UL = 'U';
      else if (Uplo == CblasLower) UL = 'L';
      else
      {
         cblas_xerbla(2, "cblas_ctrmv","Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (TransA == CblasNoTrans) TA = 'N';
      else if (TransA == CblasTrans) TA = 'T';
      else if (TransA == CblasConjTrans) TA = 'C';
      else
      {
         cblas_xerbla(3, "cblas_ctrmv","Illegal TransA setting, %d\n", TransA);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (Diag == CblasUnit) DI = 'U';
      else if (Diag == CblasNonUnit) DI = 'N';
      else
      {
         cblas_xerbla(4, "cblas_ctrmv","Illegal Diag setting, %d\n", Diag);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      ctrmv_( &UL, &TA, &DI, &N, A, &lda, X,
                      &incX);
   }
   else if (order == CblasRowMajor)
   {
      RowMajorStrg = 1;
      if (Uplo == CblasUpper) UL = 'L';
      else if (Uplo == CblasLower) UL = 'U';
      else
      {
         cblas_xerbla(2, "cblas_ctrmv","Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (TransA == CblasNoTrans) TA = 'T';
      else if (TransA == CblasTrans) TA = 'N';
      else if (TransA == CblasConjTrans)
      {
         TA = 'N';
         if ( N > 0)
         {
            if(incX > 0)
               tincX = incX;
            else
               tincX = -incX;
            i = tincX << 1;
            n = i * N;
            st = x + n;
            do
            {
               x[1] = -x[1];
               x+= i;
            }
            while (x != st);
            x -= n;
         }
      }
      else
      {
         cblas_xerbla(3, "cblas_ctrmv","Illegal TransA setting, %d\n", TransA);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (Diag == CblasUnit) DI = 'U';
      else if (Diag == CblasNonUnit) DI = 'N';
      else
      {
         cblas_xerbla(4, "cblas_ctrmv","Illegal Diag setting, %d\n", Diag);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
         ctrmv_( &UL, &TA, &DI, &N, A, &lda, X,
                      &incX);
      if (TransA == CblasConjTrans)
      {
         if (N > 0)
         {
            do
            {
               x[1] = -x[1];
               x += i;
            }
            while (x != st);
         }
      }
   }
   else cblas_xerbla(1, "cblas_ctrmv", "Illegal Order setting, %d\n", order);
   CBLAS_CallFromC = 0;
   RowMajorStrg = 0;
   return;
}

canonical_original_code:
void cblas_ctrmv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA, enum CBLAS_DIAG Diag, int N, void *A, int lda, void *X, int incX)
{
   char TA;
   char UL;
   char DI;
   int n; int i = 0; int tincX;
   float *st = 0; float *x = (float *)X;
   extern int CBLAS_CallFromC;
   extern int RowMajorStrg;
   RowMajorStrg = 0;
   CBLAS_CallFromC = 1;
   if (order == CblasColMajor)
   {
      if (Uplo == CblasUpper) UL = 'U';
      else if (Uplo == CblasLower) UL = 'L';
      else
      {
         cblas_xerbla(2, "cblas_ctrmv","Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (TransA == CblasNoTrans) TA = 'N';
      else if (TransA == CblasTrans) TA = 'T';
      else if (TransA == CblasConjTrans) TA = 'C';
      else
      {
         cblas_xerbla(3, "cblas_ctrmv","Illegal TransA setting, %d\n", TransA);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (Diag == CblasUnit) DI = 'U';
      else if (Diag == CblasNonUnit) DI = 'N';
      else
      {
         cblas_xerbla(4, "cblas_ctrmv","Illegal Diag setting, %d\n", Diag);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      ctrmv_( &UL, &TA, &DI, &N, A, &lda, X,
                      &incX);
   }
   else if (order == CblasRowMajor)
   {
      RowMajorStrg = 1;
      if (Uplo == CblasUpper) UL = 'L';
      else if (Uplo == CblasLower) UL = 'U';
      else
      {
         cblas_xerbla(2, "cblas_ctrmv","Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (TransA == CblasNoTrans) TA = 'T';
      else if (TransA == CblasTrans) TA = 'N';
      else if (TransA == CblasConjTrans)
      {
         TA = 'N';
         if ( N > 0)
         {
            if(incX > 0)
               tincX = incX;
            else
               tincX = -incX;
            i = tincX << 1;
            n = i * N;
            st = x + n;
            do
            {
               x[1] = -x[1];
               x+= i;
            }
            while (x != st);
            x -= n;
         }
      }
      else
      {
         cblas_xerbla(3, "cblas_ctrmv","Illegal TransA setting, %d\n", TransA);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (Diag == CblasUnit) DI = 'U';
      else if (Diag == CblasNonUnit) DI = 'N';
      else
      {
         cblas_xerbla(4, "cblas_ctrmv","Illegal Diag setting, %d\n", Diag);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
         ctrmv_( &UL, &TA, &DI, &N, A, &lda, X,
                      &incX);
      if (TransA == CblasConjTrans)
      {
         if (N > 0)
         {
            do
            {
               x[1] = -x[1];
               x += i;
            }
            while (x != st);
         }
      }
   }
   else cblas_xerbla(1, "cblas_ctrmv", "Illegal Order setting, %d\n", order);
   CBLAS_CallFromC = 0;
   RowMajorStrg = 0;
   return;
}

variable_types: enum CBLAS_ORDER { CblasRowMajor=101, CblasColMajor=102 }

variable_types: enum CBLAS_DIAG { CblasNonUnit=131, CblasUnit=132 }

variable_types: TA char

variable_types: UL char

variable_types: DI char

variable_types: n int

variable_types: i int

variable_types: tincX int

variable_types:
st
float *

variable_types:
x
float *

variable_types: RowMajorStrg int

user_defined_types: enum CBLAS_UPLO { CblasUpper=121, CblasLower=122 }

user_defined_types: enum CBLAS_TRANSPOSE { CblasNoTrans=111, CblasTrans=112, CblasConjTrans=113 }


decompiled_code:
__int64 __fastcall cblas_ctbmv(unsigned int a1, unsigned int a2, unsigned int a3, int a4, int a5, int a6, __int64 a7, char a8, _DWORD *a9, int a10)
{
signed int v11; // ebp
_DWORD *v12; // rax
__int64 v13; // rdi
_DWORD *v14; // r13
_DWORD *v15; // rbx
__int64 result; // rax
__int64 v17; // rbp
int v18; // [rsp+8h] [rbp-40h] BYREF
int v19[4]; // [rsp+Ch] [rbp-3Ch] BYREF
char v20; // [rsp+1Dh] [rbp-2Bh] BYREF
char v21; // [rsp+1Eh] [rbp-2Ah] BYREF
char v22[41]; // [rsp+1Fh] [rbp-29h] BYREF

RowMajorStrg = 0;
v19[0] = a5;
v18 = a6;
CBLAS_CallFromC = 1;
if ( a1 != 102 )
{
if ( a1 == 101 )
{
RowMajorStrg = 1;
if ( a2 == 121 )
{
v21 = 76;
LABEL_6:
switch ( a3 )
{
case 'o':
v20 = 84;
v15 = a9;
v14 = 0LL;
v11 = 0;
break;
case 'p':
v20 = 78;
v15 = a9;
v14 = 0LL;
v11 = 0;
break;
case 'q':
v20 = 78;
if ( v19[0] <= 0 )
{
v15 = a9;
v14 = 0LL;
v11 = 0;
}
else
{
v11 = 2 * abs32(a10);
v12 = a9 + 1;
v13 = 4LL * v11 * v19[0];
v14 = &a9[(unsigned __int64)v13 / 4 + 1];
do
{
*v12 ^= LC4;
v12 += v11;
}
while ( v14 != v12 );
v15 = &v14[v13 / 0xFFFFFFFFFFFFFFFCLL];
}
break;
default:
LABEL_41:
result = cblas_xerbla(3LL, "cblas_ctbmv", "Illegal TransA setting, %d\n", a3);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
if ( a4 == 132 )
{
v22[0] = 85;
goto LABEL_34;
}
if ( a4 == 131 )
{
v22[0] = 78;
LABEL_34:
result = ctbmv_(&v21, &v20, v22, v19, &v18, a7, &a8, a9, &a10);
if ( a3 == 113 )
{
result = (unsigned int)v19[0];
if ( v19[0] > 0 )
{
v17 = 4LL * v11;
do
{
*v15 ^= LC4;
v15 = (_DWORD *)((char *)v15 + v17);
}
while ( v14 != v15 );
}
}
goto LABEL_14;
}
result = cblas_xerbla(4LL, "cblas_ctbmv", "Illegal Uplo setting, %d\n");
goto LABEL_46;
}
if ( a2 == 122 )
{
v21 = 85;
goto LABEL_6;
}
LABEL_26:
result = cblas_xerbla(2LL, "cblas_ctbmv", "Illegal Uplo setting, %d\n", a2);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
result = cblas_xerbla(1LL, "cblas_ctbmv", "Illegal Order setting, %d\n", a1);
LABEL_14:
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
if ( a2 == 121 )
{
v21 = 85;
}
else
{
if ( a2 != 122 )
goto LABEL_26;
v21 = 76;
}
switch ( a3 )
{
case 'o':
v20 = 78;
break;
case 'p':
v20 = 84;
break;
case 'q':
v20 = 67;
break;
default:
goto LABEL_41;
}
if ( a4 == 132 )
{
v22[0] = 85;
goto LABEL_25;
}
if ( a4 == 131 )
{
v22[0] = 78;
LABEL_25:
result = ctbmv_(&v21, &v20, v22, v19, &v18, a7, &a8, a9, &a10);
goto LABEL_14;
}
result = cblas_xerbla(4LL, "cblas_ctbmv", "Illegal Diag setting, %d\n");
LABEL_46:
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(unsigned int a1, unsigned int a2, unsigned int a3, int a4, int a5, int a6, __int64 a7, char a8, _DWORD *a9, int a10)
{
signed int v11; // ebp
_DWORD *v12; // rax
__int64 v13; // rdi
_DWORD *v14; // r13
_DWORD *v15; // rbx
__int64 result; // rax
__int64 v17; // rbp
int v18; // [rsp+8h] [rbp-40h] BYREF
int v19[4]; // [rsp+Ch] [rbp-3Ch] BYREF
char v20; // [rsp+1Dh] [rbp-2Bh] BYREF
char v21; // [rsp+1Eh] [rbp-2Ah] BYREF
char v22[41]; // [rsp+1Fh] [rbp-29h] BYREF

RowMajorStrg = 0;
v19[0] = a5;
v18 = a6;
CBLAS_CallFromC = 1;
if ( a1 != 102 )
{
if ( a1 == 101 )
{
RowMajorStrg = 1;
if ( a2 == 121 )
{
v21 = 76;
LABEL_6:
switch ( a3 )
{
case 'o':
v20 = 84;
v15 = a9;
v14 = 0LL;
v11 = 0;
break;
case 'p':
v20 = 78;
v15 = a9;
v14 = 0LL;
v11 = 0;
break;
case 'q':
v20 = 78;
if ( v19[0] <= 0 )
{
v15 = a9;
v14 = 0LL;
v11 = 0;
}
else
{
v11 = 2 * abs32(a10);
v12 = a9 + 1;
v13 = 4LL * v11 * v19[0];
v14 = &a9[(unsigned __int64)v13 / 4 + 1];
do
{
*v12 ^= LC4;
v12 += v11;
}
while ( v14 != v12 );
v15 = &v14[v13 / 0xFFFFFFFFFFFFFFFCLL];
}
break;
default:
LABEL_41:
result = cblas_xerbla(3LL, "cblas_ctbmv", "Illegal TransA setting, %d\n", a3);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
if ( a4 == 132 )
{
v22[0] = 85;
goto LABEL_34;
}
if ( a4 == 131 )
{
v22[0] = 78;
LABEL_34:
result = ctbmv_(&v21, &v20, v22, v19, &v18, a7, &a8, a9, &a10);
if ( a3 == 113 )
{
result = (unsigned int)v19[0];
if ( v19[0] > 0 )
{
v17 = 4LL * v11;
do
{
*v15 ^= LC4;
v15 = (_DWORD *)((char *)v15 + v17);
}
while ( v14 != v15 );
}
}
goto LABEL_14;
}
result = cblas_xerbla(4LL, "cblas_ctbmv", "Illegal Uplo setting, %d\n");
goto LABEL_46;
}
if ( a2 == 122 )
{
v21 = 85;
goto LABEL_6;
}
LABEL_26:
result = cblas_xerbla(2LL, "cblas_ctbmv", "Illegal Uplo setting, %d\n", a2);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
result = cblas_xerbla(1LL, "cblas_ctbmv", "Illegal Order setting, %d\n", a1);
LABEL_14:
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
if ( a2 == 121 )
{
v21 = 85;
}
else
{
if ( a2 != 122 )
goto LABEL_26;
v21 = 76;
}
switch ( a3 )
{
case 'o':
v20 = 78;
break;
case 'p':
v20 = 84;
break;
case 'q':
v20 = 67;
break;
default:
goto LABEL_41;
}
if ( a4 == 132 )
{
v22[0] = 85;
goto LABEL_25;
}
if ( a4 == 131 )
{
v22[0] = 78;
LABEL_25:
result = ctbmv_(&v21, &v20, v22, v19, &v18, a7, &a8, a9, &a10);
goto LABEL_14;
}
result = cblas_xerbla(4LL, "cblas_ctbmv", "Illegal Diag setting, %d\n");
LABEL_46:
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}

original_code:
void cblas_ctbmv(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo,
                 const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag,
                 const int N, const int K, const void *A, const int lda,
                 void *X, const int incX)
{
   char TA;
   char UL;
   char DI;
   int n, i=0, tincX;
   float *st=0, *x=(float *)X;
   extern int CBLAS_CallFromC;
   extern int RowMajorStrg;
   RowMajorStrg = 0;
   CBLAS_CallFromC = 1;
   if (order == CblasColMajor)
   {
      if (Uplo == CblasUpper) UL = 'U';
      else if (Uplo == CblasLower) UL = 'L';
      else
      {
         cblas_xerbla(2, "cblas_ctbmv","Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (TransA == CblasNoTrans) TA = 'N';
      else if (TransA == CblasTrans) TA = 'T';
      else if (TransA == CblasConjTrans) TA = 'C';
      else
      {
         cblas_xerbla(3, "cblas_ctbmv","Illegal TransA setting, %d\n", TransA);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (Diag == CblasUnit) DI = 'U';
      else if (Diag == CblasNonUnit) DI = 'N';
      else
      {
         cblas_xerbla(4, "cblas_ctbmv","Illegal Diag setting, %d\n", Diag);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      ctbmv_( &UL, &TA, &DI, &N, &K, A, &lda, X,
                      &incX);
   }
   else if (order == CblasRowMajor)
   {
      RowMajorStrg = 1;
      if (Uplo == CblasUpper) UL = 'L';
      else if (Uplo == CblasLower) UL = 'U';
      else
      {
         cblas_xerbla(2, "cblas_ctbmv","Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (TransA == CblasNoTrans) TA = 'T';
      else if (TransA == CblasTrans) TA = 'N';
      else if (TransA == CblasConjTrans)
      {
         TA = 'N';
         if ( N > 0)
         {
            if(incX > 0)
               tincX = incX;
            else
               tincX = -incX;
            i = tincX << 1;
            n = i * N;
            x++;
            st = x + n;
            do
            {
               *x = -(*x);
               x+= i;
            }
            while (x != st);
            x -= n;
         }
      }
      else
      {
         cblas_xerbla(3, "cblas_ctbmv","Illegal TransA setting, %d\n", TransA);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (Diag == CblasUnit) DI = 'U';
      else if (Diag == CblasNonUnit) DI = 'N';
      else
      {
         cblas_xerbla(4, "cblas_ctbmv","Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      ctbmv_( &UL, &TA, &DI, &N, &K, A, &lda, X,
                      &incX);
      if (TransA == CblasConjTrans)
      {
         if (N > 0)
         {
            do
            {
               *x = -(*x);
               x += i;
            }
            while (x != st);
         }
      }
   }
   else cblas_xerbla(1, "cblas_ctbmv", "Illegal Order setting, %d\n", order);
   CBLAS_CallFromC = 0;
   RowMajorStrg = 0;
   return;
}

canonical_original_code:
void cblas_ctbmv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA, enum CBLAS_DIAG Diag, int N, int K, void *A, int lda, void *X, int incX)
{
   char TA;
   char UL;
   char DI;
   int n; int i = 0; int tincX;
   float *st = 0; float *x = (float *)X;
   extern int CBLAS_CallFromC;
   extern int RowMajorStrg;
   RowMajorStrg = 0;
   CBLAS_CallFromC = 1;
   if (order == CblasColMajor)
   {
      if (Uplo == CblasUpper) UL = 'U';
      else if (Uplo == CblasLower) UL = 'L';
      else
      {
         cblas_xerbla(2, "cblas_ctbmv","Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (TransA == CblasNoTrans) TA = 'N';
      else if (TransA == CblasTrans) TA = 'T';
      else if (TransA == CblasConjTrans) TA = 'C';
      else
      {
         cblas_xerbla(3, "cblas_ctbmv","Illegal TransA setting, %d\n", TransA);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (Diag == CblasUnit) DI = 'U';
      else if (Diag == CblasNonUnit) DI = 'N';
      else
      {
         cblas_xerbla(4, "cblas_ctbmv","Illegal Diag setting, %d\n", Diag);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      ctbmv_( &UL, &TA, &DI, &N, &K, A, &lda, X,
                      &incX);
   }
   else if (order == CblasRowMajor)
   {
      RowMajorStrg = 1;
      if (Uplo == CblasUpper) UL = 'L';
      else if (Uplo == CblasLower) UL = 'U';
      else
      {
         cblas_xerbla(2, "cblas_ctbmv","Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (TransA == CblasNoTrans) TA = 'T';
      else if (TransA == CblasTrans) TA = 'N';
      else if (TransA == CblasConjTrans)
      {
         TA = 'N';
         if ( N > 0)
         {
            if(incX > 0)
               tincX = incX;
            else
               tincX = -incX;
            i = tincX << 1;
            n = i * N;
            x++;
            st = x + n;
            do
            {
               *x = -(*x);
               x+= i;
            }
            while (x != st);
            x -= n;
         }
      }
      else
      {
         cblas_xerbla(3, "cblas_ctbmv","Illegal TransA setting, %d\n", TransA);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (Diag == CblasUnit) DI = 'U';
      else if (Diag == CblasNonUnit) DI = 'N';
      else
      {
         cblas_xerbla(4, "cblas_ctbmv","Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      ctbmv_( &UL, &TA, &DI, &N, &K, A, &lda, X,
                      &incX);
      if (TransA == CblasConjTrans)
      {
         if (N > 0)
         {
            do
            {
               *x = -(*x);
               x += i;
            }
            while (x != st);
         }
      }
   }
   else cblas_xerbla(1, "cblas_ctbmv", "Illegal Order setting, %d\n", order);
   CBLAS_CallFromC = 0;
   RowMajorStrg = 0;
   return;
}

variable_types: enum CBLAS_UPLO { CblasUpper=121, CblasLower=122 }

variable_types: enum CBLAS_TRANSPOSE { CblasNoTrans=111, CblasTrans=112, CblasConjTrans=113 }

variable_types: N int

variable_types: K int

variable_types:
A
void *

variable_types: lda int

variable_types:
X
void *

user_defined_types: enum CBLAS_ORDER { CblasRowMajor=101, CblasColMajor=102 }


decompiled_code:
__int64 __fastcall cblas_dswap(int a1, __int64 a2, int a3, __int64 a4, int a5)
{
int v6; // [rsp+4h] [rbp-14h] BYREF
int v7; // [rsp+8h] [rbp-10h] BYREF
int v8[3]; // [rsp+Ch] [rbp-Ch] BYREF

v8[0] = a1;
v7 = a3;
v6 = a5;
return dswap_(v8, a2, &v7, a4, &v6);
}

canonical_decompiled_code:
__int64 __fastcall func0(int a1, __int64 a2, int a3, __int64 a4, int a5)
{
int v6; // [rsp+4h] [rbp-14h] BYREF
int v7; // [rsp+8h] [rbp-10h] BYREF
int v8[3]; // [rsp+Ch] [rbp-Ch] BYREF

v8[0] = a1;
v7 = a3;
v6 = a5;
return dswap_(v8, a2, &v7, a4, &v6);
}

original_code:
void cblas_dswap( const int N, double *X, const int incX, double *Y,
                       const int incY)
{
   dswap_( &N, X, &incX, Y, &incY);
}

canonical_original_code:
void cblas_dswap(int N, double *X, int incX, double *Y, int incY)
{
   dswap_( &N, X, &incX, Y, &incY);
}

variable_types:
X
double *

variable_types: incX int

variable_types:
Y
double *

variable_types: incY int


decompiled_code:
__int64 __fastcall cblas_zgemm(unsigned int a1, unsigned int a2, unsigned int a3, int a4, int a5, int a6, __int64 a7, __int64 a8, char a9, __int64 a10, char a11, __int64 a12, __int64 a13, char a14)
{
__int64 result; // rax
int v15; // [rsp+4h] [rbp-24h] BYREF
int v16; // [rsp+8h] [rbp-20h] BYREF
int v17[4]; // [rsp+Ch] [rbp-1Ch] BYREF
char v18; // [rsp+1Eh] [rbp-Ah] BYREF
char v19[9]; // [rsp+1Fh] [rbp-9h] BYREF

RowMajorStrg = 0;
v17[0] = a4;
v16 = a5;
v15 = a6;
CBLAS_CallFromC = 1;
if ( a1 != 102 )
{
if ( a1 != 101 )
{
result = cblas_xerbla(1LL, "cblas_zgemm", "Illegal Order setting, %d\n", a1);
goto LABEL_13;
}
RowMajorStrg = 1;
switch ( a2 )
{
case 'p':
v19[0] = 84;
goto LABEL_7;
case 'q':
v19[0] = 67;
goto LABEL_7;
case 'o':
v19[0] = 78;
LABEL_7:
switch ( a3 )
{
case 'p':
v18 = 84;
goto LABEL_11;
case 'q':
v18 = 67;
goto LABEL_11;
case 'o':
v18 = 78;
LABEL_11:
result = zgemm_(&v18, v19, &v16, v17, &v15, a7, a10, &a11, a8, &a9, a12, a13, &a14);
LABEL_13:
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
result = cblas_xerbla(2LL, "cblas_zgemm", "Illegal TransB setting, %d\n", a3);
goto LABEL_30;
}
LABEL_29:
result = cblas_xerbla(2LL, "cblas_zgemm", "Illegal TransA setting, %d\n", a2);
LABEL_30:
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
switch ( a2 )
{
case 'p':
v18 = 84;
break;
case 'q':
v18 = 67;
break;
case 'o':
v18 = 78;
break;
default:
goto LABEL_29;
}
switch ( a3 )
{
case 'p':
v19[0] = 84;
goto LABEL_22;
case 'q':
v19[0] = 67;
goto LABEL_22;
case 'o':
v19[0] = 78;
LABEL_22:
result = zgemm_(&v18, v19, v17, &v16, &v15, a7, a8, &a9, a10, &a11, a12, a13, &a14);
goto LABEL_13;
}
result = cblas_xerbla(3LL, "cblas_zgemm", "Illegal TransB setting, %d\n", a3);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(unsigned int a1, unsigned int a2, unsigned int a3, int a4, int a5, int a6, __int64 a7, __int64 a8, char a9, __int64 a10, char a11, __int64 a12, __int64 a13, char a14)
{
__int64 result; // rax
int v15; // [rsp+4h] [rbp-24h] BYREF
int v16; // [rsp+8h] [rbp-20h] BYREF
int v17[4]; // [rsp+Ch] [rbp-1Ch] BYREF
char v18; // [rsp+1Eh] [rbp-Ah] BYREF
char v19[9]; // [rsp+1Fh] [rbp-9h] BYREF

RowMajorStrg = 0;
v17[0] = a4;
v16 = a5;
v15 = a6;
CBLAS_CallFromC = 1;
if ( a1 != 102 )
{
if ( a1 != 101 )
{
result = cblas_xerbla(1LL, "cblas_zgemm", "Illegal Order setting, %d\n", a1);
goto LABEL_13;
}
RowMajorStrg = 1;
switch ( a2 )
{
case 'p':
v19[0] = 84;
goto LABEL_7;
case 'q':
v19[0] = 67;
goto LABEL_7;
case 'o':
v19[0] = 78;
LABEL_7:
switch ( a3 )
{
case 'p':
v18 = 84;
goto LABEL_11;
case 'q':
v18 = 67;
goto LABEL_11;
case 'o':
v18 = 78;
LABEL_11:
result = zgemm_(&v18, v19, &v16, v17, &v15, a7, a10, &a11, a8, &a9, a12, a13, &a14);
LABEL_13:
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
result = cblas_xerbla(2LL, "cblas_zgemm", "Illegal TransB setting, %d\n", a3);
goto LABEL_30;
}
LABEL_29:
result = cblas_xerbla(2LL, "cblas_zgemm", "Illegal TransA setting, %d\n", a2);
LABEL_30:
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
switch ( a2 )
{
case 'p':
v18 = 84;
break;
case 'q':
v18 = 67;
break;
case 'o':
v18 = 78;
break;
default:
goto LABEL_29;
}
switch ( a3 )
{
case 'p':
v19[0] = 84;
goto LABEL_22;
case 'q':
v19[0] = 67;
goto LABEL_22;
case 'o':
v19[0] = 78;
LABEL_22:
result = zgemm_(&v18, v19, v17, &v16, &v15, a7, a8, &a9, a10, &a11, a12, a13, &a14);
goto LABEL_13;
}
result = cblas_xerbla(3LL, "cblas_zgemm", "Illegal TransB setting, %d\n", a3);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}

original_code:
void cblas_zgemm(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA,
                 const enum CBLAS_TRANSPOSE TransB, const int M, const int N,
                 const int K, const void *alpha, const void *A,
                 const int lda, const void *B, const int ldb,
                 const void *beta, void *C, const int ldc)
{
   char TA, TB;
   extern int CBLAS_CallFromC;
   extern int RowMajorStrg;
   RowMajorStrg = 0;
   CBLAS_CallFromC = 1;
   if( Order == CblasColMajor )
   {
      if(TransA == CblasTrans) TA='T';
      else if ( TransA == CblasConjTrans ) TA='C';
      else if ( TransA == CblasNoTrans ) TA='N';
      else
      {
         cblas_xerbla(2, "cblas_zgemm","Illegal TransA setting, %d\n", TransA);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if(TransB == CblasTrans) TB='T';
      else if ( TransB == CblasConjTrans ) TB='C';
      else if ( TransB == CblasNoTrans ) TB='N';
      else
      {
         cblas_xerbla(3, "cblas_zgemm","Illegal TransB setting, %d\n", TransB);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      zgemm_(&TA, &TB, &M, &N, &K, alpha, A,
                     &lda, B, &ldb, beta, C, &ldc);
   } else if (Order == CblasRowMajor)
   {
      RowMajorStrg = 1;
      if(TransA == CblasTrans) TB='T';
      else if ( TransA == CblasConjTrans ) TB='C';
      else if ( TransA == CblasNoTrans ) TB='N';
      else
      {
         cblas_xerbla(2, "cblas_zgemm","Illegal TransA setting, %d\n", TransA);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if(TransB == CblasTrans) TA='T';
      else if ( TransB == CblasConjTrans ) TA='C';
      else if ( TransB == CblasNoTrans ) TA='N';
      else
      {
         cblas_xerbla(2, "cblas_zgemm","Illegal TransB setting, %d\n", TransB);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      zgemm_(&TA, &TB, &N, &M, &K, alpha, B,
                  &ldb, A, &lda, beta, C, &ldc);
   }
   else cblas_xerbla(1, "cblas_zgemm", "Illegal Order setting, %d\n", Order);
   CBLAS_CallFromC = 0;
   RowMajorStrg = 0;
   return;
}

canonical_original_code:
void cblas_zgemm(enum CBLAS_ORDER Order, enum CBLAS_TRANSPOSE TransA, enum CBLAS_TRANSPOSE TransB, int M, int N, int K, void *alpha, void *A, int lda, void *B, int ldb, void *beta, void *C, int ldc)
{
   char TA; char TB;
   extern int CBLAS_CallFromC;
   extern int RowMajorStrg;
   RowMajorStrg = 0;
   CBLAS_CallFromC = 1;
   if( Order == CblasColMajor )
   {
      if(TransA == CblasTrans) TA='T';
      else if ( TransA == CblasConjTrans ) TA='C';
      else if ( TransA == CblasNoTrans ) TA='N';
      else
      {
         cblas_xerbla(2, "cblas_zgemm","Illegal TransA setting, %d\n", TransA);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if(TransB == CblasTrans) TB='T';
      else if ( TransB == CblasConjTrans ) TB='C';
      else if ( TransB == CblasNoTrans ) TB='N';
      else
      {
         cblas_xerbla(3, "cblas_zgemm","Illegal TransB setting, %d\n", TransB);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      zgemm_(&TA, &TB, &M, &N, &K, alpha, A,
                     &lda, B, &ldb, beta, C, &ldc);
   } else if (Order == CblasRowMajor)
   {
      RowMajorStrg = 1;
      if(TransA == CblasTrans) TB='T';
      else if ( TransA == CblasConjTrans ) TB='C';
      else if ( TransA == CblasNoTrans ) TB='N';
      else
      {
         cblas_xerbla(2, "cblas_zgemm","Illegal TransA setting, %d\n", TransA);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if(TransB == CblasTrans) TA='T';
      else if ( TransB == CblasConjTrans ) TA='C';
      else if ( TransB == CblasNoTrans ) TA='N';
      else
      {
         cblas_xerbla(2, "cblas_zgemm","Illegal TransB setting, %d\n", TransB);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      zgemm_(&TA, &TB, &N, &M, &K, alpha, B,
                  &ldb, A, &lda, beta, C, &ldc);
   }
   else cblas_xerbla(1, "cblas_zgemm", "Illegal Order setting, %d\n", Order);
   CBLAS_CallFromC = 0;
   RowMajorStrg = 0;
   return;
}

variable_types: enum CBLAS_ORDER { CblasRowMajor=101, CblasColMajor=102 }

variable_types: M int

variable_types:
alpha
void *

variable_types:
B
void *

variable_types: ldb int

variable_types:
beta
void *

variable_types:
C
void *

variable_types: ldc int

variable_types: TA char

variable_types: TB char


decompiled_code:
__int64 __fastcall cblas_sspmv(unsigned int a1, unsigned int a2, int a3, __int64 a4, __int64 a5, int a6, float a7, float a8, __int64 a9, char a10)
{
__int64 result; // rax
float v11; // [rsp+0h] [rbp-28h] BYREF
int v12; // [rsp+4h] [rbp-24h] BYREF
float v13; // [rsp+8h] [rbp-20h] BYREF
int v14[4]; // [rsp+Ch] [rbp-1Ch] BYREF
char v15[9]; // [rsp+1Fh] [rbp-9h] BYREF

RowMajorStrg = 0;
v14[0] = a3;
v12 = a6;
CBLAS_CallFromC = 1;
v13 = a7;
v11 = a8;
if ( a1 != 102 )
{
if ( a1 != 101 )
{
result = cblas_xerbla(1LL, "cblas_sspmv", "Illegal Order setting, %d\n", a1);
goto LABEL_8;
}
RowMajorStrg = 1;
if ( a2 != 121 )
{
if ( a2 == 122 )
{
LABEL_5:
v15[0] = 85;
LABEL_6:
result = sspmv_(v15, v14, &v13, a4, a5, &v12, &v11, a9, &a10);
LABEL_8:
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
goto LABEL_12;
}
LABEL_11:
v15[0] = 76;
goto LABEL_6;
}
if ( a2 == 121 )
goto LABEL_5;
if ( a2 == 122 )
goto LABEL_11;
LABEL_12:
result = cblas_xerbla(2LL, "cblas_sspmv", "Illegal Uplo setting, %d\n", a2);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(unsigned int a1, unsigned int a2, int a3, __int64 a4, __int64 a5, int a6, float a7, float a8, __int64 a9, char a10)
{
__int64 result; // rax
float v11; // [rsp+0h] [rbp-28h] BYREF
int v12; // [rsp+4h] [rbp-24h] BYREF
float v13; // [rsp+8h] [rbp-20h] BYREF
int v14[4]; // [rsp+Ch] [rbp-1Ch] BYREF
char v15[9]; // [rsp+1Fh] [rbp-9h] BYREF

RowMajorStrg = 0;
v14[0] = a3;
v12 = a6;
CBLAS_CallFromC = 1;
v13 = a7;
v11 = a8;
if ( a1 != 102 )
{
if ( a1 != 101 )
{
result = cblas_xerbla(1LL, "cblas_sspmv", "Illegal Order setting, %d\n", a1);
goto LABEL_8;
}
RowMajorStrg = 1;
if ( a2 != 121 )
{
if ( a2 == 122 )
{
LABEL_5:
v15[0] = 85;
LABEL_6:
result = sspmv_(v15, v14, &v13, a4, a5, &v12, &v11, a9, &a10);
LABEL_8:
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
goto LABEL_12;
}
LABEL_11:
v15[0] = 76;
goto LABEL_6;
}
if ( a2 == 121 )
goto LABEL_5;
if ( a2 == 122 )
goto LABEL_11;
LABEL_12:
result = cblas_xerbla(2LL, "cblas_sspmv", "Illegal Uplo setting, %d\n", a2);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}

original_code:
void cblas_sspmv(const enum CBLAS_ORDER order,
                 const enum CBLAS_UPLO Uplo, const int N,
                 const float alpha, const float *AP,
                 const float *X, const int incX, const float beta,
                 float *Y, const int incY)
{
   char UL;
   extern int CBLAS_CallFromC;
   extern int RowMajorStrg;
   RowMajorStrg = 0;
   CBLAS_CallFromC = 1;
   if (order == CblasColMajor)
   {
      if (Uplo == CblasUpper) UL = 'U';
      else if (Uplo == CblasLower) UL = 'L';
      else
      {
         cblas_xerbla(2, "cblas_sspmv","Illegal Uplo setting, %d\n",Uplo );
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      sspmv_(&UL, &N, &alpha, AP, X,
                     &incX, &beta, Y, &incY);
   }
   else if (order == CblasRowMajor)
   {
      RowMajorStrg = 1;
      if (Uplo == CblasUpper) UL = 'L';
      else if (Uplo == CblasLower) UL = 'U';
      else
      {
         cblas_xerbla(2, "cblas_sspmv","Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      sspmv_(&UL, &N, &alpha,
                     AP, X,&incX, &beta, Y, &incY);
   }
   else cblas_xerbla(1, "cblas_sspmv", "Illegal Order setting, %d\n", order);
   CBLAS_CallFromC = 0;
   RowMajorStrg = 0;
}

canonical_original_code:
void cblas_sspmv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, int N, float alpha, float *AP, float *X, int incX, float beta, float *Y, int incY)
{
   char UL;
   extern int CBLAS_CallFromC;
   extern int RowMajorStrg;
   RowMajorStrg = 0;
   CBLAS_CallFromC = 1;
   if (order == CblasColMajor)
   {
      if (Uplo == CblasUpper) UL = 'U';
      else if (Uplo == CblasLower) UL = 'L';
      else
      {
         cblas_xerbla(2, "cblas_sspmv","Illegal Uplo setting, %d\n",Uplo );
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      sspmv_(&UL, &N, &alpha, AP, X,
                     &incX, &beta, Y, &incY);
   }
   else if (order == CblasRowMajor)
   {
      RowMajorStrg = 1;
      if (Uplo == CblasUpper) UL = 'L';
      else if (Uplo == CblasLower) UL = 'U';
      else
      {
         cblas_xerbla(2, "cblas_sspmv","Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      sspmv_(&UL, &N, &alpha,
                     AP, X,&incX, &beta, Y, &incY);
   }
   else cblas_xerbla(1, "cblas_sspmv", "Illegal Order setting, %d\n", order);
   CBLAS_CallFromC = 0;
   RowMajorStrg = 0;
}

variable_types: enum CBLAS_UPLO { CblasUpper=121, CblasLower=122 }

variable_types: N int

variable_types: alpha float

variable_types:
AP
float *

variable_types:
X
float *

variable_types: beta float

variable_types:
Y
float *

variable_types: UL char

variable_types: RowMajorStrg int


original_code:
void cblas_zher2(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo,
                 const int N, const void *alpha, const void *X, const int incX,
                 const void *Y, const int incY, void *A, const int lda)
{
   char UL;
   int n, i, j, tincx, tincy, incx=incX, incy=incY;
   double *x=(double *)X, *xx=(double *)X, *y=(double *)Y,
         *yy=(double *)Y, *tx, *ty, *stx, *sty;
   extern int CBLAS_CallFromC;
   extern int RowMajorStrg;
   RowMajorStrg = 0;
   CBLAS_CallFromC = 1;
   if (order == CblasColMajor)
   {
      if (Uplo == CblasLower) UL = 'L';
      else if (Uplo == CblasUpper) UL = 'U';
      else
      {
         cblas_xerbla(2, "cblas_zher2", "Illegal Uplo setting, %d\n",Uplo );
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      zher2_(&UL, &N, alpha, X, &incx,
                                            Y, &incy, A, &lda);
   } else if (order == CblasRowMajor)
   {
      RowMajorStrg = 1;
      if (Uplo == CblasUpper) UL = 'L';
      else if (Uplo == CblasLower) UL = 'U';
      else
      {
         cblas_xerbla(2, "cblas_zher2", "Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (N > 0)
      {
         n = N << 1;
         x = malloc(n*sizeof(double));
         y = malloc(n*sizeof(double));
         tx = x;
         ty = y;
         if( incX > 0 ) {
            i = incX << 1 ;
            tincx = 2;
            stx= x+n;
         } else {
            i = incX *(-2);
            tincx = -2;
            stx = x-2;
            x +=(n-2);
         }
         if( incY > 0 ) {
            j = incY << 1;
            tincy = 2;
            sty= y+n;
         } else {
            j = incY *(-2);
            tincy = -2;
            sty = y-2;
            y +=(n-2);
         }
         do
         {
            *x = *xx;
            x[1] = -xx[1];
            x += tincx ;
            xx += i;
         }
         while (x != stx);
         do
         {
            *y = *yy;
            y[1] = -yy[1];
            y += tincy ;
            yy += j;
         }
         while (y != sty);
         x=tx;
         y=ty;
            incx = 1;
            incy = 1;
      } else
      {
         x = (double *) X;
         y = (double *) Y;
      }
      zher2_(&UL, &N, alpha, y, &incy, x,
                                      &incx, A, &lda);
   }
   else
   {
      cblas_xerbla(1, "cblas_zher2", "Illegal Order setting, %d\n", order);
      CBLAS_CallFromC = 0;
      RowMajorStrg = 0;
      return;
   }
   if(X!=x)
      free(x);
   if(Y!=y)
      free(y);
   CBLAS_CallFromC = 0;
   RowMajorStrg = 0;
   return;
}

canonical_original_code:
void cblas_zher2(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, int N, void *alpha, void *X, int incX, void *Y, int incY, void *A, int lda)
{
   char UL;
   int n; int i; int j; int tincx; int tincy; int incx = incX; int incy = incY;
   double *x = (double *)X; double *xx = (double *)X; double *y = (double *)Y; double *yy = (double *)Y; double *tx; double *ty; double *stx; double *sty;
   extern int CBLAS_CallFromC;
   extern int RowMajorStrg;
   RowMajorStrg = 0;
   CBLAS_CallFromC = 1;
   if (order == CblasColMajor)
   {
      if (Uplo == CblasLower) UL = 'L';
      else if (Uplo == CblasUpper) UL = 'U';
      else
      {
         cblas_xerbla(2, "cblas_zher2", "Illegal Uplo setting, %d\n",Uplo );
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      zher2_(&UL, &N, alpha, X, &incx,
                                            Y, &incy, A, &lda);
   } else if (order == CblasRowMajor)
   {
      RowMajorStrg = 1;
      if (Uplo == CblasUpper) UL = 'L';
      else if (Uplo == CblasLower) UL = 'U';
      else
      {
         cblas_xerbla(2, "cblas_zher2", "Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (N > 0)
      {
         n = N << 1;
         x = malloc(n*sizeof(double));
         y = malloc(n*sizeof(double));
         tx = x;
         ty = y;
         if( incX > 0 ) {
            i = incX << 1 ;
            tincx = 2;
            stx= x+n;
         } else {
            i = incX *(-2);
            tincx = -2;
            stx = x-2;
            x +=(n-2);
         }
         if( incY > 0 ) {
            j = incY << 1;
            tincy = 2;
            sty= y+n;
         } else {
            j = incY *(-2);
            tincy = -2;
            sty = y-2;
            y +=(n-2);
         }
         do
         {
            *x = *xx;
            x[1] = -xx[1];
            x += tincx ;
            xx += i;
         }
         while (x != stx);
         do
         {
            *y = *yy;
            y[1] = -yy[1];
            y += tincy ;
            yy += j;
         }
         while (y != sty);
         x=tx;
         y=ty;
            incx = 1;
            incy = 1;
      } else
      {
         x = (double *) X;
         y = (double *) Y;
      }
      zher2_(&UL, &N, alpha, y, &incy, x,
                                      &incx, A, &lda);
   }
   else
   {
      cblas_xerbla(1, "cblas_zher2", "Illegal Order setting, %d\n", order);
      CBLAS_CallFromC = 0;
      RowMajorStrg = 0;
      return;
   }
   if(X!=x)
      free(x);
   if(Y!=y)
      free(y);
   CBLAS_CallFromC = 0;
   RowMajorStrg = 0;
   return;
}

variable_types: enum CBLAS_ORDER { CblasRowMajor=101, CblasColMajor=102 }

variable_types:
alpha
void *

variable_types:
X
void *

variable_types: incX int

variable_types:
Y
void *

variable_types: incY int

variable_types:
A
void *

variable_types: lda int

variable_types: n int

variable_types: i int

variable_types: j int

variable_types: tincx int

variable_types: tincy int

variable_types: incx int

variable_types: incy int

variable_types:
x
double *

variable_types:
xx
double *

variable_types:
y
double *

variable_types:
yy
double *

variable_types:
tx
double *

variable_types:
ty
double *

variable_types:
stx
double *

variable_types:
sty
double *


decompiled_code:
__int64 __fastcall cblas_daxpy(int a1, __int64 a2, int a3, __int64 a4, int a5, double a6)
{
int v7; // [rsp+Ch] [rbp-1Ch] BYREF
double v8; // [rsp+10h] [rbp-18h] BYREF
int v9; // [rsp+18h] [rbp-10h] BYREF
int v10[3]; // [rsp+1Ch] [rbp-Ch] BYREF

v10[0] = a1;
v9 = a3;
v7 = a5;
v8 = a6;
return daxpy_(v10, &v8, a2, &v9, a4, &v7);
}

canonical_decompiled_code:
__int64 __fastcall func0(int a1, __int64 a2, int a3, __int64 a4, int a5, double a6)
{
int v7; // [rsp+Ch] [rbp-1Ch] BYREF
double v8; // [rsp+10h] [rbp-18h] BYREF
int v9; // [rsp+18h] [rbp-10h] BYREF
int v10[3]; // [rsp+1Ch] [rbp-Ch] BYREF

v10[0] = a1;
v9 = a3;
v7 = a5;
v8 = a6;
return daxpy_(v10, &v8, a2, &v9, a4, &v7);
}

original_code:
void cblas_daxpy( const int N, const double alpha, const double *X,
                       const int incX, double *Y, const int incY)
{
   daxpy_( &N, &alpha, X, &incX, Y, &incY);
}

canonical_original_code:
void cblas_daxpy(int N, double alpha, double *X, int incX, double *Y, int incY)
{
   daxpy_( &N, &alpha, X, &incX, Y, &incY);
}

variable_types: N int

variable_types: alpha double

variable_types:
X
double *

variable_types: incX int

variable_types:
Y
double *

variable_types: incY int


decompiled_code:
__int64 __fastcall cblas_dtpsv(unsigned int a1, unsigned int a2, unsigned int a3, __int64 a4, int a5, __int64 a6, __int64 a7, char a8)
{
__int64 result; // rax
__int64 v9; // [rsp-10h] [rbp-38h]
int v10[4]; // [rsp+Ch] [rbp-1Ch] BYREF
char v11; // [rsp+1Dh] [rbp-Bh] BYREF
char v12; // [rsp+1Eh] [rbp-Ah] BYREF
char v13[9]; // [rsp+1Fh] [rbp-9h] BYREF

RowMajorStrg = 0;
v10[0] = a5;
CBLAS_CallFromC = 1;
if ( a1 == 102 )
{
if ( a2 == 121 )
{
v12 = 85;
}
else
{
if ( a2 != 122 )
goto LABEL_22;
v12 = 76;
}
if ( a3 == 111 )
goto LABEL_23;
if ( a3 != 112 )
{
if ( a3 != 113 )
goto LABEL_8;
v11 = 67;
LABEL_18:
if ( (_DWORD)a4 == 132 )
{
LABEL_24:
v13[0] = 85;
goto LABEL_21;
}
goto LABEL_19;
}
LABEL_25:
v11 = 84;
goto LABEL_18;
}
if ( a1 != 101 )
{
result = cblas_xerbla(1LL, "cblas_dtpsv", "Illegal Order setting, %d\n", a1);
LABEL_10:
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
RowMajorStrg = 1;
if ( a2 != 121 )
{
if ( a2 == 122 )
{
v12 = 85;
goto LABEL_6;
}
LABEL_22:
result = cblas_xerbla(2LL, "cblas_dtpsv", "Illegal Uplo setting, %d\n", a2);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
v12 = 76;
LABEL_6:
if ( a3 == 111 )
goto LABEL_25;
if ( a3 - 112 > 1 )
{
LABEL_8:
result = cblas_xerbla(3LL, "cblas_dtpsv", "Illegal TransA setting, %d\n", a3);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
LABEL_23:
v11 = 78;
if ( (_DWORD)a4 == 132 )
goto LABEL_24;
LABEL_19:
if ( (_DWORD)a4 == 131 )
{
v13[0] = 78;
LABEL_21:
dtpsv_(&v12, &v11, v13, v10, a6, a7, &a8);
result = v9;
goto LABEL_10;
}
result = cblas_xerbla(4LL, "cblas_dtpsv", "Illegal Diag setting, %d\n", a4);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(unsigned int a1, unsigned int a2, unsigned int a3, __int64 a4, int a5, __int64 a6, __int64 a7, char a8)
{
__int64 result; // rax
__int64 v9; // [rsp-10h] [rbp-38h]
int v10[4]; // [rsp+Ch] [rbp-1Ch] BYREF
char v11; // [rsp+1Dh] [rbp-Bh] BYREF
char v12; // [rsp+1Eh] [rbp-Ah] BYREF
char v13[9]; // [rsp+1Fh] [rbp-9h] BYREF

RowMajorStrg = 0;
v10[0] = a5;
CBLAS_CallFromC = 1;
if ( a1 == 102 )
{
if ( a2 == 121 )
{
v12 = 85;
}
else
{
if ( a2 != 122 )
goto LABEL_22;
v12 = 76;
}
if ( a3 == 111 )
goto LABEL_23;
if ( a3 != 112 )
{
if ( a3 != 113 )
goto LABEL_8;
v11 = 67;
LABEL_18:
if ( (_DWORD)a4 == 132 )
{
LABEL_24:
v13[0] = 85;
goto LABEL_21;
}
goto LABEL_19;
}
LABEL_25:
v11 = 84;
goto LABEL_18;
}
if ( a1 != 101 )
{
result = cblas_xerbla(1LL, "cblas_dtpsv", "Illegal Order setting, %d\n", a1);
LABEL_10:
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
RowMajorStrg = 1;
if ( a2 != 121 )
{
if ( a2 == 122 )
{
v12 = 85;
goto LABEL_6;
}
LABEL_22:
result = cblas_xerbla(2LL, "cblas_dtpsv", "Illegal Uplo setting, %d\n", a2);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
v12 = 76;
LABEL_6:
if ( a3 == 111 )
goto LABEL_25;
if ( a3 - 112 > 1 )
{
LABEL_8:
result = cblas_xerbla(3LL, "cblas_dtpsv", "Illegal TransA setting, %d\n", a3);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
LABEL_23:
v11 = 78;
if ( (_DWORD)a4 == 132 )
goto LABEL_24;
LABEL_19:
if ( (_DWORD)a4 == 131 )
{
v13[0] = 78;
LABEL_21:
dtpsv_(&v12, &v11, v13, v10, a6, a7, &a8);
result = v9;
goto LABEL_10;
}
result = cblas_xerbla(4LL, "cblas_dtpsv", "Illegal Diag setting, %d\n", a4);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}

original_code:
void cblas_dtpsv(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo,
                 const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag,
                 const int N, const double *Ap, double *X, const int incX)
{
   char TA;
   char UL;
   char DI;
   extern int CBLAS_CallFromC;
   extern int RowMajorStrg;
   RowMajorStrg = 0;
   CBLAS_CallFromC = 1;
   if (order == CblasColMajor)
   {
      if (Uplo == CblasUpper) UL = 'U';
      else if (Uplo == CblasLower) UL = 'L';
      else
      {
         cblas_xerbla(2, "cblas_dtpsv","Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (TransA == CblasNoTrans) TA = 'N';
      else if (TransA == CblasTrans) TA = 'T';
      else if (TransA == CblasConjTrans) TA = 'C';
      else
      {
         cblas_xerbla(3, "cblas_dtpsv","Illegal TransA setting, %d\n", TransA);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (Diag == CblasUnit) DI = 'U';
      else if (Diag == CblasNonUnit) DI = 'N';
      else
      {
         cblas_xerbla(4, "cblas_dtpsv","Illegal Diag setting, %d\n", Diag);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      dtpsv_( &UL, &TA, &DI, &N, Ap, X, &incX);
   }
   else if (order == CblasRowMajor)
   {
      RowMajorStrg = 1;
      if (Uplo == CblasUpper) UL = 'L';
      else if (Uplo == CblasLower) UL = 'U';
      else
      {
         cblas_xerbla(2, "cblas_dtpsv","Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (TransA == CblasNoTrans) TA = 'T';
      else if (TransA == CblasTrans) TA = 'N';
      else if (TransA == CblasConjTrans) TA = 'N';
      else
      {
         cblas_xerbla(3, "cblas_dtpsv","Illegal TransA setting, %d\n", TransA);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (Diag == CblasUnit) DI = 'U';
      else if (Diag == CblasNonUnit) DI = 'N';
      else
      {
         cblas_xerbla(4, "cblas_dtpsv","Illegal Diag setting, %d\n", Diag);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      dtpsv_( &UL, &TA, &DI, &N, Ap, X,&incX);
   }
   else cblas_xerbla(1, "cblas_dtpsv", "Illegal Order setting, %d\n", order);
   CBLAS_CallFromC = 0;
   RowMajorStrg = 0;
   return;
}

canonical_original_code:
void cblas_dtpsv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA, enum CBLAS_DIAG Diag, int N, double *Ap, double *X, int incX)
{
   char TA;
   char UL;
   char DI;
   extern int CBLAS_CallFromC;
   extern int RowMajorStrg;
   RowMajorStrg = 0;
   CBLAS_CallFromC = 1;
   if (order == CblasColMajor)
   {
      if (Uplo == CblasUpper) UL = 'U';
      else if (Uplo == CblasLower) UL = 'L';
      else
      {
         cblas_xerbla(2, "cblas_dtpsv","Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (TransA == CblasNoTrans) TA = 'N';
      else if (TransA == CblasTrans) TA = 'T';
      else if (TransA == CblasConjTrans) TA = 'C';
      else
      {
         cblas_xerbla(3, "cblas_dtpsv","Illegal TransA setting, %d\n", TransA);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (Diag == CblasUnit) DI = 'U';
      else if (Diag == CblasNonUnit) DI = 'N';
      else
      {
         cblas_xerbla(4, "cblas_dtpsv","Illegal Diag setting, %d\n", Diag);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      dtpsv_( &UL, &TA, &DI, &N, Ap, X, &incX);
   }
   else if (order == CblasRowMajor)
   {
      RowMajorStrg = 1;
      if (Uplo == CblasUpper) UL = 'L';
      else if (Uplo == CblasLower) UL = 'U';
      else
      {
         cblas_xerbla(2, "cblas_dtpsv","Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (TransA == CblasNoTrans) TA = 'T';
      else if (TransA == CblasTrans) TA = 'N';
      else if (TransA == CblasConjTrans) TA = 'N';
      else
      {
         cblas_xerbla(3, "cblas_dtpsv","Illegal TransA setting, %d\n", TransA);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (Diag == CblasUnit) DI = 'U';
      else if (Diag == CblasNonUnit) DI = 'N';
      else
      {
         cblas_xerbla(4, "cblas_dtpsv","Illegal Diag setting, %d\n", Diag);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      dtpsv_( &UL, &TA, &DI, &N, Ap, X,&incX);
   }
   else cblas_xerbla(1, "cblas_dtpsv", "Illegal Order setting, %d\n", order);
   CBLAS_CallFromC = 0;
   RowMajorStrg = 0;
   return;
}

variable_types: enum CBLAS_ORDER { CblasRowMajor=101, CblasColMajor=102 }

variable_types: enum CBLAS_UPLO { CblasUpper=121, CblasLower=122 }

variable_types: enum CBLAS_TRANSPOSE { CblasNoTrans=111, CblasTrans=112, CblasConjTrans=113 }

variable_types: enum CBLAS_DIAG { CblasNonUnit=131, CblasUnit=132 }

variable_types:
Ap
double *

variable_types: TA char

variable_types: UL char

variable_types: DI char

variable_types: RowMajorStrg int


parseargs

repo: ivartj/platformer

decompiled_code:
int __fastcall parseargs(int argc, char **argv)
{
int result; // eax

while ( 1 )
{
result = getopt_long(argc, argv, "h", &longopts_0, 0LL);
if ( result == -1 )
break;
if ( result == 104 )
{
usage(stdout);
exit(0);
}
if ( result <= 104 && (result == 58 || result == 63) )
goto LABEL_7;
}
if ( optind != argc )
{
LABEL_7:
usage(stderr);
exit(1);
}
return result;
}

canonical_decompiled_code:
int __fastcall func1(int argc, char **argv)
{
int result; // eax

while ( 1 )
{
result = getopt_long(argc, argv, "h", &longopts_0, 0LL);
if ( result == -1 )
break;
if ( result == 104 )
{
func0(stdout);
exit(0);
}
if ( result <= 104 && (result == 58 || result == 63) )
goto LABEL_7;
}
if ( optind != argc )
{
LABEL_7:
func0(stderr);
exit(1);
}
return result;
}

original_code:
void parseargs(int argc, char *argv[])
{
 int c;
 static struct option longopts[] = {
  { "help", 0, ((void *)0), 'h' },
  { 0, 0, 0, 0 },
 };
 while((c = getopt_long(argc, argv, "h", longopts, ((void *)0))) != -1)
 switch(c) {
 case 'h':
  usage(stdout);
  exit(0);
 case '?':
 case ':':
  usage(stderr);
  exit(1);
 }
 switch(argc - optind) {
 case 0:
  break;
 default:
  usage(stderr);
  exit(1);
 }
}

variable_types: argc int

variable_types:
argv
char *[]

variable_types: c int

variable_types: struct option { char *name; int has_arg; int *flag; int val; } []


init

decompiled_code:
void init()
{
int v0; // eax
const char *v1; // rdx
int v2; // eax
const char *v3; // rdx

if ( !(unsigned int)video_init(640LL, 480LL) )
{
if ( !(unsigned int)load_init() )
return;
LABEL_5:
v2 = geterrmsg();
error((int)"Failed to initialize image loading: %s", v2, v3);
return;
}
v0 = geterrmsg();
error((int)"Failed to initialize video: %s", v0, v1);
if ( (unsigned int)load_init() )
goto LABEL_5;
}

canonical_decompiled_code:
void func2()
{
int v0; // eax
const char *v1; // rdx
int v2; // eax
const char *v3; // rdx

if ( !(unsigned int)video_init(640LL, 480LL) )
{
if ( !(unsigned int)load_init() )
return;
LABEL_5:
v2 = geterrmsg();
error((int)"Failed to initialize image loading: %s", v2, v3);
return;
}
v0 = geterrmsg();
error((int)"Failed to initialize video: %s", v0, v1);
if ( (unsigned int)load_init() )
goto LABEL_5;
}

original_code:
void init(void)
{
 int err;
 err = video_init(640, 480);
 if(err)
  error("Failed to initialize video: %s", geterrmsg());
 err = load_init();
 if(err)
  error("Failed to initialize image loading: %s", geterrmsg());
}

canonical_original_code:
void init()
{
 int err;
 err = video_init(640, 480);
 if(err)
  error("Failed to initialize video: %s", geterrmsg());
 err = load_init();
 if(err)
  error("Failed to initialize image loading: %s", geterrmsg());
}

variable_types: err int


fail

decompiled_code:
void __noreturn fail()
{
exit(1);
}

canonical_decompiled_code:
void __noreturn func3()
{
exit(1);
}

original_code:
void fail(void)
{
 exit(1);
}

canonical_original_code:
void fail()
{
 exit(1);
}


quit

decompiled_code:
void __noreturn quit()
{
exit(0);
}

canonical_decompiled_code:
void __noreturn func4()
{
exit(0);
}

original_code:
void quit(void)
{
 exit(0);
}

canonical_original_code:
void quit()
{
 exit(0);
}


main

canonical_name: main

decompiled_code:
int __cdecl __noreturn main(int argc, const char **argv, const char **envp)
{
parseargs(argc, (char **)argv);
init();
quit();
}

canonical_decompiled_code:
int __cdecl __noreturn main(int argc, const char **argv, const char **envp)
{
func1(argc, (char **)argv);
func2();
func4();
}

original_code:
int main(int argc, char *argv[])
{
 parseargs(argc, argv);
 init();
 quit();
 return 0;
}

return_type: int


original_code:
uint64_t hash_create(unsigned char *data, size_t len)
{
 uint64_t hash;
 int hashlen;
 unsigned char *bytes;
 int i;
 hash = 0;
 hashlen = sizeof(hash);
 bytes = (unsigned char *)&hash;
 for(i = 0; i < len; i++)
  bytes[i % hashlen] ^= data[i];
 return hash;
}

canonical_original_code:
unsigned long hash_create(unsigned char *data, unsigned long len)
{
 unsigned long hash;
 int hashlen;
 unsigned char *bytes;
 int i;
 hash = 0;
 hashlen = sizeof(hash);
 bytes = (unsigned char *)&hash;
 for(i = 0; i < len; i++)
  bytes[i % hashlen] ^= data[i];
 return hash;
}

variable_types:
data
unsigned char *

variable_types:
len
unsigned long

variable_types:
hash
unsigned long

variable_types: hashlen int

variable_types:
bytes
unsigned char *

variable_types: i int

return_type: unsigned long


decompiled_code:
// attributes: thunk
void gfx_destroy(void *ptr)
{
free(ptr);
}

canonical_decompiled_code:
void func0(void *ptr)
{
free(ptr);
}

original_code:
void gfx_destroy(gfx *g)
{
 free(g);
}

canonical_original_code:
void gfx_destroy(struct _gfx *g)
{
 free(g);
}

variable_types: struct _gfx { struct _image { int w; unsigned int *pix; void *private; } *img; int x; unsigned int c; } *

user_defined_types: struct _gfx { struct _image *img; int x; unsigned int c; }


decompiled_code:
void __fastcall gfx_translate(__int64 a1, int a2, int a3)
{
*(_DWORD *)(a1 + 8) += a2;
*(_DWORD *)(a1 + 12) += a3;
}

original_code:
void gfx_translate(gfx *g, int x, int y)
{
 g->x += x;
 g->y += y;
}

canonical_original_code:
void gfx_translate(struct _gfx *g, int x, int y)
{
 g->x += x;
 g->y += y;
}

variable_types: x int

variable_types: y int

user_defined_types: struct _image { int w; unsigned int *pix; void *private; }


decompiled_code:
void __fastcall gfx_color(__int64 a1, int a2)
{
*(_DWORD *)(a1 + 16) = a2;
}

canonical_decompiled_code:
void __fastcall func2(__int64 a1, int a2)
{
*(_DWORD *)(a1 + 16) = a2;
}

original_code:
void gfx_color(gfx *g, color c)
{
 g->c = c;
}

canonical_original_code:
void gfx_color(struct _gfx *g, unsigned int c)
{
 g->c = c;
}

variable_types:
c
unsigned int


original_code:
void gfx_dot(gfx *g, int x, int y)
{
 int tx, ty;
 tx = x + g->x;
 ty = y + g->y;
 if(tx < 0 || tx >= g->img->w)
  return;
 if(ty < 0 || ty >= g->img->h)
  return;
 g->img->pix[tx + ty * g->img->w] = g->c;
}

canonical_original_code:
void gfx_dot(struct _gfx *g, int x, int y)
{
 int tx; int ty;
 tx = x + g->x;
 ty = y + g->y;
 if(tx < 0 || tx >= g->img->w)
  return;
 if(ty < 0 || ty >= g->img->h)
  return;
 g->img->pix[tx + ty * g->img->w] = g->c;
}

variable_types: tx int

variable_types: ty int


original_code:
void gfx_fill(gfx *g, rect *r)
{
 rect rr;
 memcpy(&rr, r, sizeof(rr));
 rr.x += g->x;
 rr.y += g->y;
 image_fill(g->img, &rr, g->c);
}

canonical_original_code:
void gfx_fill(struct _gfx *g, struct rect *r)
{
 struct rect rr;
 memcpy(&rr, r, sizeof(rr));
 rr.x += g->x;
 rr.y += g->y;
 image_fill(g->img, &rr, g->c);
}

variable_types:
r
struct rect { int x; } *

variable_types:
rr
struct rect { int x; }


original_code:
color gfx_get(gfx *g, int x, int y)
{
 x += g->x;
 y += g->y;
 if(x < 0 || x >= g->img->w)
  return 0;
 if(y < 0 || y >= g->img->h)
  return 0;
 return g->img->pix[x + g->img->w * y];
}

canonical_original_code:
unsigned int gfx_get(struct _gfx *g, int x, int y)
{
 x += g->x;
 y += g->y;
 if(x < 0 || x >= g->img->w)
  return 0;
 if(y < 0 || y >= g->img->h)
  return 0;
 return g->img->pix[x + g->img->w * y];
}

return_type: unsigned int


decompiled_code:
__int64 __fastcall gfx_blit(__int64 a1, __int64 a2, __int64 a3, int a4, int a5)
{
return blitrxy(
a2,
a3,
*(_QWORD *)a1,
(unsigned int)(*(_DWORD *)(a1 + 8) + a4),
(unsigned int)(*(_DWORD *)(a1 + 12) + a5));
}

canonical_decompiled_code:
__int64 __fastcall func6(__int64 a1, __int64 a2, __int64 a3, int a4, int a5)
{
return blitrxy(
a2,
a3,
*(_QWORD *)a1,
(unsigned int)(*(_DWORD *)(a1 + 8) + a4),
(unsigned int)(*(_DWORD *)(a1 + 12) + a5));
}

original_code:
void gfx_blit(gfx *g, image *img, rect *r, int x, int y)
{
 blitrxy(img, r, g->img, g->x + x, g->y + y);
}

canonical_original_code:
void gfx_blit(struct _gfx *g, struct _image *img, struct rect *r, int x, int y)
{
 blitrxy(img, r, g->img, g->x + x, g->y + y);
}

variable_types:
img
struct _image *


decompiled_code:
__int64 __fastcall dnode_iter_next(__int64 *a1, void *a2)
{
__int64 v2; // rax
const void *v4; // rsi

v2 = *a1;
if ( !*a1 )
return 0LL;
v4 = *(const void **)v2;
*a1 = *(_QWORD *)(v2 + 16);
memcpy(a2, v4, *(_QWORD *)(v2 + 8));
return 1LL;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 *a1, void *a2)
{
__int64 v2; // rax
const void *v4; // rsi

v2 = *a1;
if ( !*a1 )
return 0LL;
v4 = *(const void **)v2;
*a1 = *(_QWORD *)(v2 + 16);
memcpy(a2, v4, *(_QWORD *)(v2 + 8));
return 1LL;
}

original_code:
int dnode_iter_next(iter *i, void *retval)
{
 dnode *dn;
 dn = (dnode *)(i->data.v);
 if(dn == ((void *)0))
  return 0;
 i->data.v = dn->next;
 memcpy(retval, dn->data, dn->datalen);
 return 1;
}

canonical_original_code:
int dnode_iter_next(struct _iter *i, void *retval)
{
 struct _dnode *dn;
 dn = (struct _dnode *)(i->data.v);
 if(dn == ((void *)0))
  return 0;
 i->data.v = dn->next;
 memcpy(retval, dn->data, dn->datalen);
 return 1;
}

variable_types: struct _iter { union _data { void *v; int i; double d; } data; int (*next)(struct _iter *i, void *retval); } *

variable_types:
retval
void *

variable_types: struct _dnode { void *data; unsigned long datalen; struct _dnode *next; struct _dnode *prev; struct _dlist { struct _dnode *first; struct _dnode *last; } *list; } *

user_defined_types: struct _iter { union _data data; int (*next)(struct _iter *i, void *retval); }

user_defined_types: struct _dnode { void *data; unsigned long datalen; struct _dnode *next; struct _dnode *prev; struct _dlist *list; }


decompiled_code:
void *dlist_create()
{
return calloc(1uLL, 0x10uLL);
}

canonical_decompiled_code:
void *func1()
{
return calloc(1uLL, 0x10uLL);
}

original_code:
dlist *dlist_create(void)
{
 dlist *dl;
 dl = calloc(1, sizeof(dlist));
 return dl;
}

canonical_original_code:
struct _dlist *dlist_create()
{
 struct _dlist *dl;
 dl = calloc(1, sizeof(dlist));
 return dl;
}

variable_types: struct _dlist { struct _dnode { void *data; unsigned long datalen; struct _dnode *next; struct _dnode *prev; struct _dlist *list; } *first; struct _dnode *last; } *

user_defined_types: struct _dlist { struct _dnode *first; struct _dnode *last; }


decompiled_code:
__int64 __fastcall dnode_next(__int64 a1)
{
return *(_QWORD *)(a1 + 16);
}

canonical_decompiled_code:
__int64 __fastcall func3(__int64 a1)
{
return *(_QWORD *)(a1 + 16);
}

original_code:
dnode *dnode_next(dnode *dn)
{
 return dn->next;
}

canonical_original_code:
struct _dnode *dnode_next(struct _dnode *dn)
{
 return dn->next;
}

variable_types:
dn
struct _dnode *

return_type: struct _dnode { void *data; unsigned long datalen; struct _dnode *next; struct _dnode *prev; struct _dlist { struct _dnode *first; struct _dnode *last; } *list; } *


decompiled_code:
__int64 __fastcall dnode_prev(__int64 a1)
{
return *(_QWORD *)(a1 + 24);
}

canonical_decompiled_code:
__int64 __fastcall func4(__int64 a1)
{
return *(_QWORD *)(a1 + 24);
}

original_code:
dnode *dnode_prev(dnode *dn)
{
 return dn->prev;
}

canonical_original_code:
struct _dnode *dnode_prev(struct _dnode *dn)
{
 return dn->prev;
}


decompiled_code:
__int64 __fastcall dlist_last(__int64 a1)
{
return *(_QWORD *)(a1 + 8);
}

canonical_decompiled_code:
__int64 __fastcall func5(__int64 a1)
{
return *(_QWORD *)(a1 + 8);
}

original_code:
dnode *dlist_last(dlist *dl)
{
 return dl->last;
}

canonical_original_code:
struct _dnode *dlist_last(struct _dlist *dl)
{
 return dl->last;
}

variable_types:
dl
struct _dlist *


decompiled_code:
__int64 __fastcall dlist_first(__int64 a1)
{
return *(_QWORD *)a1;
}

canonical_decompiled_code:
__int64 __fastcall func6(__int64 a1)
{
return *(_QWORD *)a1;
}

original_code:
dnode *dlist_first(dlist *dl)
{
 return dl->first;
}

canonical_original_code:
struct _dnode *dlist_first(struct _dlist *dl)
{
 return dl->first;
}


decompiled_code:
void __fastcall dnode_rem(void *ptr)
{
__int64 v1; // rax
__int64 v2; // rdx

v1 = *((_QWORD *)ptr + 3);
v2 = *((_QWORD *)ptr + 2);
if ( !v1 )
{
**((_QWORD **)ptr + 4) = v2;
if ( v2 )
goto LABEL_3;
LABEL_6:
*(_QWORD *)(*((_QWORD *)ptr + 4) + 8LL) = v1;
goto LABEL_4;
}
*(_QWORD *)(v1 + 16) = v2;
if ( !v2 )
goto LABEL_6;
LABEL_3:
*(_QWORD *)(v2 + 24) = v1;
LABEL_4:
free(*(void **)ptr);
free(ptr);
}

canonical_decompiled_code:
void __fastcall func7(void *ptr)
{
__int64 v1; // rax
__int64 v2; // rdx

v1 = *((_QWORD *)ptr + 3);
v2 = *((_QWORD *)ptr + 2);
if ( !v1 )
{
**((_QWORD **)ptr + 4) = v2;
if ( v2 )
goto LABEL_3;
LABEL_6:
*(_QWORD *)(*((_QWORD *)ptr + 4) + 8LL) = v1;
goto LABEL_4;
}
*(_QWORD *)(v1 + 16) = v2;
if ( !v2 )
goto LABEL_6;
LABEL_3:
*(_QWORD *)(v2 + 24) = v1;
LABEL_4:
free(*(void **)ptr);
free(ptr);
}

original_code:
void dnode_rem(dnode *dn)
{
 if(dn->prev != ((void *)0))
  dn->prev->next = dn->next;
 else
  dn->list->first = dn->next;
 if(dn->next != ((void *)0))
  dn->next->prev = dn->prev;
 else
  dn->list->last = dn->prev;
 free(dn->data);
 free(dn);
}

canonical_original_code:
void dnode_rem(struct _dnode *dn)
{
 if(dn->prev != ((void *)0))
  dn->prev->next = dn->next;
 else
  dn->list->first = dn->next;
 if(dn->next != ((void *)0))
  dn->next->prev = dn->prev;
 else
  dn->list->last = dn->prev;
 free(dn->data);
 free(dn);
}


decompiled_code:
_BOOL8 __fastcall dlist_iter(__int64 *a1, _QWORD *a2)
{
__int64 v2; // rax

v2 = *a1;
a2[1] = dnode_iter_next;
*a2 = v2;
return v2 != 0;
}

canonical_decompiled_code:
_BOOL8 __fastcall func8(__int64 *a1, _QWORD *a2)
{
__int64 v2; // rax

v2 = *a1;
a2[1] = dnode_iter_next;
*a2 = v2;
return v2 != 0;
}

original_code:
int dlist_iter(dlist *dl, iter *i)
{
 i->data.v = dl->first;
 i->next = dnode_iter_next;
 return dl->first != ((void *)0);
}

canonical_original_code:
int dlist_iter(struct _dlist *dl, struct _iter *i)
{
 i->data.v = dl->first;
 i->next = dnode_iter_next;
 return dl->first != ((void *)0);
}

user_defined_types: union _data { void *v; int i; double d; }


decompiled_code:
// attributes: thunk
__int64 thread_sleep()
{
return SDL_Delay();
}

canonical_decompiled_code:
__int64 func0()
{
return SDL_Delay();
}

original_code:
void thread_sleep(int ms)
{
 SDL_Delay(ms);
}

variable_types: ms int


vwarning

decompiled_code:
size_t __fastcall vwarning(char *format, __gnuc_va_list arg)
{
vfprintf(stderr, format, arg);
return fwrite(&unk_3E0, 1uLL, 2uLL, stderr);
}

canonical_decompiled_code:
size_t __fastcall func0(char *format, __gnuc_va_list arg)
{
vfprintf(stderr, format, arg);
return fwrite(&unk_3E0, 1uLL, 2uLL, stderr);
}

original_code:
void vwarning(const char *fmt, va_list ap)
{
 vfprintf(stderr, fmt, ap);
 fprintf(stderr, ".\n");
}

canonical_original_code:
void vwarning(char *fmt, __builtin_va_list ap)
{
 vfprintf(stderr, fmt, ap);
 fprintf(stderr, ".\n");
}

variable_types:
fmt
char *


geterrmsg

decompiled_code:
void *geterrmsg()
{
return &errmsg;
}

canonical_decompiled_code:
void *func1()
{
return &errmsg;
}

original_code:
char *geterrmsg(void)
{
 return errmsg;
}

canonical_original_code:
char *geterrmsg()
{
 return errmsg;
}

return_type: char *


seterrmsg

original_code:
int seterrmsg(const char *fmt, ...)
{
 va_list ap;
 int len;
 char bakmsg[sizeof(errmsg)] = { 0 };
 __builtin_va_start(ap,fmt);
 len = vsnprintf(bakmsg, sizeof(errmsg), fmt, ap);
 memcpy(errmsg, bakmsg, len + 1);
 __builtin_va_end(ap);
 return -1;
}

canonical_original_code:
int seterrmsg(char *fmt, ...)
{
 __builtin_va_list ap;
 int len;
 char bakmsg[-1] = { 0 };
 __builtin_va_start(ap,fmt);
 len = vsnprintf(bakmsg, sizeof(errmsg), fmt, ap);
 memcpy(errmsg, bakmsg, len + 1);
 __builtin_va_end(ap);
 return -1;
}

variable_types: len int

variable_types:
bakmsg
char [-1]


error

decompiled_code:
void __noreturn error(char *a1, ...)
{
gcc_va_list arg; // [rsp+8h] [rbp-D0h] BYREF

va_start(arg, a1);
vwarning(a1, arg);
exit(1);
}

canonical_decompiled_code:
void __noreturn func3(char *a1, ...)
{
gcc_va_list arg; // [rsp+8h] [rbp-D0h] BYREF

va_start(arg, a1);
func0(a1, arg);
exit(1);
}

original_code:
void error(const char *fmt, ...)
{
 va_list ap;
 __builtin_va_start(ap,fmt);
 vwarning(fmt, ap);
 __builtin_va_end(ap);
 exit(1);
}

canonical_original_code:
void error(char *fmt, ...)
{
 __builtin_va_list ap;
 __builtin_va_start(ap,fmt);
 vwarning(fmt, ap);
 __builtin_va_end(ap);
 exit(1);
}


warning

decompiled_code:
size_t warning(char *a1, ...)
{
gcc_va_list arg; // [rsp+8h] [rbp-D0h] BYREF

va_start(arg, a1);
return vwarning(a1, arg);
}

canonical_decompiled_code:
size_t func4(char *a1, ...)
{
gcc_va_list arg; // [rsp+8h] [rbp-D0h] BYREF

va_start(arg, a1);
return func0(a1, arg);
}

original_code:
void warning(const char *fmt, ...)
{
 va_list ap;
 __builtin_va_start(ap,fmt);
 vwarning(fmt, ap);
 __builtin_va_end(ap);
}

canonical_original_code:
void warning(char *fmt, ...)
{
 __builtin_va_list ap;
 __builtin_va_start(ap,fmt);
 vwarning(fmt, ap);
 __builtin_va_end(ap);
}


decompiled_code:
__int64 seterrmsg_freeimage()
{
return seterrmsg(&unk_1A8);
}

canonical_decompiled_code:
__int64 func0()
{
return seterrmsg(&unk_1A8);
}

original_code:
static void seterrmsg_freeimage(FREE_IMAGE_FORMAT fif, const char *message)
{
 seterrmsg("%s", message);
}

canonical_original_code:
static void seterrmsg_freeimage(int fif, char *message)
{
 seterrmsg("%s", message);
}

variable_types: fif int

variable_types:
message
char *


decompiled_code:
__int64 load_init()
{
FreeImage_Initialise(0LL);
atexit((void (*)(void))&FreeImage_DeInitialise);
FreeImage_SetOutputMessage(seterrmsg_freeimage);
return 0LL;
}

canonical_decompiled_code:
__int64 func1()
{
FreeImage_Initialise(0LL);
atexit((void (*)(void))&FreeImage_DeInitialise);
FreeImage_SetOutputMessage(seterrmsg_freeimage);
return 0LL;
}

original_code:
int load_init(void)
{
 FreeImage_Initialise(0);
 atexit(FreeImage_DeInitialise);
 FreeImage_SetOutputMessage(seterrmsg_freeimage);
 return 0;
}

canonical_original_code:
int load_init()
{
 FreeImage_Initialise(0);
 atexit(FreeImage_DeInitialise);
 FreeImage_SetOutputMessage(seterrmsg_freeimage);
 return 0;
}