<commit_before>#ifndef FLATBUFFERS_COMMON_READER_H
#define FLATBUFFERS_COMMON_READER_H

/* Generated by flatcc 0.3.6-dev FlatBuffers schema compiler for C by dvide.com */

/* Common FlatBuffers read functionality for C. */

#define PDIAGNOSTIC_IGNORE_UNUSED
#include "flatcc/portable/pdiagnostic_push.h"
#include "flatcc/flatcc_flatbuffers.h"


#define __flatbuffers_read_scalar_at_byteoffset(N, p, o) N ## _read_from_pe((uint8_t *)(p) + (o))
#define __flatbuffers_read_scalar(N, p) N ## _read_from_pe(p)
#define __flatbuffers_read_vt(ID, offset, t)\
flatbuffers_voffset_t offset = 0;\
{   flatbuffers_voffset_t id, *vt;\
    assert(t != 0 && "null pointer table access");\
    id = ID;\
    vt = (flatbuffers_voffset_t *)((uint8_t *)(t) -\
        __flatbuffers_soffset_read_from_pe(t));\
    if (__flatbuffers_voffset_read_from_pe(vt) >= sizeof(vt[0]) * (id + 3)) {\
        offset = __flatbuffers_voffset_read_from_pe(vt + id + 2);\
    }\
}
#define __flatbuffers_field_present(ID, t) { __flatbuffers_read_vt(ID, offset, t) return offset != 0; }
#define __flatbuffers_scalar_field(N, ID, V, t)\
{\
    __flatbuffers_read_vt(ID, offset, t)\
    return offset ? __flatbuffers_read_scalar_at_byteoffset(N, t, offset) : V;\
}
#define __flatbuffers_struct_field(T, ID, t, r)\
{\
    __flatbuffers_read_vt(ID, offset, t)\
    if (offset) {\
        return (T)((uint8_t *)(t) + offset);\
    }\
    assert(!(r) && "required field missing");\
    return 0;\
}
#define __flatbuffers_offset_field(T, ID, t, r, adjust)\
{\
    flatbuffers_uoffset_t *elem;\
    __flatbuffers_read_vt(ID, offset, t)\
    if (offset) {\
        elem = (flatbuffers_uoffset_t *)((uint8_t *)(t) + offset);\
        /* Add sizeof so C api can have raw access past header field. */\
        return (T)((uint8_t *)(elem) + adjust +\
              __flatbuffers_uoffset_read_from_pe(elem));\
    }\
    assert(!(r) && "required field missing");\
    return 0;\
}
#define __flatbuffers_vector_field(T, ID, t, r) __flatbuffers_offset_field(T, ID, t, r, sizeof(flatbuffers_uoffset_t))
#define __flatbuffers_table_field(T, ID, t, r) __flatbuffers_offset_field(T, ID, t, r, 0)
#define __flatbuffers_vec_len(vec)\
{ return (vec) ? (size_t)__flatbuffers_uoffset_read_from_pe((flatbuffers_uoffset_t *)vec - 1) : 0; }
#define __flatbuffers_string_len(s) __flatbuffers_vec_len(s)
static inline size_t flatbuffers_vec_len(const void *vec)
__flatbuffers_vec_len(vec)
#define __flatbuffers_scalar_vec_at(N, vec, i)\
{ assert(flatbuffers_vec_len(vec) > (i) && "index out of range");\
  return __flatbuffers_read_scalar(N, &(vec)[i]); }
#define __flatbuffers_struct_vec_at(vec, i)\
{ assert(flatbuffers_vec_len(vec) > (i) && "index out of range"); return (vec) + (i); }
/* `adjust` skips past the header for string vectors. */
#define __flatbuffers_offset_vec_at(T, vec, i, adjust)\
{ const flatbuffers_uoffset_t *elem = (vec) + (i);\
  assert(flatbuffers_vec_len(vec) > (i) && "index out of range");\
  return (T)((uint8_t *)(elem) + (size_t)__flatbuffers_uoffset_read_from_pe(elem) + adjust); }
#define __flatbuffers_define_scalar_vec_len(N) \
static inline size_t N ## _vec_len(N ##_vec_t vec)\
{ return flatbuffers_vec_len(vec); }
#define __flatbuffers_define_scalar_vec_at(N, T) \
static inline T N ## _vec_at(N ## _vec_t vec, size_t i)\
__flatbuffers_scalar_vec_at(N, vec, i)
typedef const char *flatbuffers_string_t;
static inline size_t flatbuffers_string_len(flatbuffers_string_t s)
__flatbuffers_string_len(s)
typedef const flatbuffers_uoffset_t *flatbuffers_string_vec_t;
typedef flatbuffers_uoffset_t *flatbuffers_string_mutable_vec_t;
static inline size_t flatbuffers_string_vec_len(flatbuffers_string_vec_t vec)
__flatbuffers_vec_len(vec)
static inline flatbuffers_string_t flatbuffers_string_vec_at(flatbuffers_string_vec_t vec, size_t i)
__flatbuffers_offset_vec_at(flatbuffers_string_t, vec, i, sizeof(vec[0]))
typedef const void *flatbuffers_generic_table_t;
#include <string.h>
static size_t flatbuffers_not_found = (size_t)-1;
#define __flatbuffers_identity(n) (n)
/* Subtraction doesn't work for unsigned types. */
#define __flatbuffers_scalar_cmp(x, y, n) ((x) < (y) ? -1 : (x) > (y))
static inline int __flatbuffers_string_n_cmp(flatbuffers_string_t v, const char *s, size_t n)
{ size_t nv = flatbuffers_string_len(v); int x = strncmp(v, s, nv < n ? nv : n);
  return x != 0 ? x : nv < n ? -1 : nv > n; }
/* `n` arg unused, but needed by string find macro expansion. */
static inline int __flatbuffers_string_cmp(flatbuffers_string_t v, const char *s, size_t n) { (void)n; return strcmp(v, s); }
/* A = identity if searching scalar vectors rather than key fields. */
/* Returns lowest matching index not_found. */
#define __flatbuffers_find_by_field(A, V, E, L, K, Kn, T, D)\
{ T v; size_t a = 0, b, m; if (!(b = L(V))) { return flatbuffers_not_found; }\
  --b;\
  while (a < b) {\
    m = a + ((b - a) >> 1);\
    v = A(E(V, m));\
    if ((D(v, (K), (Kn))) < 0) {\
      a = m + 1;\
    } else {\
      b = m;\
    }\
  }\
  if (a == b) {\
    v = A(E(V, a));\
    if (D(v, (K), (Kn)) == 0) {\
       return a;\
    }\
  }\
  return flatbuffers_not_found;\
}
#define __flatbuffers_find_by_scalar_field(A, V, E, L, K, T)\
__flatbuffers_find_by_field(A, V, E, L, K, 0, T, __flatbuffers_scalar_cmp)
#define __flatbuffers_find_by_string_field(A, V, E, L, K)\
__flatbuffers_find_by_field(A, V, E, L, K, 0, flatbuffers_string_t, __flatbuffers_string_cmp)
#define __flatbuffers_find_by_string_n_field(A, V, E, L, K, Kn)\
__flatbuffers_find_by_field(A, V, E, L, K, Kn, flatbuffers_string_t, __flatbuffers_string_n_cmp)
#define __flatbuffers_define_find_by_scalar_field(N, NK, TK)\
static inline size_t N ## _vec_find_by_ ## NK(N ## _vec_t vec, TK key)\
__flatbuffers_find_by_scalar_field(N ## _ ## NK, vec, N ## _vec_at, N ## _vec_len, key, TK)
#define __flatbuffers_define_scalar_find(N, T)\
static inline size_t N ## _vec_find(N ## _vec_t vec, T key)\
__flatbuffers_find_by_scalar_field(__flatbuffers_identity, vec, N ## _vec_at, N ## _vec_len, key, T)
#define __flatbuffers_heap_sort(N, X, A, E, L, TK, TE, D, S)\
static inline void __ ## N ## X ## __heap_sift_down(\
        N ## _mutable_vec_t vec, size_t start, size_t end)\
{ size_t child, root; TK v1, v2, vroot;\
  root = start;\
  while ((root << 1) <= end) {\
    child = root << 1;\
    if (child < end) {\
      v1 = A(E(vec, child));\
      v2 = A(E(vec, child + 1));\
      if (D(v1, v2) < 0) {\
        child++;\
      }\
    }\
    vroot = A(E(vec, root));\
    v1 = A(E(vec, child));\
    if (D(vroot, v1) < 0) {\
      S(vec, root, child, TE);\
      root = child;\
    } else {\
      return;\
    }\
  }\
}\
static inline void __ ## N ## X ## __heap_sort(N ## _mutable_vec_t vec)\
{ size_t start, end, size;\
  size = L(vec); if (size == 0) return; end = size - 1; start = size >> 1;\
  do { __ ## N ## X ## __heap_sift_down(vec, start, end); } while (start--);\
  while (end > 0) { \
    S(vec, 0, end, TE);\
    __ ## N ## X ## __heap_sift_down(vec, 0, --end); } }
#define __flatbuffers_define_sort_by_field(N, NK, TK, TE, D, S)\
  __flatbuffers_heap_sort(N, _sort_by_ ## NK, N ## _ ## NK, N ## _vec_at, N ## _vec_len, TK, TE, D, S)\
static inline void N ## _vec_sort_by_ ## NK(N ## _mutable_vec_t vec)\
{ __ ## N ## _sort_by_ ## NK ## __heap_sort(vec); }
#define __flatbuffers_define_sort(N, TK, TE, D, S)\
__flatbuffers_heap_sort(N, , __flatbuffers_identity, N ## _vec_at, N ## _vec_len, TK, TE, D, S)\
static inline void N ## _vec_sort(N ## _mutable_vec_t vec) { __ ## N ## __heap_sort(vec); }
#define __flatbuffers_scalar_diff(x, y) ((x) < (y) ? -1 : (x) > (y))
#define __flatbuffers_string_diff(x, y) __flatbuffers_string_n_cmp((x), (const char *)(y), flatbuffers_string_len(y))
#define __flatbuffers_scalar_swap(vec, a, b, TE) { TE tmp = vec[b]; vec[b] = vec[a]; vec[a] = tmp; }
#define __flatbuffers_string_swap(vec, a, b, TE)\
{ TE tmp, d; d = (TE)((a - b) * sizeof(vec[0])); tmp = vec[b]; vec[b] = vec[a] + d; vec[a] = tmp - d; }
#define __flatbuffers_define_sort_by_scalar_field(N, NK, TK, TE)\<commit_msg>Update reflection api with recent endian related fixes<commit_after>#ifndef FLATBUFFERS_COMMON_READER_H
#define FLATBUFFERS_COMMON_READER_H

/* Generated by flatcc 0.3.6-dev FlatBuffers schema compiler for C by dvide.com */

/* Common FlatBuffers read functionality for C. */

#define PDIAGNOSTIC_IGNORE_UNUSED
#include "flatcc/portable/pdiagnostic_push.h"
#include "flatcc/flatcc_flatbuffers.h"


#define __flatbuffers_read_scalar_at_byteoffset(N, p, o) N ## _read_from_pe((uint8_t *)(p) + (o))
#define __flatbuffers_read_scalar(N, p) N ## _read_from_pe(p)
#define __flatbuffers_read_vt(ID, offset, t)\
flatbuffers_voffset_t offset = 0;\
{   flatbuffers_voffset_t id, *vt;\
    assert(t != 0 && "null pointer table access");\
    id = ID;\
    vt = (flatbuffers_voffset_t *)((uint8_t *)(t) -\
        __flatbuffers_soffset_read_from_pe(t));\
    if (__flatbuffers_voffset_read_from_pe(vt) >= sizeof(vt[0]) * (id + 3)) {\
        offset = __flatbuffers_voffset_read_from_pe(vt + id + 2);\
    }\
}
#define __flatbuffers_field_present(ID, t) { __flatbuffers_read_vt(ID, offset, t) return offset != 0; }
#define __flatbuffers_scalar_field(N, ID, V, t)\
{\
    __flatbuffers_read_vt(ID, offset, t)\
    return offset ? __flatbuffers_read_scalar_at_byteoffset(N, t, offset) : V;\
}
#define __flatbuffers_struct_field(T, ID, t, r)\
{\
    __flatbuffers_read_vt(ID, offset, t)\
    if (offset) {\
        return (T)((uint8_t *)(t) + offset);\
    }\
    assert(!(r) && "required field missing");\
    return 0;\
}
#define __flatbuffers_offset_field(T, ID, t, r, adjust)\
{\
    flatbuffers_uoffset_t *elem;\
    __flatbuffers_read_vt(ID, offset, t)\
    if (offset) {\
        elem = (flatbuffers_uoffset_t *)((uint8_t *)(t) + offset);\
        /* Add sizeof so C api can have raw access past header field. */\
        return (T)((uint8_t *)(elem) + adjust +\
              __flatbuffers_uoffset_read_from_pe(elem));\
    }\
    assert(!(r) && "required field missing");\
    return 0;\
}
#define __flatbuffers_vector_field(T, ID, t, r) __flatbuffers_offset_field(T, ID, t, r, sizeof(flatbuffers_uoffset_t))
#define __flatbuffers_table_field(T, ID, t, r) __flatbuffers_offset_field(T, ID, t, r, 0)
#define __flatbuffers_vec_len(vec)\
{ return (vec) ? (size_t)__flatbuffers_uoffset_read_from_pe((flatbuffers_uoffset_t *)vec - 1) : 0; }
#define __flatbuffers_string_len(s) __flatbuffers_vec_len(s)
static inline size_t flatbuffers_vec_len(const void *vec)
__flatbuffers_vec_len(vec)
#define __flatbuffers_scalar_vec_at(N, vec, i)\
{ assert(flatbuffers_vec_len(vec) > (i) && "index out of range");\
  return __flatbuffers_read_scalar(N, &(vec)[i]); }
#define __flatbuffers_struct_vec_at(vec, i)\
{ assert(flatbuffers_vec_len(vec) > (i) && "index out of range"); return (vec) + (i); }
/* `adjust` skips past the header for string vectors. */
#define __flatbuffers_offset_vec_at(T, vec, i, adjust)\
{ const flatbuffers_uoffset_t *elem = (vec) + (i);\
  assert(flatbuffers_vec_len(vec) > (i) && "index out of range");\
  return (T)((uint8_t *)(elem) + (size_t)__flatbuffers_uoffset_read_from_pe(elem) + adjust); }
#define __flatbuffers_define_scalar_vec_len(N) \
static inline size_t N ## _vec_len(N ##_vec_t vec)\
{ return flatbuffers_vec_len(vec); }
#define __flatbuffers_define_scalar_vec_at(N, T) \
static inline T N ## _vec_at(N ## _vec_t vec, size_t i)\
__flatbuffers_scalar_vec_at(N, vec, i)
typedef const char *flatbuffers_string_t;
static inline size_t flatbuffers_string_len(flatbuffers_string_t s)
__flatbuffers_string_len(s)
typedef const flatbuffers_uoffset_t *flatbuffers_string_vec_t;
typedef flatbuffers_uoffset_t *flatbuffers_string_mutable_vec_t;
static inline size_t flatbuffers_string_vec_len(flatbuffers_string_vec_t vec)
__flatbuffers_vec_len(vec)
static inline flatbuffers_string_t flatbuffers_string_vec_at(flatbuffers_string_vec_t vec, size_t i)
__flatbuffers_offset_vec_at(flatbuffers_string_t, vec, i, sizeof(vec[0]))
typedef const void *flatbuffers_generic_table_t;
#include <string.h>
static size_t flatbuffers_not_found = (size_t)-1;
#define __flatbuffers_identity(n) (n)
/* Subtraction doesn't work for unsigned types. */
#define __flatbuffers_scalar_cmp(x, y, n) ((x) < (y) ? -1 : (x) > (y))
static inline int __flatbuffers_string_n_cmp(flatbuffers_string_t v, const char *s, size_t n)
{ size_t nv = flatbuffers_string_len(v); int x = strncmp(v, s, nv < n ? nv : n);
  return x != 0 ? x : nv < n ? -1 : nv > n; }
/* `n` arg unused, but needed by string find macro expansion. */
static inline int __flatbuffers_string_cmp(flatbuffers_string_t v, const char *s, size_t n) { (void)n; return strcmp(v, s); }
/* A = identity if searching scalar vectors rather than key fields. */
/* Returns lowest matching index not_found. */
#define __flatbuffers_find_by_field(A, V, E, L, K, Kn, T, D)\
{ T v; size_t a = 0, b, m; if (!(b = L(V))) { return flatbuffers_not_found; }\
  --b;\
  while (a < b) {\
    m = a + ((b - a) >> 1);\
    v = A(E(V, m));\
    if ((D(v, (K), (Kn))) < 0) {\
      a = m + 1;\
    } else {\
      b = m;\
    }\
  }\
  if (a == b) {\
    v = A(E(V, a));\
    if (D(v, (K), (Kn)) == 0) {\
       return a;\
    }\
  }\
  return flatbuffers_not_found;\
}
#define __flatbuffers_find_by_scalar_field(A, V, E, L, K, T)\
__flatbuffers_find_by_field(A, V, E, L, K, 0, T, __flatbuffers_scalar_cmp)
#define __flatbuffers_find_by_string_field(A, V, E, L, K)\
__flatbuffers_find_by_field(A, V, E, L, K, 0, flatbuffers_string_t, __flatbuffers_string_cmp)
#define __flatbuffers_find_by_string_n_field(A, V, E, L, K, Kn)\
__flatbuffers_find_by_field(A, V, E, L, K, Kn, flatbuffers_string_t, __flatbuffers_string_n_cmp)
#define __flatbuffers_define_find_by_scalar_field(N, NK, TK)\
static inline size_t N ## _vec_find_by_ ## NK(N ## _vec_t vec, TK key)\
__flatbuffers_find_by_scalar_field(N ## _ ## NK, vec, N ## _vec_at, N ## _vec_len, key, TK)
#define __flatbuffers_define_scalar_find(N, T)\
static inline size_t N ## _vec_find(N ## _vec_t vec, T key)\
__flatbuffers_find_by_scalar_field(__flatbuffers_identity, vec, N ## _vec_at, N ## _vec_len, key, T)
#define __flatbuffers_heap_sort(N, X, A, E, L, TK, TE, D, S)\
static inline void __ ## N ## X ## __heap_sift_down(\
        N ## _mutable_vec_t vec, size_t start, size_t end)\
{ size_t child, root; TK v1, v2, vroot;\
  root = start;\
  while ((root << 1) <= end) {\
    child = root << 1;\
    if (child < end) {\
      v1 = A(E(vec, child));\
      v2 = A(E(vec, child + 1));\
      if (D(v1, v2) < 0) {\
        child++;\
      }\
    }\
    vroot = A(E(vec, root));\
    v1 = A(E(vec, child));\
    if (D(vroot, v1) < 0) {\
      S(vec, root, child, TE);\
      root = child;\
    } else {\
      return;\
    }\
  }\
}\
static inline void __ ## N ## X ## __heap_sort(N ## _mutable_vec_t vec)\
{ size_t start, end, size;\
  size = L(vec); if (size == 0) return; end = size - 1; start = size >> 1;\
  do { __ ## N ## X ## __heap_sift_down(vec, start, end); } while (start--);\
  while (end > 0) { \
    S(vec, 0, end, TE);\
    __ ## N ## X ## __heap_sift_down(vec, 0, --end); } }
#define __flatbuffers_define_sort_by_field(N, NK, TK, TE, D, S)\
  __flatbuffers_heap_sort(N, _sort_by_ ## NK, N ## _ ## NK, N ## _vec_at, N ## _vec_len, TK, TE, D, S)\
static inline void N ## _vec_sort_by_ ## NK(N ## _mutable_vec_t vec)\
{ __ ## N ## _sort_by_ ## NK ## __heap_sort(vec); }
#define __flatbuffers_define_sort(N, TK, TE, D, S)\
__flatbuffers_heap_sort(N, , __flatbuffers_identity, N ## _vec_at, N ## _vec_len, TK, TE, D, S)\
static inline void N ## _vec_sort(N ## _mutable_vec_t vec) { __ ## N ## __heap_sort(vec); }
#define __flatbuffers_scalar_diff(x, y) ((x) < (y) ? -1 : (x) > (y))
#define __flatbuffers_string_diff(x, y) __flatbuffers_string_n_cmp((x), (const char *)(y), flatbuffers_string_len(y))
#define __flatbuffers_scalar_swap(vec, a, b, TE) { TE tmp = vec[b]; vec[b] = vec[a]; vec[a] = tmp; }
#define __flatbuffers_string_swap(vec, a, b, TE)\
{ TE ta, tb, d;\
  d = (TE)((a - b) * sizeof(vec[0]));\
  ta =  __flatbuffers_uoffset_read_from_pe(vec + b) - d;\
  tb =  __flatbuffers_uoffset_read_from_pe(vec + a) + d;\
  __flatbuffers_uoffset_write_to_pe(vec + a, ta);\
  __flatbuffers_uoffset_write_to_pe(vec + b, tb); }
#define __flatbuffers_define_sort_by_scalar_field(N, NK, TK, TE)\
{'fraction_non_alphanumeric': 0.1537424966311405, 'fraction_numerical': 0.006492711013107926, 'mean_word_length': 4.347854569276122, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6738833', 'n_tokens_mistral': 6663, 'n_tokens_neox': 6537, 'n_words': 1567}