#include "../lib.h"

extern "C" {
void __pragma_loopbound(unsigned, unsigned) {}

void bsort_init(void);
void bsort_main(void);
int bsort_return(void);

EXPORT("wasm_module") int wasm_module(void) {
  bsort_init();

  fail_start_trace();
  bsort_main();
  fail_stop_trace();

  int ret = bsort_return();
  if (ret == 0) {
    PRINT("result correct.\n");
    fail_marker_positive();
  } else {
    PRINT("result incorrect.\n");
    fail_marker_negative();
  }
  return ret;
}
}
