decompiled_code:
__int64 __fastcall count_I2(__int16 *a1, __int64 a2, __int64 a3, int a4)
{
__int16 *v6; // rdx
__int16 *v7; // r8
__int16 v8; // ax

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

canonical_decompiled_code:
__int64 __fastcall func0(__int16 *a1, __int64 a2, __int64 a3, int a4)
{
__int16 *v6; // rdx
__int16 *v7; // r8
__int16 v8; // ax

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

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

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

variable_types:
in
short *

variable_types:
n
long long

variable_types:
cnt
long long *

variable_types: idx short


repo: linkedin/datacl

original_code:
int
pos_sel_aux_nn_copy_I8_I4(
    long long *f1_select,
    char *nn_f1_select,
    long long *f1_copy,
    char *nn_f1_copy,
    long long nR1,
    int *f2,
    char *nn_f2,
    long long nR2,
    long long lb,
    long long ub,
    long long *f3,
    long long *ptr_cnt
    )
{
  int status = 0;
  long long cnt = 0;
  long long i3 = 0;
  for ( long long i2 = 0; i2 < nR2; i2++ ) {
    if ( ( nn_f2 != ((void *)0) ) && ( nn_f2[i2] == 0 ) ) { continue; }
    int f1idx = f2[i2];
    if ( ( f1idx < 0 ) || ( f1idx >= nR1 ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 39, "./AUX/pos_sel_aux_nn_copy_I8_I4.c"); }; status = -1 ; goto BYE; }; }
    if ( ( nn_f1_select != ((void *)0) ) && ( nn_f1_select[f1idx] == 0 ) ) { continue; }
    long long val = f1_select[f1idx];
    if ( ( val >= lb ) && ( val <= ub ) ) {
      if ( ( nn_f1_copy != ((void *)0) ) && ( nn_f1_copy[f1idx] == 0 ) ) {
      }
      else {
        val = f1_copy[f1idx];
        f3[i3++] = val;
        cnt++;
      }
    }
  }
  *ptr_cnt = cnt;
BYE:
  return(status);
}

canonical_original_code:
int pos_sel_aux_nn_copy_I8_I4(long long *f1_select, char *nn_f1_select, long long *f1_copy, char *nn_f1_copy, long long nR1, int *f2, char *nn_f2, long long nR2, long long lb, long long ub, long long *f3, long long *ptr_cnt)
{
  int status = 0;
  long long cnt = 0;
  long long i3 = 0;
  for ( long long i2 = 0; i2 < nR2; i2++ ) {
    if ( ( nn_f2 != ((void *)0) ) && ( nn_f2[i2] == 0 ) ) { continue; }
    int f1idx = f2[i2];
    if ( ( f1idx < 0 ) || ( f1idx >= nR1 ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 39, "./AUX/pos_sel_aux_nn_copy_I8_I4.c"); }; status = -1 ; goto BYE; }; }
    if ( ( nn_f1_select != ((void *)0) ) && ( nn_f1_select[f1idx] == 0 ) ) { continue; }
    long long val = f1_select[f1idx];
    if ( ( val >= lb ) && ( val <= ub ) ) {
      if ( ( nn_f1_copy != ((void *)0) ) && ( nn_f1_copy[f1idx] == 0 ) ) {
      }
      else {
        val = f1_copy[f1idx];
        f3[i3++] = val;
        cnt++;
      }
    }
  }
  *ptr_cnt = cnt;
BYE:
  return(status);
}

variable_types:
lb
long long

variable_types:
ub
long long

variable_types: status int

variable_types:
cnt
long long

variable_types:
val
long long

return_type: int


decompiled_code:
__int64 __fastcall open_temp_file(char *path, char *a2, char *a3, unsigned __int64 a4)
{
int v6; // ebp
int v7; // eax
unsigned __int64 v9[6]; // [rsp+8h] [rbp-30h] BYREF

if ( path )
{
if ( a2 )
{
if ( a3 )
{
if ( a4 )
{
v6 = avail_space(a2, v9);
if ( v6 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 61LL, "./dir_dbutils/open_temp_file.c");
return (unsigned int)v6;
}
if ( v9[0] <= a4 )
{
fprintf(stderr, "Space (%lld bytes) in directory [%s] not available \n", a4, a2);
fprintf(stderr, "Line %3d of File %s \n", 65LL, "./dir_dbutils/open_temp_file.c");
return (unsigned int)-1;
}
}
if ( chdir(a2) )
{
fprintf(stderr, "Directory [%s] not accessible \n", a2);
fprintf(stderr, "Line %3d of File %s \n", 72LL, "./dir_dbutils/open_temp_file.c");
v6 = -1;
}
else
{
strcpy(a3, "_tempf_XXXXXX");
v7 = mkstemp(a3);
close(v7);
v6 = chdir(path);
if ( v6 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 80LL, "./dir_dbutils/open_temp_file.c");
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 56LL, "./dir_dbutils/open_temp_file.c");
v6 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 55LL, "./dir_dbutils/open_temp_file.c");
v6 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 54LL, "./dir_dbutils/open_temp_file.c");
v6 = -1;
}
return (unsigned int)v6;
}

canonical_decompiled_code:
__int64 __fastcall func1(char *path, char *a2, char *a3, unsigned __int64 a4)
{
int v6; // ebp
int v7; // eax
unsigned __int64 v9[6]; // [rsp+8h] [rbp-30h] BYREF

if ( path )
{
if ( a2 )
{
if ( a3 )
{
if ( a4 )
{
v6 = func0(a2, v9);
if ( v6 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 61LL, "./dir_dbutils/open_temp_file.c");
return (unsigned int)v6;
}
if ( v9[0] <= a4 )
{
fprintf(stderr, "Space (%lld bytes) in directory [%s] not available \n", a4, a2);
fprintf(stderr, "Line %3d of File %s \n", 65LL, "./dir_dbutils/open_temp_file.c");
return (unsigned int)-1;
}
}
if ( chdir(a2) )
{
fprintf(stderr, "Directory [%s] not accessible \n", a2);
fprintf(stderr, "Line %3d of File %s \n", 72LL, "./dir_dbutils/open_temp_file.c");
v6 = -1;
}
else
{
strcpy(a3, "_tempf_XXXXXX");
v7 = mkstemp(a3);
close(v7);
v6 = chdir(path);
if ( v6 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 80LL, "./dir_dbutils/open_temp_file.c");
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 56LL, "./dir_dbutils/open_temp_file.c");
v6 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 55LL, "./dir_dbutils/open_temp_file.c");
v6 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 54LL, "./dir_dbutils/open_temp_file.c");
v6 = -1;
}
return (unsigned int)v6;
}

original_code:
int
open_temp_file(
        char *cwd,
        char *dir,
        char *fname,
        size_t filesize
        )
{
  int status = 0;
  if ( cwd == ((void *)0) ) { { { fprintf(stderr, "Line %3d of File %s \n", 54, "./dir_dbutils/open_temp_file.c"); }; status = -1 ; goto BYE; }; }
  if ( dir == ((void *)0) ) { { { fprintf(stderr, "Line %3d of File %s \n", 55, "./dir_dbutils/open_temp_file.c"); }; status = -1 ; goto BYE; }; }
  if ( fname == ((void *)0) ) { { { fprintf(stderr, "Line %3d of File %s \n", 56, "./dir_dbutils/open_temp_file.c"); }; status = -1 ; goto BYE; }; }
  if ( filesize > 0 ) {
    size_t space_available;
    status = avail_space(dir, &space_available); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 61, "./dir_dbutils/open_temp_file.c"); }; status = (status) ; goto BYE; } } };
    if ( space_available <= filesize ) {
      fprintf(stderr, "Space (%lld bytes) in directory [%s] not available \n",
       (long long)filesize, dir);
      { { fprintf(stderr, "Line %3d of File %s \n", 65, "./dir_dbutils/open_temp_file.c"); }; status = -1 ; goto BYE; };
    }
  }
  status = chdir(dir);
  if ( status != 0 ) {
    fprintf(stderr, "Directory [%s] not accessible \n", dir);
    { { fprintf(stderr, "Line %3d of File %s \n", 72, "./dir_dbutils/open_temp_file.c"); }; status = -1 ; goto BYE; };
  }
  strcpy(fname, "_tempf_XXXXXX");
  int fd = mkstemp(fname);
  close(fd);
  status = chdir(cwd);
  { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 80, "./dir_dbutils/open_temp_file.c"); }; status = (status) ; goto BYE; } } };
 BYE:
  return(status);
}

canonical_original_code:
int open_temp_file(char *cwd, char *dir, char *fname, unsigned long filesize)
{
  int status = 0;
  if ( cwd == ((void *)0) ) { { { fprintf(stderr, "Line %3d of File %s \n", 54, "./dir_dbutils/open_temp_file.c"); }; status = -1 ; goto BYE; }; }
  if ( dir == ((void *)0) ) { { { fprintf(stderr, "Line %3d of File %s \n", 55, "./dir_dbutils/open_temp_file.c"); }; status = -1 ; goto BYE; }; }
  if ( fname == ((void *)0) ) { { { fprintf(stderr, "Line %3d of File %s \n", 56, "./dir_dbutils/open_temp_file.c"); }; status = -1 ; goto BYE; }; }
  if ( filesize > 0 ) {
    unsigned long space_available;
    status = avail_space(dir, &space_available); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 61, "./dir_dbutils/open_temp_file.c"); }; status = (status) ; goto BYE; } } };
    if ( space_available <= filesize ) {
      fprintf(stderr, "Space (%lld bytes) in directory [%s] not available \n",
       (long long)filesize, dir);
      { { fprintf(stderr, "Line %3d of File %s \n", 65, "./dir_dbutils/open_temp_file.c"); }; status = -1 ; goto BYE; };
    }
  }
  status = chdir(dir);
  if ( status != 0 ) {
    fprintf(stderr, "Directory [%s] not accessible \n", dir);
    { { fprintf(stderr, "Line %3d of File %s \n", 72, "./dir_dbutils/open_temp_file.c"); }; status = -1 ; goto BYE; };
  }
  strcpy(fname, "_tempf_XXXXXX");
  int fd = mkstemp(fname);
  close(fd);
  status = chdir(cwd);
  { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 80, "./dir_dbutils/open_temp_file.c"); }; status = (status) ; goto BYE; } } };
 BYE:
  return(status);
}

variable_types:
cwd
char *

variable_types:
dir
char *

variable_types:
fname
char *

variable_types:
filesize
unsigned long

variable_types: fd int


decompiled_code:
__int64 __fastcall avail_space(const char *a1, _QWORD *a2)
{
int v2; // ebx
struct statvfs v4; // [rsp+0h] [rbp-88h] BYREF

v2 = statvfs(a1, &v4);
if ( v2 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 32LL, "./dir_dbutils/open_temp_file.c");
else
*a2 = v4.f_bavail * v4.f_bsize;
return (unsigned int)v2;
}

canonical_decompiled_code:
__int64 __fastcall func0(const char *a1, _QWORD *a2)
{
int v2; // ebx
struct statvfs v4; // [rsp+0h] [rbp-88h] BYREF

v2 = statvfs(a1, &v4);
if ( v2 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 32LL, "./dir_dbutils/open_temp_file.c");
else
*a2 = v4.f_bavail * v4.f_bsize;
return (unsigned int)v2;
}

original_code:
int
avail_space(
     char *dir,
     size_t *ptr_avail_space
     )
{
  int status = 0;
  struct statvfs sbuf;
  status = statvfs(dir , &sbuf); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 32, "./dir_dbutils/open_temp_file.c"); }; status = (status) ; goto BYE; } } };
  *ptr_avail_space = sbuf.f_bsize * sbuf.f_bavail;
 BYE:
  return(status);
}

canonical_original_code:
int avail_space(char *dir, unsigned long *ptr_avail_space)
{
  int status = 0;
  struct statvfs sbuf;
  status = statvfs(dir , &sbuf); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 32, "./dir_dbutils/open_temp_file.c"); }; status = (status) ; goto BYE; } } };
  *ptr_avail_space = sbuf.f_bsize * sbuf.f_bavail;
 BYE:
  return(status);
}

variable_types: struct statvfs { unsigned long f_bsize; unsigned long f_frsize; unsigned long f_blocks; unsigned long f_bfree; unsigned long f_bavail; unsigned long f_files; unsigned long f_ffree; unsigned long f_favail; unsigned long f_fsid; unsigned long f_flag; unsigned long f_namemax; int __f_spare[6]; }


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

variable_types: outv char

variable_types:
i
long long

return_type: void


decompiled_code:
__int64 __fastcall is_nn_fld(_BYTE *a1, _BYTE *a2, _DWORD *a3, char *a4)
{
int v6; // ebx
__int64 v7; // rdx
char v9[236]; // [rsp+0h] [rbp-2C8h] BYREF
int v10; // [rsp+ECh] [rbp-1DCh] BYREF
char v11[236]; // [rsp+F0h] [rbp-1D8h] BYREF
int v12; // [rsp+1DCh] [rbp-ECh] BYREF
char v13[188]; // [rsp+1E0h] [rbp-E8h] BYREF
int v14[11]; // [rsp+29Ch] [rbp-2Ch] BYREF

if ( a1 && *a1 )
{
if ( a2 && *a2 )
{
v6 = is_tbl(a1, v14, v13);
if ( v6 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 37LL, "./dir_ro_verbs/is_nn_fld.c");
}
else if ( v14[0] < 0 || v14[0] >= g_n_tbl )
{
fprintf(stderr, "Line %3d of File %s \n", 38LL, "./dir_ro_verbs/is_nn_fld.c");
v6 = -1;
}
else
{
v6 = is_fld(0LL, (unsigned int)v14[0], a2, &v12, v11, &v10, v9);
if ( v6 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 40LL, "./dir_ro_verbs/is_nn_fld.c");
}
else if ( v12 < 0 || v12 >= g_n_fld )
{
fprintf(stderr, "Line %3d of File %s \n", 41LL, "./dir_ro_verbs/is_nn_fld.c");
v6 = -1;
}
else
{
v7 = *(unsigned int *)(g_flds + 224LL * v12 + 20);
v10 = v7;
if ( (int)v7 < 0 )
strcpy(a4, "0,-1");
else
sprintf(a4, "1,%d", v7);
*a3 = v10;
}
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 35LL, "./dir_ro_verbs/is_nn_fld.c");
v6 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 34LL, "./dir_ro_verbs/is_nn_fld.c");
v6 = -1;
}
return (unsigned int)v6;
}

canonical_decompiled_code:
__int64 __fastcall func0(_BYTE *a1, _BYTE *a2, _DWORD *a3, char *a4)
{
int v6; // ebx
__int64 v7; // rdx
char v9[236]; // [rsp+0h] [rbp-2C8h] BYREF
int v10; // [rsp+ECh] [rbp-1DCh] BYREF
char v11[236]; // [rsp+F0h] [rbp-1D8h] BYREF
int v12; // [rsp+1DCh] [rbp-ECh] BYREF
char v13[188]; // [rsp+1E0h] [rbp-E8h] BYREF
int v14[11]; // [rsp+29Ch] [rbp-2Ch] BYREF

if ( a1 && *a1 )
{
if ( a2 && *a2 )
{
v6 = is_tbl(a1, v14, v13);
if ( v6 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 37LL, "./dir_ro_verbs/is_nn_fld.c");
}
else if ( v14[0] < 0 || v14[0] >= g_n_tbl )
{
fprintf(stderr, "Line %3d of File %s \n", 38LL, "./dir_ro_verbs/is_nn_fld.c");
v6 = -1;
}
else
{
v6 = is_fld(0LL, (unsigned int)v14[0], a2, &v12, v11, &v10, v9);
if ( v6 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 40LL, "./dir_ro_verbs/is_nn_fld.c");
}
else if ( v12 < 0 || v12 >= g_n_fld )
{
fprintf(stderr, "Line %3d of File %s \n", 41LL, "./dir_ro_verbs/is_nn_fld.c");
v6 = -1;
}
else
{
v7 = *(unsigned int *)(g_flds + 224LL * v12 + 20);
v10 = v7;
if ( (int)v7 < 0 )
strcpy(a4, "0,-1");
else
sprintf(a4, "1,%d", v7);
*a3 = v10;
}
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 35LL, "./dir_ro_verbs/is_nn_fld.c");
v6 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 34LL, "./dir_ro_verbs/is_nn_fld.c");
v6 = -1;
}
return (unsigned int)v6;
}

original_code:
int
is_nn_fld(
 char *tbl,
 char *fld,
 int *ptr_nn_fld_id,
 char *str_result
 )
{
  int status = 0;
  int tbl_id; TBL_REC_TYPE tbl_rec;
  int fld_id; FLD_REC_TYPE fld_rec;
  int nn_fld_id; FLD_REC_TYPE nn_fld_rec;
  if ( ( tbl == ((void *)0) ) || ( *tbl == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 34, "./dir_ro_verbs/is_nn_fld.c"); }; status = -1 ; goto BYE; }; }
  if ( ( fld == ((void *)0) ) || ( *fld == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 35, "./dir_ro_verbs/is_nn_fld.c"); }; status = -1 ; goto BYE; }; }
  status = is_tbl(tbl, &tbl_id, &tbl_rec); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 37, "./dir_ro_verbs/is_nn_fld.c"); }; status = (status) ; goto BYE; } } };
  { if ( ( (tbl_id) < (0) ) || ( (tbl_id) >= (g_n_tbl ) ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 38, "./dir_ro_verbs/is_nn_fld.c"); }; status = -1 ; goto BYE; }; } };
  status = is_fld(((void *)0), tbl_id, fld, &fld_id, &fld_rec, &nn_fld_id, &nn_fld_rec);
  { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 40, "./dir_ro_verbs/is_nn_fld.c"); }; status = (status) ; goto BYE; } } };
  { if ( ( (fld_id) < (0) ) || ( (fld_id) >= (g_n_fld ) ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 41, "./dir_ro_verbs/is_nn_fld.c"); }; status = -1 ; goto BYE; }; } };
  nn_fld_id = g_flds[fld_id].nn_fld_id;
  if ( nn_fld_id >= 0 ) {
    sprintf(str_result, "1,%d", nn_fld_id);
  }
  else {
    strcpy(str_result, "0,-1");
  }
  *ptr_nn_fld_id = nn_fld_id;
 BYE:
  return(status);
}

canonical_original_code:
int is_nn_fld(char *tbl, char *fld, int *ptr_nn_fld_id, char *str_result)
{
  int status = 0;
  int tbl_id; struct _TBL_REC_TYPE tbl_rec;
  int fld_id; struct _FLD_REC_TYPE fld_rec;
  int nn_fld_id; struct _FLD_REC_TYPE nn_fld_rec;
  if ( ( tbl == ((void *)0) ) || ( *tbl == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 34, "./dir_ro_verbs/is_nn_fld.c"); }; status = -1 ; goto BYE; }; }
  if ( ( fld == ((void *)0) ) || ( *fld == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 35, "./dir_ro_verbs/is_nn_fld.c"); }; status = -1 ; goto BYE; }; }
  status = is_tbl(tbl, &tbl_id, &tbl_rec); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 37, "./dir_ro_verbs/is_nn_fld.c"); }; status = (status) ; goto BYE; } } };
  { if ( ( (tbl_id) < (0) ) || ( (tbl_id) >= (g_n_tbl ) ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 38, "./dir_ro_verbs/is_nn_fld.c"); }; status = -1 ; goto BYE; }; } };
  status = is_fld(((void *)0), tbl_id, fld, &fld_id, &fld_rec, &nn_fld_id, &nn_fld_rec);
  { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 40, "./dir_ro_verbs/is_nn_fld.c"); }; status = (status) ; goto BYE; } } };
  { if ( ( (fld_id) < (0) ) || ( (fld_id) >= (g_n_fld ) ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 41, "./dir_ro_verbs/is_nn_fld.c"); }; status = -1 ; goto BYE; }; } };
  nn_fld_id = g_flds[fld_id].nn_fld_id;
  if ( nn_fld_id >= 0 ) {
    sprintf(str_result, "1,%d", nn_fld_id);
  }
  else {
    strcpy(str_result, "0,-1");
  }
  *ptr_nn_fld_id = nn_fld_id;
 BYE:
  return(status);
}

variable_types:
tbl
char *

variable_types:
fld
char *

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

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; }

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; }


original_code:
void
div2_I8(
       long long *in1,
       long long *in2,
       long long nR,
       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 div2_I8(long long *in1, long long *in2, long long nR, 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
long long *

variable_types:
outv
long long


decompiled_code:
__int64 __fastcall find_largest_leq_I8(__int64 a1, __int64 a2, __int64 a3, __int64 *a4)
{
__int64 v7; // rdi
__int64 v8; // rdx
__int64 i; // r8
__int64 v11; // rax

if ( !a1 )
{
fprintf(stderr, "Line %3d of File %s \n", 18LL, "./AUTOGEN/GENFILES/find_largest_leq_I8.c");
return 0xFFFFFFFFLL;
}
v7 = a2 - 1;
if ( a2 <= 1 )
{
fprintf(stderr, "Line %3d of File %s \n", 19LL, "./AUTOGEN/GENFILES/find_largest_leq_I8.c");
return 0xFFFFFFFFLL;
}
v8 = v7 / 2;
for ( i = 0LL; ; v8 = (v7 + i) / 2 )
{
v11 = *(_QWORD *)(a1 + 8 * v8);
if ( v11 > a3 )
{
v7 = v8;
goto LABEL_7;
}
if ( v11 >= a3 )
break;
i = v8;
LABEL_7:
if ( (v7 + i) / 2 == v8 )
{
*a4 = i;
return 0LL;
}
}
*a4 = v8;
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, __int64 a2, __int64 a3, __int64 *a4)
{
__int64 v7; // rdi
__int64 v8; // rdx
__int64 i; // r8
__int64 v11; // rax

if ( !a1 )
{
fprintf(stderr, "Line %3d of File %s \n", 18LL, "./AUTOGEN/GENFILES/find_largest_leq_I8.c");
return 0xFFFFFFFFLL;
}
v7 = a2 - 1;
if ( a2 <= 1 )
{
fprintf(stderr, "Line %3d of File %s \n", 19LL, "./AUTOGEN/GENFILES/find_largest_leq_I8.c");
return 0xFFFFFFFFLL;
}
v8 = v7 / 2;
for ( i = 0LL; ; v8 = (v7 + i) / 2 )
{
v11 = *(_QWORD *)(a1 + 8 * v8);
if ( v11 > a3 )
{
v7 = v8;
goto LABEL_7;
}
if ( v11 >= a3 )
break;
i = v8;
LABEL_7:
if ( (v7 + i) / 2 == v8 )
{
*a4 = i;
return 0LL;
}
}
*a4 = v8;
return 0LL;
}

original_code:
int
find_largest_leq_I8(
    long long *X,
    long long n,
    long long val,
    long long *ptr_idx
    )
{
  int status = 0;
  long long mid, prev_mid = (-0x7fffffffffffffffLL - 1LL);
  long long bot = 0;
  long long top = n-1;
  if ( X == ((void *)0) ) { { { fprintf(stderr, "Line %3d of File %s \n", 18, "./AUTOGEN/GENFILES/find_largest_leq_I8.c"); }; status = -1 ; goto BYE; }; }
  if ( n <= 1 ) { { { fprintf(stderr, "Line %3d of File %s \n", 19, "./AUTOGEN/GENFILES/find_largest_leq_I8.c"); }; status = -1 ; goto BYE; }; }
  for ( ; ; ) {
    mid = ( bot + top ) / 2;
    if ( mid == prev_mid ) { *ptr_idx = bot; break; }
    if ( X[mid] > val ) {
      top = mid;
    }
    else if ( X[mid] < val ) {
      bot = mid;
    }
    else {
      *ptr_idx = mid; break;
    }
    prev_mid = mid;
  }
BYE:
  return(status);
}

canonical_original_code:
int find_largest_leq_I8(long long *X, long long n, long long val, long long *ptr_idx)
{
  int status = 0;
  long long mid; long long prev_mid = (-0x7fffffffffffffffLL - 1LL);
  long long bot = 0;
  long long top = n-1;
  if ( X == ((void *)0) ) { { { fprintf(stderr, "Line %3d of File %s \n", 18, "./AUTOGEN/GENFILES/find_largest_leq_I8.c"); }; status = -1 ; goto BYE; }; }
  if ( n <= 1 ) { { { fprintf(stderr, "Line %3d of File %s \n", 19, "./AUTOGEN/GENFILES/find_largest_leq_I8.c"); }; status = -1 ; goto BYE; }; }
  for ( ; ; ) {
    mid = ( bot + top ) / 2;
    if ( mid == prev_mid ) { *ptr_idx = bot; break; }
    if ( X[mid] > val ) {
      top = mid;
    }
    else if ( X[mid] < val ) {
      bot = mid;
    }
    else {
      *ptr_idx = mid; break;
    }
    prev_mid = mid;
  }
BYE:
  return(status);
}

variable_types:
X
long long *

variable_types:
n
long long

variable_types:
val
long long

variable_types: status int

variable_types:
mid
long long

variable_types:
bot
long long

variable_types:
top
long long


original_code:
int
g_f1s1opf2(
    char *f1,
    char *str_scalar,
    char *str_op,
    char *f2
    )
{
  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);
  char *gpu_reg_X = ((void *)0);
  size_t gpu_reg_nX = 0;
  GPU_REG_TYPE *gpu_reg = ((void *)0);
  int n_gpu_reg = 0;
  long long svals_I8[128];
  int svals_I4[128];
  short svals_I2[128];
  char svals_I1[128];
  float svals_F4[128];
  double svals_F8[128];
  long long sval_I8 = 0x7fffffffffffffffLL;
  int sval_I4 = 0x7fffffff;
  short sval_I2 = 0x7fff;
  char sval_I1 = 0x7f;
  float sval_F4 = 3.40282346638528859811704183484516925e+38F;
  double sval_F8 = ((double)1.79769313486231570814527423731704357e+308L);
  int num_scalar_vals = -1;
  char *hashes_I1 = ((void *)0);
  short *hashes_I2 = ((void *)0);
  int *hashes_I4 = ((void *)0);
  long long *hashes_I8 = ((void *)0);
  unsigned int n = 0;
  unsigned int a = 0, b = 0;
  FLD_TYPE f2_fldtype;
  status = g_mmap_meta_data(g_docroot, &gpu_reg_X, &gpu_reg_nX,
      &gpu_reg, &n_gpu_reg);
  if ( ( str_scalar == ((void *)0) ) || ( *str_scalar == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 68, "g_f1s1opf2.c"); }; status = -1 ; goto BYE; }; }
  if ( ( str_op == ((void *)0) ) || ( *str_op == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 69, "g_f1s1opf2.c"); }; status = -1 ; goto BYE; }; }
  if ( ( f1 == ((void *)0) ) || ( *f1 == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 70, "g_f1s1opf2.c"); }; status = -1 ; goto BYE; }; }
  if ( ( f2 == ((void *)0) ) || ( *f2 == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 71, "g_f1s1opf2.c"); }; status = -1 ; goto BYE; }; }
  if ( strcmp(f1, f2) == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 72, "g_f1s1opf2.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", 74, "g_f1s1opf2.c"); }; status = (status) ; goto BYE; } } };
  if ( f1_id < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 75, "g_f1s1opf2.c"); }; status = -1 ; goto BYE; }; }
  if ( is_fldtype_goodfor_gpu(f1_rec.fldtype) == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 76, "g_f1s1opf2.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", 78, "g_f1s1opf2.c"); }; status = (status) ; goto BYE; } } };
  if ( f2_id < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 79, "g_f1s1opf2.c"); }; status = -1 ; goto BYE; }; }
  if ( is_fldtype_goodfor_gpu(f2_rec.fldtype) == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 80, "g_f1s1opf2.c"); }; status = -1 ; goto BYE; }; }
  if ( f1_rec.nR != f2_rec.nR ) { { { fprintf(stderr, "Line %3d of File %s \n", 82, "g_f1s1opf2.c"); }; status = -1 ; goto BYE; }; }
  if ( f1_rec.filesz == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 83, "g_f1s1opf2.c"); }; status = -1 ; goto BYE; }; }
  if ( f1_rec.nR == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 84, "g_f1s1opf2.c"); }; status = -1 ; goto BYE; }; }
  status = get_type_op_fld("f1s1opf2", str_op, f1_rec.fldtype,
      f1_rec.fldtype, "", &f2_fldtype);
  if ( f2_fldtype != f2_rec.fldtype ) { { { fprintf(stderr, "Line %3d of File %s \n", 88, "g_f1s1opf2.c"); }; status = -1 ; goto BYE; }; }
  status = g_chk_f1s1opf2(f1_rec, f2_rec, str_op); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 90, "g_f1s1opf2.c"); }; status = (status) ; goto BYE; } } };
  status = break_into_scalars(str_scalar, f1_rec.fldtype, &num_scalar_vals,
 &sval_I8, &sval_I4, &sval_I2, &sval_I1, &sval_F4, &sval_F8,
 svals_I8, svals_I4, svals_I2, svals_I1, svals_F4, svals_F8,
 &hashes_I1, &hashes_I2, &hashes_I4, &hashes_I8, &n, &a, &b);
  { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 95, "g_f1s1opf2.c"); }; status = (status) ; goto BYE; } } };
  char url[2048]; zero_string(url, 2048);
  char command[1024]; zero_string(command, 1024);
  sprintf(command, "f1s1opf2 d_fld1=%s scalar=%s op=%s d_fld2=%s",
        f1, str_scalar, str_op, f2);
  status = g_make_url(command, url); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 101, "g_f1s1opf2.c"); }; status = (status) ; goto BYE; } } };
  status = g_call_gpu(url, &curl_response); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 102, "g_f1s1opf2.c"); }; status = (status) ; goto BYE; } } };
  if ( 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_f1s1opf2(char *f1, char *str_scalar, char *str_op, char *f2)
{
  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);
  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;
  long long svals_I8[128];
  int svals_I4[128];
  short svals_I2[128];
  char svals_I1[128];
  float svals_F4[128];
  double svals_F8[128];
  long long sval_I8 = 0x7fffffffffffffffLL;
  int sval_I4 = 0x7fffffff;
  short sval_I2 = 0x7fff;
  char sval_I1 = 0x7f;
  float sval_F4 = 3.40282346638528859811704183484516925e+38F;
  double sval_F8 = ((double)1.79769313486231570814527423731704357e+308L);
  int num_scalar_vals = -1;
  char *hashes_I1 = ((void *)0);
  short *hashes_I2 = ((void *)0);
  int *hashes_I4 = ((void *)0);
  long long *hashes_I8 = ((void *)0);
  unsigned int n = 0;
  unsigned int a = 0; unsigned int b = 0;
  enum _FLD_TYPE f2_fldtype;
  status = g_mmap_meta_data(g_docroot, &gpu_reg_X, &gpu_reg_nX,
      &gpu_reg, &n_gpu_reg);
  if ( ( str_scalar == ((void *)0) ) || ( *str_scalar == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 68, "g_f1s1opf2.c"); }; status = -1 ; goto BYE; }; }
  if ( ( str_op == ((void *)0) ) || ( *str_op == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 69, "g_f1s1opf2.c"); }; status = -1 ; goto BYE; }; }
  if ( ( f1 == ((void *)0) ) || ( *f1 == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 70, "g_f1s1opf2.c"); }; status = -1 ; goto BYE; }; }
  if ( ( f2 == ((void *)0) ) || ( *f2 == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 71, "g_f1s1opf2.c"); }; status = -1 ; goto BYE; }; }
  if ( strcmp(f1, f2) == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 72, "g_f1s1opf2.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", 74, "g_f1s1opf2.c"); }; status = (status) ; goto BYE; } } };
  if ( f1_id < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 75, "g_f1s1opf2.c"); }; status = -1 ; goto BYE; }; }
  if ( is_fldtype_goodfor_gpu(f1_rec.fldtype) == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 76, "g_f1s1opf2.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", 78, "g_f1s1opf2.c"); }; status = (status) ; goto BYE; } } };
  if ( f2_id < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 79, "g_f1s1opf2.c"); }; status = -1 ; goto BYE; }; }
  if ( is_fldtype_goodfor_gpu(f2_rec.fldtype) == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 80, "g_f1s1opf2.c"); }; status = -1 ; goto BYE; }; }
  if ( f1_rec.nR != f2_rec.nR ) { { { fprintf(stderr, "Line %3d of File %s \n", 82, "g_f1s1opf2.c"); }; status = -1 ; goto BYE; }; }
  if ( f1_rec.filesz == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 83, "g_f1s1opf2.c"); }; status = -1 ; goto BYE; }; }
  if ( f1_rec.nR == 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 84, "g_f1s1opf2.c"); }; status = -1 ; goto BYE; }; }
  status = get_type_op_fld("f1s1opf2", str_op, f1_rec.fldtype,
      f1_rec.fldtype, "", &f2_fldtype);
  if ( f2_fldtype != f2_rec.fldtype ) { { { fprintf(stderr, "Line %3d of File %s \n", 88, "g_f1s1opf2.c"); }; status = -1 ; goto BYE; }; }
  status = g_chk_f1s1opf2(f1_rec, f2_rec, str_op); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 90, "g_f1s1opf2.c"); }; status = (status) ; goto BYE; } } };
  status = break_into_scalars(str_scalar, f1_rec.fldtype, &num_scalar_vals,
 &sval_I8, &sval_I4, &sval_I2, &sval_I1, &sval_F4, &sval_F8,
 svals_I8, svals_I4, svals_I2, svals_I1, svals_F4, svals_F8,
 &hashes_I1, &hashes_I2, &hashes_I4, &hashes_I8, &n, &a, &b);
  { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 95, "g_f1s1opf2.c"); }; status = (status) ; goto BYE; } } };
  char url[2048]; zero_string(url, 2048);
  char command[1024]; zero_string(command, 1024);
  sprintf(command, "f1s1opf2 d_fld1=%s scalar=%s op=%s d_fld2=%s",
        f1, str_scalar, str_op, f2);
  status = g_make_url(command, url); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 101, "g_f1s1opf2.c"); }; status = (status) ; goto BYE; } } };
  status = g_call_gpu(url, &curl_response); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 102, "g_f1s1opf2.c"); }; status = (status) ; goto BYE; } } };
  if ( 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: 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:
n
unsigned int

variable_types:
a
unsigned int

variable_types:
b
unsigned int

variable_types:
url
char [2048]

variable_types:
command
char [1024]

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
is_sorted_alldef_I4(
    int *iX,
    long long nR,
    SORT_TYPE *ptr_is_sorted
    )
{
  int first_val, second_val, prev_val, curr_val;
  SORT_TYPE sort_order;
  _Bool second_val_seen = 0;
  long long i = 0;
  if ( nR == 0 ) { *ptr_is_sorted = unknown; return; }
  if ( nR == 1 ) { *ptr_is_sorted = ascending; return; }
  first_val = iX[0];
  for ( i = 1; i < nR; i++ ) {
    if ( iX[i] != first_val ) {
      second_val = iX[i];
      second_val_seen = 1;
      break;
    }
  }
  if ( !second_val_seen ) { *ptr_is_sorted = ascending; return; }
  if ( first_val < second_val ) {
    sort_order = ascending;
  }
  else {
    sort_order = descending;
  }
  if ( i == nR ) { return; }
  prev_val = second_val;
  iX += i;
  nR -= i;
  for ( ; i < nR; i++ ) {
    curr_val = iX[i];
    switch ( sort_order ) {
      case ascending :
 if ( curr_val < prev_val ) { *ptr_is_sorted = unsorted; return; } break;
 if ( curr_val > prev_val ) { prev_val = curr_val; }
 break;
      case descending :
 if ( curr_val > prev_val ) { *ptr_is_sorted = unsorted; return; } break;
 if ( curr_val < prev_val ) { prev_val = curr_val; }
      default :
 exit(-1);
    }
    prev_val = curr_val;
  }
  *ptr_is_sorted = sort_order;
}

canonical_original_code:
void is_sorted_alldef_I4(int *iX, long long nR, enum _SORT_TYPE *ptr_is_sorted)
{
  int first_val; int second_val; int prev_val; int curr_val;
  enum _SORT_TYPE sort_order;
  _Bool second_val_seen = 0;
  long long i = 0;
  if ( nR == 0 ) { *ptr_is_sorted = unknown; return; }
  if ( nR == 1 ) { *ptr_is_sorted = ascending; return; }
  first_val = iX[0];
  for ( i = 1; i < nR; i++ ) {
    if ( iX[i] != first_val ) {
      second_val = iX[i];
      second_val_seen = 1;
      break;
    }
  }
  if ( !second_val_seen ) { *ptr_is_sorted = ascending; return; }
  if ( first_val < second_val ) {
    sort_order = ascending;
  }
  else {
    sort_order = descending;
  }
  if ( i == nR ) { return; }
  prev_val = second_val;
  iX += i;
  nR -= i;
  for ( ; i < nR; i++ ) {
    curr_val = iX[i];
    switch ( sort_order ) {
      case ascending :
 if ( curr_val < prev_val ) { *ptr_is_sorted = unsorted; return; } break;
 if ( curr_val > prev_val ) { prev_val = curr_val; }
 break;
      case descending :
 if ( curr_val > prev_val ) { *ptr_is_sorted = unsorted; return; } break;
 if ( curr_val < prev_val ) { prev_val = curr_val; }
      default :
 exit(-1);
    }
    prev_val = curr_val;
  }
  *ptr_is_sorted = sort_order;
}

variable_types:
iX
int *

variable_types:
nR
long long

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

variable_types:
i
long long


decompiled_code:
__int64 __fastcall unset_min_max_sum(const char *a1, int a2)
{
__int64 v2; // rdx
__int64 v3; // rax
__int64 v5; // rdx

if ( !strcmp(a1, "sum") )
{
v2 = g_flds + 120LL * a2;
*(_QWORD *)(v2 + 80) = 0LL;
*(_BYTE *)(v2 + 104) = 0;
goto LABEL_3;
}
if ( !strcmp(a1, "min") )
{
v5 = g_flds + 120LL * a2;
*(_QWORD *)(v5 + 88) = 0LL;
*(_BYTE *)(v5 + 105) = 0;
LABEL_3:
v3 = g_flds + 120LL * a2;
if ( *(_BYTE *)(v3 + 106) )
return 0LL;
LABEL_4:
*(_QWORD *)(v3 + 112) = -1LL;
return 0LL;
}
if ( !strcmp(a1, "max") )
{
v3 = g_flds + 120LL * a2;
*(_QWORD *)(v3 + 96) = 0LL;
*(_BYTE *)(v3 + 106) = 0;
goto LABEL_4;
}
fprintf(stderr, "Line %3d of File %s \n", 32LL, "unset_meta.c");
return 0xFFFFFFFFLL;
}

canonical_decompiled_code:
__int64 __fastcall func0(const char *a1, int a2)
{
__int64 v2; // rdx
__int64 v3; // rax
__int64 v5; // rdx

if ( !strcmp(a1, "sum") )
{
v2 = g_flds + 120LL * a2;
*(_QWORD *)(v2 + 80) = 0LL;
*(_BYTE *)(v2 + 104) = 0;
goto LABEL_3;
}
if ( !strcmp(a1, "min") )
{
v5 = g_flds + 120LL * a2;
*(_QWORD *)(v5 + 88) = 0LL;
*(_BYTE *)(v5 + 105) = 0;
LABEL_3:
v3 = g_flds + 120LL * a2;
if ( *(_BYTE *)(v3 + 106) )
return 0LL;
LABEL_4:
*(_QWORD *)(v3 + 112) = -1LL;
return 0LL;
}
if ( !strcmp(a1, "max") )
{
v3 = g_flds + 120LL * a2;
*(_QWORD *)(v3 + 96) = 0LL;
*(_BYTE *)(v3 + 106) = 0;
goto LABEL_4;
}
fprintf(stderr, "Line %3d of File %s \n", 32LL, "unset_meta.c");
return 0xFFFFFFFFLL;
}

original_code:
int unset_min_max_sum(
      const char *attr,
      int fld_id
      )
{
  int status = 0;
  if ( strcmp(attr, "sum") == 0 ) {
    g_flds[fld_id].sumval.sumI8 = g_flds[fld_id].sumval.sumF8 = 0;
    g_flds[fld_id].is_sum_nn = 0;
  }
  else if ( strcmp(attr, "min") == 0 ) {
    g_flds[fld_id].minval.minI8 = g_flds[fld_id].minval.minF8 = 0;
    g_flds[fld_id].is_min_nn = 0;
  }
  else if ( strcmp(attr, "max") == 0 ) {
    g_flds[fld_id].maxval.maxI8 = g_flds[fld_id].maxval.maxF8 = 0;
    g_flds[fld_id].is_max_nn = 0;
  }
  else {
    { { fprintf(stderr, "Line %3d of File %s \n", 32, "unset_meta.c"); }; status = -1 ; goto BYE; };
  }
  if ( ( g_flds[fld_id].is_max_nn == 0 ) &&
       ( g_flds[fld_id].is_max_nn == 0 ) &&
       ( g_flds[fld_id].is_max_nn == 0 ) ) {
     g_flds[fld_id].num_nn = -1;
  }
 BYE:
  return status ;
}

canonical_original_code:
int unset_min_max_sum(char *attr, int fld_id)
{
  int status = 0;
  if ( strcmp(attr, "sum") == 0 ) {
    g_flds[fld_id].sumval.sumI8 = g_flds[fld_id].sumval.sumF8 = 0;
    g_flds[fld_id].is_sum_nn = 0;
  }
  else if ( strcmp(attr, "min") == 0 ) {
    g_flds[fld_id].minval.minI8 = g_flds[fld_id].minval.minF8 = 0;
    g_flds[fld_id].is_min_nn = 0;
  }
  else if ( strcmp(attr, "max") == 0 ) {
    g_flds[fld_id].maxval.maxI8 = g_flds[fld_id].maxval.maxF8 = 0;
    g_flds[fld_id].is_max_nn = 0;
  }
  else {
    { { fprintf(stderr, "Line %3d of File %s \n", 32, "unset_meta.c"); }; status = -1 ; goto BYE; };
  }
  if ( ( g_flds[fld_id].is_max_nn == 0 ) &&
       ( g_flds[fld_id].is_max_nn == 0 ) &&
       ( g_flds[fld_id].is_max_nn == 0 ) ) {
     g_flds[fld_id].num_nn = -1;
  }
 BYE:
  return status ;
}

variable_types:
attr
char *


decompiled_code:
__int64 __fastcall int_unset_meta(int a1, int a2, const char *a3)
{
bool v5; // cf
bool v6; // zf
const char *v7; // rdi
__int64 v8; // rcx
__int64 v9; // rsi
int v10; // ebx
bool v12; // al
bool v13; // cf
bool v14; // zf
const char *v15; // rdi
__int64 v16; // rcx

if ( a3 && *a3 )
{
v5 = 0;
v6 = a1 == 0;
if ( a1 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 55LL, "unset_meta.c");
v10 = -1;
}
else
{
v7 = "tbltype";
v8 = 8LL;
v9 = (__int64)a3;
do
{
if ( !v8 )
break;
v5 = *(_BYTE *)v9 < *v7;
v6 = *(_BYTE *)v9++ == *v7++;
--v8;
}
while ( v6 );
if ( a2 >= 0 || (!v5 && !v6) == v5 )
{
if ( (!v5 && !v6) == v5 )
{
*(_DWORD *)(g_tbls + 48LL * a1 + 44) = 0;
}
else if ( !strcmp(a3, "dict_fld") )
{
v9 = 1LL;
v10 = del_from_fld_info_1((unsigned int)a2, 1LL);
if ( v10 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 64LL, "unset_meta.c");
return (unsigned int)v10;
}
}
else if ( !strcmp(a3, "sum") || !strcmp(a3, "min") || (v12 = strcmp(a3, "max") != 0, v13 = 0, v14 = !v12) )
{
v9 = (unsigned int)a2;
v10 = unset_min_max_sum(a3, a2);
if ( v10 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 69LL, "unset_meta.c");
return (unsigned int)v10;
}
}
else
{
v15 = "srttype";
v16 = 8LL;
v9 = (__int64)a3;
do
{
if ( !v16 )
break;
v13 = *(_BYTE *)v9 < *v15;
v14 = *(_BYTE *)v9++ == *v15++;
--v16;
}
while ( v14 );
if ( (!v13 && !v14) != v13 )
{
fprintf(stderr, "NOT IMPLEMENTED. attr = [%s] \n", a3);
fprintf(stderr, "Line %3d of File %s \n", 76LL, "unset_meta.c");
return (unsigned int)-1;
}
*(_DWORD *)(g_flds + 120LL * a2 + 28) = 0;
}
v10 = chk_tbl_meta((unsigned int)a1, v9);
if ( v10 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 78LL, "unset_meta.c");
}
else if ( a2 >= 0 )
{
v10 = chk_fld_meta((unsigned int)a2, *(_QWORD *)(g_tbls + 48LL * a1));
if ( v10 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 81LL, "unset_meta.c");
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 57LL, "unset_meta.c");
v10 = -1;
}
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 54LL, "unset_meta.c");
v10 = -1;
}
return (unsigned int)v10;
}

canonical_decompiled_code:
__int64 __fastcall func1(int a1, int a2, const char *a3)
{
bool v5; // cf
bool v6; // zf
const char *v7; // rdi
__int64 v8; // rcx
__int64 v9; // rsi
int v10; // ebx
bool v12; // al
bool v13; // cf
bool v14; // zf
const char *v15; // rdi
__int64 v16; // rcx

if ( a3 && *a3 )
{
v5 = 0;
v6 = a1 == 0;
if ( a1 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 55LL, "unset_meta.c");
v10 = -1;
}
else
{
v7 = "tbltype";
v8 = 8LL;
v9 = (__int64)a3;
do
{
if ( !v8 )
break;
v5 = *(_BYTE *)v9 < *v7;
v6 = *(_BYTE *)v9++ == *v7++;
--v8;
}
while ( v6 );
if ( a2 >= 0 || (!v5 && !v6) == v5 )
{
if ( (!v5 && !v6) == v5 )
{
*(_DWORD *)(g_tbls + 48LL * a1 + 44) = 0;
}
else if ( !strcmp(a3, "dict_fld") )
{
v9 = 1LL;
v10 = del_from_fld_info_1((unsigned int)a2, 1LL);
if ( v10 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 64LL, "unset_meta.c");
return (unsigned int)v10;
}
}
else if ( !strcmp(a3, "sum") || !strcmp(a3, "min") || (v12 = strcmp(a3, "max") != 0, v13 = 0, v14 = !v12) )
{
v9 = (unsigned int)a2;
v10 = func0(a3, a2);
if ( v10 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 69LL, "unset_meta.c");
return (unsigned int)v10;
}
}
else
{
v15 = "srttype";
v16 = 8LL;
v9 = (__int64)a3;
do
{
if ( !v16 )
break;
v13 = *(_BYTE *)v9 < *v15;
v14 = *(_BYTE *)v9++ == *v15++;
--v16;
}
while ( v14 );
if ( (!v13 && !v14) != v13 )
{
fprintf(stderr, "NOT IMPLEMENTED. attr = [%s] \n", a3);
fprintf(stderr, "Line %3d of File %s \n", 76LL, "unset_meta.c");
return (unsigned int)-1;
}
*(_DWORD *)(g_flds + 120LL * a2 + 28) = 0;
}
v10 = chk_tbl_meta((unsigned int)a1, v9);
if ( v10 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 78LL, "unset_meta.c");
}
else if ( a2 >= 0 )
{
v10 = chk_fld_meta((unsigned int)a2, *(_QWORD *)(g_tbls + 48LL * a1));
if ( v10 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 81LL, "unset_meta.c");
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 57LL, "unset_meta.c");
v10 = -1;
}
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 54LL, "unset_meta.c");
v10 = -1;
}
return (unsigned int)v10;
}

original_code:
int
int_unset_meta(
      int tbl_id,
      int fld_id,
      const char *attr
      )
{
  int status = 0;
  if ( ( attr == ((void *)0) ) || ( *attr == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 54, "unset_meta.c"); }; status = -1 ; goto BYE; }; }
  if ( tbl_id < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 55, "unset_meta.c"); }; status = -1 ; goto BYE; }; }
  if ( strcmp(attr, "tbltype") != 0 ) {
    if ( fld_id < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 57, "unset_meta.c"); }; status = -1 ; goto BYE; }; }
  }
  if ( strcmp(attr, "tbltype") == 0 ) {
    g_tbls[tbl_id].tbltype = undef_tbl;
  }
  else if ( strcmp(attr, "dict_fld") == 0 ) {
    status = del_from_fld_info_1(fld_id, fk_fld_txt_lkp); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 64, "unset_meta.c"); }; status = (status) ; goto BYE; } } };
  }
  else if ( ( strcmp(attr, "sum") == 0 ) ||
            ( strcmp(attr, "min") == 0 ) ||
            ( strcmp(attr, "max") == 0 ) ) {
    status = unset_min_max_sum(attr, fld_id); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 69, "unset_meta.c"); }; status = (status) ; goto BYE; } } };
  }
  else if ( strcmp(attr, "srttype") == 0 ) {
    g_flds[fld_id].srttype = unknown;
  }
  else {
    fprintf(stderr, "NOT IMPLEMENTED. attr = [%s] \n", attr);
    { { fprintf(stderr, "Line %3d of File %s \n", 76, "unset_meta.c"); }; status = -1 ; goto BYE; };
  }
  status = chk_tbl_meta(tbl_id); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 78, "unset_meta.c"); }; status = (status) ; goto BYE; } } };
  long long nR = g_tbls[tbl_id].nR;
  if ( fld_id >= 0 ) {
    status = chk_fld_meta(fld_id, nR); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 81, "unset_meta.c"); }; status = (status) ; goto BYE; } } };
  }
 BYE:
  return status ;
}

canonical_original_code:
int int_unset_meta(int tbl_id, int fld_id, char *attr)
{
  int status = 0;
  if ( ( attr == ((void *)0) ) || ( *attr == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 54, "unset_meta.c"); }; status = -1 ; goto BYE; }; }
  if ( tbl_id < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 55, "unset_meta.c"); }; status = -1 ; goto BYE; }; }
  if ( strcmp(attr, "tbltype") != 0 ) {
    if ( fld_id < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 57, "unset_meta.c"); }; status = -1 ; goto BYE; }; }
  }
  if ( strcmp(attr, "tbltype") == 0 ) {
    g_tbls[tbl_id].tbltype = undef_tbl;
  }
  else if ( strcmp(attr, "dict_fld") == 0 ) {
    status = del_from_fld_info_1(fld_id, fk_fld_txt_lkp); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 64, "unset_meta.c"); }; status = (status) ; goto BYE; } } };
  }
  else if ( ( strcmp(attr, "sum") == 0 ) ||
            ( strcmp(attr, "min") == 0 ) ||
            ( strcmp(attr, "max") == 0 ) ) {
    status = unset_min_max_sum(attr, fld_id); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 69, "unset_meta.c"); }; status = (status) ; goto BYE; } } };
  }
  else if ( strcmp(attr, "srttype") == 0 ) {
    g_flds[fld_id].srttype = unknown;
  }
  else {
    fprintf(stderr, "NOT IMPLEMENTED. attr = [%s] \n", attr);
    { { fprintf(stderr, "Line %3d of File %s \n", 76, "unset_meta.c"); }; status = -1 ; goto BYE; };
  }
  status = chk_tbl_meta(tbl_id); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 78, "unset_meta.c"); }; status = (status) ; goto BYE; } } };
  long long nR = g_tbls[tbl_id].nR;
  if ( fld_id >= 0 ) {
    status = chk_fld_meta(fld_id, nR); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 81, "unset_meta.c"); }; status = (status) ; goto BYE; } } };
  }
 BYE:
  return status ;
}


decompiled_code:
__int64 __fastcall unset_meta(_BYTE *a1, _BYTE *a2, const char *a3)
{
int v4; // ebx
char v6[4]; // [rsp+Ch] [rbp-14Ch] BYREF
char v7[124]; // [rsp+10h] [rbp-148h] BYREF
int v8; // [rsp+8Ch] [rbp-CCh] BYREF
char v9[124]; // [rsp+90h] [rbp-C8h] BYREF
int v10; // [rsp+10Ch] [rbp-4Ch] BYREF
char v11[72]; // [rsp+110h] [rbp-48h] BYREF

if ( a1 && *a1 )
{
if ( a3 )
{
v4 = is_tbl(a1, &v10, v11);
if ( v4 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 104LL, "unset_meta.c");
}
else if ( v10 < 0 || v10 >= g_n_tbl )
{
fprintf(stderr, "Line %3d of File %s \n", 105LL, "unset_meta.c");
v4 = -1;
}
else
{
if ( a2 && *a2 )
{
v4 = is_fld(0LL, (unsigned int)v10, a2, &v8, v9, v6, v7);
if ( v4 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 112LL, "unset_meta.c");
return (unsigned int)v4;
}
if ( v8 < 0 || v8 >= g_n_fld )
{
fprintf(stderr, "Line %3d of File %s \n", 113LL, "unset_meta.c");
return (unsigned int)-1;
}
}
else
{
v8 = -1;
}
v4 = int_unset_meta(v10, v8, a3);
if ( v4 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 115LL, "unset_meta.c");
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 102LL, "unset_meta.c");
v4 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 101LL, "unset_meta.c");
v4 = -1;
}
return (unsigned int)v4;
}

canonical_decompiled_code:
__int64 __fastcall func2(_BYTE *a1, _BYTE *a2, const char *a3)
{
int v4; // ebx
char v6[4]; // [rsp+Ch] [rbp-14Ch] BYREF
char v7[124]; // [rsp+10h] [rbp-148h] BYREF
int v8; // [rsp+8Ch] [rbp-CCh] BYREF
char v9[124]; // [rsp+90h] [rbp-C8h] BYREF
int v10; // [rsp+10Ch] [rbp-4Ch] BYREF
char v11[72]; // [rsp+110h] [rbp-48h] BYREF

if ( a1 && *a1 )
{
if ( a3 )
{
v4 = is_tbl(a1, &v10, v11);
if ( v4 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 104LL, "unset_meta.c");
}
else if ( v10 < 0 || v10 >= g_n_tbl )
{
fprintf(stderr, "Line %3d of File %s \n", 105LL, "unset_meta.c");
v4 = -1;
}
else
{
if ( a2 && *a2 )
{
v4 = is_fld(0LL, (unsigned int)v10, a2, &v8, v9, v6, v7);
if ( v4 < 0 )
{
fprintf(stderr, "Line %3d of File %s \n", 112LL, "unset_meta.c");
return (unsigned int)v4;
}
if ( v8 < 0 || v8 >= g_n_fld )
{
fprintf(stderr, "Line %3d of File %s \n", 113LL, "unset_meta.c");
return (unsigned int)-1;
}
}
else
{
v8 = -1;
}
v4 = func1(v10, v8, a3);
if ( v4 < 0 )
fprintf(stderr, "Line %3d of File %s \n", 115LL, "unset_meta.c");
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 102LL, "unset_meta.c");
v4 = -1;
}
}
else
{
fprintf(stderr, "Line %3d of File %s \n", 101LL, "unset_meta.c");
v4 = -1;
}
return (unsigned int)v4;
}

original_code:
int
unset_meta(
  const char *tbl,
  const char *fld,
  const char *attr
  )
{
  int status = 0;
  TBL_REC_TYPE tbl_rec; int tbl_id;
  FLD_REC_TYPE fld_rec; int fld_id;
  FLD_REC_TYPE nn_fld_rec; int nn_fld_id;
  if ( ( tbl == ((void *)0) ) || ( *tbl == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 101, "unset_meta.c"); }; status = -1 ; goto BYE; }; }
  if ( ( attr == ((void *)0) ) || ( * tbl == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 102, "unset_meta.c"); }; status = -1 ; goto BYE; }; }
  status = is_tbl(tbl, &tbl_id, &tbl_rec); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 104, "unset_meta.c"); }; status = (status) ; goto BYE; } } };
  { if ( ( (tbl_id) < (0) ) || ( (tbl_id) >= (g_n_tbl ) ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 105, "unset_meta.c"); }; status = -1 ; goto BYE; }; } };
  if ( ( fld == ((void *)0) ) || ( *fld == '\0' ) ) {
    fld_id = -1;
  }
  else {
    status = is_fld(((void *)0), tbl_id, fld, &fld_id, &fld_rec,
      &nn_fld_id, &nn_fld_rec);
    { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 112, "unset_meta.c"); }; status = (status) ; goto BYE; } } };
    { if ( ( (fld_id) < (0) ) || ( (fld_id) >= (g_n_fld ) ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 113, "unset_meta.c"); }; status = -1 ; goto BYE; }; } };
  }
  status = int_unset_meta(tbl_id, fld_id, attr); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 115, "unset_meta.c"); }; status = (status) ; goto BYE; } } };
 BYE:
  return status ;
}

canonical_original_code:
int unset_meta(char *tbl, char *fld, char *attr)
{
  int status = 0;
  struct _TBL_REC_TYPE tbl_rec; int tbl_id;
  struct _FLD_REC_TYPE fld_rec; int fld_id;
  struct _FLD_REC_TYPE nn_fld_rec; int nn_fld_id;
  if ( ( tbl == ((void *)0) ) || ( *tbl == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 101, "unset_meta.c"); }; status = -1 ; goto BYE; }; }
  if ( ( attr == ((void *)0) ) || ( * tbl == '\0' ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 102, "unset_meta.c"); }; status = -1 ; goto BYE; }; }
  status = is_tbl(tbl, &tbl_id, &tbl_rec); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 104, "unset_meta.c"); }; status = (status) ; goto BYE; } } };
  { if ( ( (tbl_id) < (0) ) || ( (tbl_id) >= (g_n_tbl ) ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 105, "unset_meta.c"); }; status = -1 ; goto BYE; }; } };
  if ( ( fld == ((void *)0) ) || ( *fld == '\0' ) ) {
    fld_id = -1;
  }
  else {
    status = is_fld(((void *)0), tbl_id, fld, &fld_id, &fld_rec,
      &nn_fld_id, &nn_fld_rec);
    { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 112, "unset_meta.c"); }; status = (status) ; goto BYE; } } };
    { if ( ( (fld_id) < (0) ) || ( (fld_id) >= (g_n_fld ) ) ) { { { fprintf(stderr, "Line %3d of File %s \n", 113, "unset_meta.c"); }; status = -1 ; goto BYE; }; } };
  }
  status = int_unset_meta(tbl_id, fld_id, attr); { if ( (status) < 0 ) { { { fprintf(stderr, "Line %3d of File %s \n", 115, "unset_meta.c"); }; status = (status) ; goto BYE; } } };
 BYE:
  return status ;
}

variable_types:
tbl
char *

variable_types:
fld
char *

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; }

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; }