Exemple #1
0
void
mapscreens(void) {
	WMScreen *s, *ss;
	Rectangle r;
	int i, j;

#define frob(left, min, max, x, y) \
	if(Dy(r) > 0) /* If they intersect at some point on this axis */        \
	if(ss->r.min.x < s->r.min.x) {                                          \
		if((!s->left)                                                   \
		|| (abs(Dy(r)) < abs(s->left.max.x - s->min.x))) \
			s->left = ss;                                           \
	}

	/* Variable hell? Certainly. */
	for(i=0; i < nscreens; i++) {
		s = screens[i];
		for(j=0; j < nscreens; j++) {
			if(i == j)
				continue;
			ss = screens[j];
			r = rect_intersection(ss->r, s->r);
			frob(left,   min, max, x, y);
			frob(right,  max, min, x, y);
			frob(atop,   min, max, y, x);
			frob(below,  max, min, y, x);
		}
	}
#undef frob
}
void
rhs_to_tree (int x, int z)
{
  if (x >= 4)
    frob ();
  if (x >= 3)
    frob ();
}
Exemple #3
0
test_3 (int code)
{
  char *temp = frob ();
  int rotate = (code == 22);
  if (!rotate || temp == 0)
    oof ();
}
sss (rtx insn, int code1, int code2, int code3)
{
  _Bool D1562;
  struct rtx_def * body;
  int i;
  int n_sets;
  int D1544;

  body = insn->u.fld[5].rt_rtx;
  D1544 = body->code;
  n_sets = 1;
  if (D1544 == 55) goto L7; else goto L1;

L1:
  n_sets = 0;
  if (code3 == 99) goto L2; else goto L11;

L2:
  D1562 = code1 == 10;
  n_sets = (int) D1562;
  if (n_sets > 0) goto L7; else goto L11;

L37:
  if (code2 == 42) goto L8; else goto L9;

L8:
  arf ();

L9:
  i = i + 1;
  if (i < n_sets) goto L37; else goto L32;

L32:

L11:
  if (n_sets > 1) goto L12; else goto L15;

L12:
  nit ();

L14:
  i = 0;
  goto L38;

L15:
  if (n_sets > 0) goto L14; else goto L16;

L38:
  frob ();
  i = i + 1;
  if (n_sets > i) goto L38; else goto L16;

L16:
  return;

L7:
  i = 0;
  goto L37;

}
Exemple #5
0
test (int code)
{
  char *temp = frob ();
  int rotate = (code == 22);
  if (temp == 0 && !rotate)
    oof ();
}
Exemple #6
0
int func (char *input)
{
	int x = frob();

	if (a == 1) {
		if (x != -5)
			return;
	} else if (a == 2) {
		if (x != 0)
			return;
	} else if (a == 3) {
		if (x != 42)
			return;
	} else {
		return;
	}

	if (x) {
		__smatch_implied(x);
		__smatch_implied(a);
	}

	if (x == -5)
		__smatch_implied(a);

	return 0;
}
Exemple #7
0
void
test_4 (int code)
{
  char *temp = frob ();
  int rotate = (code == 22);
  if (temp == 0 || !rotate)
    oof ();
}
Exemple #8
0
void
test_2 (int code)
{
  char *temp = frob ();
  int rotate = (code == 22);
  if (!rotate && temp == 0)
    oof ();
}
int main(void)
{
  int i; 
  printf("i = %d\n", i); /* { dg-warning "'i' is used uninitialized in this function" } */
  frob(&i);

  return 0;
}
Exemple #10
0
int main (void)
{
  e = 3;
  if (frob (0, 2) != 0 || g != 1 || p != 2 || e != 3
      || get_n () != 1
      || g != 2 || p != 2)
    abort ();
  exit (0);
}
Exemple #11
0
int
main(void)
{
    int i, result;
    flint_rand_t state;

    _randinit(state);

    {
        const char *str = 
            "3  [5 0 0] [0 5 0] [0 0 5] (2  0 1)[1 1 3]";
        const long n = atoi(str) - 1;

        mpoly_t P;
        ctx_t ctxFracQt;
        qadic_ctx_t Qq;
        fmpz_t p  = {3L};
        long d    = 40;
        qadic_t t1;
        prec_t prec, prec_in;

/*
prec_in.N0   = 9;
prec_in.N1   = 9;
prec_in.N2   = 9;
prec_in.N3   = 13;
prec_in.N3i  = 14;
prec_in.N3w  = 23;
prec_in.N3iw = 22;
prec_in.N4   = 18;
prec_in.m    = 29;
prec_in.K    = 178;
prec_in.r    = 0;
prec_in.s    = 0;
 */

        ctx_init_fmpz_poly_q(ctxFracQt);
        qadic_ctx_init_conway(Qq, p, d, 1, 1, "X", PADIC_SERIES);

        qadic_init2(t1, 1);
        qadic_gen(t1, Qq);

        mpoly_init(P, n + 1, ctxFracQt);
        mpoly_set_str(P, str, ctxFracQt);

        frob(P, ctxFracQt, t1, Qq, &prec, NULL, 1);

        qadic_clear(t1);
        mpoly_clear(P, ctxFracQt);
        ctx_clear(ctxFracQt);
        qadic_ctx_clear(Qq);
    }

    _randclear(state);
    _fmpz_cleanup();
    return EXIT_SUCCESS;
}
Exemple #12
0
void func (void)
{
	if (x)
		free(x);
	if (y)
		frob(y);
	free(y);
	if (z) {
		free(z);
	}
}
void
find_unreachable_blocks (int frobit)
{
  basic_block *tos, *worklist, bb;
  tos = worklist = xmalloc (sizeof (basic_block) * n_basic_blocks);
  edge e = frob();
  if (!(e->dest->flags & 4))
    {
      e->dest->flags |= 4;
      *tos++ = e->dest;
    }
}
Exemple #14
0
int main(void)
{
	printf("Sending raw length 69,105....\n");
	int raw_ret = raw(69105.0);
	printf("Received %d in return.\n", raw_ret);
	
	printf("Frobbing with length 69,105...\n");
	hundredths_t frob_ret = frob(69105.0);
	printf("Received %f hundredths in return.\n", frob_ret);
	
	return 0;
}
Exemple #15
0
int
main(void)
{
    int i, result;
    flint_rand_t state;

    _randinit(state);

    /*
        A generic sextic curve.
     */

    {
        const char *str = 
            "3  [6 0 0] [0 6 0] [0 0 6] "
            "(2  0 -1)[5 1 0] (2  0 7)[5 0 1] (2  0 2)[1 5 0] (2  0 1)[0 5 1] (2  0 2)[1 0 5] (2  0 1)[0 1 5] "
            "(2  0 2)[4 2 0] (2  0 2)[4 0 2] (2  0 3)[2 4 0] (2  0 1)[0 4 2] (2  0 3)[2 0 4] (2  0 1)[0 2 4] "
            "(2  0 3)[4 1 1] (2  0 3)[1 4 1] (2  0 1)[1 1 4] "
            "(2  0 -1)[3 3 0] (2  0 -2)[3 0 3] (2  0 4)[0 3 3] "
            "(2  0 2)[3 2 1] (2  0 1)[3 1 2] (2  0 -1)[2 3 1] (2  0 1)[1 3 2] (2  0 2)[2 1 3] (2  0 1)[1 2 3] "
            "(2  0 1)[2 2 2]";
        const long n = atoi(str) - 1;

        mpoly_t P;
        ctx_t ctxFracQt;
        qadic_ctx_t Qq;
        fmpz_t p  = {5L};
        long d    = 1;
        qadic_t t1;
        prec_t prec, prec_in;

        ctx_init_fmpz_poly_q(ctxFracQt);
        qadic_ctx_init_conway(Qq, p, d, 1, 1, "X", PADIC_SERIES);

        qadic_init2(t1, 1);
        qadic_set_ui(t1, 2, Qq);

        mpoly_init(P, n + 1, ctxFracQt);
        mpoly_set_str(P, str, ctxFracQt);

        frob(P, ctxFracQt, t1, Qq, &prec, NULL, 1);

        qadic_clear(t1);
        mpoly_clear(P, ctxFracQt);
        ctx_clear(ctxFracQt);
        qadic_ctx_clear(Qq);
    }

    _randclear(state);
    _fmpz_cleanup();
    return EXIT_SUCCESS;
}
Exemple #16
0
unsigned int f(int *devspec, unsigned int addr)
{
 reg_gio_rw_i2c1_ctrl ctrl = {0};
 reg_gio_rw_i2c1_data data = {0};

 foobar();

 static int first = 1;

 if (first) {
  reg_gio_rw_i2c1_cfg cfg = {0};
  first = 0;

  foo(1);
  cfg.sda0_idle = 1;
  cfg.sda0_io = 0;
  cfg.scl_inv = 0;
  cfg.scl_io = 0;
  cfg.bit_order = 1;
  cfg.sda_sel = 0;
  cfg.sen_sel = 0;
  cfg.en = 1;
  reg_gio = cfg;
 }

 ctrl.freq = 1;
 ctrl.start_bit = 0;
 ctrl.ack_bit = 1;
 ctrl.ack_dir0 = 0;
 ctrl.ack_dir1 = 0;
 ctrl.ack_dir2 = 0;
 ctrl.ack_dir3 = 1;
 ctrl.ack_dir4 = 0;
 ctrl.ack_dir5 = 0;
 ctrl.start_stop = 1;
 ctrl.early_end = 0;
 ctrl.extra_start = 2;
 ctrl.switch_dir = 8*3;
 ctrl.trf_bits = 8*4;
 reg_ctrl = ctrl;
 frob(0xac);
 data.data0 = devspec[1] & 192;
 data.data1 = addr;
 data.data2 = devspec[1] | 0x01;
 reg_data = data;
 reg_start = 1;
 bar(100);
 data = reg_data;
 baz();

 return data.data3;
}
Exemple #17
0
int
main(void)
{
    int i, result;
    flint_rand_t state;

    _randinit(state);

    /*
        A quartic surface from Example 4.2.1 in [AKR].

        TODO:  This currently still fails!
     */

    {
        const char *str = 
            "4  (2  2 -1)[4 0 0 0] [0 4 0 0] [0 0 4 0] [0 0 0 4] "
            "(2  0 -1)[0 1 3 0] (2  0 1)[1 1 2 0] (2  0 1)[1 1 1 1] "
            "(2  0 1)[2 1 1 0] (2  0 -1)[2 1 0 1] (2  0 1)[1 0 3 0] (2  0 -1)[1 0 2 1]";

        const long n = atoi(str) - 1;

        mpoly_t P;
        ctx_t ctxFracQt;
        qadic_ctx_t Qq;
        fmpz_t p  = {3L};
        long d    = 2;
        qadic_t t1;
        prec_t prec, prec_in;

        ctx_init_fmpz_poly_q(ctxFracQt);
        qadic_ctx_init_conway(Qq, p, d, 1, 1, "X", PADIC_SERIES);

        qadic_init2(t1, 1);
        qadic_gen(t1, Qq);

        mpoly_init(P, n + 1, ctxFracQt);
        mpoly_set_str(P, str, ctxFracQt);

        frob(P, ctxFracQt, t1, Qq, &prec, NULL, 1);

        qadic_clear(t1);
        mpoly_clear(P, ctxFracQt);
        ctx_clear(ctxFracQt);
        qadic_ctx_clear(Qq);
    }

    _randclear(state);
    _fmpz_cleanup();
    return EXIT_SUCCESS;
}
Exemple #18
0
int
findscreen(Rectangle rect, int direction) {
	Rectangle r;
	WMScreen *ss, *s;
	int best, i, j;

	best = -1;
#define frob(min, max, x, y)
	if(Dy(r) > 0) /* If they intersect at some point on this axis */
	if(ss->r.min.x < rect.min.x) {
		if(best == -1
		|| (abs(ss->r.max.x - rect.min.x) < abs(screens[best]->r.max.x - rect.min.x)))
			best = s->idx;
	}

	/* Variable hell? Certainly. */
	for(i=0; i < nscreens; i++) {
		ss = screens[j];
		r = rect_intersection(ss->r, rect);
		switch(direction) {
		default:
			return -1;
		case West:
			frob(min, max, x, y);
			break;
		case East:
			frob(max, min, x, y);
			break;
		case North:
			frob(min, max, y, x);
			break;
		case South:
			frob(max, min, y, x);
			break;
		}
	}
#undef frob
}
Exemple #19
0
static int options_write(void)
{
	if (x & y == 0)
		frob();
	if (x | y == 0)
		frob();
	if (a == b & c == d)
		frob();
	if (a == c == d)
		frob();
	if (!a == b)
		frob();
	c = !a & b;
	if (x + y == 0)
		frob();
	if (!a == !b)
		frob();
	if (!a == z->x)
		frob();
	if (!!a == b)
		frob();

}
void
another_unregistered_pointer (void)
{
  double X[] = { 1, 2, 3, 4 };
  double *Y;

  Y = malloc (123 * sizeof *Y);
  if (Y == NULL)
    return;
  else
    {
      extern void frob (double *);
      frob (Y);
    }
  X[0] = 42;

#pragma starpu register Y 123
  my_task (X, Y);		      /* (warning "X.* used unregistered") */
}
Exemple #21
0
int
main(void)
{
    int i, result;
    flint_rand_t state;

    _randinit(state);

    {
        const char *str = 
            "4  [5 0 0 0] [0 5 0 0] [0 0 5 0] [0 0 0 5] (2  0 1)[2 1 1 1]";
        const long n = atoi(str) - 1;

        mpoly_t P;
        ctx_t ctxFracQt;
        qadic_ctx_t Qq;
        fmpz_t p  = {2L};
        long d    = 10;
        qadic_t t1;
        prec_t prec, prec_in;

        ctx_init_fmpz_poly_q(ctxFracQt);
        qadic_ctx_init_conway(Qq, p, d, 1, 1, "X", PADIC_SERIES);

        qadic_init2(t1, 1);
        qadic_gen(t1, Qq);

        mpoly_init(P, n + 1, ctxFracQt);
        mpoly_set_str(P, str, ctxFracQt);

        frob(P, ctxFracQt, t1, Qq, &prec, NULL, 1);

        qadic_clear(t1);
        mpoly_clear(P, ctxFracQt);
        ctx_clear(ctxFracQt);
        qadic_ctx_clear(Qq);
    }

    _randclear(state);
    _fmpz_cleanup();
    return EXIT_SUCCESS;
}
Exemple #22
0
// Extract digits from fully packed slots, multithreaded version
void extractDigitsPacked(Ctxt& ctxt, long botHigh, long r, long ePrime,
			 const vector<ZZX>& unpackSlotEncoding)
{
  FHE_TIMER_START;

  // Step 1: unpack the slots of ctxt
  FHE_NTIMER_START(unpack);
  ctxt.cleanUp();

  // Apply the d automorphisms and store them in scratch area
  long d = ctxt.getContext().zMStar.getOrdP();

  vector<Ctxt> unpacked(d, Ctxt(ZeroCtxtLike, ctxt));
  { // explicit scope to force all temporaries to be released
    vector< shared_ptr<DoubleCRT> > coeff_vector;
    coeff_vector.resize(d);

    FHE_NTIMER_START(unpack1);
    for (long i = 0; i < d; i++)
      coeff_vector[i] = shared_ptr<DoubleCRT>(new 
        DoubleCRT(unpackSlotEncoding[i], ctxt.getContext(), ctxt.getPrimeSet()) );
    FHE_NTIMER_STOP(unpack1);

    FHE_NTIMER_START(unpack2);
    vector<Ctxt> frob(d, Ctxt(ZeroCtxtLike, ctxt));

    NTL_EXEC_RANGE(d, first, last)
    // FIXME: implement using hoisting!
        for (long j = first; j < last; j++) { // process jth Frobenius 
          frob[j] = ctxt;
          frob[j].frobeniusAutomorph(j);
          frob[j].cleanUp();
          // FIXME: not clear if we should call cleanUp here
        }
    NTL_EXEC_RANGE_END

    FHE_NTIMER_STOP(unpack2);

    FHE_NTIMER_START(unpack3);
    Ctxt tmp1(ZeroCtxtLike, ctxt);
    for (long i = 0; i < d; i++) {
      for (long j = 0; j < d; j++) {
        tmp1 = frob[j];
        tmp1.multByConstant(*coeff_vector[mcMod(i+j, d)]);
        unpacked[i] += tmp1;
      }
    }
    FHE_NTIMER_STOP(unpack3);
  }
  FHE_NTIMER_STOP(unpack);

  // Step 2: extract the digits top-1,...,0 from the slots of unpacked[i]
  long p = ctxt.getContext().zMStar.getP();
  long p2r = power_long(p,r);
  long topHigh = botHigh + r-1;

#ifdef DEBUG_PRINTOUT
  cerr << "+ After unpack ";
  decryptAndPrint(cerr, unpacked[0], *dbgKey, *dbgEa, printFlag);
  cerr << "    extracting "<<(topHigh+1)<<" digits\n";
#endif

  if (p==2 && r>2)
    topHigh--; // For p==2 we sometime get a bit for free

  FHE_NTIMER_START(extractDigits);

  NTL_EXEC_RANGE(d, first, last)
      for (long i = first; i < last; i++) {
        vector<Ctxt> scratch;
    
        if (topHigh<=0) { // extracting LSB = no-op
          scratch.assign(1,unpacked[i]);
        } else {          // extract digits topHigh...0, store them in scratch
          extractDigits(scratch, unpacked[i], topHigh+1);
        }

        // set upacked[i] = -\sum_{j=botHigh}^{topHigh} scratch[j] * p^{j-botHigh}
        if (topHigh >= (long)scratch.size()) {
          topHigh = scratch.size() -1;
          cerr << " @ suspect: not enough digits in extractDigitsPacked\n";
        }
    
        unpacked[i] = scratch[topHigh];
        for (long j=topHigh-1; j>=botHigh; --j) {
          unpacked[i].multByP();
          unpacked[i] += scratch[j];
        }
        if (p==2 && botHigh>0) {   // For p==2, subtract also the previous bit
          //cerr << scratch.size() << " " <<  botHigh-1 << "\n";
          unpacked.at(i) += scratch.at(botHigh-1);
        }
        unpacked[i].negate();
    
        if (r>ePrime) {          // Add in digits from the bottom part, if any
          long topLow = r-1 - ePrime;
          Ctxt tmp = scratch[topLow];
          for (long j=topLow-1; j>=0; --j) {
    	tmp.multByP();
    	tmp += scratch[j];
          }
          if (ePrime>0)
    	tmp.multByP(ePrime); // multiply by p^e'
          unpacked[i] += tmp;
        }
        unpacked[i].reducePtxtSpace(p2r); // Our plaintext space is now mod p^r
      }
  NTL_EXEC_RANGE_END

  FHE_NTIMER_STOP(extractDigits);

#ifdef DEBUG_PRINTOUT
  cerr << "+ Before repack ";
  decryptAndPrint(cerr, unpacked[0], *dbgKey, *dbgEa, printFlag);
#endif

  // Step 3: re-pack the slots
  FHE_NTIMER_START(repack);
  const EncryptedArray& ea2 = *ctxt.getContext().ea;
  ZZX xInSlots;
  vector<ZZX> xVec(ea2.size());
  ctxt = unpacked[0];
  for (long i=1; i<d; i++) {
    x2iInSlots(xInSlots, i, xVec, ea2);
    unpacked[i].multByConstant(xInSlots);
    ctxt += unpacked[i];
  }
  FHE_NTIMER_STOP(repack);
#ifdef DEBUG_PRINTOUT
  cerr << "+ After repack ";
  decryptAndPrint(cerr, ctxt, *dbgKey, *dbgEa, printFlag);
#endif
}
Exemple #23
0
void func (void)
{
	int test, test2;

	if (({int test = !!x; frob(); frob(); frob(); test;}))
Exemple #24
0
void foo(void) {
  float x[4];
  char y[__alignof__(x) == 16 ? 1 : -1];
  frob(y);
}
Exemple #25
0
static int
snap_hline(const Rectangle *rects, int nrect, int dx, const Rectangle *r, int y) {
	frob(y, x);
}
Exemple #26
0
static int
snap_vline(const Rectangle *rects, int nrect, int dx, const Rectangle *r, int x) {
	frob(x, y);
}
QByteArray Options::frobPassword(const QString& pw)
{
  QByteArray pwByteArray = pw.toUtf8();
  return frob(pwByteArray);
}
QString Options::unfrobPassword(QByteArray fpwByteArray)
{
  frob(fpwByteArray);
  return QString::fromUtf8(fpwByteArray.data(), fpwByteArray.size());
}