#include "../lib.h"

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

void sha_init(void);
void sha_main(void);
int sha_return(void);

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

  fail_start_trace();
  sha_main();
  fail_stop_trace();

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