original_code:
void cblas_zgbmv(const enum CBLAS_ORDER order,
                 const enum CBLAS_TRANSPOSE TransA, const int M, const int N,
                 const int KL, const int KU,
                 const void *alpha, const void *A, const int lda,
                 const void *X, const int incX, const void *beta,
                 void *Y, const int incY)
{
   char TA;
   int n, i=0, incx=incX;
   const double *xx= (double *)X, *alp= (double *)alpha, *bet = (double *)beta;
   double ALPHA[2],BETA[2];
   int tincY, tincx;
   double *x=(double *)X, *y=(double *)Y, *st=0, *tx;
   extern int CBLAS_CallFromC;
   extern int RowMajorStrg;
   RowMajorStrg = 0;
   CBLAS_CallFromC = 1;
   if (order == CblasColMajor)
   {
      if (TransA == CblasNoTrans) TA = 'N';
      else if (TransA == CblasTrans) TA = 'T';
      else if (TransA == CblasConjTrans) TA = 'C';
      else
      {
         cblas_xerbla(2, "cblas_zgbmv","Illegal TransA setting, %d\n", TransA);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      zgbmv_(&TA, &M, &N, &KL, &KU, alpha,
                     A, &lda, X, &incx, beta, Y, &incY);
   }
   else if (order == CblasRowMajor)
   {
      RowMajorStrg = 1;
      if (TransA == CblasNoTrans) TA = 'T';
      else if (TransA == CblasTrans) TA = 'N';
      else if (TransA == CblasConjTrans)
      {
         ALPHA[0]= *alp;
         ALPHA[1]= -alp[1];
         BETA[0]= *bet;
         BETA[1]= -bet[1];
         TA = 'N';
         if (M > 0)
         {
            n = M << 1;
            x = malloc(n*sizeof(double));
            tx = x;
            if( incX > 0 ) {
               i = incX << 1 ;
               tincx = 2;
               st= x+n;
            } else {
               i = incX *(-2);
               tincx = -2;
               st = x-2;
               x +=(n-2);
            }
            do
            {
               *x = *xx;
               x[1] = -xx[1];
               x += tincx ;
               xx += i;
            }
            while (x != st);
            x=tx;
               incx = 1;
            if( incY > 0 )
              tincY = incY;
            else
              tincY = -incY;
            y++;
            if (N > 0)
            {
               i = tincY << 1;
               n = i * N ;
               st = y + n;
               do {
                  *y = -(*y);
                  y += i;
               } while(y != st);
               y -= n;
            }
         }
         else x = (double *) X;
      }
      else
      {
         cblas_xerbla(2, "cblas_zgbmv","Illegal TransA setting, %d\n", TransA);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (TransA == CblasConjTrans)
         zgbmv_(&TA, &N, &M, &KU, &KL, ALPHA,
                        A ,&lda, x,&incx, BETA, Y, &incY);
      else
         zgbmv_(&TA, &N, &M, &KU, &KL, alpha,
                        A ,&lda, x,&incx, beta, Y, &incY);
      if (TransA == CblasConjTrans)
      {
         if (x != X) free(x);
         if (N > 0)
         {
            do
            {
               *y = -(*y);
               y += i;
            }
            while (y != st);
         }
      }
   }
   else cblas_xerbla(1, "cblas_zgbmv", "Illegal Order setting, %d\n", order);
   CBLAS_CallFromC = 0;
   RowMajorStrg = 0;
   return;
}

canonical_original_code:
void cblas_zgbmv(enum CBLAS_ORDER order, enum CBLAS_TRANSPOSE TransA, int M, int N, int KL, int KU, void *alpha, void *A, int lda, void *X, int incX, void *beta, void *Y, int incY)
{
   char TA;
   int n; int i = 0; int incx = incX;
   double *xx = (double *)X; double *alp = (double *)alpha; double *bet = (double *)beta;
   double ALPHA[2]; double BETA[2];
   int tincY; int tincx;
   double *x = (double *)X; double *y = (double *)Y; double *st = 0; double *tx;
   extern int CBLAS_CallFromC;
   extern int RowMajorStrg;
   RowMajorStrg = 0;
   CBLAS_CallFromC = 1;
   if (order == CblasColMajor)
   {
      if (TransA == CblasNoTrans) TA = 'N';
      else if (TransA == CblasTrans) TA = 'T';
      else if (TransA == CblasConjTrans) TA = 'C';
      else
      {
         cblas_xerbla(2, "cblas_zgbmv","Illegal TransA setting, %d\n", TransA);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      zgbmv_(&TA, &M, &N, &KL, &KU, alpha,
                     A, &lda, X, &incx, beta, Y, &incY);
   }
   else if (order == CblasRowMajor)
   {
      RowMajorStrg = 1;
      if (TransA == CblasNoTrans) TA = 'T';
      else if (TransA == CblasTrans) TA = 'N';
      else if (TransA == CblasConjTrans)
      {
         ALPHA[0]= *alp;
         ALPHA[1]= -alp[1];
         BETA[0]= *bet;
         BETA[1]= -bet[1];
         TA = 'N';
         if (M > 0)
         {
            n = M << 1;
            x = malloc(n*sizeof(double));
            tx = x;
            if( incX > 0 ) {
               i = incX << 1 ;
               tincx = 2;
               st= x+n;
            } else {
               i = incX *(-2);
               tincx = -2;
               st = x-2;
               x +=(n-2);
            }
            do
            {
               *x = *xx;
               x[1] = -xx[1];
               x += tincx ;
               xx += i;
            }
            while (x != st);
            x=tx;
               incx = 1;
            if( incY > 0 )
              tincY = incY;
            else
              tincY = -incY;
            y++;
            if (N > 0)
            {
               i = tincY << 1;
               n = i * N ;
               st = y + n;
               do {
                  *y = -(*y);
                  y += i;
               } while(y != st);
               y -= n;
            }
         }
         else x = (double *) X;
      }
      else
      {
         cblas_xerbla(2, "cblas_zgbmv","Illegal TransA setting, %d\n", TransA);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if (TransA == CblasConjTrans)
         zgbmv_(&TA, &N, &M, &KU, &KL, ALPHA,
                        A ,&lda, x,&incx, BETA, Y, &incY);
      else
         zgbmv_(&TA, &N, &M, &KU, &KL, alpha,
                        A ,&lda, x,&incx, beta, Y, &incY);
      if (TransA == CblasConjTrans)
      {
         if (x != X) free(x);
         if (N > 0)
         {
            do
            {
               *y = -(*y);
               y += i;
            }
            while (y != st);
         }
      }
   }
   else cblas_xerbla(1, "cblas_zgbmv", "Illegal Order setting, %d\n", order);
   CBLAS_CallFromC = 0;
   RowMajorStrg = 0;
   return;
}

variable_types: M int

variable_types: N int

variable_types: KL int

variable_types: KU int

variable_types:
alpha
void *

variable_types:
A
void *

variable_types: lda int

variable_types:
X
void *

variable_types:
beta
void *

variable_types:
Y
void *

variable_types: incY int

variable_types: TA char

variable_types: n int

variable_types: i int

variable_types: incx int

variable_types:
xx
double *

variable_types:
alp
double *

variable_types:
bet
double *

variable_types:
ALPHA
double [2]

variable_types:
BETA
double [2]

variable_types: tincY int

variable_types: tincx int

variable_types:
x
double *

variable_types:
y
double *

variable_types:
st
double *

variable_types:
tx
double *

variable_types: RowMajorStrg int


repo: ivanjimenez/ipaap

decompiled_code:
__int64 __fastcall cblas_ztrmm(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_ztrmm", "Illegal Diag setting, %d\n", a5);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
v17[0] = 78;
}
result = ztrmm_(&v16, &v14, &v15, v17, v13, &a7, a8, a9, &a10, a11, &a12);
goto LABEL_18;
}
if ( a1 != 101 )
{
result = cblas_xerbla(1LL, "cblas_ztrmm", "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_ztrmm", "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_ztrmm", "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 = ztrmm_(&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_ztrmm", "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_ztrmm", "Illegal Diag setting, %d\n", a5);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
v17[0] = 78;
}
result = ztrmm_(&v16, &v14, &v15, v17, v13, &a7, a8, a9, &a10, a11, &a12);
goto LABEL_18;
}
if ( a1 != 101 )
{
result = cblas_xerbla(1LL, "cblas_ztrmm", "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_ztrmm", "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_ztrmm", "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 = ztrmm_(&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_ztrmm", "Illegal Trans setting, %d\n", a4);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}

original_code:
void cblas_ztrmm(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_ztrmm", "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_ztrmm", "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_ztrmm", "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_ztrmm", "Illegal Diag setting, %d\n", Diag);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      ztrmm_(&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_ztrmm", "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_ztrmm", "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_ztrmm", "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_ztrmm", "Illegal Diag setting, %d\n", Diag);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      ztrmm_(&SD, &UL, &TA, &DI, &N, &M, alpha, A, &lda, B, &ldb);
   }
   else cblas_xerbla(1, "cblas_ztrmm", "Illegal Order setting, %d\n", Order);
   CBLAS_CallFromC = 0;
   RowMajorStrg = 0;
   return;
}

canonical_original_code:
void cblas_ztrmm(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_ztrmm", "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_ztrmm", "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_ztrmm", "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_ztrmm", "Illegal Diag setting, %d\n", Diag);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      ztrmm_(&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_ztrmm", "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_ztrmm", "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_ztrmm", "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_ztrmm", "Illegal Diag setting, %d\n", Diag);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      ztrmm_(&SD, &UL, &TA, &DI, &N, &M, alpha, A, &lda, B, &ldb);
   }
   else cblas_xerbla(1, "cblas_ztrmm", "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: enum CBLAS_DIAG { CblasNonUnit=131, CblasUnit=132 }

variable_types: M int

variable_types: N int

variable_types:
alpha
void *

variable_types:
A
void *

variable_types: lda int

variable_types:
B
void *

variable_types: ldb int

variable_types: UL char

variable_types: SD char

variable_types: DI char

return_type: void


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

RowMajorStrg = 0;
v19[0] = a4;
v18 = a5;
v17 = a6;
CBLAS_CallFromC = 1;
v16 = a7;
v15 = a8;
if ( a1 != 102 )
{
if ( a1 != 101 )
{
result = cblas_xerbla(1LL, "cblas_dgemm", "Illegal Order setting, %d\n", a1);
goto LABEL_13;
}
RowMajorStrg = 1;
switch ( a2 )
{
case 'p':
v21[0] = 84;
goto LABEL_7;
case 'q':
v21[0] = 67;
goto LABEL_7;
case 'o':
v21[0] = 78;
LABEL_7:
switch ( a3 )
{
case 'p':
v20 = 84;
goto LABEL_11;
case 'q':
v20 = 67;
goto LABEL_11;
case 'o':
v20 = 78;
LABEL_11:
result = dgemm_(&v20, v21, &v18, v19, &v17, &v16, a11, &a12, a9, &a10, &v15, a13, &a14);
LABEL_13:
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
result = cblas_xerbla(2LL, "cblas_dgemm", "Illegal TransB setting, %d\n", a3);
goto LABEL_30;
}
LABEL_29:
result = cblas_xerbla(2LL, "cblas_dgemm", "Illegal TransA setting, %d\n", a2);
LABEL_30:
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
switch ( a2 )
{
case 'p':
v20 = 84;
break;
case 'q':
v20 = 67;
break;
case 'o':
v20 = 78;
break;
default:
goto LABEL_29;
}
switch ( a3 )
{
case 'p':
v21[0] = 84;
goto LABEL_22;
case 'q':
v21[0] = 67;
goto LABEL_22;
case 'o':
v21[0] = 78;
LABEL_22:
result = dgemm_(&v20, v21, v19, &v18, &v17, &v16, a9, &a10, a11, &a12, &v15, a13, &a14);
goto LABEL_13;
}
result = cblas_xerbla(3LL, "cblas_dgemm", "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, double a7, double a8, __int64 a9, char a10, __int64 a11, char a12, __int64 a13, char a14)
{
__int64 result; // rax
double v15; // [rsp+0h] [rbp-38h] BYREF
double v16; // [rsp+8h] [rbp-30h] BYREF
int v17; // [rsp+14h] [rbp-24h] BYREF
int v18; // [rsp+18h] [rbp-20h] BYREF
int v19[4]; // [rsp+1Ch] [rbp-1Ch] BYREF
char v20; // [rsp+2Eh] [rbp-Ah] BYREF
char v21[9]; // [rsp+2Fh] [rbp-9h] BYREF

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

original_code:
void cblas_dgemm(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 double alpha, const double *A,
                 const int lda, const double *B, const int ldb,
                 const double beta, double *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_dgemm","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_dgemm","Illegal TransB setting, %d\n", TransB);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      dgemm_(&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_dgemm","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_dgemm","Illegal TransB setting, %d\n", TransB);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      dgemm_(&TA, &TB, &N, &M, &K, &alpha, B,
                  &ldb, A, &lda, &beta, C, &ldc);
   }
   else cblas_xerbla(1, "cblas_dgemm", "Illegal Order setting, %d\n", Order);
   CBLAS_CallFromC = 0;
   RowMajorStrg = 0;
   return;
}

canonical_original_code:
void cblas_dgemm(enum CBLAS_ORDER Order, enum CBLAS_TRANSPOSE TransA, enum CBLAS_TRANSPOSE TransB, int M, int N, int K, double alpha, double *A, int lda, double *B, int ldb, double beta, double *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_dgemm","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_dgemm","Illegal TransB setting, %d\n", TransB);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      dgemm_(&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_dgemm","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_dgemm","Illegal TransB setting, %d\n", TransB);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      dgemm_(&TA, &TB, &N, &M, &K, &alpha, B,
                  &ldb, A, &lda, &beta, C, &ldc);
   }
   else cblas_xerbla(1, "cblas_dgemm", "Illegal Order setting, %d\n", Order);
   CBLAS_CallFromC = 0;
   RowMajorStrg = 0;
   return;
}

variable_types: K int

variable_types: alpha double

variable_types:
A
double *

variable_types:
B
double *

variable_types: beta double

variable_types:
C
double *

variable_types: ldc int

variable_types: TA char

variable_types: TB char

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

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


decompiled_code:
__int64 __fastcall cblas_ssbmv(unsigned int a1, unsigned int a2, int a3, int a4, __int64 a5, int a6, float a7, float a8, __int64 a9, char a10, __int64 a11, char a12)
{
__int64 result; // rax
float v13; // [rsp+Ch] [rbp-2Ch] BYREF
int v14; // [rsp+10h] [rbp-28h] BYREF
float v15; // [rsp+14h] [rbp-24h] BYREF
int v16; // [rsp+18h] [rbp-20h] BYREF
int v17[4]; // [rsp+1Ch] [rbp-1Ch] BYREF
char v18[9]; // [rsp+2Fh] [rbp-9h] BYREF

RowMajorStrg = 0;
v17[0] = a3;
v16 = a4;
v14 = a6;
CBLAS_CallFromC = 1;
v15 = a7;
v13 = a8;
if ( a1 != 102 )
{
if ( a1 != 101 )
{
result = cblas_xerbla(1LL, "cblas_ssbmv", "Illegal Order setting, %d\n", a1);
goto LABEL_8;
}
RowMajorStrg = 1;
if ( a2 != 121 )
{
if ( a2 == 122 )
{
LABEL_5:
v18[0] = 85;
LABEL_6:
result = ssbmv_(v18, v17, &v16, &v15, a5, &v14, a9, &a10, &v13, a11, &a12);
LABEL_8:
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
goto LABEL_12;
}
LABEL_11:
v18[0] = 76;
goto LABEL_6;
}
if ( a2 == 121 )
goto LABEL_5;
if ( a2 == 122 )
goto LABEL_11;
LABEL_12:
result = cblas_xerbla(2LL, "cblas_ssbmv", "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, int a4, __int64 a5, int a6, float a7, float a8, __int64 a9, char a10, __int64 a11, char a12)
{
__int64 result; // rax
float v13; // [rsp+Ch] [rbp-2Ch] BYREF
int v14; // [rsp+10h] [rbp-28h] BYREF
float v15; // [rsp+14h] [rbp-24h] BYREF
int v16; // [rsp+18h] [rbp-20h] BYREF
int v17[4]; // [rsp+1Ch] [rbp-1Ch] BYREF
char v18[9]; // [rsp+2Fh] [rbp-9h] BYREF

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

original_code:
void cblas_ssbmv(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo,
           const int N, const int K, const float alpha, const float *A,
           const int lda, 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_ssbmv","Illegal Uplo setting, %d\n",Uplo );
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      ssbmv_(&UL, &N, &K, &alpha, A, &lda, 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_ssbmv","Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      ssbmv_(&UL, &N, &K, &alpha, A, &lda, X,
      &incX, &beta, Y, &incY);
   }
   else cblas_xerbla(1, "cblas_ssbmv", "Illegal Order setting, %d\n", order);
   CBLAS_CallFromC = 0;
   RowMajorStrg = 0;
   return;
}

canonical_original_code:
void cblas_ssbmv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, int N, int K, float alpha, float *A, int lda, 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_ssbmv","Illegal Uplo setting, %d\n",Uplo );
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      ssbmv_(&UL, &N, &K, &alpha, A, &lda, 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_ssbmv","Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      ssbmv_(&UL, &N, &K, &alpha, A, &lda, X,
      &incX, &beta, Y, &incY);
   }
   else cblas_xerbla(1, "cblas_ssbmv", "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: N int

variable_types: alpha float

variable_types:
A
float *

variable_types:
X
float *

variable_types: incX int

variable_types: beta float

variable_types:
Y
float *

variable_types: incY int

variable_types: RowMajorStrg int


decompiled_code:
__int64 __fastcall cblas_stpmv(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_stpmv", "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_stpmv", "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_stpmv", "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:
stpmv_(&v12, &v11, v13, v10, a6, a7, &a8);
result = v9;
goto LABEL_10;
}
result = cblas_xerbla(4LL, "cblas_stpmv", "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_stpmv", "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_stpmv", "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_stpmv", "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:
stpmv_(&v12, &v11, v13, v10, a6, a7, &a8);
result = v9;
goto LABEL_10;
}
result = cblas_xerbla(4LL, "cblas_stpmv", "Illegal Diag setting, %d\n", a4);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}

original_code:
void cblas_stpmv(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo,
                 const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag,
                 const int N, const float *Ap, float *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_stpmv","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_stpmv","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_stpmv","Illegal Diag setting, %d\n", Diag);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      stpmv_( &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_stpmv","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_stpmv","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_stpmv","Illegal Diag setting, %d\n", Diag);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      stpmv_( &UL, &TA, &DI, &N, Ap, X,&incX);
   }
   else cblas_xerbla(1, "cblas_stpmv", "Illegal Order setting, %d\n", order);
   CBLAS_CallFromC = 0;
   RowMajorStrg = 0;
   return;
}

canonical_original_code:
void cblas_stpmv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA, enum CBLAS_DIAG Diag, int N, float *Ap, float *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_stpmv","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_stpmv","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_stpmv","Illegal Diag setting, %d\n", Diag);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      stpmv_( &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_stpmv","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_stpmv","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_stpmv","Illegal Diag setting, %d\n", Diag);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      stpmv_( &UL, &TA, &DI, &N, Ap, X,&incX);
   }
   else cblas_xerbla(1, "cblas_stpmv", "Illegal Order setting, %d\n", order);
   CBLAS_CallFromC = 0;
   RowMajorStrg = 0;
   return;
}

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

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

variable_types:
Ap
float *

variable_types: UL char

variable_types: DI char

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


decompiled_code:
__int64 __fastcall cblas_dspr(unsigned int a1, unsigned int a2, int a3, __int64 a4, int a5, double a6)
{
__int64 result; // rax
double v7; // [rsp+0h] [rbp-28h] BYREF
int v8; // [rsp+8h] [rbp-20h] BYREF
int v9[4]; // [rsp+Ch] [rbp-1Ch] BYREF
char v10[9]; // [rsp+1Fh] [rbp-9h] BYREF

RowMajorStrg = 0;
v9[0] = a3;
v8 = a5;
CBLAS_CallFromC = 1;
v7 = a6;
if ( a1 != 102 )
{
if ( a1 != 101 )
{
result = cblas_xerbla(1LL, "cblas_dspr", "Illegal Order setting, %d\n", a1);
goto LABEL_8;
}
RowMajorStrg = 1;
if ( a2 != 122 )
{
if ( a2 == 121 )
{
LABEL_5:
v10[0] = 76;
LABEL_6:
result = dspr_(v10, v9, &v7, a4, &v8);
LABEL_8:
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
goto LABEL_12;
}
LABEL_11:
v10[0] = 85;
goto LABEL_6;
}
if ( a2 == 122 )
goto LABEL_5;
if ( a2 == 121 )
goto LABEL_11;
LABEL_12:
result = cblas_xerbla(2LL, "cblas_dspr", "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, int a5, double a6)
{
__int64 result; // rax
double v7; // [rsp+0h] [rbp-28h] BYREF
int v8; // [rsp+8h] [rbp-20h] BYREF
int v9[4]; // [rsp+Ch] [rbp-1Ch] BYREF
char v10[9]; // [rsp+1Fh] [rbp-9h] BYREF

RowMajorStrg = 0;
v9[0] = a3;
v8 = a5;
CBLAS_CallFromC = 1;
v7 = a6;
if ( a1 != 102 )
{
if ( a1 != 101 )
{
result = cblas_xerbla(1LL, "cblas_dspr", "Illegal Order setting, %d\n", a1);
goto LABEL_8;
}
RowMajorStrg = 1;
if ( a2 != 122 )
{
if ( a2 == 121 )
{
LABEL_5:
v10[0] = 76;
LABEL_6:
result = dspr_(v10, v9, &v7, a4, &v8);
LABEL_8:
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
goto LABEL_12;
}
LABEL_11:
v10[0] = 85;
goto LABEL_6;
}
if ( a2 == 122 )
goto LABEL_5;
if ( a2 == 121 )
goto LABEL_11;
LABEL_12:
result = cblas_xerbla(2LL, "cblas_dspr", "Illegal Uplo setting, %d\n", a2);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}

original_code:
void cblas_dspr(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo,
                const int N, const double alpha, const double *X,
                const int incX, double *Ap)
{
   char UL;
   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_dspr","Illegal Uplo setting, %d\n",Uplo );
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      dspr_(&UL, &N, &alpha, X, &incX, Ap);
   } else if (order == CblasRowMajor)
   {
      RowMajorStrg = 1;
      if (Uplo == CblasLower) UL = 'U';
      else if (Uplo == CblasUpper) UL = 'L';
      else
      {
         cblas_xerbla(2, "cblas_dspr","Illegal Uplo setting, %d\n",Uplo );
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      dspr_(&UL, &N, &alpha, X, &incX, Ap);
   } else cblas_xerbla(1, "cblas_dspr", "Illegal Order setting, %d\n", order);
   CBLAS_CallFromC = 0;
   RowMajorStrg = 0;
   return;
}

canonical_original_code:
void cblas_dspr(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, int N, double alpha, double *X, int incX, double *Ap)
{
   char UL;
   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_dspr","Illegal Uplo setting, %d\n",Uplo );
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      dspr_(&UL, &N, &alpha, X, &incX, Ap);
   } else if (order == CblasRowMajor)
   {
      RowMajorStrg = 1;
      if (Uplo == CblasLower) UL = 'U';
      else if (Uplo == CblasUpper) UL = 'L';
      else
      {
         cblas_xerbla(2, "cblas_dspr","Illegal Uplo setting, %d\n",Uplo );
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      dspr_(&UL, &N, &alpha, X, &incX, Ap);
   } else cblas_xerbla(1, "cblas_dspr", "Illegal Order setting, %d\n", order);
   CBLAS_CallFromC = 0;
   RowMajorStrg = 0;
   return;
}

variable_types: alpha double

variable_types:
X
double *

variable_types:
Ap
double *


decompiled_code:
__int64 __fastcall cblas_dsymv(unsigned int a1, unsigned int a2, int a3, __int64 a4, int a5, double a6)
{
__int64 result; // rax
double v7; // [rsp+10h] [rbp-28h] BYREF
int v8; // [rsp+18h] [rbp-20h] BYREF
int v9[4]; // [rsp+1Ch] [rbp-1Ch] BYREF
char v10[9]; // [rsp+2Fh] [rbp-9h] BYREF

RowMajorStrg = 0;
v9[0] = a3;
v8 = a5;
CBLAS_CallFromC = 1;
v7 = a6;
if ( a1 != 102 )
{
if ( a1 != 101 )
{
result = cblas_xerbla(1LL, "cblas_dsymv", "Illegal Order setting, %d\n", a1);
goto LABEL_8;
}
RowMajorStrg = 1;
if ( a2 != 121 )
{
if ( a2 == 122 )
{
LABEL_5:
v10[0] = 85;
LABEL_6:
result = dsymv_(v10, v9, &v7, a4, &v8);
LABEL_8:
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
goto LABEL_12;
}
LABEL_11:
v10[0] = 76;
goto LABEL_6;
}
if ( a2 == 121 )
goto LABEL_5;
if ( a2 == 122 )
goto LABEL_11;
LABEL_12:
result = cblas_xerbla(2LL, "cblas_dsymv", "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, int a5, double a6)
{
__int64 result; // rax
double v7; // [rsp+10h] [rbp-28h] BYREF
int v8; // [rsp+18h] [rbp-20h] BYREF
int v9[4]; // [rsp+1Ch] [rbp-1Ch] BYREF
char v10[9]; // [rsp+2Fh] [rbp-9h] BYREF

RowMajorStrg = 0;
v9[0] = a3;
v8 = a5;
CBLAS_CallFromC = 1;
v7 = a6;
if ( a1 != 102 )
{
if ( a1 != 101 )
{
result = cblas_xerbla(1LL, "cblas_dsymv", "Illegal Order setting, %d\n", a1);
goto LABEL_8;
}
RowMajorStrg = 1;
if ( a2 != 121 )
{
if ( a2 == 122 )
{
LABEL_5:
v10[0] = 85;
LABEL_6:
result = dsymv_(v10, v9, &v7, a4, &v8);
LABEL_8:
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
goto LABEL_12;
}
LABEL_11:
v10[0] = 76;
goto LABEL_6;
}
if ( a2 == 121 )
goto LABEL_5;
if ( a2 == 122 )
goto LABEL_11;
LABEL_12:
result = cblas_xerbla(2LL, "cblas_dsymv", "Illegal Uplo setting, %d\n", a2);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}

original_code:
void cblas_dsymv(const enum CBLAS_ORDER order,
                 const enum CBLAS_UPLO Uplo, const int N,
                 const double alpha, const double *A, const int lda,
                 const double *X, const int incX, const double beta,
                 double *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_dsymv","Illegal Uplo setting, %d\n",Uplo );
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      dsymv_(&UL, &N, &alpha, A, &lda, 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_dsymv","Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      dsymv_(&UL, &N, &alpha,
                     A ,&lda, X,&incX, &beta, Y, &incY);
   }
   else cblas_xerbla(1, "cblas_dsymv", "Illegal Order setting, %d\n", order);
   CBLAS_CallFromC = 0;
   RowMajorStrg = 0;
   return;
}

canonical_original_code:
void cblas_dsymv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, int N, double alpha, double *A, int lda, double *X, int incX, double beta, double *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_dsymv","Illegal Uplo setting, %d\n",Uplo );
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      dsymv_(&UL, &N, &alpha, A, &lda, 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_dsymv","Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      dsymv_(&UL, &N, &alpha,
                     A ,&lda, X,&incX, &beta, Y, &incY);
   }
   else cblas_xerbla(1, "cblas_dsymv", "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: N int

variable_types:
A
double *

variable_types: lda int

variable_types: beta double

variable_types:
Y
double *


decompiled_code:
__int64 __fastcall cblas_ztpsv(unsigned int a1, unsigned int a2, unsigned int a3, __int64 a4, int a5, __int64 a6, _QWORD *a7, int a8)
{
unsigned int v9; // ebp
int v10; // edx
int v11; // ebp
_QWORD *v12; // rax
__int64 v13; // r13
_QWORD *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_ztpsv", "Illegal Diag setting, %d\n", a4);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
v20[0] = 78;
}
result = ztpsv_(&v19, &v18, v20, v17, a6, a7, &a8);
LABEL_14:
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
if ( a1 != 101 )
{
result = cblas_xerbla(1LL, "cblas_ztpsv", "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_ztpsv", "Illegal Uplo setting, %d\n", a2);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
v19 = 76;
LABEL_6:
switch ( a3 )
{
case 'o':
v18 = 84;
v14 = a7;
v13 = 0LL;
v11 = 0;
LABEL_32:
if ( (_DWORD)a4 == 132 )
{
v20[0] = 85;
goto LABEL_35;
}
if ( (_DWORD)a4 == 131 )
{
v20[0] = 78;
LABEL_35:
result = ztpsv_(&v19, &v18, v20, v17, a6, a7, &a8);
if ( a3 == 113 )
{
result = (unsigned int)v17[0];
if ( v17[0] > 0 )
{
v16 = 8LL * v11;
do
{
*v14 ^= LC4;
v14 = (_QWORD *)((char *)v14 + v16);
}
while ( (_QWORD *)v13 != v14 );
}
}
goto LABEL_14;
}
goto LABEL_29;
case 'p':
v18 = 78;
v14 = a7;
v13 = 0LL;
v11 = 0;
goto LABEL_32;
case 'q':
v18 = 78;
if ( v17[0] <= 0 )
{
v14 = a7;
v13 = 0LL;
v11 = 0;
}
else
{
v9 = abs32(a8);
v10 = v9 * v17[0];
v11 = 2 * v9;
v12 = a7 + 1;
v13 = (__int64)&a7[2 * v10 + 1];
do
{
*v12 ^= LC4;
v12 += v11;
}
while ( (_QWORD *)v13 != v12 );
v14 = a7 + 1;
}
goto LABEL_32;
}
LABEL_42:
result = cblas_xerbla(3LL, "cblas_ztpsv", "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, _QWORD *a7, int a8)
{
unsigned int v9; // ebp
int v10; // edx
int v11; // ebp
_QWORD *v12; // rax
__int64 v13; // r13
_QWORD *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_ztpsv", "Illegal Diag setting, %d\n", a4);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
v20[0] = 78;
}
result = ztpsv_(&v19, &v18, v20, v17, a6, a7, &a8);
LABEL_14:
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
if ( a1 != 101 )
{
result = cblas_xerbla(1LL, "cblas_ztpsv", "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_ztpsv", "Illegal Uplo setting, %d\n", a2);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
v19 = 76;
LABEL_6:
switch ( a3 )
{
case 'o':
v18 = 84;
v14 = a7;
v13 = 0LL;
v11 = 0;
LABEL_32:
if ( (_DWORD)a4 == 132 )
{
v20[0] = 85;
goto LABEL_35;
}
if ( (_DWORD)a4 == 131 )
{
v20[0] = 78;
LABEL_35:
result = ztpsv_(&v19, &v18, v20, v17, a6, a7, &a8);
if ( a3 == 113 )
{
result = (unsigned int)v17[0];
if ( v17[0] > 0 )
{
v16 = 8LL * v11;
do
{
*v14 ^= LC4;
v14 = (_QWORD *)((char *)v14 + v16);
}
while ( (_QWORD *)v13 != v14 );
}
}
goto LABEL_14;
}
goto LABEL_29;
case 'p':
v18 = 78;
v14 = a7;
v13 = 0LL;
v11 = 0;
goto LABEL_32;
case 'q':
v18 = 78;
if ( v17[0] <= 0 )
{
v14 = a7;
v13 = 0LL;
v11 = 0;
}
else
{
v9 = abs32(a8);
v10 = v9 * v17[0];
v11 = 2 * v9;
v12 = a7 + 1;
v13 = (__int64)&a7[2 * v10 + 1];
do
{
*v12 ^= LC4;
v12 += v11;
}
while ( (_QWORD *)v13 != v12 );
v14 = a7 + 1;
}
goto LABEL_32;
}
LABEL_42:
result = cblas_xerbla(3LL, "cblas_ztpsv", "Illegal TransA setting, %d\n", a3);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}

original_code:
void cblas_ztpsv(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 *Ap, void *X, const int incX)
{
   char TA;
   char UL;
   char DI;
   int n, i=0, tincX;
   double *st=0, *x=(double*)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_ztpsv","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_ztpsv","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_ztpsv","Illegal Diag setting, %d\n", Diag);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      ztpsv_( &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_ztpsv","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_ztpsv","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_ztpsv","Illegal Diag setting, %d\n", Diag);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      ztpsv_( &UL, &TA, &DI, &N, Ap, X,&incX);
      if (TransA == CblasConjTrans)
      {
         if (N > 0)
         {
            do
            {
               *x = -(*x);
               x += i;
            }
            while (x != st);
         }
      }
   }
   else cblas_xerbla(1, "cblas_ztpsv", "Illegal Order setting, %d\n", order);
   CBLAS_CallFromC = 0;
   RowMajorStrg = 0;
   return;
}

canonical_original_code:
void cblas_ztpsv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA, enum CBLAS_DIAG Diag, int N, void *Ap, void *X, int incX)
{
   char TA;
   char UL;
   char DI;
   int n; int i = 0; int tincX;
   double *st = 0; double *x = (double*)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_ztpsv","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_ztpsv","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_ztpsv","Illegal Diag setting, %d\n", Diag);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      ztpsv_( &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_ztpsv","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_ztpsv","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_ztpsv","Illegal Diag setting, %d\n", Diag);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      ztpsv_( &UL, &TA, &DI, &N, Ap, X,&incX);
      if (TransA == CblasConjTrans)
      {
         if (N > 0)
         {
            do
            {
               *x = -(*x);
               x += i;
            }
            while (x != st);
         }
      }
   }
   else cblas_xerbla(1, "cblas_ztpsv", "Illegal Order setting, %d\n", order);
   CBLAS_CallFromC = 0;
   RowMajorStrg = 0;
   return;
}

variable_types:
Ap
void *

variable_types:
X
void *

variable_types: incX int

variable_types: TA char

variable_types: n int

variable_types: i int

variable_types: tincX int

variable_types:
st
double *

variable_types:
x
double *

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


main

canonical_name: main

original_code:
int main ( )
{
   enum CBLAS_ORDER order;
   enum CBLAS_TRANSPOSE transa;
   double *a, *x, *y;
   double alpha, beta;
   int m, n, lda, incx, incy, i;
   order = CblasColMajor;
   transa = CblasNoTrans;
   m = 4;
   n = 4;
   lda = 4;
   incx = 1;
   incy = 1;
   alpha = 1;
   beta = 0;
   a = (double *)malloc(sizeof(double)*m*n);
   x = (double *)malloc(sizeof(double)*n);
   y = (double *)malloc(sizeof(double)*n);
   a[0] = 1;
   a[1] = 2;
   a[2] = 3;
   a[3] = 4;
   a[m] = 1;
   a[m+1] = 1;
   a[m+2] = 1;
   a[m+3] = 1;
   a[m*2] = 3;
   a[m*2+1] = 4;
   a[m*2+2] = 5;
   a[m*2+3] = 6;
   a[m*3] = 5;
   a[m*3+1] = 6;
   a[m*3+2] = 7;
   a[m*3+3] = 8;
   x[0] = 1;
   x[1] = 2;
   x[2] = 1;
   x[3] = 1;
   y[0] = 0;
   y[1] = 0;
   y[2] = 0;
   y[3] = 0;
   cblas_dgemv( order, transa, m, n, alpha, a, lda, x, incx, beta,
                y, incy );
   for( i = 0; i < n; i++ )
      printf(" y%d = %f\n", i, y[i]);
   free(a);
   free(x);
   free(y);
   return 1;
}

canonical_original_code:
int main()
{
   enum CBLAS_ORDER order;
   enum CBLAS_TRANSPOSE transa;
   double *a; double *x; double *y;
   double alpha; double beta;
   int m; int n; int lda; int incx; int incy; int i;
   order = CblasColMajor;
   transa = CblasNoTrans;
   m = 4;
   n = 4;
   lda = 4;
   incx = 1;
   incy = 1;
   alpha = 1;
   beta = 0;
   a = (double *)malloc(sizeof(double)*m*n);
   x = (double *)malloc(sizeof(double)*n);
   y = (double *)malloc(sizeof(double)*n);
   a[0] = 1;
   a[1] = 2;
   a[2] = 3;
   a[3] = 4;
   a[m] = 1;
   a[m+1] = 1;
   a[m+2] = 1;
   a[m+3] = 1;
   a[m*2] = 3;
   a[m*2+1] = 4;
   a[m*2+2] = 5;
   a[m*2+3] = 6;
   a[m*3] = 5;
   a[m*3+1] = 6;
   a[m*3+2] = 7;
   a[m*3+3] = 8;
   x[0] = 1;
   x[1] = 2;
   x[2] = 1;
   x[3] = 1;
   y[0] = 0;
   y[1] = 0;
   y[2] = 0;
   y[3] = 0;
   cblas_dgemv( order, transa, m, n, alpha, a, lda, x, incx, beta,
                y, incy );
   for( i = 0; i < n; i++ )
      printf(" y%d = %f\n", i, y[i]);
   free(a);
   free(x);
   free(y);
   return 1;
}

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

variable_types:
a
double *

variable_types:
y
double *

variable_types: alpha double

variable_types: m int

variable_types: incx int

variable_types: incy int

return_type: int


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

RowMajorStrg = 0;
v14 = a5;
v15[0] = a4;
CBLAS_CallFromC = 1;
if ( a1 != 102 )
{
if ( a1 != 101 )
{
result = cblas_xerbla(1LL, "cblas_chemm", "Illegal Order setting, %d\n", a1);
goto LABEL_11;
}
RowMajorStrg = 1;
if ( a2 == 142 )
{
v16 = 76;
goto LABEL_6;
}
if ( a2 == 141 )
{
v16 = 82;
LABEL_6:
if ( a3 == 121 )
{
v17[0] = 76;
goto LABEL_9;
}
if ( a3 == 122 )
{
v17[0] = 85;
LABEL_9:
result = chemm_(&v16, v17, &v14, v15, a6, a7, &a8, a9, &a10, a11, a12, &a13);
LABEL_11:
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
goto LABEL_21;
}
LABEL_19:
result = cblas_xerbla(2LL, "cblas_chemm", "Illegal Side setting, %d\n", a2);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
if ( a2 == 142 )
{
v16 = 82;
}
else
{
if ( a2 != 141 )
goto LABEL_19;
v16 = 76;
}
if ( a3 == 121 )
{
v17[0] = 85;
goto LABEL_18;
}
if ( a3 == 122 )
{
v17[0] = 76;
LABEL_18:
result = chemm_(&v16, v17, v15, &v14, a6, a7, &a8, a9, &a10, a11, a12, &a13);
goto LABEL_11;
}
LABEL_21:
result = cblas_xerbla(3LL, "cblas_chemm", "Illegal Uplo 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, __int64 a6, __int64 a7, char a8, __int64 a9, char a10, __int64 a11, __int64 a12, char a13)
{
__int64 result; // rax
int v14; // [rsp+8h] [rbp-20h] BYREF
int v15[4]; // [rsp+Ch] [rbp-1Ch] BYREF
char v16; // [rsp+1Eh] [rbp-Ah] BYREF
char v17[9]; // [rsp+1Fh] [rbp-9h] BYREF

RowMajorStrg = 0;
v14 = a5;
v15[0] = a4;
CBLAS_CallFromC = 1;
if ( a1 != 102 )
{
if ( a1 != 101 )
{
result = cblas_xerbla(1LL, "cblas_chemm", "Illegal Order setting, %d\n", a1);
goto LABEL_11;
}
RowMajorStrg = 1;
if ( a2 == 142 )
{
v16 = 76;
goto LABEL_6;
}
if ( a2 == 141 )
{
v16 = 82;
LABEL_6:
if ( a3 == 121 )
{
v17[0] = 76;
goto LABEL_9;
}
if ( a3 == 122 )
{
v17[0] = 85;
LABEL_9:
result = chemm_(&v16, v17, &v14, v15, a6, a7, &a8, a9, &a10, a11, a12, &a13);
LABEL_11:
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
goto LABEL_21;
}
LABEL_19:
result = cblas_xerbla(2LL, "cblas_chemm", "Illegal Side setting, %d\n", a2);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
if ( a2 == 142 )
{
v16 = 82;
}
else
{
if ( a2 != 141 )
goto LABEL_19;
v16 = 76;
}
if ( a3 == 121 )
{
v17[0] = 85;
goto LABEL_18;
}
if ( a3 == 122 )
{
v17[0] = 76;
LABEL_18:
result = chemm_(&v16, v17, v15, &v14, a6, a7, &a8, a9, &a10, a11, a12, &a13);
goto LABEL_11;
}
LABEL_21:
result = cblas_xerbla(3LL, "cblas_chemm", "Illegal Uplo setting, %d\n", a3);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}

original_code:
void cblas_chemm(const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side,
                 const enum CBLAS_UPLO Uplo, const int M, const int N,
                 const void *alpha, const void *A, const int lda,
                 const void *B, const int ldb, const void *beta,
                 void *C, const int ldc)
{
   char SD, UL;
   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_chemm", "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_chemm", "Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      chemm_(&SD, &UL, &M, &N, alpha, A, &lda,
                     B, &ldb, beta, C, &ldc);
   } else if (Order == CblasRowMajor)
   {
      RowMajorStrg = 1;
      if( Side == CblasRight) SD='L';
      else if ( Side == CblasLeft ) SD='R';
      else
      {
         cblas_xerbla(2, "cblas_chemm", "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_chemm", "Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      chemm_(&SD, &UL, &N, &M, alpha, A,
                 &lda, B, &ldb, beta, C, &ldc);
   }
   else cblas_xerbla(1, "cblas_chemm", "Illegal Order setting, %d\n", Order);
   CBLAS_CallFromC = 0;
   RowMajorStrg = 0;
   return;
}

canonical_original_code:
void cblas_chemm(enum CBLAS_ORDER Order, enum CBLAS_SIDE Side, enum CBLAS_UPLO Uplo, int M, int N, void *alpha, void *A, int lda, void *B, int ldb, void *beta, void *C, int ldc)
{
   char SD; char UL;
   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_chemm", "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_chemm", "Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      chemm_(&SD, &UL, &M, &N, alpha, A, &lda,
                     B, &ldb, beta, C, &ldc);
   } else if (Order == CblasRowMajor)
   {
      RowMajorStrg = 1;
      if( Side == CblasRight) SD='L';
      else if ( Side == CblasLeft ) SD='R';
      else
      {
         cblas_xerbla(2, "cblas_chemm", "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_chemm", "Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      chemm_(&SD, &UL, &N, &M, alpha, A,
                 &lda, B, &ldb, beta, C, &ldc);
   }
   else cblas_xerbla(1, "cblas_chemm", "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: M int

variable_types: N int

variable_types:
alpha
void *

variable_types:
A
void *

variable_types: lda int

variable_types:
B
void *

variable_types: ldb int

variable_types:
beta
void *

variable_types:
C
void *

variable_types: ldc int

variable_types: SD char

variable_types: UL char

variable_types: RowMajorStrg int


decompiled_code:
double __fastcall cblas_dznrm2(int a1, __int64 a2, int a3)
{
int v4; // [rsp+8h] [rbp-20h] BYREF
int v5[3]; // [rsp+Ch] [rbp-1Ch] BYREF
double v6[2]; // [rsp+18h] [rbp-10h] BYREF

v5[0] = a1;
v4 = a3;
dznrm2sub_(v5, a2, &v4, v6);
return v6[0];
}

canonical_decompiled_code:
double __fastcall func0(int a1, __int64 a2, int a3)
{
int v4; // [rsp+8h] [rbp-20h] BYREF
int v5[3]; // [rsp+Ch] [rbp-1Ch] BYREF
double v6[2]; // [rsp+18h] [rbp-10h] BYREF

v5[0] = a1;
v4 = a3;
dznrm2sub_(v5, a2, &v4, v6);
return v6[0];
}

original_code:
double cblas_dznrm2( const int N, const void *X, const int incX)
{
   double nrm2;
   dznrm2sub_( &N, X, &incX, &nrm2);
   return nrm2;
}

canonical_original_code:
double cblas_dznrm2(int N, void *X, int incX)
{
   double nrm2;
   dznrm2sub_( &N, X, &incX, &nrm2);
   return nrm2;
}

variable_types:
X
void *

variable_types: incX int

return_type: double


decompiled_code:
double __fastcall cblas_dzasum(int a1, __int64 a2, int a3)
{
int v4; // [rsp+8h] [rbp-20h] BYREF
int v5[3]; // [rsp+Ch] [rbp-1Ch] BYREF
double v6[2]; // [rsp+18h] [rbp-10h] BYREF

v5[0] = a1;
v4 = a3;
dzasumsub_(v5, a2, &v4, v6);
return v6[0];
}

canonical_decompiled_code:
double __fastcall func0(int a1, __int64 a2, int a3)
{
int v4; // [rsp+8h] [rbp-20h] BYREF
int v5[3]; // [rsp+Ch] [rbp-1Ch] BYREF
double v6[2]; // [rsp+18h] [rbp-10h] BYREF

v5[0] = a1;
v4 = a3;
dzasumsub_(v5, a2, &v4, v6);
return v6[0];
}

original_code:
double cblas_dzasum( const int N, const void *X, const int incX)
{
   double asum;
   dzasumsub_( &N, X, &incX, &asum);
   return asum;
}

canonical_original_code:
double cblas_dzasum(int N, void *X, int incX)
{
   double asum;
   dzasumsub_( &N, X, &incX, &asum);
   return asum;
}

variable_types: asum double


decompiled_code:
// attributes: thunk
__int64 cblas_drotg()
{
return drotg_();
}

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

original_code:
void cblas_drotg( double *a, double *b, double *c, double *s)
{
   drotg_(a,b,c,s);
}

canonical_original_code:
void cblas_drotg(double *a, double *b, double *c, double *s)
{
   drotg_(a,b,c,s);
}

variable_types:
a
double *

variable_types:
b
double *

variable_types:
c
double *

variable_types:
s
double *


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

RowMajorStrg = 0;
v14 = a5;
v15[0] = a4;
CBLAS_CallFromC = 1;
if ( a1 != 102 )
{
if ( a1 != 101 )
{
result = cblas_xerbla(1LL, "cblas_zhemm", "Illegal Order setting, %d\n", a1);
goto LABEL_11;
}
RowMajorStrg = 1;
if ( a2 == 142 )
{
v16 = 76;
goto LABEL_6;
}
if ( a2 == 141 )
{
v16 = 82;
LABEL_6:
if ( a3 == 121 )
{
v17[0] = 76;
goto LABEL_9;
}
if ( a3 == 122 )
{
v17[0] = 85;
LABEL_9:
result = zhemm_(&v16, v17, &v14, v15, a6, a7, &a8, a9, &a10, a11, a12, &a13);
LABEL_11:
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
goto LABEL_21;
}
LABEL_19:
result = cblas_xerbla(2LL, "cblas_zhemm", "Illegal Side setting, %d\n", a2);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
if ( a2 == 142 )
{
v16 = 82;
}
else
{
if ( a2 != 141 )
goto LABEL_19;
v16 = 76;
}
if ( a3 == 121 )
{
v17[0] = 85;
goto LABEL_18;
}
if ( a3 == 122 )
{
v17[0] = 76;
LABEL_18:
result = zhemm_(&v16, v17, v15, &v14, a6, a7, &a8, a9, &a10, a11, a12, &a13);
goto LABEL_11;
}
LABEL_21:
result = cblas_xerbla(3LL, "cblas_zhemm", "Illegal Uplo 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, __int64 a6, __int64 a7, char a8, __int64 a9, char a10, __int64 a11, __int64 a12, char a13)
{
__int64 result; // rax
int v14; // [rsp+8h] [rbp-20h] BYREF
int v15[4]; // [rsp+Ch] [rbp-1Ch] BYREF
char v16; // [rsp+1Eh] [rbp-Ah] BYREF
char v17[9]; // [rsp+1Fh] [rbp-9h] BYREF

RowMajorStrg = 0;
v14 = a5;
v15[0] = a4;
CBLAS_CallFromC = 1;
if ( a1 != 102 )
{
if ( a1 != 101 )
{
result = cblas_xerbla(1LL, "cblas_zhemm", "Illegal Order setting, %d\n", a1);
goto LABEL_11;
}
RowMajorStrg = 1;
if ( a2 == 142 )
{
v16 = 76;
goto LABEL_6;
}
if ( a2 == 141 )
{
v16 = 82;
LABEL_6:
if ( a3 == 121 )
{
v17[0] = 76;
goto LABEL_9;
}
if ( a3 == 122 )
{
v17[0] = 85;
LABEL_9:
result = zhemm_(&v16, v17, &v14, v15, a6, a7, &a8, a9, &a10, a11, a12, &a13);
LABEL_11:
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
goto LABEL_21;
}
LABEL_19:
result = cblas_xerbla(2LL, "cblas_zhemm", "Illegal Side setting, %d\n", a2);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
if ( a2 == 142 )
{
v16 = 82;
}
else
{
if ( a2 != 141 )
goto LABEL_19;
v16 = 76;
}
if ( a3 == 121 )
{
v17[0] = 85;
goto LABEL_18;
}
if ( a3 == 122 )
{
v17[0] = 76;
LABEL_18:
result = zhemm_(&v16, v17, v15, &v14, a6, a7, &a8, a9, &a10, a11, a12, &a13);
goto LABEL_11;
}
LABEL_21:
result = cblas_xerbla(3LL, "cblas_zhemm", "Illegal Uplo setting, %d\n", a3);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}

original_code:
void cblas_zhemm(const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side,
                 const enum CBLAS_UPLO Uplo, const int M, const int N,
                 const void *alpha, const void *A, const int lda,
                 const void *B, const int ldb, const void *beta,
                 void *C, const int ldc)
{
   char SD, UL;
   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_zhemm", "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_zhemm", "Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      zhemm_(&SD, &UL, &M, &N, alpha, A, &lda,
                     B, &ldb, beta, C, &ldc);
   } else if (Order == CblasRowMajor)
   {
      RowMajorStrg = 1;
      if( Side == CblasRight) SD='L';
      else if ( Side == CblasLeft ) SD='R';
      else
      {
         cblas_xerbla(2, "cblas_zhemm", "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_zhemm", "Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      zhemm_(&SD, &UL, &N, &M, alpha, A,
                 &lda, B, &ldb, beta, C, &ldc);
   }
   else cblas_xerbla(1, "cblas_zhemm", "Illegal Order setting, %d\n", Order);
   CBLAS_CallFromC = 0;
   RowMajorStrg = 0;
   return;
}

canonical_original_code:
void cblas_zhemm(enum CBLAS_ORDER Order, enum CBLAS_SIDE Side, enum CBLAS_UPLO Uplo, int M, int N, void *alpha, void *A, int lda, void *B, int ldb, void *beta, void *C, int ldc)
{
   char SD; char UL;
   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_zhemm", "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_zhemm", "Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      zhemm_(&SD, &UL, &M, &N, alpha, A, &lda,
                     B, &ldb, beta, C, &ldc);
   } else if (Order == CblasRowMajor)
   {
      RowMajorStrg = 1;
      if( Side == CblasRight) SD='L';
      else if ( Side == CblasLeft ) SD='R';
      else
      {
         cblas_xerbla(2, "cblas_zhemm", "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_zhemm", "Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      zhemm_(&SD, &UL, &N, &M, alpha, A,
                 &lda, B, &ldb, beta, C, &ldc);
   }
   else cblas_xerbla(1, "cblas_zhemm", "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: M int

variable_types: N int

variable_types:
alpha
void *

variable_types:
A
void *


decompiled_code:
float __fastcall cblas_snrm2(int a1, __int64 a2, int a3)
{
int v4; // [rsp+8h] [rbp-20h] BYREF
int v5[4]; // [rsp+Ch] [rbp-1Ch] BYREF
float v6[3]; // [rsp+1Ch] [rbp-Ch] BYREF

v5[0] = a1;
v4 = a3;
snrm2sub_(v5, a2, &v4, v6);
return v6[0];
}

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

v5[0] = a1;
v4 = a3;
snrm2sub_(v5, a2, &v4, v6);
return v6[0];
}

original_code:
float cblas_snrm2( const int N, const float *X, const int incX)
{
   float nrm2;
   snrm2sub_( &N, X, &incX, &nrm2);
   return nrm2;
}

canonical_original_code:
float cblas_snrm2(int N, float *X, int incX)
{
   float nrm2;
   snrm2sub_( &N, X, &incX, &nrm2);
   return nrm2;
}

variable_types:
X
float *

return_type: float


original_code:
void cblas_zhbmv(const enum CBLAS_ORDER order,
                 const enum CBLAS_UPLO Uplo,const int N,const int K,
                 const void *alpha, const void *A, const int lda,
                 const void *X, const int incX, const void *beta,
                 void *Y, const int incY)
{
   char UL;
   int n, i=0, incx=incX;
   const double *xx= (double *)X, *alp= (double *)alpha, *bet = (double *)beta;
   double ALPHA[2],BETA[2];
   int tincY, tincx;
   double *x=(double *)X, *y=(double *)Y, *st=0, *tx;
   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_zhbmv","Illegal Uplo setting, %d\n",Uplo );
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      zhbmv_(&UL, &N, &K, alpha, A, &lda, X,
                     &incx, beta, Y, &incY);
   }
   else if (order == CblasRowMajor)
   {
      RowMajorStrg = 1;
      ALPHA[0]= *alp;
      ALPHA[1]= -alp[1];
      BETA[0]= *bet;
      BETA[1]= -bet[1];
      if (N > 0)
      {
         n = N << 1;
         x = malloc(n*sizeof(double));
         tx = x;
         if( incX > 0 ) {
           i = incX << 1 ;
           tincx = 2;
           st= x+n;
         } else {
           i = incX *(-2);
           tincx = -2;
           st = x-2;
           x +=(n-2);
         }
         do
         {
           *x = *xx;
           x[1] = -xx[1];
           x += tincx ;
           xx += i;
         }
         while (x != st);
         x=tx;
            incx = 1;
         if(incY > 0)
           tincY = incY;
         else
           tincY = -incY;
         y++;
         i = tincY << 1;
         n = i * N ;
         st = y + n;
         do {
            *y = -(*y);
            y += i;
         } while(y != st);
         y -= n;
      } else
         x = (double *) X;
      if (Uplo == CblasUpper) UL = 'L';
      else if (Uplo == CblasLower) UL = 'U';
      else
      {
         cblas_xerbla(2, "cblas_zhbmv","Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      zhbmv_(&UL, &N, &K, ALPHA,
                     A ,&lda, x,&incx, BETA, Y, &incY);
   }
   else
   {
      cblas_xerbla(1, "cblas_zhbmv","Illegal Order setting, %d\n", order);
      CBLAS_CallFromC = 0;
      RowMajorStrg = 0;
      return;
   }
   if ( order == CblasRowMajor )
   {
      RowMajorStrg = 1;
      if(X!=x)
         free(x);
      if (N > 0)
      {
         do
         {
            *y = -(*y);
            y += i;
         }
         while (y != st);
      }
   }
   CBLAS_CallFromC = 0;
   RowMajorStrg = 0;
   return;
}

canonical_original_code:
void cblas_zhbmv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, int N, int K, void *alpha, void *A, int lda, void *X, int incX, void *beta, void *Y, int incY)
{
   char UL;
   int n; int i = 0; int incx = incX;
   double *xx = (double *)X; double *alp = (double *)alpha; double *bet = (double *)beta;
   double ALPHA[2]; double BETA[2];
   int tincY; int tincx;
   double *x = (double *)X; double *y = (double *)Y; double *st = 0; double *tx;
   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_zhbmv","Illegal Uplo setting, %d\n",Uplo );
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      zhbmv_(&UL, &N, &K, alpha, A, &lda, X,
                     &incx, beta, Y, &incY);
   }
   else if (order == CblasRowMajor)
   {
      RowMajorStrg = 1;
      ALPHA[0]= *alp;
      ALPHA[1]= -alp[1];
      BETA[0]= *bet;
      BETA[1]= -bet[1];
      if (N > 0)
      {
         n = N << 1;
         x = malloc(n*sizeof(double));
         tx = x;
         if( incX > 0 ) {
           i = incX << 1 ;
           tincx = 2;
           st= x+n;
         } else {
           i = incX *(-2);
           tincx = -2;
           st = x-2;
           x +=(n-2);
         }
         do
         {
           *x = *xx;
           x[1] = -xx[1];
           x += tincx ;
           xx += i;
         }
         while (x != st);
         x=tx;
            incx = 1;
         if(incY > 0)
           tincY = incY;
         else
           tincY = -incY;
         y++;
         i = tincY << 1;
         n = i * N ;
         st = y + n;
         do {
            *y = -(*y);
            y += i;
         } while(y != st);
         y -= n;
      } else
         x = (double *) X;
      if (Uplo == CblasUpper) UL = 'L';
      else if (Uplo == CblasLower) UL = 'U';
      else
      {
         cblas_xerbla(2, "cblas_zhbmv","Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      zhbmv_(&UL, &N, &K, ALPHA,
                     A ,&lda, x,&incx, BETA, Y, &incY);
   }
   else
   {
      cblas_xerbla(1, "cblas_zhbmv","Illegal Order setting, %d\n", order);
      CBLAS_CallFromC = 0;
      RowMajorStrg = 0;
      return;
   }
   if ( order == CblasRowMajor )
   {
      RowMajorStrg = 1;
      if(X!=x)
         free(x);
      if (N > 0)
      {
         do
         {
            *y = -(*y);
            y += i;
         }
         while (y != st);
      }
   }
   CBLAS_CallFromC = 0;
   RowMajorStrg = 0;
   return;
}

variable_types: K int

variable_types: lda int

variable_types:
beta
void *

variable_types:
Y
void *

variable_types: incY int

variable_types: UL char

variable_types: n int

variable_types: i int

variable_types: incx int

variable_types:
xx
double *

variable_types:
alp
double *

variable_types:
bet
double *

variable_types:
ALPHA
double [2]

variable_types:
BETA
double [2]

variable_types: tincY int

variable_types: tincx int

variable_types:
x
double *

variable_types:
y
double *

variable_types:
st
double *

variable_types:
tx
double *


decompiled_code:
__int64 __fastcall cblas_idamax(int a1, __int64 a2, int a3)
{
__int64 result; // rax
int v4; // [rsp+8h] [rbp-20h] BYREF
int v5[4]; // [rsp+Ch] [rbp-1Ch] BYREF
int v6[3]; // [rsp+1Ch] [rbp-Ch] BYREF

v5[0] = a1;
v4 = a3;
idamaxsub_(v5, a2, &v4, v6);
result = v6[0] - 1;
if ( !v6[0] )
result = 0LL;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(int a1, __int64 a2, int a3)
{
__int64 result; // rax
int v4; // [rsp+8h] [rbp-20h] BYREF
int v5[4]; // [rsp+Ch] [rbp-1Ch] BYREF
int v6[3]; // [rsp+1Ch] [rbp-Ch] BYREF

v5[0] = a1;
v4 = a3;
idamaxsub_(v5, a2, &v4, v6);
result = v6[0] - 1;
if ( !v6[0] )
result = 0LL;
return result;
}

original_code:
size_t cblas_idamax( const int N, const double *X, const int incX)
{
   int iamax;
   idamaxsub_( &N, X, &incX, &iamax);
   return iamax ? iamax-1 : 0;
}

canonical_original_code:
unsigned long cblas_idamax(int N, double *X, int incX)
{
   int iamax;
   idamaxsub_( &N, X, &incX, &iamax);
   return iamax ? iamax-1 : 0;
}

variable_types: N int

variable_types:
X
double *

variable_types: incX int

variable_types: iamax int

return_type: unsigned long


decompiled_code:
__int64 __fastcall cblas_ssyr2k(unsigned int a1, unsigned int a2, unsigned int a3, int a4, int a5, float a6)
{
__int64 result; // rax
float v7; // [rsp+4h] [rbp-24h] BYREF
int v8; // [rsp+8h] [rbp-20h] BYREF
int v9[4]; // [rsp+Ch] [rbp-1Ch] BYREF
char v10; // [rsp+1Eh] [rbp-Ah] BYREF
char v11[9]; // [rsp+1Fh] [rbp-9h] BYREF

RowMajorStrg = 0;
v9[0] = a4;
v8 = a5;
CBLAS_CallFromC = 1;
v7 = a6;
if ( a1 == 102 )
{
if ( a2 == 121 )
{
v10 = 85;
}
else
{
if ( a2 != 122 )
{
result = cblas_xerbla(2LL, "cblas_ssyr2k", "Illegal Uplo setting, %d\n", a2);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
v10 = 76;
}
if ( a3 == 112 )
goto LABEL_8;
if ( a3 == 113 )
{
v11[0] = 67;
goto LABEL_18;
}
if ( a3 != 111 )
goto LABEL_24;
goto LABEL_17;
}
if ( a1 != 101 )
{
result = cblas_xerbla(1LL, "cblas_ssyr2k", "Illegal Order setting, %d\n", a1);
LABEL_10:
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
RowMajorStrg = 1;
if ( a2 == 121 )
{
v10 = 76;
LABEL_6:
if ( a3 - 112 > 1 )
{
if ( a3 == 111 )
{
LABEL_8:
v11[0] = 84;
LABEL_18:
result = ssyr2k_(&v10, v11, v9, &v8, &v7);
goto LABEL_10;
}
LABEL_24:
result = cblas_xerbla(3LL, "cblas_ssyr2k", "Illegal Trans setting, %d\n", a3);
goto LABEL_21;
}
LABEL_17:
v11[0] = 78;
goto LABEL_18;
}
if ( a2 == 122 )
{
v10 = 85;
goto LABEL_6;
}
result = cblas_xerbla(3LL, "cblas_ssyr2k", "Illegal Uplo setting, %d\n", a2);
LABEL_21:
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, float a6)
{
__int64 result; // rax
float v7; // [rsp+4h] [rbp-24h] BYREF
int v8; // [rsp+8h] [rbp-20h] BYREF
int v9[4]; // [rsp+Ch] [rbp-1Ch] BYREF
char v10; // [rsp+1Eh] [rbp-Ah] BYREF
char v11[9]; // [rsp+1Fh] [rbp-9h] BYREF

RowMajorStrg = 0;
v9[0] = a4;
v8 = a5;
CBLAS_CallFromC = 1;
v7 = a6;
if ( a1 == 102 )
{
if ( a2 == 121 )
{
v10 = 85;
}
else
{
if ( a2 != 122 )
{
result = cblas_xerbla(2LL, "cblas_ssyr2k", "Illegal Uplo setting, %d\n", a2);
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
v10 = 76;
}
if ( a3 == 112 )
goto LABEL_8;
if ( a3 == 113 )
{
v11[0] = 67;
goto LABEL_18;
}
if ( a3 != 111 )
goto LABEL_24;
goto LABEL_17;
}
if ( a1 != 101 )
{
result = cblas_xerbla(1LL, "cblas_ssyr2k", "Illegal Order setting, %d\n", a1);
LABEL_10:
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}
RowMajorStrg = 1;
if ( a2 == 121 )
{
v10 = 76;
LABEL_6:
if ( a3 - 112 > 1 )
{
if ( a3 == 111 )
{
LABEL_8:
v11[0] = 84;
LABEL_18:
result = ssyr2k_(&v10, v11, v9, &v8, &v7);
goto LABEL_10;
}
LABEL_24:
result = cblas_xerbla(3LL, "cblas_ssyr2k", "Illegal Trans setting, %d\n", a3);
goto LABEL_21;
}
LABEL_17:
v11[0] = 78;
goto LABEL_18;
}
if ( a2 == 122 )
{
v10 = 85;
goto LABEL_6;
}
result = cblas_xerbla(3LL, "cblas_ssyr2k", "Illegal Uplo setting, %d\n", a2);
LABEL_21:
CBLAS_CallFromC = 0;
RowMajorStrg = 0;
return result;
}

original_code:
void cblas_ssyr2k(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                  const enum CBLAS_TRANSPOSE Trans, const int N, const int K,
                  const float alpha, const float *A, const int lda,
                  const float *B, const int ldb, const float beta,
                  float *C, const int ldc)
{
   char UL, TR;
   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_ssyr2k",
                       "Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if( Trans == CblasTrans) TR ='T';
      else if ( Trans == CblasConjTrans ) TR='C';
      else if ( Trans == CblasNoTrans ) TR='N';
      else
      {
         cblas_xerbla(3, "cblas_ssyr2k",
                       "Illegal Trans setting, %d\n", Trans);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      ssyr2k_(&UL, &TR, &N, &K, &alpha, A, &lda, B, &ldb, &beta, C, &ldc);
   } else if (Order == CblasRowMajor)
   {
      RowMajorStrg = 1;
      if( Uplo == CblasUpper) UL='L';
      else if ( Uplo == CblasLower ) UL='U';
      else
      {
         cblas_xerbla(3, "cblas_ssyr2k",
                       "Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if( Trans == CblasTrans) TR ='N';
      else if ( Trans == CblasConjTrans ) TR='N';
      else if ( Trans == CblasNoTrans ) TR='T';
      else
      {
         cblas_xerbla(3, "cblas_ssyr2k",
                       "Illegal Trans setting, %d\n", Trans);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      ssyr2k_(&UL, &TR, &N, &K, &alpha, A, &lda, B, &ldb, &beta, C, &ldc);
   } else cblas_xerbla(1, "cblas_ssyr2k",
                     "Illegal Order setting, %d\n", Order);
   CBLAS_CallFromC = 0;
   RowMajorStrg = 0;
   return;
}

canonical_original_code:
void cblas_ssyr2k(enum CBLAS_ORDER Order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE Trans, int N, int K, float alpha, float *A, int lda, float *B, int ldb, float beta, float *C, int ldc)
{
   char UL; char TR;
   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_ssyr2k",
                       "Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if( Trans == CblasTrans) TR ='T';
      else if ( Trans == CblasConjTrans ) TR='C';
      else if ( Trans == CblasNoTrans ) TR='N';
      else
      {
         cblas_xerbla(3, "cblas_ssyr2k",
                       "Illegal Trans setting, %d\n", Trans);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      ssyr2k_(&UL, &TR, &N, &K, &alpha, A, &lda, B, &ldb, &beta, C, &ldc);
   } else if (Order == CblasRowMajor)
   {
      RowMajorStrg = 1;
      if( Uplo == CblasUpper) UL='L';
      else if ( Uplo == CblasLower ) UL='U';
      else
      {
         cblas_xerbla(3, "cblas_ssyr2k",
                       "Illegal Uplo setting, %d\n", Uplo);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      if( Trans == CblasTrans) TR ='N';
      else if ( Trans == CblasConjTrans ) TR='N';
      else if ( Trans == CblasNoTrans ) TR='T';
      else
      {
         cblas_xerbla(3, "cblas_ssyr2k",
                       "Illegal Trans setting, %d\n", Trans);
         CBLAS_CallFromC = 0;
         RowMajorStrg = 0;
         return;
      }
      ssyr2k_(&UL, &TR, &N, &K, &alpha, A, &lda, B, &ldb, &beta, C, &ldc);
   } else cblas_xerbla(1, "cblas_ssyr2k",
                     "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: K int

variable_types: alpha float

variable_types:
A
float *

variable_types: lda int

variable_types:
B
float *

variable_types: ldb int

variable_types: beta float

variable_types:
C
float *

variable_types: ldc int

variable_types: UL char

variable_types: TR char

variable_types: RowMajorStrg int