#include<collate.cvh>
#include<stdio.h>

$input int N=2;

$gcollator gcollator=$gcollator_create($here, N);

void process(int id){
  $scope here = $here;	
  $collator collator=$collator_create(gcollator, here, id);
  int x=-1;

  $havoc(&x);
  $assume(0<x && x<3);
  $collate_state cs=$collate_arrives(collator, here);

  $elaborate(x);
  $with(cs){
    $assert($is_concrete_int(x));
  }
  $collate_departs(collator, cs);
  $free(collator);
}


int main(){
  $parfor(int i: 0 .. N-1)
    process(i);
  $free(gcollator);
}
