text: /*
  This is an autogenerated file, generated using the EzPC compiler.
  */
  #include<vector>
  #include<math.h>
  #include<cstdlib>
  #include<iostream>
  #include<fstream>
  
  using namespace std;
  
  uint32_t public_lrshift(uint32_t x, uint32_t y){
  return (x >> y);
  }
  
  int32_t public_lrshift(int32_t x, uint32_t y){
  return ((int32_t)(((uint32_t)x) >> y));
  }
  
  uint64_t public_lrshift(uint64_t x, uint64_t y){
  return (x >> y);
  }
  
  int64_t public_lrshift(int64_t x, uint64_t y){
  return ((int64_t)(((uint64_t)x) >> y));
  }
  
  template<typename T>
  vector<T> make_vector(size_t size) {
  return std::vector<T>(size);
  }
  
  template <typename T, typename... Args>
  auto make_vector(size_t first, Args... sizes)
  {
  auto inner = make_vector<T>(sizes...);
  return vector<decltype(inner)>(first, inner);
  }
  
  template<typename T>
  ostream& operator<< (ostream &os, const vector<T> &v)
  {
  for(auto it = v.begin (); it != v.end (); ++it) {
  os << *it << endl;
  }
  return os;
  }
  
  
  #include "ezpc.h"
  ABYParty *party;
  Circuit* ycirc;
  Circuit* acirc;
  Circuit* bcirc;
  uint32_t bitlen = 32;
  output_queue out_q;
  e_role role;
  
  share* signedgtbl(share* x, share* y){
  
  share* ux = x;
  
  share* uy = y;
  /* Temporary variable for sub-expression on source location: (25,28-25,33) */
  int32_t __tac_var1 = ( (int32_t)1 <<  (int32_t)31);
  /* Temporary variable for sub-expression on source location: (25,28-25,33) */
  share* __tac_var2 = put_cons32_gate(ycirc, __tac_var1);
  
  share* signBitX = ycirc->PutANDGate(x, __tac_var2);
  /* Temporary variable for sub-expression on source location: (26,28-26,33) */
  int32_t __tac_var3 = __tac_var1;
  /* Temporary variable for sub-expression on source location: (26,28-26,33) */
  share* __tac_var4 = __tac_var2;
  
  share* signBitY = ycirc->PutANDGate(y, __tac_var2);
  /* Temporary variable for sub-expression on source location: (27,10-27,29) */
  share* __tac_var5 = ycirc->PutXORGate(signBitX, signBitY);
  /* Temporary variable for sub-expression on source location: (27,33-27,35) */
  share* __tac_var6 = put_cons32_gate(ycirc,  (uint32_t)0);
  /* Temporary variable for sub-expression on source location: (27,9-27,35) */
  share* __tac_var7 = ycirc->PutGTGate(__tac_var5, __tac_var6);
  /* Temporary variable for sub-expression on source location: (27,52-27,54) */
  share* __tac_var8 = __tac_var6;
  /* Temporary variable for sub-expression on source location: (27,41-27,54) */
  share* __tac_var9 = ycirc->PutGTGate(signBitX, __tac_var6);
  /* Temporary variable for sub-expression on source location: (27,58-27,63) */
  share* __tac_var10 = put_cons1_gate(ycirc, 0);
  /* Temporary variable for sub-expression on source location: (27,66-27,70) */
  share* __tac_var11 = put_cons1_gate(ycirc, 1);
  /* Temporary variable for sub-expression on source location: (27,40-27,70) */
  share* __tac_var12 = ycirc->PutMUXGate(__tac_var10, __tac_var11, __tac_var9);
  /* Temporary variable for sub-expression on source location: (27,75-27,82) */
  share* __tac_var13 = ycirc->PutGTGate(ux, uy);
  /* Temporary variable for sub-expression on source location: (27,8-27,83) */
  share* __tac_var14 = ycirc->PutMUXGate(__tac_var12, __tac_var13, __tac_var7);
  return __tac_var14;
  }
  
  share* signedarshiftbl(share* x, uint32_t y){
  
  share* ux = x;
  /* Temporary variable for sub-expression on source location: (35,28-35,33) */
  int32_t __tac_var15 = ( (int32_t)1 <<  (int32_t)31);
  /* Temporary variable for sub-expression on source location: (35,28-35,33) */
  share* __tac_var16 = put_cons32_gate(ycirc, __tac_var15);
  
  share* signBitX = ycirc->PutANDGate(x, __tac_var16);
  /* Temporary variable for sub-expression on source location: (36,21-36,23) */
  share* __tac_var17 = put_cons32_gate(ycirc,  (uint32_t)0);
  /* Temporary variable for sub-expression on source location: (36,10-36,23) */
  share* __tac_var18 = ycirc->PutGTGate(signBitX, __tac_var17);
  /* Temporary variable for sub-expression on source location: (36,28-36,30) */
  share* __tac_var19 = __tac_var17;
  /* Temporary variable for sub-expression on source location: (36,35-36,37) */
  share* __tac_var20 = __tac_var17;
  /* Temporary variable for sub-expression on source location: (36,35-36,42) */
  share* __tac_var21 = ycirc->PutSUBGate(__tac_var17, ux);
  /* Temporary variable for sub-expression on source location: (36,34-36,48) */
  share* __tac_var22 = arithmetic_right_shift(ycirc, __tac_var21, y);
  /* Temporary variable for sub-expression on source location: (36,28-36,49) */
  share* __tac_var23 = ycirc->PutSUBGate(__tac_var17, __tac_var22);
  /* Temporary variable for sub-expression on source location: (36,54-36,61) */
  share* __tac_var24 = arithmetic_right_shift(ycirc, ux, y);
  /* Temporary variable for sub-expression on source location: (36,9-36,62) */
  share* __tac_var25 = ycirc->PutMUXGate(__tac_var23, __tac_var24, __tac_var18);
  return __tac_var25;
  }
  
  share* unsignedltbl(share* x, share* y){
  /* Temporary variable for sub-expression on source location: (40,9-40,14) */
  share* __tac_var26 = ycirc->PutGTGate(y, x);
  return __tac_var26;
  }
  
  share* signedltbl(share* x, share* y){
  /* Temporary variable for sub-expression on source location: (43,9-43,14) */
  share* __tac_var27 = signedgtbl(y, x);
  return __tac_var27;
  }
  
  share* unsignedleqbl(share* x, share* y){
  /* Temporary variable for sub-expression on source location: (47,10-47,15) */
  share* __tac_var28 = ycirc->PutGTGate(x, y);
  /* Temporary variable for sub-expression on source location: (47,8-47,16) */
  share* __tac_var29 = ((BooleanCircuit *) ycirc)->PutINVGate(__tac_var28);
  return __tac_var29;
  }
  
  share* signedleqbl(share* x, share* y){
  /* Temporary variable for sub-expression on source location: (50,10-50,15) */
  share* __tac_var30 = signedgtbl(x, y);
  /* Temporary variable for sub-expression on source location: (50,8-50,16) */
  share* __tac_var31 = ((BooleanCircuit *) ycirc)->PutINVGate(__tac_var30);
  return __tac_var31;
  }
  
  share* unsignedgeqbl(share* x, share* y){
  /* Temporary variable for sub-expression on source location: (54,10-54,15) */
  share* __tac_var32 = ycirc->PutGTGate(y, x);
  /* Temporary variable for sub-expression on source location: (54,8-54,16) */
  share* __tac_var33 = ((BooleanCircuit *) ycirc)->PutINVGate(__tac_var32);
  return __tac_var33;
  }
  
  share* signedgeqbl(share* x, share* y){
  /* Temporary variable for sub-expression on source location: (57,10-57,15) */
  share* __tac_var34 = signedgtbl(y, x);
  /* Temporary variable for sub-expression on source location: (57,8-57,16) */
  share* __tac_var35 = ((BooleanCircuit *) ycirc)->PutINVGate(__tac_var34);
  return __tac_var35;
  }
  
  share* unsignedequalsbl(share* x, share* y){
  /* Temporary variable for sub-expression on source location: (61,11-61,16) */
  share* __tac_var36 = unsignedltbl(x, y);
  /* Temporary variable for sub-expression on source location: (61,9-61,17) */
  share* __tac_var37 = ((BooleanCircuit *) ycirc)->PutINVGate(__tac_var36);
  /* Temporary variable for sub-expression on source location: (61,25-61,30) */
  share* __tac_var38 = unsignedltbl(y, x);
  /* Temporary variable for sub-expression on source location: (61,23-61,31) */
  share* __tac_var39 = ((BooleanCircuit *) ycirc)->PutINVGate(__tac_var38);
  /* Temporary variable for sub-expression on source location: (61,8-61,32) */
  share* __tac_var40 = ycirc->PutANDGate(__tac_var37, __tac_var39);
  return __tac_var40;
  }
  
  share* signedequalsbl(share* x, share* y){
  /* Temporary variable for sub-expression on source location: (64,11-64,16) */
  share* __tac_var41 = signedltbl(x, y);
  /* Temporary variable for sub-expression on source location: (64,9-64,17) */
  share* __tac_var42 = ((BooleanCircuit *) ycirc)->PutINVGate(__tac_var41);
  /* Temporary variable for sub-expression on source location: (64,25-64,30) */
  share* __tac_var43 = signedltbl(y, x);
  /* Temporary variable for sub-expression on source location: (64,23-64,31) */
  share* __tac_var44 = ((BooleanCircuit *) ycirc)->PutINVGate(__tac_var43);
  /* Temporary variable for sub-expression on source location: (64,8-64,32) */
  share* __tac_var45 = ycirc->PutANDGate(__tac_var42, __tac_var44);
  return __tac_var45;
  }
  
  share* longDivision(share* x, share* y, uint32_t getQuotient){
  
  share* q = put_cons32_gate(ycirc,  (uint32_t)0);
  
  share* divisor = q;
  
  share* cond = put_cons1_gate(ycirc, 0);
  for (uint32_t iter =  (int32_t)0; iter <  (int32_t)32; iter++){
  
  uint32_t i = ( (int32_t)31 - iter);
  divisor = left_shift(ycirc, divisor,  (uint32_t)1);
  /* Temporary variable for sub-expression on source location: (81,32-81,39) */
  uint32_t __tac_var46 = ( (uint32_t)1 << i);
  /* Temporary variable for sub-expression on source location: (81,32-81,39) */
  share* __tac_var47 = put_cons32_gate(ycirc, __tac_var46);
  /* Temporary variable for sub-expression on source location: (81,27-81,40) */
  share* __tac_var48 = ycirc->PutANDGate(x, __tac_var47);
  /* Temporary variable for sub-expression on source location: (81,26-81,47) */
  share* __tac_var49 = logical_right_shift(ycirc, __tac_var48, i);
  divisor = ycirc->PutADDGate(divisor, __tac_var49);
  cond = unsignedgeqbl(divisor, y);
  /* Temporary variable for sub-expression on source location: (83,22-83,36) */
  share* __tac_var50 = ycirc->PutSUBGate(divisor, y);
  divisor = ycirc->PutMUXGate(__tac_var50, divisor, cond);
  q = left_shift(ycirc, q,  (uint32_t)1);
  /* Temporary variable for sub-expression on source location: (85,19-85,21) */
  share* __tac_var51 = put_cons32_gate(ycirc,  (uint32_t)1);
  /* Temporary variable for sub-expression on source location: (85,15-85,21) */
  share* __tac_var52 = ycirc->PutADDGate(q, __tac_var51);
  q = ycirc->PutMUXGate(__tac_var52, q, cond);
  }
  /* Temporary variable for sub-expression on source location: (88,9-88,34) */
  share* __tac_var53 = getQuotient ? q : divisor;
  return __tac_var53;
  }
  
  share* unsigneddivbl(share* x, share* y){
  /* Temporary variable for sub-expression on source location: (91,8-91,32) */
  share* __tac_var54 = longDivision(x, y, 1);
  return __tac_var54;
  }
  
  share* unsigneddival(share* x, share* y){
  
  share* bx = ycirc->PutA2YGate(x);
  
  share* by = ycirc->PutA2YGate(y);
  /* Temporary variable for sub-expression on source location: (96,8-96,13) */
  share* __tac_var55 = unsigneddivbl(bx, by);
  return __tac_var55;
  }
  
  share* signeddivbl(share* x, share* y){
  /* Temporary variable for sub-expression on source location: (99,23-99,24) */
  share* __tac_var56 = put_cons32_gate(ycirc,  (int32_t)0);
  
  share* isXNeg = signedltbl(x, __tac_var56);
  /* Temporary variable for sub-expression on source location: (100,23-100,24) */
  share* __tac_var57 = __tac_var56;
  
  share* isYNeg = signedltbl(y, __tac_var56);
  /* Temporary variable for sub-expression on source location: (101,26-101,27) */
  share* __tac_var58 = __tac_var56;
  /* Temporary variable for sub-expression on source location: (101,26-101,31) */
  share* __tac_var59 = ycirc->PutSUBGate(__tac_var56, x);
  
  share* ux = ycirc->PutMUXGate(__tac_var59, x, isXNeg);
  /* Temporary variable for sub-expression on source location: (102,26-102,27) */
  share* __tac_var60 = __tac_var56;
  /* Temporary variable for sub-expression on source location: (102,26-102,31) */
  share* __tac_var61 = ycirc->PutSUBGate(__tac_var56, y);
  
  share* uy = ycirc->PutMUXGate(__tac_var61, y, isYNeg);
  
  share* ures = unsigneddivbl(ux, uy);
  
  share* isResNeg = ycirc->PutXORGate(isXNeg, isYNeg);
  /* Temporary variable for sub-expression on source location: (105,21-105,23) */
  share* __tac_var62 = put_cons32_gate(ycirc,  (uint32_t)0);
  /* Temporary variable for sub-expression on source location: (105,21-105,30) */
  share* __tac_var63 = ycirc->PutSUBGate(__tac_var62, ures);
  /* Temporary variable for sub-expression on source location: (105,9-105,38) */
  share* __tac_var64 = ycirc->PutMUXGate(__tac_var63, ures, isResNeg);
  return __tac_var64;
  }
  
  share* signeddival(share* x, share* y){
  
  share* bx = ycirc->PutA2YGate(x);
  
  share* by = ycirc->PutA2YGate(y);
  /* Temporary variable for sub-expression on source location: (110,8-110,13) */
  share* __tac_var65 = signeddivbl(bx, by);
  return __tac_var65;
  }
  
  share* unsignedmodbl(share* x, share* y){
  /* Temporary variable for sub-expression on source location: (118,8-118,33) */
  share* __tac_var66 = longDivision(x, y, 0);
  return __tac_var66;
  }
  
  share* unsignedmodal(share* x, share* y){
  
  share* bx = ycirc->PutA2YGate(x);
  
  share* by = ycirc->PutA2YGate(y);
  /* Temporary variable for sub-expression on source location: (123,8-123,13) */
  share* __tac_var67 = unsignedmodbl(bx, by);
  return __tac_var67;
  }
  
  share* signedmodbl(share* x, share* y){
  /* Temporary variable for sub-expression on source location: (126,23-126,24) */
  share* __tac_var68 = put_cons32_gate(ycirc,  (int32_t)0);
  
  share* isXNeg = signedltbl(x, __tac_var68);
  /* Temporary variable for sub-expression on source location: (127,23-127,24) */
  share* __tac_var69 = __tac_var68;
  
  share* isYNeg = signedltbl(y, __tac_var68);
  /* Temporary variable for sub-expression on source location: (128,26-128,27) */
  share* __tac_var70 = __tac_var68;
  /* Temporary variable for sub-expression on source location: (128,26-128,31) */
  share* __tac_var71 = ycirc->PutSUBGate(__tac_var68, x);
  
  share* ux = ycirc->PutMUXGate(__tac_var71, x, isXNeg);
  /* Temporary variable for sub-expression on source location: (129,26-129,27) */
  share* __tac_var72 = __tac_var68;
  /* Temporary variable for sub-expression on source location: (129,26-129,31) */
  share* __tac_var73 = ycirc->PutSUBGate(__tac_var68, y);
  
  share* uy = ycirc->PutMUXGate(__tac_var73, y, isYNeg);
  
  share* urem = unsignedmodbl(ux, uy);
  /* Temporary variable for sub-expression on source location: (131,19-131,21) */
  share* __tac_var74 = put_cons32_gate(ycirc,  (uint32_t)0);
  /* Temporary variable for sub-expression on source location: (131,19-131,28) */
  share* __tac_var75 = ycirc->PutSUBGate(__tac_var74, urem);
  /* Temporary variable for sub-expression on source location: (131,9-131,36) */
  share* __tac_var76 = ycirc->PutMUXGate(__tac_var75, urem, isXNeg);
  return __tac_var76;
  }
  
  share* signedmodal(share* x, share* y){
  
  share* bx = ycirc->PutA2YGate(x);
  
  share* by = ycirc->PutA2YGate(y);
  /* Temporary variable for sub-expression on source location: (136,8-136,13) */
  share* __tac_var77 = signedmodbl(bx, by);
  return __tac_var77;
  }
  
  const uint32_t dim =  (uint32_t)2;
  
  
  int64_t ezpc_main (e_role role_param, char* address, uint16_t port, seclvl seclvl,
  uint32_t nvals, uint32_t nthreads, e_mt_gen_alg mt_alg,
  e_sharing sharing) {
  role = role_param;
  party = new ABYParty(role_param, address, port, seclvl, bitlen, nthreads, mt_alg, 520000000);
  std::vector<Sharing*>& sharings = party->GetSharings();
  ycirc = (sharings)[S_YAO]->GetCircuitBuildRoutine();
  acirc = (sharings)[S_ARITH]->GetCircuitBuildRoutine();
  bcirc = (sharings)[S_BOOL]->GetCircuitBuildRoutine();
  
  
  auto w = make_vector<share*>( (uint32_t)2);
  if ((role == SERVER)) {
  cout << ("Input w:") << endl;
  }
  /* Variable to read the clear value corresponding to the input variable w at (169,1-169,32) */
  uint32_t __tmp_in_w;
  for (uint32_t i0 =  (uint32_t)0; i0 <  (uint32_t)2; i0++){
  if ((role == SERVER)) {
  cin >> __tmp_in_w;
  }
  w[i0] = (role == SERVER) ? acirc->PutINGate(__tmp_in_w, bitlen, SERVER) : acirc->PutDummyINGate(bitlen);
  }
  
  share* b;
  if ((role == SERVER)) {
  cout << ("Input b:") << endl;
  }
  /* Variable to read the clear value corresponding to the input variable b at (170,1-170,27) */
  uint32_t __tmp_in_b;
  if ((role == SERVER)) {
  cin >> __tmp_in_b;
  }
  b = (role == SERVER) ? ycirc->PutINGate(__tmp_in_b, bitlen, SERVER) : ycirc->PutDummyINGate(bitlen);
  
  auto x = make_vector<share*>( (uint32_t)2);
  if ((role == CLIENT)) {
  cout << ("Input x:") << endl;
  }
  /* Variable to read the clear value corresponding to the input variable x at (171,1-171,32) */
  uint32_t __tmp_in_x;
  for (uint32_t i0 =  (uint32_t)0; i0 <  (uint32_t)2; i0++){
  if ((role == CLIENT)) {
  cin >> __tmp_in_x;
  }
  x[i0] = (role == CLIENT) ? acirc->PutINGate(__tmp_in_x, bitlen, CLIENT) : acirc->PutDummyINGate(bitlen);
  }
  
  share* acc = put_cons32_gate(acirc,  (int32_t)0);
  
  uint32_t lower =  (uint32_t)0;
  
  uint32_t upper =  (uint32_t)2;
  /* Temporary variable for sub-expression on source location: (175,8-175,21) */
  uint32_t __tac_var78 = ( (uint32_t)0 -  (uint32_t)0);
  for (uint32_t i = __tac_var78; i <  (uint32_t)2; i++){
  /* Temporary variable for sub-expression on source location: (175,46-175,50) */
  share* __tac_var79 = w[i];
  /* Temporary variable for sub-expression on source location: (175,53-175,57) */
  share* __tac_var80 = x[i];
  /* Temporary variable for sub-expression on source location: (175,46-175,57) */
  share* __tac_var81 = acirc->PutMULGate(__tac_var79, __tac_var80);
  acc = acirc->PutADDGate(acc, __tac_var81);
  }
  /* Temporary variable for sub-expression on source location: (176,18-176,21) */
  share* __tac_var82 = ycirc->PutA2YGate(acc);
  /* Temporary variable for sub-expression on source location: (176,18-176,25) */
  share* __tac_var83 = signedgtbl(__tac_var82, b);
  /* Temporary variable for sub-expression on source location: (176,29-176,30) */
  share* __tac_var84 = put_cons32_gate(ycirc,  (int32_t)1);
  /* Temporary variable for sub-expression on source location: (176,33-176,34) */
  share* __tac_var85 = put_cons32_gate(ycirc,  (int32_t)0);
  /* Temporary variable for sub-expression on source location: (176,17-176,34) */
  share* __tac_var86 = ycirc->PutMUXGate(__tac_var84, __tac_var85, __tac_var83);
  add_print_msg_to_output_queue(out_q, "Value of __tac_var86:", CLIENT, cout);
  add_to_output_queue(out_q, ycirc->PutOUTGate(__tac_var86, CLIENT), CLIENT, cout);
  party->ExecCircuit();
  flush_output_queue(out_q, role, bitlen);
  return 0;
  }
  
  