// Copyright (c) 2024, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
//
// This file has been automatically generated. Please do not edit it manually.
// Generated by tests/ffi/generator/address_of_test_generator.dart.

#include <stdarg.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <sys/types.h>

#include <cmath>
#include <iostream>
#include <limits>

#if defined(_WIN32)
#define DART_EXPORT extern "C" __declspec(dllexport)
#else
#define DART_EXPORT                                                            \
  extern "C" __attribute__((visibility("default"))) __attribute((used))
#endif

namespace dart {

#define CHECK(X)                                                               \
  if (!(X)) {                                                                  \
    fprintf(stderr, "%s\n", "Check failed: " #X);                              \
    return 1;                                                                  \
  }

#define CHECK_EQ(X, Y) CHECK((X) == (Y))

// Works for positive, negative and zero.
#define CHECK_APPROX(EXPECTED, ACTUAL)                                         \
  CHECK(((EXPECTED * 0.99) <= (ACTUAL) && (EXPECTED * 1.01) >= (ACTUAL)) ||    \
        ((EXPECTED * 0.99) >= (ACTUAL) && (EXPECTED * 1.01) <= (ACTUAL)))

DART_EXPORT int8_t TakeInt8Pointer(int8_t* data, size_t length) {
  int8_t result = 0;
  if (length > 100) {
    std::cout << "Mangled arguments\n";
    return result;
  }
  for (size_t i = 0; i < length; i++) {
    std::cout << "data[" << i << "] = " << static_cast<int>(data[i]) << "\n";
    result += data[i];
  }
  return result;
}

DART_EXPORT int8_t TakeInt8PointerMany(int8_t* data0,
                                       int8_t* data1,
                                       int8_t* data2,
                                       int8_t* data3,
                                       int8_t* data4,
                                       int8_t* data5,
                                       int8_t* data6,
                                       int8_t* data7,
                                       int8_t* data8,
                                       int8_t* data9,
                                       int8_t* data10,
                                       int8_t* data11,
                                       int8_t* data12,
                                       int8_t* data13,
                                       int8_t* data14,
                                       int8_t* data15,
                                       int8_t* data16,
                                       int8_t* data17,
                                       int8_t* data18,
                                       int8_t* data19) {
  int8_t result = 0;
  std::cout << "data0[0] = " << static_cast<int>(data0[0]) << "\n";
  result += data0[0];
  std::cout << "data1[0] = " << static_cast<int>(data1[0]) << "\n";
  result += data1[0];
  std::cout << "data2[0] = " << static_cast<int>(data2[0]) << "\n";
  result += data2[0];
  std::cout << "data3[0] = " << static_cast<int>(data3[0]) << "\n";
  result += data3[0];
  std::cout << "data4[0] = " << static_cast<int>(data4[0]) << "\n";
  result += data4[0];
  std::cout << "data5[0] = " << static_cast<int>(data5[0]) << "\n";
  result += data5[0];
  std::cout << "data6[0] = " << static_cast<int>(data6[0]) << "\n";
  result += data6[0];
  std::cout << "data7[0] = " << static_cast<int>(data7[0]) << "\n";
  result += data7[0];
  std::cout << "data8[0] = " << static_cast<int>(data8[0]) << "\n";
  result += data8[0];
  std::cout << "data9[0] = " << static_cast<int>(data9[0]) << "\n";
  result += data9[0];
  std::cout << "data10[0] = " << static_cast<int>(data10[0]) << "\n";
  result += data10[0];
  std::cout << "data11[0] = " << static_cast<int>(data11[0]) << "\n";
  result += data11[0];
  std::cout << "data12[0] = " << static_cast<int>(data12[0]) << "\n";
  result += data12[0];
  std::cout << "data13[0] = " << static_cast<int>(data13[0]) << "\n";
  result += data13[0];
  std::cout << "data14[0] = " << static_cast<int>(data14[0]) << "\n";
  result += data14[0];
  std::cout << "data15[0] = " << static_cast<int>(data15[0]) << "\n";
  result += data15[0];
  std::cout << "data16[0] = " << static_cast<int>(data16[0]) << "\n";
  result += data16[0];
  std::cout << "data17[0] = " << static_cast<int>(data17[0]) << "\n";
  result += data17[0];
  std::cout << "data18[0] = " << static_cast<int>(data18[0]) << "\n";
  result += data18[0];
  std::cout << "data19[0] = " << static_cast<int>(data19[0]) << "\n";
  result += data19[0];
  return result;
}

DART_EXPORT int16_t TakeInt16Pointer(int16_t* data, size_t length) {
  int16_t result = 0;
  if (length > 100) {
    std::cout << "Mangled arguments\n";
    return result;
  }
  for (size_t i = 0; i < length; i++) {
    std::cout << "data[" << i << "] = " << data[i] << "\n";
    result += data[i];
  }
  return result;
}

DART_EXPORT int16_t TakeInt16PointerMany(int16_t* data0,
                                         int16_t* data1,
                                         int16_t* data2,
                                         int16_t* data3,
                                         int16_t* data4,
                                         int16_t* data5,
                                         int16_t* data6,
                                         int16_t* data7,
                                         int16_t* data8,
                                         int16_t* data9,
                                         int16_t* data10,
                                         int16_t* data11,
                                         int16_t* data12,
                                         int16_t* data13,
                                         int16_t* data14,
                                         int16_t* data15,
                                         int16_t* data16,
                                         int16_t* data17,
                                         int16_t* data18,
                                         int16_t* data19) {
  int16_t result = 0;
  std::cout << "data0[0] = " << data0[0] << "\n";
  result += data0[0];
  std::cout << "data1[0] = " << data1[0] << "\n";
  result += data1[0];
  std::cout << "data2[0] = " << data2[0] << "\n";
  result += data2[0];
  std::cout << "data3[0] = " << data3[0] << "\n";
  result += data3[0];
  std::cout << "data4[0] = " << data4[0] << "\n";
  result += data4[0];
  std::cout << "data5[0] = " << data5[0] << "\n";
  result += data5[0];
  std::cout << "data6[0] = " << data6[0] << "\n";
  result += data6[0];
  std::cout << "data7[0] = " << data7[0] << "\n";
  result += data7[0];
  std::cout << "data8[0] = " << data8[0] << "\n";
  result += data8[0];
  std::cout << "data9[0] = " << data9[0] << "\n";
  result += data9[0];
  std::cout << "data10[0] = " << data10[0] << "\n";
  result += data10[0];
  std::cout << "data11[0] = " << data11[0] << "\n";
  result += data11[0];
  std::cout << "data12[0] = " << data12[0] << "\n";
  result += data12[0];
  std::cout << "data13[0] = " << data13[0] << "\n";
  result += data13[0];
  std::cout << "data14[0] = " << data14[0] << "\n";
  result += data14[0];
  std::cout << "data15[0] = " << data15[0] << "\n";
  result += data15[0];
  std::cout << "data16[0] = " << data16[0] << "\n";
  result += data16[0];
  std::cout << "data17[0] = " << data17[0] << "\n";
  result += data17[0];
  std::cout << "data18[0] = " << data18[0] << "\n";
  result += data18[0];
  std::cout << "data19[0] = " << data19[0] << "\n";
  result += data19[0];
  return result;
}

DART_EXPORT int32_t TakeInt32Pointer(int32_t* data, size_t length) {
  int32_t result = 0;
  if (length > 100) {
    std::cout << "Mangled arguments\n";
    return result;
  }
  for (size_t i = 0; i < length; i++) {
    std::cout << "data[" << i << "] = " << data[i] << "\n";
    result += data[i];
  }
  return result;
}

DART_EXPORT int32_t TakeInt32PointerMany(int32_t* data0,
                                         int32_t* data1,
                                         int32_t* data2,
                                         int32_t* data3,
                                         int32_t* data4,
                                         int32_t* data5,
                                         int32_t* data6,
                                         int32_t* data7,
                                         int32_t* data8,
                                         int32_t* data9,
                                         int32_t* data10,
                                         int32_t* data11,
                                         int32_t* data12,
                                         int32_t* data13,
                                         int32_t* data14,
                                         int32_t* data15,
                                         int32_t* data16,
                                         int32_t* data17,
                                         int32_t* data18,
                                         int32_t* data19) {
  int32_t result = 0;
  std::cout << "data0[0] = " << data0[0] << "\n";
  result += data0[0];
  std::cout << "data1[0] = " << data1[0] << "\n";
  result += data1[0];
  std::cout << "data2[0] = " << data2[0] << "\n";
  result += data2[0];
  std::cout << "data3[0] = " << data3[0] << "\n";
  result += data3[0];
  std::cout << "data4[0] = " << data4[0] << "\n";
  result += data4[0];
  std::cout << "data5[0] = " << data5[0] << "\n";
  result += data5[0];
  std::cout << "data6[0] = " << data6[0] << "\n";
  result += data6[0];
  std::cout << "data7[0] = " << data7[0] << "\n";
  result += data7[0];
  std::cout << "data8[0] = " << data8[0] << "\n";
  result += data8[0];
  std::cout << "data9[0] = " << data9[0] << "\n";
  result += data9[0];
  std::cout << "data10[0] = " << data10[0] << "\n";
  result += data10[0];
  std::cout << "data11[0] = " << data11[0] << "\n";
  result += data11[0];
  std::cout << "data12[0] = " << data12[0] << "\n";
  result += data12[0];
  std::cout << "data13[0] = " << data13[0] << "\n";
  result += data13[0];
  std::cout << "data14[0] = " << data14[0] << "\n";
  result += data14[0];
  std::cout << "data15[0] = " << data15[0] << "\n";
  result += data15[0];
  std::cout << "data16[0] = " << data16[0] << "\n";
  result += data16[0];
  std::cout << "data17[0] = " << data17[0] << "\n";
  result += data17[0];
  std::cout << "data18[0] = " << data18[0] << "\n";
  result += data18[0];
  std::cout << "data19[0] = " << data19[0] << "\n";
  result += data19[0];
  return result;
}

DART_EXPORT int64_t TakeInt64Pointer(int64_t* data, size_t length) {
  int64_t result = 0;
  if (length > 100) {
    std::cout << "Mangled arguments\n";
    return result;
  }
  for (size_t i = 0; i < length; i++) {
    std::cout << "data[" << i << "] = " << data[i] << "\n";
    result += data[i];
  }
  return result;
}

DART_EXPORT int64_t TakeInt64PointerMany(int64_t* data0,
                                         int64_t* data1,
                                         int64_t* data2,
                                         int64_t* data3,
                                         int64_t* data4,
                                         int64_t* data5,
                                         int64_t* data6,
                                         int64_t* data7,
                                         int64_t* data8,
                                         int64_t* data9,
                                         int64_t* data10,
                                         int64_t* data11,
                                         int64_t* data12,
                                         int64_t* data13,
                                         int64_t* data14,
                                         int64_t* data15,
                                         int64_t* data16,
                                         int64_t* data17,
                                         int64_t* data18,
                                         int64_t* data19) {
  int64_t result = 0;
  std::cout << "data0[0] = " << data0[0] << "\n";
  result += data0[0];
  std::cout << "data1[0] = " << data1[0] << "\n";
  result += data1[0];
  std::cout << "data2[0] = " << data2[0] << "\n";
  result += data2[0];
  std::cout << "data3[0] = " << data3[0] << "\n";
  result += data3[0];
  std::cout << "data4[0] = " << data4[0] << "\n";
  result += data4[0];
  std::cout << "data5[0] = " << data5[0] << "\n";
  result += data5[0];
  std::cout << "data6[0] = " << data6[0] << "\n";
  result += data6[0];
  std::cout << "data7[0] = " << data7[0] << "\n";
  result += data7[0];
  std::cout << "data8[0] = " << data8[0] << "\n";
  result += data8[0];
  std::cout << "data9[0] = " << data9[0] << "\n";
  result += data9[0];
  std::cout << "data10[0] = " << data10[0] << "\n";
  result += data10[0];
  std::cout << "data11[0] = " << data11[0] << "\n";
  result += data11[0];
  std::cout << "data12[0] = " << data12[0] << "\n";
  result += data12[0];
  std::cout << "data13[0] = " << data13[0] << "\n";
  result += data13[0];
  std::cout << "data14[0] = " << data14[0] << "\n";
  result += data14[0];
  std::cout << "data15[0] = " << data15[0] << "\n";
  result += data15[0];
  std::cout << "data16[0] = " << data16[0] << "\n";
  result += data16[0];
  std::cout << "data17[0] = " << data17[0] << "\n";
  result += data17[0];
  std::cout << "data18[0] = " << data18[0] << "\n";
  result += data18[0];
  std::cout << "data19[0] = " << data19[0] << "\n";
  result += data19[0];
  return result;
}

DART_EXPORT uint8_t TakeUint8Pointer(uint8_t* data, size_t length) {
  uint8_t result = 0;
  if (length > 100) {
    std::cout << "Mangled arguments\n";
    return result;
  }
  for (size_t i = 0; i < length; i++) {
    std::cout << "data[" << i << "] = " << static_cast<int>(data[i]) << "\n";
    result += data[i];
  }
  return result;
}

DART_EXPORT uint8_t TakeUint8PointerMany(uint8_t* data0,
                                         uint8_t* data1,
                                         uint8_t* data2,
                                         uint8_t* data3,
                                         uint8_t* data4,
                                         uint8_t* data5,
                                         uint8_t* data6,
                                         uint8_t* data7,
                                         uint8_t* data8,
                                         uint8_t* data9,
                                         uint8_t* data10,
                                         uint8_t* data11,
                                         uint8_t* data12,
                                         uint8_t* data13,
                                         uint8_t* data14,
                                         uint8_t* data15,
                                         uint8_t* data16,
                                         uint8_t* data17,
                                         uint8_t* data18,
                                         uint8_t* data19) {
  uint8_t result = 0;
  std::cout << "data0[0] = " << static_cast<int>(data0[0]) << "\n";
  result += data0[0];
  std::cout << "data1[0] = " << static_cast<int>(data1[0]) << "\n";
  result += data1[0];
  std::cout << "data2[0] = " << static_cast<int>(data2[0]) << "\n";
  result += data2[0];
  std::cout << "data3[0] = " << static_cast<int>(data3[0]) << "\n";
  result += data3[0];
  std::cout << "data4[0] = " << static_cast<int>(data4[0]) << "\n";
  result += data4[0];
  std::cout << "data5[0] = " << static_cast<int>(data5[0]) << "\n";
  result += data5[0];
  std::cout << "data6[0] = " << static_cast<int>(data6[0]) << "\n";
  result += data6[0];
  std::cout << "data7[0] = " << static_cast<int>(data7[0]) << "\n";
  result += data7[0];
  std::cout << "data8[0] = " << static_cast<int>(data8[0]) << "\n";
  result += data8[0];
  std::cout << "data9[0] = " << static_cast<int>(data9[0]) << "\n";
  result += data9[0];
  std::cout << "data10[0] = " << static_cast<int>(data10[0]) << "\n";
  result += data10[0];
  std::cout << "data11[0] = " << static_cast<int>(data11[0]) << "\n";
  result += data11[0];
  std::cout << "data12[0] = " << static_cast<int>(data12[0]) << "\n";
  result += data12[0];
  std::cout << "data13[0] = " << static_cast<int>(data13[0]) << "\n";
  result += data13[0];
  std::cout << "data14[0] = " << static_cast<int>(data14[0]) << "\n";
  result += data14[0];
  std::cout << "data15[0] = " << static_cast<int>(data15[0]) << "\n";
  result += data15[0];
  std::cout << "data16[0] = " << static_cast<int>(data16[0]) << "\n";
  result += data16[0];
  std::cout << "data17[0] = " << static_cast<int>(data17[0]) << "\n";
  result += data17[0];
  std::cout << "data18[0] = " << static_cast<int>(data18[0]) << "\n";
  result += data18[0];
  std::cout << "data19[0] = " << static_cast<int>(data19[0]) << "\n";
  result += data19[0];
  return result;
}

DART_EXPORT uint16_t TakeUint16Pointer(uint16_t* data, size_t length) {
  uint16_t result = 0;
  if (length > 100) {
    std::cout << "Mangled arguments\n";
    return result;
  }
  for (size_t i = 0; i < length; i++) {
    std::cout << "data[" << i << "] = " << data[i] << "\n";
    result += data[i];
  }
  return result;
}

DART_EXPORT uint16_t TakeUint16PointerMany(uint16_t* data0,
                                           uint16_t* data1,
                                           uint16_t* data2,
                                           uint16_t* data3,
                                           uint16_t* data4,
                                           uint16_t* data5,
                                           uint16_t* data6,
                                           uint16_t* data7,
                                           uint16_t* data8,
                                           uint16_t* data9,
                                           uint16_t* data10,
                                           uint16_t* data11,
                                           uint16_t* data12,
                                           uint16_t* data13,
                                           uint16_t* data14,
                                           uint16_t* data15,
                                           uint16_t* data16,
                                           uint16_t* data17,
                                           uint16_t* data18,
                                           uint16_t* data19) {
  uint16_t result = 0;
  std::cout << "data0[0] = " << data0[0] << "\n";
  result += data0[0];
  std::cout << "data1[0] = " << data1[0] << "\n";
  result += data1[0];
  std::cout << "data2[0] = " << data2[0] << "\n";
  result += data2[0];
  std::cout << "data3[0] = " << data3[0] << "\n";
  result += data3[0];
  std::cout << "data4[0] = " << data4[0] << "\n";
  result += data4[0];
  std::cout << "data5[0] = " << data5[0] << "\n";
  result += data5[0];
  std::cout << "data6[0] = " << data6[0] << "\n";
  result += data6[0];
  std::cout << "data7[0] = " << data7[0] << "\n";
  result += data7[0];
  std::cout << "data8[0] = " << data8[0] << "\n";
  result += data8[0];
  std::cout << "data9[0] = " << data9[0] << "\n";
  result += data9[0];
  std::cout << "data10[0] = " << data10[0] << "\n";
  result += data10[0];
  std::cout << "data11[0] = " << data11[0] << "\n";
  result += data11[0];
  std::cout << "data12[0] = " << data12[0] << "\n";
  result += data12[0];
  std::cout << "data13[0] = " << data13[0] << "\n";
  result += data13[0];
  std::cout << "data14[0] = " << data14[0] << "\n";
  result += data14[0];
  std::cout << "data15[0] = " << data15[0] << "\n";
  result += data15[0];
  std::cout << "data16[0] = " << data16[0] << "\n";
  result += data16[0];
  std::cout << "data17[0] = " << data17[0] << "\n";
  result += data17[0];
  std::cout << "data18[0] = " << data18[0] << "\n";
  result += data18[0];
  std::cout << "data19[0] = " << data19[0] << "\n";
  result += data19[0];
  return result;
}

DART_EXPORT uint32_t TakeUint32Pointer(uint32_t* data, size_t length) {
  uint32_t result = 0;
  if (length > 100) {
    std::cout << "Mangled arguments\n";
    return result;
  }
  for (size_t i = 0; i < length; i++) {
    std::cout << "data[" << i << "] = " << data[i] << "\n";
    result += data[i];
  }
  return result;
}

DART_EXPORT uint32_t TakeUint32PointerMany(uint32_t* data0,
                                           uint32_t* data1,
                                           uint32_t* data2,
                                           uint32_t* data3,
                                           uint32_t* data4,
                                           uint32_t* data5,
                                           uint32_t* data6,
                                           uint32_t* data7,
                                           uint32_t* data8,
                                           uint32_t* data9,
                                           uint32_t* data10,
                                           uint32_t* data11,
                                           uint32_t* data12,
                                           uint32_t* data13,
                                           uint32_t* data14,
                                           uint32_t* data15,
                                           uint32_t* data16,
                                           uint32_t* data17,
                                           uint32_t* data18,
                                           uint32_t* data19) {
  uint32_t result = 0;
  std::cout << "data0[0] = " << data0[0] << "\n";
  result += data0[0];
  std::cout << "data1[0] = " << data1[0] << "\n";
  result += data1[0];
  std::cout << "data2[0] = " << data2[0] << "\n";
  result += data2[0];
  std::cout << "data3[0] = " << data3[0] << "\n";
  result += data3[0];
  std::cout << "data4[0] = " << data4[0] << "\n";
  result += data4[0];
  std::cout << "data5[0] = " << data5[0] << "\n";
  result += data5[0];
  std::cout << "data6[0] = " << data6[0] << "\n";
  result += data6[0];
  std::cout << "data7[0] = " << data7[0] << "\n";
  result += data7[0];
  std::cout << "data8[0] = " << data8[0] << "\n";
  result += data8[0];
  std::cout << "data9[0] = " << data9[0] << "\n";
  result += data9[0];
  std::cout << "data10[0] = " << data10[0] << "\n";
  result += data10[0];
  std::cout << "data11[0] = " << data11[0] << "\n";
  result += data11[0];
  std::cout << "data12[0] = " << data12[0] << "\n";
  result += data12[0];
  std::cout << "data13[0] = " << data13[0] << "\n";
  result += data13[0];
  std::cout << "data14[0] = " << data14[0] << "\n";
  result += data14[0];
  std::cout << "data15[0] = " << data15[0] << "\n";
  result += data15[0];
  std::cout << "data16[0] = " << data16[0] << "\n";
  result += data16[0];
  std::cout << "data17[0] = " << data17[0] << "\n";
  result += data17[0];
  std::cout << "data18[0] = " << data18[0] << "\n";
  result += data18[0];
  std::cout << "data19[0] = " << data19[0] << "\n";
  result += data19[0];
  return result;
}

DART_EXPORT uint64_t TakeUint64Pointer(uint64_t* data, size_t length) {
  uint64_t result = 0;
  if (length > 100) {
    std::cout << "Mangled arguments\n";
    return result;
  }
  for (size_t i = 0; i < length; i++) {
    std::cout << "data[" << i << "] = " << data[i] << "\n";
    result += data[i];
  }
  return result;
}

DART_EXPORT uint64_t TakeUint64PointerMany(uint64_t* data0,
                                           uint64_t* data1,
                                           uint64_t* data2,
                                           uint64_t* data3,
                                           uint64_t* data4,
                                           uint64_t* data5,
                                           uint64_t* data6,
                                           uint64_t* data7,
                                           uint64_t* data8,
                                           uint64_t* data9,
                                           uint64_t* data10,
                                           uint64_t* data11,
                                           uint64_t* data12,
                                           uint64_t* data13,
                                           uint64_t* data14,
                                           uint64_t* data15,
                                           uint64_t* data16,
                                           uint64_t* data17,
                                           uint64_t* data18,
                                           uint64_t* data19) {
  uint64_t result = 0;
  std::cout << "data0[0] = " << data0[0] << "\n";
  result += data0[0];
  std::cout << "data1[0] = " << data1[0] << "\n";
  result += data1[0];
  std::cout << "data2[0] = " << data2[0] << "\n";
  result += data2[0];
  std::cout << "data3[0] = " << data3[0] << "\n";
  result += data3[0];
  std::cout << "data4[0] = " << data4[0] << "\n";
  result += data4[0];
  std::cout << "data5[0] = " << data5[0] << "\n";
  result += data5[0];
  std::cout << "data6[0] = " << data6[0] << "\n";
  result += data6[0];
  std::cout << "data7[0] = " << data7[0] << "\n";
  result += data7[0];
  std::cout << "data8[0] = " << data8[0] << "\n";
  result += data8[0];
  std::cout << "data9[0] = " << data9[0] << "\n";
  result += data9[0];
  std::cout << "data10[0] = " << data10[0] << "\n";
  result += data10[0];
  std::cout << "data11[0] = " << data11[0] << "\n";
  result += data11[0];
  std::cout << "data12[0] = " << data12[0] << "\n";
  result += data12[0];
  std::cout << "data13[0] = " << data13[0] << "\n";
  result += data13[0];
  std::cout << "data14[0] = " << data14[0] << "\n";
  result += data14[0];
  std::cout << "data15[0] = " << data15[0] << "\n";
  result += data15[0];
  std::cout << "data16[0] = " << data16[0] << "\n";
  result += data16[0];
  std::cout << "data17[0] = " << data17[0] << "\n";
  result += data17[0];
  std::cout << "data18[0] = " << data18[0] << "\n";
  result += data18[0];
  std::cout << "data19[0] = " << data19[0] << "\n";
  result += data19[0];
  return result;
}

DART_EXPORT float TakeFloatPointer(float* data, size_t length) {
  float result = 0.0;
  if (length > 100) {
    std::cout << "Mangled arguments\n";
    return result;
  }
  for (size_t i = 0; i < length; i++) {
    std::cout << "data[" << i << "] = " << data[i] << "\n";
    result += data[i];
  }
  return result;
}

DART_EXPORT float TakeFloatPointerMany(float* data0,
                                       float* data1,
                                       float* data2,
                                       float* data3,
                                       float* data4,
                                       float* data5,
                                       float* data6,
                                       float* data7,
                                       float* data8,
                                       float* data9,
                                       float* data10,
                                       float* data11,
                                       float* data12,
                                       float* data13,
                                       float* data14,
                                       float* data15,
                                       float* data16,
                                       float* data17,
                                       float* data18,
                                       float* data19) {
  float result = 0.0;
  std::cout << "data0[0] = " << data0[0] << "\n";
  result += data0[0];
  std::cout << "data1[0] = " << data1[0] << "\n";
  result += data1[0];
  std::cout << "data2[0] = " << data2[0] << "\n";
  result += data2[0];
  std::cout << "data3[0] = " << data3[0] << "\n";
  result += data3[0];
  std::cout << "data4[0] = " << data4[0] << "\n";
  result += data4[0];
  std::cout << "data5[0] = " << data5[0] << "\n";
  result += data5[0];
  std::cout << "data6[0] = " << data6[0] << "\n";
  result += data6[0];
  std::cout << "data7[0] = " << data7[0] << "\n";
  result += data7[0];
  std::cout << "data8[0] = " << data8[0] << "\n";
  result += data8[0];
  std::cout << "data9[0] = " << data9[0] << "\n";
  result += data9[0];
  std::cout << "data10[0] = " << data10[0] << "\n";
  result += data10[0];
  std::cout << "data11[0] = " << data11[0] << "\n";
  result += data11[0];
  std::cout << "data12[0] = " << data12[0] << "\n";
  result += data12[0];
  std::cout << "data13[0] = " << data13[0] << "\n";
  result += data13[0];
  std::cout << "data14[0] = " << data14[0] << "\n";
  result += data14[0];
  std::cout << "data15[0] = " << data15[0] << "\n";
  result += data15[0];
  std::cout << "data16[0] = " << data16[0] << "\n";
  result += data16[0];
  std::cout << "data17[0] = " << data17[0] << "\n";
  result += data17[0];
  std::cout << "data18[0] = " << data18[0] << "\n";
  result += data18[0];
  std::cout << "data19[0] = " << data19[0] << "\n";
  result += data19[0];
  return result;
}

DART_EXPORT double TakeDoublePointer(double* data, size_t length) {
  double result = 0.0;
  if (length > 100) {
    std::cout << "Mangled arguments\n";
    return result;
  }
  for (size_t i = 0; i < length; i++) {
    std::cout << "data[" << i << "] = " << data[i] << "\n";
    result += data[i];
  }
  return result;
}

DART_EXPORT double TakeDoublePointerMany(double* data0,
                                         double* data1,
                                         double* data2,
                                         double* data3,
                                         double* data4,
                                         double* data5,
                                         double* data6,
                                         double* data7,
                                         double* data8,
                                         double* data9,
                                         double* data10,
                                         double* data11,
                                         double* data12,
                                         double* data13,
                                         double* data14,
                                         double* data15,
                                         double* data16,
                                         double* data17,
                                         double* data18,
                                         double* data19) {
  double result = 0.0;
  std::cout << "data0[0] = " << data0[0] << "\n";
  result += data0[0];
  std::cout << "data1[0] = " << data1[0] << "\n";
  result += data1[0];
  std::cout << "data2[0] = " << data2[0] << "\n";
  result += data2[0];
  std::cout << "data3[0] = " << data3[0] << "\n";
  result += data3[0];
  std::cout << "data4[0] = " << data4[0] << "\n";
  result += data4[0];
  std::cout << "data5[0] = " << data5[0] << "\n";
  result += data5[0];
  std::cout << "data6[0] = " << data6[0] << "\n";
  result += data6[0];
  std::cout << "data7[0] = " << data7[0] << "\n";
  result += data7[0];
  std::cout << "data8[0] = " << data8[0] << "\n";
  result += data8[0];
  std::cout << "data9[0] = " << data9[0] << "\n";
  result += data9[0];
  std::cout << "data10[0] = " << data10[0] << "\n";
  result += data10[0];
  std::cout << "data11[0] = " << data11[0] << "\n";
  result += data11[0];
  std::cout << "data12[0] = " << data12[0] << "\n";
  result += data12[0];
  std::cout << "data13[0] = " << data13[0] << "\n";
  result += data13[0];
  std::cout << "data14[0] = " << data14[0] << "\n";
  result += data14[0];
  std::cout << "data15[0] = " << data15[0] << "\n";
  result += data15[0];
  std::cout << "data16[0] = " << data16[0] << "\n";
  result += data16[0];
  std::cout << "data17[0] = " << data17[0] << "\n";
  result += data17[0];
  std::cout << "data18[0] = " << data18[0] << "\n";
  result += data18[0];
  std::cout << "data19[0] = " << data19[0] << "\n";
  result += data19[0];
  return result;
}

DART_EXPORT bool TakeBoolPointer(bool* data, size_t length) {
  bool result = false;
  if (length > 100) {
    std::cout << "Mangled arguments\n";
    return result;
  }
  for (size_t i = 0; i < length; i++) {
    std::cout << "data[" << i << "] = " << static_cast<int>(data[i]) << "\n";
    result ^= static_cast<int>(data[i]);
  }
  return result;
}

DART_EXPORT bool TakeBoolPointerMany(bool* data0,
                                     bool* data1,
                                     bool* data2,
                                     bool* data3,
                                     bool* data4,
                                     bool* data5,
                                     bool* data6,
                                     bool* data7,
                                     bool* data8,
                                     bool* data9,
                                     bool* data10,
                                     bool* data11,
                                     bool* data12,
                                     bool* data13,
                                     bool* data14,
                                     bool* data15,
                                     bool* data16,
                                     bool* data17,
                                     bool* data18,
                                     bool* data19) {
  bool result = false;
  std::cout << "data0[0] = " << static_cast<int>(data0[0]) << "\n";
  result ^= static_cast<int>(data0[0]);
  std::cout << "data1[0] = " << static_cast<int>(data1[0]) << "\n";
  result ^= static_cast<int>(data1[0]);
  std::cout << "data2[0] = " << static_cast<int>(data2[0]) << "\n";
  result ^= static_cast<int>(data2[0]);
  std::cout << "data3[0] = " << static_cast<int>(data3[0]) << "\n";
  result ^= static_cast<int>(data3[0]);
  std::cout << "data4[0] = " << static_cast<int>(data4[0]) << "\n";
  result ^= static_cast<int>(data4[0]);
  std::cout << "data5[0] = " << static_cast<int>(data5[0]) << "\n";
  result ^= static_cast<int>(data5[0]);
  std::cout << "data6[0] = " << static_cast<int>(data6[0]) << "\n";
  result ^= static_cast<int>(data6[0]);
  std::cout << "data7[0] = " << static_cast<int>(data7[0]) << "\n";
  result ^= static_cast<int>(data7[0]);
  std::cout << "data8[0] = " << static_cast<int>(data8[0]) << "\n";
  result ^= static_cast<int>(data8[0]);
  std::cout << "data9[0] = " << static_cast<int>(data9[0]) << "\n";
  result ^= static_cast<int>(data9[0]);
  std::cout << "data10[0] = " << static_cast<int>(data10[0]) << "\n";
  result ^= static_cast<int>(data10[0]);
  std::cout << "data11[0] = " << static_cast<int>(data11[0]) << "\n";
  result ^= static_cast<int>(data11[0]);
  std::cout << "data12[0] = " << static_cast<int>(data12[0]) << "\n";
  result ^= static_cast<int>(data12[0]);
  std::cout << "data13[0] = " << static_cast<int>(data13[0]) << "\n";
  result ^= static_cast<int>(data13[0]);
  std::cout << "data14[0] = " << static_cast<int>(data14[0]) << "\n";
  result ^= static_cast<int>(data14[0]);
  std::cout << "data15[0] = " << static_cast<int>(data15[0]) << "\n";
  result ^= static_cast<int>(data15[0]);
  std::cout << "data16[0] = " << static_cast<int>(data16[0]) << "\n";
  result ^= static_cast<int>(data16[0]);
  std::cout << "data17[0] = " << static_cast<int>(data17[0]) << "\n";
  result ^= static_cast<int>(data17[0]);
  std::cout << "data18[0] = " << static_cast<int>(data18[0]) << "\n";
  result ^= static_cast<int>(data18[0]);
  std::cout << "data19[0] = " << static_cast<int>(data19[0]) << "\n";
  result ^= static_cast<int>(data19[0]);
  return result;
}

struct Struct2BytesInt {
  int16_t a0;
};

DART_EXPORT int16_t TakeStruct2BytesIntPointerMany(Struct2BytesInt* data0,
                                                   Struct2BytesInt* data1,
                                                   Struct2BytesInt* data2,
                                                   Struct2BytesInt* data3,
                                                   Struct2BytesInt* data4,
                                                   Struct2BytesInt* data5,
                                                   Struct2BytesInt* data6,
                                                   Struct2BytesInt* data7,
                                                   Struct2BytesInt* data8,
                                                   Struct2BytesInt* data9,
                                                   Struct2BytesInt* data10,
                                                   Struct2BytesInt* data11,
                                                   Struct2BytesInt* data12,
                                                   Struct2BytesInt* data13,
                                                   Struct2BytesInt* data14,
                                                   Struct2BytesInt* data15,
                                                   Struct2BytesInt* data16,
                                                   Struct2BytesInt* data17,
                                                   Struct2BytesInt* data18,
                                                   Struct2BytesInt* data19) {
  int16_t result = 0;
  std::cout << "data0->a0 = " << data0->a0 << "\n";
  result += data0->a0;
  std::cout << "data1->a0 = " << data1->a0 << "\n";
  result += data1->a0;
  std::cout << "data2->a0 = " << data2->a0 << "\n";
  result += data2->a0;
  std::cout << "data3->a0 = " << data3->a0 << "\n";
  result += data3->a0;
  std::cout << "data4->a0 = " << data4->a0 << "\n";
  result += data4->a0;
  std::cout << "data5->a0 = " << data5->a0 << "\n";
  result += data5->a0;
  std::cout << "data6->a0 = " << data6->a0 << "\n";
  result += data6->a0;
  std::cout << "data7->a0 = " << data7->a0 << "\n";
  result += data7->a0;
  std::cout << "data8->a0 = " << data8->a0 << "\n";
  result += data8->a0;
  std::cout << "data9->a0 = " << data9->a0 << "\n";
  result += data9->a0;
  std::cout << "data10->a0 = " << data10->a0 << "\n";
  result += data10->a0;
  std::cout << "data11->a0 = " << data11->a0 << "\n";
  result += data11->a0;
  std::cout << "data12->a0 = " << data12->a0 << "\n";
  result += data12->a0;
  std::cout << "data13->a0 = " << data13->a0 << "\n";
  result += data13->a0;
  std::cout << "data14->a0 = " << data14->a0 << "\n";
  result += data14->a0;
  std::cout << "data15->a0 = " << data15->a0 << "\n";
  result += data15->a0;
  std::cout << "data16->a0 = " << data16->a0 << "\n";
  result += data16->a0;
  std::cout << "data17->a0 = " << data17->a0 << "\n";
  result += data17->a0;
  std::cout << "data18->a0 = " << data18->a0 << "\n";
  result += data18->a0;
  std::cout << "data19->a0 = " << data19->a0 << "\n";
  result += data19->a0;
  return result;
}

union Union2BytesInt {
  int16_t a0;
};

DART_EXPORT int16_t TakeUnion2BytesIntPointerMany(Union2BytesInt* data0,
                                                  Union2BytesInt* data1,
                                                  Union2BytesInt* data2,
                                                  Union2BytesInt* data3,
                                                  Union2BytesInt* data4,
                                                  Union2BytesInt* data5,
                                                  Union2BytesInt* data6,
                                                  Union2BytesInt* data7,
                                                  Union2BytesInt* data8,
                                                  Union2BytesInt* data9,
                                                  Union2BytesInt* data10,
                                                  Union2BytesInt* data11,
                                                  Union2BytesInt* data12,
                                                  Union2BytesInt* data13,
                                                  Union2BytesInt* data14,
                                                  Union2BytesInt* data15,
                                                  Union2BytesInt* data16,
                                                  Union2BytesInt* data17,
                                                  Union2BytesInt* data18,
                                                  Union2BytesInt* data19) {
  int16_t result = 0;
  std::cout << "data0->a0 = " << data0->a0 << "\n";
  result += data0->a0;
  std::cout << "data1->a0 = " << data1->a0 << "\n";
  result += data1->a0;
  std::cout << "data2->a0 = " << data2->a0 << "\n";
  result += data2->a0;
  std::cout << "data3->a0 = " << data3->a0 << "\n";
  result += data3->a0;
  std::cout << "data4->a0 = " << data4->a0 << "\n";
  result += data4->a0;
  std::cout << "data5->a0 = " << data5->a0 << "\n";
  result += data5->a0;
  std::cout << "data6->a0 = " << data6->a0 << "\n";
  result += data6->a0;
  std::cout << "data7->a0 = " << data7->a0 << "\n";
  result += data7->a0;
  std::cout << "data8->a0 = " << data8->a0 << "\n";
  result += data8->a0;
  std::cout << "data9->a0 = " << data9->a0 << "\n";
  result += data9->a0;
  std::cout << "data10->a0 = " << data10->a0 << "\n";
  result += data10->a0;
  std::cout << "data11->a0 = " << data11->a0 << "\n";
  result += data11->a0;
  std::cout << "data12->a0 = " << data12->a0 << "\n";
  result += data12->a0;
  std::cout << "data13->a0 = " << data13->a0 << "\n";
  result += data13->a0;
  std::cout << "data14->a0 = " << data14->a0 << "\n";
  result += data14->a0;
  std::cout << "data15->a0 = " << data15->a0 << "\n";
  result += data15->a0;
  std::cout << "data16->a0 = " << data16->a0 << "\n";
  result += data16->a0;
  std::cout << "data17->a0 = " << data17->a0 << "\n";
  result += data17->a0;
  std::cout << "data18->a0 = " << data18->a0 << "\n";
  result += data18->a0;
  std::cout << "data19->a0 = " << data19->a0 << "\n";
  result += data19->a0;
  return result;
}

}  // namespace dart
