#include "../lib.h"

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

void complex_updates_init(void);
void complex_updates_main(void);
int complex_updates_return(void);

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

  fail_start_trace();
  complex_updates_main();
  fail_stop_trace();

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