Ejemplo n.º 1
0
int
assfail(const char *astring, const char *file, int line)
{
	__assert_fail(astring, file, line, "");
	/*NOTREACHED*/
	return (0);
}
int main() {
	int x1 = 0;
	int x2 = 0;

	int i = 1;
	int nextI;
	while (1) {
		if (i == 1) {
			x1++;
			i = 2;
		} else if (i == 2) {
			x2++;
			i = 3;
			nextI = 4;
		} else if (i == 3) {
			i = 5;
			nextI = 4;
		} else if (i == 4) {
			i = 5;
			nextI = 6;
		} else if (i == 5) {
			i = nextI;
		}

		if (i == 6) {
			i = 1;
			if (!(x1 == x2)) {
				__assert_fail();
				return 1;
			}
		}
	}
}
Ejemplo n.º 3
0
void __ptassert_fail (
        const char *__assertion,
        const char *__file,
        unsigned int __line,
        const char *__function) {
    std::cout << "[TEST_FAILED]  assert(" << __assertion << ")  In " << __file << ":" << __line << ", in " << __function << std::endl;
    __assert_fail("test failed - see above", __file, __line, __function);
}
Ejemplo n.º 4
0
void sg_ast_fail(const char* message, const char* file, unsigned long line, const char* func) {
#ifdef REDLANDMM_PLATFORM_WIN
     fprintf(stderr, "assert fail %s\n", message);
#else
     __assert_fail (message, file, line, func);
#endif
    exit(1);
}
Ejemplo n.º 5
0
int main() {
	int N;
	int x = 0;
	int i = 0;

  	while (i < N) {
	  	if (!(x == 0)) {
			__assert_fail();
			return 1;
	  	}
   		i = i+1;
  	}
  	if (!(x == 0)) {
		__assert_fail();
		return 1;
  	}
}
Ejemplo n.º 6
0
__cold __attribute__((weak)) __reldap_exportable
void __ldap_assert_fail(
		const char* assertion,
		const char* file,
		unsigned line,
		const char* function) {
	__assert_fail(assertion, file, line, function);
	abort();
}
Ejemplo n.º 7
0
void foobar()
   {
     __PRETTY_FUNCTION__;

#if 0
     __func__;
  // ((1 == 1) ? static_cast<void> (0) : __assert_fail ("1 == 1", "test2001_03.C", 22, __PRETTY_FUNCTION__));
     __assert_fail ("1 == 1", "test2001_03.C", 22, __PRETTY_FUNCTION__);
#endif
   }
Ejemplo n.º 8
0
void deAssertFail (const char* reason, const char* file, int line)
{
#if defined(DE_ASSERT_FAILURE_CALLBACK)
	if (g_assertFailureCallback != DE_NULL)
	{
		/* Remove callback in case of the callback causes further asserts. */
		deAssertFailureCallbackFunc callback = g_assertFailureCallback;
		deSetAssertFailureCallback(DE_NULL);
		callback(reason, file, line);
	}
#endif

#if (((DE_OS == DE_OS_WIN32) || (DE_OS == DE_OS_WINCE)) && (DE_COMPILER == DE_COMPILER_MSC))
	{
		wchar_t	wreason[1024];
		wchar_t	wfile[128];
		int		num;
		int		i;

	/*	MessageBox(reason, "Assertion failed", MB_OK); */

		num = deMin32((int)strlen(reason), DE_LENGTH_OF_ARRAY(wreason)-1);
		for (i = 0; i < num; i++)
			wreason[i] = reason[i];
		wreason[i] = 0;

		num = deMin32((int)strlen(file), DE_LENGTH_OF_ARRAY(wfile)-1);
		for (i = 0; i < num; i++)
			wfile[i] = file[i];
		wfile[i] = 0;

#	if (DE_OS == DE_OS_WIN32)
		_wassert(wreason, wfile, line);
#	else /* WINCE */
		assert(wreason);
#	endif
	}
#elif ((DE_OS == DE_OS_WIN32) && (DE_COMPILER == DE_COMPILER_CLANG))
	_assert(reason, file, line);
#elif (DE_OS == DE_OS_UNIX)
	__assert_fail(reason, file, (unsigned int)line, "Unknown function");
#elif (DE_OS == DE_OS_SYMBIAN)
	__assert("Unknown function", file, line, reason);
#elif (DE_OS == DE_OS_OSX) || (DE_OS == DE_OS_IOS)
	fprintf(stderr, "Assertion '%s' failed at %s:%d\n", reason, file, line);
	raise(SIGTRAP);
	abort();
#elif (DE_OS == DE_OS_ANDROID)
	__android_log_print(ANDROID_LOG_ERROR, "delibs", "Assertion '%s' failed at %s:%d", reason, file, line);
	__assert(file, line, reason);
#else
#	error Implement assertion function on your platform.
#endif
}
Ejemplo n.º 9
0
static void destroy_serial(struct kref *kref ) 
{ 

  {
#line 27
  if (ldv_lock == 0) {

  } else {
    {
#line 27
    __assert_fail("ldv_lock==0", "kref_put.c", 27U, "destroy_serial");
    }
  }
#line 28
  return;
}
}
Ejemplo n.º 10
0
int main() {
	int x;

	if(!(x<0)) {
		 return 0;
	}
	while(x<10 ) {
	 x=x+1;
	}
	if(!(x==10)) {
		 goto ERROR;
	}
	return 0;

ERROR: 
	__assert_fail();
	return 1;
}
Ejemplo n.º 11
0
int main() {
	int x;
	int y;

	if(!( x<y)) {
		 return 0;
	}
	while( x<y) {
	 if (x < 0) x = x + 7; else x = x + 10; if (y < 0) y = y - 10; else y = y + 3;
	}
	if(!( x >= y && x <= y + 16)) {
		 goto ERROR;
	}
	return 0;

ERROR: 
	__assert_fail();
	return 1;
}
Ejemplo n.º 12
0
int main() {
	int i;
	int k;

	if(!(0 <= k && k <= 1 && i == 1)) {
		 return 0;
	}
	while(1) {
	i = i + 1; k = k - 1;
		if(!(1 <= i + k && i + k <= 2 && i >= 1)) {
			 goto ERROR;
		}
	}
	return 0;

ERROR: 
	__assert_fail();
	return 1;
}
Ejemplo n.º 13
0
int main() {
	int x;
	int y;

	if(!(x == 1 && y == 0)) {
		 return 0;
	}
	while(1) {
	 x = x + y; y = y + 1;
		if(!(x >= y)) {
			 goto ERROR;
		}
	}
	return 0;

ERROR: 
	__assert_fail();
	return 1;
}
Ejemplo n.º 14
0
int main() {
	int x;
	int y;

	if(!(x == y && y == 0 )) {
		 return 0;
	}
	while(1) {
	x++;y++;
		if(!(x == y && x >= 0)) {
			 goto ERROR;
		}
	}
	return 0;

ERROR: 
	__assert_fail();
	return 1;
}
Ejemplo n.º 15
0
int main() {
	int i;
	int j;

if(i < 0) i = -i; i = i + 1;
	if(!(i*i < j && i >= 1)) {
		 return 0;
	}
	while(i*i < j) {
	 i = i + 1;
	}
	if(!((i - 1) * (i - 1) < j && j <= i * i)) {
		 goto ERROR;
	}
	return 0;

ERROR: 
	__assert_fail();
	return 1;
}
Ejemplo n.º 16
0
int main() {
	int l;

 int n; int i;
 i = l;
	if(!( l>0)) {
		 return 0;
	}
	while( i < n) {
	i++;
	}
	if(!(l>=1)) {
		 goto ERROR;
	}
	return 0;

ERROR: 
	__assert_fail();
	return 1;
}
Ejemplo n.º 17
0
__inline static void mark_range_start(size_t i ) 
{ void *ent_from_table ;
  void *tmp ;

  {
  tmp = hash_insert(range_start_ht, (void const   *)((void *)i));
  ent_from_table = tmp;
  if ((unsigned long )ent_from_table == (unsigned long )((void *)0)) {
    xalloc_die();
  } else {

  }
  if (! ((unsigned long )ent_from_table == i)) {
    __assert_fail("(size_t) ent_from_table == i", "cut.c", 254U, "mark_range_start");
  } else {

  }
  return;
}
}
Ejemplo n.º 18
0
void __assert_fail_msg (__const char *__assertion, __const char *__file,
			   unsigned int __line, __const char *__function, const char *format, ...)
{
	size_t bufferLen = (strlen(__assertion) + strlen(format)) * 2;
	if (bufferLen < 4096)
		bufferLen = 4096;

	char *buffer = (char *)malloc(bufferLen);
	int printed = snprintf(buffer, bufferLen, "%s: ", __assertion);

	va_list ap;
	va_start(ap, format);

	vsnprintf(buffer + printed, bufferLen - printed, format, ap);

	va_end(ap);

	__assert_fail(buffer, __file, __line, __function);

	free(buffer);
}
Ejemplo n.º 19
0
static TACommandVerdict __assert_fail_cmd(TAThread thread,TAInputStream stream)
{
    FILE * old_std;
    FILE * stubfile;

    // Prepare
    const char * assertion = readString(&stream);
    const char * file = readString(&stream);
    unsigned int line = readUInt(&stream);
    int ind = readInt(&stream);
    const char * function = NULL;

    if (ind)
        function = readString(&stream);

    START_TARGET_OPERATION(thread);

    //writeDeferredReaction( thread, "assertFail_processTerminated" );
    //sendResponse( thread );

    // Execute
    stubfile = fopen(ta_get_test_file_path("stderr_stub.txt"),"wt");

    old_std = stderr;
    stderr = stubfile;

    __assert_fail(assertion, file, line, function);
    stderr = old_std;
    fclose(stubfile);

    END_TARGET_OPERATION(thread);

    // Response
    writeDeferredReaction( thread, "assertFail_return" );
    sendResponse( thread );

    return taDefaultVerdict;
}
Ejemplo n.º 20
0
int append_buf(char const   *str , size_t len , int outfd , char *outbuf , size_t *outlen ) 
{ 
  int tmp ;

  {
#line 61
  if (! (len <= 524288UL)) {
    {
#line 61
    __assert_fail("len <= 524288", "/home/june/collector/temp/bootchart-0.90.2/bootchart-collector.c",
                  61U, "append_buf");
    }
  }
#line 63
  if (*outlen + len > 524288UL) {
    {
#line 64
    tmp = flush_buf(outfd, outbuf, outlen);
    }
#line 64
    if (tmp < 0) {
#line 65
      return (-1);
    }
  }
  {
#line 67
  memcpy((void */* __restrict  */)(outbuf + *outlen), (void const   */* __restrict  */)str,
         len);
#line 68
  *outlen += len;
  }
#line 70
  return (0);
}
}
int main(void) 
{ char fbuf[3] ;
  int fb ;
  int c1 ;
  int tmp ;
  int tmp___0 ;
  unsigned long __cil_tmp6 ;
  unsigned long __cil_tmp7 ;
  unsigned long __cil_tmp8 ;
  unsigned long __cil_tmp9 ;
  char __cil_tmp10 ;
  int __cil_tmp11 ;
  unsigned long __cil_tmp12 ;
  unsigned long __cil_tmp13 ;
  char __cil_tmp14 ;
  int __cil_tmp15 ;
  unsigned long __cil_tmp16 ;
  unsigned long __cil_tmp17 ;
  unsigned long __cil_tmp18 ;
  unsigned long __cil_tmp19 ;

  {
#line 13
  fb = 0;
  {
#line 14
  while (1) {
    while_0_continue: /* CIL Label */ ;
    {
#line 14
    c1 = __VERIFIER_nondet_int();
    }
#line 14
    if (c1 != -1) {

    } else {
      goto while_0_break;
    }
    {
#line 16
    tmp = isascii(c1);
    }
#line 16
    if (tmp) {
      {
#line 16
      tmp___0 = isspace(c1);
      }
#line 16
      if (tmp___0) {
        goto while_0_continue;
      } else {

      }
    } else {

    }
#line 18
    if (c1 == 61) {
      goto while_0_continue;
    } else {

    }
#line 22
    if (fb < 2) {

    } else {
      {
#line 22
      __assert_fail("fb < 2", "../versisec/sendmail/progs/sendmailCVE-1999-0047mime7to8_mime7to8_arr_one_char_heavy_test_bad.c",
                    22U, "main");
      }
    }
#line 24
    __cil_tmp6 = fb * 1UL;
#line 24
    __cil_tmp7 = (unsigned long )(fbuf) + __cil_tmp6;
#line 24
    *((char *)__cil_tmp7) = (char )c1;
    {
#line 27
    __cil_tmp8 = fb * 1UL;
#line 27
    __cil_tmp9 = (unsigned long )(fbuf) + __cil_tmp8;
#line 27
    __cil_tmp10 = *((char *)__cil_tmp9);
#line 27
    __cil_tmp11 = (int )__cil_tmp10;
#line 27
    if (__cil_tmp11 == 10) {
#line 29
      fb = fb - 1;
#line 30
      if (fb < 0) {
#line 31
        fb = 0;
      } else {
        {
#line 32
        __cil_tmp12 = fb * 1UL;
#line 32
        __cil_tmp13 = (unsigned long )(fbuf) + __cil_tmp12;
#line 32
        __cil_tmp14 = *((char *)__cil_tmp13);
#line 32
        __cil_tmp15 = (int )__cil_tmp14;
#line 32
        if (__cil_tmp15 != 13) {
#line 33
          fb = fb + 1;
        } else {

        }
        }
      }
#line 36
      if (fb <= 2) {

      } else {
        {
#line 36
        __assert_fail("fb <= 2", "../versisec/sendmail/progs/sendmailCVE-1999-0047mime7to8_mime7to8_arr_one_char_heavy_test_bad.c",
                      36U, "main");
        }
      }
#line 38
      __cil_tmp16 = fb * 1UL;
#line 38
      __cil_tmp17 = (unsigned long )(fbuf) + __cil_tmp16;
#line 38
      *((char *)__cil_tmp17) = (char)0;
#line 39
      fb = 0;
    } else {
#line 42
      fb = fb + 1;
    }
    }
  }
  while_0_break: /* CIL Label */ ;
  }
#line 46
  if (fb > 0) {
#line 49
    __cil_tmp18 = fb * 1UL;
#line 49
    __cil_tmp19 = (unsigned long )(fbuf) + __cil_tmp18;
#line 49
    *((char *)__cil_tmp19) = (char)0;
  } else {

  }
#line 52
  return (0);
}
}
Ejemplo n.º 22
0
void
__aeabi_assert (const char *assertion, const char *file,
		unsigned int line)
{
  __assert_fail (assertion, file, line, NULL);
}
Ejemplo n.º 23
0
static int ljForce(SimFlat *s)
{
  LjPotential *pot = (LjPotential *)(s -> pot);
  real_t sigma = pot -> sigma;
  real_t epsilon = pot -> epsilon;
  real_t rCut = pot -> cutoff;
  real_t rCut2 = rCut * rCut;
// zero forces and energy
  real_t ePot = 0.0;
  s -> ePotential = 0.0;
  int fSize = s -> boxes -> nTotalBoxes * 64;
  for (int ii = 0; ii < fSize; ++ii) {
    zeroReal3(s -> atoms -> f[ii]);
    s -> atoms -> U[ii] = 0.0;
  }
  real_t s6 = sigma * sigma * sigma * sigma * sigma * sigma;
  real_t rCut6 = s6 / (rCut2 * rCut2 * rCut2);
  real_t eShift = 1.0 * rCut6 * (rCut6 - 1.0);
  int nbrBoxes[27];
// loop over local boxes
  for (int iBox = 0; iBox < s -> boxes -> nLocalBoxes; iBox++) {
    int nIBox = s -> boxes -> nAtoms[iBox];
    if (nIBox == 0) {
      continue; 
    }
    int nNbrBoxes = getNeighborBoxes(s -> boxes,iBox,nbrBoxes);
// loop over neighbors of iBox
    for (int jTmp = 0; jTmp < nNbrBoxes; jTmp++) {
      int jBox = nbrBoxes[jTmp];
      jBox >= 0?((void )0) : __assert_fail("jBox>=0","ljForce.c",159,__PRETTY_FUNCTION__);
      int nJBox = s -> boxes -> nAtoms[jBox];
      if (nJBox == 0) {
        continue; 
      }
// loop over atoms in iBox
      for (int iOff = iBox * 64, ii = 0; ii < nIBox; (ii++ , iOff++)) {
        int iId = s -> atoms -> gid[iOff];
// loop over atoms in jBox
        for (int jOff = 64 * jBox, ij = 0; ij < nJBox; (ij++ , jOff++)) {
          real_t dr[3];
          int jId = s -> atoms -> gid[jOff];
          if (jBox < s -> boxes -> nLocalBoxes && jId <= iId) {
// don't double count local-local pairs.
            continue; 
          }
          real_t r2 = 0.0;
          for (int m = 0; m < 3; m++) {
            dr[m] = s -> atoms -> r[iOff][m] - s -> atoms -> r[jOff][m];
            r2 += dr[m] * dr[m];
          }
          if (r2 > rCut2) {
            continue; 
          }
// Important note:
// from this point on r actually refers to 1.0/r
          r2 = 1.0 / r2;
          real_t r6 = s6 * (r2 * r2 * r2);
          real_t eLocal = r6 * (r6 - 1.0) - eShift;
          s -> atoms -> U[iOff] += 0.5 * eLocal;
          s -> atoms -> U[jOff] += 0.5 * eLocal;
// calculate energy contribution based on whether
// the neighbor box is local or remote
          if (jBox < s -> boxes -> nLocalBoxes) {
            ePot += eLocal;
          }
          else {
            ePot += 0.5 * eLocal;
          }
// different formulation to avoid sqrt computation
          real_t fr = -4.0 * epsilon * r6 * r2 * (12.0 * r6 - 6.0);
          for (int m = 0; m < 3; m++) {
            s -> atoms -> f[iOff][m] -= dr[m] * fr;
            s -> atoms -> f[jOff][m] += dr[m] * fr;
          }
// loop over atoms in jBox
        }
// loop over atoms in iBox
      }
// loop over neighbor boxes
    }
// loop over local boxes in system
  }
  ePot = ePot * 4.0 * epsilon;
  s -> ePotential = ePot;
  return 0;
}
Ejemplo n.º 24
0
Archivo: lib.c Proyecto: Linhos13/svc15
void __VERIFIER_assert(int expr)
{
	if (!expr)
		__assert_fail("verifier assertion failed", __FILE__, __LINE__, __func__);
}
int hypre_SMGResidual(void *residual_vdata,hypre_StructMatrix *A,hypre_StructVector *x,hypre_StructVector *b,hypre_StructVector *r)
{
  int ierr = 0;
  hypre_SMGResidualData *residual_data = residual_vdata;
  hypre_IndexRef base_stride = (residual_data -> base_stride);
  hypre_BoxArray *base_points = (residual_data -> base_points);
  hypre_ComputePkg *compute_pkg = (residual_data -> compute_pkg);
  hypre_CommHandle *comm_handle;
  hypre_BoxArrayArray *compute_box_aa;
  hypre_BoxArray *compute_box_a;
  hypre_Box *compute_box;
  hypre_Box *A_data_box;
  hypre_Box *x_data_box;
  hypre_Box *b_data_box;
  hypre_Box *r_data_box;
  int Ai;
  int xi;
  int bi;
  int ri;
  double *Ap;
  double *xp;
  double *bp;
  double *rp;
  hypre_Index loop_size;
  hypre_IndexRef start;
  hypre_StructStencil *stencil;
  hypre_Index *stencil_shape;
  int stencil_size;
  int compute_i;
  int i;
  int j;
  int si;
  int loopi;
  int loopj;
  int loopk;
/* New static variables, precomputed */
  hypre_BeginTiming((residual_data -> time_index));
  stencil = (A -> stencil);
  stencil_shape = (stencil -> shape);
  stencil_size = (stencil -> size);
  (stencil_size <= 15)?0 : ((__assert_fail(("stencil_size <= 15"),("/home/liao6/svnrepos/benchmarks/smg2000/struct_ls/smg_residual.c"),(203),("int hypre_SMGResidual(void *, struct hypre_StructMatrix_struct *, struct hypre_StructVector_struct *, struct hypre_StructVector_struct *, struct hypre_StructVector_struct *)")) , 0));
  for (compute_i = 0; compute_i < 2; compute_i++) {
    switch(compute_i){
      case 0:
{
{
          xp = (x -> data);
          hypre_InitializeIndtComputations(compute_pkg,xp,&comm_handle);
          compute_box_aa = (compute_pkg -> indt_boxes);
          compute_box_a = base_points;
          for (i = 0; i < (compute_box_a -> size); i++) {
            compute_box = ((compute_box_a -> boxes) + i);
            start = (compute_box -> imin);
            b_data_box = ((( *(b -> data_space)).boxes) + i);
            r_data_box = ((( *(r -> data_space)).boxes) + i);
            bp = ((b -> data) + ((b -> data_indices)[i]));
            rp = ((r -> data) + ((r -> data_indices)[i]));
            hypre_BoxGetStrideSize(compute_box,base_stride,loop_size);
{
              int hypre__i1start = (((start[0]) - ((b_data_box -> imin)[0])) + ((((start[1]) - ((b_data_box -> imin)[1])) + (((start[2]) - ((b_data_box -> imin)[2])) * (((0 < ((((b_data_box -> imax)[1]) - ((b_data_box -> imin)[1])) + 1))?((((b_data_box -> imax)[1]) - ((b_data_box -> imin)[1])) + 1) : 0)))) * (((0 < ((((b_data_box -> imax)[0]) - ((b_data_box -> imin)[0])) + 1))?((((b_data_box -> imax)[0]) - ((b_data_box -> imin)[0])) + 1) : 0))));
              int hypre__i2start = (((start[0]) - ((r_data_box -> imin)[0])) + ((((start[1]) - ((r_data_box -> imin)[1])) + (((start[2]) - ((r_data_box -> imin)[2])) * (((0 < ((((r_data_box -> imax)[1]) - ((r_data_box -> imin)[1])) + 1))?((((r_data_box -> imax)[1]) - ((r_data_box -> imin)[1])) + 1) : 0)))) * (((0 < ((((r_data_box -> imax)[0]) - ((r_data_box -> imin)[0])) + 1))?((((r_data_box -> imax)[0]) - ((r_data_box -> imin)[0])) + 1) : 0))));
              int hypre__sx1 = (base_stride[0]);
              int hypre__sy1 = ((base_stride[1]) * (((0 < ((((b_data_box -> imax)[0]) - ((b_data_box -> imin)[0])) + 1))?((((b_data_box -> imax)[0]) - ((b_data_box -> imin)[0])) + 1) : 0)));
              int hypre__sz1 = (((base_stride[2]) * (((0 < ((((b_data_box -> imax)[0]) - ((b_data_box -> imin)[0])) + 1))?((((b_data_box -> imax)[0]) - ((b_data_box -> imin)[0])) + 1) : 0))) * (((0 < ((((b_data_box -> imax)[1]) - ((b_data_box -> imin)[1])) + 1))?((((b_data_box -> imax)[1]) - ((b_data_box -> imin)[1])) + 1) : 0)));
              int hypre__sx2 = (base_stride[0]);
              int hypre__sy2 = ((base_stride[1]) * (((0 < ((((r_data_box -> imax)[0]) - ((r_data_box -> imin)[0])) + 1))?((((r_data_box -> imax)[0]) - ((r_data_box -> imin)[0])) + 1) : 0)));
              int hypre__sz2 = (((base_stride[2]) * (((0 < ((((r_data_box -> imax)[0]) - ((r_data_box -> imin)[0])) + 1))?((((r_data_box -> imax)[0]) - ((r_data_box -> imin)[0])) + 1) : 0))) * (((0 < ((((r_data_box -> imax)[1]) - ((r_data_box -> imin)[1])) + 1))?((((r_data_box -> imax)[1]) - ((r_data_box -> imin)[1])) + 1) : 0)));
              int hypre__nx = (loop_size[0]);
              int hypre__ny = (loop_size[1]);
              int hypre__nz = (loop_size[2]);
              int hypre__mx = hypre__nx;
              int hypre__my = hypre__ny;
              int hypre__mz = hypre__nz;
              int hypre__dir;
              int hypre__max;
              int hypre__div;
              int hypre__mod;
              int hypre__block;
              int hypre__num_blocks;
              hypre__dir = 0;
              hypre__max = hypre__nx;
              if (hypre__ny > hypre__max) {
                hypre__dir = 1;
                hypre__max = hypre__ny;
              }
              if (hypre__nz > hypre__max) {
                hypre__dir = 2;
                hypre__max = hypre__nz;
              }
              hypre__num_blocks = 1;
              if (hypre__max < hypre__num_blocks) {
                hypre__num_blocks = hypre__max;
              }
              if (hypre__num_blocks > 0) {
                hypre__div = (hypre__max / hypre__num_blocks);
                hypre__mod = (hypre__max % hypre__num_blocks);
              }
/* # 236 "smg_residual.c" */
              (hypre__sx1 == 1)?0 : ((__assert_fail(("hypre__sx1 == 1"),("/home/liao6/svnrepos/benchmarks/smg2000/struct_ls/smg_residual.c"),(357),("int hypre_SMGResidual(void *, struct hypre_StructMatrix_struct *, struct hypre_StructVector_struct *, struct hypre_StructVector_struct *, struct hypre_StructVector_struct *)")) , 0));
              (hypre__sx2 == 1)?0 : ((__assert_fail(("hypre__sx2 == 1"),("/home/liao6/svnrepos/benchmarks/smg2000/struct_ls/smg_residual.c"),(358),("int hypre_SMGResidual(void *, struct hypre_StructMatrix_struct *, struct hypre_StructVector_struct *, struct hypre_StructVector_struct *, struct hypre_StructVector_struct *)")) , 0));
              if (hypre__num_blocks == 1) {
                int ii;
                int jj;
                int kk;
                const double *bp_0 = (bp + hypre__i1start);
                double *rp_0 = (rp + hypre__i2start);
                for (kk = 0; kk < hypre__mz; kk++) {
                  for (jj = 0; jj < hypre__my; jj++) {
                    const double *bpp = ((bp_0 + (jj * hypre__sy1)) + (kk * hypre__sz1));
                    double *rpp = ((rp_0 + (jj * hypre__sy2)) + (kk * hypre__sz2));
                    for (ii = 0; ii < hypre__mx; ii++) {
                      rpp[ii] = (bpp[ii]);
                    }
                  }
                }
/* hypre__num_blocks > 1 */
              }
              else {
                for (hypre__block = 0; hypre__block < hypre__num_blocks; hypre__block++) {
                  loopi = 0;
                  loopj = 0;
                  loopk = 0;
                  hypre__nx = hypre__mx;
                  hypre__ny = hypre__my;
                  hypre__nz = hypre__mz;
                  if (hypre__dir == 0) {
                    loopi = ((hypre__block * hypre__div) + (((hypre__mod < hypre__block)?hypre__mod : hypre__block)));
                    hypre__nx = (hypre__div + (((hypre__mod > hypre__block)?1 : 0)));
                  }
                  else if (hypre__dir == 1) {
                    loopj = ((hypre__block * hypre__div) + (((hypre__mod < hypre__block)?hypre__mod : hypre__block)));
                    hypre__ny = (hypre__div + (((hypre__mod > hypre__block)?1 : 0)));
                  }
                  else if (hypre__dir == 2) {
                    loopk = ((hypre__block * hypre__div) + (((hypre__mod < hypre__block)?hypre__mod : hypre__block)));
                    hypre__nz = (hypre__div + (((hypre__mod > hypre__block)?1 : 0)));
                  }
                  bi = (((hypre__i1start + loopi) + (loopj * hypre__sy1)) + (loopk * hypre__sz1));
                  ri = (((hypre__i2start + loopi) + (loopj * hypre__sy2)) + (loopk * hypre__sz2));
/* AAA */
{
                    int ii;
                    int jj;
                    int kk;
                    const double *bp_0 = (bp + bi);
                    double *rp_0 = (rp + ri);
                    for (kk = 0; kk < hypre__nz; kk++) {
                      for (jj = 0; jj < hypre__ny; jj++) {
                        const double *bpp = ((bp_0 + (jj * hypre__sy1)) + (kk * hypre__sz1));
                        double *rpp = ((rp_0 + (jj * hypre__sy2)) + (kk * hypre__sz2));
                        for (ii = 0; ii < hypre__nx; ii++) {
                          rpp[ii] = (bpp[ii]);
                        }
                      }
                    }
/* AAA */
                  }
                }
/* hypre__num_blocks > 1 */
              }
            }
          }
        }
        break; 
      }
      case 1:
{
{
          hypre_FinalizeIndtComputations(comm_handle);
          compute_box_aa = (compute_pkg -> dept_boxes);
        }
        break; 
      }
/* switch */
    }
/*--------------------------------------------------------------------
     * Compute r -= A*x
     *--------------------------------------------------------------------*/
    for (i = 0; i < (compute_box_aa -> size); i++) {
      int dxp_s[15UL];
      compute_box_a = ((compute_box_aa -> box_arrays)[i]);
      A_data_box = ((( *(A -> data_space)).boxes) + i);
      x_data_box = ((( *(x -> data_space)).boxes) + i);
      r_data_box = ((( *(r -> data_space)).boxes) + i);
      rp = ((r -> data) + ((r -> data_indices)[i]));
      for (si = 0; si < stencil_size; si++) {
        dxp_s[si] = (((stencil_shape[si])[0]) + ((((stencil_shape[si])[1]) + (((stencil_shape[si])[2]) * (((0 < ((((x_data_box -> imax)[1]) - ((x_data_box -> imin)[1])) + 1))?((((x_data_box -> imax)[1]) - ((x_data_box -> imin)[1])) + 1) : 0)))) * (((0 < ((((x_data_box -> imax)[0]) - ((x_data_box -> imin)[0])) + 1))?((((x_data_box -> imax)[0]) - ((x_data_box -> imin)[0])) + 1) : 0))));
      }
      for (j = 0; j < (compute_box_a -> size); j++) {{
          int hypre__i1start;
          int hypre__i2start;
          int hypre__i3start;
          int hypre__sx1;
          int hypre__sy1;
          int hypre__sz1;
          int hypre__sx2;
          int hypre__sy2;
          int hypre__sz2;
          int hypre__sx3;
          int hypre__sy3;
          int hypre__sz3;
          int hypre__nx;
          int hypre__ny;
          int hypre__nz;
          int hypre__mx;
          int hypre__my;
          int hypre__mz;
          int hypre__dir;
          int hypre__max;
          int hypre__div;
          int hypre__mod;
          int hypre__block;
          int hypre__num_blocks;
          compute_box = ((compute_box_a -> boxes) + j);
          start = (compute_box -> imin);
          hypre__i1start = (((start[0]) - ((A_data_box -> imin)[0])) + ((((start[1]) - ((A_data_box -> imin)[1])) + (((start[2]) - ((A_data_box -> imin)[2])) * (((0 < ((((A_data_box -> imax)[1]) - ((A_data_box -> imin)[1])) + 1))?((((A_data_box -> imax)[1]) - ((A_data_box -> imin)[1])) + 1) : 0)))) * (((0 < ((((A_data_box -> imax)[0]) - ((A_data_box -> imin)[0])) + 1))?((((A_data_box -> imax)[0]) - ((A_data_box -> imin)[0])) + 1) : 0))));
          hypre__i2start = (((start[0]) - ((x_data_box -> imin)[0])) + ((((start[1]) - ((x_data_box -> imin)[1])) + (((start[2]) - ((x_data_box -> imin)[2])) * (((0 < ((((x_data_box -> imax)[1]) - ((x_data_box -> imin)[1])) + 1))?((((x_data_box -> imax)[1]) - ((x_data_box -> imin)[1])) + 1) : 0)))) * (((0 < ((((x_data_box -> imax)[0]) - ((x_data_box -> imin)[0])) + 1))?((((x_data_box -> imax)[0]) - ((x_data_box -> imin)[0])) + 1) : 0))));
          hypre__i3start = (((start[0]) - ((r_data_box -> imin)[0])) + ((((start[1]) - ((r_data_box -> imin)[1])) + (((start[2]) - ((r_data_box -> imin)[2])) * (((0 < ((((r_data_box -> imax)[1]) - ((r_data_box -> imin)[1])) + 1))?((((r_data_box -> imax)[1]) - ((r_data_box -> imin)[1])) + 1) : 0)))) * (((0 < ((((r_data_box -> imax)[0]) - ((r_data_box -> imin)[0])) + 1))?((((r_data_box -> imax)[0]) - ((r_data_box -> imin)[0])) + 1) : 0))));
          hypre_BoxGetStrideSize(compute_box,base_stride,loop_size);
          hypre__sx1 = (base_stride[0]);
          hypre__sy1 = ((base_stride[1]) * (((0 < ((((A_data_box -> imax)[0]) - ((A_data_box -> imin)[0])) + 1))?((((A_data_box -> imax)[0]) - ((A_data_box -> imin)[0])) + 1) : 0)));
          hypre__sz1 = (((base_stride[2]) * (((0 < ((((A_data_box -> imax)[0]) - ((A_data_box -> imin)[0])) + 1))?((((A_data_box -> imax)[0]) - ((A_data_box -> imin)[0])) + 1) : 0))) * (((0 < ((((A_data_box -> imax)[1]) - ((A_data_box -> imin)[1])) + 1))?((((A_data_box -> imax)[1]) - ((A_data_box -> imin)[1])) + 1) : 0)));
          hypre__sx2 = (base_stride[0]);
          hypre__sy2 = ((base_stride[1]) * (((0 < ((((x_data_box -> imax)[0]) - ((x_data_box -> imin)[0])) + 1))?((((x_data_box -> imax)[0]) - ((x_data_box -> imin)[0])) + 1) : 0)));
          hypre__sz2 = (((base_stride[2]) * (((0 < ((((x_data_box -> imax)[0]) - ((x_data_box -> imin)[0])) + 1))?((((x_data_box -> imax)[0]) - ((x_data_box -> imin)[0])) + 1) : 0))) * (((0 < ((((x_data_box -> imax)[1]) - ((x_data_box -> imin)[1])) + 1))?((((x_data_box -> imax)[1]) - ((x_data_box -> imin)[1])) + 1) : 0)));
          hypre__sx3 = (base_stride[0]);
          hypre__sy3 = ((base_stride[1]) * (((0 < ((((r_data_box -> imax)[0]) - ((r_data_box -> imin)[0])) + 1))?((((r_data_box -> imax)[0]) - ((r_data_box -> imin)[0])) + 1) : 0)));
          hypre__sz3 = (((base_stride[2]) * (((0 < ((((r_data_box -> imax)[0]) - ((r_data_box -> imin)[0])) + 1))?((((r_data_box -> imax)[0]) - ((r_data_box -> imin)[0])) + 1) : 0))) * (((0 < ((((r_data_box -> imax)[1]) - ((r_data_box -> imin)[1])) + 1))?((((r_data_box -> imax)[1]) - ((r_data_box -> imin)[1])) + 1) : 0)));
/* Based on BG/L Milestone #46 */
          (hypre__sx1 == 1)?0 : ((__assert_fail(("hypre__sx1 == 1"),("/home/liao6/svnrepos/benchmarks/smg2000/struct_ls/smg_residual.c"),(602),("int hypre_SMGResidual(void *, struct hypre_StructMatrix_struct *, struct hypre_StructVector_struct *, struct hypre_StructVector_struct *, struct hypre_StructVector_struct *)")) , 0));
          (hypre__sx2 == 1)?0 : ((__assert_fail(("hypre__sx2 == 1"),("/home/liao6/svnrepos/benchmarks/smg2000/struct_ls/smg_residual.c"),(603),("int hypre_SMGResidual(void *, struct hypre_StructMatrix_struct *, struct hypre_StructVector_struct *, struct hypre_StructVector_struct *, struct hypre_StructVector_struct *)")) , 0));
          (hypre__sx3 == 1)?0 : ((__assert_fail(("hypre__sx3 == 1"),("/home/liao6/svnrepos/benchmarks/smg2000/struct_ls/smg_residual.c"),(604),("int hypre_SMGResidual(void *, struct hypre_StructMatrix_struct *, struct hypre_StructVector_struct *, struct hypre_StructVector_struct *, struct hypre_StructVector_struct *)")) , 0));
          hypre__mx = (loop_size[0]);
          hypre__my = (loop_size[1]);
          hypre__mz = (loop_size[2]);
          hypre__dir = 0;
          hypre__max = hypre__mx;
          if (hypre__my > hypre__max) {
            hypre__dir = 1;
            hypre__max = hypre__my;
          }
          if (hypre__mz > hypre__max) {
            hypre__dir = 2;
            hypre__max = hypre__mz;
          }
          hypre__num_blocks = 1;
          if (hypre__max < hypre__num_blocks) {
            hypre__num_blocks = hypre__max;
          }
          if (hypre__num_blocks > 0) {
            hypre__div = (hypre__max / hypre__num_blocks);
            hypre__mod = (hypre__max % hypre__num_blocks);
          }
          else 
            continue; 
          if (hypre__num_blocks == 1) {
            int si;
            int ii;
            int jj;
            int kk;
            const double *Ap_0 = ((A -> data) + hypre__i1start);
            const double *xp_0 = (((x -> data) + hypre__i2start) + ((x -> data_indices)[i]));
            ri = hypre__i3start;

            void *__out_argv1__1527__[21];
            *(__out_argv1__1527__ + 0) = ((void *)(&xp_0));
            *(__out_argv1__1527__ + 1) = ((void *)(&Ap_0));
            *(__out_argv1__1527__ + 2) = ((void *)(&kk));
            *(__out_argv1__1527__ + 3) = ((void *)(&jj));
            *(__out_argv1__1527__ + 4) = ((void *)(&ii));
            *(__out_argv1__1527__ + 5) = ((void *)(&si));
            *(__out_argv1__1527__ + 6) = ((void *)(&hypre__mz));
            *(__out_argv1__1527__ + 7) = ((void *)(&hypre__my));
            *(__out_argv1__1527__ + 8) = ((void *)(&hypre__mx));
            *(__out_argv1__1527__ + 9) = ((void *)(&hypre__sz3));
            *(__out_argv1__1527__ + 10) = ((void *)(&hypre__sy3));
            *(__out_argv1__1527__ + 11) = ((void *)(&hypre__sz2));
            *(__out_argv1__1527__ + 12) = ((void *)(&hypre__sy2));
            *(__out_argv1__1527__ + 13) = ((void *)(&hypre__sz1));
            *(__out_argv1__1527__ + 14) = ((void *)(&hypre__sy1));
            *(__out_argv1__1527__ + 15) = ((void *)(&dxp_s));
            *(__out_argv1__1527__ + 16) = ((void *)(&i));
            *(__out_argv1__1527__ + 17) = ((void *)(&stencil_size));
            *(__out_argv1__1527__ + 18) = ((void *)(&rp));
            *(__out_argv1__1527__ + 19) = ((void *)(&ri));
            *(__out_argv1__1527__ + 20) = ((void *)(&A));
#ifdef USE_DLOPEN
            if (g_execution_flag == 0){
              printf("Opening the .so file ...\n");
              FunctionLib = dlopen("/home/liao6/svnrepos/benchmarks/smg2000/struct_ls/OUT__1__6119__.so",RTLD_LAZY);
              dlError = dlerror();
              if( dlError ) {
                printf("cannot open .so file!\n");
                exit(1);
              }

              /* Find the first loaded function */
              OUT__1__6119__ = dlsym( FunctionLib, "OUT__1__6119__");
              dlError = dlerror();
              if( dlError )
              {
                printf("cannot find OUT__1__6755__() !\n");
                exit(1);
              }
              //remove("/tmp/peri.result");
              //time1=time_stamp();
            } // end if (flag ==0)
             g_execution_flag ++;

            (*OUT__1__6119__)(__out_argv1__1527__);
#else            
            OUT__1__6119__(__out_argv1__1527__);
#endif
/* hypre__num_blocks > 1 */
          }
          else {
            for (si = 0; si < stencil_size; si++) {
              Ap = ((A -> data) + (((A -> data_indices)[i])[si]));
              xp = (((x -> data) + ((x -> data_indices)[i])) + (dxp_s[si]));
              for (hypre__block = 0; hypre__block < hypre__num_blocks; hypre__block++) {
                loopi = 0;
                loopj = 0;
                loopk = 0;
                hypre__nx = hypre__mx;
                hypre__ny = hypre__my;
                hypre__nz = hypre__mz;
                if (hypre__dir == 0) {
                  loopi = ((hypre__block * hypre__div) + (((hypre__mod < hypre__block)?hypre__mod : hypre__block)));
                  hypre__nx = (hypre__div + (((hypre__mod > hypre__block)?1 : 0)));
                }
                else if (hypre__dir == 1) {
                  loopj = ((hypre__block * hypre__div) + (((hypre__mod < hypre__block)?hypre__mod : hypre__block)));
                  hypre__ny = (hypre__div + (((hypre__mod > hypre__block)?1 : 0)));
                }
                else if (hypre__dir == 2) {
                  loopk = ((hypre__block * hypre__div) + (((hypre__mod < hypre__block)?hypre__mod : hypre__block)));
                  hypre__nz = (hypre__div + (((hypre__mod > hypre__block)?1 : 0)));
                }
                Ai = (((hypre__i1start + (loopi * hypre__sx1)) + (loopj * hypre__sy1)) + (loopk * hypre__sz1));
                xi = (((hypre__i2start + (loopi * hypre__sx2)) + (loopj * hypre__sy2)) + (loopk * hypre__sz2));
                ri = (((hypre__i3start + (loopi * hypre__sx3)) + (loopj * hypre__sy3)) + (loopk * hypre__sz3));
/* CORE LOOP BEGIN */
                (hypre__sx1 == 1)?0 : ((__assert_fail(("hypre__sx1 == 1"),("/home/liao6/svnrepos/benchmarks/smg2000/struct_ls/smg_residual.c"),(689),("int hypre_SMGResidual(void *, struct hypre_StructMatrix_struct *, struct hypre_StructVector_struct *, struct hypre_StructVector_struct *, struct hypre_StructVector_struct *)")) , 0));
                (hypre__sx2 == 1)?0 : ((__assert_fail(("hypre__sx2 == 1"),("/home/liao6/svnrepos/benchmarks/smg2000/struct_ls/smg_residual.c"),(690),("int hypre_SMGResidual(void *, struct hypre_StructMatrix_struct *, struct hypre_StructVector_struct *, struct hypre_StructVector_struct *, struct hypre_StructVector_struct *)")) , 0));
                (hypre__sx3 == 1)?0 : ((__assert_fail(("hypre__sx3 == 1"),("/home/liao6/svnrepos/benchmarks/smg2000/struct_ls/smg_residual.c"),(691),("int hypre_SMGResidual(void *, struct hypre_StructMatrix_struct *, struct hypre_StructVector_struct *, struct hypre_StructVector_struct *, struct hypre_StructVector_struct *)")) , 0));
{
/* In essence, this loop computes:
                   *
                   FOR_ALL i, j, k DO
                   rp[ri + i + j*DJ_R + k*DK_R]
                   -= Ap[Ai + i + j*DJ_A + k*DK_A]
                   * xp[xi + i + j*DJ_X + k*DK_X];
                   */
// 1. promoting loop invariant expressions
// j loop increment for Ai, xi, and ri
                  int DJA0 = (hypre__sy1 - (hypre__nx * hypre__sx1));
                  int DJX0 = (hypre__sy2 - (hypre__nx * hypre__sx2));
                  int DJR0 = (hypre__sy3 - (hypre__nx * hypre__sx3));
// k loop increment for Ai, xi, and ri
                  int DKA0 = (hypre__sz1 - (hypre__ny * hypre__sy1));
                  int DKX0 = (hypre__sz2 - (hypre__ny * hypre__sy2));
                  int DKR0 = (hypre__sz3 - (hypre__ny * hypre__sy3));
// pre-compute array index offset changes for one iteration within each level of loop
// one iteration of j loop on ri
                  int DJR1 = (DJR0 + (hypre__nx * hypre__sx3));
// one iteration of k loop on ri
                  int DKR1 = (DKR0 + (hypre__ny * DJR1));
// one iteration of j loop on Ai
                  int DJA1 = (DJA0 + (hypre__nx * hypre__sx1));
// one iteration of k loop on Ai
                  int DKA1 = (DKA0 + (hypre__ny * DJA1));
// one iteration of j loop on xi
                  int DJX1 = (DJX0 + (hypre__nx * hypre__sx2));
// one iteration of k loop on xi
                  int DKX1 = (DKX0 + (hypre__ny * DJX1));
                  for (loopk = 0; loopk < hypre__nz; loopk++) {
                    for (loopj = 0; loopj < hypre__ny; loopj++) {
                      for (loopi = 0; loopi < hypre__nx; loopi++) {{
                          rp[((ri + (loopi * hypre__sx1)) + (loopj * DJR1)) + (loopk * DKR1)] -= ((Ap[((Ai + (loopi * hypre__sx1)) + (loopj * DJA1)) + (loopk * DKA1)]) * (xp[((xi + (loopi * hypre__sx2)) + (loopj * DJX1)) + (loopk * DKX1)]));
//rp[ri] -= Ap[Ai] * xp[xi];
                        }
//Ai += hypre__sx1; // 2. merging loop index changes
//xi += hypre__sx2;
//ri += hypre__sx3;
                      }
//Ai += DJA0;//(hypre__sy1 - (hypre__nx * hypre__sx1));
//xi += DJX0;//(hypre__sy2 - (hypre__nx * hypre__sx2));
//ri += DJR0;//(hypre__sy3 - (hypre__nx * hypre__sx3));
                    }
//Ai += DKA0;//(hypre__sz1 - (hypre__ny * hypre__sy1));
//xi += DKX0; //(hypre__sz2 - (hypre__ny * hypre__sy2));
//ri += DKR0;//(hypre__sz3 - (hypre__ny * hypre__sy3));
                  }
                }
/* CORE LOOP END */
/* hypre__block */
              }
/* si */
            }
/* else hypre__num_blocks > 1 */
          }
/* j */
        }
      }
/* i */
    }
/* compute_i */
  }
  hypre_IncFLOPCount((residual_data -> flops));
  hypre_EndTiming((residual_data -> time_index));
  return ierr;
}
Ejemplo n.º 26
0
Archivo: lib.c Proyecto: Linhos13/svc15
void __VERIFIER_error(void)
{
	/* FILE and LINE will be wrong, but that doesn't matter, klee will
	   replace this call by its own handler anyway */
	__assert_fail("verifier assertion failed", __FILE__, __LINE__, __func__);
}
char *get_tag(char *tag , int tagbuf_len ) 
{ char *tag_val ;
  char c ;
  char term ;
  int t ;
  int tmp ;
  int tmp___0 ;
  int tmp___1 ;
  int tmp___2 ;
  int tmp___3 ;
  int tmp___4 ;
  int tmp___5 ;
  int tmp___6 ;
  int tmp___7 ;
  int tmp___8 ;
  int tmp___9 ;
  int tmp___10 ;
  int tmp___11 ;
  int tmp___12 ;
  int __cil_tmp21 ;
  int __cil_tmp22 ;
  int __cil_tmp23 ;
  void *__cil_tmp24 ;
  char *__cil_tmp25 ;
  void *__cil_tmp26 ;
  int __cil_tmp27 ;
  char *__cil_tmp28 ;
  char *__cil_tmp29 ;
  int __cil_tmp30 ;
  void *__cil_tmp31 ;
  int __cil_tmp32 ;
  int __cil_tmp33 ;
  void *__cil_tmp34 ;
  char *__cil_tmp35 ;
  void *__cil_tmp36 ;
  int __cil_tmp37 ;
  int __cil_tmp38 ;
  int __cil_tmp39 ;
  int __cil_tmp40 ;
  char *__cil_tmp41 ;
  char *__cil_tmp42 ;
  void *__cil_tmp43 ;
  int __cil_tmp44 ;
  int __cil_tmp45 ;
  int __cil_tmp46 ;
  char *__cil_tmp47 ;
  char *__cil_tmp48 ;

  {
#line 9
  t = 0;
#line 11
  tagbuf_len = tagbuf_len - 1;
  {
#line 13
  while (1) {
    while_0_continue: /* CIL Label */ ;
    {
#line 14
    tmp = __VERIFIER_nondet_char();
#line 14
    c = (char )tmp;
#line 13
    tmp___0 = ap_isspace(c);
    }
#line 13
    if (tmp___0) {

    } else {
      goto while_0_break;
    }
  }
  while_0_break: /* CIL Label */ ;
  }
  {
#line 17
  __cil_tmp21 = (int )c;
#line 17
  if (__cil_tmp21 == 45) {
    {
#line 18
    tmp___1 = __VERIFIER_nondet_char();
#line 18
    c = (char )tmp___1;
    }
    {
#line 19
    __cil_tmp22 = (int )c;
#line 19
    if (__cil_tmp22 == 45) {
      {
#line 20
      while (1) {
        while_1_continue: /* CIL Label */ ;
        {
#line 21
        tmp___2 = __VERIFIER_nondet_char();
#line 21
        c = (char )tmp___2;
#line 20
        tmp___3 = ap_isspace(c);
        }
#line 20
        if (tmp___3) {

        } else {
          goto while_1_break;
        }
      }
      while_1_break: /* CIL Label */ ;
      }
      {
#line 23
      __cil_tmp23 = (int )c;
#line 23
      if (__cil_tmp23 == 62) {
        {
#line 24
        ap_cpystrn(tag, "done", tagbuf_len);
        }
#line 25
        return (tag);
      } else {

      }
      }
    } else {

    }
    }
    {
#line 28
    __cil_tmp24 = (void *)0;
#line 28
    return ((char *)__cil_tmp24);
    }
  } else {

  }
  }
  {
#line 31
  while (1) {
    while_2_continue: /* CIL Label */ ;
#line 32
    if (t == tagbuf_len) {
#line 33
      __cil_tmp25 = tag + t;
#line 33
      *__cil_tmp25 = (char)0;
      {
#line 34
      __cil_tmp26 = (void *)0;
#line 34
      return ((char *)__cil_tmp26);
      }
    } else {

    }
    {
#line 36
    __cil_tmp27 = (int )c;
#line 36
    if (__cil_tmp27 == 61) {
      goto while_2_break;
    } else {
      {
#line 36
      tmp___4 = ap_isspace(c);
      }
#line 36
      if (tmp___4) {
        goto while_2_break;
      } else {

      }
    }
    }
    {
#line 39
    tmp___5 = ap_tolower(c);
#line 39
    __cil_tmp28 = tag + t;
#line 39
    *__cil_tmp28 = (char )tmp___5;
#line 40
    t = t + 1;
#line 41
    tmp___6 = __VERIFIER_nondet_char();
#line 41
    c = (char )tmp___6;
    }
  }
  while_2_break: /* CIL Label */ ;
  }
#line 44
  __cil_tmp29 = tag + t;
#line 44
  *__cil_tmp29 = (char)0;
#line 45
  t = t + 1;
#line 46
  tag_val = tag + t;
  {
#line 48
  while (1) {
    while_3_continue: /* CIL Label */ ;
    {
#line 48
    tmp___8 = ap_isspace(c);
    }
#line 48
    if (tmp___8) {

    } else {
      goto while_3_break;
    }
    {
#line 49
    tmp___7 = __VERIFIER_nondet_char();
#line 49
    c = (char )tmp___7;
    }
  }
  while_3_break: /* CIL Label */ ;
  }
  {
#line 51
  __cil_tmp30 = (int )c;
#line 51
  if (__cil_tmp30 != 61) {
    {
#line 52
    __cil_tmp31 = (void *)0;
#line 52
    return ((char *)__cil_tmp31);
    }
  } else {

  }
  }
  {
#line 55
  while (1) {
    while_4_continue: /* CIL Label */ ;
    {
#line 56
    tmp___9 = __VERIFIER_nondet_char();
#line 56
    c = (char )tmp___9;
#line 55
    tmp___10 = ap_isspace(c);
    }
#line 55
    if (tmp___10) {

    } else {
      goto while_4_break;
    }
  }
  while_4_break: /* CIL Label */ ;
  }
  {
#line 59
  __cil_tmp32 = (int )c;
#line 59
  if (__cil_tmp32 != 34) {
    {
#line 59
    __cil_tmp33 = (int )c;
#line 59
    if (__cil_tmp33 != 39) {
      {
#line 60
      __cil_tmp34 = (void *)0;
#line 60
      return ((char *)__cil_tmp34);
      }
    } else {

    }
    }
  } else {

  }
  }
#line 62
  term = c;
  {
#line 63
  while (1) {
    while_5_continue: /* CIL Label */ ;
    {
#line 64
    tmp___11 = __VERIFIER_nondet_char();
#line 64
    c = (char )tmp___11;
    }
#line 65
    if (t == tagbuf_len) {
#line 66
      __cil_tmp35 = tag + t;
#line 66
      *__cil_tmp35 = (char)0;
      {
#line 67
      __cil_tmp36 = (void *)0;
#line 67
      return ((char *)__cil_tmp36);
      }
    } else {

    }
    {
#line 70
    __cil_tmp37 = (int )c;
#line 70
    if (__cil_tmp37 == 92) {
      {
#line 71
      tmp___12 = __VERIFIER_nondet_char();
#line 71
      c = (char )tmp___12;
      }
      {
#line 72
      __cil_tmp38 = (int )term;
#line 72
      __cil_tmp39 = (int )c;
#line 72
      if (__cil_tmp39 != __cil_tmp38) {
        {
#line 74
        __cil_tmp40 = t + 1;
#line 74
        if (__cil_tmp40 < tagbuf_len) {

        } else {
          {
#line 74
          __assert_fail("t + 1 < tagbuf_len", "../versisec/apache/progs/apacheCVE-2004-0940get_tag_iter1_prefixLong_arr_ok.c",
                        74U, "get_tag");
          }
        }
        }
#line 77
        __cil_tmp41 = tag + t;
#line 77
        *__cil_tmp41 = (char )'\\';
#line 78
        t = t + 1;
#line 79
        if (t == tagbuf_len) {
#line 81
          __cil_tmp42 = tag + t;
#line 81
          *__cil_tmp42 = (char)0;
          {
#line 82
          __cil_tmp43 = (void *)0;
#line 82
          return ((char *)__cil_tmp43);
          }
        } else {

        }
      } else {

      }
      }
    } else {
      {
#line 86
      __cil_tmp44 = (int )term;
#line 86
      __cil_tmp45 = (int )c;
#line 86
      if (__cil_tmp45 == __cil_tmp44) {
        goto while_5_break;
      } else {

      }
      }
    }
    }
    {
#line 91
    __cil_tmp46 = t + 2;
#line 91
    if (__cil_tmp46 < tagbuf_len) {

    } else {
      {
#line 91
      __assert_fail("t + 2 < tagbuf_len", "../versisec/apache/progs/apacheCVE-2004-0940get_tag_iter1_prefixLong_arr_ok.c",
                    91U, "get_tag");
      }
    }
    }
#line 94
    __cil_tmp47 = tag + t;
#line 94
    *__cil_tmp47 = c;
#line 95
    t = t + 1;
  }
  while_5_break: /* CIL Label */ ;
  }
#line 99
  __cil_tmp48 = tag + t;
#line 99
  *__cil_tmp48 = (char)0;
#line 101
  return (tag);
}
}
Ejemplo n.º 28
0
static void cut_fields(FILE *stream ) 
{ int c ;
  size_t field_idx ;
  _Bool found_any_selected_field ;
  _Bool buffer_first_field ;
  _Bool tmp ;
  int tmp___0 ;
  ssize_t len ;
  size_t n_bytes ;
  int tmp___1 ;
  int tmp___2 ;
  unsigned char tmp___3 ;
  _Bool tmp___4 ;
  _Bool tmp___5 ;

  {
  field_idx = 1UL;
  found_any_selected_field = (_Bool)0;
  c = getc_unlocked(stream);
  if (c == -1) {
    return;
  } else {

  }
  ungetc(c, stream);
  tmp = print_kth(1UL, (_Bool *)((void *)0));
  if (tmp) {
    tmp___0 = 0;
  } else {
    tmp___0 = 1;
  }
  buffer_first_field = (_Bool )((int )suppress_non_delimited ^ tmp___0);
  while (1) {
    if (field_idx == 1UL) {
      if (buffer_first_field) {
        len = getndelim2(& field_1_buffer, & field_1_bufsize, 0UL, 4294967295UL, (int )delim, '\n', stream);
        if (len < 0L) {
          free((void *)field_1_buffer);
          field_1_buffer = (char *)((void *)0);
          tmp___1 = ferror_unlocked(stream);
          if (tmp___1) {
            break;
          } else {
            tmp___2 = feof_unlocked(stream);
            if (tmp___2) {
              break;
            } else {

            }
          }
          xalloc_die();
        } else {

        }
        n_bytes = (unsigned long )len;
        if (! (n_bytes != 0UL)) {
          __assert_fail("n_bytes != 0", "cut.c", 626U, "cut_fields");
        } else {

        }
        tmp___3 = to_uchar(*(field_1_buffer + (n_bytes - 1UL)));
        if ((int )tmp___3 != (int )delim) {
          if (! suppress_non_delimited) {
            fwrite_unlocked((void const   */* __restrict  */)field_1_buffer, sizeof(char ), n_bytes, (FILE */* __restrict  */)stdout);
            if ((int )*(field_1_buffer + (n_bytes - 1UL)) != 10) {
              putchar_unlocked('\n');
            } else {

            }
          } else {

          }
          continue;
        } else {

        }
        tmp___4 = print_kth(1UL, (_Bool *)((void *)0));
        if (tmp___4) {
          fwrite_unlocked((void const   */* __restrict  */)field_1_buffer, sizeof(char ), n_bytes - 1UL, (FILE */* __restrict  */)stdout);
          found_any_selected_field = (_Bool)1;
        } else {

        }
        field_idx ++;
      } else {

      }
    } else {

    }
    if (c != -1) {
      tmp___5 = print_kth(field_idx, (_Bool *)((void *)0));
      if (tmp___5) {
        if (found_any_selected_field) {
          fwrite_unlocked((void const   */* __restrict  */)output_delimiter_string, sizeof(char ), output_delimiter_length, (FILE */* __restrict  */)stdout);
        } else {

        }
        found_any_selected_field = (_Bool)1;
        while (1) {
          c = getc_unlocked(stream);
          if (c != (int )delim) {
            if (c != 10) {
              if (! (c != -1)) {
                break;
              } else {

              }
            } else {
              break;
            }
          } else {
            break;
          }
          putchar_unlocked(c);
        }
      } else {
        while (1) {
          c = getc_unlocked(stream);
          if (c != (int )delim) {
            if (c != 10) {
              if (! (c != -1)) {
                break;
              } else {

              }
            } else {
              break;
            }
          } else {
            break;
          }
        }
      }
    } else {

    }
    if (c == 10) {
      c = getc_unlocked(stream);
      if (c != -1) {
        ungetc(c, stream);
        c = '\n';
      } else {

      }
    } else {

    }
    if (c == (int )delim) {
      field_idx ++;
    } else {
      if (c == 10) {
        goto _L;
      } else {
        if (c == -1) {
          _L: 
          if (found_any_selected_field) {
            putchar_unlocked('\n');
          } else {
            if (suppress_non_delimited) {
              if (! (field_idx == 1UL)) {
                putchar_unlocked('\n');
              } else {

              }
            } else {
              putchar_unlocked('\n');
            }
          }
          if (c == -1) {
            break;
          } else {

          }
          field_idx = 1UL;
          found_any_selected_field = (_Bool)0;
        } else {

        }
      }
    }
  }
  return;
}
}
Ejemplo n.º 29
0
void
__assert (const char *assertion, const char *file, int line)
{
  __assert_fail (assertion, file, line, (const char *) 0);
}
Ejemplo n.º 30
0
void TestFail (const char* msg, const char* file, int line, const char* pf) {
  __assert_fail (msg, file, line, pf);
}