decompiled_code:
__int64 __fastcall is_s_in_f(__int64 a1, __int64 a2, unsigned int a3, const char *a4, __int64 a5, __int64 a6, _QWORD *a7)
{
int v10; // ebp
__int64 v12; // [rsp+18h] [rbp-50h] BYREF
unsigned int v13; // [rsp+20h] [rbp-48h] BYREF
__int16 v14; // [rsp+24h] [rbp-44h] BYREF
char v15; // [rsp+27h] [rbp-41h] BYREF
__int64 v16[8]; // [rsp+28h] [rbp-40h] BYREF

v16[0] = -1LL;
*a7 = -1LL;
if ( !a1 )
{
fprintf(stderr, "Line %3d of File %s \n", 37LL, "is_s_in_f.c");
return (unsigned int)-1;
}
if ( !a5 )
{
fprintf(stderr, "Line %3d of File %s \n", 38LL, "is_s_in_f.c");
return (unsigned int)-1;
}
if ( !a4 )
{
fprintf(stderr, "Line %3d of File %s \n", 39LL, "is_s_in_f.c");
return (unsigned int)-1;
}
if ( a3 == 4 )
{
v10 = stoI4(a5, &v13);
if ( v10 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 44LL, "is_s_in_f.c");
return (unsigned int)v10;
}
if ( !strcmp(a4, "ascending") )
{
v10 = bin_search_I4(a1, a6, v13, v16, &unk_4CB);
if ( v10 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 58LL, "is_s_in_f.c");
return (unsigned int)v10;
}
}
else
{
is_s_in_f_seq_I4(a1, a2, v13, a6, v16);
}
goto LABEL_30;
}
if ( a3 > 4 )
{
if ( a3 == 5 )
{
v10 = stoI8(a5, &v12);
if ( v10 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 45LL, "is_s_in_f.c");
return (unsigned int)v10;
}
if ( !strcmp(a4, "ascending") )
{
v10 = bin_search_I8(a1, a6, v12, v16, &unk_4CB);
if ( v10 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 61LL, "is_s_in_f.c");
return (unsigned int)v10;
}
}
else
{
is_s_in_f_seq_I8(a1, a2, v12, a6, v16);
}
goto LABEL_30;
}
goto LABEL_34;
}
if ( a3 != 2 )
{
if ( a3 == 3 )
{
v10 = stoI2(a5, &v14);
if ( v10 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 43LL, "is_s_in_f.c");
return (unsigned int)v10;
}
if ( strcmp(a4, "ascending") )
{
is_s_in_f_seq_I2(a1, a2, (unsigned int)v14, a6, v16);
goto LABEL_30;
}
goto LABEL_10;
}
LABEL_34:
fprintf(stderr, "Line %3d of File %s \n", 46LL, "is_s_in_f.c");
return (unsigned int)-1;
}
v10 = stoI1(a5, &v15);
if ( v10 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 42LL, "is_s_in_f.c");
return (unsigned int)v10;
}
if ( strcmp(a4, "ascending") )
{
is_s_in_f_seq_I1(a1, a2, (unsigned int)v15, a6, v16);
goto LABEL_30;
}
if ( a3 != 3 )
{
if ( a3 != 2 )
{
fprintf(stderr, "Line %3d of File %s \n", 64LL, "is_s_in_f.c");
return (unsigned int)-1;
}
v10 = bin_search_I1(a1, a6, (unsigned int)v15, v16, &unk_4CB);
if ( v10 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 52LL, "is_s_in_f.c");
return (unsigned int)v10;
}
LABEL_30:
*a7 = v16[0];
return (unsigned int)v10;
}
LABEL_10:
v10 = bin_search_I2(a1, a6, (unsigned int)v14, v16, &unk_4CB);
if ( v10 >= 0 )
goto LABEL_30;
fprintf(stderr, "Line %3d of File %s \n", 55LL, "is_s_in_f.c");
return (unsigned int)v10;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, __int64 a2, unsigned int a3, const char *a4, __int64 a5, __int64 a6, _QWORD *a7)
{
int v10; // ebp
__int64 v12; // [rsp+18h] [rbp-50h] BYREF
unsigned int v13; // [rsp+20h] [rbp-48h] BYREF
__int16 v14; // [rsp+24h] [rbp-44h] BYREF
char v15; // [rsp+27h] [rbp-41h] BYREF
__int64 v16[8]; // [rsp+28h] [rbp-40h] BYREF

v16[0] = -1LL;
*a7 = -1LL;
if ( !a1 )
{
fprintf(stderr, "Line %3d of File %s \n", 37LL, "is_s_in_f.c");
return (unsigned int)-1;
}
if ( !a5 )
{
fprintf(stderr, "Line %3d of File %s \n", 38LL, "is_s_in_f.c");
return (unsigned int)-1;
}
if ( !a4 )
{
fprintf(stderr, "Line %3d of File %s \n", 39LL, "is_s_in_f.c");
return (unsigned int)-1;
}
if ( a3 == 4 )
{
v10 = stoI4(a5, &v13);
if ( v10 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 44LL, "is_s_in_f.c");
return (unsigned int)v10;
}
if ( !strcmp(a4, "ascending") )
{
v10 = bin_search_I4(a1, a6, v13, v16, &unk_4CB);
if ( v10 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 58LL, "is_s_in_f.c");
return (unsigned int)v10;
}
}
else
{
is_s_in_f_seq_I4(a1, a2, v13, a6, v16);
}
goto LABEL_30;
}
if ( a3 > 4 )
{
if ( a3 == 5 )
{
v10 = stoI8(a5, &v12);
if ( v10 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 45LL, "is_s_in_f.c");
return (unsigned int)v10;
}
if ( !strcmp(a4, "ascending") )
{
v10 = bin_search_I8(a1, a6, v12, v16, &unk_4CB);
if ( v10 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 61LL, "is_s_in_f.c");
return (unsigned int)v10;
}
}
else
{
is_s_in_f_seq_I8(a1, a2, v12, a6, v16);
}
goto LABEL_30;
}
goto LABEL_34;
}
if ( a3 != 2 )
{
if ( a3 == 3 )
{
v10 = stoI2(a5, &v14);
if ( v10 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 43LL, "is_s_in_f.c");
return (unsigned int)v10;
}
if ( strcmp(a4, "ascending") )
{
is_s_in_f_seq_I2(a1, a2, (unsigned int)v14, a6, v16);
goto LABEL_30;
}
goto LABEL_10;
}
LABEL_34:
fprintf(stderr, "Line %3d of File %s \n", 46LL, "is_s_in_f.c");
return (unsigned int)-1;
}
v10 = stoI1(a5, &v15);
if ( v10 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 42LL, "is_s_in_f.c");
return (unsigned int)v10;
}
if ( strcmp(a4, "ascending") )
{
is_s_in_f_seq_I1(a1, a2, (unsigned int)v15, a6, v16);
goto LABEL_30;
}
if ( a3 != 3 )
{
if ( a3 != 2 )
{
fprintf(stderr, "Line %3d of File %s \n", 64LL, "is_s_in_f.c");
return (unsigned int)-1;
}
v10 = bin_search_I1(a1, a6, (unsigned int)v15, v16, &unk_4CB);
if ( v10 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 52LL, "is_s_in_f.c");
return (unsigned int)v10;
}
LABEL_30:
*a7 = v16[0];
return (unsigned int)v10;
}
LABEL_10:
v10 = bin_search_I2(a1, a6, (unsigned int)v14, v16, &unk_4CB);
if ( v10 >= 0 )
goto LABEL_30;
fprintf(stderr, "Line %3d of File %s \n", 55LL, "is_s_in_f.c");
return (unsigned int)v10;
}

original_code:
int
is_s_in_f(
    char *X,
    char *nn_X,
    FLD_TYPE fldtype,
    char *str_srttype,
    char *str_val,
    long long nR,
    long long *ptr_idx
    )
{
  int status = 0;
  long long idx = -1;
  char I1val, *I1ptr = (char *)X;
  short I2val, *I2ptr = (short *)X;
  int I4val, *I4ptr = (int *)X;
  long long I8val, *I8ptr = (long long *)X;
  *ptr_idx = -1;
  if ( X == ((void *)0) ) { { { fprintf(stderr, "Line %3d of File %s \n", 37, "is_s_in_f.c"); }; status = -1 ; goto BYE; }; }
  if ( str_val == ((void *)0) ) { { { fprintf(stderr, "Line %3d of File %s \n", 38, "is_s_in_f.c"); }; status = -1 ; goto BYE; }; }
  if ( str_srttype == ((void *)0) ) { { { fprintf(stderr, "Line %3d of File %s \n", 39, "is_s_in_f.c"); }; status = -1 ; goto BYE; }; }
  switch ( fldtype ) {
    case I1 : status = stoI1(str_val, &I1val); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 42, "is_s_in_f.c"); }; status = (status) ; goto BYE; } } }; break;
    case I2 : status = stoI2(str_val, &I2val); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 43, "is_s_in_f.c"); }; status = (status) ; goto BYE; } } }; break;
    case I4 : status = stoI4(str_val, &I4val); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 44, "is_s_in_f.c"); }; status = (status) ; goto BYE; } } }; break;
    case I8 : status = stoI8(str_val, &I8val); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 45, "is_s_in_f.c"); }; status = (status) ; goto BYE; } } }; break;
    default : { { fprintf(stderr, "Line %3d of File %s \n", 46, "is_s_in_f.c"); }; status = -1 ; goto BYE; }; break;
  }
  if ( strcmp(str_srttype, "ascending") == 0 ) {
    switch ( fldtype ) {
      case I1 :
 status = bin_search_I1(I1ptr, nR, I1val, &idx, ""); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 52, "is_s_in_f.c"); }; status = (status) ; goto BYE; } } };
 break;
      case I2 :
 status = bin_search_I2(I2ptr, nR, I2val, &idx, ""); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 55, "is_s_in_f.c"); }; status = (status) ; goto BYE; } } };
 break;
      case I4 :
 status = bin_search_I4(I4ptr, nR, I4val, &idx, ""); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 58, "is_s_in_f.c"); }; status = (status) ; goto BYE; } } };
 break;
      case I8 :
 status = bin_search_I8(I8ptr, nR, I8val, &idx, ""); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 61, "is_s_in_f.c"); }; status = (status) ; goto BYE; } } };
 break;
      default :
 { { fprintf(stderr, "Line %3d of File %s \n", 64, "is_s_in_f.c"); }; status = -1 ; goto BYE; };
 break;
    }
  }
  else {
    switch ( fldtype ) {
      case I1 :
        is_s_in_f_seq_I1(I1ptr, nn_X, I1val, nR, &idx);{ if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 71, "is_s_in_f.c"); }; status = (status) ; goto BYE; } } };
 break;
      case I2 :
        is_s_in_f_seq_I2(I2ptr, nn_X, I2val, nR, &idx);{ if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 74, "is_s_in_f.c"); }; status = (status) ; goto BYE; } } };
 break;
      case I4 :
        is_s_in_f_seq_I4(I4ptr, nn_X, I4val, nR, &idx);{ if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 77, "is_s_in_f.c"); }; status = (status) ; goto BYE; } } };
 break;
      case I8 :
        is_s_in_f_seq_I8(I8ptr, nn_X, I8val, nR, &idx);{ if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 80, "is_s_in_f.c"); }; status = (status) ; goto BYE; } } };
 break;
      default :
 { { fprintf(stderr, "Line %3d of File %s \n", 83, "is_s_in_f.c"); }; status = -1 ; goto BYE; };
 break;
    }
  }
  *ptr_idx = idx;
BYE:
  return status ;
}

canonical_original_code:
int is_s_in_f(char *X, char *nn_X, enum _FLD_TYPE fldtype, char *str_srttype, char *str_val, long long nR, long long *ptr_idx)
{
  int status = 0;
  long long idx = -1;
  char I1val; char *I1ptr = (char *)X;
  short I2val; short *I2ptr = (short *)X;
  int I4val; int *I4ptr = (int *)X;
  long long I8val; long long *I8ptr = (long long *)X;
  *ptr_idx = -1;
  if ( X == ((void *)0) ) { { { fprintf(stderr, "Line %3d of File %s \n", 37, "is_s_in_f.c"); }; status = -1 ; goto BYE; }; }
  if ( str_val == ((void *)0) ) { { { fprintf(stderr, "Line %3d of File %s \n", 38, "is_s_in_f.c"); }; status = -1 ; goto BYE; }; }
  if ( str_srttype == ((void *)0) ) { { { fprintf(stderr, "Line %3d of File %s \n", 39, "is_s_in_f.c"); }; status = -1 ; goto BYE; }; }
  switch ( fldtype ) {
    case I1 : status = stoI1(str_val, &I1val); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 42, "is_s_in_f.c"); }; status = (status) ; goto BYE; } } }; break;
    case I2 : status = stoI2(str_val, &I2val); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 43, "is_s_in_f.c"); }; status = (status) ; goto BYE; } } }; break;
    case I4 : status = stoI4(str_val, &I4val); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 44, "is_s_in_f.c"); }; status = (status) ; goto BYE; } } }; break;
    case I8 : status = stoI8(str_val, &I8val); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 45, "is_s_in_f.c"); }; status = (status) ; goto BYE; } } }; break;
    default : { { fprintf(stderr, "Line %3d of File %s \n", 46, "is_s_in_f.c"); }; status = -1 ; goto BYE; }; break;
  }
  if ( strcmp(str_srttype, "ascending") == 0 ) {
    switch ( fldtype ) {
      case I1 :
 status = bin_search_I1(I1ptr, nR, I1val, &idx, ""); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 52, "is_s_in_f.c"); }; status = (status) ; goto BYE; } } };
 break;
      case I2 :
 status = bin_search_I2(I2ptr, nR, I2val, &idx, ""); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 55, "is_s_in_f.c"); }; status = (status) ; goto BYE; } } };
 break;
      case I4 :
 status = bin_search_I4(I4ptr, nR, I4val, &idx, ""); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 58, "is_s_in_f.c"); }; status = (status) ; goto BYE; } } };
 break;
      case I8 :
 status = bin_search_I8(I8ptr, nR, I8val, &idx, ""); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 61, "is_s_in_f.c"); }; status = (status) ; goto BYE; } } };
 break;
      default :
 { { fprintf(stderr, "Line %3d of File %s \n", 64, "is_s_in_f.c"); }; status = -1 ; goto BYE; };
 break;
    }
  }
  else {
    switch ( fldtype ) {
      case I1 :
        is_s_in_f_seq_I1(I1ptr, nn_X, I1val, nR, &idx);{ if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 71, "is_s_in_f.c"); }; status = (status) ; goto BYE; } } };
 break;
      case I2 :
        is_s_in_f_seq_I2(I2ptr, nn_X, I2val, nR, &idx);{ if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 74, "is_s_in_f.c"); }; status = (status) ; goto BYE; } } };
 break;
      case I4 :
        is_s_in_f_seq_I4(I4ptr, nn_X, I4val, nR, &idx);{ if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 77, "is_s_in_f.c"); }; status = (status) ; goto BYE; } } };
 break;
      case I8 :
        is_s_in_f_seq_I8(I8ptr, nn_X, I8val, nR, &idx);{ if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 80, "is_s_in_f.c"); }; status = (status) ; goto BYE; } } };
 break;
      default :
 { { fprintf(stderr, "Line %3d of File %s \n", 83, "is_s_in_f.c"); }; status = -1 ; goto BYE; };
 break;
    }
  }
  *ptr_idx = idx;
BYE:
  return status ;
}

variable_types:
idx
long long


repo: linkedin/datacl

decompiled_code:
__int64 __fastcall sort3_asc_F4(float *a1, float *a2)
{
float v2; // xmm2_4
float v3; // xmm4_4
float v4; // xmm3_4
float v5; // xmm5_4
__int64 result; // rax

v2 = a1[1];
v3 = a1[2];
v4 = a2[1];
v5 = a2[2];
result = 1LL;
if ( *a1 <= *a2 )
{
result = 0xFFFFFFFFLL;
if ( *a2 <= *a1 )
{
result = 1LL;
if ( v2 <= v4 )
{
result = 0xFFFFFFFFLL;
if ( v4 <= v2 )
{
result = 1LL;
if ( v3 <= v5 )
result = (unsigned int)-(v5 > v3);
}
}
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(float *a1, float *a2)
{
float v2; // xmm2_4
float v3; // xmm4_4
float v4; // xmm3_4
float v5; // xmm5_4
__int64 result; // rax

v2 = a1[1];
v3 = a1[2];
v4 = a2[1];
v5 = a2[2];
result = 1LL;
if ( *a1 <= *a2 )
{
result = 0xFFFFFFFFLL;
if ( *a2 <= *a1 )
{
result = 1LL;
if ( v2 <= v4 )
{
result = 0xFFFFFFFFLL;
if ( v4 <= v2 )
{
result = 1LL;
if ( v3 <= v5 )
result = (unsigned int)-(v5 > v3);
}
}
}
}
return result;
}

original_code:
int sort3_asc_F4(
     const void *ii,
     const void *jj
     )
{
  float val11, val12, val13, val21,val22, val23;
  float *ptr1, *ptr2;
  ptr1 = (float *)ii;
  ptr2 = (float *)jj;
  val11 = *ptr1++;
  val12 = *ptr1++;
  val13 = *ptr1++;
  val21 = *ptr2++;
  val22 = *ptr2++;
  val23 = *ptr2++;
  if ( val11 > val21 ) {
    return (1);
  }
  else if ( val11 < val21 ) {
    return (-1);
  }
  else {
    if ( val12 > val22 ) {
      return (1);
    }
    else if ( val12 < val22 ) {
      return (-1);
    }
    else {
      if ( val13 > val23 ) {
 return (1);
      }
      else if ( val13 < val23 ) {
 return (-1);
      }
      else {
 return(0);
      }
    }
  }
}

canonical_original_code:
int sort3_asc_F4(void *ii, void *jj)
{
  float val11; float val12; float val13; float val21; float val22; float val23;
  float *ptr1; float *ptr2;
  ptr1 = (float *)ii;
  ptr2 = (float *)jj;
  val11 = *ptr1++;
  val12 = *ptr1++;
  val13 = *ptr1++;
  val21 = *ptr2++;
  val22 = *ptr2++;
  val23 = *ptr2++;
  if ( val11 > val21 ) {
    return (1);
  }
  else if ( val11 < val21 ) {
    return (-1);
  }
  else {
    if ( val12 > val22 ) {
      return (1);
    }
    else if ( val12 < val22 ) {
      return (-1);
    }
    else {
      if ( val13 > val23 ) {
 return (1);
      }
      else if ( val13 < val23 ) {
 return (-1);
      }
      else {
 return(0);
      }
    }
  }
}

variable_types:
ii
void *

variable_types:
jj
void *

return_type: int


original_code:
void
sub2_I4(
       int *in1,
       int *in2,
       long long nR,
       int * restrict out
       )
{
  int inv1, inv2, outv;
  for ( long long i = 0; i < nR; i++ ) {
    inv1 = *in1;
    inv2 = *in2;
    outv = inv1 - inv2;
    *out = outv;
    in1++;
    in2++;
    out++;
  }
}

canonical_original_code:
void sub2_I4(int *in1, int *in2, long long nR, int *out)
{
  int inv1; int inv2; int outv;
  for ( long long i = 0; i < nR; i++ ) {
    inv1 = *in1;
    inv2 = *in2;
    outv = inv1 - inv2;
    *out = outv;
    in1++;
    in2++;
    out++;
  }
}

variable_types:
nR
long long

variable_types:
out
int *

variable_types: outv int

variable_types:
i
long long

return_type: void


qtils

decompiled_code:
__int64 __fastcall qtils(unsigned int a1, _QWORD *a2, char *a3, unsigned int a4)
{
__int64 v7; // rdx
const char *v8; // r14
int v9; // ebx
bool v10; // cf
bool v11; // zf
const char *v12; // rax
const char *v13; // rdi
__int64 v14; // rcx
const char *v15; // rsi
int v16; // ebp
bool v17; // cf
bool v18; // zf
const char *v19; // rdi
__int64 v20; // rcx
const char *v21; // rsi
__int64 v23; // rax
_BYTE *v24; // r12
const char *v25; // r13
const char *v26; // r14
const char *v27; // r15
bool v28; // al
bool v29; // cf
bool v30; // zf
const char *v31; // rdi
__int64 v32; // rcx
const char *v33; // rsi
bool v34; // al
bool v35; // cf
bool v36; // zf
const char *v37; // rdi
__int64 v38; // rcx
const char *v39; // rsi
char *v40; // rax
int v41; // [rsp+Ch] [rbp-104Ch] BYREF
char dest[4108]; // [rsp+10h] [rbp-1048h] BYREF
unsigned int v43[15]; // [rsp+101Ch] [rbp-3Ch] BYREF

if ( a1 - 2 > 0xB )
{
fprintf(stderr, "Line %3d of File %s \n", 39LL, "qtils.c");
v9 = -1;
}
else
{
v7 = a4;
v8 = (const char *)a2[1];
v11 = strcmp(v8, "time_since_epoch") == 0;
v9 = !v11;
if ( v11 )
{
v10 = a1 < 3;
v11 = a1 == 3;
if ( a1 == 3 )
{
v12 = (const char *)a2[2];
v13 = "usec";
v14 = 5LL;
v15 = v12;
do
{
if ( !v14 )
break;
v10 = *v15 < (unsigned int)*v13;
v11 = *v15++ == *v13++;
--v14;
}
while ( v11 );
v16 = (char)((!v10 && !v11) - v10);
v17 = 0;
v18 = v16 == 0;
if ( v16 )
{
v19 = "sec";
v20 = 4LL;
v21 = v12;
do
{
if ( !v20 )
break;
v17 = *v21 < (unsigned int)*v19;
v18 = *v21++ == *v19++;
--v20;
}
while ( v18 );
if ( (!v17 && !v18) == v17 )
{
v9 = time1(v43, v21, v7);
if ( v9 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 46LL, "qtils.c");
else
sprintf(a3, "%d", v43[0]);
}
}
else
{
v23 = get_time_usec(v13, v15, v7);
sprintf(a3, "%llu", v23);
v9 = 0;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 41LL, "qtils.c");
v9 = -1;
}
}
else if ( !strcmp(v8, "hdfs_get") )
{
if ( a1 == 11 )
{
zero_string(dest, 4096LL, a4);
v24 = (_BYTE *)a2[2];
if ( *v24 )
{
v25 = (const char *)a2[3];
if ( *v25 )
{
v26 = (const char *)a2[4];
if ( *v26 )
{
v27 = (const char *)a2[5];
if ( *v27 )
{
if ( *v27 == 47 )
{
v9 = stoI4(a2[4], &v41);
if ( v9 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 64LL, "qtils.c");
}
else if ( v41 <= 1023 )
{
fprintf(stderr, "Line %3d of File %s \n", 65LL, "qtils.c");
v9 = -1;
}
else
{
strcpy(dest, "http://");
strcat(dest, v25);
*(_WORD *)&dest[strlen(dest)] = 58;
strcat(dest, v26);
strcat(dest, "/webhdfs/v1");
strcat(dest, v27);
v9 = hdfs_get(v24, dest, a2[6], a2[7], a2[8], a2[9], a2[10]);
if ( v9 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 74LL, "qtils.c");
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 63LL, "qtils.c");
v9 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 61LL, "qtils.c");
v9 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 60LL, "qtils.c");
v9 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 59LL, "qtils.c");
v9 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 58LL, "qtils.c");
v9 = -1;
}
}
else
{
fprintf(stderr, "argc = %d \n", a1);
fprintf(stderr, "Line %3d of File %s \n", 51LL, "qtils.c");
v9 = -1;
}
}
else if ( !strcmp(v8, "replace_char") )
{
if ( a1 == 5 )
{
v9 = replace_char(a2[2], a2[3], a2[4]);
if ( v9 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 78LL, "qtils.c");
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 77LL, "qtils.c");
v9 = -1;
}
}
else if ( !strcmp(v8, "tab_split") )
{
if ( a1 == 7 )
{
v9 = tab_split(a2[2], a2[3], a2[4], a2[5], a2[6]);
if ( v9 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 82LL, "qtils.c");
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 81LL, "qtils.c");
v9 = -1;
}
}
else
{
v28 = strcmp(v8, "qhead") != 0;
v29 = 0;
v30 = !v28;
if ( v28 )
{
v31 = "chk_ascii";
v32 = 10LL;
v33 = v8;
do
{
if ( !v32 )
break;
v29 = *v33 < (unsigned int)*v31;
v30 = *v33++ == *v31++;
--v32;
}
while ( v30 );
if ( (!v29 && !v30) == v29 )
{
if ( a1 == 3 )
{
v9 = chk_ascii(a2[2], v33, v7);
if ( v9 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 90LL, "qtils.c");
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 89LL, "qtils.c");
v9 = -1;
}
}
else if ( !strcmp(v8, "urlencode") )
{
if ( a1 == 3 )
{
v9 = ext_url_encode(a2[2], a3, v7);
if ( v9 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 94LL, "qtils.c");
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 93LL, "qtils.c");
v9 = -1;
}
}
else
{
v34 = strcmp(v8, "urldecode") != 0;
v35 = 0;
v36 = !v34;
if ( v34 )
{
v37 = "esc_for_latex";
v38 = 14LL;
v39 = v8;
do
{
if ( !v38 )
break;
v35 = *v39 < (unsigned int)*v37;
v36 = *v39++ == *v37++;
--v38;
}
while ( v36 );
if ( (!v35 && !v36) == v35 )
{
if ( a1 == 2 )
{
v9 = esc_for_latex(v37, v39, v7);
if ( v9 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 102LL, "qtils.c");
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 101LL, "qtils.c");
v9 = -1;
}
}
else if ( !strcmp(v8, "hash_string") )
{
if ( a1 == 4 )
{
v9 = ext_hash_string(a2[2], a2[3], v7);
if ( v9 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 106LL, "qtils.c");
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 105LL, "qtils.c");
v9 = -1;
}
}
else if ( !strcmp(v8, "txt_sub") )
{
if ( a1 == 4 )
{
v9 = txt_sub(a2[2], a2[3]);
if ( v9 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 110LL, "qtils.c");
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 109LL, "qtils.c");
v9 = -1;
}
}
else if ( !strcmp(v8, "asc2bin") )
{
if ( a1 == 5 )
{
v9 = asc2bin(a2[2], a2[3], a2[4]);
if ( v9 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 114LL, "qtils.c");
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 113LL, "qtils.c");
v9 = -1;
}
}
else if ( !strcmp(v8, "bin2asc") )
{
if ( a1 == 6 )
{
v9 = bin2asc(a2[2], a2[3], a2[4], a2[5]);
if ( v9 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 118LL, "qtils.c");
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 117LL, "qtils.c");
v9 = -1;
}
}
else if ( !strcmp(v8, "date_to_I4") )
{
if ( a1 == 6 )
{
v9 = date_to_I4(a2[2], a2[3], a2[4], a2[5]);
if ( v9 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 122LL, "qtils.c");
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 121LL, "qtils.c");
v9 = -1;
}
}
else if ( !strcmp(v8, "sortbindmp") )
{
if ( a1 == 5 )
{
v9 = sortbindmp(a2[2], a2[3], a2[4]);
if ( v9 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 126LL, "qtils.c");
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 125LL, "qtils.c");
v9 = -1;
}
}
else if ( !strcmp(v8, "mk_ldb_dict") )
{
if ( a1 == 9 )
{
v40 = getenv("Q_DATA_DIR");
if ( v40 )
{
v9 = mk_ldb_dict(a2[2], a2[3], a2[4], a2[5], a2[6], a2[7], a2[8], v40);
if ( v9 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 134LL, "qtils.c");
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 131LL, "qtils.c");
v9 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 129LL, "qtils.c");
v9 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 139LL, "qtils.c");
v9 = -1;
}
}
else if ( a1 == 3 )
{
v9 = ext_url_decode(a2[2], a3, v7);
if ( v9 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 98LL, "qtils.c");
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 97LL, "qtils.c");
v9 = -1;
}
}
}
else if ( a1 == 5 )
{
v9 = qhead(a2[2], a2[3], a2[4]);
if ( v9 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 86LL, "qtils.c");
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 85LL, "qtils.c");
v9 = -1;
}
}
}
return (unsigned int)v9;
}

canonical_decompiled_code:
__int64 __fastcall func0(unsigned int a1, _QWORD *a2, char *a3, unsigned int a4)
{
__int64 v7; // rdx
const char *v8; // r14
int v9; // ebx
bool v10; // cf
bool v11; // zf
const char *v12; // rax
const char *v13; // rdi
__int64 v14; // rcx
const char *v15; // rsi
int v16; // ebp
bool v17; // cf
bool v18; // zf
const char *v19; // rdi
__int64 v20; // rcx
const char *v21; // rsi
__int64 v23; // rax
_BYTE *v24; // r12
const char *v25; // r13
const char *v26; // r14
const char *v27; // r15
bool v28; // al
bool v29; // cf
bool v30; // zf
const char *v31; // rdi
__int64 v32; // rcx
const char *v33; // rsi
bool v34; // al
bool v35; // cf
bool v36; // zf
const char *v37; // rdi
__int64 v38; // rcx
const char *v39; // rsi
char *v40; // rax
int v41; // [rsp+Ch] [rbp-104Ch] BYREF
char dest[4108]; // [rsp+10h] [rbp-1048h] BYREF
unsigned int v43[15]; // [rsp+101Ch] [rbp-3Ch] BYREF

if ( a1 - 2 > 0xB )
{
fprintf(stderr, "Line %3d of File %s \n", 39LL, "qtils.c");
v9 = -1;
}
else
{
v7 = a4;
v8 = (const char *)a2[1];
v11 = strcmp(v8, "time_since_epoch") == 0;
v9 = !v11;
if ( v11 )
{
v10 = a1 < 3;
v11 = a1 == 3;
if ( a1 == 3 )
{
v12 = (const char *)a2[2];
v13 = "usec";
v14 = 5LL;
v15 = v12;
do
{
if ( !v14 )
break;
v10 = *v15 < (unsigned int)*v13;
v11 = *v15++ == *v13++;
--v14;
}
while ( v11 );
v16 = (char)((!v10 && !v11) - v10);
v17 = 0;
v18 = v16 == 0;
if ( v16 )
{
v19 = "sec";
v20 = 4LL;
v21 = v12;
do
{
if ( !v20 )
break;
v17 = *v21 < (unsigned int)*v19;
v18 = *v21++ == *v19++;
--v20;
}
while ( v18 );
if ( (!v17 && !v18) == v17 )
{
v9 = time1(v43, v21, v7);
if ( v9 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 46LL, "qtils.c");
else
sprintf(a3, "%d", v43[0]);
}
}
else
{
v23 = get_time_usec(v13, v15, v7);
sprintf(a3, "%llu", v23);
v9 = 0;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 41LL, "qtils.c");
v9 = -1;
}
}
else if ( !strcmp(v8, "hdfs_get") )
{
if ( a1 == 11 )
{
zero_string(dest, 4096LL, a4);
v24 = (_BYTE *)a2[2];
if ( *v24 )
{
v25 = (const char *)a2[3];
if ( *v25 )
{
v26 = (const char *)a2[4];
if ( *v26 )
{
v27 = (const char *)a2[5];
if ( *v27 )
{
if ( *v27 == 47 )
{
v9 = stoI4(a2[4], &v41);
if ( v9 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 64LL, "qtils.c");
}
else if ( v41 <= 1023 )
{
fprintf(stderr, "Line %3d of File %s \n", 65LL, "qtils.c");
v9 = -1;
}
else
{
strcpy(dest, "http://");
strcat(dest, v25);
*(_WORD *)&dest[strlen(dest)] = 58;
strcat(dest, v26);
strcat(dest, "/webhdfs/v1");
strcat(dest, v27);
v9 = hdfs_get(v24, dest, a2[6], a2[7], a2[8], a2[9], a2[10]);
if ( v9 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 74LL, "qtils.c");
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 63LL, "qtils.c");
v9 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 61LL, "qtils.c");
v9 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 60LL, "qtils.c");
v9 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 59LL, "qtils.c");
v9 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 58LL, "qtils.c");
v9 = -1;
}
}
else
{
fprintf(stderr, "argc = %d \n", a1);
fprintf(stderr, "Line %3d of File %s \n", 51LL, "qtils.c");
v9 = -1;
}
}
else if ( !strcmp(v8, "replace_char") )
{
if ( a1 == 5 )
{
v9 = replace_char(a2[2], a2[3], a2[4]);
if ( v9 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 78LL, "qtils.c");
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 77LL, "qtils.c");
v9 = -1;
}
}
else if ( !strcmp(v8, "tab_split") )
{
if ( a1 == 7 )
{
v9 = tab_split(a2[2], a2[3], a2[4], a2[5], a2[6]);
if ( v9 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 82LL, "qtils.c");
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 81LL, "qtils.c");
v9 = -1;
}
}
else
{
v28 = strcmp(v8, "qhead") != 0;
v29 = 0;
v30 = !v28;
if ( v28 )
{
v31 = "chk_ascii";
v32 = 10LL;
v33 = v8;
do
{
if ( !v32 )
break;
v29 = *v33 < (unsigned int)*v31;
v30 = *v33++ == *v31++;
--v32;
}
while ( v30 );
if ( (!v29 && !v30) == v29 )
{
if ( a1 == 3 )
{
v9 = chk_ascii(a2[2], v33, v7);
if ( v9 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 90LL, "qtils.c");
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 89LL, "qtils.c");
v9 = -1;
}
}
else if ( !strcmp(v8, "urlencode") )
{
if ( a1 == 3 )
{
v9 = ext_url_encode(a2[2], a3, v7);
if ( v9 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 94LL, "qtils.c");
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 93LL, "qtils.c");
v9 = -1;
}
}
else
{
v34 = strcmp(v8, "urldecode") != 0;
v35 = 0;
v36 = !v34;
if ( v34 )
{
v37 = "esc_for_latex";
v38 = 14LL;
v39 = v8;
do
{
if ( !v38 )
break;
v35 = *v39 < (unsigned int)*v37;
v36 = *v39++ == *v37++;
--v38;
}
while ( v36 );
if ( (!v35 && !v36) == v35 )
{
if ( a1 == 2 )
{
v9 = esc_for_latex(v37, v39, v7);
if ( v9 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 102LL, "qtils.c");
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 101LL, "qtils.c");
v9 = -1;
}
}
else if ( !strcmp(v8, "hash_string") )
{
if ( a1 == 4 )
{
v9 = ext_hash_string(a2[2], a2[3], v7);
if ( v9 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 106LL, "qtils.c");
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 105LL, "qtils.c");
v9 = -1;
}
}
else if ( !strcmp(v8, "txt_sub") )
{
if ( a1 == 4 )
{
v9 = txt_sub(a2[2], a2[3]);
if ( v9 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 110LL, "qtils.c");
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 109LL, "qtils.c");
v9 = -1;
}
}
else if ( !strcmp(v8, "asc2bin") )
{
if ( a1 == 5 )
{
v9 = asc2bin(a2[2], a2[3], a2[4]);
if ( v9 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 114LL, "qtils.c");
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 113LL, "qtils.c");
v9 = -1;
}
}
else if ( !strcmp(v8, "bin2asc") )
{
if ( a1 == 6 )
{
v9 = bin2asc(a2[2], a2[3], a2[4], a2[5]);
if ( v9 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 118LL, "qtils.c");
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 117LL, "qtils.c");
v9 = -1;
}
}
else if ( !strcmp(v8, "date_to_I4") )
{
if ( a1 == 6 )
{
v9 = date_to_I4(a2[2], a2[3], a2[4], a2[5]);
if ( v9 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 122LL, "qtils.c");
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 121LL, "qtils.c");
v9 = -1;
}
}
else if ( !strcmp(v8, "sortbindmp") )
{
if ( a1 == 5 )
{
v9 = sortbindmp(a2[2], a2[3], a2[4]);
if ( v9 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 126LL, "qtils.c");
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 125LL, "qtils.c");
v9 = -1;
}
}
else if ( !strcmp(v8, "mk_ldb_dict") )
{
if ( a1 == 9 )
{
v40 = getenv("Q_DATA_DIR");
if ( v40 )
{
v9 = mk_ldb_dict(a2[2], a2[3], a2[4], a2[5], a2[6], a2[7], a2[8], v40);
if ( v9 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 134LL, "qtils.c");
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 131LL, "qtils.c");
v9 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 129LL, "qtils.c");
v9 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 139LL, "qtils.c");
v9 = -1;
}
}
else if ( a1 == 3 )
{
v9 = ext_url_decode(a2[2], a3, v7);
if ( v9 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 98LL, "qtils.c");
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 97LL, "qtils.c");
v9 = -1;
}
}
}
else if ( a1 == 5 )
{
v9 = qhead(a2[2], a2[3], a2[4]);
if ( v9 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 86LL, "qtils.c");
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 85LL, "qtils.c");
v9 = -1;
}
}
}
return (unsigned int)v9;
}

original_code:
int
qtils(
      int argc,
      char **argv,
      char *rslt_buf,
      int sz_rslt_buf
      )
{
  int status = 0;
  int itemp;
  if ( ( argc <= 1 ) || ( argc >= 14 ) ) {{ { fprintf(stderr, "Line %3d of File %s \n", 39, "qtils.c"); }; status = -1 ; goto BYE; }; }
  if ( strcmp(argv[1], "time_since_epoch") == 0 ) {
    if ( argc != 3 ) { { { fprintf(stderr, "Line %3d of File %s \n", 41, "qtils.c"); }; status = -1 ; goto BYE; }; }
    if ( strcmp(argv[2], "usec") == 0 ) {
      sprintf(rslt_buf, "%llu", get_time_usec());
    }
    else if ( strcmp(argv[2], "sec") == 0 ) {
      status = time1(&itemp); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 46, "qtils.c"); }; status = (status) ; goto BYE; } } };
      sprintf(rslt_buf, "%d", itemp);
    }
  }
  else if ( strcmp(argv[1], "hdfs_get") == 0 ) {
    if ( argc != 11 ) { fprintf(stderr, "argc = %d \n", argc); { { fprintf(stderr, "Line %3d of File %s \n", 51, "qtils.c"); }; status = -1 ; goto BYE; }; }
    char url[4096]; zero_string(url, 4096); int port;
    char *username = argv[2];
    char *server = argv[3];
    char *str_port = argv[4];
    char *from = argv[5];
    if ( *username == '\0' ) { { { fprintf(stderr, "Line %3d of File %s \n", 58, "qtils.c"); }; status = -1 ; goto BYE; }; }
    if ( *server == '\0' ) { { { fprintf(stderr, "Line %3d of File %s \n", 59, "qtils.c"); }; status = -1 ; goto BYE; }; }
    if ( *str_port == '\0' ) { { { fprintf(stderr, "Line %3d of File %s \n", 60, "qtils.c"); }; status = -1 ; goto BYE; }; }
    if ( *from == '\0' ) { { { fprintf(stderr, "Line %3d of File %s \n", 61, "qtils.c"); }; status = -1 ; goto BYE; }; }
    if ( *from != '/' ) { { { fprintf(stderr, "Line %3d of File %s \n", 63, "qtils.c"); }; status = -1 ; goto BYE; }; }
    status = stoI4(str_port, &port); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 64, "qtils.c"); }; status = (status) ; goto BYE; } } };
    if ( port < 1024 ) { { { fprintf(stderr, "Line %3d of File %s \n", 65, "qtils.c"); }; status = -1 ; goto BYE; }; }
    strcpy(url, "http://");
    strcat(url, server);
    strcat(url, ":");
    strcat(url, str_port);
    strcat(url, "/webhdfs/v1");
    strcat(url, from);
    status = hdfs_get(username, url, argv[6], argv[7], argv[8], argv[9], argv[10]);
    { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 74, "qtils.c"); }; status = (status) ; goto BYE; } } };
  }
  else if ( strcmp(argv[1], "replace_char") == 0 ) {
    if ( argc != 5 ) { { { fprintf(stderr, "Line %3d of File %s \n", 77, "qtils.c"); }; status = -1 ; goto BYE; }; }
    status = replace_char(argv[2], argv[3], argv[4]); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 78, "qtils.c"); }; status = (status) ; goto BYE; } } };
  }
  else if ( strcmp(argv[1], "tab_split") == 0 ) {
    if ( argc != 7 ) { { { fprintf(stderr, "Line %3d of File %s \n", 81, "qtils.c"); }; status = -1 ; goto BYE; }; }
    status = tab_split(argv[2], argv[3], argv[4], argv[5], argv[6]); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 82, "qtils.c"); }; status = (status) ; goto BYE; } } };
  }
  else if ( strcmp(argv[1], "qhead") == 0 ) {
    if ( argc != 5 ) { { { fprintf(stderr, "Line %3d of File %s \n", 85, "qtils.c"); }; status = -1 ; goto BYE; }; }
    status = qhead(argv[2], argv[3], argv[4]); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 86, "qtils.c"); }; status = (status) ; goto BYE; } } };
  }
  else if ( strcmp(argv[1], "chk_ascii") == 0 ) {
    if ( argc != 3 ) { { { fprintf(stderr, "Line %3d of File %s \n", 89, "qtils.c"); }; status = -1 ; goto BYE; }; }
    status = chk_ascii(argv[2]); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 90, "qtils.c"); }; status = (status) ; goto BYE; } } };
  }
  else if ( strcmp(argv[1], "urlencode") == 0 ) {
    if ( argc != 3 ) { { { fprintf(stderr, "Line %3d of File %s \n", 93, "qtils.c"); }; status = -1 ; goto BYE; }; }
    status = ext_url_encode(argv[2], rslt_buf, sz_rslt_buf); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 94, "qtils.c"); }; status = (status) ; goto BYE; } } };
  }
  else if ( strcmp(argv[1], "urldecode") == 0 ) {
    if ( argc != 3 ) { { { fprintf(stderr, "Line %3d of File %s \n", 97, "qtils.c"); }; status = -1 ; goto BYE; }; }
    status = ext_url_decode(argv[2], rslt_buf, sz_rslt_buf); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 98, "qtils.c"); }; status = (status) ; goto BYE; } } };
  }
  else if ( strcmp(argv[1], "esc_for_latex") == 0 ) {
    if ( argc != 2 ) { { { fprintf(stderr, "Line %3d of File %s \n", 101, "qtils.c"); }; status = -1 ; goto BYE; }; }
    status = esc_for_latex(); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 102, "qtils.c"); }; status = (status) ; goto BYE; } } };
  }
  else if ( strcmp(argv[1], "hash_string") == 0 ) {
    if ( argc != 4 ) { { { fprintf(stderr, "Line %3d of File %s \n", 105, "qtils.c"); }; status = -1 ; goto BYE; }; }
    status = ext_hash_string(argv[2], argv[3]); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 106, "qtils.c"); }; status = (status) ; goto BYE; } } };
  }
  else if ( strcmp(argv[1], "txt_sub") == 0 ) {
    if ( argc != 4 ) { { { fprintf(stderr, "Line %3d of File %s \n", 109, "qtils.c"); }; status = -1 ; goto BYE; }; }
    status = txt_sub(argv[2], argv[3]); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 110, "qtils.c"); }; status = (status) ; goto BYE; } } };
  }
  else if ( strcmp(argv[1], "asc2bin") == 0 ) {
    if ( argc != 5 ) { { { fprintf(stderr, "Line %3d of File %s \n", 113, "qtils.c"); }; status = -1 ; goto BYE; }; }
    status = asc2bin(argv[2], argv[3], argv[4]); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 114, "qtils.c"); }; status = (status) ; goto BYE; } } };
  }
  else if ( strcmp(argv[1], "bin2asc") == 0 ) {
    if ( argc != 6 ) { { { fprintf(stderr, "Line %3d of File %s \n", 117, "qtils.c"); }; status = -1 ; goto BYE; }; }
    status = bin2asc(argv[2], argv[3], argv[4], argv[5]); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 118, "qtils.c"); }; status = (status) ; goto BYE; } } };
  }
  else if ( strcmp(argv[1], "date_to_I4") == 0 ) {
    if ( argc != 6 ) { { { fprintf(stderr, "Line %3d of File %s \n", 121, "qtils.c"); }; status = -1 ; goto BYE; }; }
    status = date_to_I4 (argv[2], argv[3], argv[4], argv[5]); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 122, "qtils.c"); }; status = (status) ; goto BYE; } } };
  }
  else if ( strcmp(argv[1], "sortbindmp") == 0 ) {
    if ( argc != 5 ) { { { fprintf(stderr, "Line %3d of File %s \n", 125, "qtils.c"); }; status = -1 ; goto BYE; }; }
    status = sortbindmp(argv[2], argv[3], argv[4]); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 126, "qtils.c"); }; status = (status) ; goto BYE; } } };
  }
  else if ( strcmp(argv[1], "mk_ldb_dict") == 0 ) {
    if ( argc != 9 ) { { { fprintf(stderr, "Line %3d of File %s \n", 129, "qtils.c"); }; status = -1 ; goto BYE; }; }
    char *q_data_dir = getenv("Q_DATA_DIR");
    if ( q_data_dir == ((void *)0) ) { { { fprintf(stderr, "Line %3d of File %s \n", 131, "qtils.c"); }; status = -1 ; goto BYE; }; }
    status = mk_ldb_dict(argv[2], argv[3], argv[4], argv[5], argv[6],
 argv[7], argv[8], q_data_dir);
    { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 134, "qtils.c"); }; status = (status) ; goto BYE; } } };
  }
  else { { { fprintf(stderr, "Line %3d of File %s \n", 139, "qtils.c"); }; status = -1 ; goto BYE; }; }
 BYE:
  return(status);
}

canonical_original_code:
int qtils(int argc, char **argv, char *rslt_buf, int sz_rslt_buf)
{
  int status = 0;
  int itemp;
  if ( ( argc <= 1 ) || ( argc >= 14 ) ) {{ { fprintf(stderr, "Line %3d of File %s \n", 39, "qtils.c"); }; status = -1 ; goto BYE; }; }
  if ( strcmp(argv[1], "time_since_epoch") == 0 ) {
    if ( argc != 3 ) { { { fprintf(stderr, "Line %3d of File %s \n", 41, "qtils.c"); }; status = -1 ; goto BYE; }; }
    if ( strcmp(argv[2], "usec") == 0 ) {
      sprintf(rslt_buf, "%llu", get_time_usec());
    }
    else if ( strcmp(argv[2], "sec") == 0 ) {
      status = time1(&itemp); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 46, "qtils.c"); }; status = (status) ; goto BYE; } } };
      sprintf(rslt_buf, "%d", itemp);
    }
  }
  else if ( strcmp(argv[1], "hdfs_get") == 0 ) {
    if ( argc != 11 ) { fprintf(stderr, "argc = %d \n", argc); { { fprintf(stderr, "Line %3d of File %s \n", 51, "qtils.c"); }; status = -1 ; goto BYE; }; }
    char url[4096]; zero_string(url, 4096); int port;
    char *username = argv[2];
    char *server = argv[3];
    char *str_port = argv[4];
    char *from = argv[5];
    if ( *username == '\0' ) { { { fprintf(stderr, "Line %3d of File %s \n", 58, "qtils.c"); }; status = -1 ; goto BYE; }; }
    if ( *server == '\0' ) { { { fprintf(stderr, "Line %3d of File %s \n", 59, "qtils.c"); }; status = -1 ; goto BYE; }; }
    if ( *str_port == '\0' ) { { { fprintf(stderr, "Line %3d of File %s \n", 60, "qtils.c"); }; status = -1 ; goto BYE; }; }
    if ( *from == '\0' ) { { { fprintf(stderr, "Line %3d of File %s \n", 61, "qtils.c"); }; status = -1 ; goto BYE; }; }
    if ( *from != '/' ) { { { fprintf(stderr, "Line %3d of File %s \n", 63, "qtils.c"); }; status = -1 ; goto BYE; }; }
    status = stoI4(str_port, &port); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 64, "qtils.c"); }; status = (status) ; goto BYE; } } };
    if ( port < 1024 ) { { { fprintf(stderr, "Line %3d of File %s \n", 65, "qtils.c"); }; status = -1 ; goto BYE; }; }
    strcpy(url, "http://");
    strcat(url, server);
    strcat(url, ":");
    strcat(url, str_port);
    strcat(url, "/webhdfs/v1");
    strcat(url, from);
    status = hdfs_get(username, url, argv[6], argv[7], argv[8], argv[9], argv[10]);
    { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 74, "qtils.c"); }; status = (status) ; goto BYE; } } };
  }
  else if ( strcmp(argv[1], "replace_char") == 0 ) {
    if ( argc != 5 ) { { { fprintf(stderr, "Line %3d of File %s \n", 77, "qtils.c"); }; status = -1 ; goto BYE; }; }
    status = replace_char(argv[2], argv[3], argv[4]); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 78, "qtils.c"); }; status = (status) ; goto BYE; } } };
  }
  else if ( strcmp(argv[1], "tab_split") == 0 ) {
    if ( argc != 7 ) { { { fprintf(stderr, "Line %3d of File %s \n", 81, "qtils.c"); }; status = -1 ; goto BYE; }; }
    status = tab_split(argv[2], argv[3], argv[4], argv[5], argv[6]); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 82, "qtils.c"); }; status = (status) ; goto BYE; } } };
  }
  else if ( strcmp(argv[1], "qhead") == 0 ) {
    if ( argc != 5 ) { { { fprintf(stderr, "Line %3d of File %s \n", 85, "qtils.c"); }; status = -1 ; goto BYE; }; }
    status = qhead(argv[2], argv[3], argv[4]); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 86, "qtils.c"); }; status = (status) ; goto BYE; } } };
  }
  else if ( strcmp(argv[1], "chk_ascii") == 0 ) {
    if ( argc != 3 ) { { { fprintf(stderr, "Line %3d of File %s \n", 89, "qtils.c"); }; status = -1 ; goto BYE; }; }
    status = chk_ascii(argv[2]); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 90, "qtils.c"); }; status = (status) ; goto BYE; } } };
  }
  else if ( strcmp(argv[1], "urlencode") == 0 ) {
    if ( argc != 3 ) { { { fprintf(stderr, "Line %3d of File %s \n", 93, "qtils.c"); }; status = -1 ; goto BYE; }; }
    status = ext_url_encode(argv[2], rslt_buf, sz_rslt_buf); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 94, "qtils.c"); }; status = (status) ; goto BYE; } } };
  }
  else if ( strcmp(argv[1], "urldecode") == 0 ) {
    if ( argc != 3 ) { { { fprintf(stderr, "Line %3d of File %s \n", 97, "qtils.c"); }; status = -1 ; goto BYE; }; }
    status = ext_url_decode(argv[2], rslt_buf, sz_rslt_buf); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 98, "qtils.c"); }; status = (status) ; goto BYE; } } };
  }
  else if ( strcmp(argv[1], "esc_for_latex") == 0 ) {
    if ( argc != 2 ) { { { fprintf(stderr, "Line %3d of File %s \n", 101, "qtils.c"); }; status = -1 ; goto BYE; }; }
    status = esc_for_latex(); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 102, "qtils.c"); }; status = (status) ; goto BYE; } } };
  }
  else if ( strcmp(argv[1], "hash_string") == 0 ) {
    if ( argc != 4 ) { { { fprintf(stderr, "Line %3d of File %s \n", 105, "qtils.c"); }; status = -1 ; goto BYE; }; }
    status = ext_hash_string(argv[2], argv[3]); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 106, "qtils.c"); }; status = (status) ; goto BYE; } } };
  }
  else if ( strcmp(argv[1], "txt_sub") == 0 ) {
    if ( argc != 4 ) { { { fprintf(stderr, "Line %3d of File %s \n", 109, "qtils.c"); }; status = -1 ; goto BYE; }; }
    status = txt_sub(argv[2], argv[3]); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 110, "qtils.c"); }; status = (status) ; goto BYE; } } };
  }
  else if ( strcmp(argv[1], "asc2bin") == 0 ) {
    if ( argc != 5 ) { { { fprintf(stderr, "Line %3d of File %s \n", 113, "qtils.c"); }; status = -1 ; goto BYE; }; }
    status = asc2bin(argv[2], argv[3], argv[4]); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 114, "qtils.c"); }; status = (status) ; goto BYE; } } };
  }
  else if ( strcmp(argv[1], "bin2asc") == 0 ) {
    if ( argc != 6 ) { { { fprintf(stderr, "Line %3d of File %s \n", 117, "qtils.c"); }; status = -1 ; goto BYE; }; }
    status = bin2asc(argv[2], argv[3], argv[4], argv[5]); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 118, "qtils.c"); }; status = (status) ; goto BYE; } } };
  }
  else if ( strcmp(argv[1], "date_to_I4") == 0 ) {
    if ( argc != 6 ) { { { fprintf(stderr, "Line %3d of File %s \n", 121, "qtils.c"); }; status = -1 ; goto BYE; }; }
    status = date_to_I4 (argv[2], argv[3], argv[4], argv[5]); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 122, "qtils.c"); }; status = (status) ; goto BYE; } } };
  }
  else if ( strcmp(argv[1], "sortbindmp") == 0 ) {
    if ( argc != 5 ) { { { fprintf(stderr, "Line %3d of File %s \n", 125, "qtils.c"); }; status = -1 ; goto BYE; }; }
    status = sortbindmp(argv[2], argv[3], argv[4]); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 126, "qtils.c"); }; status = (status) ; goto BYE; } } };
  }
  else if ( strcmp(argv[1], "mk_ldb_dict") == 0 ) {
    if ( argc != 9 ) { { { fprintf(stderr, "Line %3d of File %s \n", 129, "qtils.c"); }; status = -1 ; goto BYE; }; }
    char *q_data_dir = getenv("Q_DATA_DIR");
    if ( q_data_dir == ((void *)0) ) { { { fprintf(stderr, "Line %3d of File %s \n", 131, "qtils.c"); }; status = -1 ; goto BYE; }; }
    status = mk_ldb_dict(argv[2], argv[3], argv[4], argv[5], argv[6],
 argv[7], argv[8], q_data_dir);
    { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 134, "qtils.c"); }; status = (status) ; goto BYE; } } };
  }
  else { { { fprintf(stderr, "Line %3d of File %s \n", 139, "qtils.c"); }; status = -1 ; goto BYE; }; }
 BYE:
  return(status);
}

variable_types: argc int

variable_types:
argv
char **

variable_types: status int

variable_types: itemp int

variable_types:
url
char [4096]

variable_types: port int

variable_types:
username
char *

variable_types:
server
char *

variable_types:
from
char *


original_code:
void
core_wisifxthenyelsez_F4(
      char *X,
      char *nn_X,
      long long nR,
      float yval,
      char *in_Y,
      char *nn_Y,
      float zval,
      char *in_Z,
      char *nn_Z,
      char *in_W,
      char *nn_W,
      _Bool *ptr_is_some_null
      )
{
  float *W = (float *)in_W;
  float *Y = (float *)in_Y;
  float *Z = (float *)in_Z;
  for ( long long i = 0; i < nR; i++ ) {
    if ( ( nn_X == ((void *)0) ) || ( nn_X[i] == 1 ) ) {
      if ( X[i] == 1 ) {
 if ( in_Y == ((void *)0) ) {
   W[i] = yval;
   nn_W[i] = 1;
 }
 else {
   if ( ( nn_Y == ((void *)0) ) || ( nn_Y[i] == 1 ) ) {
     W[i] = Y[i];
     nn_W[i] = 1;
   }
   else {
     W[i] = 0;
     nn_W[i] = 0;
     *ptr_is_some_null = 0;
   }
 }
      }
      else if ( X[i] == 0 ) {
 if ( in_Z == ((void *)0) ) {
   W[i] = zval;
   nn_W[i] = 1;
 }
 else {
   if ( ( nn_Z == ((void *)0) ) || ( nn_Z[i] == 1 ) ) {
     W[i] = Z[i];
     nn_W[i] = 1;
   }
   else {
     W[i] = 0;
     nn_W[i] = 0;
     *ptr_is_some_null = 0;
   }
 }
      }
      else {
 exit(-1);
      }
    }
    else {
      W[i] = 0;
      nn_W[i] = 0;
      *ptr_is_some_null = 0;
    }
  }
}

canonical_original_code:
void core_wisifxthenyelsez_F4(char *X, char *nn_X, long long nR, float yval, char *in_Y, char *nn_Y, float zval, char *in_Z, char *nn_Z, char *in_W, char *nn_W, _Bool *ptr_is_some_null)
{
  float *W = (float *)in_W;
  float *Y = (float *)in_Y;
  float *Z = (float *)in_Z;
  for ( long long i = 0; i < nR; i++ ) {
    if ( ( nn_X == ((void *)0) ) || ( nn_X[i] == 1 ) ) {
      if ( X[i] == 1 ) {
 if ( in_Y == ((void *)0) ) {
   W[i] = yval;
   nn_W[i] = 1;
 }
 else {
   if ( ( nn_Y == ((void *)0) ) || ( nn_Y[i] == 1 ) ) {
     W[i] = Y[i];
     nn_W[i] = 1;
   }
   else {
     W[i] = 0;
     nn_W[i] = 0;
     *ptr_is_some_null = 0;
   }
 }
      }
      else if ( X[i] == 0 ) {
 if ( in_Z == ((void *)0) ) {
   W[i] = zval;
   nn_W[i] = 1;
 }
 else {
   if ( ( nn_Z == ((void *)0) ) || ( nn_Z[i] == 1 ) ) {
     W[i] = Z[i];
     nn_W[i] = 1;
   }
   else {
     W[i] = 0;
     nn_W[i] = 0;
     *ptr_is_some_null = 0;
   }
 }
      }
      else {
 exit(-1);
      }
    }
    else {
      W[i] = 0;
      nn_W[i] = 0;
      *ptr_is_some_null = 0;
    }
  }
}

variable_types:
X
char *

variable_types: yval float

variable_types: zval float

variable_types:
W
float *

variable_types:
Y
float *

variable_types:
Z
float *


decompiled_code:
__int64 __fastcall vec_s_to_f(__int64 a1, __int64 a2, __int64 a3)
{
int v4; // eax
int v5; // ebx
__int64 v7; // rax
__int64 v8; // rax
__int64 v9; // rax
__int64 v10[19]; // [rsp+0h] [rbp-158h] BYREF
int v11; // [rsp+98h] [rbp-C0h]
char v12[8]; // [rsp+A0h] [rbp-B8h] BYREF
char v13[7]; // [rsp+A8h] [rbp-B0h] BYREF
char v14; // [rsp+AFh] [rbp-A9h] BYREF
char v15[32]; // [rsp+B0h] [rbp-A8h] BYREF
char v16[40]; // [rsp+D0h] [rbp-88h] BYREF
char v17[6]; // [rsp+F8h] [rbp-60h] BYREF
__int16 v18; // [rsp+FEh] [rbp-5Ah] BYREF
__int16 v19; // [rsp+100h] [rbp-58h] BYREF
char v20[3]; // [rsp+102h] [rbp-56h] BYREF
char v21; // [rsp+105h] [rbp-53h] BYREF
char v22; // [rsp+106h] [rbp-52h] BYREF
char v23; // [rsp+107h] [rbp-51h] BYREF
__int64 v24; // [rsp+108h] [rbp-50h] BYREF
__int64 v25; // [rsp+110h] [rbp-48h] BYREF
char v26[12]; // [rsp+118h] [rbp-40h] BYREF
int v27; // [rsp+124h] [rbp-34h] BYREF
int v28; // [rsp+128h] [rbp-30h] BYREF
char v29[44]; // [rsp+12Ch] [rbp-2Ch] BYREF

v14 = 1;
zero_string(v16, 32LL);
zero_string(v15, 32LL);
v4 = extract_S(a3, "op=[", "]", v16, 32LL, &v14);
if ( v4 < 0 )
{
v5 = v4;
fprintf(stderr, "Line %3d of File %s \n", 49LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( v14 )
{
fprintf(stderr, "Line %3d of File %s \n", 49LL, "vec_s_to_f.c");
return (unsigned int)-1;
}
v5 = extract_S(a3, "fldtype=[", "]", v15, 32LL, &v14);
if ( v5 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 52LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( v14 )
{
fprintf(stderr, "Line %3d of File %s \n", 52LL, "vec_s_to_f.c");
return (unsigned int)-1;
}
v5 = partition(a2, 4096LL, 0xFFFFFFFFLL, v12, v13);
if ( v5 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 53LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( !strcmp(v16, "const") )
{
if ( !strcmp(v15, "I1") )
{
v5 = extract_I1(a3, "val=[", "]", &v23, &v14);
if ( v5 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 58LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( v14 )
{
fprintf(stderr, "Line %3d of File %s \n", 59LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
}
else if ( !strcmp(v15, "I2") )
{
v5 = extract_I2(a3, "val=[", "]", v20, &v14);
if ( v5 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 63LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( v14 )
{
fprintf(stderr, "Line %3d of File %s \n", 64LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
}
else if ( !strcmp(v15, "I4") )
{
v5 = extract_I4(a3, "val=[", "]", v29, &v14);
if ( v5 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 68LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( v14 )
{
fprintf(stderr, "Line %3d of File %s \n", 69LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
}
else if ( !strcmp(v15, "F4") )
{
v5 = extract_F4(a3, "val=[", "]", v17, &v14);
if ( v5 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 73LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( v14 )
{
fprintf(stderr, "Line %3d of File %s \n", 74LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
}
else
{
if ( strcmp(v15, "I8") )
{
fprintf(stderr, "Line %3d of File %s \n", 82LL, "vec_s_to_f.c");
return (unsigned int)-1;
}
v5 = extract_I8(a3, "val=[", "]", v26, &v14);
if ( v5 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 78LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( v14 )
{
fprintf(stderr, "Line %3d of File %s \n", 79LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
}
}
else
{
if ( strcmp(v16, "seq") )
{
fprintf(stderr, "Line %3d of File %s \n", 142LL, "vec_s_to_f.c");
return (unsigned int)-1;
}
if ( !strcmp(v15, "I1") )
{
v5 = extract_I1(a3, "start=[", "]", &v22, &v14);
if ( v5 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 88LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( v14 )
{
fprintf(stderr, "Line %3d of File %s \n", 89LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
v5 = extract_I1(a3, "incr=[", "]", &v21, &v14);
if ( v5 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 91LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( v14 )
{
fprintf(stderr, "Line %3d of File %s \n", 92LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( !v21 )
{
fprintf(stderr, "Line %3d of File %s \n", 93LL, "vec_s_to_f.c");
return (unsigned int)-1;
}
v25 = v22;
v24 = v21;
v7 = v22 + a2 * v21;
if ( v7 > 127 )
{
fprintf(stderr, "Line %3d of File %s \n", 97LL, "vec_s_to_f.c");
return (unsigned int)-1;
}
if ( v7 < -128 )
{
fprintf(stderr, "Line %3d of File %s \n", 98LL, "vec_s_to_f.c");
return (unsigned int)-1;
}
}
else if ( !strcmp(v15, "I2") )
{
v5 = extract_I2(a3, "start=[", "]", &v19, &v14);
if ( v5 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 102LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( v14 )
{
fprintf(stderr, "Line %3d of File %s \n", 103LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
v5 = extract_I2(a3, "incr=[", "]", &v18, &v14);
if ( v5 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 105LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( v14 )
{
fprintf(stderr, "Line %3d of File %s \n", 106LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( !v18 )
{
fprintf(stderr, "Line %3d of File %s \n", 107LL, "vec_s_to_f.c");
return (unsigned int)-1;
}
v25 = v19;
v24 = v18;
v8 = v19 + a2 * v18;
if ( v8 > 0x7FFF )
{
fprintf(stderr, "Line %3d of File %s \n", 111LL, "vec_s_to_f.c");
return (unsigned int)-1;
}
if ( v8 < -32768 )
{
fprintf(stderr, "Line %3d of File %s \n", 112LL, "vec_s_to_f.c");
return (unsigned int)-1;
}
}
else if ( !strcmp(v15, "I4") )
{
v5 = extract_I4(a3, "start=[", "]", &v28, &v14);
if ( v5 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 116LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( v14 )
{
fprintf(stderr, "Line %3d of File %s \n", 117LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
v5 = extract_I4(a3, "incr=[", "]", &v27, &v14);
if ( v5 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 119LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( v14 )
{
fprintf(stderr, "Line %3d of File %s \n", 120LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( !v27 )
{
fprintf(stderr, "Line %3d of File %s \n", 121LL, "vec_s_to_f.c");
return (unsigned int)-1;
}
v25 = v28;
v24 = v27;
v9 = v28 + a2 * v27;
if ( v9 > 0x7FFFFFFF )
{
fprintf(stderr, "Line %3d of File %s \n", 125LL, "vec_s_to_f.c");
return (unsigned int)-1;
}
if ( v9 < (__int64)0xFFFFFFFF80000000LL )
{
fprintf(stderr, "Line %3d of File %s \n", 126LL, "vec_s_to_f.c");
return (unsigned int)-1;
}
}
else
{
if ( strcmp(v15, "I8") )
{
fprintf(stderr, "Line %3d of File %s \n", 138LL, "vec_s_to_f.c");
return (unsigned int)-1;
}
v5 = extract_I8(a3, "start=[", "]", &v25, &v14);
if ( v5 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 130LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( v14 )
{
fprintf(stderr, "Line %3d of File %s \n", 131LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
v5 = extract_I8(a3, "incr=[", "]", &v24, &v14);
if ( v5 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 133LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( v14 )
{
fprintf(stderr, "Line %3d of File %s \n", 134LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( !v24 )
{
fprintf(stderr, "Line %3d of File %s \n", 135LL, "vec_s_to_f.c");
return (unsigned int)-1;
}
}
}
v10[1] = a2;
v10[0] = a1;
v10[2] = (__int64)v29;
v10[3] = (__int64)&v28;
v10[4] = (__int64)&v27;
v10[5] = (__int64)v26;
v10[6] = (__int64)&v25;
v10[7] = (__int64)&v24;
v10[8] = (__int64)&v23;
v10[9] = (__int64)&v22;
v10[10] = (__int64)&v21;
v10[11] = (__int64)v20;
v10[12] = (__int64)&v19;
v10[13] = (__int64)&v18;
v10[14] = (__int64)v17;
v10[15] = (__int64)v16;
v10[16] = (__int64)v15;
v10[17] = (__int64)v13;
v10[18] = (__int64)v12;
v11 = v5;
GOMP_parallel(vec_s_to_f__omp_fn_0, v10, 0LL, 0LL);
v5 = v11;
if ( v11 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 228LL, "vec_s_to_f.c");
return (unsigned int)v5;
}

canonical_decompiled_code:
__int64 __fastcall func1(__int64 a1, __int64 a2, __int64 a3)
{
int v4; // eax
int v5; // ebx
__int64 v7; // rax
__int64 v8; // rax
__int64 v9; // rax
__int64 v10[19]; // [rsp+0h] [rbp-158h] BYREF
int v11; // [rsp+98h] [rbp-C0h]
char v12[8]; // [rsp+A0h] [rbp-B8h] BYREF
char v13[7]; // [rsp+A8h] [rbp-B0h] BYREF
char v14; // [rsp+AFh] [rbp-A9h] BYREF
char v15[32]; // [rsp+B0h] [rbp-A8h] BYREF
char v16[40]; // [rsp+D0h] [rbp-88h] BYREF
char v17[6]; // [rsp+F8h] [rbp-60h] BYREF
__int16 v18; // [rsp+FEh] [rbp-5Ah] BYREF
__int16 v19; // [rsp+100h] [rbp-58h] BYREF
char v20[3]; // [rsp+102h] [rbp-56h] BYREF
char v21; // [rsp+105h] [rbp-53h] BYREF
char v22; // [rsp+106h] [rbp-52h] BYREF
char v23; // [rsp+107h] [rbp-51h] BYREF
__int64 v24; // [rsp+108h] [rbp-50h] BYREF
__int64 v25; // [rsp+110h] [rbp-48h] BYREF
char v26[12]; // [rsp+118h] [rbp-40h] BYREF
int v27; // [rsp+124h] [rbp-34h] BYREF
int v28; // [rsp+128h] [rbp-30h] BYREF
char v29[44]; // [rsp+12Ch] [rbp-2Ch] BYREF

v14 = 1;
zero_string(v16, 32LL);
zero_string(v15, 32LL);
v4 = extract_S(a3, "op=[", "]", v16, 32LL, &v14);
if ( v4 < 0 )
{
v5 = v4;
fprintf(stderr, "Line %3d of File %s \n", 49LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( v14 )
{
fprintf(stderr, "Line %3d of File %s \n", 49LL, "vec_s_to_f.c");
return (unsigned int)-1;
}
v5 = extract_S(a3, "fldtype=[", "]", v15, 32LL, &v14);
if ( v5 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 52LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( v14 )
{
fprintf(stderr, "Line %3d of File %s \n", 52LL, "vec_s_to_f.c");
return (unsigned int)-1;
}
v5 = partition(a2, 4096LL, 0xFFFFFFFFLL, v12, v13);
if ( v5 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 53LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( !strcmp(v16, "const") )
{
if ( !strcmp(v15, "I1") )
{
v5 = extract_I1(a3, "val=[", "]", &v23, &v14);
if ( v5 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 58LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( v14 )
{
fprintf(stderr, "Line %3d of File %s \n", 59LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
}
else if ( !strcmp(v15, "I2") )
{
v5 = extract_I2(a3, "val=[", "]", v20, &v14);
if ( v5 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 63LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( v14 )
{
fprintf(stderr, "Line %3d of File %s \n", 64LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
}
else if ( !strcmp(v15, "I4") )
{
v5 = extract_I4(a3, "val=[", "]", v29, &v14);
if ( v5 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 68LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( v14 )
{
fprintf(stderr, "Line %3d of File %s \n", 69LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
}
else if ( !strcmp(v15, "F4") )
{
v5 = extract_F4(a3, "val=[", "]", v17, &v14);
if ( v5 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 73LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( v14 )
{
fprintf(stderr, "Line %3d of File %s \n", 74LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
}
else
{
if ( strcmp(v15, "I8") )
{
fprintf(stderr, "Line %3d of File %s \n", 82LL, "vec_s_to_f.c");
return (unsigned int)-1;
}
v5 = extract_I8(a3, "val=[", "]", v26, &v14);
if ( v5 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 78LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( v14 )
{
fprintf(stderr, "Line %3d of File %s \n", 79LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
}
}
else
{
if ( strcmp(v16, "seq") )
{
fprintf(stderr, "Line %3d of File %s \n", 142LL, "vec_s_to_f.c");
return (unsigned int)-1;
}
if ( !strcmp(v15, "I1") )
{
v5 = extract_I1(a3, "start=[", "]", &v22, &v14);
if ( v5 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 88LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( v14 )
{
fprintf(stderr, "Line %3d of File %s \n", 89LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
v5 = extract_I1(a3, "incr=[", "]", &v21, &v14);
if ( v5 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 91LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( v14 )
{
fprintf(stderr, "Line %3d of File %s \n", 92LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( !v21 )
{
fprintf(stderr, "Line %3d of File %s \n", 93LL, "vec_s_to_f.c");
return (unsigned int)-1;
}
v25 = v22;
v24 = v21;
v7 = v22 + a2 * v21;
if ( v7 > 127 )
{
fprintf(stderr, "Line %3d of File %s \n", 97LL, "vec_s_to_f.c");
return (unsigned int)-1;
}
if ( v7 < -128 )
{
fprintf(stderr, "Line %3d of File %s \n", 98LL, "vec_s_to_f.c");
return (unsigned int)-1;
}
}
else if ( !strcmp(v15, "I2") )
{
v5 = extract_I2(a3, "start=[", "]", &v19, &v14);
if ( v5 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 102LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( v14 )
{
fprintf(stderr, "Line %3d of File %s \n", 103LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
v5 = extract_I2(a3, "incr=[", "]", &v18, &v14);
if ( v5 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 105LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( v14 )
{
fprintf(stderr, "Line %3d of File %s \n", 106LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( !v18 )
{
fprintf(stderr, "Line %3d of File %s \n", 107LL, "vec_s_to_f.c");
return (unsigned int)-1;
}
v25 = v19;
v24 = v18;
v8 = v19 + a2 * v18;
if ( v8 > 0x7FFF )
{
fprintf(stderr, "Line %3d of File %s \n", 111LL, "vec_s_to_f.c");
return (unsigned int)-1;
}
if ( v8 < -32768 )
{
fprintf(stderr, "Line %3d of File %s \n", 112LL, "vec_s_to_f.c");
return (unsigned int)-1;
}
}
else if ( !strcmp(v15, "I4") )
{
v5 = extract_I4(a3, "start=[", "]", &v28, &v14);
if ( v5 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 116LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( v14 )
{
fprintf(stderr, "Line %3d of File %s \n", 117LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
v5 = extract_I4(a3, "incr=[", "]", &v27, &v14);
if ( v5 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 119LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( v14 )
{
fprintf(stderr, "Line %3d of File %s \n", 120LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( !v27 )
{
fprintf(stderr, "Line %3d of File %s \n", 121LL, "vec_s_to_f.c");
return (unsigned int)-1;
}
v25 = v28;
v24 = v27;
v9 = v28 + a2 * v27;
if ( v9 > 0x7FFFFFFF )
{
fprintf(stderr, "Line %3d of File %s \n", 125LL, "vec_s_to_f.c");
return (unsigned int)-1;
}
if ( v9 < (__int64)0xFFFFFFFF80000000LL )
{
fprintf(stderr, "Line %3d of File %s \n", 126LL, "vec_s_to_f.c");
return (unsigned int)-1;
}
}
else
{
if ( strcmp(v15, "I8") )
{
fprintf(stderr, "Line %3d of File %s \n", 138LL, "vec_s_to_f.c");
return (unsigned int)-1;
}
v5 = extract_I8(a3, "start=[", "]", &v25, &v14);
if ( v5 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 130LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( v14 )
{
fprintf(stderr, "Line %3d of File %s \n", 131LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
v5 = extract_I8(a3, "incr=[", "]", &v24, &v14);
if ( v5 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 133LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( v14 )
{
fprintf(stderr, "Line %3d of File %s \n", 134LL, "vec_s_to_f.c");
return (unsigned int)v5;
}
if ( !v24 )
{
fprintf(stderr, "Line %3d of File %s \n", 135LL, "vec_s_to_f.c");
return (unsigned int)-1;
}
}
}
v10[1] = a2;
v10[0] = a1;
v10[2] = (__int64)v29;
v10[3] = (__int64)&v28;
v10[4] = (__int64)&v27;
v10[5] = (__int64)v26;
v10[6] = (__int64)&v25;
v10[7] = (__int64)&v24;
v10[8] = (__int64)&v23;
v10[9] = (__int64)&v22;
v10[10] = (__int64)&v21;
v10[11] = (__int64)v20;
v10[12] = (__int64)&v19;
v10[13] = (__int64)&v18;
v10[14] = (__int64)v17;
v10[15] = (__int64)v16;
v10[16] = (__int64)v15;
v10[17] = (__int64)v13;
v10[18] = (__int64)v12;
v11 = v5;
GOMP_parallel(vec_s_to_f__omp_fn_0, v10, 0LL, 0LL);
v5 = v11;
if ( v11 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 228LL, "vec_s_to_f.c");
return (unsigned int)v5;
}

original_code:
int
vec_s_to_f(
    char *X,
    long long nR,
    const char *str_scalar
    )
{
  int status = 0;
  int valI4, startI4, incrI4;
  long long valI8, startI8, incrI8;
  char valI1, startI1, incrI1;
  short valI2, startI2, incrI2;
  float valF4;
  char op[32];
  char fldtype[32];
  _Bool is_null = 1;
  int nT; long long block_size;
  zero_string(op, 32);
  zero_string(fldtype, 32);
  status = extract_S(str_scalar, "op=[", "]", op, 32, &is_null);
  { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 49, "vec_s_to_f.c"); }; status = (status) ; goto BYE; } } }; if ( is_null ) { { { fprintf(stderr, "Line %3d of File %s \n", 49, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
  status = extract_S(str_scalar, "fldtype=[", "]", fldtype, 32, &is_null);
  { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 52, "vec_s_to_f.c"); }; status = (status) ; goto BYE; } } }; if ( is_null ) { { { fprintf(stderr, "Line %3d of File %s \n", 52, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
  status = partition(nR, 4096, -1, &block_size, &nT); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 53, "vec_s_to_f.c"); }; status = (status) ; goto BYE; } } };
  if ( strcmp(op, "const") == 0 ) {
    if ( strcmp(fldtype, "I1") == 0 ) {
      status = extract_I1(str_scalar, "val=[", "]", &valI1, &is_null);
      { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 58, "vec_s_to_f.c"); }; status = (status) ; goto BYE; } } };
      if ( is_null ) { { { fprintf(stderr, "Line %3d of File %s \n", 59, "vec_s_to_f.c"); }; status = status ; goto BYE; }; }
    }
    else if ( strcmp(fldtype, "I2") == 0 ) {
      status = extract_I2(str_scalar, "val=[", "]", &valI2, &is_null);
      { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 63, "vec_s_to_f.c"); }; status = (status) ; goto BYE; } } };
      if ( is_null ) { { { fprintf(stderr, "Line %3d of File %s \n", 64, "vec_s_to_f.c"); }; status = status ; goto BYE; }; }
    }
    else if ( strcmp(fldtype, "I4") == 0 ) {
      status = extract_I4(str_scalar, "val=[", "]", &valI4, &is_null);
      { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 68, "vec_s_to_f.c"); }; status = (status) ; goto BYE; } } };
      if ( is_null ) { { { fprintf(stderr, "Line %3d of File %s \n", 69, "vec_s_to_f.c"); }; status = status ; goto BYE; }; }
    }
    else if ( strcmp(fldtype, "F4") == 0 ) {
      status = extract_F4(str_scalar, "val=[", "]", &valF4, &is_null);
      { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 73, "vec_s_to_f.c"); }; status = (status) ; goto BYE; } } };
      if ( is_null ) { { { fprintf(stderr, "Line %3d of File %s \n", 74, "vec_s_to_f.c"); }; status = status ; goto BYE; }; }
    }
    else if ( strcmp(fldtype, "I8") == 0 ) {
      status = extract_I8(str_scalar, "val=[", "]", &valI8, &is_null);
      { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 78, "vec_s_to_f.c"); }; status = (status) ; goto BYE; } } };
      if ( is_null ) { { { fprintf(stderr, "Line %3d of File %s \n", 79, "vec_s_to_f.c"); }; status = status ; goto BYE; }; }
    }
    else {
      { { fprintf(stderr, "Line %3d of File %s \n", 82, "vec_s_to_f.c"); }; status = -1 ; goto BYE; };
    }
  }
  else if ( strcmp(op, "seq") == 0 ) {
    if ( strcmp(fldtype, "I1") == 0 ) {
      status = extract_I1(str_scalar, "start=[", "]", &startI1, &is_null);
      { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 88, "vec_s_to_f.c"); }; status = (status) ; goto BYE; } } };
      if ( is_null ) { { { fprintf(stderr, "Line %3d of File %s \n", 89, "vec_s_to_f.c"); }; status = status ; goto BYE; }; }
      status = extract_I1(str_scalar, "incr=[", "]", &incrI1, &is_null);
      { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 91, "vec_s_to_f.c"); }; status = (status) ; goto BYE; } } };
      if ( is_null ) { { { fprintf(stderr, "Line %3d of File %s \n", 92, "vec_s_to_f.c"); }; status = status ; goto BYE; }; }
      if ( incrI1 == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 93, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
      startI8 = startI1; incrI8 = incrI1;
      if ( startI8 > 0x7f ) { { { fprintf(stderr, "Line %3d of File %s \n", 95, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
      if ( startI8 < (-0x7f - 1) ) { { { fprintf(stderr, "Line %3d of File %s \n", 96, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
      if ( startI8 + (nR * incrI8) > 0x7f ) { { { fprintf(stderr, "Line %3d of File %s \n", 97, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
      if ( startI8 + (nR * incrI8) < (-0x7f - 1) ) {{ { fprintf(stderr, "Line %3d of File %s \n", 98, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
    }
    else if ( strcmp(fldtype, "I2") == 0 ) {
      status = extract_I2(str_scalar, "start=[", "]", &startI2, &is_null);
      { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 102, "vec_s_to_f.c"); }; status = (status) ; goto BYE; } } };
      if ( is_null ) { { { fprintf(stderr, "Line %3d of File %s \n", 103, "vec_s_to_f.c"); }; status = status ; goto BYE; }; }
      status = extract_I2(str_scalar, "incr=[", "]", &incrI2, &is_null);
      { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 105, "vec_s_to_f.c"); }; status = (status) ; goto BYE; } } };
      if ( is_null ) { { { fprintf(stderr, "Line %3d of File %s \n", 106, "vec_s_to_f.c"); }; status = status ; goto BYE; }; }
      if ( incrI2 == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 107, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
      startI8 = startI2; incrI8 = incrI2;
      if ( startI8 > 0x7fff ) { { { fprintf(stderr, "Line %3d of File %s \n", 109, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
      if ( startI8 < (-0x7fff - 1) ) { { { fprintf(stderr, "Line %3d of File %s \n", 110, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
      if ( startI8 + (nR * incrI8) > 0x7fff ) { { { fprintf(stderr, "Line %3d of File %s \n", 111, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
      if ( startI8 + (nR * incrI8) < (-0x7fff - 1) ) {{ { fprintf(stderr, "Line %3d of File %s \n", 112, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
    }
    else if ( strcmp(fldtype, "I4") == 0 ) {
      status = extract_I4(str_scalar, "start=[", "]", &startI4, &is_null);
      { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 116, "vec_s_to_f.c"); }; status = (status) ; goto BYE; } } };
      if ( is_null ) { { { fprintf(stderr, "Line %3d of File %s \n", 117, "vec_s_to_f.c"); }; status = status ; goto BYE; }; }
      status = extract_I4(str_scalar, "incr=[", "]", &incrI4, &is_null);
      { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 119, "vec_s_to_f.c"); }; status = (status) ; goto BYE; } } };
      if ( is_null ) { { { fprintf(stderr, "Line %3d of File %s \n", 120, "vec_s_to_f.c"); }; status = status ; goto BYE; }; }
      if ( incrI4 == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 121, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
      startI8 = startI4; incrI8 = incrI4;
      if ( startI8 > 0x7fffffff ) { { { fprintf(stderr, "Line %3d of File %s \n", 123, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
      if ( startI8 < (-0x7fffffff - 1) ) { { { fprintf(stderr, "Line %3d of File %s \n", 124, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
      if ( startI8 + (nR * incrI8) > 0x7fffffff ) { { { fprintf(stderr, "Line %3d of File %s \n", 125, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
      if ( startI8 + (nR * incrI8) < (-0x7fffffff - 1) ) {{ { fprintf(stderr, "Line %3d of File %s \n", 126, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
    }
    else if ( strcmp(fldtype, "I8") == 0 ) {
      status = extract_I8(str_scalar, "start=[", "]", &startI8, &is_null);
      { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 130, "vec_s_to_f.c"); }; status = (status) ; goto BYE; } } };
      if ( is_null ) { { { fprintf(stderr, "Line %3d of File %s \n", 131, "vec_s_to_f.c"); }; status = status ; goto BYE; }; }
      status = extract_I8(str_scalar, "incr=[", "]", &incrI8, &is_null);
      { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 133, "vec_s_to_f.c"); }; status = (status) ; goto BYE; } } };
      if ( is_null ) { { { fprintf(stderr, "Line %3d of File %s \n", 134, "vec_s_to_f.c"); }; status = status ; goto BYE; }; }
      if ( incrI8 == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 135, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
    }
    else {
      { { fprintf(stderr, "Line %3d of File %s \n", 138, "vec_s_to_f.c"); }; status = -1 ; goto BYE; };
    }
  }
  else {
    { { fprintf(stderr, "Line %3d of File %s \n", 142, "vec_s_to_f.c"); }; status = -1 ; goto BYE; };
  }

#pragma omp parallel for
  for ( int tid = 0; tid < nT; tid++ ) {
    char *XI1 = ((void *)0); char lstartI1;
    short *XI2 = ((void *)0); short lstartI2;
    int *XI4 = ((void *)0); int lstartI4;
    long long *XI8 = ((void *)0); long long lstartI8;
    float *XF4 = ((void *)0);
    long long lb = tid * block_size;
    long long ub = lb + block_size;
    if ( tid == (nT-1) ) { ub = nR; }
    long long nX = (ub -lb);
    if ( strcmp(op, "const") == 0 ) {
      if ( strcmp(fldtype, "I1") == 0 ) {
 XI1 = (char *)X; XI1 += lb;
 s_to_f_const_I1(XI1, nX, valI1);
      }
      else if ( strcmp(fldtype, "I2") == 0 ) {
 XI2 = (short *)X; XI2 += lb;
 s_to_f_const_I2(XI2, nX, valI2);
      }
      else if ( strcmp(fldtype, "I4") == 0 ) {
 XI4 = (int *)X; XI4 += lb;
 s_to_f_const_I4(XI4, nX, valI4);
      }
      else if ( strcmp(fldtype, "F4") == 0 ) {
 XF4 = (float *)X; XF4 += lb;
 s_to_f_const_F4(XF4, nX, valF4);
      }
      else if ( strcmp(fldtype, "I8") == 0 ) {
 XI8 = (long long *) X; XI8 += lb;
 s_to_f_const_I8(XI8, nX, valI8);
      }
    }
    else if ( strcmp(op, "seq") == 0 ) {
      if ( strcmp(fldtype, "I1") == 0 ) {
 XI1 = (char *)X; XI1 += lb;
        lstartI1 = startI1 + (lb * incrI1);
 s_to_f_seq_I1(XI1, nX, lstartI1, incrI1);
      }
      else if ( strcmp(fldtype, "I2") == 0 ) {
 XI2 = (short *)X; XI2 += lb;
        lstartI2 = startI2 + (lb * incrI2);
 s_to_f_seq_I2(XI2, nX, lstartI2, incrI2);
      }
      else if ( strcmp(fldtype, "I4") == 0 ) {
 XI4 = (int *)X; XI4 += lb;
        lstartI4 = startI4 + (lb * incrI4);
 s_to_f_seq_I4(XI4, nX, lstartI4, incrI4);
      }
      else if ( strcmp(fldtype, "I8") == 0 ) {
 XI8 = (long long *) X; XI8 += lb;
        lstartI8 = startI8 + (lb * incrI8);
 s_to_f_seq_I8(XI8, nX, lstartI8, incrI8);
      }
    }
    else {
      status = -1; continue;
    }
  }
  { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 228, "vec_s_to_f.c"); }; status = (status) ; goto BYE; } } };
 BYE:
  return status ;
}

canonical_original_code:
int vec_s_to_f(char *X, long long nR, char *str_scalar)
{
  int status = 0;
  int valI4; int startI4; int incrI4;
  long long valI8; long long startI8; long long incrI8;
  char valI1; char startI1; char incrI1;
  short valI2; short startI2; short incrI2;
  float valF4;
  char op[32];
  char fldtype[32];
  _Bool is_null = 1;
  int nT; long long block_size;
  zero_string(op, 32);
  zero_string(fldtype, 32);
  status = extract_S(str_scalar, "op=[", "]", op, 32, &is_null);
  { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 49, "vec_s_to_f.c"); }; status = (status) ; goto BYE; } } }; if ( is_null ) { { { fprintf(stderr, "Line %3d of File %s \n", 49, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
  status = extract_S(str_scalar, "fldtype=[", "]", fldtype, 32, &is_null);
  { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 52, "vec_s_to_f.c"); }; status = (status) ; goto BYE; } } }; if ( is_null ) { { { fprintf(stderr, "Line %3d of File %s \n", 52, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
  status = partition(nR, 4096, -1, &block_size, &nT); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 53, "vec_s_to_f.c"); }; status = (status) ; goto BYE; } } };
  if ( strcmp(op, "const") == 0 ) {
    if ( strcmp(fldtype, "I1") == 0 ) {
      status = extract_I1(str_scalar, "val=[", "]", &valI1, &is_null);
      { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 58, "vec_s_to_f.c"); }; status = (status) ; goto BYE; } } };
      if ( is_null ) { { { fprintf(stderr, "Line %3d of File %s \n", 59, "vec_s_to_f.c"); }; status = status ; goto BYE; }; }
    }
    else if ( strcmp(fldtype, "I2") == 0 ) {
      status = extract_I2(str_scalar, "val=[", "]", &valI2, &is_null);
      { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 63, "vec_s_to_f.c"); }; status = (status) ; goto BYE; } } };
      if ( is_null ) { { { fprintf(stderr, "Line %3d of File %s \n", 64, "vec_s_to_f.c"); }; status = status ; goto BYE; }; }
    }
    else if ( strcmp(fldtype, "I4") == 0 ) {
      status = extract_I4(str_scalar, "val=[", "]", &valI4, &is_null);
      { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 68, "vec_s_to_f.c"); }; status = (status) ; goto BYE; } } };
      if ( is_null ) { { { fprintf(stderr, "Line %3d of File %s \n", 69, "vec_s_to_f.c"); }; status = status ; goto BYE; }; }
    }
    else if ( strcmp(fldtype, "F4") == 0 ) {
      status = extract_F4(str_scalar, "val=[", "]", &valF4, &is_null);
      { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 73, "vec_s_to_f.c"); }; status = (status) ; goto BYE; } } };
      if ( is_null ) { { { fprintf(stderr, "Line %3d of File %s \n", 74, "vec_s_to_f.c"); }; status = status ; goto BYE; }; }
    }
    else if ( strcmp(fldtype, "I8") == 0 ) {
      status = extract_I8(str_scalar, "val=[", "]", &valI8, &is_null);
      { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 78, "vec_s_to_f.c"); }; status = (status) ; goto BYE; } } };
      if ( is_null ) { { { fprintf(stderr, "Line %3d of File %s \n", 79, "vec_s_to_f.c"); }; status = status ; goto BYE; }; }
    }
    else {
      { { fprintf(stderr, "Line %3d of File %s \n", 82, "vec_s_to_f.c"); }; status = -1 ; goto BYE; };
    }
  }
  else if ( strcmp(op, "seq") == 0 ) {
    if ( strcmp(fldtype, "I1") == 0 ) {
      status = extract_I1(str_scalar, "start=[", "]", &startI1, &is_null);
      { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 88, "vec_s_to_f.c"); }; status = (status) ; goto BYE; } } };
      if ( is_null ) { { { fprintf(stderr, "Line %3d of File %s \n", 89, "vec_s_to_f.c"); }; status = status ; goto BYE; }; }
      status = extract_I1(str_scalar, "incr=[", "]", &incrI1, &is_null);
      { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 91, "vec_s_to_f.c"); }; status = (status) ; goto BYE; } } };
      if ( is_null ) { { { fprintf(stderr, "Line %3d of File %s \n", 92, "vec_s_to_f.c"); }; status = status ; goto BYE; }; }
      if ( incrI1 == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 93, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
      startI8 = startI1; incrI8 = incrI1;
      if ( startI8 > 0x7f ) { { { fprintf(stderr, "Line %3d of File %s \n", 95, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
      if ( startI8 < (-0x7f - 1) ) { { { fprintf(stderr, "Line %3d of File %s \n", 96, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
      if ( startI8 + (nR * incrI8) > 0x7f ) { { { fprintf(stderr, "Line %3d of File %s \n", 97, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
      if ( startI8 + (nR * incrI8) < (-0x7f - 1) ) {{ { fprintf(stderr, "Line %3d of File %s \n", 98, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
    }
    else if ( strcmp(fldtype, "I2") == 0 ) {
      status = extract_I2(str_scalar, "start=[", "]", &startI2, &is_null);
      { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 102, "vec_s_to_f.c"); }; status = (status) ; goto BYE; } } };
      if ( is_null ) { { { fprintf(stderr, "Line %3d of File %s \n", 103, "vec_s_to_f.c"); }; status = status ; goto BYE; }; }
      status = extract_I2(str_scalar, "incr=[", "]", &incrI2, &is_null);
      { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 105, "vec_s_to_f.c"); }; status = (status) ; goto BYE; } } };
      if ( is_null ) { { { fprintf(stderr, "Line %3d of File %s \n", 106, "vec_s_to_f.c"); }; status = status ; goto BYE; }; }
      if ( incrI2 == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 107, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
      startI8 = startI2; incrI8 = incrI2;
      if ( startI8 > 0x7fff ) { { { fprintf(stderr, "Line %3d of File %s \n", 109, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
      if ( startI8 < (-0x7fff - 1) ) { { { fprintf(stderr, "Line %3d of File %s \n", 110, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
      if ( startI8 + (nR * incrI8) > 0x7fff ) { { { fprintf(stderr, "Line %3d of File %s \n", 111, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
      if ( startI8 + (nR * incrI8) < (-0x7fff - 1) ) {{ { fprintf(stderr, "Line %3d of File %s \n", 112, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
    }
    else if ( strcmp(fldtype, "I4") == 0 ) {
      status = extract_I4(str_scalar, "start=[", "]", &startI4, &is_null);
      { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 116, "vec_s_to_f.c"); }; status = (status) ; goto BYE; } } };
      if ( is_null ) { { { fprintf(stderr, "Line %3d of File %s \n", 117, "vec_s_to_f.c"); }; status = status ; goto BYE; }; }
      status = extract_I4(str_scalar, "incr=[", "]", &incrI4, &is_null);
      { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 119, "vec_s_to_f.c"); }; status = (status) ; goto BYE; } } };
      if ( is_null ) { { { fprintf(stderr, "Line %3d of File %s \n", 120, "vec_s_to_f.c"); }; status = status ; goto BYE; }; }
      if ( incrI4 == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 121, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
      startI8 = startI4; incrI8 = incrI4;
      if ( startI8 > 0x7fffffff ) { { { fprintf(stderr, "Line %3d of File %s \n", 123, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
      if ( startI8 < (-0x7fffffff - 1) ) { { { fprintf(stderr, "Line %3d of File %s \n", 124, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
      if ( startI8 + (nR * incrI8) > 0x7fffffff ) { { { fprintf(stderr, "Line %3d of File %s \n", 125, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
      if ( startI8 + (nR * incrI8) < (-0x7fffffff - 1) ) {{ { fprintf(stderr, "Line %3d of File %s \n", 126, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
    }
    else if ( strcmp(fldtype, "I8") == 0 ) {
      status = extract_I8(str_scalar, "start=[", "]", &startI8, &is_null);
      { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 130, "vec_s_to_f.c"); }; status = (status) ; goto BYE; } } };
      if ( is_null ) { { { fprintf(stderr, "Line %3d of File %s \n", 131, "vec_s_to_f.c"); }; status = status ; goto BYE; }; }
      status = extract_I8(str_scalar, "incr=[", "]", &incrI8, &is_null);
      { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 133, "vec_s_to_f.c"); }; status = (status) ; goto BYE; } } };
      if ( is_null ) { { { fprintf(stderr, "Line %3d of File %s \n", 134, "vec_s_to_f.c"); }; status = status ; goto BYE; }; }
      if ( incrI8 == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 135, "vec_s_to_f.c"); }; status = -1 ; goto BYE; }; }
    }
    else {
      { { fprintf(stderr, "Line %3d of File %s \n", 138, "vec_s_to_f.c"); }; status = -1 ; goto BYE; };
    }
  }
  else {
    { { fprintf(stderr, "Line %3d of File %s \n", 142, "vec_s_to_f.c"); }; status = -1 ; goto BYE; };
  }

#pragma omp parallel for
  for ( int tid = 0; tid < nT; tid++ ) {
    char *XI1 = ((void *)0); char lstartI1;
    short *XI2 = ((void *)0); short lstartI2;
    int *XI4 = ((void *)0); int lstartI4;
    long long *XI8 = ((void *)0); long long lstartI8;
    float *XF4 = ((void *)0);
    long long lb = tid * block_size;
    long long ub = lb + block_size;
    if ( tid == (nT-1) ) { ub = nR; }
    long long nX = (ub -lb);
    if ( strcmp(op, "const") == 0 ) {
      if ( strcmp(fldtype, "I1") == 0 ) {
 XI1 = (char *)X; XI1 += lb;
 s_to_f_const_I1(XI1, nX, valI1);
      }
      else if ( strcmp(fldtype, "I2") == 0 ) {
 XI2 = (short *)X; XI2 += lb;
 s_to_f_const_I2(XI2, nX, valI2);
      }
      else if ( strcmp(fldtype, "I4") == 0 ) {
 XI4 = (int *)X; XI4 += lb;
 s_to_f_const_I4(XI4, nX, valI4);
      }
      else if ( strcmp(fldtype, "F4") == 0 ) {
 XF4 = (float *)X; XF4 += lb;
 s_to_f_const_F4(XF4, nX, valF4);
      }
      else if ( strcmp(fldtype, "I8") == 0 ) {
 XI8 = (long long *) X; XI8 += lb;
 s_to_f_const_I8(XI8, nX, valI8);
      }
    }
    else if ( strcmp(op, "seq") == 0 ) {
      if ( strcmp(fldtype, "I1") == 0 ) {
 XI1 = (char *)X; XI1 += lb;
        lstartI1 = startI1 + (lb * incrI1);
 s_to_f_seq_I1(XI1, nX, lstartI1, incrI1);
      }
      else if ( strcmp(fldtype, "I2") == 0 ) {
 XI2 = (short *)X; XI2 += lb;
        lstartI2 = startI2 + (lb * incrI2);
 s_to_f_seq_I2(XI2, nX, lstartI2, incrI2);
      }
      else if ( strcmp(fldtype, "I4") == 0 ) {
 XI4 = (int *)X; XI4 += lb;
        lstartI4 = startI4 + (lb * incrI4);
 s_to_f_seq_I4(XI4, nX, lstartI4, incrI4);
      }
      else if ( strcmp(fldtype, "I8") == 0 ) {
 XI8 = (long long *) X; XI8 += lb;
        lstartI8 = startI8 + (lb * incrI8);
 s_to_f_seq_I8(XI8, nX, lstartI8, incrI8);
      }
    }
    else {
      status = -1; continue;
    }
  }
  { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 228, "vec_s_to_f.c"); }; status = (status) ; goto BYE; } } };
 BYE:
  return status ;
}

variable_types:
nR
long long

variable_types:
op
char [32]

variable_types:
fldtype
char [32]

variable_types: nT int

variable_types: tid int

variable_types:
lb
long long

variable_types:
ub
long long

variable_types:
nX
long long


decompiled_code:
__int64 __fastcall cmp_eq_mult_scalar_I8(__int64 a1, __int64 a2, __int64 a3, int a4)
{
__int64 result; // rax

if ( a4 > 8 )
result = cmp_eq_mult_scalar_log_I8();
else
result = cmp_eq_mult_scalar_simple_I8();
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, __int64 a2, __int64 a3, int a4)
{
__int64 result; // rax

if ( a4 > 8 )
result = cmp_eq_mult_scalar_log_I8();
else
result = cmp_eq_mult_scalar_simple_I8();
return result;
}

original_code:
void
cmp_eq_mult_scalar_I8(
         long long *in1,
         long long n1,
         long long *in2,
         int n2,
         char * restrict out
          )
{
  if ( n2 <= 8 ) {
    cmp_eq_mult_scalar_simple_I8( in1, n1, in2, n2, out);
  }
  else
    cmp_eq_mult_scalar_log_I8( in1, n1, in2, n2, out);
}

canonical_original_code:
void cmp_eq_mult_scalar_I8(long long *in1, long long n1, long long *in2, int n2, char *out)
{
  if ( n2 <= 8 ) {
    cmp_eq_mult_scalar_simple_I8( in1, n1, in2, n2, out);
  }
  else
    cmp_eq_mult_scalar_log_I8( in1, n1, in2, n2, out);
}

variable_types:
out
char *


decompiled_code:
__int64 __fastcall sort2_asc_F4(float *a1, float *a2)
{
float v2; // xmm2_4
float v3; // xmm3_4
__int64 result; // rax

v2 = a1[1];
v3 = a2[1];
result = 1LL;
if ( *a1 <= *a2 )
{
result = 0xFFFFFFFFLL;
if ( *a2 <= *a1 )
{
result = 1LL;
if ( v2 <= v3 )
result = (unsigned int)-(v3 > v2);
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(float *a1, float *a2)
{
float v2; // xmm2_4
float v3; // xmm3_4
__int64 result; // rax

v2 = a1[1];
v3 = a2[1];
result = 1LL;
if ( *a1 <= *a2 )
{
result = 0xFFFFFFFFLL;
if ( *a2 <= *a1 )
{
result = 1LL;
if ( v2 <= v3 )
result = (unsigned int)-(v3 > v2);
}
}
return result;
}

original_code:
int sort2_asc_F4(
         const void *ii,
         const void *jj
         )
{
  float val11, val12, val21,val22;
  float *ptr1, *ptr2;
  ptr1 = (float *)ii;
  ptr2 = (float *)jj;
  val11 = *ptr1++;
  val12 = *ptr1++;
  val21 = *ptr2++;
  val22 = *ptr2++;
  if ( val11 > val21 ) {
    return (1);
  }
  else if ( val11 < val21 ) {
    return (-1);
  }
  else {
    if ( val12 > val22 ) {
      return (1);
    }
    else if ( val12 < val22 ) {
      return (-1);
    }
    else {
      return(0);
    }
  }
}

canonical_original_code:
int sort2_asc_F4(void *ii, void *jj)
{
  float val11; float val12; float val21; float val22;
  float *ptr1; float *ptr2;
  ptr1 = (float *)ii;
  ptr2 = (float *)jj;
  val11 = *ptr1++;
  val12 = *ptr1++;
  val21 = *ptr2++;
  val22 = *ptr2++;
  if ( val11 > val21 ) {
    return (1);
  }
  else if ( val11 < val21 ) {
    return (-1);
  }
  else {
    if ( val12 > val22 ) {
      return (1);
    }
    else if ( val12 < val22 ) {
      return (-1);
    }
    else {
      return(0);
    }
  }
}

variable_types:
ii
void *

variable_types:
jj
void *


decompiled_code:
__int64 __fastcall bin_search_I1(_BYTE *a1, __int64 a2, char a3, __int64 *a4, const char *a5)
{
__int64 v9; // rcx
__int64 v10; // rdx
__int64 result; // rax
__int64 v12; // rax
__int64 v13; // rbp
char v14; // si
__int64 v15; // r13
__int64 v16; // [rsp+8h] [rbp-40h]

if ( !a1 )
{
fprintf(stderr, "Line %3d of File %s \n", 27LL, "./AUTOGEN/GENFILES/bin_search_I1.c");
return 0xFFFFFFFFLL;
}
if ( a2 <= 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 28LL, "./AUTOGEN/GENFILES/bin_search_I1.c");
return 0xFFFFFFFFLL;
}
if ( a2 == 1 )
{
if ( *a1 == a3 )
*a4 = 0LL;
else
*a4 = -1LL;
result = 0LL;
}
else
{
v16 = a2 - 1;
*a4 = -1LL;
v9 = a2 - 1;
v10 = 0LL;
while ( 1 )
{
v12 = (v10 + v9) / 2;
v13 = v12;
v14 = a1[v12];
if ( v14 == a3 )
break;
if ( v14 <= a3 )
{
if ( v12 <= v10 )
v12 = v10 + 1;
v10 = v12;
}
else
{
if ( v12 >= v9 )
v12 = v9 - 1;
v9 = v12;
}
if ( v10 > v9 )
{
v13 = -1LL;
break;
}
}
if ( !a5 || !*a5 )
goto LABEL_34;
if ( !strcasecmp(a5, "lowest") )
{
if ( v13 > 0 )
{
do
{
if ( a1[v13 - 1] != a3 )
break;
--v13;
}
while ( v13 );
}
goto LABEL_34;
}
if ( !strcasecmp(a5, "highest") )
{
v15 = a2 - 1;
if ( v13 < v16 )
{
while ( a1[v13 + 1] == a3 )
{
if ( ++v13 == v15 )
{
v13 = v15;
goto LABEL_34;
}
}
}
goto LABEL_34;
}
if ( !strcasecmp(a5, "dontcare") )
{
LABEL_34:
*a4 = v13;
return 0LL;
}
fprintf(stderr, "Line %3d of File %s \n", 69LL, "./AUTOGEN/GENFILES/bin_search_I1.c");
result = 0xFFFFFFFFLL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(_BYTE *a1, __int64 a2, char a3, __int64 *a4, const char *a5)
{
__int64 v9; // rcx
__int64 v10; // rdx
__int64 result; // rax
__int64 v12; // rax
__int64 v13; // rbp
char v14; // si
__int64 v15; // r13
__int64 v16; // [rsp+8h] [rbp-40h]

if ( !a1 )
{
fprintf(stderr, "Line %3d of File %s \n", 27LL, "./AUTOGEN/GENFILES/bin_search_I1.c");
return 0xFFFFFFFFLL;
}
if ( a2 <= 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 28LL, "./AUTOGEN/GENFILES/bin_search_I1.c");
return 0xFFFFFFFFLL;
}
if ( a2 == 1 )
{
if ( *a1 == a3 )
*a4 = 0LL;
else
*a4 = -1LL;
result = 0LL;
}
else
{
v16 = a2 - 1;
*a4 = -1LL;
v9 = a2 - 1;
v10 = 0LL;
while ( 1 )
{
v12 = (v10 + v9) / 2;
v13 = v12;
v14 = a1[v12];
if ( v14 == a3 )
break;
if ( v14 <= a3 )
{
if ( v12 <= v10 )
v12 = v10 + 1;
v10 = v12;
}
else
{
if ( v12 >= v9 )
v12 = v9 - 1;
v9 = v12;
}
if ( v10 > v9 )
{
v13 = -1LL;
break;
}
}
if ( !a5 || !*a5 )
goto LABEL_34;
if ( !strcasecmp(a5, "lowest") )
{
if ( v13 > 0 )
{
do
{
if ( a1[v13 - 1] != a3 )
break;
--v13;
}
while ( v13 );
}
goto LABEL_34;
}
if ( !strcasecmp(a5, "highest") )
{
v15 = a2 - 1;
if ( v13 < v16 )
{
while ( a1[v13 + 1] == a3 )
{
if ( ++v13 == v15 )
{
v13 = v15;
goto LABEL_34;
}
}
}
goto LABEL_34;
}
if ( !strcasecmp(a5, "dontcare") )
{
LABEL_34:
*a4 = v13;
return 0LL;
}
fprintf(stderr, "Line %3d of File %s \n", 69LL, "./AUTOGEN/GENFILES/bin_search_I1.c");
result = 0xFFFFFFFFLL;
}
return result;
}

original_code:
int
bin_search_I1(
    const char *X,
    long long nX,
    char key,
    long long *ptr_pos,
    char *str_direction
    )
{
  int status = 0;
  long long pos, lb, ub, mid;
  int direction;
  if ( X == ((void *)0) ) { { fprintf(stderr, "Line %3d of File %s \n", 27, "./AUTOGEN/GENFILES/bin_search_I1.c"); }; status = -1 ; goto BYE; };
  if ( nX <= 0 ) { { fprintf(stderr, "Line %3d of File %s \n", 28, "./AUTOGEN/GENFILES/bin_search_I1.c"); }; status = -1 ; goto BYE; };
  if ( nX == 1 ) {
    if ( X[0] == key ) {
      *ptr_pos = 0;
    }
    else {
      *ptr_pos = -1;
    }
    return status ;
  }
  lb = 0; ub = nX - 1;
  *ptr_pos = pos = -1;
  for ( ; lb <= ub ; ) {
    mid = ( lb + ub ) / 2 ;
    if ( X[mid] == key ) {
      pos = mid;
      break;
    }
    else if ( key < X[mid] ) {
      ub = ((ub - 1) < (mid) ? (ub - 1) : (mid));
    }
    else {
      lb = ((lb + 1) > (mid) ? (lb + 1) : (mid));
    }
  }
  if ( ( str_direction == ((void *)0) ) || ( strlen(str_direction) == 0 ) ) {
    direction = 3;
  }
  else if ( strcasecmp(str_direction, "lowest") == 0 ) {
    direction = 1;
  }
  else if ( strcasecmp(str_direction, "highest") == 0 ) {
    direction = 2;
  }
  else if ( strcasecmp(str_direction, "dontcare") == 0 ) {
    direction = 3;
  }
  else {
    { { fprintf(stderr, "Line %3d of File %s \n", 69, "./AUTOGEN/GENFILES/bin_search_I1.c"); }; status = -1 ; goto BYE; };
  }
  switch ( direction ) {
  case 1 :
    for ( ; pos > 0; ) {
      if ( X[pos-1] == key ) { pos--; } else { break; }
    }
    break;
  case 2 :
    for ( ; pos < nX-1; ) {
      if ( X[pos+1] == key ) { pos++; } else { break; }
    }
    break;
  case 3 :
    break;
  default : { { fprintf(stderr, "Line %3d of File %s \n", 85, "./AUTOGEN/GENFILES/bin_search_I1.c"); }; status = -1 ; goto BYE; };
  }
  *ptr_pos = pos;
 BYE:
  return status ;
}

canonical_original_code:
int bin_search_I1(char *X, long long nX, char key, long long *ptr_pos, char *str_direction)
{
  int status = 0;
  long long pos; long long lb; long long ub; long long mid;
  int direction;
  if ( X == ((void *)0) ) { { fprintf(stderr, "Line %3d of File %s \n", 27, "./AUTOGEN/GENFILES/bin_search_I1.c"); }; status = -1 ; goto BYE; };
  if ( nX <= 0 ) { { fprintf(stderr, "Line %3d of File %s \n", 28, "./AUTOGEN/GENFILES/bin_search_I1.c"); }; status = -1 ; goto BYE; };
  if ( nX == 1 ) {
    if ( X[0] == key ) {
      *ptr_pos = 0;
    }
    else {
      *ptr_pos = -1;
    }
    return status ;
  }
  lb = 0; ub = nX - 1;
  *ptr_pos = pos = -1;
  for ( ; lb <= ub ; ) {
    mid = ( lb + ub ) / 2 ;
    if ( X[mid] == key ) {
      pos = mid;
      break;
    }
    else if ( key < X[mid] ) {
      ub = ((ub - 1) < (mid) ? (ub - 1) : (mid));
    }
    else {
      lb = ((lb + 1) > (mid) ? (lb + 1) : (mid));
    }
  }
  if ( ( str_direction == ((void *)0) ) || ( strlen(str_direction) == 0 ) ) {
    direction = 3;
  }
  else if ( strcasecmp(str_direction, "lowest") == 0 ) {
    direction = 1;
  }
  else if ( strcasecmp(str_direction, "highest") == 0 ) {
    direction = 2;
  }
  else if ( strcasecmp(str_direction, "dontcare") == 0 ) {
    direction = 3;
  }
  else {
    { { fprintf(stderr, "Line %3d of File %s \n", 69, "./AUTOGEN/GENFILES/bin_search_I1.c"); }; status = -1 ; goto BYE; };
  }
  switch ( direction ) {
  case 1 :
    for ( ; pos > 0; ) {
      if ( X[pos-1] == key ) { pos--; } else { break; }
    }
    break;
  case 2 :
    for ( ; pos < nX-1; ) {
      if ( X[pos+1] == key ) { pos++; } else { break; }
    }
    break;
  case 3 :
    break;
  default : { { fprintf(stderr, "Line %3d of File %s \n", 85, "./AUTOGEN/GENFILES/bin_search_I1.c"); }; status = -1 ; goto BYE; };
  }
  *ptr_pos = pos;
 BYE:
  return status ;
}

variable_types:
X
char *

variable_types: key char

variable_types: status int

variable_types:
pos
long long

variable_types:
mid
long long

variable_types: direction int