// File: kernel.cpp
#include "loop_127.h"
#include <stdint.h>

extern "C" void inner_loop_127(struct loop_127_data * data) {
  uint32_t *a = data->a;
  uint32_t *b = data->b;
  int n = data->n;

  uint32_t res = 0;
  for (int i = 0; i < n; i++) {
    res += a[i] * b[i];
    if (a[i] == 512) {
      break;
    }
  }
  data->res = res;
}