decompiled_code:
__int64 __fastcall ext_stride(const char *a1, _BYTE *a2, __int64 a3, __int64 a4, const char *a5, _BYTE *a6, __int64 a7)
{
int v11; // er14
__int64 v12; // r15
__int64 v13; // rdx
__int64 v14; // rax
__int64 v15; // r8
int v17; // [rsp+Ch] [rbp-27Ch] BYREF
unsigned int v18; // [rsp+10h] [rbp-278h] BYREF
unsigned int v19; // [rsp+14h] [rbp-274h] BYREF
__int64 v20; // [rsp+18h] [rbp-270h] BYREF
__int64 v21; // [rsp+20h] [rbp-268h] BYREF
char v22[4]; // [rsp+2Ch] [rbp-25Ch] BYREF
char v23[32]; // [rsp+30h] [rbp-258h] BYREF
int v24; // [rsp+50h] [rbp-238h]
int v25; // [rsp+ACh] [rbp-1DCh] BYREF
char v26[124]; // [rsp+B0h] [rbp-1D8h] BYREF
char v27[4]; // [rsp+12Ch] [rbp-15Ch] BYREF
__int64 v28; // [rsp+130h] [rbp-158h] BYREF
__int64 v29; // [rsp+150h] [rbp-138h]
unsigned int v30; // [rsp+1ACh] [rbp-DCh] BYREF
char v31[60]; // [rsp+1B0h] [rbp-D8h] BYREF
char v32[4]; // [rsp+1ECh] [rbp-9Ch] BYREF
__int64 v33[7]; // [rsp+1F0h] [rbp-98h] BYREF
__int64 v34; // [rsp+228h] [rbp-60h] BYREF
size_t v35; // [rsp+230h] [rbp-58h] BYREF
void *v36; // [rsp+238h] [rbp-50h] BYREF
size_t len; // [rsp+240h] [rbp-48h] BYREF
void *addr; // [rsp+248h] [rbp-40h] BYREF

addr = 0LL;
len = 0LL;
v36 = 0LL;
v35 = 0LL;
v19 = -1;
v18 = 0x7FFFFFFF;
v17 = 0x7FFFFFFF;
if ( !a1 || !*a1 )
{
fprintf(stderr, "Line %3d of File %s \n", 95LL, "stride.c");
v11 = -1;
goto LABEL_33;
}
if ( !a2 || !*a2 )
{
fprintf(stderr, "Line %3d of File %s \n", 96LL, "stride.c");
v11 = -1;
goto LABEL_33;
}
if ( !a5 || !*a5 )
{
fprintf(stderr, "Line %3d of File %s \n", 97LL, "stride.c");
v11 = -1;
goto LABEL_33;
}
if ( !a6 || !*a6 )
{
fprintf(stderr, "Line %3d of File %s \n", 98LL, "stride.c");
v11 = -1;
goto LABEL_33;
}
if ( !strcmp(a1, a5) )
{
fprintf(stderr, "Line %3d of File %s \n", 99LL, "stride.c");
v11 = -1;
goto LABEL_33;
}
v11 = stoI8(a3, &v21);
if ( v11 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 100LL, "stride.c");
goto LABEL_33;
}
v11 = stoI8(a4, &v20);
if ( v11 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 101LL, "stride.c");
goto LABEL_33;
}
v34 = (int)stoI8(a7, &v34);
v11 = is_tbl(a1, v32, v33);
if ( v11 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 104LL, "stride.c");
goto LABEL_33;
}
v12 = v33[0];
v11 = is_fld(a1, 0xFFFFFFFFLL, a2, v27, &v28, &v25, v26);
if ( v11 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 107LL, "stride.c");
goto LABEL_33;
}
v11 = get_data(&addr, &len, 0LL);
if ( v11 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 108LL, "stride.c");
goto LABEL_33;
}
if ( v25 >= 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 109LL, "stride.c");
v11 = -1;
goto LABEL_33;
}
v11 = del_tbl(a5, 0xFFFFFFFFLL);
if ( v11 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 110LL, "stride.c");
goto LABEL_33;
}
if ( (unsigned int)(v29 - 4) > 1 )
{
fprintf(stderr, "Line %3d of File %s \n", 115LL, "stride.c");
v11 = -1;
goto LABEL_33;
}
if ( v21 >= v12 || v21 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 118LL, "stride.c");
v11 = -1;
goto LABEL_33;
}
if ( v20 >= v12 || v20 <= 1 )
{
fprintf(stderr, "Line %3d of File %s \n", 119LL, "stride.c");
v11 = -1;
goto LABEL_33;
}
if ( v34 <= 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 120LL, "stride.c");
v11 = -1;
goto LABEL_33;
}
v13 = v34 - 1;
v14 = v21 + v34 * v20 - v20;
if ( v12 < v21 + v34 * v20 )
{
do
{
v15 = v13--;
v14 -= v20;
}
while ( v12 < v20 + v14 );
v34 = v15;
if ( v15 <= 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 124LL, "stride.c");
v11 = -1;
goto LABEL_33;
}
}
v11 = get_fld_sz((unsigned int)v29, &v17, v13);
if ( v11 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 127LL, "stride.c");
goto LABEL_33;
}
v11 = mk_temp_file(v34 * v17, &v18, &v19);
if ( v11 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 129LL, "stride.c");
goto LABEL_33;
}
v11 = q_mmap(v18, v19, &v36, &v35, 1LL);
if ( v11 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 130LL, "stride.c");
goto LABEL_33;
}
if ( (_DWORD)v29 == 4 )
{
v11 = stride_I4((__int64)addr, v12, v21, v20, (__int64)v36, v34);
if ( v11 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 136LL, "stride.c");
goto LABEL_33;
}
}
else
{
if ( (_DWORD)v29 != 5 )
{
fprintf(stderr, "Line %3d of File %s \n", 144LL, "stride.c");
v11 = -1;
goto LABEL_33;
}
v11 = stride_I8((__int64)addr, v12, v21, v20, (__int64)v36, v34);
if ( v11 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 141LL, "stride.c");
goto LABEL_33;
}
}
v11 = add_tbl(a5, a7, &v30, v31);
if ( v11 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 149LL, "stride.c");
}
else
{
zero_fld_rec(v23);
v24 = v29;
v11 = add_fld(v30, a6, v18, v19, v22, v23);
if ( v11 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 152LL, "stride.c");
}
LABEL_33:
if ( addr )
{
if ( len )
{
munmap(addr, len);
addr = 0LL;
len = 0LL;
goto LABEL_36;
}
LABEL_68:
fprintf(stderr, "Line %3d of File %s \n", 155LL, "stride.c");
return (unsigned int)-1;
}
if ( len )
goto LABEL_68;
LABEL_36:
if ( !v36 )
{
if ( !v35 )
return (unsigned int)v11;
LABEL_71:
fprintf(stderr, "Line %3d of File %s \n", 156LL, "stride.c");
return (unsigned int)-1;
}
if ( !v35 )
goto LABEL_71;
munmap(v36, v35);
return (unsigned int)v11;
}

canonical_decompiled_code:
__int64 __fastcall func2(const char *a1, _BYTE *a2, __int64 a3, __int64 a4, const char *a5, _BYTE *a6, __int64 a7)
{
int v11; // er14
__int64 v12; // r15
__int64 v13; // rdx
__int64 v14; // rax
__int64 v15; // r8
int v17; // [rsp+Ch] [rbp-27Ch] BYREF
unsigned int v18; // [rsp+10h] [rbp-278h] BYREF
unsigned int v19; // [rsp+14h] [rbp-274h] BYREF
__int64 v20; // [rsp+18h] [rbp-270h] BYREF
__int64 v21; // [rsp+20h] [rbp-268h] BYREF
char v22[4]; // [rsp+2Ch] [rbp-25Ch] BYREF
char v23[32]; // [rsp+30h] [rbp-258h] BYREF
int v24; // [rsp+50h] [rbp-238h]
int v25; // [rsp+ACh] [rbp-1DCh] BYREF
char v26[124]; // [rsp+B0h] [rbp-1D8h] BYREF
char v27[4]; // [rsp+12Ch] [rbp-15Ch] BYREF
__int64 v28; // [rsp+130h] [rbp-158h] BYREF
__int64 v29; // [rsp+150h] [rbp-138h]
unsigned int v30; // [rsp+1ACh] [rbp-DCh] BYREF
char v31[60]; // [rsp+1B0h] [rbp-D8h] BYREF
char v32[4]; // [rsp+1ECh] [rbp-9Ch] BYREF
__int64 v33[7]; // [rsp+1F0h] [rbp-98h] BYREF
__int64 v34; // [rsp+228h] [rbp-60h] BYREF
size_t v35; // [rsp+230h] [rbp-58h] BYREF
void *v36; // [rsp+238h] [rbp-50h] BYREF
size_t len; // [rsp+240h] [rbp-48h] BYREF
void *addr; // [rsp+248h] [rbp-40h] BYREF

addr = 0LL;
len = 0LL;
v36 = 0LL;
v35 = 0LL;
v19 = -1;
v18 = 0x7FFFFFFF;
v17 = 0x7FFFFFFF;
if ( !a1 || !*a1 )
{
fprintf(stderr, "Line %3d of File %s \n", 95LL, "stride.c");
v11 = -1;
goto LABEL_33;
}
if ( !a2 || !*a2 )
{
fprintf(stderr, "Line %3d of File %s \n", 96LL, "stride.c");
v11 = -1;
goto LABEL_33;
}
if ( !a5 || !*a5 )
{
fprintf(stderr, "Line %3d of File %s \n", 97LL, "stride.c");
v11 = -1;
goto LABEL_33;
}
if ( !a6 || !*a6 )
{
fprintf(stderr, "Line %3d of File %s \n", 98LL, "stride.c");
v11 = -1;
goto LABEL_33;
}
if ( !strcmp(a1, a5) )
{
fprintf(stderr, "Line %3d of File %s \n", 99LL, "stride.c");
v11 = -1;
goto LABEL_33;
}
v11 = stoI8(a3, &v21);
if ( v11 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 100LL, "stride.c");
goto LABEL_33;
}
v11 = stoI8(a4, &v20);
if ( v11 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 101LL, "stride.c");
goto LABEL_33;
}
v34 = (int)stoI8(a7, &v34);
v11 = is_tbl(a1, v32, v33);
if ( v11 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 104LL, "stride.c");
goto LABEL_33;
}
v12 = v33[0];
v11 = is_fld(a1, 0xFFFFFFFFLL, a2, v27, &v28, &v25, v26);
if ( v11 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 107LL, "stride.c");
goto LABEL_33;
}
v11 = get_data(&addr, &len, 0LL);
if ( v11 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 108LL, "stride.c");
goto LABEL_33;
}
if ( v25 >= 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 109LL, "stride.c");
v11 = -1;
goto LABEL_33;
}
v11 = del_tbl(a5, 0xFFFFFFFFLL);
if ( v11 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 110LL, "stride.c");
goto LABEL_33;
}
if ( (unsigned int)(v29 - 4) > 1 )
{
fprintf(stderr, "Line %3d of File %s \n", 115LL, "stride.c");
v11 = -1;
goto LABEL_33;
}
if ( v21 >= v12 || v21 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 118LL, "stride.c");
v11 = -1;
goto LABEL_33;
}
if ( v20 >= v12 || v20 <= 1 )
{
fprintf(stderr, "Line %3d of File %s \n", 119LL, "stride.c");
v11 = -1;
goto LABEL_33;
}
if ( v34 <= 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 120LL, "stride.c");
v11 = -1;
goto LABEL_33;
}
v13 = v34 - 1;
v14 = v21 + v34 * v20 - v20;
if ( v12 < v21 + v34 * v20 )
{
do
{
v15 = v13--;
v14 -= v20;
}
while ( v12 < v20 + v14 );
v34 = v15;
if ( v15 <= 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 124LL, "stride.c");
v11 = -1;
goto LABEL_33;
}
}
v11 = get_fld_sz((unsigned int)v29, &v17, v13);
if ( v11 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 127LL, "stride.c");
goto LABEL_33;
}
v11 = mk_temp_file(v34 * v17, &v18, &v19);
if ( v11 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 129LL, "stride.c");
goto LABEL_33;
}
v11 = q_mmap(v18, v19, &v36, &v35, 1LL);
if ( v11 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 130LL, "stride.c");
goto LABEL_33;
}
if ( (_DWORD)v29 == 4 )
{
v11 = func0((__int64)addr, v12, v21, v20, (__int64)v36, v34);
if ( v11 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 136LL, "stride.c");
goto LABEL_33;
}
}
else
{
if ( (_DWORD)v29 != 5 )
{
fprintf(stderr, "Line %3d of File %s \n", 144LL, "stride.c");
v11 = -1;
goto LABEL_33;
}
v11 = func1((__int64)addr, v12, v21, v20, (__int64)v36, v34);
if ( v11 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 141LL, "stride.c");
goto LABEL_33;
}
}
v11 = add_tbl(a5, a7, &v30, v31);
if ( v11 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 149LL, "stride.c");
}
else
{
zero_fld_rec(v23);
v24 = v29;
v11 = add_fld(v30, a6, v18, v19, v22, v23);
if ( v11 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 152LL, "stride.c");
}
LABEL_33:
if ( addr )
{
if ( len )
{
munmap(addr, len);
addr = 0LL;
len = 0LL;
goto LABEL_36;
}
LABEL_68:
fprintf(stderr, "Line %3d of File %s \n", 155LL, "stride.c");
return (unsigned int)-1;
}
if ( len )
goto LABEL_68;
LABEL_36:
if ( !v36 )
{
if ( !v35 )
return (unsigned int)v11;
LABEL_71:
fprintf(stderr, "Line %3d of File %s \n", 156LL, "stride.c");
return (unsigned int)-1;
}
if ( !v35 )
goto LABEL_71;
munmap(v36, v35);
return (unsigned int)v11;
}

original_code:
int
ext_stride(
    const char *t1,
    const char *f1,
    char *str_start,
    char *str_stride,
    const char *t2,
    const char *f2,
    char *str_nR2
    )
{
  int status = 0;
  char *f1_X = ((void *)0); size_t f1_nX = 0;
  char *f2_X = ((void *)0); size_t f2_nX = 0;
  long long nR1, nR2;
  TBL_REC_TYPE t1_rec; int t1_id;
  TBL_REC_TYPE t2_rec; int t2_id;
  FLD_REC_TYPE f1_rec; int f1_id;
  FLD_REC_TYPE nn_f1_rec; int nn_f1_id;
  FLD_REC_TYPE f2_rec; int f2_id;
  long long start, stride;
  int fileno = -1, ddir_id = 0x7fffffff;
  int fldsz = 0x7fffffff; size_t filesz = 0;
  int *f1I4 = ((void *)0), *f2I4 = ((void *)0);
  long long *f1I8 = ((void *)0), *f2I8 = ((void *)0);
  if ( ( t1 == ((void *)0) ) || ( *t1 == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 95, "stride.c"); }; status = -1 ; goto BYE; }; }
  if ( ( f1 == ((void *)0) ) || ( *f1 == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 96, "stride.c"); }; status = -1 ; goto BYE; }; }
  if ( ( t2 == ((void *)0) ) || ( *t2 == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 97, "stride.c"); }; status = -1 ; goto BYE; }; }
  if ( ( f2 == ((void *)0) ) || ( *f2 == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 98, "stride.c"); }; status = -1 ; goto BYE; }; }
  if ( strcmp(t1, t2) == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 99, "stride.c"); }; status = -1 ; goto BYE; }; }
  status = stoI8(str_start, &start); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 100, "stride.c"); }; status = (status) ; goto BYE; } } };
  status = stoI8(str_stride, &stride); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 101, "stride.c"); }; status = (status) ; goto BYE; } } };
  nR2 = stoI8(str_nR2, &nR2); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 102, "stride.c"); }; status = (status) ; goto BYE; } } };
  status = is_tbl(t1, &t1_id, &t1_rec); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 104, "stride.c"); }; status = (status) ; goto BYE; } } };
  nR1 = t1_rec.nR;
  status = is_fld(t1, -1, f1, &f1_id, &f1_rec, &nn_f1_id, &nn_f1_rec);
  { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 107, "stride.c"); }; status = (status) ; goto BYE; } } };
  status = get_data(f1_rec, &f1_X, &f1_nX, 0); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 108, "stride.c"); }; status = (status) ; goto BYE; } } };
  if ( nn_f1_id >= 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 109, "stride.c"); }; status = -1 ; goto BYE; }; }
  status = del_tbl(t2, -1); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 110, "stride.c"); }; status = (status) ; goto BYE; } } };
  if ( ( f1_rec.fldtype == I4 ) || ( f1_rec.fldtype == I8 ) ) {
  }
  else {
    { { fprintf(stderr, "Line %3d of File %s \n", 115, "stride.c"); }; status = -1 ; goto BYE; };
  }
  if ( ( start < 0 ) || ( start >= nR1 ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 118, "stride.c"); }; status = -1 ; goto BYE; }; }
  if ( ( stride <= 1 ) || ( stride >= nR1 ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 119, "stride.c"); }; status = -1 ; goto BYE; }; }
  if ( nR2 < 1 ) { { { fprintf(stderr, "Line %3d of File %s \n", 120, "stride.c"); }; status = -1 ; goto BYE; }; }
  while ( start + (stride * nR2) > nR1 ) { nR2--; }
  if ( nR2 < 1 ) { { { fprintf(stderr, "Line %3d of File %s \n", 124, "stride.c"); }; status = -1 ; goto BYE; }; }
  status = get_fld_sz(f1_rec.fldtype, &fldsz); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 127, "stride.c"); }; status = (status) ; goto BYE; } } };
  filesz = fldsz * nR2;
  status = mk_temp_file(filesz, &ddir_id, &fileno); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 129, "stride.c"); }; status = (status) ; goto BYE; } } };
  status = q_mmap(ddir_id, fileno, &f2_X, &f2_nX, 1); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 130, "stride.c"); }; status = (status) ; goto BYE; } } };
  switch ( f1_rec.fldtype ) {
    case I4 :
      f1I4 = (int *)f1_X;
      f2I4 = (int *)f2_X;
      status = stride_I4(f1I4, nR1, start, stride, f2I4, nR2); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 136, "stride.c"); }; status = (status) ; goto BYE; } } };
      break;
    case I8 :
      f1I8 = (long long *)f1_X;
      f2I8 = (long long *)f2_X;
      status = stride_I8(f1I8, nR1, start, stride, f2I8, nR2); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 141, "stride.c"); }; status = (status) ; goto BYE; } } };
      break;
    default :
      { { fprintf(stderr, "Line %3d of File %s \n", 144, "stride.c"); }; status = -1 ; goto BYE; };
      break;
  }
  { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 147, "stride.c"); }; status = (status) ; goto BYE; } } };
  status = add_tbl(t2, str_nR2, &t2_id, &t2_rec); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 149, "stride.c"); }; status = (status) ; goto BYE; } } };
  zero_fld_rec(&f2_rec); f2_rec.fldtype = f1_rec.fldtype;
  status = add_fld(t2_id, f2, ddir_id, fileno, &f2_id, &f2_rec);
  { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 152, "stride.c"); }; status = (status) ; goto BYE; } } };
 BYE:
  { if ( ( f1_X == ((void *)0) ) && ( f1_nX != 0 ) ) { { fprintf(stderr, "Line %3d of File %s \n", 155, "stride.c"); }; return(-1); } if ( ( f1_X != ((void *)0) ) && ( f1_nX == 0 ) ) { { fprintf(stderr, "Line %3d of File %s \n", 155, "stride.c"); }; return(-1); } if ( f1_X != ((void *)0) ) { munmap(f1_X, f1_nX); f1_X = ((void *)0); f1_nX = 0; } };
  { if ( ( f2_X == ((void *)0) ) && ( f2_nX != 0 ) ) { { fprintf(stderr, "Line %3d of File %s \n", 156, "stride.c"); }; return(-1); } if ( ( f2_X != ((void *)0) ) && ( f2_nX == 0 ) ) { { fprintf(stderr, "Line %3d of File %s \n", 156, "stride.c"); }; return(-1); } if ( f2_X != ((void *)0) ) { munmap(f2_X, f2_nX); f2_X = ((void *)0); f2_nX = 0; } };
  return status ;
}

canonical_original_code:
int ext_stride(char *t1, char *f1, char *str_start, char *str_stride, char *t2, char *f2, char *str_nR2)
{
  int status = 0;
  char *f1_X = ((void *)0); unsigned long f1_nX = 0;
  char *f2_X = ((void *)0); unsigned long f2_nX = 0;
  long long nR1; long long nR2;
  struct _TBL_REC_TYPE t1_rec; int t1_id;
  struct _TBL_REC_TYPE t2_rec; int t2_id;
  struct _FLD_REC_TYPE f1_rec; int f1_id;
  struct _FLD_REC_TYPE nn_f1_rec; int nn_f1_id;
  struct _FLD_REC_TYPE f2_rec; int f2_id;
  long long start; long long stride;
  int fileno = -1; int ddir_id = 0x7fffffff;
  int fldsz = 0x7fffffff; unsigned long filesz = 0;
  int *f1I4 = ((void *)0); int *f2I4 = ((void *)0);
  long long *f1I8 = ((void *)0); long long *f2I8 = ((void *)0);
  if ( ( t1 == ((void *)0) ) || ( *t1 == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 95, "stride.c"); }; status = -1 ; goto BYE; }; }
  if ( ( f1 == ((void *)0) ) || ( *f1 == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 96, "stride.c"); }; status = -1 ; goto BYE; }; }
  if ( ( t2 == ((void *)0) ) || ( *t2 == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 97, "stride.c"); }; status = -1 ; goto BYE; }; }
  if ( ( f2 == ((void *)0) ) || ( *f2 == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 98, "stride.c"); }; status = -1 ; goto BYE; }; }
  if ( strcmp(t1, t2) == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 99, "stride.c"); }; status = -1 ; goto BYE; }; }
  status = stoI8(str_start, &start); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 100, "stride.c"); }; status = (status) ; goto BYE; } } };
  status = stoI8(str_stride, &stride); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 101, "stride.c"); }; status = (status) ; goto BYE; } } };
  nR2 = stoI8(str_nR2, &nR2); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 102, "stride.c"); }; status = (status) ; goto BYE; } } };
  status = is_tbl(t1, &t1_id, &t1_rec); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 104, "stride.c"); }; status = (status) ; goto BYE; } } };
  nR1 = t1_rec.nR;
  status = is_fld(t1, -1, f1, &f1_id, &f1_rec, &nn_f1_id, &nn_f1_rec);
  { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 107, "stride.c"); }; status = (status) ; goto BYE; } } };
  status = get_data(f1_rec, &f1_X, &f1_nX, 0); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 108, "stride.c"); }; status = (status) ; goto BYE; } } };
  if ( nn_f1_id >= 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 109, "stride.c"); }; status = -1 ; goto BYE; }; }
  status = del_tbl(t2, -1); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 110, "stride.c"); }; status = (status) ; goto BYE; } } };
  if ( ( f1_rec.fldtype == I4 ) || ( f1_rec.fldtype == I8 ) ) {
  }
  else {
    { { fprintf(stderr, "Line %3d of File %s \n", 115, "stride.c"); }; status = -1 ; goto BYE; };
  }
  if ( ( start < 0 ) || ( start >= nR1 ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 118, "stride.c"); }; status = -1 ; goto BYE; }; }
  if ( ( stride <= 1 ) || ( stride >= nR1 ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 119, "stride.c"); }; status = -1 ; goto BYE; }; }
  if ( nR2 < 1 ) { { { fprintf(stderr, "Line %3d of File %s \n", 120, "stride.c"); }; status = -1 ; goto BYE; }; }
  while ( start + (stride * nR2) > nR1 ) { nR2--; }
  if ( nR2 < 1 ) { { { fprintf(stderr, "Line %3d of File %s \n", 124, "stride.c"); }; status = -1 ; goto BYE; }; }
  status = get_fld_sz(f1_rec.fldtype, &fldsz); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 127, "stride.c"); }; status = (status) ; goto BYE; } } };
  filesz = fldsz * nR2;
  status = mk_temp_file(filesz, &ddir_id, &fileno); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 129, "stride.c"); }; status = (status) ; goto BYE; } } };
  status = q_mmap(ddir_id, fileno, &f2_X, &f2_nX, 1); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 130, "stride.c"); }; status = (status) ; goto BYE; } } };
  switch ( f1_rec.fldtype ) {
    case I4 :
      f1I4 = (int *)f1_X;
      f2I4 = (int *)f2_X;
      status = stride_I4(f1I4, nR1, start, stride, f2I4, nR2); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 136, "stride.c"); }; status = (status) ; goto BYE; } } };
      break;
    case I8 :
      f1I8 = (long long *)f1_X;
      f2I8 = (long long *)f2_X;
      status = stride_I8(f1I8, nR1, start, stride, f2I8, nR2); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 141, "stride.c"); }; status = (status) ; goto BYE; } } };
      break;
    default :
      { { fprintf(stderr, "Line %3d of File %s \n", 144, "stride.c"); }; status = -1 ; goto BYE; };
      break;
  }
  { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 147, "stride.c"); }; status = (status) ; goto BYE; } } };
  status = add_tbl(t2, str_nR2, &t2_id, &t2_rec); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 149, "stride.c"); }; status = (status) ; goto BYE; } } };
  zero_fld_rec(&f2_rec); f2_rec.fldtype = f1_rec.fldtype;
  status = add_fld(t2_id, f2, ddir_id, fileno, &f2_id, &f2_rec);
  { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 152, "stride.c"); }; status = (status) ; goto BYE; } } };
 BYE:
  { if ( ( f1_X == ((void *)0) ) && ( f1_nX != 0 ) ) { { fprintf(stderr, "Line %3d of File %s \n", 155, "stride.c"); }; return(-1); } if ( ( f1_X != ((void *)0) ) && ( f1_nX == 0 ) ) { { fprintf(stderr, "Line %3d of File %s \n", 155, "stride.c"); }; return(-1); } if ( f1_X != ((void *)0) ) { munmap(f1_X, f1_nX); f1_X = ((void *)0); f1_nX = 0; } };
  { if ( ( f2_X == ((void *)0) ) && ( f2_nX != 0 ) ) { { fprintf(stderr, "Line %3d of File %s \n", 156, "stride.c"); }; return(-1); } if ( ( f2_X != ((void *)0) ) && ( f2_nX == 0 ) ) { { fprintf(stderr, "Line %3d of File %s \n", 156, "stride.c"); }; return(-1); } if ( f2_X != ((void *)0) ) { munmap(f2_X, f2_nX); f2_X = ((void *)0); f2_nX = 0; } };
  return status ;
}

variable_types: struct _TBL_REC_TYPE { long long nR; _Bool is_temp; char name[-1]; enum _TBL_TYPE { undef_tbl=0, regular=1, ldb_dict=2, txt_lkp=3, min_max=4, first_last=5, bins=6 } tbltype; }

variable_types: struct _FLD_REC_TYPE { short tbl_id; short ddir_id; short parent_id; short nn_fld_id; short len; unsigned long filesz; _Bool is_external; enum _SORT_TYPE { unknown=0, ascending=1, descending=2, unsorted=3 } srttype; enum _FLD_TYPE { undef_fldtype=0, B=1, I1=2, I2=3, I4=4, I8=5, F4=6, F8=7, SC=8, SV=9 } fldtype; enum _AUX_TYPE { undef_auxtype=0, nn=1, len=2, off=3 } auxtype; char name[-1]; int fileno; union sumval { long long sumI8; double sumF8; } sumval; union minval { long long minI8; double minF8; } minval; union maxval { long long maxI8; double maxF8; } maxval; _Bool is_sum_nn; _Bool is_min_nn; _Bool is_max_nn; long long num_nn; }

variable_types: fileno int

variable_types: fldsz int

variable_types:
filesz
unsigned long

user_defined_types: struct _TBL_REC_TYPE { long long nR; _Bool is_temp; char name[-1]; enum _TBL_TYPE tbltype; }

user_defined_types: struct _FLD_REC_TYPE { short tbl_id; short ddir_id; short parent_id; short nn_fld_id; short len; unsigned long filesz; _Bool is_external; enum _SORT_TYPE srttype; enum _FLD_TYPE fldtype; enum _AUX_TYPE auxtype; char name[-1]; int fileno; union sumval sumval; union minval minval; union maxval maxval; _Bool is_sum_nn; _Bool is_min_nn; _Bool is_max_nn; long long num_nn; }


repo: linkedin/datacl

decompiled_code:
__int64 __fastcall g_shift(const char *a1, const char *a2, const char *a3, const char *a4)
{
int v6; // ebx
char *v7; // rbp
_BYTE v9[712]; // [rsp-590h] [rbp-1798h] BYREF
_BYTE v10[712]; // [rsp-2C8h] [rbp-14D0h] BYREF
char v11[1024]; // [rsp+0h] [rbp-1208h] BYREF
char v12[2060]; // [rsp+400h] [rbp-E08h] BYREF
unsigned int v13; // [rsp+C0Ch] [rbp-5FCh] BYREF
__int64 v14; // [rsp+C10h] [rbp-5F8h] BYREF
__int64 v15; // [rsp+C18h] [rbp-5F0h] BYREF
__int64 v16; // [rsp+C20h] [rbp-5E8h] BYREF
__int64 v17; // [rsp+C28h] [rbp-5E0h] BYREF
__int64 v18; // [rsp+C30h] [rbp-5D8h] BYREF
char *haystack; // [rsp+C38h] [rbp-5D0h] BYREF
__int64 v20[89]; // [rsp+C40h] [rbp-5C8h] BYREF
int v21; // [rsp+F0Ch] [rbp-2FCh] BYREF
__int64 v22[89]; // [rsp+F10h] [rbp-2F8h] BYREF
int v23[11]; // [rsp+11DCh] [rbp-2Ch] BYREF

v23[0] = -1;
v21 = -1;
haystack = 0LL;
v18 = 0LL;
v17 = 0LL;
v16 = 0LL;
v15 = 0LL;
v14 = 0LL;
v13 = 0;
g_mmap_meta_data(&g_docroot, &v16, &v15, &v14, &v13);
if ( a3 && *a3 )
{
if ( a4 && *a4 )
{
if ( a1 && *a1 )
{
if ( a2 && *a2 )
{
v6 = g_is_fld(v14, v13, a1, v23, v22);
if ( v6 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 48LL, "g_shift.c");
}
else if ( v23[0] < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 49LL, "g_shift.c");
v6 = -1;
}
else if ( (unsigned int)is_fldtype_goodfor_gpu(LODWORD(v22[4])) )
{
v6 = g_is_fld(v14, v13, a2, &v21, v20);
if ( v6 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 52LL, "g_shift.c");
}
else if ( v21 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 53LL, "g_shift.c");
v6 = -1;
}
else if ( (unsigned int)is_fldtype_goodfor_gpu(LODWORD(v20[4])) )
{
if ( v22[1] )
{
if ( v22[3] )
{
if ( v20[1] )
{
if ( v20[3] )
{
v6 = stoI8(a3, &v18);
if ( v6 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 60LL, "g_shift.c");
}
else
{
qmemcpy(v10, v20, sizeof(v10));
qmemcpy(v9, v22, sizeof(v9));
v6 = g_chk_shift(v18, v17);
if ( v6 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 61LL, "g_shift.c");
}
else
{
v6 = stoI8(a3, &v18);
if ( v6 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 62LL, "g_shift.c");
}
else if ( (unsigned __int64)(v18 + 16) > 0x20 )
{
fprintf(stderr, "Line %3d of File %s \n", 64LL, "g_shift.c");
v6 = -1;
}
else
{
v6 = stoI8(a4, &v17);
if ( v6 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 66LL, "g_shift.c");
}
else
{
zero_string(v12, 2048LL);
zero_string(v11, 1024LL);
sprintf(v11, "f1_shift_f2 d_fld1=%s d_fld2=%s shift_amt=%s newval=%s", a1, a2, a3, a4);
v6 = g_make_url(v11, v12);
if ( v6 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 72LL, "g_shift.c");
}
else
{
v6 = g_call_gpu(v12, &haystack);
if ( v6 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 73LL, "g_shift.c");
}
else
{
v7 = haystack;
if ( !haystack )
goto LABEL_46;
if ( strstr(haystack, "\"\"") )
{
LABEL_45:
free(v7);
haystack = 0LL;
goto LABEL_46;
}
fprintf(stderr, "Response from GPU = [%s]\n", v7);
}
}
}
}
}
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 59LL, "g_shift.c");
v6 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 58LL, "g_shift.c");
v6 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 57LL, "g_shift.c");
v6 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 56LL, "g_shift.c");
v6 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 54LL, "g_shift.c");
v6 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 50LL, "g_shift.c");
v6 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 46LL, "g_shift.c");
v6 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 45LL, "g_shift.c");
v6 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 44LL, "g_shift.c");
v6 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 43LL, "g_shift.c");
v6 = -1;
}
v7 = haystack;
if ( haystack )
goto LABEL_45;
LABEL_46:
g_unmap_meta_data(v16, v15);
return (unsigned int)v6;
}

canonical_decompiled_code:
__int64 __fastcall func0(const char *a1, const char *a2, const char *a3, const char *a4)
{
int v6; // ebx
char *v7; // rbp
_BYTE v9[712]; // [rsp-590h] [rbp-1798h] BYREF
_BYTE v10[712]; // [rsp-2C8h] [rbp-14D0h] BYREF
char v11[1024]; // [rsp+0h] [rbp-1208h] BYREF
char v12[2060]; // [rsp+400h] [rbp-E08h] BYREF
unsigned int v13; // [rsp+C0Ch] [rbp-5FCh] BYREF
__int64 v14; // [rsp+C10h] [rbp-5F8h] BYREF
__int64 v15; // [rsp+C18h] [rbp-5F0h] BYREF
__int64 v16; // [rsp+C20h] [rbp-5E8h] BYREF
__int64 v17; // [rsp+C28h] [rbp-5E0h] BYREF
__int64 v18; // [rsp+C30h] [rbp-5D8h] BYREF
char *haystack; // [rsp+C38h] [rbp-5D0h] BYREF
__int64 v20[89]; // [rsp+C40h] [rbp-5C8h] BYREF
int v21; // [rsp+F0Ch] [rbp-2FCh] BYREF
__int64 v22[89]; // [rsp+F10h] [rbp-2F8h] BYREF
int v23[11]; // [rsp+11DCh] [rbp-2Ch] BYREF

v23[0] = -1;
v21 = -1;
haystack = 0LL;
v18 = 0LL;
v17 = 0LL;
v16 = 0LL;
v15 = 0LL;
v14 = 0LL;
v13 = 0;
g_mmap_meta_data(&g_docroot, &v16, &v15, &v14, &v13);
if ( a3 && *a3 )
{
if ( a4 && *a4 )
{
if ( a1 && *a1 )
{
if ( a2 && *a2 )
{
v6 = g_is_fld(v14, v13, a1, v23, v22);
if ( v6 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 48LL, "g_shift.c");
}
else if ( v23[0] < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 49LL, "g_shift.c");
v6 = -1;
}
else if ( (unsigned int)is_fldtype_goodfor_gpu(LODWORD(v22[4])) )
{
v6 = g_is_fld(v14, v13, a2, &v21, v20);
if ( v6 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 52LL, "g_shift.c");
}
else if ( v21 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 53LL, "g_shift.c");
v6 = -1;
}
else if ( (unsigned int)is_fldtype_goodfor_gpu(LODWORD(v20[4])) )
{
if ( v22[1] )
{
if ( v22[3] )
{
if ( v20[1] )
{
if ( v20[3] )
{
v6 = stoI8(a3, &v18);
if ( v6 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 60LL, "g_shift.c");
}
else
{
qmemcpy(v10, v20, sizeof(v10));
qmemcpy(v9, v22, sizeof(v9));
v6 = g_chk_shift(v18, v17);
if ( v6 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 61LL, "g_shift.c");
}
else
{
v6 = stoI8(a3, &v18);
if ( v6 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 62LL, "g_shift.c");
}
else if ( (unsigned __int64)(v18 + 16) > 0x20 )
{
fprintf(stderr, "Line %3d of File %s \n", 64LL, "g_shift.c");
v6 = -1;
}
else
{
v6 = stoI8(a4, &v17);
if ( v6 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 66LL, "g_shift.c");
}
else
{
zero_string(v12, 2048LL);
zero_string(v11, 1024LL);
sprintf(v11, "f1_shift_f2 d_fld1=%s d_fld2=%s shift_amt=%s newval=%s", a1, a2, a3, a4);
v6 = g_make_url(v11, v12);
if ( v6 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 72LL, "g_shift.c");
}
else
{
v6 = g_call_gpu(v12, &haystack);
if ( v6 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 73LL, "g_shift.c");
}
else
{
v7 = haystack;
if ( !haystack )
goto LABEL_46;
if ( strstr(haystack, "\"\"") )
{
LABEL_45:
free(v7);
haystack = 0LL;
goto LABEL_46;
}
fprintf(stderr, "Response from GPU = [%s]\n", v7);
}
}
}
}
}
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 59LL, "g_shift.c");
v6 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 58LL, "g_shift.c");
v6 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 57LL, "g_shift.c");
v6 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 56LL, "g_shift.c");
v6 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 54LL, "g_shift.c");
v6 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 50LL, "g_shift.c");
v6 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 46LL, "g_shift.c");
v6 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 45LL, "g_shift.c");
v6 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 44LL, "g_shift.c");
v6 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 43LL, "g_shift.c");
v6 = -1;
}
v7 = haystack;
if ( haystack )
goto LABEL_45;
LABEL_46:
g_unmap_meta_data(v16, v15);
return (unsigned int)v6;
}

original_code:
int
g_shift(
    char *f1,
    char *f2,
    char *str_shift_amt,
    char *str_newval
    )
{
  int status = 0;
  int f1_id = -1; GPU_REG_TYPE f1_rec;
  int f2_id = -1; GPU_REG_TYPE f2_rec;
  char *curl_response = ((void *)0);
  long long shift_amt = 0, newval = 0;
  char *gpu_reg_X = ((void *)0);
  size_t gpu_reg_nX = 0;
  GPU_REG_TYPE *gpu_reg = ((void *)0);
  int n_gpu_reg = 0;
  status = g_mmap_meta_data(g_docroot, &gpu_reg_X, &gpu_reg_nX,
      &gpu_reg, &n_gpu_reg);
  if ( ( str_shift_amt == ((void *)0) ) || ( *str_shift_amt == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 43, "g_shift.c"); }; status = -1 ; goto BYE; }; }
  if ( ( str_newval == ((void *)0) ) || ( *str_newval == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 44, "g_shift.c"); }; status = -1 ; goto BYE; }; }
  if ( ( f1 == ((void *)0) ) || ( *f1 == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 45, "g_shift.c"); }; status = -1 ; goto BYE; }; }
  if ( ( f2 == ((void *)0) ) || ( *f2 == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 46, "g_shift.c"); }; status = -1 ; goto BYE; }; }
  status = g_is_fld(gpu_reg, n_gpu_reg, f1, &f1_id, &f1_rec); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 48, "g_shift.c"); }; status = (status) ; goto BYE; } } };
  if ( f1_id < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 49, "g_shift.c"); }; status = -1 ; goto BYE; }; }
  if ( is_fldtype_goodfor_gpu(f1_rec.fldtype) == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 50, "g_shift.c"); }; status = -1 ; goto BYE; }; }
  status = g_is_fld(gpu_reg, n_gpu_reg, f2, &f2_id, &f2_rec); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 52, "g_shift.c"); }; status = (status) ; goto BYE; } } };
  if ( f2_id < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 53, "g_shift.c"); }; status = -1 ; goto BYE; }; }
  if ( is_fldtype_goodfor_gpu(f2_rec.fldtype) == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 54, "g_shift.c"); }; status = -1 ; goto BYE; }; }
  if ( f1_rec.filesz == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 56, "g_shift.c"); }; status = -1 ; goto BYE; }; }
  if ( f1_rec.nR == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 57, "g_shift.c"); }; status = -1 ; goto BYE; }; }
  if ( f2_rec.filesz == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 58, "g_shift.c"); }; status = -1 ; goto BYE; }; }
  if ( f2_rec.nR == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 59, "g_shift.c"); }; status = -1 ; goto BYE; }; }
 status = stoI8(str_shift_amt, &shift_amt); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 60, "g_shift.c"); }; status = (status) ; goto BYE; } } };
  status = g_chk_shift(f1_rec, f2_rec, shift_amt, newval); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 61, "g_shift.c"); }; status = (status) ; goto BYE; } } };
  status = stoI8(str_shift_amt, &shift_amt); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 62, "g_shift.c"); }; status = (status) ; goto BYE; } } };
  if ( ( shift_amt < (-1 * 16) ) || ( shift_amt > 16 ) ) {
    { { fprintf(stderr, "Line %3d of File %s \n", 64, "g_shift.c"); }; status = -1 ; goto BYE; };
  }
  status = stoI8(str_newval, &newval); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 66, "g_shift.c"); }; status = (status) ; goto BYE; } } };
  char url[2048]; zero_string(url, 2048);
  char command[1024]; zero_string(command, 1024);
  sprintf(command, "f1_shift_f2 d_fld1=%s d_fld2=%s shift_amt=%s newval=%s",
      f1, f2, str_shift_amt, str_newval);
  status = g_make_url(command, url); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 72, "g_shift.c"); }; status = (status) ; goto BYE; } } };
  status = g_call_gpu(url, &curl_response); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 73, "g_shift.c"); }; status = (status) ; goto BYE; } } };
  if ( curl_response != ((void *)0) ) {
    if ( strstr(curl_response, "\"\"") == ((void *)0) ) {
      fprintf(stderr, "Response from GPU = [%s]\n", curl_response);
    }
  }
BYE:
  { if ( (curl_response) != ((void *)0) ) { free((curl_response)); (curl_response) = ((void *)0); } };
  g_unmap_meta_data(gpu_reg_X, gpu_reg_nX);
  return(status);
}

canonical_original_code:
int g_shift(char *f1, char *f2, char *str_shift_amt, char *str_newval)
{
  int status = 0;
  int f1_id = -1; struct _GPU_REG_TYPE f1_rec;
  int f2_id = -1; struct _GPU_REG_TYPE f2_rec;
  char *curl_response = ((void *)0);
  long long shift_amt = 0; long long newval = 0;
  char *gpu_reg_X = ((void *)0);
  unsigned long gpu_reg_nX = 0;
  struct _GPU_REG_TYPE *gpu_reg = ((void *)0);
  int n_gpu_reg = 0;
  status = g_mmap_meta_data(g_docroot, &gpu_reg_X, &gpu_reg_nX,
      &gpu_reg, &n_gpu_reg);
  if ( ( str_shift_amt == ((void *)0) ) || ( *str_shift_amt == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 43, "g_shift.c"); }; status = -1 ; goto BYE; }; }
  if ( ( str_newval == ((void *)0) ) || ( *str_newval == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 44, "g_shift.c"); }; status = -1 ; goto BYE; }; }
  if ( ( f1 == ((void *)0) ) || ( *f1 == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 45, "g_shift.c"); }; status = -1 ; goto BYE; }; }
  if ( ( f2 == ((void *)0) ) || ( *f2 == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 46, "g_shift.c"); }; status = -1 ; goto BYE; }; }
  status = g_is_fld(gpu_reg, n_gpu_reg, f1, &f1_id, &f1_rec); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 48, "g_shift.c"); }; status = (status) ; goto BYE; } } };
  if ( f1_id < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 49, "g_shift.c"); }; status = -1 ; goto BYE; }; }
  if ( is_fldtype_goodfor_gpu(f1_rec.fldtype) == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 50, "g_shift.c"); }; status = -1 ; goto BYE; }; }
  status = g_is_fld(gpu_reg, n_gpu_reg, f2, &f2_id, &f2_rec); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 52, "g_shift.c"); }; status = (status) ; goto BYE; } } };
  if ( f2_id < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 53, "g_shift.c"); }; status = -1 ; goto BYE; }; }
  if ( is_fldtype_goodfor_gpu(f2_rec.fldtype) == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 54, "g_shift.c"); }; status = -1 ; goto BYE; }; }
  if ( f1_rec.filesz == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 56, "g_shift.c"); }; status = -1 ; goto BYE; }; }
  if ( f1_rec.nR == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 57, "g_shift.c"); }; status = -1 ; goto BYE; }; }
  if ( f2_rec.filesz == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 58, "g_shift.c"); }; status = -1 ; goto BYE; }; }
  if ( f2_rec.nR == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 59, "g_shift.c"); }; status = -1 ; goto BYE; }; }
 status = stoI8(str_shift_amt, &shift_amt); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 60, "g_shift.c"); }; status = (status) ; goto BYE; } } };
  status = g_chk_shift(f1_rec, f2_rec, shift_amt, newval); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 61, "g_shift.c"); }; status = (status) ; goto BYE; } } };
  status = stoI8(str_shift_amt, &shift_amt); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 62, "g_shift.c"); }; status = (status) ; goto BYE; } } };
  if ( ( shift_amt < (-1 * 16) ) || ( shift_amt > 16 ) ) {
    { { fprintf(stderr, "Line %3d of File %s \n", 64, "g_shift.c"); }; status = -1 ; goto BYE; };
  }
  status = stoI8(str_newval, &newval); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 66, "g_shift.c"); }; status = (status) ; goto BYE; } } };
  char url[2048]; zero_string(url, 2048);
  char command[1024]; zero_string(command, 1024);
  sprintf(command, "f1_shift_f2 d_fld1=%s d_fld2=%s shift_amt=%s newval=%s",
      f1, f2, str_shift_amt, str_newval);
  status = g_make_url(command, url); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 72, "g_shift.c"); }; status = (status) ; goto BYE; } } };
  status = g_call_gpu(url, &curl_response); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 73, "g_shift.c"); }; status = (status) ; goto BYE; } } };
  if ( curl_response != ((void *)0) ) {
    if ( strstr(curl_response, "\"\"") == ((void *)0) ) {
      fprintf(stderr, "Response from GPU = [%s]\n", curl_response);
    }
  }
BYE:
  { if ( (curl_response) != ((void *)0) ) { free((curl_response)); (curl_response) = ((void *)0); } };
  g_unmap_meta_data(gpu_reg_X, gpu_reg_nX);
  return(status);
}

variable_types: status int

variable_types:
newval
long long

variable_types: struct _GPU_REG_TYPE { void *reg; unsigned long filesz; _Bool is_busy; long long nR; enum _FLD_TYPE { undef_fldtype=0, B=1, I1=2, I2=3, I4=4, I8=5, F4=6, F8=7, SC=8, SV=9 } fldtype; char filename[-1]; char tbl[-1]; char h_fld[-1]; char d_fld[-1]; } *

variable_types:
url
char [2048]

variable_types:
command
char [1024]

return_type: int

user_defined_types: struct _GPU_REG_TYPE { void *reg; unsigned long filesz; _Bool is_busy; long long nR; enum _FLD_TYPE fldtype; char filename[-1]; char tbl[-1]; char h_fld[-1]; char d_fld[-1]; }


original_code:
void
mul2_F8(
       double *in1,
       double *in2,
       long long nR,
       double * restrict out
       )
{
  double 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 mul2_F8(double *in1, double *in2, long long nR, double *out)
{
  double inv1; double inv2; double 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
double *

variable_types: outv double

variable_types:
i
long long

return_type: void


decompiled_code:
__int64 __fastcall g_load(_BYTE *a1, _BYTE *a2, _BYTE *a3)
{
int v4; // ebx
char *v5; // rbp
char v7[1024]; // [rsp+0h] [rbp-1458h] BYREF
char src[1024]; // [rsp+400h] [rbp-1058h] BYREF
char v9[2052]; // [rsp+800h] [rbp-C58h] BYREF
unsigned int v10; // [rsp+1004h] [rbp-454h] BYREF
__int64 v11; // [rsp+1008h] [rbp-450h] BYREF
__int64 v12; // [rsp+1010h] [rbp-448h] BYREF
__int64 v13; // [rsp+1018h] [rbp-440h] BYREF
char v14[712]; // [rsp+1020h] [rbp-438h] BYREF
char *haystack; // [rsp+12E8h] [rbp-170h] BYREF
char v16[120]; // [rsp+12F0h] [rbp-168h] BYREF
int v17; // [rsp+1368h] [rbp-F0h] BYREF
int v18; // [rsp+136Ch] [rbp-ECh] BYREF
__int64 v19; // [rsp+1370h] [rbp-E8h] BYREF
__int64 v20; // [rsp+1390h] [rbp-C8h]
int v21; // [rsp+13ECh] [rbp-6Ch] BYREF
__int64 v22; // [rsp+13F0h] [rbp-68h] BYREF
unsigned int v23[11]; // [rsp+142Ch] [rbp-2Ch] BYREF

v23[0] = -1;
v21 = -1;
v18 = -1;
v17 = -1;
haystack = 0LL;
v13 = 0LL;
v12 = 0LL;
v11 = 0LL;
v10 = 0;
g_mmap_meta_data(&g_docroot, &v13, &v12, &v11, &v10);
if ( a1 && *a1 )
{
if ( a2 && *a2 )
{
if ( a3 && *a3 )
{
if ( (unsigned int)g_num_free_regs(v11, v10) )
{
v4 = chk_fld_name(a3);
if ( v4 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 48LL, "g_load.c");
}
else
{
v4 = is_tbl(a1, v23, &v22);
if ( v4 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 49LL, "g_load.c");
}
else if ( (v23[0] & 0x80000000) != 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 50LL, "g_load.c");
v4 = -1;
}
else
{
is_fld(0LL, v23[0], a2, &v21, &v19, &v17, v16);
if ( v21 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 53LL, "g_load.c");
v4 = -1;
}
else if ( v17 >= 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 54LL, "g_load.c");
v4 = -1;
}
else if ( (unsigned int)is_fldtype_goodfor_gpu((unsigned int)v20) )
{
v4 = g_is_fld(v11, v10, a3, &v18, v14);
if ( v4 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 57LL, "g_load.c");
}
else if ( v18 >= 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 58LL, "g_load.c");
v4 = -1;
}
else
{
zero_string(v9, 2048LL);
zero_string(src, 1024LL);
zero_string(v7, 1024LL);
v4 = g_meta_to_str(src, a3);
if ( v4 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 65LL, "g_load.c");
}
else
{
strcpy(v7, "load ");
strcat(v7, src);
v4 = g_make_url(v7, v9);
if ( v4 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 68LL, "g_load.c");
}
else
{
v4 = g_call_gpu(v9, &haystack);
if ( v4 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 69LL, "g_load.c");
}
else
{
v5 = haystack;
if ( !haystack )
goto LABEL_29;
if ( strstr(haystack, "\"\"") )
{
LABEL_28:
free(v5);
haystack = 0LL;
goto LABEL_29;
}
fprintf(stderr, "Response from GPU = [%s]\n", v5);
}
}
}
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 55LL, "g_load.c");
v4 = -1;
}
}
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 47LL, "g_load.c");
v4 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 45LL, "g_load.c");
v4 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 44LL, "g_load.c");
v4 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 43LL, "g_load.c");
v4 = -1;
}
v5 = haystack;
if ( haystack )
goto LABEL_28;
LABEL_29:
g_unmap_meta_data(v13, v12);
return (unsigned int)v4;
}

canonical_decompiled_code:
__int64 __fastcall func0(_BYTE *a1, _BYTE *a2, _BYTE *a3)
{
int v4; // ebx
char *v5; // rbp
char v7[1024]; // [rsp+0h] [rbp-1458h] BYREF
char src[1024]; // [rsp+400h] [rbp-1058h] BYREF
char v9[2052]; // [rsp+800h] [rbp-C58h] BYREF
unsigned int v10; // [rsp+1004h] [rbp-454h] BYREF
__int64 v11; // [rsp+1008h] [rbp-450h] BYREF
__int64 v12; // [rsp+1010h] [rbp-448h] BYREF
__int64 v13; // [rsp+1018h] [rbp-440h] BYREF
char v14[712]; // [rsp+1020h] [rbp-438h] BYREF
char *haystack; // [rsp+12E8h] [rbp-170h] BYREF
char v16[120]; // [rsp+12F0h] [rbp-168h] BYREF
int v17; // [rsp+1368h] [rbp-F0h] BYREF
int v18; // [rsp+136Ch] [rbp-ECh] BYREF
__int64 v19; // [rsp+1370h] [rbp-E8h] BYREF
__int64 v20; // [rsp+1390h] [rbp-C8h]
int v21; // [rsp+13ECh] [rbp-6Ch] BYREF
__int64 v22; // [rsp+13F0h] [rbp-68h] BYREF
unsigned int v23[11]; // [rsp+142Ch] [rbp-2Ch] BYREF

v23[0] = -1;
v21 = -1;
v18 = -1;
v17 = -1;
haystack = 0LL;
v13 = 0LL;
v12 = 0LL;
v11 = 0LL;
v10 = 0;
g_mmap_meta_data(&g_docroot, &v13, &v12, &v11, &v10);
if ( a1 && *a1 )
{
if ( a2 && *a2 )
{
if ( a3 && *a3 )
{
if ( (unsigned int)g_num_free_regs(v11, v10) )
{
v4 = chk_fld_name(a3);
if ( v4 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 48LL, "g_load.c");
}
else
{
v4 = is_tbl(a1, v23, &v22);
if ( v4 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 49LL, "g_load.c");
}
else if ( (v23[0] & 0x80000000) != 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 50LL, "g_load.c");
v4 = -1;
}
else
{
is_fld(0LL, v23[0], a2, &v21, &v19, &v17, v16);
if ( v21 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 53LL, "g_load.c");
v4 = -1;
}
else if ( v17 >= 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 54LL, "g_load.c");
v4 = -1;
}
else if ( (unsigned int)is_fldtype_goodfor_gpu((unsigned int)v20) )
{
v4 = g_is_fld(v11, v10, a3, &v18, v14);
if ( v4 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 57LL, "g_load.c");
}
else if ( v18 >= 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 58LL, "g_load.c");
v4 = -1;
}
else
{
zero_string(v9, 2048LL);
zero_string(src, 1024LL);
zero_string(v7, 1024LL);
v4 = g_meta_to_str(src, a3);
if ( v4 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 65LL, "g_load.c");
}
else
{
strcpy(v7, "load ");
strcat(v7, src);
v4 = g_make_url(v7, v9);
if ( v4 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 68LL, "g_load.c");
}
else
{
v4 = g_call_gpu(v9, &haystack);
if ( v4 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 69LL, "g_load.c");
}
else
{
v5 = haystack;
if ( !haystack )
goto LABEL_29;
if ( strstr(haystack, "\"\"") )
{
LABEL_28:
free(v5);
haystack = 0LL;
goto LABEL_29;
}
fprintf(stderr, "Response from GPU = [%s]\n", v5);
}
}
}
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 55LL, "g_load.c");
v4 = -1;
}
}
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 47LL, "g_load.c");
v4 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 45LL, "g_load.c");
v4 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 44LL, "g_load.c");
v4 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 43LL, "g_load.c");
v4 = -1;
}
v5 = haystack;
if ( haystack )
goto LABEL_28;
LABEL_29:
g_unmap_meta_data(v13, v12);
return (unsigned int)v4;
}

original_code:
int
g_load(
    char *tbl,
    char *h_fld,
    char *d_fld
    )
{
  int status = 0;
  int tbl_id = -1; TBL_REC_TYPE tbl_rec;
  int h_fld_id = -1; FLD_REC_TYPE h_fld_rec;
  int d_fld_id = -1;
  int nn_fld_id = -1; FLD_REC_TYPE nn_fld_rec;
  char *curl_response = ((void *)0);
  GPU_REG_TYPE d_fld_rec;
  char *gpu_reg_X = ((void *)0);
  size_t gpu_reg_nX = 0;
  GPU_REG_TYPE *gpu_reg = ((void *)0);
  int n_gpu_reg = 0;
  status = g_mmap_meta_data(g_docroot, &gpu_reg_X, &gpu_reg_nX,
      &gpu_reg, &n_gpu_reg);
  if ( ( tbl == ((void *)0) ) || ( *tbl == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 43, "g_load.c"); }; status = -1 ; goto BYE; }; }
  if ( ( h_fld == ((void *)0) ) || ( *h_fld == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 44, "g_load.c"); }; status = -1 ; goto BYE; }; }
  if ( ( d_fld == ((void *)0) ) || ( *d_fld == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 45, "g_load.c"); }; status = -1 ; goto BYE; }; }
  if ( g_num_free_regs(gpu_reg, n_gpu_reg) == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 47, "g_load.c"); }; status = -1 ; goto BYE; }; }
  status = chk_fld_name(d_fld); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 48, "g_load.c"); }; status = (status) ; goto BYE; } } };
  status = is_tbl(tbl, &tbl_id, &tbl_rec); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 49, "g_load.c"); }; status = (status) ; goto BYE; } } };
  if ( tbl_id < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 50, "g_load.c"); }; status = -1 ; goto BYE; }; }
  status = is_fld(((void *)0), tbl_id, h_fld, &h_fld_id, &h_fld_rec,
      &nn_fld_id, &nn_fld_rec);
  if ( h_fld_id < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 53, "g_load.c"); }; status = -1 ; goto BYE; }; }
  if ( nn_fld_id >= 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 54, "g_load.c"); }; status = -1 ; goto BYE; }; }
  if ( is_fldtype_goodfor_gpu(h_fld_rec.fldtype) == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 55, "g_load.c"); }; status = -1 ; goto BYE; }; }
  status = g_is_fld(gpu_reg, n_gpu_reg, d_fld, &d_fld_id, &d_fld_rec);
  { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 57, "g_load.c"); }; status = (status) ; goto BYE; } } };
  if ( d_fld_id >= 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 58, "g_load.c"); }; status = -1 ; goto BYE; }; }
  char url[2048]; zero_string(url, 2048);
  char meta_str[1024]; zero_string(meta_str, 1024);
  char command[1024]; zero_string(command, 1024);
  status = g_meta_to_str(meta_str, d_fld, tbl_rec, h_fld_rec); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 65, "g_load.c"); }; status = (status) ; goto BYE; } } };
  strcpy(command, "load "); strcat(command, meta_str);
  status = g_make_url(command, url); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 68, "g_load.c"); }; status = (status) ; goto BYE; } } };
  status = g_call_gpu(url, &curl_response); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 69, "g_load.c"); }; status = (status) ; goto BYE; } } };
  if ( curl_response != ((void *)0) ) {
    if ( strstr(curl_response, "\"\"") == ((void *)0) ) {
      fprintf(stderr, "Response from GPU = [%s]\n", curl_response);
    }
  }
BYE:
  { if ( (curl_response) != ((void *)0) ) { free((curl_response)); (curl_response) = ((void *)0); } };
  g_unmap_meta_data(gpu_reg_X, gpu_reg_nX);
  return(status);
}

canonical_original_code:
int g_load(char *tbl, char *h_fld, char *d_fld)
{
  int status = 0;
  int tbl_id = -1; struct _TBL_REC_TYPE tbl_rec;
  int h_fld_id = -1; struct _FLD_REC_TYPE h_fld_rec;
  int d_fld_id = -1;
  int nn_fld_id = -1; struct _FLD_REC_TYPE nn_fld_rec;
  char *curl_response = ((void *)0);
  struct _GPU_REG_TYPE d_fld_rec;
  char *gpu_reg_X = ((void *)0);
  unsigned long gpu_reg_nX = 0;
  struct _GPU_REG_TYPE *gpu_reg = ((void *)0);
  int n_gpu_reg = 0;
  status = g_mmap_meta_data(g_docroot, &gpu_reg_X, &gpu_reg_nX,
      &gpu_reg, &n_gpu_reg);
  if ( ( tbl == ((void *)0) ) || ( *tbl == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 43, "g_load.c"); }; status = -1 ; goto BYE; }; }
  if ( ( h_fld == ((void *)0) ) || ( *h_fld == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 44, "g_load.c"); }; status = -1 ; goto BYE; }; }
  if ( ( d_fld == ((void *)0) ) || ( *d_fld == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 45, "g_load.c"); }; status = -1 ; goto BYE; }; }
  if ( g_num_free_regs(gpu_reg, n_gpu_reg) == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 47, "g_load.c"); }; status = -1 ; goto BYE; }; }
  status = chk_fld_name(d_fld); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 48, "g_load.c"); }; status = (status) ; goto BYE; } } };
  status = is_tbl(tbl, &tbl_id, &tbl_rec); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 49, "g_load.c"); }; status = (status) ; goto BYE; } } };
  if ( tbl_id < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 50, "g_load.c"); }; status = -1 ; goto BYE; }; }
  status = is_fld(((void *)0), tbl_id, h_fld, &h_fld_id, &h_fld_rec,
      &nn_fld_id, &nn_fld_rec);
  if ( h_fld_id < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 53, "g_load.c"); }; status = -1 ; goto BYE; }; }
  if ( nn_fld_id >= 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 54, "g_load.c"); }; status = -1 ; goto BYE; }; }
  if ( is_fldtype_goodfor_gpu(h_fld_rec.fldtype) == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 55, "g_load.c"); }; status = -1 ; goto BYE; }; }
  status = g_is_fld(gpu_reg, n_gpu_reg, d_fld, &d_fld_id, &d_fld_rec);
  { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 57, "g_load.c"); }; status = (status) ; goto BYE; } } };
  if ( d_fld_id >= 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 58, "g_load.c"); }; status = -1 ; goto BYE; }; }
  char url[2048]; zero_string(url, 2048);
  char meta_str[1024]; zero_string(meta_str, 1024);
  char command[1024]; zero_string(command, 1024);
  status = g_meta_to_str(meta_str, d_fld, tbl_rec, h_fld_rec); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 65, "g_load.c"); }; status = (status) ; goto BYE; } } };
  strcpy(command, "load "); strcat(command, meta_str);
  status = g_make_url(command, url); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 68, "g_load.c"); }; status = (status) ; goto BYE; } } };
  status = g_call_gpu(url, &curl_response); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 69, "g_load.c"); }; status = (status) ; goto BYE; } } };
  if ( curl_response != ((void *)0) ) {
    if ( strstr(curl_response, "\"\"") == ((void *)0) ) {
      fprintf(stderr, "Response from GPU = [%s]\n", curl_response);
    }
  }
BYE:
  { if ( (curl_response) != ((void *)0) ) { free((curl_response)); (curl_response) = ((void *)0); } };
  g_unmap_meta_data(gpu_reg_X, gpu_reg_nX);
  return(status);
}

variable_types:
tbl
char *

variable_types: struct _GPU_REG_TYPE { void *reg; unsigned long filesz; _Bool is_busy; long long nR; enum _FLD_TYPE { undef_fldtype=0, B=1, I1=2, I2=3, I4=4, I8=5, F4=6, F8=7, SC=8, SV=9 } fldtype; char filename[-1]; char tbl[-1]; char h_fld[-1]; char d_fld[-1]; }

user_defined_types: enum _TBL_TYPE { undef_tbl=0, regular=1, ldb_dict=2, txt_lkp=3, min_max=4, first_last=5, bins=6 }

user_defined_types: enum _SORT_TYPE { unknown=0, ascending=1, descending=2, unsorted=3 }

user_defined_types: enum _AUX_TYPE { undef_auxtype=0, nn=1, len=2, off=3 }

user_defined_types: union sumval { long long sumI8; double sumF8; }

user_defined_types: union minval { long long minI8; double minF8; }

user_defined_types: union maxval { long long maxI8; double maxF8; }


decompiled_code:
void __fastcall vec_sqrt_F4(float *a1, int a2, float *a3)
{
float *v3; // rbx
float v5; // xmm0_4
float v6; // xmm0_4

if ( a2 > 0 )
{
v3 = a1;
do
{
v5 = *v3;
if ( *v3 < 0.0 )
v6 = sqrtf(v5);
else
v6 = fsqrt(v5);
*a3 = v6;
++v3;
++a3;
}
while ( v3 != &a1[a2] );
}
}

canonical_decompiled_code:
void __fastcall func0(float *a1, int a2, float *a3)
{
float *v3; // rbx
float v5; // xmm0_4
float v6; // xmm0_4

if ( a2 > 0 )
{
v3 = a1;
do
{
v5 = *v3;
if ( *v3 < 0.0 )
v6 = sqrtf(v5);
else
v6 = fsqrt(v5);
*a3 = v6;
++v3;
++a3;
}
while ( v3 != &a1[a2] );
}
}

original_code:
void
vec_sqrt_F4(
       float *in,
       int nR,
       float *out
       )
{
  int i;
  for ( i = 0; i < nR; i++ ) {
    *out = (float)sqrt(*in);
    in++;
    out++;
  }
}

canonical_original_code:
void vec_sqrt_F4(float *in, int nR, float *out)
{
  int i;
  for ( i = 0; i < nR; i++ ) {
    *out = (float)sqrt(*in);
    in++;
    out++;
  }
}

variable_types:
in
float *

variable_types: nR int

variable_types:
out
float *

variable_types: i int


original_code:
void
bwise_and2_I8(
       unsigned long long *in1,
       unsigned long long *in2,
       long long nR,
       unsigned long long * restrict out
       )
{
  long long 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 bwise_and2_I8(unsigned long long *in1, unsigned long long *in2, long long nR, unsigned long long *out)
{
  long long inv1; long long inv2; long long outv;
  for ( long long i = 0; i < nR; i++ ) {
    inv1 = *in1;
    inv2 = *in2;
    outv = inv1 & inv2;
    *out = outv;
    in1++;
    in2++;
    out++;
  }
}

variable_types:
out
unsigned long long *

variable_types:
outv
long long


original_code:
int
pos_sel_copy_I4_I8(
    int *f1,
    long long nR1,
    long long *f2,
    long long nR2,
    int lb,
    int ub,
    int *f3,
    long long *ptr_cnt
    )
{
  int status = 0;
  long long cnt = 0;
  long long i3 = 0;
  for ( long long i2 = 0; i2 < nR2; i2++ ) {
    long long f1idx = f2[i2];
    if ( ( f1idx < 0 ) || ( f1idx >= nR1 ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 34, "./AUX/pos_sel_copy_I4_I8.c"); }; status = -1 ; goto BYE; }; }
    int val = f1[f1idx];
    if ( ( val >= lb ) && ( val <= ub ) ) {
      f3[i3++] = val;
      cnt++;
    }
  }
  *ptr_cnt = cnt;
BYE:
  return(status);
}

canonical_original_code:
int pos_sel_copy_I4_I8(int *f1, long long nR1, long long *f2, long long nR2, int lb, int ub, int *f3, long long *ptr_cnt)
{
  int status = 0;
  long long cnt = 0;
  long long i3 = 0;
  for ( long long i2 = 0; i2 < nR2; i2++ ) {
    long long f1idx = f2[i2];
    if ( ( f1idx < 0 ) || ( f1idx >= nR1 ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 34, "./AUX/pos_sel_copy_I4_I8.c"); }; status = -1 ; goto BYE; }; }
    int val = f1[f1idx];
    if ( ( val >= lb ) && ( val <= ub ) ) {
      f3[i3++] = val;
      cnt++;
    }
  }
  *ptr_cnt = cnt;
BYE:
  return(status);
}

variable_types: lb int

variable_types: ub int

variable_types: status int

variable_types:
cnt
long long

variable_types: val int


original_code:
int
is_A_in_b(
   char *t1,
   char *f1,
   char *t2,
   char *f2,
   char *cfld
   )
{
  int status = 0;
  char *f1_X = ((void *)0); size_t f1_nX = 0;
  char *f2_X = ((void *)0); size_t f2_nX = 0;
  char *cfX = ((void *)0); size_t cf_nX = 0;
  char *nn_f1_X = ((void *)0); size_t nn_f1_nX = 0;
  FLD_REC_TYPE f1_rec, f2_rec, cfld_rec;
  FLD_REC_TYPE nn_f1_rec, nn_f2_rec;
  TBL_REC_TYPE t1_rec, t2_rec;
  long long nR1, nR2;
  char opfile[15 +1];
  int t1_id, t2_id;
  int f1_id, nn_f1_id;
  int f2_id, nn_f2_id;
  int cfld_id = (-0x7fffffff - 1);
  int ddir_id;
  char buf[16];
  if ( ( t1 == ((void *)0) ) || ( *t1 == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 65, "./dir_wr_verbs/is_A_in_b.c"); }; status = -1 ; goto BYE; }; }
  if ( ( f1 == ((void *)0) ) || ( *f1 == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 66, "./dir_wr_verbs/is_A_in_b.c"); }; status = -1 ; goto BYE; }; }
  if ( ( t2 == ((void *)0) ) || ( *t2 == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 67, "./dir_wr_verbs/is_A_in_b.c"); }; status = -1 ; goto BYE; }; }
  if ( ( f2 == ((void *)0) ) || ( *f2 == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 68, "./dir_wr_verbs/is_A_in_b.c"); }; status = -1 ; goto BYE; }; }
  if ( strcmp(f1, cfld) == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 69, "./dir_wr_verbs/is_A_in_b.c"); }; status = -1 ; goto BYE; }; }
  status = is_tbl(t1, &t1_id, &t1_rec); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 71, "./dir_wr_verbs/is_A_in_b.c"); }; status = (status) ; goto BYE; } } };
  { if ( ( (t1_id) < (0) ) || ( (t1_id) >= (g_n_tbl ) ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 72, "./dir_wr_verbs/is_A_in_b.c"); }; status = -1 ; goto BYE; }; } };
  nR1 = g_tbls[t1_id].nR; if ( nR1 <= 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 73, "./dir_wr_verbs/is_A_in_b.c"); }; status = -1 ; goto BYE; }; }
  status = is_fld(((void *)0), t1_id, f1, &f1_id, &f1_rec, &nn_f1_id, &nn_f1_rec);
  if ( f1_id < 0 ) {
    fprintf(stderr, "Field [%s] in Table [%s] missing\n", f1, t1);
    { { fprintf(stderr, "Line %3d of File %s \n", 77, "./dir_wr_verbs/is_A_in_b.c"); }; status = -1 ; goto BYE; };
  }
  { if ( ( (f1_id) < (0) ) || ( (f1_id) >= (g_n_fld ) ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 79, "./dir_wr_verbs/is_A_in_b.c"); }; status = -1 ; goto BYE; }; } };
  status = get_data(f1_rec, &f1_X, &f1_nX, 0); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 80, "./dir_wr_verbs/is_A_in_b.c"); }; status = (status) ; goto BYE; } } };
  status = ext_f_to_s(t1, f1, "is_sorted", buf, 16); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 81, "./dir_wr_verbs/is_A_in_b.c"); }; status = (status) ; goto BYE; } } };
  if ( strcmp(buf, "ascending") != 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 82, "./dir_wr_verbs/is_A_in_b.c"); }; status = -1 ; goto BYE; }; }
  status = is_tbl(t2, &t2_id, &t2_rec); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 85, "./dir_wr_verbs/is_A_in_b.c"); }; status = (status) ; goto BYE; } } };
  { if ( ( (t2_id) < (0) ) || ( (t2_id) >= (g_n_tbl ) ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 86, "./dir_wr_verbs/is_A_in_b.c"); }; status = -1 ; goto BYE; }; } };
  nR2 = g_tbls[t2_id].nR;
  status = is_fld(((void *)0), t2_id, f2, &f2_id, &f2_rec, &nn_f2_id, &nn_f2_rec);
  { if ( ( (f2_id) < (0) ) || ( (f2_id) >= (g_n_fld ) ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 89, "./dir_wr_verbs/is_A_in_b.c"); }; status = -1 ; goto BYE; }; } };
  status = get_data(f2_rec, &f2_X, &f2_nX, 0); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 90, "./dir_wr_verbs/is_A_in_b.c"); }; status = (status) ; goto BYE; } } };
  status = ext_f_to_s(t2, f2, "is_sorted", buf, 16); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 91, "./dir_wr_verbs/is_A_in_b.c"); }; status = (status) ; goto BYE; } } };
  if ( strcmp(buf, "ascending") != 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 92, "./dir_wr_verbs/is_A_in_b.c"); }; status = -1 ; goto BYE; }; }
  if (f1_rec.fldtype != f2_rec.fldtype ) { { { fprintf(stderr, "Line %3d of File %s \n", 95, "./dir_wr_verbs/is_A_in_b.c"); }; status = -1 ; goto BYE; }; }
  if ( nn_f1_id >= 0 ) {
    status = get_data(nn_f1_rec, &nn_f1_X, &nn_f1_nX, 0); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 99, "./dir_wr_verbs/is_A_in_b.c"); }; status = (status) ; goto BYE; } } };
  }
  if ( nn_f2_id >= 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 101, "./dir_wr_verbs/is_A_in_b.c"); }; status = -1 ; goto BYE; }; }
  status = mk_temp_file(opfile, (nR1 *sizeof(char)), &ddir_id); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 104, "./dir_wr_verbs/is_A_in_b.c"); }; status = (status) ; goto BYE; } } };
  status = q_mmap(ddir_id, opfile, &cfX, &cf_nX, 1); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 105, "./dir_wr_verbs/is_A_in_b.c"); }; status = (status) ; goto BYE; } } };
  long long min_block_size = 8192, block_size; int nT;
  status = partition(nR1, min_block_size, -1, &block_size, &nT); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 108, "./dir_wr_verbs/is_A_in_b.c"); }; status = (status) ; goto BYE; } } };
  for ( int tid = 0; tid < nT; tid++ ) {
    if ( status < 0 ) { continue; }
    long long lb = 0 + (tid * block_size);
    long long ub = lb + block_size;
    if ( tid == (nT-1) ) { ub = nR1; }
    int *f2_I4 = (int *)f2_X;
    char *l_cfX = cfX;
    int *f1_I4 = (int *)f1_X;
    int min_val_this_block_I4;
    long long min_f2_idx;
    switch ( f1_rec.fldtype ) {
      case I4 :
 min_val_this_block_I4 = f1_I4[lb];
 status = find_largest_leq_I4 (f2_I4, nR2, min_val_this_block_I4,
       &min_f2_idx);
 break;
      default :
        if ( status == 0 ) { { fprintf(stderr, "Line %3d of File %s \n", 127, "./dir_wr_verbs/is_A_in_b.c"); }; } status = -1;
 break;
    }
    int *l_f2_I4 = f2_I4 + min_f2_idx;
    int *l_max_f2_I4 = f2_I4 + nR2;
    for ( long long i1 = lb; i1 < ub; i1++ ) {
      if ( ( nn_f1_X != ((void *)0) ) && ( nn_f1_X[i1] == 0 ) ) {
 l_cfX[i1] = 0;
 continue;
      }
      int f1_val_I4 = f1_I4[i1];
      int found = 0;
      switch ( f1_rec.fldtype ) {
      case I4 :
      for ( ; l_f2_I4 < l_max_f2_I4; ) {
 int f2_val_I4 = *l_f2_I4;
 if ( f2_val_I4 < f1_val_I4 ) {
   l_f2_I4++;
   continue;
 }
 else if ( f2_val_I4 == f1_val_I4 ) {
   found = 1;
   break;
 }
 else {
   found = 0;
   break;
 }
      }
      break;
      default :
      if ( status == 0 ) { { fprintf(stderr, "Line %3d of File %s \n", 162, "./dir_wr_verbs/is_A_in_b.c"); }; } status = -1;
      break;
      }
      l_cfX[i1] = found;
    }
  }
  { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 168, "./dir_wr_verbs/is_A_in_b.c"); }; status = (status) ; goto BYE; } } };
  status = add_fld(t1_id, cfld, ddir_id, opfile, I1, -1, &cfld_id, &cfld_rec);
  { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 172, "./dir_wr_verbs/is_A_in_b.c"); }; status = (status) ; goto BYE; } } };
 BYE:
  { if ( ( f1_X == ((void *)0) ) && ( f1_nX != 0 ) ) { { fprintf(stderr, "Line %3d of File %s \n", 174, "./dir_wr_verbs/is_A_in_b.c"); }; return(-1); } if ( ( f1_X != ((void *)0) ) && ( f1_nX == 0 ) ) { { fprintf(stderr, "Line %3d of File %s \n", 174, "./dir_wr_verbs/is_A_in_b.c"); }; return(-1); } if ( f1_X != ((void *)0) ) { munmap(f1_X, f1_nX); f1_X = ((void *)0); f1_nX = 0; } };
  { if ( ( f2_X == ((void *)0) ) && ( f2_nX != 0 ) ) { { fprintf(stderr, "Line %3d of File %s \n", 175, "./dir_wr_verbs/is_A_in_b.c"); }; return(-1); } if ( ( f2_X != ((void *)0) ) && ( f2_nX == 0 ) ) { { fprintf(stderr, "Line %3d of File %s \n", 175, "./dir_wr_verbs/is_A_in_b.c"); }; return(-1); } if ( f2_X != ((void *)0) ) { munmap(f2_X, f2_nX); f2_X = ((void *)0); f2_nX = 0; } };
  { if ( ( cfX == ((void *)0) ) && ( cf_nX != 0 ) ) { { fprintf(stderr, "Line %3d of File %s \n", 176, "./dir_wr_verbs/is_A_in_b.c"); }; return(-1); } if ( ( cfX != ((void *)0) ) && ( cf_nX == 0 ) ) { { fprintf(stderr, "Line %3d of File %s \n", 176, "./dir_wr_verbs/is_A_in_b.c"); }; return(-1); } if ( cfX != ((void *)0) ) { munmap(cfX, cf_nX); cfX = ((void *)0); cf_nX = 0; } };
  { if ( ( nn_f1_X == ((void *)0) ) && ( nn_f1_nX != 0 ) ) { { fprintf(stderr, "Line %3d of File %s \n", 177, "./dir_wr_verbs/is_A_in_b.c"); }; return(-1); } if ( ( nn_f1_X != ((void *)0) ) && ( nn_f1_nX == 0 ) ) { { fprintf(stderr, "Line %3d of File %s \n", 177, "./dir_wr_verbs/is_A_in_b.c"); }; return(-1); } if ( nn_f1_X != ((void *)0) ) { munmap(nn_f1_X, nn_f1_nX); nn_f1_X = ((void *)0); nn_f1_nX = 0; } };
  return(status);
}

canonical_original_code:
int is_A_in_b(char *t1, char *f1, char *t2, char *f2, char *cfld)
{
  int status = 0;
  char *f1_X = ((void *)0); unsigned long f1_nX = 0;
  char *f2_X = ((void *)0); unsigned long f2_nX = 0;
  char *cfX = ((void *)0); unsigned long cf_nX = 0;
  char *nn_f1_X = ((void *)0); unsigned long nn_f1_nX = 0;
  struct _FLD_REC_TYPE f1_rec; struct _FLD_REC_TYPE f2_rec; struct _FLD_REC_TYPE cfld_rec;
  struct _FLD_REC_TYPE nn_f1_rec; struct _FLD_REC_TYPE nn_f2_rec;
  struct _TBL_REC_TYPE t1_rec; struct _TBL_REC_TYPE t2_rec;
  long long nR1; long long nR2;
  char opfile[-1];
  int t1_id; int t2_id;
  int f1_id; int nn_f1_id;
  int f2_id; int nn_f2_id;
  int cfld_id = (-0x7fffffff - 1);
  int ddir_id;
  char buf[16];
  if ( ( t1 == ((void *)0) ) || ( *t1 == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 65, "./dir_wr_verbs/is_A_in_b.c"); }; status = -1 ; goto BYE; }; }
  if ( ( f1 == ((void *)0) ) || ( *f1 == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 66, "./dir_wr_verbs/is_A_in_b.c"); }; status = -1 ; goto BYE; }; }
  if ( ( t2 == ((void *)0) ) || ( *t2 == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 67, "./dir_wr_verbs/is_A_in_b.c"); }; status = -1 ; goto BYE; }; }
  if ( ( f2 == ((void *)0) ) || ( *f2 == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 68, "./dir_wr_verbs/is_A_in_b.c"); }; status = -1 ; goto BYE; }; }
  if ( strcmp(f1, cfld) == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 69, "./dir_wr_verbs/is_A_in_b.c"); }; status = -1 ; goto BYE; }; }
  status = is_tbl(t1, &t1_id, &t1_rec); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 71, "./dir_wr_verbs/is_A_in_b.c"); }; status = (status) ; goto BYE; } } };
  { if ( ( (t1_id) < (0) ) || ( (t1_id) >= (g_n_tbl ) ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 72, "./dir_wr_verbs/is_A_in_b.c"); }; status = -1 ; goto BYE; }; } };
  nR1 = g_tbls[t1_id].nR; if ( nR1 <= 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 73, "./dir_wr_verbs/is_A_in_b.c"); }; status = -1 ; goto BYE; }; }
  status = is_fld(((void *)0), t1_id, f1, &f1_id, &f1_rec, &nn_f1_id, &nn_f1_rec);
  if ( f1_id < 0 ) {
    fprintf(stderr, "Field [%s] in Table [%s] missing\n", f1, t1);
    { { fprintf(stderr, "Line %3d of File %s \n", 77, "./dir_wr_verbs/is_A_in_b.c"); }; status = -1 ; goto BYE; };
  }
  { if ( ( (f1_id) < (0) ) || ( (f1_id) >= (g_n_fld ) ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 79, "./dir_wr_verbs/is_A_in_b.c"); }; status = -1 ; goto BYE; }; } };
  status = get_data(f1_rec, &f1_X, &f1_nX, 0); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 80, "./dir_wr_verbs/is_A_in_b.c"); }; status = (status) ; goto BYE; } } };
  status = ext_f_to_s(t1, f1, "is_sorted", buf, 16); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 81, "./dir_wr_verbs/is_A_in_b.c"); }; status = (status) ; goto BYE; } } };
  if ( strcmp(buf, "ascending") != 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 82, "./dir_wr_verbs/is_A_in_b.c"); }; status = -1 ; goto BYE; }; }
  status = is_tbl(t2, &t2_id, &t2_rec); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 85, "./dir_wr_verbs/is_A_in_b.c"); }; status = (status) ; goto BYE; } } };
  { if ( ( (t2_id) < (0) ) || ( (t2_id) >= (g_n_tbl ) ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 86, "./dir_wr_verbs/is_A_in_b.c"); }; status = -1 ; goto BYE; }; } };
  nR2 = g_tbls[t2_id].nR;
  status = is_fld(((void *)0), t2_id, f2, &f2_id, &f2_rec, &nn_f2_id, &nn_f2_rec);
  { if ( ( (f2_id) < (0) ) || ( (f2_id) >= (g_n_fld ) ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 89, "./dir_wr_verbs/is_A_in_b.c"); }; status = -1 ; goto BYE; }; } };
  status = get_data(f2_rec, &f2_X, &f2_nX, 0); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 90, "./dir_wr_verbs/is_A_in_b.c"); }; status = (status) ; goto BYE; } } };
  status = ext_f_to_s(t2, f2, "is_sorted", buf, 16); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 91, "./dir_wr_verbs/is_A_in_b.c"); }; status = (status) ; goto BYE; } } };
  if ( strcmp(buf, "ascending") != 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 92, "./dir_wr_verbs/is_A_in_b.c"); }; status = -1 ; goto BYE; }; }
  if (f1_rec.fldtype != f2_rec.fldtype ) { { { fprintf(stderr, "Line %3d of File %s \n", 95, "./dir_wr_verbs/is_A_in_b.c"); }; status = -1 ; goto BYE; }; }
  if ( nn_f1_id >= 0 ) {
    status = get_data(nn_f1_rec, &nn_f1_X, &nn_f1_nX, 0); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 99, "./dir_wr_verbs/is_A_in_b.c"); }; status = (status) ; goto BYE; } } };
  }
  if ( nn_f2_id >= 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 101, "./dir_wr_verbs/is_A_in_b.c"); }; status = -1 ; goto BYE; }; }
  status = mk_temp_file(opfile, (nR1 *sizeof(char)), &ddir_id); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 104, "./dir_wr_verbs/is_A_in_b.c"); }; status = (status) ; goto BYE; } } };
  status = q_mmap(ddir_id, opfile, &cfX, &cf_nX, 1); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 105, "./dir_wr_verbs/is_A_in_b.c"); }; status = (status) ; goto BYE; } } };
  long long min_block_size = 8192; long long block_size; int nT;
  status = partition(nR1, min_block_size, -1, &block_size, &nT); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 108, "./dir_wr_verbs/is_A_in_b.c"); }; status = (status) ; goto BYE; } } };
  for ( int tid = 0; tid < nT; tid++ ) {
    if ( status < 0 ) { continue; }
    long long lb = 0 + (tid * block_size);
    long long ub = lb + block_size;
    if ( tid == (nT-1) ) { ub = nR1; }
    int *f2_I4 = (int *)f2_X;
    char *l_cfX = cfX;
    int *f1_I4 = (int *)f1_X;
    int min_val_this_block_I4;
    long long min_f2_idx;
    switch ( f1_rec.fldtype ) {
      case I4 :
 min_val_this_block_I4 = f1_I4[lb];
 status = find_largest_leq_I4 (f2_I4, nR2, min_val_this_block_I4,
       &min_f2_idx);
 break;
      default :
        if ( status == 0 ) { { fprintf(stderr, "Line %3d of File %s \n", 127, "./dir_wr_verbs/is_A_in_b.c"); }; } status = -1;
 break;
    }
    int *l_f2_I4 = f2_I4 + min_f2_idx;
    int *l_max_f2_I4 = f2_I4 + nR2;
    for ( long long i1 = lb; i1 < ub; i1++ ) {
      if ( ( nn_f1_X != ((void *)0) ) && ( nn_f1_X[i1] == 0 ) ) {
 l_cfX[i1] = 0;
 continue;
      }
      int f1_val_I4 = f1_I4[i1];
      int found = 0;
      switch ( f1_rec.fldtype ) {
      case I4 :
      for ( ; l_f2_I4 < l_max_f2_I4; ) {
 int f2_val_I4 = *l_f2_I4;
 if ( f2_val_I4 < f1_val_I4 ) {
   l_f2_I4++;
   continue;
 }
 else if ( f2_val_I4 == f1_val_I4 ) {
   found = 1;
   break;
 }
 else {
   found = 0;
   break;
 }
      }
      break;
      default :
      if ( status == 0 ) { { fprintf(stderr, "Line %3d of File %s \n", 162, "./dir_wr_verbs/is_A_in_b.c"); }; } status = -1;
      break;
      }
      l_cfX[i1] = found;
    }
  }
  { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 168, "./dir_wr_verbs/is_A_in_b.c"); }; status = (status) ; goto BYE; } } };
  status = add_fld(t1_id, cfld, ddir_id, opfile, I1, -1, &cfld_id, &cfld_rec);
  { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 172, "./dir_wr_verbs/is_A_in_b.c"); }; status = (status) ; goto BYE; } } };
 BYE:
  { if ( ( f1_X == ((void *)0) ) && ( f1_nX != 0 ) ) { { fprintf(stderr, "Line %3d of File %s \n", 174, "./dir_wr_verbs/is_A_in_b.c"); }; return(-1); } if ( ( f1_X != ((void *)0) ) && ( f1_nX == 0 ) ) { { fprintf(stderr, "Line %3d of File %s \n", 174, "./dir_wr_verbs/is_A_in_b.c"); }; return(-1); } if ( f1_X != ((void *)0) ) { munmap(f1_X, f1_nX); f1_X = ((void *)0); f1_nX = 0; } };
  { if ( ( f2_X == ((void *)0) ) && ( f2_nX != 0 ) ) { { fprintf(stderr, "Line %3d of File %s \n", 175, "./dir_wr_verbs/is_A_in_b.c"); }; return(-1); } if ( ( f2_X != ((void *)0) ) && ( f2_nX == 0 ) ) { { fprintf(stderr, "Line %3d of File %s \n", 175, "./dir_wr_verbs/is_A_in_b.c"); }; return(-1); } if ( f2_X != ((void *)0) ) { munmap(f2_X, f2_nX); f2_X = ((void *)0); f2_nX = 0; } };
  { if ( ( cfX == ((void *)0) ) && ( cf_nX != 0 ) ) { { fprintf(stderr, "Line %3d of File %s \n", 176, "./dir_wr_verbs/is_A_in_b.c"); }; return(-1); } if ( ( cfX != ((void *)0) ) && ( cf_nX == 0 ) ) { { fprintf(stderr, "Line %3d of File %s \n", 176, "./dir_wr_verbs/is_A_in_b.c"); }; return(-1); } if ( cfX != ((void *)0) ) { munmap(cfX, cf_nX); cfX = ((void *)0); cf_nX = 0; } };
  { if ( ( nn_f1_X == ((void *)0) ) && ( nn_f1_nX != 0 ) ) { { fprintf(stderr, "Line %3d of File %s \n", 177, "./dir_wr_verbs/is_A_in_b.c"); }; return(-1); } if ( ( nn_f1_X != ((void *)0) ) && ( nn_f1_nX == 0 ) ) { { fprintf(stderr, "Line %3d of File %s \n", 177, "./dir_wr_verbs/is_A_in_b.c"); }; return(-1); } if ( nn_f1_X != ((void *)0) ) { munmap(nn_f1_X, nn_f1_nX); nn_f1_X = ((void *)0); nn_f1_nX = 0; } };
  return(status);
}

variable_types:
cfld
char *

variable_types:
cfX
char *

variable_types: struct _FLD_REC_TYPE { int tbl_id; int ddir_id; int is_external; enum _SORT_TYPE { unknown=0, ascending=1, descending=2, unsorted=3 } sort_type; int parent_id; int nn_fld_id; enum _FLD_TYPE { xunknown=0, B=1, I1=2, I2=3, I4=4, I8=5, F4=6, F8=7, clob=8 } fldtype; enum _AUX_TYPE { undef=0, nn=1 } auxtype; char name[-1]; char filename[-1]; char dispname[-1]; int dict_tbl_id; int alias_of_fld_id; long long cnt; }

variable_types: struct _TBL_REC_TYPE { long long nR; char name[-1]; char dispname[-1]; _Bool is_dict_tbl; }

variable_types:
opfile
char [-1]

variable_types:
buf
char [16]

variable_types: nT int

variable_types: tid int

variable_types:
lb
long long

variable_types:
ub
long long

variable_types: found int

user_defined_types: struct _FLD_REC_TYPE { int tbl_id; int ddir_id; int is_external; enum _SORT_TYPE sort_type; int parent_id; int nn_fld_id; enum _FLD_TYPE fldtype; enum _AUX_TYPE auxtype; char name[-1]; char filename[-1]; char dispname[-1]; int dict_tbl_id; int alias_of_fld_id; long long cnt; }


decompiled_code:
__int64 __fastcall count_I4(__int64 a1, __int64 a2, __int64 a3, int a4)
{
__int64 v7; // rdx
int v8; // eax

if ( a2 <= 0 )
return 0LL;
v7 = 0LL;
while ( 1 )
{
v8 = *(_DWORD *)(a1 + 4 * v7);
if ( v8 < 0 || v8 >= a4 )
break;
++*(_QWORD *)(a3 + 8LL * v8);
if ( a2 == ++v7 )
return 0LL;
}
fprintf(stderr, "Line %3d of File %s \n", 30LL, "./AUX/count_I4.c");
return 0xFFFFFFFFLL;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, __int64 a2, __int64 a3, int a4)
{
__int64 v7; // rdx
int v8; // eax

if ( a2 <= 0 )
return 0LL;
v7 = 0LL;
while ( 1 )
{
v8 = *(_DWORD *)(a1 + 4 * v7);
if ( v8 < 0 || v8 >= a4 )
break;
++*(_QWORD *)(a3 + 8LL * v8);
if ( a2 == ++v7 )
return 0LL;
}
fprintf(stderr, "Line %3d of File %s \n", 30LL, "./AUX/count_I4.c");
return 0xFFFFFFFFLL;
}

original_code:
int
count_I4(
  int *in,
  long long n,
  long long * restrict cnt,
  int n_out
  )
{
  int status = 0;
  for ( long long i = 0; i < n; i++ ) {
    int idx = in[i];
    int idxI4 = (int)idx;
    if ( ( idx < 0 ) || ( idx >= n_out ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 30, "./AUX/count_I4.c"); }; status = -1 ; goto BYE; }; }
    cnt[idxI4]++;
  }
 BYE:
  return(status);
}

canonical_original_code:
int count_I4(int *in, long long n, long long *cnt, int n_out)
{
  int status = 0;
  for ( long long i = 0; i < n; i++ ) {
    int idx = in[i];
    int idxI4 = (int)idx;
    if ( ( idx < 0 ) || ( idx >= n_out ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 30, "./AUX/count_I4.c"); }; status = -1 ; goto BYE; }; }
    cnt[idxI4]++;
  }
 BYE:
  return(status);
}

variable_types:
in
int *

variable_types:
n
long long

variable_types:
cnt
long long *

variable_types:
i
long long

variable_types: idx int


decompiled_code:
__int64 __fastcall rotl32(int a1, char a2)
{
return (unsigned int)__ROL4__(a1, a2);
}

canonical_decompiled_code:
__int64 __fastcall func0(int a1, char a2)
{
return (unsigned int)__ROL4__(a1, a2);
}

original_code:
__attribute__((always_inline)) uint32_t rotl32 ( uint32_t x, int8_t r )
{
  return (x << r) | (x >> (32 - r));
}

canonical_original_code:
unsigned int rotl32(unsigned int x, char r)
{
  return (x << r) | (x >> (32 - r));
}

variable_types:
x
unsigned int

variable_types: r char

return_type: unsigned int


decompiled_code:
__int64 __fastcall rotl64(__int64 a1, char a2)
{
return __ROL8__(a1, a2);
}

canonical_decompiled_code:
__int64 __fastcall func1(__int64 a1, char a2)
{
return __ROL8__(a1, a2);
}

original_code:
__attribute__((always_inline)) uint64_t rotl64 ( uint64_t x, int8_t r )
{
  return (x << r) | (x >> (64 - r));
}

canonical_original_code:
unsigned long rotl64(unsigned long x, char r)
{
  return (x << r) | (x >> (64 - r));
}

variable_types:
x
unsigned long

return_type: unsigned long


decompiled_code:
__int64 __fastcall getblock_32(__int64 a1, int a2)
{
return *(unsigned int *)(a1 + 4LL * a2);
}

canonical_decompiled_code:
__int64 __fastcall func2(__int64 a1, int a2)
{
return *(unsigned int *)(a1 + 4LL * a2);
}

original_code:
__attribute__((always_inline)) uint32_t getblock_32 ( const uint32_t * p, int i )
{
  return p[i];
}

canonical_original_code:
unsigned int getblock_32(unsigned int *p, int i)
{
  return p[i];
}

variable_types:
p
unsigned int *

variable_types: i int


getblock

decompiled_code:
__int64 __fastcall getblock(__int64 a1, int a2)
{
return *(_QWORD *)(a1 + 8LL * a2);
}

canonical_decompiled_code:
__int64 __fastcall func3(__int64 a1, int a2)
{
return *(_QWORD *)(a1 + 8LL * a2);
}

original_code:
__attribute__((always_inline)) uint64_t getblock ( const uint64_t * p, int i )
{
  return p[i];
}

canonical_original_code:
unsigned long getblock(unsigned long *p, int i)
{
  return p[i];
}

variable_types:
p
unsigned long *


original_code:
__attribute__((always_inline)) uint32_t fmix_32 ( uint32_t h )
{
  h ^= h >> 16;
  h *= 0x85ebca6b;
  h ^= h >> 13;
  h *= 0xc2b2ae35;
  h ^= h >> 16;
  return h;
}

canonical_original_code:
unsigned int fmix_32(unsigned int h)
{
  h ^= h >> 16;
  h *= 0x85ebca6b;
  h ^= h >> 13;
  h *= 0xc2b2ae35;
  h ^= h >> 16;
  return h;
}

variable_types:
h
unsigned int


fmix

original_code:
__attribute__((always_inline)) uint64_t fmix ( uint64_t k )
{
  k ^= k >> 33;
  k *= (0xff51afd7ed558ccdLLU);
  k ^= k >> 33;
  k *= (0xc4ceb9fe1a85ec53LLU);
  k ^= k >> 33;
  return k;
}

canonical_original_code:
unsigned long fmix(unsigned long k)
{
  k ^= k >> 33;
  k *= (0xff51afd7ed558ccdLLU);
  k ^= k >> 33;
  k *= (0xc4ceb9fe1a85ec53LLU);
  k ^= k >> 33;
  return k;
}

variable_types:
k
unsigned long


canonical_original_code:
void MurmurHash3_x86_128(void *key, int len, unsigned int seed, void *out)
{
  unsigned char *data = (const uint8_t*)key;
  int nblocks = len / 16;
  unsigned int h1 = seed;
  unsigned int h2 = seed;
  unsigned int h3 = seed;
  unsigned int h4 = seed;
  unsigned int c1 = 0x239b961b;
  unsigned int c2 = 0xab0e9789;
  unsigned int c3 = 0x38b34ae5;
  unsigned int c4 = 0xa1e38b93;
  unsigned int *blocks = (const uint32_t *)(data + nblocks*16);
  for(int i = -nblocks; i; i++)
  {
    unsigned int k1 = getblock_32(blocks,i*4+0);
    unsigned int k2 = getblock_32(blocks,i*4+1);
    unsigned int k3 = getblock_32(blocks,i*4+2);
    unsigned int k4 = getblock_32(blocks,i*4+3);
    k1 *= c1; k1 = rotl32(k1,15); k1 *= c2; h1 ^= k1;
    h1 = rotl32(h1,19); h1 += h2; h1 = h1*5+0x561ccd1b;
    k2 *= c2; k2 = rotl32(k2,16); k2 *= c3; h2 ^= k2;
    h2 = rotl32(h2,17); h2 += h3; h2 = h2*5+0x0bcaa747;
    k3 *= c3; k3 = rotl32(k3,17); k3 *= c4; h3 ^= k3;
    h3 = rotl32(h3,15); h3 += h4; h3 = h3*5+0x96cd1c35;
    k4 *= c4; k4 = rotl32(k4,18); k4 *= c1; h4 ^= k4;
    h4 = rotl32(h4,13); h4 += h1; h4 = h4*5+0x32ac3b17;
  }
  unsigned char *tail = (const uint8_t*)(data + nblocks*16);
  unsigned int k1 = 0;
  unsigned int k2 = 0;
  unsigned int k3 = 0;
  unsigned int k4 = 0;
  switch(len & 15)
  {
  case 15: k4 ^= tail[14] << 16;
  case 14: k4 ^= tail[13] << 8;
  case 13: k4 ^= tail[12] << 0;
           k4 *= c4; k4 = rotl32(k4,18); k4 *= c1; h4 ^= k4;
  case 12: k3 ^= tail[11] << 24;
  case 11: k3 ^= tail[10] << 16;
  case 10: k3 ^= tail[ 9] << 8;
  case 9: k3 ^= tail[ 8] << 0;
           k3 *= c3; k3 = rotl32(k3,17); k3 *= c4; h3 ^= k3;
  case 8: k2 ^= tail[ 7] << 24;
  case 7: k2 ^= tail[ 6] << 16;
  case 6: k2 ^= tail[ 5] << 8;
  case 5: k2 ^= tail[ 4] << 0;
           k2 *= c2; k2 = rotl32(k2,16); k2 *= c3; h2 ^= k2;
  case 4: k1 ^= tail[ 3] << 24;
  case 3: k1 ^= tail[ 2] << 16;
  case 2: k1 ^= tail[ 1] << 8;
  case 1: k1 ^= tail[ 0] << 0;
           k1 *= c1; k1 = rotl32(k1,15); k1 *= c2; h1 ^= k1;
  };
  h1 ^= len; h2 ^= len; h3 ^= len; h4 ^= len;
  h1 += h2; h1 += h3; h1 += h4;
  h2 += h1; h3 += h1; h4 += h1;
  h1 = fmix(h1);
  h2 = fmix(h2);
  h3 = fmix(h3);
  h4 = fmix(h4);
  h1 += h2; h1 += h3; h1 += h4;
  h2 += h1; h3 += h1; h4 += h1;
  ((unsigned int *)out)[0] = h1;
  ((unsigned int *)out)[1] = h2;
  ((unsigned int *)out)[2] = h3;
  ((unsigned int *)out)[3] = h4;
}

variable_types:
key
void *

variable_types: len int

variable_types:
seed
unsigned int

variable_types:
out
void *

variable_types:
data
unsigned char *

variable_types: nblocks int

variable_types:
blocks
unsigned int *

variable_types:
tail
unsigned char *


decompiled_code:
unsigned __int64 __fastcall MurmurHash3_x64_128(_QWORD *a1, int a2, unsigned int a3, unsigned __int64 *a4)
{
_QWORD *v4; // r9
int v7; // esi
int v8; // esi
__int64 v9; // rbp
_QWORD *v10; // rcx
__int64 v11; // r12
int v12; // edi
unsigned __int8 *v13; // r9
unsigned __int64 v14; // rdx
unsigned __int64 v15; // rdx
unsigned __int64 v16; // rax
unsigned __int64 v17; // rax
unsigned __int64 v18; // rdx
unsigned __int64 v19; // rdx
unsigned __int64 v20; // rax
unsigned __int64 v21; // rdx
unsigned __int64 v22; // rdx
unsigned __int64 v23; // rax
unsigned __int64 v24; // rax
unsigned __int64 v25; // rdx
unsigned __int64 v26; // rdx
__int64 v27; // rax
unsigned __int64 v28; // rbp
unsigned __int64 v29; // r12
unsigned __int64 v30; // rdx
unsigned __int64 v31; // rax
unsigned __int64 result; // rax

v4 = a1;
v7 = a2 + 15;
if ( a2 >= 0 )
v7 = a2;
v8 = v7 >> 4;
v9 = a3;
if ( a2 <= 15 )
{
v11 = a3;
}
else
{
v10 = a1;
v11 = a3;
v12 = 0;
do
{
v9 = 5 * (v11 + __ROL8__(v9 ^ (0x4CF5AD432745937FLL * __ROL8__(0x87C37B91114253D5LL * *v10, 31)), 27))
+ 1390208809;
v11 = 5 * (v9 + __ROL8__(v11 ^ (0x87C37B91114253D5LL * __ROR8__(0x4CF5AD432745937FLL * v10[1], 31)), 31))
+ 944331445;
++v12;
v10 += 2;
}
while ( v8 > v12 );
}
v13 = (unsigned __int8 *)&v4[2 * v8];
switch ( a2 & 0xF )
{
case 0:
goto LABEL_24;
case 1:
v26 = 0LL;
goto LABEL_23;
case 2:
v25 = 0LL;
goto LABEL_22;
case 3:
v24 = 0LL;
goto LABEL_21;
case 4:
v23 = 0LL;
goto LABEL_20;
case 5:
v22 = 0LL;
goto LABEL_19;
case 6:
v21 = 0LL;
goto LABEL_18;
case 7:
v20 = 0LL;
goto LABEL_17;
case 8:
goto LABEL_16;
case 9:
v19 = 0LL;
goto LABEL_15;
case 0xA:
v18 = 0LL;
goto LABEL_14;
case 0xB:
v17 = 0LL;
goto LABEL_13;
case 0xC:
v16 = 0LL;
goto LABEL_12;
case 0xD:
v15 = 0LL;
goto LABEL_11;
case 0xE:
v14 = 0LL;
goto LABEL_10;
case 0xF:
v14 = (unsigned __int64)v13[14] << 48;
LABEL_10:
v15 = ((unsigned __int64)v13[13] << 40) ^ v14;
LABEL_11:
v16 = v15 ^ ((unsigned __int64)v13[12] << 32);
LABEL_12:
v17 = ((unsigned __int64)v13[11] << 24) ^ v16;
LABEL_13:
v18 = v17 ^ ((unsigned __int64)v13[10] << 16);
LABEL_14:
v19 = ((unsigned __int64)v13[9] << 8) ^ v18;
LABEL_15:
v11 ^= 0x87C37B91114253D5LL * __ROR8__(0x4CF5AD432745937FLL * (v19 ^ v13[8]), 31);
LABEL_16:
v20 = (unsigned __int64)v13[7] << 56;
LABEL_17:
v21 = v20 ^ ((unsigned __int64)v13[6] << 48);
LABEL_18:
v22 = ((unsigned __int64)v13[5] << 40) ^ v21;
LABEL_19:
v23 = v22 ^ ((unsigned __int64)v13[4] << 32);
LABEL_20:
v24 = ((unsigned __int64)v13[3] << 24) ^ v23;
LABEL_21:
v25 = v24 ^ ((unsigned __int64)v13[2] << 16);
LABEL_22:
v26 = ((unsigned __int64)v13[1] << 8) ^ v25;
LABEL_23:
v9 ^= 0x4CF5AD432745937FLL * __ROL8__(0x87C37B91114253D5LL * (v26 ^ *v13), 31);
LABEL_24:
v27 = v11 ^ a2;
v28 = v27 + (a2 ^ (unsigned __int64)v9);
v29 = v27 + v28;
v30 = ((0xC4CEB9FE1A85EC53LL
* ((0xFF51AFD7ED558CCDLL * ((v29 >> 33) ^ v29)) ^ ((0xFF51AFD7ED558CCDLL * ((v29 >> 33) ^ v29)) >> 33))) >> 33) ^ (0xC4CEB9FE1A85EC53LL * ((0xFF51AFD7ED558CCDLL * ((v29 >> 33) ^ v29)) ^ ((0xFF51AFD7ED558CCDLL * ((v29 >> 33) ^ v29)) >> 33)));
v31 = v30
+ (((0xC4CEB9FE1A85EC53LL
* ((0xFF51AFD7ED558CCDLL * ((v28 >> 33) ^ v28)) ^ ((0xFF51AFD7ED558CCDLL * ((v28 >> 33) ^ v28)) >> 33))) >> 33) ^ (0xC4CEB9FE1A85EC53LL * ((0xFF51AFD7ED558CCDLL * ((v28 >> 33) ^ v28)) ^ ((0xFF51AFD7ED558CCDLL * ((v28 >> 33) ^ v28)) >> 33))));
*a4 = v31;
result = v30 + v31;
a4[1] = result;
return result;
}
}

canonical_decompiled_code:
unsigned __int64 __fastcall func8(_QWORD *a1, int a2, unsigned int a3, unsigned __int64 *a4)
{
_QWORD *v4; // r9
int v7; // esi
int v8; // esi
__int64 v9; // rbp
_QWORD *v10; // rcx
__int64 v11; // r12
int v12; // edi
unsigned __int8 *v13; // r9
unsigned __int64 v14; // rdx
unsigned __int64 v15; // rdx
unsigned __int64 v16; // rax
unsigned __int64 v17; // rax
unsigned __int64 v18; // rdx
unsigned __int64 v19; // rdx
unsigned __int64 v20; // rax
unsigned __int64 v21; // rdx
unsigned __int64 v22; // rdx
unsigned __int64 v23; // rax
unsigned __int64 v24; // rax
unsigned __int64 v25; // rdx
unsigned __int64 v26; // rdx
__int64 v27; // rax
unsigned __int64 v28; // rbp
unsigned __int64 v29; // r12
unsigned __int64 v30; // rdx
unsigned __int64 v31; // rax
unsigned __int64 result; // rax

v4 = a1;
v7 = a2 + 15;
if ( a2 >= 0 )
v7 = a2;
v8 = v7 >> 4;
v9 = a3;
if ( a2 <= 15 )
{
v11 = a3;
}
else
{
v10 = a1;
v11 = a3;
v12 = 0;
do
{
v9 = 5 * (v11 + __ROL8__(v9 ^ (0x4CF5AD432745937FLL * __ROL8__(0x87C37B91114253D5LL * *v10, 31)), 27))
+ 1390208809;
v11 = 5 * (v9 + __ROL8__(v11 ^ (0x87C37B91114253D5LL * __ROR8__(0x4CF5AD432745937FLL * v10[1], 31)), 31))
+ 944331445;
++v12;
v10 += 2;
}
while ( v8 > v12 );
}
v13 = (unsigned __int8 *)&v4[2 * v8];
switch ( a2 & 0xF )
{
case 0:
goto LABEL_24;
case 1:
v26 = 0LL;
goto LABEL_23;
case 2:
v25 = 0LL;
goto LABEL_22;
case 3:
v24 = 0LL;
goto LABEL_21;
case 4:
v23 = 0LL;
goto LABEL_20;
case 5:
v22 = 0LL;
goto LABEL_19;
case 6:
v21 = 0LL;
goto LABEL_18;
case 7:
v20 = 0LL;
goto LABEL_17;
case 8:
goto LABEL_16;
case 9:
v19 = 0LL;
goto LABEL_15;
case 0xA:
v18 = 0LL;
goto LABEL_14;
case 0xB:
v17 = 0LL;
goto LABEL_13;
case 0xC:
v16 = 0LL;
goto LABEL_12;
case 0xD:
v15 = 0LL;
goto LABEL_11;
case 0xE:
v14 = 0LL;
goto LABEL_10;
case 0xF:
v14 = (unsigned __int64)v13[14] << 48;
LABEL_10:
v15 = ((unsigned __int64)v13[13] << 40) ^ v14;
LABEL_11:
v16 = v15 ^ ((unsigned __int64)v13[12] << 32);
LABEL_12:
v17 = ((unsigned __int64)v13[11] << 24) ^ v16;
LABEL_13:
v18 = v17 ^ ((unsigned __int64)v13[10] << 16);
LABEL_14:
v19 = ((unsigned __int64)v13[9] << 8) ^ v18;
LABEL_15:
v11 ^= 0x87C37B91114253D5LL * __ROR8__(0x4CF5AD432745937FLL * (v19 ^ v13[8]), 31);
LABEL_16:
v20 = (unsigned __int64)v13[7] << 56;
LABEL_17:
v21 = v20 ^ ((unsigned __int64)v13[6] << 48);
LABEL_18:
v22 = ((unsigned __int64)v13[5] << 40) ^ v21;
LABEL_19:
v23 = v22 ^ ((unsigned __int64)v13[4] << 32);
LABEL_20:
v24 = ((unsigned __int64)v13[3] << 24) ^ v23;
LABEL_21:
v25 = v24 ^ ((unsigned __int64)v13[2] << 16);
LABEL_22:
v26 = ((unsigned __int64)v13[1] << 8) ^ v25;
LABEL_23:
v9 ^= 0x4CF5AD432745937FLL * __ROL8__(0x87C37B91114253D5LL * (v26 ^ *v13), 31);
LABEL_24:
v27 = v11 ^ a2;
v28 = v27 + (a2 ^ (unsigned __int64)v9);
v29 = v27 + v28;
v30 = ((0xC4CEB9FE1A85EC53LL
* ((0xFF51AFD7ED558CCDLL * ((v29 >> 33) ^ v29)) ^ ((0xFF51AFD7ED558CCDLL * ((v29 >> 33) ^ v29)) >> 33))) >> 33) ^ (0xC4CEB9FE1A85EC53LL * ((0xFF51AFD7ED558CCDLL * ((v29 >> 33) ^ v29)) ^ ((0xFF51AFD7ED558CCDLL * ((v29 >> 33) ^ v29)) >> 33)));
v31 = v30
+ (((0xC4CEB9FE1A85EC53LL
* ((0xFF51AFD7ED558CCDLL * ((v28 >> 33) ^ v28)) ^ ((0xFF51AFD7ED558CCDLL * ((v28 >> 33) ^ v28)) >> 33))) >> 33) ^ (0xC4CEB9FE1A85EC53LL * ((0xFF51AFD7ED558CCDLL * ((v28 >> 33) ^ v28)) ^ ((0xFF51AFD7ED558CCDLL * ((v28 >> 33) ^ v28)) >> 33))));
*a4 = v31;
result = v30 + v31;
a4[1] = result;
return result;
}
}

canonical_original_code:
void MurmurHash3_x64_128(void *key, int len, unsigned int seed, void *out)
{
  unsigned char *data = (const uint8_t*)key;
  int nblocks = len / 16;
  unsigned long h1 = seed;
  unsigned long h2 = seed;
  unsigned long c1 = (0x87c37b91114253d5LLU);
  unsigned long c2 = (0x4cf5ad432745937fLLU);
  unsigned long *blocks = (const uint64_t *)(data);
  for(int i = 0; i < nblocks; i++)
  {
    unsigned long k1 = getblock(blocks,i*2+0);
    unsigned long k2 = getblock(blocks,i*2+1);
    k1 *= c1; k1 = rotl64(k1,31); k1 *= c2; h1 ^= k1;
    h1 = rotl64(h1,27); h1 += h2; h1 = h1*5+0x52dce729;
    k2 *= c2; k2 = rotl64(k2,33); k2 *= c1; h2 ^= k2;
    h2 = rotl64(h2,31); h2 += h1; h2 = h2*5+0x38495ab5;
  }
  unsigned char *tail = (const uint8_t*)(data + nblocks*16);
  unsigned long k1 = 0;
  unsigned long k2 = 0;
  switch(len & 15)
  {
  case 15: k2 ^= (unsigned long)(tail[14]) << 48;
  case 14: k2 ^= (unsigned long)(tail[13]) << 40;
  case 13: k2 ^= (unsigned long)(tail[12]) << 32;
  case 12: k2 ^= (unsigned long)(tail[11]) << 24;
  case 11: k2 ^= (unsigned long)(tail[10]) << 16;
  case 10: k2 ^= (unsigned long)(tail[ 9]) << 8;
  case 9: k2 ^= (unsigned long)(tail[ 8]) << 0;
           k2 *= c2; k2 = rotl64(k2,33); k2 *= c1; h2 ^= k2;
  case 8: k1 ^= (unsigned long)(tail[ 7]) << 56;
  case 7: k1 ^= (unsigned long)(tail[ 6]) << 48;
  case 6: k1 ^= (unsigned long)(tail[ 5]) << 40;
  case 5: k1 ^= (unsigned long)(tail[ 4]) << 32;
  case 4: k1 ^= (unsigned long)(tail[ 3]) << 24;
  case 3: k1 ^= (unsigned long)(tail[ 2]) << 16;
  case 2: k1 ^= (unsigned long)(tail[ 1]) << 8;
  case 1: k1 ^= (unsigned long)(tail[ 0]) << 0;
           k1 *= c1; k1 = rotl64(k1,31); k1 *= c2; h1 ^= k1;
  };
  h1 ^= len; h2 ^= len;
  h1 += h2;
  h2 += h1;
  h1 = fmix(h1);
  h2 = fmix(h2);
  h1 += h2;
  h2 += h1;
  ((unsigned long *)out)[0] = h1;
  ((unsigned long *)out)[1] = h2;
}

variable_types:
blocks
unsigned long *