janet_abstract_begin:
 1366|  28.1k|void *janet_abstract_begin(const JanetAbstractType *atype, size_t size) {
 1367|  28.1k|    JanetAbstractHead *header = janet_gcalloc(JANET_MEMORY_NONE,
 1368|  28.1k|        sizeof(JanetAbstractHead) + size);
 1369|  28.1k|    header->size = size;
 1370|  28.1k|    header->type = atype;
 1371|  28.1k|    return (void *) & (header->data);
 1372|  28.1k|}
janet_abstract_end:
 1374|  28.1k|void *janet_abstract_end(void *x) {
 1375|  28.1k|    janet_gc_settype((void *)(janet_abstract_head(x)), JANET_MEMORY_ABSTRACT);
  ------------------
  |  |  656|  28.1k|#define janet_gc_settype(m, t) ((janet_gc_header(m)->flags |= (0xFF & (t))))
  |  |  ------------------
  |  |  |  |  650|  28.1k|#define janet_gc_header(mem) ((JanetGCObject *)(mem))
  |  |  ------------------
  ------------------
 1376|  28.1k|    return x;
 1377|  28.1k|}
janet_abstract:
 1379|  28.1k|void *janet_abstract(const JanetAbstractType *atype, size_t size) {
 1380|  28.1k|    return janet_abstract_end(janet_abstract_begin(atype, size));
 1381|  28.1k|}
janet_array:
 1604|  26.1k|JanetArray *janet_array(int32_t capacity) {
 1605|  26.1k|    JanetArray *array = janet_gcalloc(JANET_MEMORY_ARRAY, sizeof(JanetArray));
 1606|  26.1k|    janet_array_impl(array, capacity);
 1607|  26.1k|    return array;
 1608|  26.1k|}
janet_array_ensure:
 1631|  30.4M|void janet_array_ensure(JanetArray *array, int32_t capacity, int32_t growth) {
 1632|  30.4M|    Janet *newData;
 1633|  30.4M|    Janet *old = array->data;
 1634|  30.4M|    if (capacity <= array->capacity) return;
  ------------------
  |  Branch (1634:9): [True: 30.4M, False: 4.19k]
  ------------------
 1635|  4.19k|    int64_t new_capacity = ((int64_t) capacity) * growth;
 1636|  4.19k|    if (new_capacity > MAX_ARRAY_CAPACITY) new_capacity = MAX_ARRAY_CAPACITY;
  ------------------
  |  | 1584|  4.19k|#define MAX_ARRAY_CAPACITY INT32_MAX
  ------------------
                  if (new_capacity > MAX_ARRAY_CAPACITY) new_capacity = MAX_ARRAY_CAPACITY;
  ------------------
  |  | 1584|      0|#define MAX_ARRAY_CAPACITY INT32_MAX
  ------------------
  |  Branch (1636:9): [True: 0, False: 4.19k]
  ------------------
 1637|  4.19k|    capacity = (int32_t) new_capacity;
 1638|  4.19k|    newData = janet_realloc(old, capacity * sizeof(Janet));
  ------------------
  |  | 2409|  4.19k|#define janet_realloc(X, Y) realloc((X), (Y))
  ------------------
 1639|  4.19k|    if (NULL == newData) {
  ------------------
  |  Branch (1639:9): [True: 0, False: 4.19k]
  ------------------
 1640|      0|        JANET_OUT_OF_MEMORY;
  ------------------
  |  |  419|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (419:122): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1641|      0|    }
 1642|  4.19k|    janet_vm.next_collection += (capacity - array->capacity) * sizeof(Janet);
 1643|  4.19k|    array->data = newData;
 1644|  4.19k|    array->capacity = capacity;
 1645|  4.19k|}
janet_array_push:
 1662|  30.4M|void janet_array_push(JanetArray *array, Janet x) {
 1663|  30.4M|    if (array->count == MAX_ARRAY_CAPACITY) {
  ------------------
  |  | 1584|  30.4M|#define MAX_ARRAY_CAPACITY INT32_MAX
  ------------------
  |  Branch (1663:9): [True: 0, False: 30.4M]
  ------------------
 1664|      0|        janet_panic("array overflow");
 1665|      0|    }
 1666|  30.4M|    int32_t newcount = array->count + 1;
 1667|  30.4M|    janet_array_ensure(array, newcount, 2);
 1668|  30.4M|    array->data[array->count] = x;
 1669|  30.4M|    array->count = newcount;
 1670|  30.4M|}
janet_lib_array:
 1962|  7.06k|void janet_lib_array(JanetTable *env) {
 1963|  7.06k|    JanetRegExt array_cfuns[] = {
 1964|  7.06k|        JANET_CORE_REG("array/new", cfun_array_new),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 1965|  7.06k|        JANET_CORE_REG("array/weak", cfun_array_weak),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 1966|  7.06k|        JANET_CORE_REG("array/new-filled", cfun_array_new_filled),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 1967|  7.06k|        JANET_CORE_REG("array/fill", cfun_array_fill),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 1968|  7.06k|        JANET_CORE_REG("array/pop", cfun_array_pop),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 1969|  7.06k|        JANET_CORE_REG("array/peek", cfun_array_peek),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 1970|  7.06k|        JANET_CORE_REG("array/push", cfun_array_push),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 1971|  7.06k|        JANET_CORE_REG("array/ensure", cfun_array_ensure),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 1972|  7.06k|        JANET_CORE_REG("array/slice", cfun_array_slice),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 1973|  7.06k|        JANET_CORE_REG("array/concat", cfun_array_concat),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 1974|  7.06k|        JANET_CORE_REG("array/insert", cfun_array_insert),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 1975|  7.06k|        JANET_CORE_REG("array/remove", cfun_array_remove),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 1976|  7.06k|        JANET_CORE_REG("array/trim", cfun_array_trim),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 1977|  7.06k|        JANET_CORE_REG("array/clear", cfun_array_clear),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 1978|  7.06k|        JANET_CORE_REG("array/join", cfun_array_join),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 1979|  7.06k|        JANET_REG_END
  ------------------
  |  | 2110|  7.06k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
 1980|  7.06k|    };
 1981|       |    janet_core_cfuns_ext(env, NULL, array_cfuns);
 1982|  7.06k|}
janet_lib_asm:
 3136|  7.06k|void janet_lib_asm(JanetTable *env) {
 3137|  7.06k|    JanetRegExt asm_cfuns[] = {
 3138|  7.06k|        JANET_CORE_REG("asm", cfun_asm),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3139|  7.06k|        JANET_CORE_REG("disasm", cfun_disasm),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3140|  7.06k|        JANET_REG_END
  ------------------
  |  | 2110|  7.06k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
 3141|  7.06k|    };
 3142|       |    janet_core_cfuns_ext(env, NULL, asm_cfuns);
 3143|  7.06k|}
janet_buffer_init:
 3204|  19.5M|JanetBuffer *janet_buffer_init(JanetBuffer *buffer, int32_t capacity) {
 3205|  19.5M|    janet_buffer_init_impl(buffer, capacity);
 3206|  19.5M|    buffer->gc.data.next = NULL;
 3207|  19.5M|    buffer->gc.flags = JANET_MEM_DISABLED;
  ------------------
  |  |  654|  19.5M|#define JANET_MEM_DISABLED 0x200
  ------------------
 3208|  19.5M|    return buffer;
 3209|  19.5M|}
janet_buffer_deinit:
 3224|  19.5M|void janet_buffer_deinit(JanetBuffer *buffer) {
 3225|  19.5M|    if (!(buffer->gc.flags & JANET_BUFFER_FLAG_NO_REALLOC)) {
  ------------------
  |  | 1780|  19.5M|#define JANET_BUFFER_FLAG_NO_REALLOC 0x10000
  ------------------
  |  Branch (3225:9): [True: 19.5M, False: 0]
  ------------------
 3226|  19.5M|        janet_free(buffer->data);
  ------------------
  |  | 2415|  19.5M|#define janet_free(X) free((X))
  ------------------
 3227|       |        buffer->data = NULL;
 3228|  19.5M|    }
 3229|  19.5M|}
janet_buffer:
 3232|  13.6k|JanetBuffer *janet_buffer(int32_t capacity) {
 3233|  13.6k|    JanetBuffer *buffer = janet_gcalloc(JANET_MEMORY_BUFFER, sizeof(JanetBuffer));
 3234|  13.6k|    return janet_buffer_init_impl(buffer, capacity);
 3235|  13.6k|}
janet_buffer_extra:
 3268|   802M|void janet_buffer_extra(JanetBuffer *buffer, int32_t n) {
 3269|       |    /* Check for buffer overflow */
 3270|   802M|    if ((int64_t)n + buffer->count > INT32_MAX) {
  ------------------
  |  Branch (3270:9): [True: 0, False: 802M]
  ------------------
 3271|      0|        janet_panic("buffer overflow");
 3272|      0|    }
 3273|   802M|    int32_t new_size = buffer->count + n;
 3274|   802M|    if (new_size > buffer->capacity) {
  ------------------
  |  Branch (3274:9): [True: 22.4M, False: 779M]
  ------------------
 3275|  22.4M|        janet_buffer_can_realloc(buffer);
 3276|  22.4M|        int32_t new_capacity = (new_size > (INT32_MAX / 2)) ? INT32_MAX : (new_size * 2);
  ------------------
  |  Branch (3276:32): [True: 0, False: 22.4M]
  ------------------
 3277|  22.4M|        uint8_t *new_data = janet_realloc(buffer->data, new_capacity * sizeof(uint8_t));
  ------------------
  |  | 2409|  22.4M|#define janet_realloc(X, Y) realloc((X), (Y))
  ------------------
 3278|  22.4M|        janet_gcpressure(new_capacity - buffer->capacity);
 3279|  22.4M|        if (NULL == new_data) {
  ------------------
  |  Branch (3279:13): [True: 0, False: 22.4M]
  ------------------
 3280|      0|            JANET_OUT_OF_MEMORY;
  ------------------
  |  |  419|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (419:122): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3281|      0|        }
 3282|  22.4M|        buffer->data = new_data;
 3283|  22.4M|        buffer->capacity = new_capacity;
 3284|  22.4M|    }
 3285|   802M|}
janet_buffer_push_cstring:
 3288|  33.9M|void janet_buffer_push_cstring(JanetBuffer *buffer, const char *cstring) {
 3289|  33.9M|    int32_t len = (int32_t) strlen(cstring);
 3290|  33.9M|    janet_buffer_push_bytes(buffer, (const uint8_t *) cstring, len);
 3291|  33.9M|}
janet_buffer_push_bytes:
 3294|   118M|void janet_buffer_push_bytes(JanetBuffer *buffer, const uint8_t *string, int32_t length) {
 3295|   118M|    if (0 == length) return;
  ------------------
  |  Branch (3295:9): [True: 1.48M, False: 117M]
  ------------------
 3296|   117M|    janet_buffer_extra(buffer, length);
 3297|   117M|    memcpy(buffer->data + buffer->count, string, length);
 3298|   117M|    buffer->count += length;
 3299|   117M|}
janet_buffer_push_u8:
 3306|   642M|void janet_buffer_push_u8(JanetBuffer *buffer, uint8_t byte) {
 3307|   642M|    janet_buffer_extra(buffer, 1);
 3308|   642M|    buffer->data[buffer->count] = byte;
 3309|   642M|    buffer->count++;
 3310|   642M|}
janet_lib_buffer:
 3830|  7.06k|void janet_lib_buffer(JanetTable *env) {
 3831|  7.06k|    JanetRegExt buffer_cfuns[] = {
 3832|  7.06k|        JANET_CORE_REG("buffer/new", cfun_buffer_new),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3833|  7.06k|        JANET_CORE_REG("buffer/new-filled", cfun_buffer_new_filled),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3834|  7.06k|        JANET_CORE_REG("buffer/from-bytes", cfun_buffer_frombytes),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3835|  7.06k|        JANET_CORE_REG("buffer/fill", cfun_buffer_fill),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3836|  7.06k|        JANET_CORE_REG("buffer/trim", cfun_buffer_trim),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3837|  7.06k|        JANET_CORE_REG("buffer/push-byte", cfun_buffer_u8),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3838|  7.06k|        JANET_CORE_REG("buffer/push-word", cfun_buffer_word),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3839|  7.06k|        JANET_CORE_REG("buffer/push-string", cfun_buffer_chars),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3840|  7.06k|        JANET_CORE_REG("buffer/push-uint16", cfun_buffer_push_uint16),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3841|  7.06k|        JANET_CORE_REG("buffer/push-uint32", cfun_buffer_push_uint32),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3842|  7.06k|        JANET_CORE_REG("buffer/push-uint64", cfun_buffer_push_uint64),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3843|  7.06k|        JANET_CORE_REG("buffer/push-float32", cfun_buffer_push_float32),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3844|  7.06k|        JANET_CORE_REG("buffer/push-float64", cfun_buffer_push_float64),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3845|  7.06k|        JANET_CORE_REG("buffer/push", cfun_buffer_push),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3846|  7.06k|        JANET_CORE_REG("buffer/push-at", cfun_buffer_push_at),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3847|  7.06k|        JANET_CORE_REG("buffer/popn", cfun_buffer_popn),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3848|  7.06k|        JANET_CORE_REG("buffer/clear", cfun_buffer_clear),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3849|  7.06k|        JANET_CORE_REG("buffer/slice", cfun_buffer_slice),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3850|  7.06k|        JANET_CORE_REG("buffer/bit-set", cfun_buffer_bitset),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3851|  7.06k|        JANET_CORE_REG("buffer/bit-clear", cfun_buffer_bitclear),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3852|  7.06k|        JANET_CORE_REG("buffer/bit", cfun_buffer_bitget),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3853|  7.06k|        JANET_CORE_REG("buffer/bit-toggle", cfun_buffer_bittoggle),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3854|  7.06k|        JANET_CORE_REG("buffer/blit", cfun_buffer_blit),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3855|  7.06k|        JANET_CORE_REG("buffer/format", cfun_buffer_format),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3856|  7.06k|        JANET_CORE_REG("buffer/format-at", cfun_buffer_format_at),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3857|  7.06k|        JANET_REG_END
  ------------------
  |  | 2110|  7.06k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
 3858|  7.06k|    };
 3859|       |    janet_core_cfuns_ext(env, NULL, buffer_cfuns);
 3860|  7.06k|}
janet_verify:
 5637|  3.79M|int janet_verify(JanetFuncDef *def) {
 5638|       |    /* vararg, structarg and namedargs each reserve a tuple slot at index arity */
 5639|  3.79M|    int vargs = !!(def->flags & (JANET_FUNCDEF_FLAG_VARARG | JANET_FUNCDEF_FLAG_STRUCTARG | JANET_FUNCDEF_FLAG_NAMEDARGS));
  ------------------
  |  | 1097|  3.79M|#define JANET_FUNCDEF_FLAG_VARARG 0x10000
  ------------------
                  int vargs = !!(def->flags & (JANET_FUNCDEF_FLAG_VARARG | JANET_FUNCDEF_FLAG_STRUCTARG | JANET_FUNCDEF_FLAG_NAMEDARGS));
  ------------------
  |  | 1105|  3.79M|#define JANET_FUNCDEF_FLAG_STRUCTARG 0x1000000
  ------------------
                  int vargs = !!(def->flags & (JANET_FUNCDEF_FLAG_VARARG | JANET_FUNCDEF_FLAG_STRUCTARG | JANET_FUNCDEF_FLAG_NAMEDARGS));
  ------------------
  |  | 1107|  3.79M|#define JANET_FUNCDEF_FLAG_NAMEDARGS 0x4000000
  ------------------
 5640|  3.79M|    int32_t i;
 5641|  3.79M|    int32_t maxslot = def->arity + vargs;
 5642|  3.79M|    int32_t sc = def->slotcount;
 5643|       |
 5644|  3.79M|    if (def->environments_length > 256) return 15;
  ------------------
  |  Branch (5644:9): [True: 0, False: 3.79M]
  ------------------
 5645|  3.79M|    if (def->bytecode_length == 0) return 1;
  ------------------
  |  Branch (5645:9): [True: 0, False: 3.79M]
  ------------------
 5646|       |
 5647|       |    /* Named args are the first named_args_count constants, so the count must fit the constant array */
 5648|  3.79M|    if ((def->flags & JANET_FUNCDEF_FLAG_NAMEDARGS) &&
  ------------------
  |  | 1107|  3.79M|#define JANET_FUNCDEF_FLAG_NAMEDARGS 0x4000000
  ------------------
  |  Branch (5648:9): [True: 14.1k, False: 3.77M]
  ------------------
 5649|  14.1k|            (def->named_args_count < 0 || def->named_args_count > def->constants_length))
  ------------------
  |  Branch (5649:14): [True: 0, False: 14.1k]
  |  Branch (5649:43): [True: 0, False: 14.1k]
  ------------------
 5650|      0|        return 17;
 5651|       |
 5652|       |    /* Environment indices must be -1 or non-negative */
 5653|  5.19M|    for (i = 0; i < def->environments_length; i++) {
  ------------------
  |  Branch (5653:17): [True: 1.40M, False: 3.79M]
  ------------------
 5654|  1.40M|        if (def->environments[i] < -1) return 16;
  ------------------
  |  Branch (5654:13): [True: 0, False: 1.40M]
  ------------------
 5655|  1.40M|    }
 5656|       |
 5657|  3.79M|    if (maxslot > sc) return 2;
  ------------------
  |  Branch (5657:9): [True: 0, False: 3.79M]
  ------------------
 5658|       |
 5659|       |    /* Verify each instruction */
 5660|   108M|    for (i = 0; i < def->bytecode_length; i++) {
  ------------------
  |  Branch (5660:17): [True: 104M, False: 3.79M]
  ------------------
 5661|   104M|        uint32_t instr = def->bytecode[i];
 5662|       |        /* Check for invalid instructions */
 5663|   104M|        if ((instr & 0x7F) >= JOP_INSTRUCTION_COUNT) {
  ------------------
  |  Branch (5663:13): [True: 0, False: 104M]
  ------------------
 5664|      0|            return 3;
 5665|      0|        }
 5666|   104M|        enum JanetInstructionType type = janet_instructions[instr & 0x7F];
 5667|   104M|        switch (type) {
  ------------------
  |  Branch (5667:17): [True: 104M, False: 0]
  ------------------
 5668|   550k|            case JINT_0:
  ------------------
  |  Branch (5668:13): [True: 550k, False: 104M]
  ------------------
 5669|   550k|                continue;
 5670|  20.0M|            case JINT_S: {
  ------------------
  |  Branch (5670:13): [True: 20.0M, False: 84.7M]
  ------------------
 5671|  20.0M|                if ((int32_t)(instr >> 8) >= sc) return 4;
  ------------------
  |  Branch (5671:21): [True: 0, False: 20.0M]
  ------------------
 5672|  20.0M|                continue;
 5673|  20.0M|            }
 5674|  20.0M|            case JINT_SI:
  ------------------
  |  Branch (5674:13): [True: 2.39M, False: 102M]
  ------------------
 5675|  2.39M|            case JINT_SU:
  ------------------
  |  Branch (5675:13): [True: 0, False: 104M]
  ------------------
 5676|  2.39M|            case JINT_ST: {
  ------------------
  |  Branch (5676:13): [True: 0, False: 104M]
  ------------------
 5677|  2.39M|                if ((int32_t)((instr >> 8) & 0xFF) >= sc) return 4;
  ------------------
  |  Branch (5677:21): [True: 0, False: 2.39M]
  ------------------
 5678|  2.39M|                continue;
 5679|  2.39M|            }
 5680|  4.39M|            case JINT_L: {
  ------------------
  |  Branch (5680:13): [True: 4.39M, False: 100M]
  ------------------
 5681|  4.39M|                int32_t jumpdest = i + (((int32_t)instr) >> 8);
 5682|  4.39M|                if (jumpdest < 0 || jumpdest >= def->bytecode_length) return 5;
  ------------------
  |  Branch (5682:21): [True: 0, False: 4.39M]
  |  Branch (5682:37): [True: 0, False: 4.39M]
  ------------------
 5683|  4.39M|                continue;
 5684|  4.39M|            }
 5685|  28.0M|            case JINT_SS: {
  ------------------
  |  Branch (5685:13): [True: 28.0M, False: 76.7M]
  ------------------
 5686|  28.0M|                if ((int32_t)((instr >> 8) & 0xFF) >= sc ||
  ------------------
  |  Branch (5686:21): [True: 0, False: 28.0M]
  ------------------
 5687|  28.0M|                        (int32_t)(instr >> 16) >= sc) return 4;
  ------------------
  |  Branch (5687:25): [True: 0, False: 28.0M]
  ------------------
 5688|  28.0M|                continue;
 5689|  28.0M|            }
 5690|  28.0M|            case JINT_SSI:
  ------------------
  |  Branch (5690:13): [True: 1.84M, False: 102M]
  ------------------
 5691|  2.93M|            case JINT_SSU: {
  ------------------
  |  Branch (5691:13): [True: 1.09M, False: 103M]
  ------------------
 5692|  2.93M|                if ((int32_t)((instr >> 8) & 0xFF) >= sc ||
  ------------------
  |  Branch (5692:21): [True: 0, False: 2.93M]
  ------------------
 5693|  2.93M|                        (int32_t)((instr >> 16) & 0xFF) >= sc) return 4;
  ------------------
  |  Branch (5693:25): [True: 0, False: 2.93M]
  ------------------
 5694|  2.93M|                continue;
 5695|  2.93M|            }
 5696|  7.64M|            case JINT_SL: {
  ------------------
  |  Branch (5696:13): [True: 7.64M, False: 97.1M]
  ------------------
 5697|  7.64M|                int32_t jumpdest = i + (((int32_t)instr) >> 16);
 5698|  7.64M|                if ((int32_t)((instr >> 8) & 0xFF) >= sc) return 4;
  ------------------
  |  Branch (5698:21): [True: 0, False: 7.64M]
  ------------------
 5699|  7.64M|                if (jumpdest < 0 || jumpdest >= def->bytecode_length) return 5;
  ------------------
  |  Branch (5699:21): [True: 0, False: 7.64M]
  |  Branch (5699:37): [True: 0, False: 7.64M]
  ------------------
 5700|  7.64M|                continue;
 5701|  7.64M|            }
 5702|  14.0M|            case JINT_SSS: {
  ------------------
  |  Branch (5702:13): [True: 14.0M, False: 90.7M]
  ------------------
 5703|  14.0M|                if (((int32_t)(instr >> 8) & 0xFF) >= sc ||
  ------------------
  |  Branch (5703:21): [True: 0, False: 14.0M]
  ------------------
 5704|  14.0M|                        ((int32_t)(instr >> 16) & 0xFF) >= sc ||
  ------------------
  |  Branch (5704:25): [True: 0, False: 14.0M]
  ------------------
 5705|  14.0M|                        ((int32_t)(instr >> 24) & 0xFF) >= sc) return 4;
  ------------------
  |  Branch (5705:25): [True: 0, False: 14.0M]
  ------------------
 5706|  14.0M|                continue;
 5707|  14.0M|            }
 5708|  14.0M|            case JINT_SD: {
  ------------------
  |  Branch (5708:13): [True: 1.11M, False: 103M]
  ------------------
 5709|  1.11M|                if ((int32_t)((instr >> 8) & 0xFF) >= sc) return 4;
  ------------------
  |  Branch (5709:21): [True: 0, False: 1.11M]
  ------------------
 5710|  1.11M|                if ((int32_t)(instr >> 16) >= def->defs_length) return 6;
  ------------------
  |  Branch (5710:21): [True: 0, False: 1.11M]
  ------------------
 5711|  1.11M|                continue;
 5712|  1.11M|            }
 5713|  19.1M|            case JINT_SC: {
  ------------------
  |  Branch (5713:13): [True: 19.1M, False: 85.6M]
  ------------------
 5714|  19.1M|                if ((int32_t)((instr >> 8) & 0xFF) >= sc) return 4;
  ------------------
  |  Branch (5714:21): [True: 0, False: 19.1M]
  ------------------
 5715|  19.1M|                if ((int32_t)(instr >> 16) >= def->constants_length) return 7;
  ------------------
  |  Branch (5715:21): [True: 0, False: 19.1M]
  ------------------
 5716|  19.1M|                continue;
 5717|  19.1M|            }
 5718|  19.1M|            case JINT_SES: {
  ------------------
  |  Branch (5718:13): [True: 4.36M, False: 100M]
  ------------------
 5719|       |                /* How can we check the last slot index? We need info parent funcdefs. Resort
 5720|       |                 * to runtime checks for now. Maybe invalid upvalue references could be defaulted
 5721|       |                 * to nil? (don't commit to this in the long term, though) */
 5722|  4.36M|                if ((int32_t)((instr >> 8) & 0xFF) >= sc) return 4;
  ------------------
  |  Branch (5722:21): [True: 0, False: 4.36M]
  ------------------
 5723|  4.36M|                if ((int32_t)((instr >> 16) & 0xFF) >= def->environments_length) return 8;
  ------------------
  |  Branch (5723:21): [True: 0, False: 4.36M]
  ------------------
 5724|  4.36M|                continue;
 5725|  4.36M|            }
 5726|   104M|        }
 5727|   104M|    }
 5728|       |
 5729|       |    /* Verify last instruction is either a jump, return, return-nil, or tailcall. Eventually,
 5730|       |     * some real flow analysis would be ideal, but this should be very effective. Will completely
 5731|       |     * prevent running over the end of bytecode. However, valid functions with dead code will
 5732|       |     * be rejected. */
 5733|  3.79M|    {
 5734|  3.79M|        uint32_t lastop = def->bytecode[def->bytecode_length - 1] & 0xFF;
 5735|  3.79M|        switch (lastop) {
 5736|      0|            default:
  ------------------
  |  Branch (5736:13): [True: 0, False: 3.79M]
  ------------------
 5737|      0|                return 9;
 5738|  2.22M|            case JOP_RETURN:
  ------------------
  |  Branch (5738:13): [True: 2.22M, False: 1.56M]
  ------------------
 5739|  2.51M|            case JOP_RETURN_NIL:
  ------------------
  |  Branch (5739:13): [True: 289k, False: 3.50M]
  ------------------
 5740|  2.52M|            case JOP_JUMP:
  ------------------
  |  Branch (5740:13): [True: 7.06k, False: 3.78M]
  ------------------
 5741|  2.57M|            case JOP_ERROR:
  ------------------
  |  Branch (5741:13): [True: 49.4k, False: 3.74M]
  ------------------
 5742|  3.79M|            case JOP_TAILCALL:
  ------------------
  |  Branch (5742:13): [True: 1.22M, False: 2.57M]
  ------------------
 5743|  3.79M|                break;
 5744|  3.79M|        }
 5745|  3.79M|    }
 5746|       |
 5747|       |    /* Verify debug info - slotmapping, etc. */
 5748|  39.7M|    for (int32_t i = def->symbolmap_length - 1; i >= 0; i--) {
  ------------------
  |  Branch (5748:49): [True: 35.9M, False: 3.79M]
  ------------------
 5749|  35.9M|        JanetSymbolMap jsm = def->symbolmap[i];
 5750|  35.9M|        if (jsm.birth_pc == UINT32_MAX) {
  ------------------
  |  Branch (5750:13): [True: 18.5M, False: 17.4M]
  ------------------
 5751|  18.5M|            if (jsm.death_pc >= (uint32_t) def->environments_length) {
  ------------------
  |  Branch (5751:17): [True: 0, False: 18.5M]
  ------------------
 5752|      0|                return 10;
 5753|       |                /* We should also check jsm.slot_index */
 5754|      0|            }
 5755|  18.5M|        } else {
 5756|  17.4M|            if (jsm.slot_index >= (uint32_t) def->slotcount) {
  ------------------
  |  Branch (5756:17): [True: 0, False: 17.4M]
  ------------------
 5757|      0|                return 11;
 5758|      0|            }
 5759|  17.4M|            if (jsm.birth_pc != UINT32_MAX && jsm.birth_pc >= (uint32_t) def->bytecode_length) {
  ------------------
  |  Branch (5759:17): [True: 17.4M, False: 0]
  |  Branch (5759:47): [True: 0, False: 17.4M]
  ------------------
 5760|      0|                return 12;
 5761|      0|            }
 5762|  17.4M|            if (jsm.death_pc != UINT32_MAX && jsm.death_pc > (uint32_t) def->bytecode_length) {
  ------------------
  |  Branch (5762:17): [True: 17.4M, False: 0]
  |  Branch (5762:47): [True: 0, False: 17.4M]
  ------------------
 5763|      0|                return 13;
 5764|      0|            }
 5765|  17.4M|        }
 5766|  35.9M|        if (jsm.symbol == NULL) {
  ------------------
  |  Branch (5766:13): [True: 0, False: 35.9M]
  ------------------
 5767|      0|            return 14;
 5768|      0|        }
 5769|  35.9M|    }
 5770|       |
 5771|  3.79M|    return 0;
 5772|  3.79M|}
janet_signalv:
 5882|  2.75k|void janet_signalv(JanetSignal sig, Janet message) {
 5883|  2.75k|    if (janet_vm.return_reg != NULL) {
  ------------------
  |  Branch (5883:9): [True: 2.75k, False: 0]
  ------------------
 5884|       |        /* Should match logic in janet_call for coercing everything not ok to an error (no awaits, yields, etc.) */
 5885|  2.75k|        if (janet_vm.coerce_error && sig != JANET_SIGNAL_OK) {
  ------------------
  |  Branch (5885:13): [True: 0, False: 2.75k]
  |  Branch (5885:38): [True: 0, False: 0]
  ------------------
 5886|      0|#ifdef JANET_EV
 5887|      0|            if (NULL != janet_vm.root_fiber && sig == JANET_SIGNAL_EVENT) {
  ------------------
  |  Branch (5887:17): [True: 0, False: 0]
  |  Branch (5887:48): [True: 0, False: 0]
  ------------------
 5888|      0|                janet_vm.root_fiber->sched_id++;
 5889|      0|            }
 5890|      0|#endif
 5891|      0|            if (sig != JANET_SIGNAL_ERROR) {
  ------------------
  |  Branch (5891:17): [True: 0, False: 0]
  ------------------
 5892|      0|                message = janet_wrap_string(janet_formatc("%v coerced from %s to error", message, janet_signal_names[sig]));
  ------------------
  |  |  848|      0|#define janet_wrap_string(s) janet_nanbox_wrap_c((s), JANET_STRING)
  |  |  ------------------
  |  |  |  |  828|      0|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5893|      0|            }
 5894|      0|            sig = JANET_SIGNAL_ERROR;
 5895|      0|        }
 5896|  2.75k|        *janet_vm.return_reg = message;
 5897|  2.75k|        if (NULL != janet_vm.fiber) {
  ------------------
  |  Branch (5897:13): [True: 0, False: 2.75k]
  ------------------
 5898|      0|            janet_vm.fiber->flags |= JANET_FIBER_DID_LONGJUMP;
  ------------------
  |  |  814|      0|#define JANET_FIBER_DID_LONGJUMP     0x8000000
  ------------------
 5899|      0|        }
 5900|       |#if defined(JANET_BSD) || defined(JANET_APPLE)
 5901|       |        _longjmp(*janet_vm.signal_buf, sig);
 5902|       |#else
 5903|  2.75k|        longjmp(*janet_vm.signal_buf, sig);
 5904|  2.75k|#endif
 5905|  2.75k|    } else {
 5906|      0|        const char *str = (const char *)janet_formatc("janet top level signal - %v\n", message);
 5907|      0|        janet_top_level_signal(str);
 5908|      0|    }
 5909|  2.75k|}
janet_panicv:
 5911|  2.75k|void janet_panicv(Janet message) {
 5912|  2.75k|    janet_signalv(JANET_SIGNAL_ERROR, message);
 5913|  2.75k|}
janet_panicf:
 5915|  2.74k|void janet_panicf(const char *format, ...) {
 5916|  2.74k|    va_list args;
 5917|  2.74k|    const uint8_t *ret;
 5918|  2.74k|    JanetBuffer buffer;
 5919|  2.74k|    int32_t len = 0;
 5920|  66.1k|    while (format[len]) len++;
  ------------------
  |  Branch (5920:12): [True: 63.4k, False: 2.74k]
  ------------------
 5921|  2.74k|    janet_buffer_init(&buffer, len);
 5922|  2.74k|    va_start(args, format);
 5923|  2.74k|    janet_formatbv(&buffer, format, args);
 5924|       |    va_end(args);
 5925|  2.74k|    ret = janet_string(buffer.data, buffer.count);
 5926|  2.74k|    janet_buffer_deinit(&buffer);
 5927|  2.74k|    janet_panics(ret);
 5928|  2.74k|}
janet_panics:
 5934|  2.74k|void janet_panics(const uint8_t *message) {
 5935|  2.74k|    janet_panicv(janet_wrap_string(message));
  ------------------
  |  |  848|  2.74k|#define janet_wrap_string(s) janet_nanbox_wrap_c((s), JANET_STRING)
  |  |  ------------------
  |  |  |  |  828|  2.74k|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  2.74k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  2.74k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5936|  2.74k|}
janet_arity:
 5951|  5.06k|void janet_arity(int32_t arity, int32_t min, int32_t max) {
 5952|  5.06k|    if (min >= 0 && arity < min)
  ------------------
  |  Branch (5952:9): [True: 5.06k, False: 0]
  |  Branch (5952:21): [True: 0, False: 5.06k]
  ------------------
 5953|      0|        janet_panicf("arity mismatch, expected at least %d, got %d", min, arity);
 5954|  5.06k|    if (max >= 0 && arity > max)
  ------------------
  |  Branch (5954:9): [True: 0, False: 5.06k]
  |  Branch (5954:21): [True: 0, False: 0]
  ------------------
 5955|      0|        janet_panicf("arity mismatch, expected at most %d, got %d", max, arity);
 5956|  5.06k|}
janet_getbytes:
 6250|  2.33k|JanetByteView janet_getbytes(const Janet *argv, int32_t n) {
 6251|  2.33k|    Janet x = argv[n];
 6252|  2.33k|    JanetByteView view;
 6253|  2.33k|    if (!janet_bytes_view(x, &view.bytes, &view.len)) {
  ------------------
  |  Branch (6253:9): [True: 0, False: 2.33k]
  ------------------
 6254|      0|        janet_panic_type(x, n, JANET_TFLAG_BYTES);
  ------------------
  |  |  612|      0|#define JANET_TFLAG_BYTES (JANET_TFLAG_STRING | JANET_TFLAG_SYMBOL | JANET_TFLAG_BUFFER | JANET_TFLAG_KEYWORD)
  |  |  ------------------
  |  |  |  |  599|      0|#define JANET_TFLAG_STRING (1 << JANET_STRING)
  |  |  ------------------
  |  |               #define JANET_TFLAG_BYTES (JANET_TFLAG_STRING | JANET_TFLAG_SYMBOL | JANET_TFLAG_BUFFER | JANET_TFLAG_KEYWORD)
  |  |  ------------------
  |  |  |  |  600|      0|#define JANET_TFLAG_SYMBOL (1 << JANET_SYMBOL)
  |  |  ------------------
  |  |               #define JANET_TFLAG_BYTES (JANET_TFLAG_STRING | JANET_TFLAG_SYMBOL | JANET_TFLAG_BUFFER | JANET_TFLAG_KEYWORD)
  |  |  ------------------
  |  |  |  |  606|      0|#define JANET_TFLAG_BUFFER (1 << JANET_BUFFER)
  |  |  ------------------
  |  |               #define JANET_TFLAG_BYTES (JANET_TFLAG_STRING | JANET_TFLAG_SYMBOL | JANET_TFLAG_BUFFER | JANET_TFLAG_KEYWORD)
  |  |  ------------------
  |  |  |  |  601|      0|#define JANET_TFLAG_KEYWORD (1 << JANET_KEYWORD)
  |  |  ------------------
  ------------------
 6255|      0|    }
 6256|  2.33k|    return view;
 6257|  2.33k|}
janet_dyn:
 6291|  19.9M|Janet janet_dyn(const char *name) {
 6292|  19.9M|    if (!janet_vm.fiber) {
  ------------------
  |  Branch (6292:9): [True: 19.9M, False: 0]
  ------------------
 6293|  19.9M|        if (!janet_vm.top_dyns) return janet_wrap_nil();
  ------------------
  |  |  831|  19.9M|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|  19.9M|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  19.9M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  19.9M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6293:13): [True: 19.9M, False: 0]
  ------------------
 6294|      0|        return janet_table_get(janet_vm.top_dyns, janet_ckeywordv(name));
  ------------------
  |  | 1843|      0|#define janet_ckeywordv(cstr) janet_wrap_keyword(janet_ckeyword(cstr))
  |  |  ------------------
  |  |  |  |  850|      0|#define janet_wrap_keyword(s) janet_nanbox_wrap_c((s), JANET_KEYWORD)
  |  |  |  |  ------------------
  |  |  |  |  |  |  828|      0|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6295|  19.9M|    }
 6296|      0|    if (janet_vm.fiber->env) {
  ------------------
  |  Branch (6296:9): [True: 0, False: 0]
  ------------------
 6297|      0|        return janet_table_get_keyword(janet_vm.fiber->env, name);
 6298|      0|    } else {
 6299|      0|        return janet_wrap_nil();
  ------------------
  |  |  831|      0|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|      0|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6300|      0|    }
 6301|      0|}
janet_lib_compile:
 8278|  7.06k|void janet_lib_compile(JanetTable *env) {
 8279|  7.06k|    JanetRegExt cfuns[] = {
 8280|  7.06k|        JANET_CORE_REG("compile", cfun_compile),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 8281|  7.06k|        JANET_REG_END
  ------------------
  |  | 2110|  7.06k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
 8282|  7.06k|    };
 8283|       |    janet_core_cfuns_ext(env, NULL, cfuns);
 8284|  7.06k|}
janet_core_env:
 9689|  7.06k|JanetTable *janet_core_env(JanetTable *replacements) {
 9690|       |    /* Memoize core env, ignoring replacements the second time around. */
 9691|  7.06k|    if (NULL != janet_vm.core_env) {
  ------------------
  |  Branch (9691:9): [True: 0, False: 7.06k]
  ------------------
 9692|      0|        return janet_vm.core_env;
 9693|      0|    }
 9694|       |
 9695|  7.06k|    JanetTable *dict = janet_core_lookup_table(replacements);
 9696|       |
 9697|       |    /* Unmarshal bytecode */
 9698|  7.06k|    Janet marsh_out = janet_unmarshal(
 9699|  7.06k|                          janet_core_image,
 9700|  7.06k|                          janet_core_image_size,
 9701|  7.06k|                          0,
 9702|  7.06k|                          dict,
 9703|  7.06k|                          NULL);
 9704|       |
 9705|       |    /* Memoize */
 9706|  7.06k|    janet_gcroot(marsh_out);
 9707|  7.06k|    JanetTable *env = janet_unwrap_table(marsh_out);
  ------------------
  |  |  861|  7.06k|#define janet_unwrap_table(x) ((JanetTable *)janet_nanbox_to_pointer(x))
  ------------------
 9708|  7.06k|    janet_vm.core_env = env;
 9709|       |
 9710|       |    /* Invert image dict manually here. We can't do this in boot.janet as it
 9711|       |     * breaks deterministic builds */
 9712|  7.06k|    Janet lidv, midv;
 9713|  7.06k|    lidv = midv = janet_wrap_nil();
  ------------------
  |  |  831|  7.06k|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|  7.06k|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  7.06k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  7.06k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9714|  7.06k|    janet_resolve(env, janet_csymbol("load-image-dict"), &lidv);
 9715|  7.06k|    janet_resolve(env, janet_csymbol("make-image-dict"), &midv);
 9716|       |
 9717|       |    /* Check that we actually got tables - if we are using a smaller corelib, may not exist */
 9718|  7.06k|    if (janet_checktype(lidv, JANET_TABLE) && janet_checktype(midv, JANET_TABLE)) {
  ------------------
  |  |  806|  14.1k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 7.06k, False: 0]
  |  |  |  Branch (806:6): [Folded, False: 7.06k]
  |  |  ------------------
  |  |  807|  14.1k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  14.1k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  7.06k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  7.06k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  7.06k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  7.06k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if (janet_checktype(lidv, JANET_TABLE) && janet_checktype(midv, JANET_TABLE)) {
  ------------------
  |  |  806|  7.06k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 7.06k, False: 0]
  |  |  |  Branch (806:6): [Folded, False: 7.06k]
  |  |  ------------------
  |  |  807|  7.06k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  7.06k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  7.06k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  7.06k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  7.06k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  7.06k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9719|  7.06k|        JanetTable *lid = janet_unwrap_table(lidv);
  ------------------
  |  |  861|  7.06k|#define janet_unwrap_table(x) ((JanetTable *)janet_nanbox_to_pointer(x))
  ------------------
 9720|  7.06k|        JanetTable *mid = janet_unwrap_table(midv);
  ------------------
  |  |  861|  7.06k|#define janet_unwrap_table(x) ((JanetTable *)janet_nanbox_to_pointer(x))
  ------------------
 9721|  14.4M|        for (int32_t i = 0; i < lid->capacity; i++) {
  ------------------
  |  Branch (9721:29): [True: 14.4M, False: 7.06k]
  ------------------
 9722|  14.4M|            const JanetKV *kv = lid->data + i;
 9723|  14.4M|            if (!janet_checktype(kv->key, JANET_NIL)) {
  ------------------
  |  |  806|  14.4M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 14.4M]
  |  |  ------------------
  |  |  807|  14.4M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  14.4M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  14.4M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  14.4M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  14.4M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  14.4M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (9723:17): [True: 4.65M, False: 9.80M]
  ------------------
 9724|  4.65M|                janet_table_put(mid, kv->value, kv->key);
 9725|  4.65M|            }
 9726|  14.4M|        }
 9727|  7.06k|    }
 9728|       |
 9729|  7.06k|    return env;
 9730|  7.06k|}
janet_core_lookup_table:
 9734|  7.06k|JanetTable *janet_core_lookup_table(JanetTable *replacements) {
 9735|  7.06k|    JanetTable *dict = janet_table(512);
 9736|  7.06k|    janet_load_libs(dict);
 9737|       |
 9738|       |    /* Add replacements */
 9739|  7.06k|    if (replacements != NULL) {
  ------------------
  |  Branch (9739:9): [True: 0, False: 7.06k]
  ------------------
 9740|      0|        for (int32_t i = 0; i < replacements->capacity; i++) {
  ------------------
  |  Branch (9740:29): [True: 0, False: 0]
  ------------------
 9741|      0|            JanetKV kv = replacements->data[i];
 9742|      0|            if (!janet_checktype(kv.key, JANET_NIL)) {
  ------------------
  |  |  806|      0|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 0]
  |  |  ------------------
  |  |  807|      0|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|      0|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|      0|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|      0|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (9742:17): [True: 0, False: 0]
  ------------------
 9743|      0|                janet_table_put(dict, kv.key, kv.value);
 9744|       |                /* Add replacement functions to registry? */
 9745|      0|            }
 9746|      0|        }
 9747|      0|    }
 9748|       |
 9749|  7.06k|    return dict;
 9750|  7.06k|}
janet_lib_debug:
10204|  7.06k|void janet_lib_debug(JanetTable *env) {
10205|  7.06k|    JanetRegExt debug_cfuns[] = {
10206|  7.06k|        JANET_CORE_REG("debug/break", cfun_debug_break),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
10207|  7.06k|        JANET_CORE_REG("debug/unbreak", cfun_debug_unbreak),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
10208|  7.06k|        JANET_CORE_REG("debug/fbreak", cfun_debug_fbreak),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
10209|  7.06k|        JANET_CORE_REG("debug/unfbreak", cfun_debug_unfbreak),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
10210|  7.06k|        JANET_CORE_REG("debug/arg-stack", cfun_debug_argstack),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
10211|  7.06k|        JANET_CORE_REG("debug/stack", cfun_debug_stack),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
10212|  7.06k|        JANET_CORE_REG("debug/stacktrace", cfun_debug_stacktrace),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
10213|  7.06k|        JANET_CORE_REG("debug/lineage", cfun_debug_lineage),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
10214|  7.06k|        JANET_CORE_REG("debug/step", cfun_debug_step),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
10215|  7.06k|        JANET_REG_END
  ------------------
  |  | 2110|  7.06k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
10216|  7.06k|    };
10217|       |    janet_core_cfuns_ext(env, NULL, debug_cfuns);
10218|  7.06k|}
janet_ev_init_common:
11184|  7.06k|void janet_ev_init_common(void) {
11185|  7.06k|    janet_q_init(&janet_vm.spawn);
11186|  7.06k|    janet_vm.tq = NULL;
11187|  7.06k|    janet_vm.tq_count = 0;
11188|  7.06k|    janet_vm.tq_capacity = 0;
11189|  7.06k|    janet_table_init_raw(&janet_vm.threaded_abstracts, 0);
11190|  7.06k|    janet_table_init_raw(&janet_vm.active_tasks, 0);
11191|  7.06k|    janet_table_init_raw(&janet_vm.signal_handlers, 0);
11192|  7.06k|    janet_rng_seed(&janet_vm.ev_rng, 0);
11193|  7.06k|#ifndef JANET_WINDOWS
11194|  7.06k|    pthread_attr_init(&janet_vm.new_thread_attr);
11195|       |    pthread_attr_setdetachstate(&janet_vm.new_thread_attr, PTHREAD_CREATE_DETACHED);
11196|  7.06k|#endif
11197|  7.06k|}
janet_ev_deinit_common:
11230|  7.06k|void janet_ev_deinit_common(void) {
11231|  7.06k|    JanetTimeout to;
11232|  7.06k|    while (peek_timeout(&to)) {
  ------------------
  |  Branch (11232:12): [True: 0, False: 7.06k]
  ------------------
11233|      0|        handle_timeout_worker(to, 1);
11234|      0|        pop_timeout(0);
11235|      0|    }
11236|  7.06k|    janet_q_deinit(&janet_vm.spawn);
11237|  7.06k|    janet_free(janet_vm.tq);
  ------------------
  |  | 2415|  7.06k|#define janet_free(X) free((X))
  ------------------
11238|  7.06k|    janet_table_deinit(&janet_vm.threaded_abstracts);
11239|  7.06k|    janet_table_deinit(&janet_vm.active_tasks);
11240|  7.06k|    janet_table_deinit(&janet_vm.signal_handlers);
11241|  7.06k|#ifndef JANET_WINDOWS
11242|  7.06k|    pthread_attr_destroy(&janet_vm.new_thread_attr);
11243|  7.06k|#endif
11244|  7.06k|}
janet_ev_init:
12522|  7.06k|void janet_ev_init(void) {
12523|  7.06k|    janet_ev_init_common();
12524|  7.06k|    janet_ev_setup_selfpipe();
12525|  7.06k|    janet_vm.epoll = epoll_create1(EPOLL_CLOEXEC);
12526|  7.06k|    janet_vm.timerfd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC | TFD_NONBLOCK);
12527|  7.06k|    janet_vm.timer_enabled = 0;
12528|  7.06k|    if (janet_vm.epoll == -1 || janet_vm.timerfd == -1) goto error;
  ------------------
  |  Branch (12528:9): [True: 0, False: 7.06k]
  |  Branch (12528:33): [True: 0, False: 7.06k]
  ------------------
12529|  7.06k|    struct epoll_event ev;
12530|  7.06k|    ev.events = EPOLLIN | EPOLLET;
12531|  7.06k|    ev.data.ptr = &janet_vm.timerfd;
12532|  7.06k|    if (-1 == epoll_ctl(janet_vm.epoll, EPOLL_CTL_ADD, janet_vm.timerfd, &ev)) goto error;
  ------------------
  |  Branch (12532:9): [True: 0, False: 7.06k]
  ------------------
12533|  7.06k|    ev.events = EPOLLIN | EPOLLET;
12534|  7.06k|    ev.data.ptr = janet_vm.selfpipe;
12535|  7.06k|    if (-1 == epoll_ctl(janet_vm.epoll, EPOLL_CTL_ADD, janet_vm.selfpipe[0], &ev)) goto error;
  ------------------
  |  Branch (12535:9): [True: 0, False: 7.06k]
  ------------------
12536|  7.06k|    return;
12537|  7.06k|error:
12538|       |    JANET_EXIT("failed to initialize event loop");
  ------------------
  |  |  378|      0|#define JANET_EXIT(m) do { \
  |  |  379|      0|    fprintf(stderr, "janet abort at %s:%d: %s\n",\
  |  |  380|      0|        __FILE__,\
  |  |  381|      0|        __LINE__,\
  |  |  382|      0|        (m));\
  |  |  383|      0|    abort();\
  |  |  384|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (384:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
12539|      0|}
janet_ev_deinit:
12541|  7.06k|void janet_ev_deinit(void) {
12542|  7.06k|    janet_ev_deinit_common();
12543|  7.06k|    close(janet_vm.epoll);
12544|  7.06k|    close(janet_vm.timerfd);
12545|  7.06k|    janet_ev_cleanup_selfpipe();
12546|  7.06k|    janet_vm.epoll = 0;
12547|  7.06k|}
janet_make_pipe:
13644|  7.06k|int janet_make_pipe(JanetHandle handles[2], int mode) {
13645|       |#ifdef JANET_WINDOWS
13646|       |    /*
13647|       |     * On windows, the built in CreatePipe function doesn't support overlapped IO
13648|       |     * so we lift from the windows source code and modify for our own version.
13649|       |     */
13650|       |    JanetHandle shandle, chandle;
13651|       |    CHAR PipeNameBuffer[MAX_PATH];
13652|       |    SECURITY_ATTRIBUTES saAttr;
13653|       |    memset(&saAttr, 0, sizeof(saAttr));
13654|       |    saAttr.nLength = sizeof(saAttr);
13655|       |    saAttr.bInheritHandle = TRUE;
13656|       |    if (mode == 3) {
13657|       |        /* No overlapped IO involved, just call CreatePipe */
13658|       |        if (!CreatePipe(handles, handles + 1, &saAttr, 0)) return -1;
13659|       |        return 0;
13660|       |    }
13661|       |    snprintf(PipeNameBuffer,
13662|       |             sizeof(PipeNameBuffer),
13663|       |             "\\\\.\\Pipe\\JanetPipeFile.%08x.%08x",
13664|       |             (unsigned int) GetCurrentProcessId(),
13665|       |             (unsigned int) InterlockedIncrement(&PipeSerialNumber));
13666|       |
13667|       |    /* server handle goes to subprocess */
13668|       |    shandle = CreateNamedPipeA(
13669|       |                  PipeNameBuffer,
13670|       |                  (mode == 2 ? PIPE_ACCESS_INBOUND : PIPE_ACCESS_OUTBOUND) | FILE_FLAG_OVERLAPPED,
13671|       |                  PIPE_TYPE_BYTE | PIPE_WAIT,
13672|       |                  255,           /* Max number of pipes for duplication. */
13673|       |                  4096,          /* Out buffer size */
13674|       |                  4096,          /* In buffer size */
13675|       |                  120 * 1000,    /* Timeout in ms */
13676|       |                  &saAttr);
13677|       |    if (shandle == INVALID_HANDLE_VALUE) {
13678|       |        return -1;
13679|       |    }
13680|       |
13681|       |    /* we keep client handle */
13682|       |    chandle = CreateFileA(
13683|       |                  PipeNameBuffer,
13684|       |                  (mode == 2 ? GENERIC_WRITE : GENERIC_READ),
13685|       |                  0,
13686|       |                  &saAttr,
13687|       |                  OPEN_EXISTING,
13688|       |                  FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED,
13689|       |                  NULL);
13690|       |
13691|       |    if (chandle == INVALID_HANDLE_VALUE) {
13692|       |        CloseHandle(shandle);
13693|       |        return -1;
13694|       |    }
13695|       |    if (mode == 2) {
13696|       |        handles[0] = shandle;
13697|       |        handles[1] = chandle;
13698|       |    } else {
13699|       |        handles[0] = chandle;
13700|       |        handles[1] = shandle;
13701|       |    }
13702|       |    return 0;
13703|       |#else
13704|  7.06k|    if (pipe(handles)) return -1;
  ------------------
  |  Branch (13704:9): [True: 0, False: 7.06k]
  ------------------
13705|  7.06k|    if (mode != 2 && fcntl(handles[0], F_SETFD, FD_CLOEXEC)) goto error;
  ------------------
  |  Branch (13705:9): [True: 7.06k, False: 0]
  |  Branch (13705:22): [True: 0, False: 7.06k]
  ------------------
13706|  7.06k|    if (mode != 1 && fcntl(handles[1], F_SETFD, FD_CLOEXEC)) goto error;
  ------------------
  |  Branch (13706:9): [True: 0, False: 7.06k]
  |  Branch (13706:22): [True: 0, False: 0]
  ------------------
13707|  7.06k|    if (mode != 2 && mode != 3 && fcntl(handles[0], F_SETFL, O_NONBLOCK)) goto error;
  ------------------
  |  Branch (13707:9): [True: 7.06k, False: 0]
  |  Branch (13707:22): [True: 7.06k, False: 0]
  |  Branch (13707:35): [True: 0, False: 7.06k]
  ------------------
13708|  7.06k|    if (mode != 1 && mode != 3 && fcntl(handles[1], F_SETFL, O_NONBLOCK)) goto error;
  ------------------
  |  Branch (13708:9): [True: 0, False: 7.06k]
  |  Branch (13708:22): [True: 0, False: 0]
  |  Branch (13708:35): [True: 0, False: 0]
  ------------------
13709|  7.06k|    return 0;
13710|      0|error:
13711|      0|    close(handles[0]);
13712|      0|    close(handles[1]);
13713|      0|    return -1;
13714|  7.06k|#endif
13715|  7.06k|}
janet_lib_ev:
14300|  7.06k|void janet_lib_ev(JanetTable *env) {
14301|  7.06k|    JanetRegExt ev_cfuns_ext[] = {
14302|  7.06k|        JANET_CORE_REG("ev/give", cfun_channel_push),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14303|  7.06k|        JANET_CORE_REG("ev/take", cfun_channel_pop),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14304|  7.06k|        JANET_CORE_REG("ev/full", cfun_channel_full),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14305|  7.06k|        JANET_CORE_REG("ev/capacity", cfun_channel_capacity),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14306|  7.06k|        JANET_CORE_REG("ev/count", cfun_channel_count),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14307|  7.06k|        JANET_CORE_REG("ev/select", cfun_channel_choice),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14308|  7.06k|        JANET_CORE_REG("ev/rselect", cfun_channel_rchoice),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14309|  7.06k|        JANET_CORE_REG("ev/chan", cfun_channel_new),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14310|  7.06k|        JANET_CORE_REG("ev/thread-chan", cfun_channel_new_threaded),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14311|  7.06k|        JANET_CORE_REG("ev/chan-close", cfun_channel_close),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14312|  7.06k|        JANET_CORE_REG("ev/go", cfun_ev_go),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14313|  7.06k|        JANET_CORE_REG("ev/thread", cfun_ev_thread),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14314|  7.06k|        JANET_CORE_REG("ev/give-supervisor", cfun_ev_give_supervisor),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14315|  7.06k|        JANET_CORE_REG("ev/sleep", cfun_ev_sleep),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14316|  7.06k|        JANET_CORE_REG("ev/deadline", cfun_ev_deadline),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14317|  7.06k|        JANET_CORE_REG("ev/cancel", cfun_ev_cancel),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14318|  7.06k|        JANET_CORE_REG("ev/close", janet_cfun_stream_close),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14319|  7.06k|        JANET_CORE_REG("ev/read", janet_cfun_stream_read),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14320|  7.06k|        JANET_CORE_REG("ev/chunk", janet_cfun_stream_chunk),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14321|  7.06k|        JANET_CORE_REG("ev/write", janet_cfun_stream_write),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14322|  7.06k|        JANET_CORE_REG("ev/lock", janet_cfun_mutex),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14323|  7.06k|        JANET_CORE_REG("ev/acquire-lock", janet_cfun_mutex_acquire),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14324|  7.06k|        JANET_CORE_REG("ev/release-lock", janet_cfun_mutex_release),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14325|  7.06k|        JANET_CORE_REG("ev/rwlock", janet_cfun_rwlock),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14326|  7.06k|        JANET_CORE_REG("ev/acquire-rlock", janet_cfun_rwlock_read_lock),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14327|  7.06k|        JANET_CORE_REG("ev/acquire-wlock", janet_cfun_rwlock_write_lock),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14328|  7.06k|        JANET_CORE_REG("ev/release-rlock", janet_cfun_rwlock_read_release),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14329|  7.06k|        JANET_CORE_REG("ev/release-wlock", janet_cfun_rwlock_write_release),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14330|  7.06k|        JANET_CORE_REG("ev/to-file", janet_cfun_to_file),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14331|  7.06k|        JANET_CORE_REG("ev/all-tasks", janet_cfun_ev_all_tasks),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14332|  7.06k|        JANET_REG_END
  ------------------
  |  | 2110|  7.06k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
14333|  7.06k|    };
14334|       |
14335|       |    janet_core_cfuns_ext(env, NULL, ev_cfuns_ext);
14336|  7.06k|    janet_register_abstract_type(&janet_stream_type);
14337|  7.06k|    janet_register_abstract_type(&janet_channel_type);
14338|  7.06k|    janet_register_abstract_type(&janet_mutex_type);
14339|  7.06k|    janet_register_abstract_type(&janet_rwlock_type);
14340|  7.06k|}
janet_lib_ffi:
16273|  7.06k|void janet_lib_ffi(JanetTable *env) {
16274|  7.06k|    JanetRegExt ffi_cfuns[] = {
16275|  7.06k|        JANET_CORE_REG("ffi/native", janet_core_raw_native),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16276|  7.06k|        JANET_CORE_REG("ffi/lookup", janet_core_native_lookup),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16277|  7.06k|        JANET_CORE_REG("ffi/close", janet_core_native_close),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16278|  7.06k|        JANET_CORE_REG("ffi/signature", cfun_ffi_signature),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16279|  7.06k|        JANET_CORE_REG("ffi/call", cfun_ffi_call),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16280|  7.06k|        JANET_CORE_REG("ffi/struct", cfun_ffi_struct),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16281|  7.06k|        JANET_CORE_REG("ffi/write", cfun_ffi_buffer_write),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16282|  7.06k|        JANET_CORE_REG("ffi/read", cfun_ffi_buffer_read),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16283|  7.06k|        JANET_CORE_REG("ffi/size", cfun_ffi_size),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16284|  7.06k|        JANET_CORE_REG("ffi/align", cfun_ffi_align),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16285|  7.06k|        JANET_CORE_REG("ffi/trampoline", cfun_ffi_get_callback_trampoline),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16286|  7.06k|        JANET_CORE_REG("ffi/jitfn", cfun_ffi_jitfn),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16287|  7.06k|        JANET_CORE_REG("ffi/malloc", cfun_ffi_malloc),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16288|  7.06k|        JANET_CORE_REG("ffi/free", cfun_ffi_free),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16289|  7.06k|        JANET_CORE_REG("ffi/pointer-buffer", cfun_ffi_pointer_buffer),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16290|  7.06k|        JANET_CORE_REG("ffi/pointer-cfunction", cfun_ffi_pointer_cfunction),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16291|  7.06k|        JANET_CORE_REG("ffi/calling-conventions", cfun_ffi_supported_calling_conventions),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16292|  7.06k|        JANET_REG_END
  ------------------
  |  | 2110|  7.06k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
16293|  7.06k|    };
16294|       |    janet_core_cfuns_ext(env, NULL, ffi_cfuns);
16295|  7.06k|}
janet_lib_fiber:
16975|  7.06k|void janet_lib_fiber(JanetTable *env) {
16976|  7.06k|    JanetRegExt fiber_cfuns[] = {
16977|  7.06k|        JANET_CORE_REG("fiber/new", cfun_fiber_new),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16978|  7.06k|        JANET_CORE_REG("fiber/status", cfun_fiber_status),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16979|  7.06k|        JANET_CORE_REG("fiber/root", cfun_fiber_root),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16980|  7.06k|        JANET_CORE_REG("fiber/current", cfun_fiber_current),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16981|  7.06k|        JANET_CORE_REG("fiber/maxstack", cfun_fiber_maxstack),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16982|  7.06k|        JANET_CORE_REG("fiber/setmaxstack", cfun_fiber_setmaxstack),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16983|  7.06k|        JANET_CORE_REG("fiber/getenv", cfun_fiber_getenv),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16984|  7.06k|        JANET_CORE_REG("fiber/setenv", cfun_fiber_setenv),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16985|  7.06k|        JANET_CORE_REG("fiber/can-resume?", cfun_fiber_can_resume),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16986|  7.06k|        JANET_CORE_REG("fiber/last-value", cfun_fiber_last_value),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16987|  7.06k|        JANET_REG_END
  ------------------
  |  | 2110|  7.06k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
16988|  7.06k|    };
16989|       |    janet_core_cfuns_ext(env, NULL, fiber_cfuns);
16990|  7.06k|}
janet_lib_filewatch:
17985|  7.06k|void janet_lib_filewatch(JanetTable *env) {
17986|  7.06k|    JanetRegExt cfuns[] = {
17987|  7.06k|        JANET_CORE_REG("filewatch/new", cfun_filewatch_make),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
17988|  7.06k|        JANET_CORE_REG("filewatch/add", cfun_filewatch_add),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
17989|  7.06k|        JANET_CORE_REG("filewatch/remove", cfun_filewatch_remove),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
17990|  7.06k|        JANET_CORE_REG("filewatch/listen", cfun_filewatch_listen),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
17991|  7.06k|        JANET_CORE_REG("filewatch/unlisten", cfun_filewatch_unlisten),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
17992|  7.06k|        JANET_REG_END
  ------------------
  |  | 2110|  7.06k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
17993|  7.06k|    };
17994|       |    janet_core_cfuns_ext(env, NULL, cfuns);
17995|  7.06k|}
janet_gcpressure:
18055|  41.9M|void janet_gcpressure(size_t s) {
18056|  41.9M|    janet_vm.next_collection += s;
18057|  41.9M|}
janet_gcalloc:
18529|  50.1M|void *janet_gcalloc(enum JanetMemoryType type, size_t size) {
18530|  50.1M|    JanetGCObject *mem;
18531|       |
18532|       |    /* Make sure everything is inited */
18533|  50.1M|    janet_assert(NULL != janet_vm.cache, "please initialize janet before use");
  ------------------
  |  |  389|  50.1M|#define janet_assert(c, m) do { \
  |  |  390|  50.1M|    if (!(c)) JANET_EXIT((m)); \
  |  |  ------------------
  |  |  |  |  378|      0|#define JANET_EXIT(m) do { \
  |  |  |  |  379|      0|    fprintf(stderr, "janet abort at %s:%d: %s\n",\
  |  |  |  |  380|      0|        __FILE__,\
  |  |  |  |  381|      0|        __LINE__,\
  |  |  |  |  382|      0|        (m));\
  |  |  |  |  383|      0|    abort();\
  |  |  |  |  384|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (384:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (390:9): [True: 0, False: 50.1M]
  |  |  ------------------
  |  |  391|  50.1M|} while (0)
  |  |  ------------------
  |  |  |  Branch (391:10): [Folded, False: 50.1M]
  |  |  ------------------
  ------------------
18534|  50.1M|    mem = janet_malloc(size);
  ------------------
  |  | 2406|  50.1M|#define janet_malloc(X) malloc((X))
  ------------------
18535|       |
18536|       |    /* Check for bad malloc */
18537|  50.1M|    if (NULL == mem) {
  ------------------
  |  Branch (18537:9): [True: 0, False: 50.1M]
  ------------------
18538|      0|        JANET_OUT_OF_MEMORY;
  ------------------
  |  |  419|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (419:122): [Folded, False: 0]
  |  |  ------------------
  ------------------
18539|      0|    }
18540|       |
18541|       |    /* Configure block */
18542|  50.1M|    mem->flags = type;
18543|       |
18544|       |    /* Prepend block to heap list */
18545|  50.1M|    janet_vm.next_collection += size;
18546|  50.1M|    if (type < JANET_MEMORY_TABLE_WEAKK) {
  ------------------
  |  Branch (18546:9): [True: 50.1M, False: 0]
  ------------------
18547|       |        /* normal heap */
18548|  50.1M|        mem->data.next = janet_vm.blocks;
18549|  50.1M|        janet_vm.blocks = mem;
18550|  50.1M|    } else {
18551|       |        /* weak heap */
18552|      0|        mem->data.next = janet_vm.weak_blocks;
18553|      0|        janet_vm.weak_blocks = mem;
18554|      0|    }
18555|  50.1M|    janet_vm.block_count++;
18556|       |
18557|  50.1M|    return (void *)mem;
18558|  50.1M|}
janet_gcroot:
18619|  14.1k|void janet_gcroot(Janet root) {
18620|  14.1k|    size_t newcount = janet_vm.root_count + 1;
18621|  14.1k|    if (newcount > janet_vm.root_capacity) {
  ------------------
  |  Branch (18621:9): [True: 7.06k, False: 7.06k]
  ------------------
18622|  7.06k|        size_t newcap = 2 * newcount;
18623|  7.06k|        janet_vm.roots = janet_realloc(janet_vm.roots, sizeof(Janet) * newcap);
  ------------------
  |  | 2409|  7.06k|#define janet_realloc(X, Y) realloc((X), (Y))
  ------------------
18624|  7.06k|        if (NULL == janet_vm.roots) {
  ------------------
  |  Branch (18624:13): [True: 0, False: 7.06k]
  ------------------
18625|      0|            JANET_OUT_OF_MEMORY;
  ------------------
  |  |  419|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (419:122): [Folded, False: 0]
  |  |  ------------------
  ------------------
18626|      0|        }
18627|  7.06k|        janet_vm.root_capacity = newcap;
18628|  7.06k|    }
18629|  14.1k|    janet_vm.roots[janet_vm.root_count] = root;
18630|  14.1k|    janet_vm.root_count = newcount;
18631|  14.1k|}
janet_clear_memory:
18677|  7.06k|void janet_clear_memory(void) {
18678|  7.06k|#ifdef JANET_EV
18679|  7.06k|    JanetKV *items = janet_vm.threaded_abstracts.data;
18680|  14.1k|    for (int32_t i = 0; i < janet_vm.threaded_abstracts.capacity; i++) {
  ------------------
  |  Branch (18680:25): [True: 7.06k, False: 7.06k]
  ------------------
18681|  7.06k|        if (janet_checktype(items[i].key, JANET_ABSTRACT)) {
  ------------------
  |  |  806|  7.06k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 0, False: 7.06k]
  |  |  |  Branch (806:6): [Folded, False: 7.06k]
  |  |  ------------------
  |  |  807|  7.06k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  7.06k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  7.06k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  7.06k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  7.06k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  7.06k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
18682|      0|            void *abst = janet_unwrap_abstract(items[i].key);
  ------------------
  |  |  866|      0|#define janet_unwrap_abstract(x) (janet_nanbox_to_pointer(x))
  ------------------
18683|      0|            JanetAbstractHead *head = janet_abstract_head(abst);
  ------------------
  |  | 1897|      0|#define janet_abstract_head(u) ((JanetAbstractHead *)((char *)u - offsetof(JanetAbstractHead, data)))
  ------------------
18684|      0|            if (head->type->gcperthread) {
  ------------------
  |  Branch (18684:17): [True: 0, False: 0]
  ------------------
18685|      0|                janet_assert(!head->type->gcperthread(head->data, head->size), "per-thread finalizer failed");
  ------------------
  |  |  389|      0|#define janet_assert(c, m) do { \
  |  |  390|      0|    if (!(c)) JANET_EXIT((m)); \
  |  |  ------------------
  |  |  |  |  378|      0|#define JANET_EXIT(m) do { \
  |  |  |  |  379|      0|    fprintf(stderr, "janet abort at %s:%d: %s\n",\
  |  |  |  |  380|      0|        __FILE__,\
  |  |  |  |  381|      0|        __LINE__,\
  |  |  |  |  382|      0|        (m));\
  |  |  |  |  383|      0|    abort();\
  |  |  |  |  384|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (384:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (390:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  391|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (391:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
18686|      0|            }
18687|      0|            janet_abstract_decref_maybe_free(abst);
18688|      0|        }
18689|  7.06k|    }
18690|  7.06k|#endif
18691|  7.06k|    JanetGCObject *current = janet_vm.blocks;
18692|  50.1M|    while (NULL != current) {
  ------------------
  |  Branch (18692:12): [True: 50.1M, False: 7.06k]
  ------------------
18693|  50.1M|        janet_deinit_block(current);
18694|  50.1M|        JanetGCObject *next = current->data.next;
18695|  50.1M|        janet_free(current);
  ------------------
  |  | 2415|  50.1M|#define janet_free(X) free((X))
  ------------------
18696|  50.1M|        current = next;
18697|  50.1M|    }
18698|  7.06k|    janet_vm.blocks = NULL;
18699|  7.06k|    janet_free_all_scratch();
18700|  7.06k|    janet_free(janet_vm.scratch_mem);
  ------------------
  |  | 2415|  7.06k|#define janet_free(X) free((X))
  ------------------
18701|  7.06k|}
janet_smalloc:
18715|  25.6M|void *janet_smalloc(size_t size) {
18716|  25.6M|    JanetScratch *s = janet_malloc(sizeof(JanetScratch) + size);
  ------------------
  |  | 2406|  25.6M|#define janet_malloc(X) malloc((X))
  ------------------
18717|  25.6M|    if (NULL == s) {
  ------------------
  |  Branch (18717:9): [True: 0, False: 25.6M]
  ------------------
18718|      0|        JANET_OUT_OF_MEMORY;
  ------------------
  |  |  419|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (419:122): [Folded, False: 0]
  |  |  ------------------
  ------------------
18719|      0|    }
18720|  25.6M|    s->finalize = NULL;
18721|  25.6M|    if (janet_vm.scratch_len == janet_vm.scratch_cap) {
  ------------------
  |  Branch (18721:9): [True: 14.9k, False: 25.6M]
  ------------------
18722|  14.9k|        size_t newcap = 2 * janet_vm.scratch_cap + 2;
18723|  14.9k|        JanetScratch **newmem = (JanetScratch **) janet_realloc(janet_vm.scratch_mem, newcap * sizeof(JanetScratch));
  ------------------
  |  | 2409|  14.9k|#define janet_realloc(X, Y) realloc((X), (Y))
  ------------------
18724|  14.9k|        if (NULL == newmem) {
  ------------------
  |  Branch (18724:13): [True: 0, False: 14.9k]
  ------------------
18725|      0|            JANET_OUT_OF_MEMORY;
  ------------------
  |  |  419|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (419:122): [Folded, False: 0]
  |  |  ------------------
  ------------------
18726|      0|        }
18727|  14.9k|        janet_vm.scratch_cap = newcap;
18728|  14.9k|        janet_vm.scratch_mem = newmem;
18729|  14.9k|    }
18730|  25.6M|    janet_vm.scratch_mem[janet_vm.scratch_len++] = s;
18731|  25.6M|    return (char *)(s->mem);
18732|  25.6M|}
janet_srealloc:
18744|  5.56M|void *janet_srealloc(void *mem, size_t size) {
18745|  5.56M|    if (NULL == mem) return janet_smalloc(size);
  ------------------
  |  Branch (18745:9): [True: 4.74M, False: 820k]
  ------------------
18746|   820k|    JanetScratch *s = janet_mem2scratch(mem);
18747|   820k|    if (janet_vm.scratch_len) {
  ------------------
  |  Branch (18747:9): [True: 820k, False: 0]
  ------------------
18748|   954k|        for (size_t i = janet_vm.scratch_len - 1; ; i--) {
18749|   954k|            if (janet_vm.scratch_mem[i] == s) {
  ------------------
  |  Branch (18749:17): [True: 820k, False: 134k]
  ------------------
18750|   820k|                JanetScratch *news = janet_realloc(s, size + sizeof(JanetScratch));
  ------------------
  |  | 2409|   820k|#define janet_realloc(X, Y) realloc((X), (Y))
  ------------------
18751|   820k|                if (NULL == news) {
  ------------------
  |  Branch (18751:21): [True: 0, False: 820k]
  ------------------
18752|      0|                    JANET_OUT_OF_MEMORY;
  ------------------
  |  |  419|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (419:122): [Folded, False: 0]
  |  |  ------------------
  ------------------
18753|      0|                }
18754|   820k|                janet_vm.scratch_mem[i] = news;
18755|   820k|                return (char *)(news->mem);
18756|   820k|            }
18757|   134k|            if (i == 0) break;
  ------------------
  |  Branch (18757:17): [True: 0, False: 134k]
  ------------------
18758|   134k|        }
18759|   820k|    }
18760|      0|    JANET_EXIT("invalid janet_srealloc");
  ------------------
  |  |  378|      0|#define JANET_EXIT(m) do { \
  |  |  379|      0|    fprintf(stderr, "janet abort at %s:%d: %s\n",\
  |  |  380|      0|        __FILE__,\
  |  |  381|      0|        __LINE__,\
  |  |  382|      0|        (m));\
  |  |  383|      0|    abort();\
  |  |  384|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (384:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
18761|      0|}
janet_sfree:
18768|  20.9M|void janet_sfree(void *mem) {
18769|  20.9M|    if (NULL == mem) return;
  ------------------
  |  Branch (18769:9): [True: 0, False: 20.9M]
  ------------------
18770|  20.9M|    JanetScratch *s = janet_mem2scratch(mem);
18771|  20.9M|    if (janet_vm.scratch_len) {
  ------------------
  |  Branch (18771:9): [True: 20.9M, False: 0]
  ------------------
18772|  28.7M|        for (size_t i = janet_vm.scratch_len - 1; ; i--) {
18773|  28.7M|            if (janet_vm.scratch_mem[i] == s) {
  ------------------
  |  Branch (18773:17): [True: 20.9M, False: 7.79M]
  ------------------
18774|  20.9M|                janet_vm.scratch_mem[i] = janet_vm.scratch_mem[--janet_vm.scratch_len];
18775|  20.9M|                free_one_scratch(s);
18776|  20.9M|                return;
18777|  20.9M|            }
18778|  7.79M|            if (i == 0) break;
  ------------------
  |  Branch (18778:17): [True: 0, False: 7.79M]
  ------------------
18779|  7.79M|        }
18780|  20.9M|    }
18781|      0|    JANET_EXIT("invalid janet_sfree");
  ------------------
  |  |  378|      0|#define JANET_EXIT(m) do { \
  |  |  379|      0|    fprintf(stderr, "janet abort at %s:%d: %s\n",\
  |  |  380|      0|        __FILE__,\
  |  |  381|      0|        __LINE__,\
  |  |  382|      0|        (m));\
  |  |  383|      0|    abort();\
  |  |  384|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (384:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
18782|      0|}
janet_wrap_s64:
18967|  2.53k|Janet janet_wrap_s64(int64_t x) {
18968|  2.53k|    int64_t *box = janet_abstract(&janet_s64_type, sizeof(int64_t));
18969|  2.53k|    *box = (int64_t)x;
18970|  2.53k|    return janet_wrap_abstract(box);
  ------------------
  |  |  851|  2.53k|#define janet_wrap_abstract(s) janet_nanbox_wrap_((s), JANET_ABSTRACT)
  |  |  ------------------
  |  |  |  |  825|  2.53k|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  2.53k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  2.53k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
18971|  2.53k|}
janet_wrap_u64:
18973|  2.05k|Janet janet_wrap_u64(uint64_t x) {
18974|  2.05k|    uint64_t *box = janet_abstract(&janet_u64_type, sizeof(uint64_t));
18975|  2.05k|    *box = (uint64_t)x;
18976|  2.05k|    return janet_wrap_abstract(box);
  ------------------
  |  |  851|  2.05k|#define janet_wrap_abstract(s) janet_nanbox_wrap_((s), JANET_ABSTRACT)
  |  |  ------------------
  |  |  |  |  825|  2.05k|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  2.05k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  2.05k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
18977|  2.05k|}
janet_lib_inttypes:
19465|  7.06k|void janet_lib_inttypes(JanetTable *env) {
19466|  7.06k|    JanetRegExt it_cfuns[] = {
19467|  7.06k|        JANET_CORE_REG("int/s64", cfun_it_s64_new),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
19468|  7.06k|        JANET_CORE_REG("int/u64", cfun_it_u64_new),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
19469|  7.06k|        JANET_CORE_REG("int/to-number", cfun_to_number),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
19470|  7.06k|        JANET_CORE_REG("int/to-bytes", cfun_to_bytes),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
19471|  7.06k|        JANET_REG_END
  ------------------
  |  | 2110|  7.06k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
19472|  7.06k|    };
19473|       |    janet_core_cfuns_ext(env, NULL, it_cfuns);
19474|  7.06k|    janet_register_abstract_type(&janet_s64_type);
19475|  7.06k|    janet_register_abstract_type(&janet_u64_type);
19476|  7.06k|}
janet_file_close:
19792|  21.1k|int janet_file_close(JanetFile *file) {
19793|  21.1k|    int ret = 0;
19794|  21.1k|    if (!(file->flags & (JANET_FILE_NOT_CLOSEABLE | JANET_FILE_CLOSED))) {
  ------------------
  |  | 2278|  21.1k|#define JANET_FILE_NOT_CLOSEABLE 16
  ------------------
                  if (!(file->flags & (JANET_FILE_NOT_CLOSEABLE | JANET_FILE_CLOSED))) {
  ------------------
  |  | 2279|  21.1k|#define JANET_FILE_CLOSED 32
  ------------------
  |  Branch (19794:9): [True: 0, False: 21.1k]
  ------------------
19795|      0|        ret = fclose(file->file);
19796|      0|        file->flags |= JANET_FILE_CLOSED;
  ------------------
  |  | 2279|      0|#define JANET_FILE_CLOSED 32
  ------------------
19797|      0|        file->file = NULL; /* NULL dereference is easier to debug then other problems */
19798|      0|        return ret;
19799|      0|    }
19800|  21.1k|    return 0;
19801|  21.1k|}
janet_dynprintf:
20230|  19.5M|void janet_dynprintf(const char *name, FILE *dflt_file, const char *format, ...) {
20231|  19.5M|    va_list args;
20232|  19.5M|    va_start(args, format);
20233|  19.5M|    JanetType xtype;
20234|  19.5M|    Janet x;
20235|  19.5M|    if (!name || name[0] == '\0') { /* Allow NULL or empty string to just use dflt_file directly */
  ------------------
  |  Branch (20235:9): [True: 0, False: 19.5M]
  |  Branch (20235:18): [True: 0, False: 19.5M]
  ------------------
20236|      0|        x = janet_wrap_nil();
  ------------------
  |  |  831|      0|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|      0|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
20237|      0|        xtype = JANET_NIL;
20238|  19.5M|    } else {
20239|  19.5M|        x = janet_dyn(name);
20240|  19.5M|        xtype = janet_type(x);
  ------------------
  |  |  795|  19.5M|    (isnan((x).number) \
  |  |  796|  19.5M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|  19.5M|        : JANET_NUMBER)
  ------------------
  |  Branch (20240:17): [True: 19.5M, False: 0]
  ------------------
20241|  19.5M|    }
20242|  19.5M|    switch (xtype) {
20243|      0|        default:
  ------------------
  |  Branch (20243:9): [True: 0, False: 19.5M]
  ------------------
20244|       |            /* Other values simply do nothing */
20245|      0|            break;
20246|  19.5M|        case JANET_NIL:
  ------------------
  |  Branch (20246:9): [True: 19.5M, False: 0]
  ------------------
20247|  19.5M|        case JANET_ABSTRACT: {
  ------------------
  |  Branch (20247:9): [True: 0, False: 19.5M]
  ------------------
20248|  19.5M|            FILE *f = dflt_file;
20249|  19.5M|            JanetBuffer buffer;
20250|  19.5M|            int32_t len = 0;
20251|   248M|            while (format[len]) len++;
  ------------------
  |  Branch (20251:20): [True: 228M, False: 19.5M]
  ------------------
20252|  19.5M|            janet_buffer_init(&buffer, len);
20253|  19.5M|            janet_formatbv(&buffer, format, args);
20254|  19.5M|            if (xtype == JANET_ABSTRACT) {
  ------------------
  |  Branch (20254:17): [True: 0, False: 19.5M]
  ------------------
20255|      0|                void *abstract = janet_unwrap_abstract(x);
  ------------------
  |  |  866|      0|#define janet_unwrap_abstract(x) (janet_nanbox_to_pointer(x))
  ------------------
20256|      0|                if (janet_abstract_type(abstract) != &janet_file_type)
  ------------------
  |  | 1899|      0|#define janet_abstract_type(u) (janet_abstract_head(u)->type)
  |  |  ------------------
  |  |  |  | 1897|      0|#define janet_abstract_head(u) ((JanetAbstractHead *)((char *)u - offsetof(JanetAbstractHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (20256:21): [True: 0, False: 0]
  ------------------
20257|      0|                    break;
20258|      0|                JanetFile *iofile = abstract;
20259|      0|                io_assert_writeable(iofile);
20260|      0|                f = iofile->file;
20261|      0|            }
20262|  19.5M|            fwrite(buffer.data, buffer.count, 1, f);
20263|  19.5M|            janet_buffer_deinit(&buffer);
20264|  19.5M|            break;
20265|  19.5M|        }
20266|      0|        case JANET_FUNCTION: {
  ------------------
  |  Branch (20266:9): [True: 0, False: 19.5M]
  ------------------
20267|      0|            JanetFunction *fun = janet_unwrap_function(x);
  ------------------
  |  |  868|      0|#define janet_unwrap_function(x) ((JanetFunction *)janet_nanbox_to_pointer(x))
  ------------------
20268|      0|            int32_t len = 0;
20269|      0|            while (format[len]) len++;
  ------------------
  |  Branch (20269:20): [True: 0, False: 0]
  ------------------
20270|      0|            JanetBuffer *buf = janet_buffer(len);
20271|      0|            janet_formatbv(buf, format, args);
20272|      0|            Janet args[1] = { janet_wrap_buffer(buf) };
  ------------------
  |  |  847|      0|#define janet_wrap_buffer(s) janet_nanbox_wrap_((s), JANET_BUFFER)
  |  |  ------------------
  |  |  |  |  825|      0|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
20273|      0|            janet_call(fun, 1, args);
20274|      0|            break;
20275|  19.5M|        }
20276|      0|        case JANET_BUFFER:
  ------------------
  |  Branch (20276:9): [True: 0, False: 19.5M]
  ------------------
20277|      0|            janet_formatbv(janet_unwrap_buffer(x), format, args);
  ------------------
  |  |  862|      0|#define janet_unwrap_buffer(x) ((JanetBuffer *)janet_nanbox_to_pointer(x))
  ------------------
20278|      0|            break;
20279|  19.5M|    }
20280|  19.5M|    va_end(args);
20281|  19.5M|    return;
20282|  19.5M|}
janet_makefile:
20300|  21.1k|Janet janet_makefile(FILE *f, int32_t flags) {
20301|  21.1k|    return janet_wrap_abstract(makef(f, flags, BUFSIZ));
  ------------------
  |  |  851|  21.1k|#define janet_wrap_abstract(s) janet_nanbox_wrap_((s), JANET_ABSTRACT)
  |  |  ------------------
  |  |  |  |  825|  21.1k|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  21.1k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  21.1k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
20302|  21.1k|}
janet_lib_io:
20315|  7.06k|void janet_lib_io(JanetTable *env) {
20316|  7.06k|    JanetRegExt io_cfuns[] = {
20317|  7.06k|        JANET_CORE_REG("print", cfun_io_print),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20318|  7.06k|        JANET_CORE_REG("prin", cfun_io_prin),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20319|  7.06k|        JANET_CORE_REG("printf", cfun_io_printf),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20320|  7.06k|        JANET_CORE_REG("prinf", cfun_io_prinf),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20321|  7.06k|        JANET_CORE_REG("eprin", cfun_io_eprin),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20322|  7.06k|        JANET_CORE_REG("eprint", cfun_io_eprint),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20323|  7.06k|        JANET_CORE_REG("eprintf", cfun_io_eprintf),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20324|  7.06k|        JANET_CORE_REG("eprinf", cfun_io_eprinf),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20325|  7.06k|        JANET_CORE_REG("xprint", cfun_io_xprint),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20326|  7.06k|        JANET_CORE_REG("xprin", cfun_io_xprin),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20327|  7.06k|        JANET_CORE_REG("xprintf", cfun_io_xprintf),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20328|  7.06k|        JANET_CORE_REG("xprinf", cfun_io_xprinf),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20329|  7.06k|        JANET_CORE_REG("flush", cfun_io_flush),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20330|  7.06k|        JANET_CORE_REG("eflush", cfun_io_eflush),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20331|  7.06k|        JANET_CORE_REG("file/temp", cfun_io_temp),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20332|  7.06k|        JANET_CORE_REG("file/open", cfun_io_fopen),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20333|  7.06k|        JANET_CORE_REG("file/close", cfun_io_fclose),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20334|  7.06k|        JANET_CORE_REG("file/read", cfun_io_fread),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20335|  7.06k|        JANET_CORE_REG("file/write", cfun_io_fwrite),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20336|  7.06k|        JANET_CORE_REG("file/flush", cfun_io_fflush),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20337|  7.06k|        JANET_CORE_REG("file/seek", cfun_io_fseek),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20338|  7.06k|        JANET_CORE_REG("file/tell", cfun_io_ftell),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20339|  7.06k|        JANET_REG_END
  ------------------
  |  | 2110|  7.06k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
20340|  7.06k|    };
20341|  7.06k|    janet_core_cfuns_ext(env, NULL, io_cfuns);
20342|  7.06k|    janet_register_abstract_type(&janet_file_type);
20343|  7.06k|    int default_flags = JANET_FILE_NOT_CLOSEABLE | JANET_FILE_SERIALIZABLE;
  ------------------
  |  | 2278|  7.06k|#define JANET_FILE_NOT_CLOSEABLE 16
  ------------------
                  int default_flags = JANET_FILE_NOT_CLOSEABLE | JANET_FILE_SERIALIZABLE;
  ------------------
  |  | 2281|  7.06k|#define JANET_FILE_SERIALIZABLE 128
  ------------------
20344|       |    /* stdout */
20345|  7.06k|    JANET_CORE_DEF(env, "stdout",
  ------------------
  |  |  491|  7.06k|#define JANET_CORE_DEF(ENV, NAME, X, DOC) janet_core_def_sm(ENV, NAME, X, DOC, NULL, 0)
  ------------------
20346|  7.06k|                   janet_makefile(stdout, JANET_FILE_APPEND | default_flags),
20347|  7.06k|                   "The standard output file.");
20348|       |    /* stderr */
20349|  7.06k|    JANET_CORE_DEF(env, "stderr",
  ------------------
  |  |  491|  7.06k|#define JANET_CORE_DEF(ENV, NAME, X, DOC) janet_core_def_sm(ENV, NAME, X, DOC, NULL, 0)
  ------------------
20350|  7.06k|                   janet_makefile(stderr, JANET_FILE_APPEND | default_flags),
20351|  7.06k|                   "The standard error file.");
20352|       |    /* stdin */
20353|  7.06k|    JANET_CORE_DEF(env, "stdin",
  ------------------
  |  |  491|  7.06k|#define JANET_CORE_DEF(ENV, NAME, X, DOC) janet_core_def_sm(ENV, NAME, X, DOC, NULL, 0)
  ------------------
20354|  7.06k|                   janet_makefile(stdin, JANET_FILE_READ | default_flags),
20355|  7.06k|                   "The standard input file.");
20356|       |
20357|  7.06k|}
janet_unmarshal:
22033|  7.06k|    const uint8_t **next) {
22034|  7.06k|    UnmarshalState st;
22035|  7.06k|    st.start = bytes;
22036|  7.06k|    st.end = bytes + len;
22037|  7.06k|    st.lookup_defs = NULL;
22038|  7.06k|    st.lookup_envs = NULL;
22039|  7.06k|    st.lookup = NULL;
22040|  7.06k|    st.reg = reg;
22041|  7.06k|    Janet out;
22042|  7.06k|    const uint8_t *nextbytes = unmarshal_one(&st, bytes, &out, flags);
22043|  7.06k|    if (next) *next = nextbytes;
  ------------------
  |  Branch (22043:9): [True: 0, False: 7.06k]
  ------------------
22044|  7.06k|    janet_v_free(st.lookup_defs);
  ------------------
  |  |  733|  7.06k|#define janet_v_free(v)         (((v) != NULL) ? (janet_sfree(janet_v__raw(v)), 0) : 0)
  |  |  ------------------
  |  |  |  |  741|  7.06k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  ------------------
  |  |  |  Branch (733:34): [True: 7.06k, False: 0]
  |  |  ------------------
  ------------------
22045|  7.06k|    janet_v_free(st.lookup_envs);
  ------------------
  |  |  733|  7.06k|#define janet_v_free(v)         (((v) != NULL) ? (janet_sfree(janet_v__raw(v)), 0) : 0)
  |  |  ------------------
  |  |  |  |  741|  7.06k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  ------------------
  |  |  |  Branch (733:34): [True: 7.06k, False: 0]
  |  |  ------------------
  ------------------
22046|       |    janet_v_free(st.lookup);
  ------------------
  |  |  733|  7.06k|#define janet_v_free(v)         (((v) != NULL) ? (janet_sfree(janet_v__raw(v)), 0) : 0)
  |  |  ------------------
  |  |  |  |  741|  7.06k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  ------------------
  |  |  |  Branch (733:34): [True: 7.06k, False: 0]
  |  |  ------------------
  ------------------
22047|  7.06k|    return out;
22048|  7.06k|}
janet_lib_marsh:
22109|  7.06k|void janet_lib_marsh(JanetTable *env) {
22110|  7.06k|    JanetRegExt marsh_cfuns[] = {
22111|  7.06k|        JANET_CORE_REG("marshal", cfun_marshal),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22112|  7.06k|        JANET_CORE_REG("unmarshal", cfun_unmarshal),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22113|  7.06k|        JANET_CORE_REG("env-lookup", cfun_env_lookup),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22114|  7.06k|        JANET_REG_END
  ------------------
  |  | 2110|  7.06k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
22115|  7.06k|    };
22116|       |    janet_core_cfuns_ext(env, NULL, marsh_cfuns);
22117|  7.06k|}
janet_default_rng:
22192|  7.06k|JanetRNG *janet_default_rng(void) {
22193|  7.06k|    return &janet_vm.rng;
22194|  7.06k|}
janet_rng_seed:
22196|  14.1k|void janet_rng_seed(JanetRNG *rng, uint32_t seed) {
22197|  14.1k|    rng->a = seed;
22198|  14.1k|    rng->b = 0x97654321u;
22199|  14.1k|    rng->c = 123871873u;
22200|  14.1k|    rng->d = 0xf23f56c8u;
22201|  14.1k|    rng->counter = 0u;
22202|       |    /* First several numbers aren't that random. */
22203|   240k|    for (int i = 0; i < 16; i++) janet_rng_u32(rng);
  ------------------
  |  Branch (22203:21): [True: 225k, False: 14.1k]
  ------------------
22204|  14.1k|}
janet_rng_u32:
22220|   225k|uint32_t janet_rng_u32(JanetRNG *rng) {
22221|       |    /* Algorithm "xorwow" from p. 5 of Marsaglia, "Xorshift RNGs" */
22222|   225k|    uint32_t t = rng->d;
22223|   225k|    uint32_t const s = rng->a;
22224|   225k|    rng->d = rng->c;
22225|   225k|    rng->c = rng->b;
22226|   225k|    rng->b = s;
22227|   225k|    t ^= t >> 2;
22228|   225k|    t ^= t << 1;
22229|   225k|    t ^= s ^ (s << 4);
22230|   225k|    rng->a = t;
22231|   225k|    rng->counter += 362437;
22232|   225k|    return t + rng->counter;
22233|   225k|}
janet_lib_math:
22500|  7.06k|void janet_lib_math(JanetTable *env) {
22501|  7.06k|    JanetRegExt math_cfuns[] = {
22502|  7.06k|        JANET_CORE_REG("not", janet_not),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22503|  7.06k|        JANET_CORE_REG("math/random", janet_rand),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22504|  7.06k|        JANET_CORE_REG("math/seedrandom", janet_srand),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22505|  7.06k|        JANET_CORE_REG("math/cos", janet_cos),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22506|  7.06k|        JANET_CORE_REG("math/sin", janet_sin),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22507|  7.06k|        JANET_CORE_REG("math/tan", janet_tan),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22508|  7.06k|        JANET_CORE_REG("math/acos", janet_acos),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22509|  7.06k|        JANET_CORE_REG("math/asin", janet_asin),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22510|  7.06k|        JANET_CORE_REG("math/atan", janet_atan),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22511|  7.06k|        JANET_CORE_REG("math/exp", janet_exp),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22512|  7.06k|        JANET_CORE_REG("math/log", janet_log),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22513|  7.06k|        JANET_CORE_REG("math/log10", janet_log10),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22514|  7.06k|        JANET_CORE_REG("math/log2", janet_log2),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22515|  7.06k|        JANET_CORE_REG("math/sqrt", janet_sqrt),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22516|  7.06k|#ifndef JANET_PLAN9
22517|  7.06k|        JANET_CORE_REG("math/cbrt", janet_cbrt),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22518|  7.06k|        JANET_CORE_REG("math/gamma", janet_tgamma),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22519|  7.06k|        JANET_CORE_REG("math/log-gamma", janet_lgamma),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22520|  7.06k|        JANET_CORE_REG("math/erfc", janet_erfc),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22521|  7.06k|        JANET_CORE_REG("math/erf", janet_erf),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22522|  7.06k|        JANET_CORE_REG("math/expm1", janet_expm1),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22523|  7.06k|        JANET_CORE_REG("math/atanh", janet_atanh),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22524|  7.06k|        JANET_CORE_REG("math/asinh", janet_asinh),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22525|  7.06k|        JANET_CORE_REG("math/next", janet_nextafter),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22526|  7.06k|#endif
22527|  7.06k|        JANET_CORE_REG("math/floor", janet_floor),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22528|  7.06k|        JANET_CORE_REG("math/ceil", janet_ceil),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22529|  7.06k|        JANET_CORE_REG("math/pow", janet_pow),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22530|  7.06k|        JANET_CORE_REG("math/abs", janet_fabs),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22531|  7.06k|        JANET_CORE_REG("math/sinh", janet_sinh),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22532|  7.06k|        JANET_CORE_REG("math/cosh", janet_cosh),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22533|  7.06k|        JANET_CORE_REG("math/tanh", janet_tanh),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22534|  7.06k|        JANET_CORE_REG("math/acosh", janet_acosh),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22535|  7.06k|        JANET_CORE_REG("math/atan2", janet_atan2),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22536|  7.06k|        JANET_CORE_REG("math/rng", cfun_rng_make),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22537|  7.06k|        JANET_CORE_REG("math/rng-uniform", cfun_rng_uniform),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22538|  7.06k|        JANET_CORE_REG("math/rng-int", cfun_rng_int),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22539|  7.06k|        JANET_CORE_REG("math/rng-buffer", cfun_rng_buffer),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22540|  7.06k|        JANET_CORE_REG("math/hypot", janet_hypot),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22541|  7.06k|        JANET_CORE_REG("math/exp2", janet_exp2),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22542|  7.06k|        JANET_CORE_REG("math/log1p", janet_log1p),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22543|  7.06k|        JANET_CORE_REG("math/trunc", janet_trunc),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22544|  7.06k|        JANET_CORE_REG("math/round", janet_round),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22545|  7.06k|        JANET_CORE_REG("math/gcd", janet_cfun_gcd),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22546|  7.06k|        JANET_CORE_REG("math/lcm", janet_cfun_lcm),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22547|  7.06k|        JANET_CORE_REG("math/frexp", janet_cfun_frexp),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22548|  7.06k|        JANET_CORE_REG("math/ldexp", janet_cfun_ldexp),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22549|  7.06k|        JANET_REG_END
  ------------------
  |  | 2110|  7.06k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
22550|  7.06k|    };
22551|  7.06k|    janet_core_cfuns_ext(env, NULL, math_cfuns);
22552|  7.06k|    janet_register_abstract_type(&janet_rng_type);
22553|       |#ifdef JANET_BOOTSTRAP
22554|       |    JANET_CORE_DEF(env, "math/pi", janet_wrap_number(3.1415926535897931),
22555|       |                   "The value pi.");
22556|       |    JANET_CORE_DEF(env, "math/e", janet_wrap_number(2.7182818284590451),
22557|       |                   "The base of the natural log.");
22558|       |    JANET_CORE_DEF(env, "math/inf", janet_wrap_number(INFINITY),
22559|       |                   "The number representing positive infinity");
22560|       |    JANET_CORE_DEF(env, "math/-inf", janet_wrap_number(-INFINITY),
22561|       |                   "The number representing negative infinity");
22562|       |    JANET_CORE_DEF(env, "math/int32-min", janet_wrap_number(INT32_MIN),
22563|       |                   "The minimum contiguous integer representable by a 32 bit signed integer");
22564|       |    JANET_CORE_DEF(env, "math/int32-max", janet_wrap_number(INT32_MAX),
22565|       |                   "The maximum contiguous integer representable by a 32 bit signed integer");
22566|       |    JANET_CORE_DEF(env, "math/int-min", janet_wrap_number(JANET_INTMIN_DOUBLE),
22567|       |                   "The minimum contiguous integer representable by a double (-(2^53))");
22568|       |    JANET_CORE_DEF(env, "math/int-max", janet_wrap_number(JANET_INTMAX_DOUBLE),
22569|       |                   "The maximum contiguous integer representable by a double (2^53)");
22570|       |#ifdef NAN
22571|       |    JANET_CORE_DEF(env, "math/nan", janet_wrap_number(NAN), "Not a number (IEEE-754 NaN)");
22572|       |#else
22573|       |    JANET_CORE_DEF(env, "math/nan", janet_wrap_number(0.0 / 0.0), "Not a number (IEEE-754 NaN)");
22574|       |#endif
22575|       |#endif
22576|  7.06k|}
janet_lib_net:
23861|  7.06k|void janet_lib_net(JanetTable *env) {
23862|  7.06k|    JanetRegExt net_cfuns[] = {
23863|  7.06k|        JANET_CORE_REG("net/address", cfun_net_sockaddr),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
23864|  7.06k|        JANET_CORE_REG("net/listen", cfun_net_listen),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
23865|  7.06k|        JANET_CORE_REG("net/socket", cfun_net_socket),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
23866|  7.06k|        JANET_CORE_REG("net/accept", cfun_stream_accept),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
23867|  7.06k|        JANET_CORE_REG("net/accept-loop", cfun_stream_accept_loop),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
23868|  7.06k|        JANET_CORE_REG("net/read", cfun_stream_read),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
23869|  7.06k|        JANET_CORE_REG("net/chunk", cfun_stream_chunk),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
23870|  7.06k|        JANET_CORE_REG("net/write", cfun_stream_write),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
23871|  7.06k|        JANET_CORE_REG("net/send-to", cfun_stream_send_to),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
23872|  7.06k|        JANET_CORE_REG("net/recv-from", cfun_stream_recv_from),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
23873|  7.06k|        JANET_CORE_REG("net/flush", cfun_stream_flush),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
23874|  7.06k|        JANET_CORE_REG("net/connect", cfun_net_connect),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
23875|  7.06k|        JANET_CORE_REG("net/shutdown", cfun_net_shutdown),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
23876|  7.06k|        JANET_CORE_REG("net/peername", cfun_net_getpeername),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
23877|  7.06k|        JANET_CORE_REG("net/localname", cfun_net_getsockname),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
23878|  7.06k|        JANET_CORE_REG("net/address-unpack", cfun_net_address_unpack),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
23879|  7.06k|        JANET_CORE_REG("net/setsockopt", cfun_net_setsockopt),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
23880|  7.06k|        JANET_REG_END
  ------------------
  |  | 2110|  7.06k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
23881|  7.06k|    };
23882|       |    janet_core_cfuns_ext(env, NULL, net_cfuns);
23883|  7.06k|}
janet_net_init:
23885|  7.06k|void janet_net_init(void) {
23886|       |#ifdef JANET_WINDOWS
23887|       |    WSADATA wsaData;
23888|       |    janet_assert(!WSAStartup(MAKEWORD(2, 2), &wsaData), "could not start winsock");
23889|       |    janet_vm.connect_ex_loaded = 0;
23890|       |    janet_vm.connect_ex = NULL;
23891|       |#endif
23892|  7.06k|}
janet_net_deinit:
23894|  7.06k|void janet_net_deinit(void) {
23895|       |#ifdef JANET_WINDOWS
23896|       |    WSACleanup();
23897|       |#endif
23898|  7.06k|}
janet_lib_os:
26913|  7.06k|void janet_lib_os(JanetTable *env) {
26914|       |#if !defined(JANET_REDUCED_OS) && defined(JANET_WINDOWS) && defined(JANET_THREADS)
26915|       |    /* During start up, the top-most abstract machine (thread)
26916|       |     * in the thread tree sets up the critical section. */
26917|       |    static volatile long env_lock_initializing = 0;
26918|       |    static volatile long env_lock_initialized = 0;
26919|       |    if (!InterlockedExchange(&env_lock_initializing, 1)) {
26920|       |        InitializeCriticalSection(&env_lock);
26921|       |        InterlockedOr(&env_lock_initialized, 1);
26922|       |    } else {
26923|       |        while (!InterlockedOr(&env_lock_initialized, 0)) {
26924|       |            Sleep(0);
26925|       |        }
26926|       |    }
26927|       |
26928|       |#endif
26929|  7.06k|#ifndef JANET_NO_PROCESSES
26930|  7.06k|#endif
26931|  7.06k|    JanetRegExt os_cfuns[] = {
26932|  7.06k|        JANET_CORE_REG("os/exit", os_exit),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26933|  7.06k|        JANET_CORE_REG("os/which", os_which),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26934|  7.06k|        JANET_CORE_REG("os/arch", os_arch),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26935|  7.06k|        JANET_CORE_REG("os/compiler", os_compiler),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26936|  7.06k|#ifndef JANET_REDUCED_OS
26937|       |
26938|       |        /* misc (un-sandboxed) */
26939|  7.06k|        JANET_CORE_REG("os/cpu-count", os_cpu_count),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26940|  7.06k|        JANET_CORE_REG("os/cwd", os_cwd),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26941|  7.06k|        JANET_CORE_REG("os/cryptorand", os_cryptorand),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26942|  7.06k|        JANET_CORE_REG("os/perm-string", os_permission_string),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26943|  7.06k|        JANET_CORE_REG("os/perm-int", os_permission_int),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26944|  7.06k|        JANET_CORE_REG("os/mktime", os_mktime),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26945|  7.06k|        JANET_CORE_REG("os/time", os_time), /* not high resolution */
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26946|  7.06k|        JANET_CORE_REG("os/date", os_date), /* not high resolution */
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26947|  7.06k|        JANET_CORE_REG("os/strftime", os_strftime),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26948|  7.06k|        JANET_CORE_REG("os/sleep", os_sleep),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26949|  7.06k|        JANET_CORE_REG("os/isatty", os_isatty),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26950|  7.06k|#ifndef JANET_NO_LOCALES
26951|  7.06k|        JANET_CORE_REG("os/setlocale", os_setlocale),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26952|  7.06k|#endif
26953|       |
26954|       |        /* env functions */
26955|  7.06k|#ifndef JANET_PLAN9
26956|  7.06k|        JANET_CORE_REG("os/environ", os_environ),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26957|  7.06k|#endif
26958|  7.06k|        JANET_CORE_REG("os/getenv", os_getenv),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26959|  7.06k|        JANET_CORE_REG("os/setenv", os_setenv),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26960|       |
26961|       |        /* fs read */
26962|  7.06k|        JANET_CORE_REG("os/dir", os_dir),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26963|  7.06k|        JANET_CORE_REG("os/stat", os_stat),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26964|  7.06k|        JANET_CORE_REG("os/lstat", os_lstat),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26965|  7.06k|        JANET_CORE_REG("os/realpath", os_realpath),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26966|  7.06k|        JANET_CORE_REG("os/cd", os_cd),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26967|  7.06k|#ifndef JANET_NO_UMASK
26968|  7.06k|        JANET_CORE_REG("os/umask", os_umask),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26969|  7.06k|#endif
26970|  7.06k|#ifndef JANET_NO_SYMLINKS
26971|  7.06k|        JANET_CORE_REG("os/readlink", os_readlink),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26972|  7.06k|#endif
26973|       |
26974|       |        /* fs write */
26975|  7.06k|        JANET_CORE_REG("os/mkdir", os_mkdir),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26976|  7.06k|        JANET_CORE_REG("os/rmdir", os_rmdir),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26977|  7.06k|        JANET_CORE_REG("os/rm", os_remove),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26978|  7.06k|        JANET_CORE_REG("os/link", os_link),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26979|  7.06k|        JANET_CORE_REG("os/rename", os_rename),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26980|  7.06k|        JANET_CORE_REG("os/chmod", os_chmod),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26981|  7.06k|        JANET_CORE_REG("os/touch", os_touch),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26982|  7.06k|#ifndef JANET_NO_SYMLINKS
26983|  7.06k|        JANET_CORE_REG("os/symlink", os_symlink),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26984|  7.06k|#endif
26985|       |
26986|       |        /* processes */
26987|  7.06k|#ifndef JANET_NO_PROCESSES
26988|  7.06k|        JANET_CORE_REG("os/execute", os_execute),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26989|  7.06k|        JANET_CORE_REG("os/spawn", os_spawn),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26990|  7.06k|        JANET_CORE_REG("os/shell", os_shell),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26991|  7.06k|        JANET_CORE_REG("os/posix-fork", os_posix_fork),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26992|  7.06k|        JANET_CORE_REG("os/posix-exec", os_posix_exec),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26993|  7.06k|        JANET_CORE_REG("os/posix-chroot", os_posix_chroot),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26994|       |        /* no need to sandbox process management if you can't create processes
26995|       |         * (allows for limited functionality if use exposes C-functions to create specific processes) */
26996|  7.06k|        JANET_CORE_REG("os/proc-wait", os_proc_wait),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26997|  7.06k|        JANET_CORE_REG("os/proc-kill", os_proc_kill),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26998|  7.06k|        JANET_CORE_REG("os/proc-close", os_proc_close),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26999|  7.06k|        JANET_CORE_REG("os/getpid", os_proc_getpid),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
27000|  7.06k|#ifdef JANET_EV
27001|  7.06k|        JANET_CORE_REG("os/sigaction", os_sigaction),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
27002|  7.06k|#endif
27003|  7.06k|#endif
27004|       |
27005|       |        /* high resolution timers */
27006|  7.06k|        JANET_CORE_REG("os/clock", os_clock),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
27007|       |
27008|  7.06k|#ifdef JANET_EV
27009|  7.06k|        JANET_CORE_REG("os/open", os_open), /* fs read and write */
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
27010|  7.06k|        JANET_CORE_REG("os/pipe", os_pipe),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
27011|  7.06k|#endif
27012|  7.06k|#endif
27013|  7.06k|        JANET_REG_END
  ------------------
  |  | 2110|  7.06k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
27014|  7.06k|    };
27015|       |    janet_core_cfuns_ext(env, NULL, os_cfuns);
27016|  7.06k|}
janet_is_symbol_char:
27076|   179k|int janet_is_symbol_char(uint8_t c) {
27077|   179k|    return symchars[c >> 5] & ((uint32_t)1 << (c & 0x1F));
27078|   179k|}
janet_valid_utf8:
27083|    884|int janet_valid_utf8(const uint8_t *str, int32_t len) {
27084|    884|    int32_t i = 0;
27085|    884|    int32_t j;
27086|  3.76k|    while (i < len) {
  ------------------
  |  Branch (27086:12): [True: 3.18k, False: 571]
  ------------------
27087|  3.18k|        int32_t nexti;
27088|  3.18k|        uint8_t c = str[i];
27089|       |
27090|       |        /* Check the number of bytes in code point */
27091|  3.18k|        if (c < 0x80) nexti = i + 1;
  ------------------
  |  Branch (27091:13): [True: 1.91k, False: 1.27k]
  ------------------
27092|  1.27k|        else if ((c >> 5) == 0x06) nexti = i + 2;
  ------------------
  |  Branch (27092:18): [True: 501, False: 770]
  ------------------
27093|    770|        else if ((c >> 4) == 0x0E) nexti = i + 3;
  ------------------
  |  Branch (27093:18): [True: 332, False: 438]
  ------------------
27094|    438|        else if ((c >> 3) == 0x1E) nexti = i + 4;
  ------------------
  |  Branch (27094:18): [True: 302, False: 136]
  ------------------
27095|       |        /* Don't allow 5 or 6 byte code points */
27096|    136|        else return 0;
27097|       |
27098|       |        /* No overflow */
27099|  3.05k|        if (nexti > len) return 0;
  ------------------
  |  Branch (27099:13): [True: 103, False: 2.95k]
  ------------------
27100|       |
27101|       |        /* Ensure trailing bytes are well formed (10XX XXXX) */
27102|  4.77k|        for (j = i + 1; j < nexti; j++) {
  ------------------
  |  Branch (27102:25): [True: 1.88k, False: 2.89k]
  ------------------
27103|  1.88k|            if ((str[j] >> 6) != 2) return 0;
  ------------------
  |  Branch (27103:17): [True: 55, False: 1.82k]
  ------------------
27104|  1.88k|        }
27105|       |
27106|       |        /* Check for overlong encoding */
27107|  2.89k|        if ((nexti == i + 2) && str[i] < 0xC2) return 0;
  ------------------
  |  Branch (27107:13): [True: 403, False: 2.49k]
  |  Branch (27107:33): [True: 6, False: 397]
  ------------------
27108|  2.88k|        if ((str[i] == 0xE0) && str[i + 1] < 0xA0) return 0;
  ------------------
  |  Branch (27108:13): [True: 205, False: 2.68k]
  |  Branch (27108:33): [True: 11, False: 194]
  ------------------
27109|  2.87k|        if ((str[i] == 0xF0) && str[i + 1] < 0x90) return 0;
  ------------------
  |  Branch (27109:13): [True: 100, False: 2.77k]
  |  Branch (27109:33): [True: 2, False: 98]
  ------------------
27110|       |
27111|  2.87k|        i = nexti;
27112|  2.87k|    }
27113|    571|    return 1;
27114|    884|}
janet_parser_consume:
27718|   253k|void janet_parser_consume(JanetParser *parser, uint8_t c) {
27719|   253k|    int consumed = 0;
27720|   253k|    janet_parser_checkdead(parser);
27721|   253k|    if (c == '\r') {
  ------------------
  |  Branch (27721:9): [True: 2.24k, False: 251k]
  ------------------
27722|  2.24k|        parser->line++;
27723|  2.24k|        parser->column = 0;
27724|   251k|    } else if (c == '\n') {
  ------------------
  |  Branch (27724:16): [True: 10.6k, False: 240k]
  ------------------
27725|  10.6k|        parser->column = 0;
27726|  10.6k|        if (parser->lookback != '\r')
  ------------------
  |  Branch (27726:13): [True: 10.0k, False: 550]
  ------------------
27727|  10.0k|            parser->line++;
27728|   240k|    } else {
27729|   240k|        parser->column++;
27730|   240k|    }
27731|   577k|    while (!consumed && !parser->error) {
  ------------------
  |  Branch (27731:12): [True: 324k, False: 252k]
  |  Branch (27731:25): [True: 324k, False: 719]
  ------------------
27732|   324k|        JanetParseState *state = parser->states + parser->statecount - 1;
27733|   324k|        consumed = state->consumer(parser, state, c);
27734|   324k|    }
27735|   253k|    parser->lookback = c;
27736|   253k|}
janet_parser_eof:
27738|  6.54k|void janet_parser_eof(JanetParser *parser) {
27739|  6.54k|    janet_parser_checkdead(parser);
27740|  6.54k|    size_t oldcolumn = parser->column;
27741|  6.54k|    size_t oldline = parser->line;
27742|  6.54k|    janet_parser_consume(parser, '\n');
27743|  6.54k|    if (parser->statecount > 1) {
  ------------------
  |  Branch (27743:9): [True: 1.37k, False: 5.16k]
  ------------------
27744|  1.37k|        delim_error(parser, parser->statecount - 1, 0, "unexpected end of source");
27745|  1.37k|    }
27746|  6.54k|    parser->line = oldline;
27747|  6.54k|    parser->column = oldcolumn;
27748|  6.54k|    parser->flag |= JANET_PARSER_DEAD;
  ------------------
  |  |27050|  6.54k|#define JANET_PARSER_DEAD 0x1
  ------------------
27749|  6.54k|}
janet_parser_status:
27751|   261k|enum JanetParserStatus janet_parser_status(JanetParser *parser) {
27752|   261k|    if (parser->error) return JANET_PARSE_ERROR;
  ------------------
  |  Branch (27752:9): [True: 2.93k, False: 258k]
  ------------------
27753|   258k|    if (parser->flag) return JANET_PARSE_DEAD;
  ------------------
  |  Branch (27753:9): [True: 5.16k, False: 253k]
  ------------------
27754|   253k|    if (parser->statecount > 1) return JANET_PARSE_PENDING;
  ------------------
  |  Branch (27754:9): [True: 238k, False: 14.5k]
  ------------------
27755|  14.5k|    return JANET_PARSE_ROOT;
27756|   253k|}
janet_parser_produce:
27777|  5.06k|Janet janet_parser_produce(JanetParser *parser) {
27778|  5.06k|    Janet ret;
27779|  5.06k|    size_t i;
27780|  5.06k|    if (parser->pending == 0) return janet_wrap_nil();
  ------------------
  |  |  831|      0|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|      0|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (27780:9): [True: 0, False: 5.06k]
  ------------------
27781|  5.06k|    ret = janet_unwrap_tuple(parser->args[0])[0];
  ------------------
  |  |  858|  5.06k|#define janet_unwrap_tuple(x) ((JanetTuple)janet_nanbox_to_pointer(x))
  ------------------
27782|  10.2k|    for (i = 1; i < parser->argcount; i++) {
  ------------------
  |  Branch (27782:17): [True: 5.20k, False: 5.06k]
  ------------------
27783|  5.20k|        parser->args[i - 1] = parser->args[i];
27784|  5.20k|    }
27785|  5.06k|    parser->pending--;
27786|  5.06k|    parser->argcount--;
27787|  5.06k|    parser->states[0].argn--;
27788|  5.06k|    return ret;
27789|  5.06k|}
janet_parser_init:
27805|  7.06k|void janet_parser_init(JanetParser *parser) {
27806|  7.06k|    parser->args = NULL;
27807|  7.06k|    parser->states = NULL;
27808|  7.06k|    parser->buf = NULL;
27809|  7.06k|    parser->argcount = 0;
27810|  7.06k|    parser->argcap = 0;
27811|  7.06k|    parser->bufcount = 0;
27812|  7.06k|    parser->bufcap = 0;
27813|  7.06k|    parser->statecount = 0;
27814|  7.06k|    parser->statecap = 0;
27815|  7.06k|    parser->error = NULL;
27816|  7.06k|    parser->lookback = -1;
27817|  7.06k|    parser->line = 1;
27818|  7.06k|    parser->column = 0;
27819|  7.06k|    parser->pending = 0;
27820|  7.06k|    parser->flag = 0;
27821|       |
27822|  7.06k|    pushstate(parser, root, PFLAG_CONTAINER);
  ------------------
  |  |27155|  7.06k|#define PFLAG_CONTAINER 0x100
  ------------------
27823|  7.06k|}
janet_parser_deinit:
27825|  7.06k|void janet_parser_deinit(JanetParser *parser) {
27826|  7.06k|    janet_free(parser->args);
  ------------------
  |  | 2415|  7.06k|#define janet_free(X) free((X))
  ------------------
27827|  7.06k|    janet_free(parser->buf);
  ------------------
  |  | 2415|  7.06k|#define janet_free(X) free((X))
  ------------------
27828|  7.06k|    janet_free(parser->states);
  ------------------
  |  | 2415|  7.06k|#define janet_free(X) free((X))
  ------------------
27829|  7.06k|}
janet_parser_has_more:
27876|  5.16k|int janet_parser_has_more(JanetParser *parser) {
27877|  5.16k|    return !!parser->pending;
27878|  5.16k|}
janet_lib_parse:
28330|  7.06k|void janet_lib_parse(JanetTable *env) {
28331|  7.06k|    JanetRegExt parse_cfuns[] = {
28332|  7.06k|        JANET_CORE_REG("parser/new", cfun_parse_parser),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
28333|  7.06k|        JANET_CORE_REG("parser/clone", cfun_parse_clone),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
28334|  7.06k|        JANET_CORE_REG("parser/has-more", cfun_parse_has_more),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
28335|  7.06k|        JANET_CORE_REG("parser/produce", cfun_parse_produce),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
28336|  7.06k|        JANET_CORE_REG("parser/consume", cfun_parse_consume),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
28337|  7.06k|        JANET_CORE_REG("parser/byte", cfun_parse_byte),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
28338|  7.06k|        JANET_CORE_REG("parser/error", cfun_parse_error),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
28339|  7.06k|        JANET_CORE_REG("parser/status", cfun_parse_status),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
28340|  7.06k|        JANET_CORE_REG("parser/flush", cfun_parse_flush),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
28341|  7.06k|        JANET_CORE_REG("parser/state", cfun_parse_state),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
28342|  7.06k|        JANET_CORE_REG("parser/where", cfun_parse_where),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
28343|  7.06k|        JANET_CORE_REG("parser/eof", cfun_parse_eof),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
28344|  7.06k|        JANET_CORE_REG("parser/insert", cfun_parse_insert),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
28345|  7.06k|        JANET_REG_END
  ------------------
  |  | 2110|  7.06k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
28346|  7.06k|    };
28347|       |    janet_core_cfuns_ext(env, NULL, parse_cfuns);
28348|  7.06k|}
cfun_peg_match:
30387|  5.06k|              "Returns nil if text does not match the language defined by peg. The syntax of PEGs is documented on the Janet website.") {
30388|  5.06k|    PegCall c = peg_cfun_init(argc, argv, 0);
30389|  5.06k|    PEG_TRY_SETUP
  ------------------
  |  |30370|  5.06k|    JanetTryState tstate; \
  |  |30371|  5.06k|    if (c.input_buffer && janet_try(&tstate)) { \
  |  |  ------------------
  |  |  |  | 1981|      0|#define janet_try(state) (janet_try_init(state), (JanetSignal) setjmp((state)->buf))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1981:26): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (30371:9): [True: 0, False: 5.06k]
  |  |  ------------------
  |  |30372|      0|        c.input_buffer->gc.flags = c.old_flags; \
  |  |30373|      0|        Janet result = *janet_vm.return_reg; \
  |  |30374|      0|        janet_restore(&tstate); \
  |  |30375|      0|        janet_panicv(result); /* re-raise */ \
  |  |30376|      0|    }
  ------------------
30390|  5.06k|    const uint8_t *result = peg_rule(&c.s, c.s.bytecode, c.bytes.bytes + c.start);
30391|  5.06k|    PEG_TRY_TEARDOWN
  ------------------
  |  |30379|  5.06k|    if (c.input_buffer) { \
  |  |  ------------------
  |  |  |  Branch (30379:9): [True: 0, False: 5.06k]
  |  |  ------------------
  |  |30380|      0|        janet_restore(&tstate); \
  |  |30381|      0|        c.input_buffer->gc.flags = c.old_flags; \
  |  |30382|      0|    }
  ------------------
30392|  5.06k|    return result ? janet_wrap_array(c.s.captures) : janet_wrap_nil();
  ------------------
  |  |  845|  1.38k|#define janet_wrap_array(s) janet_nanbox_wrap_((s), JANET_ARRAY)
  |  |  ------------------
  |  |  |  |  825|  1.38k|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  1.38k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  1.38k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  return result ? janet_wrap_array(c.s.captures) : janet_wrap_nil();
  ------------------
  |  |  831|  3.67k|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|  3.67k|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  3.67k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  3.67k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (30392:12): [True: 1.38k, False: 3.67k]
  ------------------
30393|  5.06k|}
janet_lib_peg:
30499|  7.06k|void janet_lib_peg(JanetTable *env) {
30500|  7.06k|    JanetRegExt cfuns[] = {
30501|  7.06k|        JANET_CORE_REG("peg/compile", cfun_peg_compile),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
30502|  7.06k|        JANET_CORE_REG("peg/match", cfun_peg_match),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
30503|  7.06k|        JANET_CORE_REG("peg/find", cfun_peg_find),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
30504|  7.06k|        JANET_CORE_REG("peg/find-all", cfun_peg_find_all),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
30505|  7.06k|        JANET_CORE_REG("peg/replace", cfun_peg_replace),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
30506|  7.06k|        JANET_CORE_REG("peg/replace-all", cfun_peg_replace_all),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
30507|  7.06k|        JANET_REG_END
  ------------------
  |  | 2110|  7.06k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
30508|  7.06k|    };
30509|       |    janet_core_cfuns_ext(env, NULL, cfuns);
30510|  7.06k|    janet_register_abstract_type(&janet_peg_type);
30511|  7.06k|}
janet_to_string_b:
30741|  91.3M|void janet_to_string_b(JanetBuffer *buffer, Janet x) {
30742|  91.3M|    switch (janet_type(x)) {
  ------------------
  |  |  795|  91.3M|    (isnan((x).number) \
  |  |  796|  91.3M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|  91.3M|        : JANET_NUMBER)
  ------------------
  |  Branch (30742:13): [True: 84.6M, False: 6.62M]
  ------------------
30743|  7.85k|        case JANET_NIL:
  ------------------
  |  Branch (30743:9): [True: 7.85k, False: 91.2M]
  ------------------
30744|  7.85k|            janet_buffer_push_cstring(buffer, "");
30745|  7.85k|            break;
30746|    246|        case JANET_BOOLEAN:
  ------------------
  |  Branch (30746:9): [True: 246, False: 91.3M]
  ------------------
30747|    246|            janet_buffer_push_cstring(buffer,
30748|    246|                                      janet_unwrap_boolean(x) ? "true" : "false");
  ------------------
  |  |  838|    246|#define janet_unwrap_boolean(x) ((x).u64 & 0x1)
  |  |  ------------------
  |  |  |  Branch (838:33): [True: 8, False: 238]
  |  |  ------------------
  ------------------
30749|    246|            break;
30750|  6.62M|        case JANET_NUMBER:
  ------------------
  |  Branch (30750:9): [True: 6.62M, False: 84.6M]
  ------------------
30751|  6.62M|            number_to_string_b(buffer, janet_unwrap_number(x));
  ------------------
  |  |  839|  6.62M|#define janet_unwrap_number(x) ((x).number)
  ------------------
30752|  6.62M|            break;
30753|  1.27k|        case JANET_STRING:
  ------------------
  |  Branch (30753:9): [True: 1.27k, False: 91.3M]
  ------------------
30754|  46.1M|        case JANET_SYMBOL:
  ------------------
  |  Branch (30754:9): [True: 46.1M, False: 45.1M]
  ------------------
30755|  49.4M|        case JANET_KEYWORD:
  ------------------
  |  Branch (30755:9): [True: 3.35M, False: 87.9M]
  ------------------
30756|  49.4M|            janet_buffer_push_bytes(buffer,
30757|  49.4M|                                    janet_unwrap_string(x),
  ------------------
  |  |  863|  49.4M|#define janet_unwrap_string(x) ((JanetString)janet_nanbox_to_pointer(x))
  ------------------
30758|  49.4M|                                    janet_string_length(janet_unwrap_string(x)));
  ------------------
  |  | 1813|  49.4M|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  ------------------
  |  |  |  | 1812|  49.4M|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
30759|  49.4M|            break;
30760|      0|        case JANET_BUFFER: {
  ------------------
  |  Branch (30760:9): [True: 0, False: 91.3M]
  ------------------
30761|      0|            JanetBuffer *to = janet_unwrap_buffer(x);
  ------------------
  |  |  862|      0|#define janet_unwrap_buffer(x) ((JanetBuffer *)janet_nanbox_to_pointer(x))
  ------------------
30762|       |            /* Prevent resizing buffer while appending */
30763|      0|            if (buffer == to) janet_buffer_extra(buffer, to->count);
  ------------------
  |  Branch (30763:17): [True: 0, False: 0]
  ------------------
30764|      0|            janet_buffer_push_bytes(buffer, to->data, to->count);
30765|      0|            break;
30766|  46.1M|        }
30767|    270|        case JANET_ABSTRACT: {
  ------------------
  |  Branch (30767:9): [True: 270, False: 91.3M]
  ------------------
30768|    270|            JanetAbstract p = janet_unwrap_abstract(x);
  ------------------
  |  |  866|    270|#define janet_unwrap_abstract(x) (janet_nanbox_to_pointer(x))
  ------------------
30769|    270|            const JanetAbstractType *t = janet_abstract_type(p);
  ------------------
  |  | 1899|    270|#define janet_abstract_type(u) (janet_abstract_head(u)->type)
  |  |  ------------------
  |  |  |  | 1897|    270|#define janet_abstract_head(u) ((JanetAbstractHead *)((char *)u - offsetof(JanetAbstractHead, data)))
  |  |  ------------------
  ------------------
30770|    270|            if (t->tostring != NULL) {
  ------------------
  |  Branch (30770:17): [True: 270, False: 0]
  ------------------
30771|    270|                t->tostring(p, buffer);
30772|    270|            } else {
30773|      0|                string_description_b(buffer, t->name, p);
30774|      0|            }
30775|    270|        }
30776|    270|        return;
30777|      0|        case JANET_CFUNCTION: {
  ------------------
  |  Branch (30777:9): [True: 0, False: 91.3M]
  ------------------
30778|      0|            JanetCFunRegistry *reg = janet_registry_get(janet_unwrap_cfunction(x));
  ------------------
  |  |  869|      0|#define janet_unwrap_cfunction(x) ((JanetCFunction)janet_nanbox_to_pointer(x))
  ------------------
30779|      0|            if (NULL != reg) {
  ------------------
  |  Branch (30779:17): [True: 0, False: 0]
  ------------------
30780|      0|                janet_buffer_push_cstring(buffer, "<cfunction ");
30781|      0|                if (NULL != reg->name_prefix) {
  ------------------
  |  Branch (30781:21): [True: 0, False: 0]
  ------------------
30782|      0|                    janet_buffer_push_cstring(buffer, reg->name_prefix);
30783|      0|                    janet_buffer_push_u8(buffer, '/');
30784|      0|                }
30785|      0|                janet_buffer_push_cstring(buffer, reg->name);
30786|      0|                janet_buffer_push_u8(buffer, '>');
30787|      0|                break;
30788|      0|            }
30789|      0|            goto fallthrough;
30790|      0|        }
30791|      0|        case JANET_FUNCTION: {
  ------------------
  |  Branch (30791:9): [True: 0, False: 91.3M]
  ------------------
30792|      0|            JanetFunction *fun = janet_unwrap_function(x);
  ------------------
  |  |  868|      0|#define janet_unwrap_function(x) ((JanetFunction *)janet_nanbox_to_pointer(x))
  ------------------
30793|      0|            JanetFuncDef *def = fun->def;
30794|      0|            if (def == NULL) {
  ------------------
  |  Branch (30794:17): [True: 0, False: 0]
  ------------------
30795|      0|                janet_buffer_push_cstring(buffer, "<incomplete function>");
30796|      0|                break;
30797|      0|            }
30798|      0|            if (def->name) {
  ------------------
  |  Branch (30798:17): [True: 0, False: 0]
  ------------------
30799|      0|                const uint8_t *n = def->name;
30800|      0|                janet_buffer_push_cstring(buffer, "<function ");
30801|      0|                janet_buffer_push_bytes(buffer, n, janet_string_length(n));
  ------------------
  |  | 1813|      0|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  ------------------
  |  |  |  | 1812|      0|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
30802|      0|                janet_buffer_push_u8(buffer, '>');
30803|      0|                break;
30804|      0|            }
30805|      0|            goto fallthrough;
30806|      0|        }
30807|      0|    fallthrough:
30808|  35.1M|        default:
  ------------------
  |  Branch (30808:9): [True: 35.1M, False: 56.1M]
  ------------------
30809|  35.1M|            string_description_b(buffer, janet_type_names[janet_type(x)], janet_unwrap_pointer(x));
  ------------------
  |  |  795|  35.1M|    (isnan((x).number) \
  |  |  796|  35.1M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|  35.1M|        : JANET_NUMBER)
  ------------------
                          string_description_b(buffer, janet_type_names[janet_type(x)], janet_unwrap_pointer(x));
  ------------------
  |  |  867|  35.1M|#define janet_unwrap_pointer(x) (janet_nanbox_to_pointer(x))
  ------------------
  |  Branch (30809:59): [True: 35.1M, False: 0]
  ------------------
30810|  35.1M|            break;
30811|  91.3M|    }
30812|  91.3M|}
janet_description_b:
30827|  56.9M|void janet_description_b(JanetBuffer *buffer, Janet x) {
30828|  56.9M|    switch (janet_type(x)) {
  ------------------
  |  |  795|  56.9M|    (isnan((x).number) \
  |  |  796|  56.9M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|  56.9M|        : JANET_NUMBER)
  ------------------
  |  Branch (30828:13): [True: 50.5M, False: 6.39M]
  ------------------
30829|  43.5M|        default:
  ------------------
  |  Branch (30829:9): [True: 43.5M, False: 13.3M]
  ------------------
30830|  43.5M|            break;
30831|  43.5M|        case JANET_NIL:
  ------------------
  |  Branch (30831:9): [True: 1.74M, False: 55.2M]
  ------------------
30832|  1.74M|            janet_buffer_push_cstring(buffer, "nil");
30833|  1.74M|            return;
30834|  3.35M|        case JANET_KEYWORD:
  ------------------
  |  Branch (30834:9): [True: 3.35M, False: 53.6M]
  ------------------
30835|  3.35M|            janet_buffer_push_u8(buffer, ':');
30836|  3.35M|            break;
30837|  7.64M|        case JANET_STRING:
  ------------------
  |  Branch (30837:9): [True: 7.64M, False: 49.3M]
  ------------------
30838|  7.64M|            janet_escape_string_b(buffer, janet_unwrap_string(x));
  ------------------
  |  |  863|  7.64M|#define janet_unwrap_string(x) ((JanetString)janet_nanbox_to_pointer(x))
  ------------------
30839|  7.64M|            return;
30840|  86.0k|        case JANET_BUFFER: {
  ------------------
  |  Branch (30840:9): [True: 86.0k, False: 56.8M]
  ------------------
30841|  86.0k|            JanetBuffer *b = janet_unwrap_buffer(x);
  ------------------
  |  |  862|  86.0k|#define janet_unwrap_buffer(x) ((JanetBuffer *)janet_nanbox_to_pointer(x))
  ------------------
30842|  86.0k|            janet_escape_buffer_b(buffer, b);
30843|  86.0k|            return;
30844|      0|        }
30845|   561k|        case JANET_ABSTRACT: {
  ------------------
  |  Branch (30845:9): [True: 561k, False: 56.4M]
  ------------------
30846|   561k|            JanetAbstract p = janet_unwrap_abstract(x);
  ------------------
  |  |  866|   561k|#define janet_unwrap_abstract(x) (janet_nanbox_to_pointer(x))
  ------------------
30847|   561k|            const JanetAbstractType *t = janet_abstract_type(p);
  ------------------
  |  | 1899|   561k|#define janet_abstract_type(u) (janet_abstract_head(u)->type)
  |  |  ------------------
  |  |  |  | 1897|   561k|#define janet_abstract_head(u) ((JanetAbstractHead *)((char *)u - offsetof(JanetAbstractHead, data)))
  |  |  ------------------
  ------------------
30848|   561k|            if (t->tostring != NULL) {
  ------------------
  |  Branch (30848:17): [True: 561k, False: 0]
  ------------------
30849|   561k|                janet_buffer_push_cstring(buffer, "<");
30850|   561k|                janet_buffer_push_cstring(buffer, t->name);
30851|   561k|                janet_buffer_push_cstring(buffer, " ");
30852|   561k|                t->tostring(p, buffer);
30853|   561k|                janet_buffer_push_cstring(buffer, ">");
30854|   561k|            } else {
30855|      0|                string_description_b(buffer, t->name, p);
30856|      0|            }
30857|   561k|            return;
30858|      0|        }
30859|  56.9M|    }
30860|  46.9M|    janet_to_string_b(buffer, x);
30861|  46.9M|}
janet_formatbv:
31514|  19.5M|void janet_formatbv(JanetBuffer *b, const char *format, va_list args) {
31515|  19.5M|    const char *format_end = format + strlen(format);
31516|  19.5M|    const char *c = format;
31517|  19.5M|    int32_t startlen = b->count;
31518|   208M|    while (c < format_end) {
  ------------------
  |  Branch (31518:12): [True: 189M, False: 19.5M]
  ------------------
31519|   189M|        if (*c != '%') {
  ------------------
  |  Branch (31519:13): [True: 149M, False: 39.8M]
  ------------------
31520|   149M|            janet_buffer_push_u8(b, (uint8_t) *c++);
31521|   149M|        } else if (*++c == '%') {
  ------------------
  |  Branch (31521:20): [True: 0, False: 39.8M]
  ------------------
31522|      0|            janet_buffer_push_u8(b, (uint8_t) *c++);
31523|  39.8M|        } else {
31524|  39.8M|            char form[MAX_FORMAT], item[MAX_ITEM];
31525|  39.8M|            char width[3], precision[3];
31526|  39.8M|            int nb = 0; /* number of bytes in added item */
31527|  39.8M|            c = scanformat(c, form, width, precision);
31528|  39.8M|            switch (*c++) {
31529|      0|                case 'c': {
  ------------------
  |  Branch (31529:17): [True: 0, False: 39.8M]
  ------------------
31530|      0|                    int n = va_arg(args, int);
31531|      0|                    nb = snprintf(item, MAX_ITEM, form, n);
  ------------------
  |  |31437|      0|#define MAX_ITEM  256
  ------------------
31532|      0|                    break;
31533|      0|                }
31534|  20.6M|                case 'd':
  ------------------
  |  Branch (31534:17): [True: 20.6M, False: 19.1M]
  ------------------
31535|  20.6M|                case 'i': {
  ------------------
  |  Branch (31535:17): [True: 0, False: 39.8M]
  ------------------
31536|  20.6M|                    int64_t n = (int64_t) va_arg(args, int32_t);
31537|  20.6M|                    nb = snprintf(item, MAX_ITEM, form, n);
  ------------------
  |  |31437|  20.6M|#define MAX_ITEM  256
  ------------------
31538|  20.6M|                    break;
31539|  20.6M|                }
31540|      0|                case 'D':
  ------------------
  |  Branch (31540:17): [True: 0, False: 39.8M]
  ------------------
31541|      0|                case 'I': {
  ------------------
  |  Branch (31541:17): [True: 0, False: 39.8M]
  ------------------
31542|      0|                    int64_t n = va_arg(args, int64_t);
31543|      0|                    nb = snprintf(item, MAX_ITEM, form, n);
  ------------------
  |  |31437|      0|#define MAX_ITEM  256
  ------------------
31544|      0|                    break;
31545|      0|                }
31546|      0|                case 'x':
  ------------------
  |  Branch (31546:17): [True: 0, False: 39.8M]
  ------------------
31547|      0|                case 'X':
  ------------------
  |  Branch (31547:17): [True: 0, False: 39.8M]
  ------------------
31548|      0|                case 'o':
  ------------------
  |  Branch (31548:17): [True: 0, False: 39.8M]
  ------------------
31549|      0|                case 'u': {
  ------------------
  |  Branch (31549:17): [True: 0, False: 39.8M]
  ------------------
31550|      0|                    uint64_t n = va_arg(args, uint64_t);
31551|      0|                    nb = snprintf(item, MAX_ITEM, form, n);
  ------------------
  |  |31437|      0|#define MAX_ITEM  256
  ------------------
31552|      0|                    break;
31553|      0|                }
31554|      0|                case 'a':
  ------------------
  |  Branch (31554:17): [True: 0, False: 39.8M]
  ------------------
31555|      0|                case 'A':
  ------------------
  |  Branch (31555:17): [True: 0, False: 39.8M]
  ------------------
31556|      0|                case 'e':
  ------------------
  |  Branch (31556:17): [True: 0, False: 39.8M]
  ------------------
31557|      0|                case 'E':
  ------------------
  |  Branch (31557:17): [True: 0, False: 39.8M]
  ------------------
31558|      0|                case 'f':
  ------------------
  |  Branch (31558:17): [True: 0, False: 39.8M]
  ------------------
31559|      0|                case 'g':
  ------------------
  |  Branch (31559:17): [True: 0, False: 39.8M]
  ------------------
31560|      0|                case 'G': {
  ------------------
  |  Branch (31560:17): [True: 0, False: 39.8M]
  ------------------
31561|      0|                    double d = va_arg(args, double);
31562|      0|                    nb = snprintf(item, MAX_ITEM, form, d);
  ------------------
  |  |31437|      0|#define MAX_ITEM  256
  ------------------
31563|      0|                    break;
31564|      0|                }
31565|   409k|                case 's':
  ------------------
  |  Branch (31565:17): [True: 409k, False: 39.4M]
  ------------------
31566|   409k|                case 'S': {
  ------------------
  |  Branch (31566:17): [True: 380, False: 39.8M]
  ------------------
31567|   409k|                    const char *str = va_arg(args, const char *);
31568|   409k|                    int32_t len = (c[-1] == 's')
  ------------------
  |  Branch (31568:35): [True: 409k, False: 380]
  ------------------
31569|   409k|                                  ? (int32_t) strlen(str)
31570|   409k|                                  : janet_string_length((JanetString) str);
  ------------------
  |  | 1813|    380|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  ------------------
  |  |  |  | 1812|    380|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
31571|   409k|                    if (form[2] == '\0')
  ------------------
  |  Branch (31571:25): [True: 409k, False: 0]
  ------------------
31572|   409k|                        janet_buffer_push_bytes(b, (const uint8_t *) str, len);
31573|      0|                    else {
31574|      0|                        if (len != (int32_t) strlen((const char *) str))
  ------------------
  |  Branch (31574:29): [True: 0, False: 0]
  ------------------
31575|      0|                            janet_panic("string contains zeros");
31576|      0|                        if (!strchr(form, '.') && len >= 100) {
  ------------------
  |  Branch (31576:29): [True: 0, False: 0]
  |  Branch (31576:51): [True: 0, False: 0]
  ------------------
31577|      0|                            janet_panic("no precision and string is too long to be formatted");
31578|      0|                        } else {
31579|      0|                            nb = snprintf(item, MAX_ITEM, form, str);
  ------------------
  |  |31437|      0|#define MAX_ITEM  256
  ------------------
31580|      0|                        }
31581|      0|                    }
31582|   409k|                    break;
31583|   409k|                }
31584|   409k|                case 'V':
  ------------------
  |  Branch (31584:17): [True: 0, False: 39.8M]
  ------------------
31585|      0|                    janet_to_string_b(b, va_arg(args, Janet));
31586|      0|                    break;
31587|  73.1k|                case 'v':
  ------------------
  |  Branch (31587:17): [True: 73.1k, False: 39.7M]
  ------------------
31588|  73.1k|                    janet_description_b(b, va_arg(args, Janet));
31589|  73.1k|                    break;
31590|      0|                case 't':
  ------------------
  |  Branch (31590:17): [True: 0, False: 39.8M]
  ------------------
31591|      0|                    janet_buffer_push_cstring(b, typestr(va_arg(args, Janet)));
31592|      0|                    break;
31593|      0|                case 'T': {
  ------------------
  |  Branch (31593:17): [True: 0, False: 39.8M]
  ------------------
31594|      0|                    int types = va_arg(args, int);
31595|      0|                    pushtypes(b, types);
31596|      0|                    break;
31597|   409k|                }
31598|      0|                case 'M':
  ------------------
  |  Branch (31598:17): [True: 0, False: 39.8M]
  ------------------
31599|  18.7M|                case 'm':
  ------------------
  |  Branch (31599:17): [True: 18.7M, False: 21.1M]
  ------------------
31600|  18.7M|                case 'N':
  ------------------
  |  Branch (31600:17): [True: 0, False: 39.8M]
  ------------------
31601|  18.7M|                case 'n':
  ------------------
  |  Branch (31601:17): [True: 0, False: 39.8M]
  ------------------
31602|  18.7M|                case 'Q':
  ------------------
  |  Branch (31602:17): [True: 0, False: 39.8M]
  ------------------
31603|  18.7M|                case 'q':
  ------------------
  |  Branch (31603:17): [True: 0, False: 39.8M]
  ------------------
31604|  18.7M|                case 'P':
  ------------------
  |  Branch (31604:17): [True: 0, False: 39.8M]
  ------------------
31605|  18.7M|                case 'p': { /* janet pretty , precision = depth */
  ------------------
  |  Branch (31605:17): [True: 2.72k, False: 39.8M]
  ------------------
31606|  18.7M|                    int depth = atoi(precision);
31607|  18.7M|                    if (depth < 1) depth = JANET_RECURSION_GUARD;
  ------------------
  |  |  296|  18.7M|#define JANET_RECURSION_GUARD 1024
  ------------------
  |  Branch (31607:25): [True: 18.7M, False: 0]
  ------------------
31608|  18.7M|                    char d = c[-1];
31609|  18.7M|                    int has_color = (d == 'P') || (d == 'Q') || (d == 'M') || (d == 'N');
  ------------------
  |  Branch (31609:37): [True: 0, False: 18.7M]
  |  Branch (31609:51): [True: 0, False: 18.7M]
  |  Branch (31609:65): [True: 0, False: 18.7M]
  |  Branch (31609:79): [True: 0, False: 18.7M]
  ------------------
31610|  18.7M|                    int has_oneline = (d == 'Q') || (d == 'q') || (d == 'N') || (d == 'n');
  ------------------
  |  Branch (31610:39): [True: 0, False: 18.7M]
  |  Branch (31610:53): [True: 0, False: 18.7M]
  |  Branch (31610:67): [True: 0, False: 18.7M]
  |  Branch (31610:81): [True: 0, False: 18.7M]
  ------------------
31611|  18.7M|                    int has_notrunc = (d == 'M') || (d == 'm') || (d == 'N') || (d == 'n');
  ------------------
  |  Branch (31611:39): [True: 0, False: 18.7M]
  |  Branch (31611:53): [True: 18.7M, False: 2.72k]
  |  Branch (31611:67): [True: 0, False: 2.72k]
  |  Branch (31611:81): [True: 0, False: 2.72k]
  ------------------
31612|  18.7M|                    int columns = atoi(width);
31613|  18.7M|                    if (columns == 0) {
  ------------------
  |  Branch (31613:25): [True: 18.7M, False: 0]
  ------------------
31614|  18.7M|                        columns = JANET_COLUMNS;
  ------------------
  |  |31350|  18.7M|#define JANET_COLUMNS 80
  ------------------
31615|  18.7M|                    } else if (columns < 0) {
  ------------------
  |  Branch (31615:32): [True: 0, False: 0]
  ------------------
31616|      0|                        has_oneline = 1;
31617|      0|                    }
31618|  18.7M|                    int flags = 0;
31619|  18.7M|                    flags |= has_color ? JANET_PRETTY_COLOR : 0;
  ------------------
  |  | 1967|      0|#define JANET_PRETTY_COLOR 1
  ------------------
  |  Branch (31619:30): [True: 0, False: 18.7M]
  ------------------
31620|  18.7M|                    flags |= has_oneline ? JANET_PRETTY_ONELINE : 0;
  ------------------
  |  | 1968|      0|#define JANET_PRETTY_ONELINE 2
  ------------------
  |  Branch (31620:30): [True: 0, False: 18.7M]
  ------------------
31621|  18.7M|                    flags |= has_notrunc ? JANET_PRETTY_NOTRUNC : 0;
  ------------------
  |  | 1969|  18.7M|#define JANET_PRETTY_NOTRUNC 4
  ------------------
  |  Branch (31621:30): [True: 18.7M, False: 2.72k]
  ------------------
31622|  18.7M|                    janet_pretty_(b, depth, columns, flags,
31623|  18.7M|                                  va_arg(args, Janet), startlen, b->count);
31624|  18.7M|                    break;
31625|  18.7M|                }
31626|      0|                case 'j': {
  ------------------
  |  Branch (31626:17): [True: 0, False: 39.8M]
  ------------------
31627|      0|                    int depth = atoi(precision);
31628|      0|                    if (depth < 1) {
  ------------------
  |  Branch (31628:25): [True: 0, False: 0]
  ------------------
31629|      0|                        depth = JANET_RECURSION_GUARD;
  ------------------
  |  |  296|      0|#define JANET_RECURSION_GUARD 1024
  ------------------
31630|      0|                    }
31631|      0|                    janet_jdn_(b, depth, va_arg(args, Janet), startlen, b->count);
31632|      0|                    break;
31633|  18.7M|                }
31634|      0|                default: {
  ------------------
  |  Branch (31634:17): [True: 0, False: 39.8M]
  ------------------
31635|       |                    /* also treat cases 'nLlh' */
31636|      0|                    janet_panicf("invalid conversion '%s' to 'format'",
31637|      0|                                 form);
31638|  18.7M|                }
31639|  39.8M|            }
31640|  39.8M|            if (nb >= MAX_ITEM)
  ------------------
  |  |31437|  39.8M|#define MAX_ITEM  256
  ------------------
  |  Branch (31640:17): [True: 0, False: 39.8M]
  ------------------
31641|      0|                janet_panic("format buffer overflow");
31642|  39.8M|            if (nb > 0)
  ------------------
  |  Branch (31642:17): [True: 20.6M, False: 19.1M]
  ------------------
31643|  20.6M|                janet_buffer_push_bytes(b, (uint8_t *) item, nb);
31644|  39.8M|        }
31645|       |
31646|   189M|    }
31647|  19.5M|}
janet_formatc:
31651|  1.36k|const uint8_t *janet_formatc(const char *format, ...) {
31652|  1.36k|    va_list args;
31653|  1.36k|    const uint8_t *ret;
31654|  1.36k|    JanetBuffer buffer;
31655|  1.36k|    int32_t len = 0;
31656|       |
31657|       |    /* Calculate length, init buffer and args */
31658|  37.7k|    while (format[len]) len++;
  ------------------
  |  Branch (31658:12): [True: 36.3k, False: 1.36k]
  ------------------
31659|  1.36k|    janet_buffer_init(&buffer, len);
31660|  1.36k|    va_start(args, format);
31661|       |
31662|       |    /* Run format */
31663|  1.36k|    janet_formatbv(&buffer, format, args);
31664|       |
31665|       |    /* Iterate length */
31666|  1.36k|    va_end(args);
31667|       |
31668|  1.36k|    ret = janet_string(buffer.data, buffer.count);
31669|  1.36k|    janet_buffer_deinit(&buffer);
31670|  1.36k|    return ret;
31671|  1.36k|}
janet_formatb:
31673|  1.39k|JanetBuffer *janet_formatb(JanetBuffer *buffer, const char *format, ...) {
31674|  1.39k|    va_list args;
31675|  1.39k|    va_start(args, format);
31676|  1.39k|    janet_formatbv(buffer, format, args);
31677|       |    va_end(args);
31678|  1.39k|    return buffer;
31679|  1.39k|}
janet_string:
33595|  18.7M|const uint8_t *janet_string(const uint8_t *buf, int32_t len) {
33596|  18.7M|    JanetStringHead *head = janet_gcalloc(JANET_MEMORY_STRING, sizeof(JanetStringHead) + (size_t) len + 1);
33597|  18.7M|    head->length = len;
33598|  18.7M|    head->hash = janet_string_calchash(buf, len);
33599|  18.7M|    uint8_t *data = (uint8_t *)head->data;
33600|  18.7M|    safe_memcpy(data, buf, len);
33601|  18.7M|    data[len] = 0;
33602|  18.7M|    return data;
33603|  18.7M|}
janet_string_compare:
33606|  2.39M|int janet_string_compare(const uint8_t *lhs, const uint8_t *rhs) {
33607|  2.39M|    int32_t xlen = janet_string_length(lhs);
  ------------------
  |  | 1813|  2.39M|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  ------------------
  |  |  |  | 1812|  2.39M|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
33608|  2.39M|    int32_t ylen = janet_string_length(rhs);
  ------------------
  |  | 1813|  2.39M|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  ------------------
  |  |  |  | 1812|  2.39M|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
33609|  2.39M|    int32_t len = xlen > ylen ? ylen : xlen;
  ------------------
  |  Branch (33609:19): [True: 829k, False: 1.56M]
  ------------------
33610|  2.39M|    int res = memcmp(lhs, rhs, len);
33611|  2.39M|    if (res) return res > 0 ? 1 : -1;
  ------------------
  |  Branch (33611:9): [True: 2.30M, False: 85.3k]
  |  Branch (33611:21): [True: 162k, False: 2.14M]
  ------------------
33612|  85.3k|    if (xlen == ylen) return 0;
  ------------------
  |  Branch (33612:9): [True: 82.4k, False: 2.90k]
  ------------------
33613|  2.90k|    return xlen < ylen ? -1 : 1;
  ------------------
  |  Branch (33613:12): [True: 2.63k, False: 276]
  ------------------
33614|  85.3k|}
janet_string_equalconst:
33617|  44.9M|int janet_string_equalconst(const uint8_t *lhs, const uint8_t *rhs, int32_t rlen, int32_t rhash) {
33618|  44.9M|    int32_t lhash = janet_string_hash(lhs);
  ------------------
  |  | 1814|  44.9M|#define janet_string_hash(s) (janet_string_head(s)->hash)
  |  |  ------------------
  |  |  |  | 1812|  44.9M|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
33619|  44.9M|    int32_t llen = janet_string_length(lhs);
  ------------------
  |  | 1813|  44.9M|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  ------------------
  |  |  |  | 1812|  44.9M|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
33620|  44.9M|    if (lhash != rhash || llen != rlen)
  ------------------
  |  Branch (33620:9): [True: 20.0M, False: 24.8M]
  |  Branch (33620:27): [True: 39, False: 24.8M]
  ------------------
33621|  20.0M|        return 0;
33622|  24.8M|    if (lhs == rhs)
  ------------------
  |  Branch (33622:9): [True: 14.1M, False: 10.7M]
  ------------------
33623|  14.1M|        return 1;
33624|  10.7M|    return !memcmp(lhs, rhs, rlen);
33625|  24.8M|}
janet_string_equal:
33628|  1.67k|int janet_string_equal(const uint8_t *lhs, const uint8_t *rhs) {
33629|  1.67k|    return janet_string_equalconst(lhs, rhs,
33630|  1.67k|                                   janet_string_length(rhs), janet_string_hash(rhs));
  ------------------
  |  | 1813|  1.67k|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  ------------------
  |  |  |  | 1812|  1.67k|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
                                                 janet_string_length(rhs), janet_string_hash(rhs));
  ------------------
  |  | 1814|  1.67k|#define janet_string_hash(s) (janet_string_head(s)->hash)
  |  |  ------------------
  |  |  |  | 1812|  1.67k|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
33631|  1.67k|}
janet_lib_string:
34212|  7.06k|void janet_lib_string(JanetTable *env) {
34213|  7.06k|    JanetRegExt string_cfuns[] = {
34214|  7.06k|        JANET_CORE_REG("string/slice", cfun_string_slice),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34215|  7.06k|        JANET_CORE_REG("keyword/slice", cfun_keyword_slice),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34216|  7.06k|        JANET_CORE_REG("symbol/slice", cfun_symbol_slice),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34217|  7.06k|        JANET_CORE_REG("string/repeat", cfun_string_repeat),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34218|  7.06k|        JANET_CORE_REG("string/bytes", cfun_string_bytes),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34219|  7.06k|        JANET_CORE_REG("string/from-bytes", cfun_string_frombytes),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34220|  7.06k|        JANET_CORE_REG("string/ascii-lower", cfun_string_asciilower),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34221|  7.06k|        JANET_CORE_REG("string/ascii-upper", cfun_string_asciiupper),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34222|  7.06k|        JANET_CORE_REG("string/reverse", cfun_string_reverse),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34223|  7.06k|        JANET_CORE_REG("string/find", cfun_string_find),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34224|  7.06k|        JANET_CORE_REG("string/find-all", cfun_string_findall),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34225|  7.06k|        JANET_CORE_REG("string/has-prefix?", cfun_string_hasprefix),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34226|  7.06k|        JANET_CORE_REG("string/has-suffix?", cfun_string_hassuffix),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34227|  7.06k|        JANET_CORE_REG("string/replace", cfun_string_replace),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34228|  7.06k|        JANET_CORE_REG("string/replace-all", cfun_string_replaceall),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34229|  7.06k|        JANET_CORE_REG("string/split", cfun_string_split),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34230|  7.06k|        JANET_CORE_REG("string/check-set", cfun_string_checkset),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34231|  7.06k|        JANET_CORE_REG("string/join", cfun_string_join),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34232|  7.06k|        JANET_CORE_REG("string/format", cfun_string_format),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34233|  7.06k|        JANET_CORE_REG("string/trim", cfun_string_trim),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34234|  7.06k|        JANET_CORE_REG("string/triml", cfun_string_triml),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34235|  7.06k|        JANET_CORE_REG("string/trimr", cfun_string_trimr),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34236|  7.06k|        JANET_REG_END
  ------------------
  |  | 2110|  7.06k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
34237|  7.06k|    };
34238|       |    janet_core_cfuns_ext(env, NULL, string_cfuns);
34239|  7.06k|}
janet_scan_number_base:
34500|  15.8k|    double *out) {
34501|  15.8k|    const uint8_t *end = str + len;
34502|  15.8k|    int seenadigit = 0;
34503|  15.8k|    int ex = 0;
34504|  15.8k|    int seenpoint = 0;
34505|  15.8k|    int foundexp = 0;
34506|  15.8k|    int neg = 0;
34507|  15.8k|    struct BigNat mant;
34508|  15.8k|    bignat_zero(&mant);
34509|       |
34510|       |    /* Prevent some kinds of overflow bugs relating to the exponent
34511|       |     * overflowing.  For example, if a string was passed 2GB worth of 0s after
34512|       |     * the decimal point, exponent could wrap around and become positive. It's
34513|       |     * easier to reject ridiculously large inputs than to check for overflows.
34514|       |     * */
34515|  15.8k|    if (len > JANET_NUMBER_LENGTH_RIDICULOUS) goto error;
  ------------------
  |  |34296|  15.8k|#define JANET_NUMBER_LENGTH_RIDICULOUS 0xFFFF
  ------------------
  |  Branch (34515:9): [True: 0, False: 15.8k]
  ------------------
34516|       |
34517|       |    /* Get sign */
34518|  15.8k|    if (str >= end) goto error;
  ------------------
  |  Branch (34518:9): [True: 0, False: 15.8k]
  ------------------
34519|  15.8k|    if (*str == '-') {
  ------------------
  |  Branch (34519:9): [True: 2.34k, False: 13.4k]
  ------------------
34520|  2.34k|        neg = 1;
34521|  2.34k|        str++;
34522|  13.4k|    } else if (*str == '+') {
  ------------------
  |  Branch (34522:16): [True: 1.35k, False: 12.1k]
  ------------------
34523|  1.35k|        str++;
34524|  1.35k|    }
34525|       |
34526|       |    /* Check for leading 0x or digit digit r */
34527|  15.8k|    if (base == 0) {
  ------------------
  |  Branch (34527:9): [True: 15.8k, False: 0]
  ------------------
34528|  15.8k|        if (str + 1 < end && str[0] == '0' && str[1] == 'x') {
  ------------------
  |  Branch (34528:13): [True: 8.27k, False: 7.56k]
  |  Branch (34528:30): [True: 1.31k, False: 6.95k]
  |  Branch (34528:47): [True: 314, False: 1.00k]
  ------------------
34529|    314|            base = 16;
34530|    314|            str += 2;
34531|  15.5k|        } else if (str + 1 < end  &&
  ------------------
  |  Branch (34531:20): [True: 7.96k, False: 7.56k]
  ------------------
34532|  7.96k|                   str[0] >= '0' && str[0] <= '9' &&
  ------------------
  |  Branch (34532:20): [True: 6.28k, False: 1.67k]
  |  Branch (34532:37): [True: 5.95k, False: 335]
  ------------------
34533|  5.95k|                   str[1] == 'r') {
  ------------------
  |  Branch (34533:20): [True: 84, False: 5.86k]
  ------------------
34534|     84|            base = str[0] - '0';
34535|     84|            str += 2;
34536|  15.4k|        } else if (str + 2 < end  &&
  ------------------
  |  Branch (34536:20): [True: 5.05k, False: 10.3k]
  ------------------
34537|  5.05k|                   str[0] >= '0' && str[0] <= '9' &&
  ------------------
  |  Branch (34537:20): [True: 4.27k, False: 775]
  |  Branch (34537:37): [True: 4.13k, False: 149]
  ------------------
34538|  4.13k|                   str[1] >= '0' && str[1] <= '9' &&
  ------------------
  |  Branch (34538:20): [True: 2.80k, False: 1.32k]
  |  Branch (34538:37): [True: 2.20k, False: 602]
  ------------------
34539|  2.20k|                   str[2] == 'r') {
  ------------------
  |  Branch (34539:20): [True: 220, False: 1.98k]
  ------------------
34540|    220|            base = 10 * (str[0] - '0') + (str[1] - '0');
34541|    220|            if (base < 2 || base > 36) goto error;
  ------------------
  |  Branch (34541:17): [True: 40, False: 180]
  |  Branch (34541:29): [True: 41, False: 139]
  ------------------
34542|    139|            str += 3;
34543|    139|        }
34544|  15.8k|    }
34545|       |
34546|       |    /* If still base is 0, set to default (10) */
34547|  15.7k|    if (base == 0) {
  ------------------
  |  Branch (34547:9): [True: 15.2k, False: 469]
  ------------------
34548|  15.2k|        base = 10;
34549|  15.2k|    }
34550|  15.7k|    int exp_base = base;
34551|       |
34552|       |    /* Skip leading zeros */
34553|  21.1k|    while (str < end && (*str == '0' || *str == '.')) {
  ------------------
  |  Branch (34553:12): [True: 17.8k, False: 3.35k]
  |  Branch (34553:26): [True: 3.10k, False: 14.7k]
  |  Branch (34553:41): [True: 2.52k, False: 12.1k]
  ------------------
34554|  5.63k|        if (seenpoint) ex--;
  ------------------
  |  Branch (34554:13): [True: 557, False: 5.07k]
  ------------------
34555|  5.63k|        if (*str == '.') {
  ------------------
  |  Branch (34555:13): [True: 2.52k, False: 3.10k]
  ------------------
34556|  2.52k|            if (seenpoint) goto error;
  ------------------
  |  Branch (34556:17): [True: 218, False: 2.30k]
  ------------------
34557|  2.30k|            seenpoint = 1;
34558|  3.10k|        } else {
34559|  3.10k|            seenadigit = 1;
34560|  3.10k|        }
34561|  5.41k|        str++;
34562|  5.41k|    }
34563|       |
34564|       |    /* Parse significant digits */
34565|  41.8k|    while (str < end) {
  ------------------
  |  Branch (34565:12): [True: 30.1k, False: 11.6k]
  ------------------
34566|  30.1k|        if (*str == '.') {
  ------------------
  |  Branch (34566:13): [True: 700, False: 29.4k]
  ------------------
34567|    700|            if (seenpoint) goto error;
  ------------------
  |  Branch (34567:17): [True: 112, False: 588]
  ------------------
34568|    588|            seenpoint = 1;
34569|  29.4k|        } else if (*str == '&') {
  ------------------
  |  Branch (34569:20): [True: 1.32k, False: 28.1k]
  ------------------
34570|  1.32k|            foundexp = 1;
34571|  1.32k|            break;
34572|  28.1k|        } else if (base == 16 && (*str == 'P' || *str == 'p')) { /* IEEE hex float */
  ------------------
  |  Branch (34572:20): [True: 1.93k, False: 26.1k]
  |  Branch (34572:35): [True: 34, False: 1.90k]
  |  Branch (34572:50): [True: 106, False: 1.79k]
  ------------------
34573|    140|            foundexp = 1;
34574|    140|            exp_base = 10;
34575|    140|            base = 2;
34576|    140|            ex *= 4; /* We need to correct the current exponent after we change the base */
34577|    140|            break;
34578|  27.9k|        } else if (base == 10 && (*str == 'E' || *str == 'e')) {
  ------------------
  |  Branch (34578:20): [True: 24.6k, False: 3.34k]
  |  Branch (34578:35): [True: 341, False: 24.2k]
  |  Branch (34578:50): [True: 342, False: 23.9k]
  ------------------
34579|    683|            foundexp = 1;
34580|    683|            break;
34581|  27.2k|        } else if (*str == '_') {
  ------------------
  |  Branch (34581:20): [True: 797, False: 26.4k]
  ------------------
34582|    797|            if (!seenadigit) goto error;
  ------------------
  |  Branch (34582:17): [True: 193, False: 604]
  ------------------
34583|  26.4k|        } else {
34584|  26.4k|            int digit = digit_lookup[*str & 0x7F];
34585|  26.4k|            if (*str > 127 || digit >= base) goto error;
  ------------------
  |  Branch (34585:17): [True: 131, False: 26.3k]
  |  Branch (34585:31): [True: 1.27k, False: 25.0k]
  ------------------
34586|  25.0k|            if (seenpoint) ex--;
  ------------------
  |  Branch (34586:17): [True: 3.22k, False: 21.8k]
  ------------------
34587|  25.0k|            bignat_muladd(&mant, base, digit);
34588|  25.0k|            seenadigit = 1;
34589|  25.0k|        }
34590|  26.2k|        str++;
34591|  26.2k|    }
34592|       |
34593|  13.8k|    if (!seenadigit)
  ------------------
  |  Branch (34593:9): [True: 1.80k, False: 12.0k]
  ------------------
34594|  1.80k|        goto error;
34595|       |
34596|       |    /* Read exponent */
34597|  12.0k|    if (str < end && foundexp) {
  ------------------
  |  Branch (34597:9): [True: 2.10k, False: 9.91k]
  |  Branch (34597:22): [True: 2.10k, False: 0]
  ------------------
34598|  2.10k|        int eneg = 0;
34599|  2.10k|        int32_t ee = 0;
34600|  2.10k|        seenadigit = 0;
34601|  2.10k|        str++;
34602|  2.10k|        if (str >= end) goto error;
  ------------------
  |  Branch (34602:13): [True: 95, False: 2.01k]
  ------------------
34603|  2.01k|        if (*str == '-') {
  ------------------
  |  Branch (34603:13): [True: 272, False: 1.73k]
  ------------------
34604|    272|            eneg = 1;
34605|    272|            str++;
34606|  1.73k|        } else if (*str == '+') {
  ------------------
  |  Branch (34606:20): [True: 95, False: 1.64k]
  ------------------
34607|     95|            str++;
34608|     95|        }
34609|       |        /* Skip leading 0s in exponent */
34610|  2.75k|        while (str < end && *str == '0') {
  ------------------
  |  Branch (34610:16): [True: 2.46k, False: 292]
  |  Branch (34610:29): [True: 747, False: 1.71k]
  ------------------
34611|    747|            str++;
34612|    747|            seenadigit = 1;
34613|    747|        }
34614|  6.10k|        while (str < end) {
  ------------------
  |  Branch (34614:16): [True: 4.31k, False: 1.79k]
  ------------------
34615|  4.31k|            int digit = digit_lookup[*str & 0x7F];
34616|  4.31k|            if (*str > 127 || digit >= exp_base) goto error;
  ------------------
  |  Branch (34616:17): [True: 33, False: 4.28k]
  |  Branch (34616:31): [True: 186, False: 4.09k]
  ------------------
34617|  4.09k|            if (ee < (INT32_MAX / 40)) {
  ------------------
  |  Branch (34617:17): [True: 3.65k, False: 445]
  ------------------
34618|  3.65k|                ee = exp_base * ee + digit;
34619|  3.65k|            }
34620|  4.09k|            str++;
34621|  4.09k|            seenadigit = 1;
34622|  4.09k|        }
34623|  1.79k|        if (eneg) ex -= ee;
  ------------------
  |  Branch (34623:13): [True: 266, False: 1.52k]
  ------------------
34624|  1.52k|        else ex += ee;
34625|  1.79k|    }
34626|       |
34627|  11.7k|    if (!seenadigit)
  ------------------
  |  Branch (34627:9): [True: 46, False: 11.6k]
  ------------------
34628|     46|        goto error;
34629|       |
34630|  11.6k|    *out = convert(neg, &mant, base, ex);
34631|  11.6k|    janet_free(mant.digits);
  ------------------
  |  | 2415|  11.6k|#define janet_free(X) free((X))
  ------------------
34632|  11.6k|    return 0;
34633|       |
34634|  4.17k|error:
34635|  4.17k|    janet_free(mant.digits);
  ------------------
  |  | 2415|  4.17k|#define janet_free(X) free((X))
  ------------------
34636|  4.17k|    return 1;
34637|  11.7k|}
janet_scan_int64:
34710|  1.65k|int janet_scan_int64(const uint8_t *str, int32_t len, int64_t *out) {
34711|  1.65k|    int neg;
34712|  1.65k|    uint64_t bi;
34713|  1.65k|    if (scan_uint64(str, len, &bi, &neg)) {
  ------------------
  |  Branch (34713:9): [True: 1.17k, False: 488]
  ------------------
34714|  1.17k|        if (neg && bi <= ((UINT64_MAX / 2) + 1)) {
  ------------------
  |  Branch (34714:13): [True: 268, False: 902]
  |  Branch (34714:20): [True: 256, False: 12]
  ------------------
34715|    256|            if (bi > INT64_MAX) {
  ------------------
  |  Branch (34715:17): [True: 10, False: 246]
  ------------------
34716|     10|                *out = INT64_MIN;
34717|    246|            } else {
34718|    246|                *out = -((int64_t) bi);
34719|    246|            }
34720|    256|            return 1;
34721|    256|        }
34722|    914|        if (!neg && bi <= INT64_MAX) {
  ------------------
  |  Branch (34722:13): [True: 902, False: 12]
  |  Branch (34722:21): [True: 845, False: 57]
  ------------------
34723|    845|            *out = (int64_t) bi;
34724|    845|            return 1;
34725|    845|        }
34726|    914|    }
34727|    557|    return 0;
34728|  1.65k|}
janet_scan_uint64:
34730|  1.57k|int janet_scan_uint64(const uint8_t *str, int32_t len, uint64_t *out) {
34731|  1.57k|    int neg;
34732|  1.57k|    uint64_t bi;
34733|  1.57k|    if (scan_uint64(str, len, &bi, &neg)) {
  ------------------
  |  Branch (34733:9): [True: 1.35k, False: 226]
  ------------------
34734|  1.35k|        if (!neg) {
  ------------------
  |  Branch (34734:13): [True: 1.31k, False: 40]
  ------------------
34735|  1.31k|            *out = bi;
34736|  1.31k|            return 1;
34737|  1.31k|        }
34738|  1.35k|    }
34739|    266|    return 0;
34740|  1.57k|}
janet_scan_numeric:
34747|  19.1k|    Janet *out) {
34748|  19.1k|    int result;
34749|  19.1k|    double num;
34750|  19.1k|    int64_t i64 = 0;
34751|  19.1k|    uint64_t u64 = 0;
34752|  19.1k|    if (len < 2 || str[len - 2] != ':') {
  ------------------
  |  Branch (34752:9): [True: 6.79k, False: 12.3k]
  |  Branch (34752:20): [True: 8.97k, False: 3.35k]
  ------------------
34753|  15.7k|        result = janet_scan_number_base(str, len, 0, &num);
34754|  15.7k|        *out = janet_wrap_number(num);
  ------------------
  |  |  835|  15.7k|#define janet_wrap_number(r) janet_nanbox_from_double(r)
  ------------------
34755|  15.7k|        return result;
34756|  15.7k|    }
34757|  3.35k|    switch (str[len - 1]) {
34758|     55|        default:
  ------------------
  |  Branch (34758:9): [True: 55, False: 3.30k]
  ------------------
34759|     55|            return 1;
34760|     69|        case 'n':
  ------------------
  |  Branch (34760:9): [True: 69, False: 3.29k]
  ------------------
34761|     69|            result = janet_scan_number_base(str, len - 2, 0, &num);
34762|     69|            *out = janet_wrap_number(num);
  ------------------
  |  |  835|     69|#define janet_wrap_number(r) janet_nanbox_from_double(r)
  ------------------
34763|     69|            return result;
34764|       |        /* Condition is inverted janet_scan_int64 and janet_scan_uint64 */
34765|  1.65k|        case 's':
  ------------------
  |  Branch (34765:9): [True: 1.65k, False: 1.70k]
  ------------------
34766|  1.65k|            result = !janet_scan_int64(str, len - 2, &i64);
34767|  1.65k|            *out = janet_wrap_s64(i64);
34768|  1.65k|            return result;
34769|  1.57k|        case 'u':
  ------------------
  |  Branch (34769:9): [True: 1.57k, False: 1.78k]
  ------------------
34770|  1.57k|            result = !janet_scan_uint64(str, len - 2, &u64);
34771|  1.57k|            *out = janet_wrap_u64(u64);
34772|  1.57k|            return result;
34773|  3.35k|    }
34774|  3.35k|}
janet_struct_begin:
34828|  54.7k|JanetKV *janet_struct_begin(int32_t count) {
34829|       |    /* Calculate capacity as power of 2 after 2 * count. */
34830|  54.7k|    int32_t capacity = janet_tablen(2 * count);
34831|  54.7k|    if (capacity < 0) capacity = janet_tablen(count + 1);
  ------------------
  |  Branch (34831:9): [True: 0, False: 54.7k]
  ------------------
34832|       |
34833|  54.7k|    size_t size = sizeof(JanetStructHead) + (size_t) capacity * sizeof(JanetKV);
34834|  54.7k|    JanetStructHead *head = janet_gcalloc(JANET_MEMORY_STRUCT, size);
34835|  54.7k|    head->length = count;
34836|  54.7k|    head->capacity = capacity;
34837|  54.7k|    head->hash = 0;
34838|  54.7k|    head->proto = NULL;
34839|       |
34840|  54.7k|    JanetKV *st = (JanetKV *)(head->data);
34841|  54.7k|    janet_memempty(st, capacity);
34842|  54.7k|    return st;
34843|  54.7k|}
janet_struct_find:
34846|  13.9M|const JanetKV *janet_struct_find(const JanetKV *st, Janet key) {
34847|       |    return janet_dict_find(st, janet_struct_capacity(st), key);
  ------------------
  |  | 1849|  13.9M|#define janet_struct_capacity(t) (janet_struct_head(t)->capacity)
  |  |  ------------------
  |  |  |  | 1846|  13.9M|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
34848|  13.9M|}
janet_struct_put_ext:
34858|   338k|void janet_struct_put_ext(JanetKV *st, Janet key, Janet value, int replace) {
34859|   338k|    int32_t cap = janet_struct_capacity(st);
  ------------------
  |  | 1849|   338k|#define janet_struct_capacity(t) (janet_struct_head(t)->capacity)
  |  |  ------------------
  |  |  |  | 1846|   338k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
34860|   338k|    int32_t hash = janet_hash(key);
34861|   338k|    int32_t index = janet_maphash(cap, hash);
  ------------------
  |  |  396|   338k|#define janet_maphash(cap, hash) ((uint32_t)(hash) & (cap - 1))
  ------------------
34862|   338k|    int32_t i, j, dist;
34863|   338k|    int32_t bounds[4] = {index, cap, 0, index};
34864|   338k|    if (janet_checktype(key, JANET_NIL) || janet_checktype(value, JANET_NIL)) return;
  ------------------
  |  |  806|   676k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 37, False: 338k]
  |  |  |  Branch (806:6): [Folded, False: 338k]
  |  |  ------------------
  |  |  807|   676k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|   676k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|   338k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|   338k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|   338k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|   338k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if (janet_checktype(key, JANET_NIL) || janet_checktype(value, JANET_NIL)) return;
  ------------------
  |  |  806|   338k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 30, False: 338k]
  |  |  |  Branch (806:6): [Folded, False: 338k]
  |  |  ------------------
  |  |  807|   338k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|   338k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|   338k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|   338k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|   338k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|   338k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
34865|   338k|    if (janet_checktype(key, JANET_NUMBER) && isnan(janet_unwrap_number(key))) return;
  ------------------
  |  |  806|   676k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 791, False: 337k]
  |  |  |  Branch (806:6): [True: 338k, Folded]
  |  |  ------------------
  |  |  807|   676k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|   338k|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 791, False: 337k]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 337k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|   676k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|      0|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|      0|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (34865:47): [True: 0, False: 791]
  ------------------
34866|       |    /* Avoid extra items */
34867|   338k|    if (janet_struct_hash(st) == janet_struct_length(st)) return;
  ------------------
  |  | 1850|   338k|#define janet_struct_hash(t) (janet_struct_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1846|   338k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
                  if (janet_struct_hash(st) == janet_struct_length(st)) return;
  ------------------
  |  | 1848|   338k|#define janet_struct_length(t) (janet_struct_head(t)->length)
  |  |  ------------------
  |  |  |  | 1846|   338k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (34867:9): [True: 0, False: 338k]
  ------------------
34868|   338k|    for (dist = 0, j = 0; j < 4; j += 2)
  ------------------
  |  Branch (34868:27): [True: 338k, False: 0]
  ------------------
34869|   482k|        for (i = bounds[j]; i < bounds[j + 1]; i++, dist++) {
  ------------------
  |  Branch (34869:29): [True: 482k, False: 178]
  ------------------
34870|   482k|            int status;
34871|   482k|            int32_t otherhash;
34872|   482k|            int32_t otherindex, otherdist;
34873|   482k|            JanetKV *kv = st + i;
34874|       |            /* We found an empty slot, so just add key and value */
34875|   482k|            if (janet_checktype(kv->key, JANET_NIL)) {
  ------------------
  |  |  806|   482k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 337k, False: 145k]
  |  |  |  Branch (806:6): [Folded, False: 482k]
  |  |  ------------------
  |  |  807|   482k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|   482k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|   482k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|   482k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|   482k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|   482k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
34876|   337k|                kv->key = key;
34877|   337k|                kv->value = value;
34878|       |                /* Update the temporary count */
34879|   337k|                janet_struct_hash(st)++;
  ------------------
  |  | 1850|   337k|#define janet_struct_hash(t) (janet_struct_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1846|   337k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
34880|   337k|                return;
34881|   337k|            }
34882|       |            /* Robinhood hashing - check if colliding kv pair
34883|       |             * is closer to their source than current. We use robinhood
34884|       |             * hashing to ensure that equivalent structs that are constructed
34885|       |             * with different order have the same internal layout, and therefor
34886|       |             * will compare properly - i.e., {1 2 3 4} should equal {3 4 1 2}.
34887|       |             * Collisions are resolved via an insertion sort insertion. */
34888|   145k|            otherhash = janet_hash(kv->key);
34889|   145k|            otherindex = janet_maphash(cap, otherhash);
  ------------------
  |  |  396|   145k|#define janet_maphash(cap, hash) ((uint32_t)(hash) & (cap - 1))
  ------------------
34890|   145k|            otherdist = (i + cap - otherindex) & (cap - 1);
34891|   145k|            if (dist < otherdist)
  ------------------
  |  Branch (34891:17): [True: 71.6k, False: 73.5k]
  ------------------
34892|  71.6k|                status = -1;
34893|  73.5k|            else if (otherdist < dist)
  ------------------
  |  Branch (34893:22): [True: 530, False: 73.0k]
  ------------------
34894|    530|                status = 1;
34895|  73.0k|            else if (hash < otherhash)
  ------------------
  |  Branch (34895:22): [True: 71.3k, False: 1.69k]
  ------------------
34896|  71.3k|                status = -1;
34897|  1.69k|            else if (otherhash < hash)
  ------------------
  |  Branch (34897:22): [True: 651, False: 1.04k]
  ------------------
34898|    651|                status = 1;
34899|  1.04k|            else
34900|  1.04k|                status = janet_compare(key, kv->key);
34901|       |            /* If other is closer to their ideal slot */
34902|   145k|            if (status == 1) {
  ------------------
  |  Branch (34902:17): [True: 1.19k, False: 143k]
  ------------------
34903|       |                /* Swap current kv pair with pair in slot */
34904|  1.19k|                JanetKV temp = *kv;
34905|  1.19k|                kv->key = key;
34906|  1.19k|                kv->value = value;
34907|  1.19k|                key = temp.key;
34908|  1.19k|                value = temp.value;
34909|       |                /* Save dist and hash of new kv pair */
34910|  1.19k|                dist = otherdist;
34911|  1.19k|                hash = otherhash;
34912|   143k|            } else if (status == 0) {
  ------------------
  |  Branch (34912:24): [True: 1.00k, False: 142k]
  ------------------
34913|  1.00k|                if (replace) {
  ------------------
  |  Branch (34913:21): [True: 1.00k, False: 0]
  ------------------
34914|       |                    /* A key was added to the struct more than once - replace old value */
34915|  1.00k|                    kv->value = value;
34916|  1.00k|                }
34917|  1.00k|                return;
34918|  1.00k|            }
34919|   145k|        }
34920|   338k|}
janet_struct_put:
34922|   338k|void janet_struct_put(JanetKV *st, Janet key, Janet value) {
34923|   338k|    janet_struct_put_ext(st, key, value, 1);
34924|   338k|}
janet_struct_end:
34927|  54.4k|const JanetKV *janet_struct_end(JanetKV *st) {
34928|  54.4k|    if (janet_struct_hash(st) != janet_struct_length(st)) {
  ------------------
  |  | 1850|  54.4k|#define janet_struct_hash(t) (janet_struct_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1846|  54.4k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
                  if (janet_struct_hash(st) != janet_struct_length(st)) {
  ------------------
  |  | 1848|  54.4k|#define janet_struct_length(t) (janet_struct_head(t)->length)
  |  |  ------------------
  |  |  |  | 1846|  54.4k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (34928:9): [True: 238, False: 54.2k]
  ------------------
34929|       |        /* Error building struct, probably duplicate values. We need to rebuild
34930|       |         * the struct using only the values that went in. The second creation should always
34931|       |         * succeed. */
34932|    238|        JanetKV *newst = janet_struct_begin(janet_struct_hash(st));
  ------------------
  |  | 1850|    238|#define janet_struct_hash(t) (janet_struct_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1846|    238|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
34933|  8.32k|        for (int32_t i = 0; i < janet_struct_capacity(st); i++) {
  ------------------
  |  | 1849|  8.32k|#define janet_struct_capacity(t) (janet_struct_head(t)->capacity)
  |  |  ------------------
  |  |  |  | 1846|  8.32k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (34933:29): [True: 8.08k, False: 238]
  ------------------
34934|  8.08k|            JanetKV *kv = st + i;
34935|  8.08k|            if (!janet_checktype(kv->key, JANET_NIL)) {
  ------------------
  |  |  806|  8.08k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 8.08k]
  |  |  ------------------
  |  |  807|  8.08k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  8.08k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  8.08k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  8.08k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  8.08k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  8.08k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (34935:17): [True: 1.32k, False: 6.76k]
  ------------------
34936|  1.32k|                janet_struct_put(newst, kv->key, kv->value);
34937|  1.32k|            }
34938|  8.08k|        }
34939|    238|        janet_struct_proto(newst) = janet_struct_proto(st);
  ------------------
  |  | 1851|    238|#define janet_struct_proto(t) (janet_struct_head(t)->proto)
  |  |  ------------------
  |  |  |  | 1846|    238|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
                      janet_struct_proto(newst) = janet_struct_proto(st);
  ------------------
  |  | 1851|    238|#define janet_struct_proto(t) (janet_struct_head(t)->proto)
  |  |  ------------------
  |  |  |  | 1846|    238|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
34940|    238|        st = newst;
34941|    238|    }
34942|  54.4k|    janet_struct_hash(st) = janet_kv_calchash(st, janet_struct_capacity(st));
  ------------------
  |  | 1850|  54.4k|#define janet_struct_hash(t) (janet_struct_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1846|  54.4k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
                  janet_struct_hash(st) = janet_kv_calchash(st, janet_struct_capacity(st));
  ------------------
  |  | 1849|  54.4k|#define janet_struct_capacity(t) (janet_struct_head(t)->capacity)
  |  |  ------------------
  |  |  |  | 1846|  54.4k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
34943|  54.4k|    if (janet_struct_proto(st)) {
  ------------------
  |  | 1851|  54.4k|#define janet_struct_proto(t) (janet_struct_head(t)->proto)
  |  |  ------------------
  |  |  |  | 1846|  54.4k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  |  |  |  Branch (1851:31): [True: 0, False: 54.4k]
  |  |  ------------------
  ------------------
34944|      0|        janet_struct_hash(st) += 2654435761u * janet_struct_hash(janet_struct_proto(st));
  ------------------
  |  | 1850|      0|#define janet_struct_hash(t) (janet_struct_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1846|      0|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
                      janet_struct_hash(st) += 2654435761u * janet_struct_hash(janet_struct_proto(st));
  ------------------
  |  | 1850|      0|#define janet_struct_hash(t) (janet_struct_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1846|      0|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
34945|      0|    }
34946|  54.4k|    return (const JanetKV *)st;
34947|  54.4k|}
janet_struct_get:
34956|  13.9M|Janet janet_struct_get(const JanetKV *st, Janet key) {
34957|  27.8M|    for (int i = JANET_MAX_PROTO_DEPTH; st && i; --i, st = janet_struct_proto(st)) {
  ------------------
  |  |  299|  13.9M|#define JANET_MAX_PROTO_DEPTH 200
  ------------------
                  for (int i = JANET_MAX_PROTO_DEPTH; st && i; --i, st = janet_struct_proto(st)) {
  ------------------
  |  | 1851|  13.9M|#define janet_struct_proto(t) (janet_struct_head(t)->proto)
  |  |  ------------------
  |  |  |  | 1846|  13.9M|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (34957:41): [True: 13.9M, False: 13.9M]
  |  Branch (34957:47): [True: 13.9M, False: 0]
  ------------------
34958|  13.9M|        const JanetKV *kv = janet_struct_find(st, key);
34959|  13.9M|        if (NULL != kv && !janet_checktype(kv->key, JANET_NIL)) {
  ------------------
  |  |  806|  13.9M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 13.9M]
  |  |  ------------------
  |  |  807|  13.9M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  13.9M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  13.9M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  13.9M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  13.9M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  13.9M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (34959:13): [True: 13.9M, False: 0]
  |  Branch (34959:27): [True: 1.91k, False: 13.9M]
  ------------------
34960|  1.91k|            return kv->value;
34961|  1.91k|        }
34962|  13.9M|    }
34963|  13.9M|    return janet_wrap_nil();
  ------------------
  |  |  831|  13.9M|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|  13.9M|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  13.9M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  13.9M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
34964|  13.9M|}
janet_lib_struct:
35094|  7.06k|void janet_lib_struct(JanetTable *env) {
35095|  7.06k|    JanetRegExt struct_cfuns[] = {
35096|  7.06k|        JANET_CORE_REG("struct/with-proto", cfun_struct_with_proto),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35097|  7.06k|        JANET_CORE_REG("struct/getproto", cfun_struct_getproto),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35098|  7.06k|        JANET_CORE_REG("struct/proto-flatten", cfun_struct_flatten),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35099|  7.06k|        JANET_CORE_REG("struct/to-table", cfun_struct_to_table),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35100|  7.06k|        JANET_CORE_REG("struct/rawget", cfun_struct_rawget),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35101|  7.06k|        JANET_REG_END
  ------------------
  |  | 2110|  7.06k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
35102|  7.06k|    };
35103|       |    janet_core_cfuns_ext(env, NULL, struct_cfuns);
35104|  7.06k|}
janet_symcache_init:
35149|  7.06k|void janet_symcache_init() {
35150|  7.06k|    janet_vm.cache_capacity = 1024;
35151|  7.06k|    janet_vm.cache = janet_calloc(1, (size_t) janet_vm.cache_capacity * sizeof(const uint8_t *));
  ------------------
  |  | 2412|  7.06k|#define janet_calloc(X, Y) calloc((X), (Y))
  ------------------
35152|  7.06k|    if (NULL == janet_vm.cache) {
  ------------------
  |  Branch (35152:9): [True: 0, False: 7.06k]
  ------------------
35153|      0|        JANET_OUT_OF_MEMORY;
  ------------------
  |  |  419|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (419:122): [Folded, False: 0]
  |  |  ------------------
  ------------------
35154|      0|    }
35155|  7.06k|    memset(&janet_vm.gensym_counter, '0', sizeof(janet_vm.gensym_counter));
35156|  7.06k|    janet_vm.gensym_counter[0] = '_';
35157|  7.06k|    janet_vm.cache_count = 0;
35158|  7.06k|    janet_vm.cache_deleted = 0;
35159|  7.06k|}
janet_symcache_deinit:
35162|  7.06k|void janet_symcache_deinit() {
35163|  7.06k|    janet_free((void *)janet_vm.cache);
  ------------------
  |  | 2415|  7.06k|#define janet_free(X) free((X))
  ------------------
35164|       |    janet_vm.cache = NULL;
35165|  7.06k|    janet_vm.cache_capacity = 0;
35166|  7.06k|    janet_vm.cache_count = 0;
35167|  7.06k|    janet_vm.cache_deleted = 0;
35168|  7.06k|}
janet_symbol_deinit:
35270|  14.1M|void janet_symbol_deinit(const uint8_t *sym) {
35271|  14.1M|    int status = 0;
35272|  14.1M|    const uint8_t **bucket = janet_symcache_find(sym, &status);
  ------------------
  |  |35225|  14.1M|    janet_symcache_findmem((str), janet_string_length(str), janet_string_hash(str), (success))
  |  |  ------------------
  |  |  |  | 1813|  14.1M|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1812|  14.1M|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   janet_symcache_findmem((str), janet_string_length(str), janet_string_hash(str), (success))
  |  |  ------------------
  |  |  |  | 1814|  14.1M|#define janet_string_hash(s) (janet_string_head(s)->hash)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1812|  14.1M|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
35273|  14.1M|    if (status) {
  ------------------
  |  Branch (35273:9): [True: 14.1M, False: 0]
  ------------------
35274|  14.1M|        janet_vm.cache_count--;
35275|  14.1M|        janet_vm.cache_deleted++;
35276|  14.1M|        *bucket = JANET_SYMCACHE_DELETED;
35277|  14.1M|    }
35278|  14.1M|}
janet_symbol:
35281|  20.0M|const uint8_t *janet_symbol(const uint8_t *str, int32_t len) {
35282|  20.0M|    int32_t hash = janet_string_calchash(str, len);
35283|  20.0M|    uint8_t *newstr;
35284|  20.0M|    int success = 0;
35285|  20.0M|    const uint8_t **bucket = janet_symcache_findmem(str, len, hash, &success);
35286|  20.0M|    if (success)
  ------------------
  |  Branch (35286:9): [True: 5.89M, False: 14.1M]
  ------------------
35287|  5.89M|        return *bucket;
35288|  14.1M|    JanetStringHead *head = janet_gcalloc(JANET_MEMORY_SYMBOL, sizeof(JanetStringHead) + (size_t) len + 1);
35289|  14.1M|    head->hash = hash;
35290|  14.1M|    head->length = len;
35291|  14.1M|    newstr = (uint8_t *)(head->data);
35292|  14.1M|    safe_memcpy(newstr, str, len);
35293|  14.1M|    newstr[len] = 0;
35294|  14.1M|    janet_symcache_put((const uint8_t *)newstr, bucket);
35295|  14.1M|    return newstr;
35296|  20.0M|}
janet_csymbol:
35299|  2.62M|const uint8_t *janet_csymbol(const char *cstr) {
35300|  2.62M|    return janet_symbol((const uint8_t *)cstr, (int32_t) strlen(cstr));
35301|  2.62M|}
janet_table_init:
35425|  18.7M|JanetTable *janet_table_init(JanetTable *table, int32_t capacity) {
35426|  18.7M|    return janet_table_init_impl(table, capacity, 1);
35427|  18.7M|}
janet_table_init_raw:
35430|  21.1k|JanetTable *janet_table_init_raw(JanetTable *table, int32_t capacity) {
35431|  21.1k|    return janet_table_init_impl(table, capacity, 0);
35432|  21.1k|}
janet_table_deinit:
35435|  18.7M|void janet_table_deinit(JanetTable *table) {
35436|  18.7M|    if (table->gc.flags & JANET_TABLE_FLAG_STACK) {
  ------------------
  |  |35385|  18.7M|#define JANET_TABLE_FLAG_STACK 0x10000
  ------------------
  |  Branch (35436:9): [True: 18.7M, False: 21.1k]
  ------------------
35437|  18.7M|        janet_sfree(table->data);
35438|  18.7M|    } else {
35439|  21.1k|        janet_free(table->data);
  ------------------
  |  | 2415|  21.1k|#define janet_free(X) free((X))
  ------------------
35440|  21.1k|    }
35441|  18.7M|}
janet_table:
35445|  5.18M|JanetTable *janet_table(int32_t capacity) {
35446|  5.18M|    JanetTable *table = janet_gcalloc(JANET_MEMORY_TABLE, sizeof(JanetTable));
35447|  5.18M|    return janet_table_init_impl(table, capacity, 0);
35448|  5.18M|}
janet_table_find:
35467|   274M|JanetKV *janet_table_find(JanetTable *t, Janet key) {
35468|   274M|    return (JanetKV *) janet_dict_find(t->data, t->capacity, key);
35469|   274M|}
janet_table_get:
35503|  55.0M|Janet janet_table_get(JanetTable *t, Janet key) {
35504|   107M|    for (int i = JANET_MAX_PROTO_DEPTH; t && i; t = t->proto, --i) {
  ------------------
  |  |  299|  55.0M|#define JANET_MAX_PROTO_DEPTH 200
  ------------------
  |  Branch (35504:41): [True: 55.0M, False: 52.4M]
  |  Branch (35504:46): [True: 55.0M, False: 0]
  ------------------
35505|  55.0M|        JanetKV *bucket = janet_table_find(t, key);
35506|  55.0M|        if (NULL != bucket && !janet_checktype(bucket->key, JANET_NIL))
  ------------------
  |  |  806|  55.0M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 55.0M]
  |  |  ------------------
  |  |  807|  55.0M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  55.0M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  55.0M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  55.0M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  55.0M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  55.0M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (35506:13): [True: 55.0M, False: 0]
  |  Branch (35506:31): [True: 2.53M, False: 52.4M]
  ------------------
35507|  2.53M|            return bucket->value;
35508|  55.0M|    }
35509|  52.4M|    return janet_wrap_nil();
  ------------------
  |  |  831|  52.4M|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|  52.4M|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  52.4M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  52.4M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
35510|  55.0M|}
janet_table_get_keyword:
35513|  84.7k|Janet janet_table_get_keyword(JanetTable *t, const char *keyword) {
35514|  84.7k|    int32_t keyword_len = (int32_t) strlen(keyword);
35515|   148k|    for (int i = JANET_MAX_PROTO_DEPTH; t && i; t = t->proto, --i) {
  ------------------
  |  |  299|  84.7k|#define JANET_MAX_PROTO_DEPTH 200
  ------------------
  |  Branch (35515:41): [True: 84.7k, False: 63.5k]
  |  Branch (35515:46): [True: 84.7k, False: 0]
  ------------------
35516|  84.7k|        JanetKV *bucket = (JanetKV *) janet_dict_find_keyword(t->data, t->capacity, (const uint8_t *) keyword, keyword_len);
35517|  84.7k|        if (NULL != bucket && !janet_checktype(bucket->key, JANET_NIL))
  ------------------
  |  |  806|  84.7k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 84.7k]
  |  |  ------------------
  |  |  807|  84.7k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  84.7k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  84.7k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  84.7k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  84.7k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  84.7k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (35517:13): [True: 84.7k, False: 0]
  |  Branch (35517:31): [True: 21.1k, False: 63.5k]
  ------------------
35518|  21.1k|            return bucket->value;
35519|  84.7k|    }
35520|  63.5k|    return janet_wrap_nil();
  ------------------
  |  |  831|  63.5k|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|  63.5k|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  63.5k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  63.5k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
35521|  84.7k|}
janet_table_get_ex:
35524|     43|Janet janet_table_get_ex(JanetTable *t, Janet key, JanetTable **which) {
35525|     86|    for (int i = JANET_MAX_PROTO_DEPTH; t && i; t = t->proto, --i) {
  ------------------
  |  |  299|     43|#define JANET_MAX_PROTO_DEPTH 200
  ------------------
  |  Branch (35525:41): [True: 43, False: 43]
  |  Branch (35525:46): [True: 43, False: 0]
  ------------------
35526|     43|        JanetKV *bucket = janet_table_find(t, key);
35527|     43|        if (NULL != bucket && !janet_checktype(bucket->key, JANET_NIL)) {
  ------------------
  |  |  806|     43|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 43]
  |  |  ------------------
  |  |  807|     43|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|     43|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|     43|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|     43|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|     43|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|     43|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (35527:13): [True: 43, False: 0]
  |  Branch (35527:31): [True: 0, False: 43]
  ------------------
35528|      0|            *which = t;
35529|      0|            return bucket->value;
35530|      0|        }
35531|     43|    }
35532|     43|    return janet_wrap_nil();
  ------------------
  |  |  831|     43|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|     43|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|     43|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|     43|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
35533|     43|}
janet_table_rawget:
35536|  18.4k|Janet janet_table_rawget(JanetTable *t, Janet key) {
35537|  18.4k|    JanetKV *bucket = janet_table_find(t, key);
35538|  18.4k|    if (NULL != bucket && !janet_checktype(bucket->key, JANET_NIL))
  ------------------
  |  |  806|  18.4k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 18.4k]
  |  |  ------------------
  |  |  807|  18.4k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  18.4k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  18.4k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  18.4k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  18.4k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  18.4k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (35538:9): [True: 18.4k, False: 0]
  |  Branch (35538:27): [True: 393, False: 18.0k]
  ------------------
35539|    393|        return bucket->value;
35540|  18.0k|    else
35541|  18.0k|        return janet_wrap_nil();
  ------------------
  |  |  831|  18.0k|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|  18.0k|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  18.0k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  18.0k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
35542|  18.4k|}
janet_table_remove:
35546|  97.7M|Janet janet_table_remove(JanetTable *t, Janet key) {
35547|  97.7M|    JanetKV *bucket = janet_table_find(t, key);
35548|  97.7M|    if (NULL != bucket && !janet_checktype(bucket->key, JANET_NIL)) {
  ------------------
  |  |  806|  97.7M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 97.7M]
  |  |  ------------------
  |  |  807|  97.7M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  97.7M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  97.7M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  97.7M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  97.7M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  97.7M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (35548:9): [True: 97.7M, False: 0]
  |  Branch (35548:27): [True: 52.3M, False: 45.3M]
  ------------------
35549|  52.3M|        Janet ret = bucket->value;
35550|  52.3M|        t->count--;
35551|  52.3M|        t->deleted++;
35552|  52.3M|        bucket->key = janet_wrap_nil();
  ------------------
  |  |  831|  52.3M|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|  52.3M|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  52.3M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  52.3M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
35553|  52.3M|        bucket->value = janet_wrap_false();
  ------------------
  |  |  833|  52.3M|#define janet_wrap_false() janet_nanbox_from_payload(JANET_BOOLEAN, 0)
  |  |  ------------------
  |  |  |  |  822|  52.3M|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  52.3M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  52.3M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
35554|  52.3M|        return ret;
35555|  52.3M|    } else {
35556|  45.3M|        return janet_wrap_nil();
  ------------------
  |  |  831|  45.3M|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|  45.3M|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  45.3M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  45.3M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
35557|  45.3M|    }
35558|  97.7M|}
janet_table_put:
35561|  85.6M|void janet_table_put(JanetTable *t, Janet key, Janet value) {
35562|  85.6M|    if (janet_checktype(key, JANET_NIL)) return;
  ------------------
  |  |  806|  85.6M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 44, False: 85.6M]
  |  |  |  Branch (806:6): [Folded, False: 85.6M]
  |  |  ------------------
  |  |  807|  85.6M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  85.6M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  85.6M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  85.6M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  85.6M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  85.6M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
35563|  85.6M|    if (janet_checktype(key, JANET_NUMBER) && isnan(janet_unwrap_number(key))) return;
  ------------------
  |  |  806|   171M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 3.59k, False: 85.6M]
  |  |  |  Branch (806:6): [True: 85.6M, Folded]
  |  |  ------------------
  |  |  807|   171M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|  85.6M|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 3.59k, False: 85.6M]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 85.6M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|   171M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|      0|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|      0|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (35563:47): [True: 0, False: 3.59k]
  ------------------
35564|  85.6M|    if (janet_checktype(value, JANET_NIL)) {
  ------------------
  |  |  806|  85.6M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 117, False: 85.6M]
  |  |  |  Branch (806:6): [Folded, False: 85.6M]
  |  |  ------------------
  |  |  807|  85.6M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  85.6M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  85.6M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  85.6M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  85.6M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  85.6M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
35565|    117|        janet_table_remove(t, key);
35566|  85.6M|    } else {
35567|  85.6M|        JanetKV *bucket = janet_table_find(t, key);
35568|  85.6M|        if (NULL != bucket && !janet_checktype(bucket->key, JANET_NIL)) {
  ------------------
  |  |  806|  85.6M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 85.6M]
  |  |  ------------------
  |  |  807|  85.6M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  85.6M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  85.6M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  85.6M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  85.6M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  85.6M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (35568:13): [True: 85.6M, False: 0]
  |  Branch (35568:31): [True: 469, False: 85.6M]
  ------------------
35569|    469|            bucket->value = value;
35570|  85.6M|        } else {
35571|  85.6M|            if (NULL == bucket || 2 * (t->count + t->deleted + 1) > t->capacity) {
  ------------------
  |  Branch (35571:17): [True: 0, False: 85.6M]
  |  Branch (35571:35): [True: 6.37M, False: 79.2M]
  ------------------
35572|  6.37M|                janet_table_rehash(t, janet_tablen(2 * t->count + 2));
35573|  6.37M|                bucket = janet_table_find(t, key);
35574|  6.37M|            }
35575|  85.6M|            if (janet_checktype(bucket->value, JANET_BOOLEAN))
  ------------------
  |  |  806|  85.6M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 0, False: 85.6M]
  |  |  |  Branch (806:6): [Folded, False: 85.6M]
  |  |  ------------------
  |  |  807|  85.6M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  85.6M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  85.6M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  85.6M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  85.6M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  85.6M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
35576|      0|                --t->deleted;
35577|  85.6M|            bucket->key = key;
35578|  85.6M|            bucket->value = value;
35579|  85.6M|            ++t->count;
35580|  85.6M|        }
35581|  85.6M|    }
35582|  85.6M|}
janet_table_clone:
35611|    249|JanetTable *janet_table_clone(JanetTable *table) {
35612|    249|    JanetTable *newTable = janet_gcalloc(JANET_MEMORY_TABLE, sizeof(JanetTable));
35613|    249|    newTable->count = table->count;
35614|    249|    newTable->capacity = table->capacity;
35615|    249|    newTable->deleted = table->deleted;
35616|    249|    newTable->proto = table->proto;
35617|    249|    newTable->data = array_allocate(sizeof(JanetKV), newTable->capacity);
35618|    249|    if (NULL == newTable->data) {
  ------------------
  |  Branch (35618:9): [True: 0, False: 249]
  ------------------
35619|      0|        JANET_OUT_OF_MEMORY;
  ------------------
  |  |  419|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (419:122): [Folded, False: 0]
  |  |  ------------------
  ------------------
35620|      0|    }
35621|    249|    memcpy(newTable->data, table->data, (size_t) table->capacity * sizeof(JanetKV));
35622|    249|    return newTable;
35623|    249|}
janet_lib_table:
35791|  7.06k|void janet_lib_table(JanetTable *env) {
35792|  7.06k|    JanetRegExt table_cfuns[] = {
35793|  7.06k|        JANET_CORE_REG("table/new", cfun_table_new),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35794|  7.06k|        JANET_CORE_REG("table/weak", cfun_table_weak),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35795|  7.06k|        JANET_CORE_REG("table/weak-keys", cfun_table_weak_keys),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35796|  7.06k|        JANET_CORE_REG("table/weak-values", cfun_table_weak_values),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35797|  7.06k|        JANET_CORE_REG("table/to-struct", cfun_table_tostruct),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35798|  7.06k|        JANET_CORE_REG("table/getproto", cfun_table_getproto),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35799|  7.06k|        JANET_CORE_REG("table/setproto", cfun_table_setproto),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35800|  7.06k|        JANET_CORE_REG("table/rawget", cfun_table_rawget),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35801|  7.06k|        JANET_CORE_REG("table/clone", cfun_table_clone),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35802|  7.06k|        JANET_CORE_REG("table/clear", cfun_table_clear),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35803|  7.06k|        JANET_CORE_REG("table/proto-flatten", cfun_table_proto_flatten),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35804|  7.06k|        JANET_REG_END
  ------------------
  |  | 2110|  7.06k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
35805|  7.06k|    };
35806|       |    janet_core_cfuns_ext(env, NULL, table_cfuns);
35807|  7.06k|}
janet_tuple_begin:
35852|  5.36M|Janet *janet_tuple_begin(int32_t length) {
35853|  5.36M|    janet_assert(length <= MAX_TUPLE_LENGTH, "tuple overflow");
  ------------------
  |  |  389|  5.36M|#define janet_assert(c, m) do { \
  |  |  390|  5.36M|    if (!(c)) JANET_EXIT((m)); \
  |  |  ------------------
  |  |  |  |  378|      0|#define JANET_EXIT(m) do { \
  |  |  |  |  379|      0|    fprintf(stderr, "janet abort at %s:%d: %s\n",\
  |  |  |  |  380|      0|        __FILE__,\
  |  |  |  |  381|      0|        __LINE__,\
  |  |  |  |  382|      0|        (m));\
  |  |  |  |  383|      0|    abort();\
  |  |  |  |  384|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (384:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (390:9): [True: 0, False: 5.36M]
  |  |  ------------------
  |  |  391|  5.36M|} while (0)
  |  |  ------------------
  |  |  |  Branch (391:10): [Folded, False: 5.36M]
  |  |  ------------------
  ------------------
35854|  5.36M|    size_t size = sizeof(JanetTupleHead) + ((size_t) length * sizeof(Janet));
35855|  5.36M|    JanetTupleHead *head = janet_gcalloc(JANET_MEMORY_TUPLE, size);
35856|  5.36M|    head->sm_line = -1;
35857|  5.36M|    head->sm_column = -1;
35858|  5.36M|    head->length = length;
35859|  5.36M|    return (Janet *)(head->data);
35860|  5.36M|}
janet_tuple_end:
35863|  5.36M|const Janet *janet_tuple_end(Janet *tuple) {
35864|  5.36M|    janet_tuple_hash(tuple) = janet_array_calchash(tuple, janet_tuple_length(tuple));
  ------------------
  |  | 1803|  5.36M|#define janet_tuple_hash(t) (janet_tuple_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1800|  5.36M|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
                  janet_tuple_hash(tuple) = janet_array_calchash(tuple, janet_tuple_length(tuple));
  ------------------
  |  | 1802|  5.36M|#define janet_tuple_length(t) (janet_tuple_head(t)->length)
  |  |  ------------------
  |  |  |  | 1800|  5.36M|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
35865|  5.36M|    return (const Janet *)tuple;
35866|  5.36M|}
janet_tuple_n:
35869|  13.9k|const Janet *janet_tuple_n(const Janet *values, int32_t n) {
35870|  13.9k|    Janet *t = janet_tuple_begin(n);
35871|  13.9k|    safe_memcpy(t, values, sizeof(Janet) * n);
35872|  13.9k|    return janet_tuple_end(t);
35873|  13.9k|}
janet_lib_tuple:
35976|  7.06k|void janet_lib_tuple(JanetTable *env) {
35977|  7.06k|    JanetRegExt tuple_cfuns[] = {
35978|  7.06k|        JANET_CORE_REG("tuple/brackets", cfun_tuple_brackets),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35979|  7.06k|        JANET_CORE_REG("tuple/slice", cfun_tuple_slice),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35980|  7.06k|        JANET_CORE_REG("tuple/type", cfun_tuple_type),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35981|  7.06k|        JANET_CORE_REG("tuple/sourcemap", cfun_tuple_sourcemap),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35982|  7.06k|        JANET_CORE_REG("tuple/setmap", cfun_tuple_setmap),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35983|  7.06k|        JANET_CORE_REG("tuple/join", cfun_tuple_join),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35984|  7.06k|        JANET_REG_END
  ------------------
  |  | 2110|  7.06k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
35985|  7.06k|    };
35986|       |    janet_core_cfuns_ext(env, NULL, tuple_cfuns);
35987|  7.06k|}
janet_hash_mix:
36113|  50.7M|uint32_t janet_hash_mix(uint32_t input, uint32_t more) {
36114|  50.7M|    uint32_t mix1 = (more + 0x9e3779b9 + (input << 6) + (input >> 2));
36115|  50.7M|    return input ^ (0x9e3779b9 + (mix1 << 6) + (mix1 >> 2));
36116|  50.7M|}
janet_string_calchash:
36120|  38.9M|int32_t janet_string_calchash(const uint8_t *str, int32_t len) {
36121|  38.9M|    if (NULL == str || len == 0) return 5381;
  ------------------
  |  Branch (36121:9): [True: 369, False: 38.9M]
  |  Branch (36121:24): [True: 5.70M, False: 33.1M]
  ------------------
36122|  33.1M|    const uint8_t *end = str + len;
36123|  33.1M|    uint32_t hash = 5381;
36124|  5.47G|    while (str < end)
  ------------------
  |  Branch (36124:12): [True: 5.44G, False: 33.1M]
  ------------------
36125|  5.44G|        hash = (hash << 5) + hash + *str++;
36126|  33.1M|    hash = janet_hash_mix(hash, (uint32_t) len);
36127|  33.1M|    return (int32_t) hash;
36128|  38.9M|}
janet_array_calchash:
36243|  5.36M|int32_t janet_array_calchash(const Janet *array, int32_t len) {
36244|  5.36M|    const Janet *end = array + len;
36245|  5.36M|    uint32_t hash = 33;
36246|  21.1M|    while (array < end) {
  ------------------
  |  Branch (36246:12): [True: 15.8M, False: 5.36M]
  ------------------
36247|  15.8M|        hash = janet_hash_mix(hash, janet_hash(*array++));
36248|  15.8M|    }
36249|  5.36M|    return (int32_t) hash;
36250|  5.36M|}
janet_kv_calchash:
36253|  54.4k|int32_t janet_kv_calchash(const JanetKV *kvs, int32_t len) {
36254|  54.4k|    const JanetKV *end = kvs + len;
36255|  54.4k|    uint32_t hash = 33;
36256|   925k|    while (kvs < end) {
  ------------------
  |  Branch (36256:12): [True: 871k, False: 54.4k]
  ------------------
36257|   871k|        hash = janet_hash_mix(hash, janet_hash(kvs->key));
36258|   871k|        hash = janet_hash_mix(hash, janet_hash(kvs->value));
36259|   871k|        kvs++;
36260|   871k|    }
36261|  54.4k|    return (int32_t) hash;
36262|  54.4k|}
janet_tablen:
36266|  30.3M|int32_t janet_tablen(int32_t n) {
36267|  30.3M|    if (n < 0) return 0;
  ------------------
  |  Branch (36267:9): [True: 0, False: 30.3M]
  ------------------
36268|  30.3M|    n |= n >> 1;
36269|  30.3M|    n |= n >> 2;
36270|  30.3M|    n |= n >> 4;
36271|  30.3M|    n |= n >> 8;
36272|  30.3M|    n |= n >> 16;
36273|  30.3M|    return n >= DICT_MAX ? DICT_MAX : n + 1;
  ------------------
  |  |  507|  30.3M|#define DICT_MAX INT32_MAX
  ------------------
                  return n >= DICT_MAX ? DICT_MAX : n + 1;
  ------------------
  |  |  507|  30.3M|#define DICT_MAX INT32_MAX
  ------------------
  |  Branch (36273:12): [True: 0, False: 30.3M]
  ------------------
36274|  30.3M|}
safe_memcpy:
36277|  32.9M|void safe_memcpy(void *dest, const void *src, size_t len) {
36278|  32.9M|    if (!len) return;
  ------------------
  |  Branch (36278:9): [True: 5.71M, False: 27.2M]
  ------------------
36279|  27.2M|    memcpy(dest, src, len);
36280|  27.2M|}
janet_dict_find_deep:
36284|   146M|const JanetKV *janet_dict_find_deep(const JanetKV *buckets, int32_t cap, Janet key) {
36285|   146M|    janet_assert(cap != 0, "bad capacity");
  ------------------
  |  |  389|   146M|#define janet_assert(c, m) do { \
  |  |  390|   146M|    if (!(c)) JANET_EXIT((m)); \
  |  |  ------------------
  |  |  |  |  378|      0|#define JANET_EXIT(m) do { \
  |  |  |  |  379|      0|    fprintf(stderr, "janet abort at %s:%d: %s\n",\
  |  |  |  |  380|      0|        __FILE__,\
  |  |  |  |  381|      0|        __LINE__,\
  |  |  |  |  382|      0|        (m));\
  |  |  |  |  383|      0|    abort();\
  |  |  |  |  384|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (384:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (390:9): [True: 0, False: 146M]
  |  |  ------------------
  |  |  391|   146M|} while (0)
  |  |  ------------------
  |  |  |  Branch (391:10): [Folded, False: 146M]
  |  |  ------------------
  ------------------
36286|   146M|    int32_t index = janet_maphash(cap, janet_hash(key));
  ------------------
  |  |  396|   146M|#define janet_maphash(cap, hash) ((uint32_t)(hash) & (cap - 1))
  ------------------
36287|   146M|    int32_t i;
36288|   146M|    const JanetKV *first_bucket = NULL;
36289|       |    /* Higher half */
36290|   193M|    for (i = index; i < cap; i++) {
  ------------------
  |  Branch (36290:21): [True: 187M, False: 6.04M]
  ------------------
36291|   187M|        const JanetKV *kv = buckets + i;
36292|   187M|        if (janet_checktype(kv->key, JANET_NIL)) {
  ------------------
  |  |  806|   187M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 121M, False: 65.7M]
  |  |  |  Branch (806:6): [Folded, False: 187M]
  |  |  ------------------
  |  |  807|   187M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|   187M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|   187M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|   187M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|   187M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|   187M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36293|   121M|            if (janet_checktype(kv->value, JANET_NIL)) {
  ------------------
  |  |  806|   121M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 100M, False: 21.7M]
  |  |  |  Branch (806:6): [Folded, False: 121M]
  |  |  ------------------
  |  |  807|   121M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|   121M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|   121M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|   121M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|   121M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|   121M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36294|   100M|                return kv;
36295|   100M|            } else if (NULL == first_bucket) {
  ------------------
  |  Branch (36295:24): [True: 12.5M, False: 9.16M]
  ------------------
36296|  12.5M|                first_bucket = kv;
36297|  12.5M|            }
36298|   121M|        } else if (janet_bitwise_same(kv->key, key) || janet_equals(kv->key, key)) {
  ------------------
  |  |  401|   131M|#define janet_bitwise_same(x, y) (janet_u64(x) == janet_u64(y))
  |  |  ------------------
  |  |  |  |  788|  65.7M|#define janet_u64(x) ((x).u64)
  |  |  ------------------
  |  |               #define janet_bitwise_same(x, y) (janet_u64(x) == janet_u64(y))
  |  |  ------------------
  |  |  |  |  788|  65.7M|#define janet_u64(x) ((x).u64)
  |  |  ------------------
  |  |  |  Branch (401:34): [True: 40.2M, False: 25.5M]
  |  |  ------------------
  ------------------
  |  Branch (36298:56): [True: 2.28k, False: 25.5M]
  ------------------
36299|  40.2M|            return buckets + i;
36300|  40.2M|        }
36301|   187M|    }
36302|       |    /* Lower half */
36303|  9.63M|    for (i = 0; i < index; i++) {
  ------------------
  |  Branch (36303:17): [True: 9.63M, False: 0]
  ------------------
36304|  9.63M|        const JanetKV *kv = buckets + i;
36305|  9.63M|        if (janet_checktype(kv->key, JANET_NIL)) {
  ------------------
  |  |  806|  9.63M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 5.42M, False: 4.21M]
  |  |  |  Branch (806:6): [Folded, False: 9.63M]
  |  |  ------------------
  |  |  807|  9.63M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  9.63M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  9.63M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  9.63M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  9.63M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  9.63M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36306|  5.42M|            if (janet_checktype(kv->value, JANET_NIL)) {
  ------------------
  |  |  806|  5.42M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 4.14M, False: 1.28M]
  |  |  |  Branch (806:6): [Folded, False: 5.42M]
  |  |  ------------------
  |  |  807|  5.42M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  5.42M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  5.42M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  5.42M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  5.42M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  5.42M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36307|  4.14M|                return kv;
36308|  4.14M|            } else if (NULL == first_bucket) {
  ------------------
  |  Branch (36308:24): [True: 72.9k, False: 1.20M]
  ------------------
36309|  72.9k|                first_bucket = kv;
36310|  72.9k|            }
36311|  5.42M|        } else if (janet_bitwise_same(kv->key, key) || janet_equals(kv->key, key)) {
  ------------------
  |  |  401|  8.42M|#define janet_bitwise_same(x, y) (janet_u64(x) == janet_u64(y))
  |  |  ------------------
  |  |  |  |  788|  4.21M|#define janet_u64(x) ((x).u64)
  |  |  ------------------
  |  |               #define janet_bitwise_same(x, y) (janet_u64(x) == janet_u64(y))
  |  |  ------------------
  |  |  |  |  788|  4.21M|#define janet_u64(x) ((x).u64)
  |  |  ------------------
  |  |  |  Branch (401:34): [True: 1.90M, False: 2.30M]
  |  |  ------------------
  ------------------
  |  Branch (36311:56): [True: 85, False: 2.30M]
  ------------------
36312|  1.90M|            return buckets + i;
36313|  1.90M|        }
36314|  9.63M|    }
36315|      0|    return first_bucket;
36316|  6.04M|}
janet_dict_find_shallow:
36319|   141M|const JanetKV *janet_dict_find_shallow(const JanetKV *buckets, int32_t cap, Janet key) {
36320|   141M|    janet_assert(cap != 0, "bad capacity");
  ------------------
  |  |  389|   141M|#define janet_assert(c, m) do { \
  |  |  390|   141M|    if (!(c)) JANET_EXIT((m)); \
  |  |  ------------------
  |  |  |  |  378|      0|#define JANET_EXIT(m) do { \
  |  |  |  |  379|      0|    fprintf(stderr, "janet abort at %s:%d: %s\n",\
  |  |  |  |  380|      0|        __FILE__,\
  |  |  |  |  381|      0|        __LINE__,\
  |  |  |  |  382|      0|        (m));\
  |  |  |  |  383|      0|    abort();\
  |  |  |  |  384|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (384:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (390:9): [True: 0, False: 141M]
  |  |  ------------------
  |  |  391|   141M|} while (0)
  |  |  ------------------
  |  |  |  Branch (391:10): [Folded, False: 141M]
  |  |  ------------------
  ------------------
36321|   141M|    int32_t hash;
36322|       |    /* Manual inline common case of symbol or keyword */
36323|   141M|    if (janet_checktype(key, JANET_KEYWORD) || janet_checktype(key, JANET_SYMBOL)) {
  ------------------
  |  |  806|   283M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 39.6M, False: 101M]
  |  |  |  Branch (806:6): [Folded, False: 141M]
  |  |  ------------------
  |  |  807|   283M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|   283M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|   141M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|   141M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|   141M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|   141M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if (janet_checktype(key, JANET_KEYWORD) || janet_checktype(key, JANET_SYMBOL)) {
  ------------------
  |  |  806|   101M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 59.6M, False: 42.2M]
  |  |  |  Branch (806:6): [Folded, False: 101M]
  |  |  ------------------
  |  |  807|   101M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|   101M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|   101M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|   101M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|   101M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|   101M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36324|  99.2M|        hash = janet_string_hash(janet_unwrap_string(key));
  ------------------
  |  | 1814|  99.2M|#define janet_string_hash(s) (janet_string_head(s)->hash)
  |  |  ------------------
  |  |  |  | 1812|  99.2M|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
36325|  99.2M|    } else {
36326|  42.2M|        hash = janet_hash(key);
36327|  42.2M|    }
36328|   141M|    int32_t index = janet_maphash(cap, hash);
  ------------------
  |  |  396|   141M|#define janet_maphash(cap, hash) ((uint32_t)(hash) & (cap - 1))
  ------------------
36329|   141M|    int32_t i;
36330|   141M|    const JanetKV *first_bucket = NULL;
36331|       |    /* Higher half */
36332|   182M|    for (i = index; i < cap; i++) {
  ------------------
  |  Branch (36332:21): [True: 180M, False: 2.24M]
  ------------------
36333|   180M|        const JanetKV *kv = buckets + i;
36334|   180M|        if (janet_checktype(kv->key, JANET_NIL)) {
  ------------------
  |  |  806|   180M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 136M, False: 43.5M]
  |  |  |  Branch (806:6): [Folded, False: 180M]
  |  |  ------------------
  |  |  807|   180M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|   180M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|   180M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|   180M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|   180M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|   180M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36335|   136M|            if (janet_checktype(kv->value, JANET_NIL)) {
  ------------------
  |  |  806|   136M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 127M, False: 9.51M]
  |  |  |  Branch (806:6): [Folded, False: 136M]
  |  |  ------------------
  |  |  807|   136M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|   136M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|   136M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|   136M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|   136M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|   136M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36336|   127M|                return kv;
36337|   127M|            } else if (NULL == first_bucket) {
  ------------------
  |  Branch (36337:24): [True: 6.32M, False: 3.18M]
  ------------------
36338|  6.32M|                first_bucket = kv;
36339|  6.32M|            }
36340|   136M|        } else if (janet_bitwise_same(kv->key, key)) {
  ------------------
  |  |  401|  43.5M|#define janet_bitwise_same(x, y) (janet_u64(x) == janet_u64(y))
  |  |  ------------------
  |  |  |  |  788|  43.5M|#define janet_u64(x) ((x).u64)
  |  |  ------------------
  |  |               #define janet_bitwise_same(x, y) (janet_u64(x) == janet_u64(y))
  |  |  ------------------
  |  |  |  |  788|  43.5M|#define janet_u64(x) ((x).u64)
  |  |  ------------------
  |  |  |  Branch (401:34): [True: 12.1M, False: 31.3M]
  |  |  ------------------
  ------------------
36341|  12.1M|            return buckets + i;
36342|  12.1M|        }
36343|   180M|    }
36344|       |    /* Lower half */
36345|  5.21M|    for (i = 0; i < index; i++) {
  ------------------
  |  Branch (36345:17): [True: 5.21M, False: 0]
  ------------------
36346|  5.21M|        const JanetKV *kv = buckets + i;
36347|  5.21M|        if (janet_checktype(kv->key, JANET_NIL)) {
  ------------------
  |  |  806|  5.21M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 3.67M, False: 1.53M]
  |  |  |  Branch (806:6): [Folded, False: 5.21M]
  |  |  ------------------
  |  |  807|  5.21M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  5.21M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  5.21M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  5.21M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  5.21M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  5.21M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36348|  3.67M|            if (janet_checktype(kv->value, JANET_NIL)) {
  ------------------
  |  |  806|  3.67M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 1.63M, False: 2.03M]
  |  |  |  Branch (806:6): [Folded, False: 3.67M]
  |  |  ------------------
  |  |  807|  3.67M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  3.67M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  3.67M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  3.67M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  3.67M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  3.67M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36349|  1.63M|                return kv;
36350|  2.03M|            } else if (NULL == first_bucket) {
  ------------------
  |  Branch (36350:24): [True: 5.56k, False: 2.03M]
  ------------------
36351|  5.56k|                first_bucket = kv;
36352|  5.56k|            }
36353|  3.67M|        } else if (janet_bitwise_same(kv->key, key)) {
  ------------------
  |  |  401|  1.53M|#define janet_bitwise_same(x, y) (janet_u64(x) == janet_u64(y))
  |  |  ------------------
  |  |  |  |  788|  1.53M|#define janet_u64(x) ((x).u64)
  |  |  ------------------
  |  |               #define janet_bitwise_same(x, y) (janet_u64(x) == janet_u64(y))
  |  |  ------------------
  |  |  |  |  788|  1.53M|#define janet_u64(x) ((x).u64)
  |  |  ------------------
  |  |  |  Branch (401:34): [True: 604k, False: 931k]
  |  |  ------------------
  ------------------
36354|   604k|            return buckets + i;
36355|   604k|        }
36356|  5.21M|    }
36357|      0|    return first_bucket;
36358|  2.24M|}
janet_dict_find:
36362|   287M|const JanetKV *janet_dict_find(const JanetKV *buckets, int32_t cap, Janet key) {
36363|   287M|    if (janet_checktypes(key, HARD_KEY_TYPES) || (janet_checktype(key, JANET_NUMBER) && janet_unwrap_number(key) == 0)) {
  ------------------
  |  |  969|   575M|#define janet_checktypes(x, tps) ((1 << janet_type(x)) & (tps))
  |  |  ------------------
  |  |  |  |  795|   287M|    (isnan((x).number) \
  |  |  |  |  796|   287M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  |  |  797|   287M|        : JANET_NUMBER)
  |  |  ------------------
  |  |  |  Branch (969:34): [True: 145M, False: 142M]
  |  |  ------------------
  ------------------
                  if (janet_checktypes(key, HARD_KEY_TYPES) || (janet_checktype(key, JANET_NUMBER) && janet_unwrap_number(key) == 0)) {
  ------------------
  |  |  806|   285M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 8.99M, False: 133M]
  |  |  |  Branch (806:6): [True: 142M, Folded]
  |  |  ------------------
  |  |  807|   285M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|   142M|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 8.99M, False: 133M]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 133M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|   285M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|      0|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|      0|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if (janet_checktypes(key, HARD_KEY_TYPES) || (janet_checktype(key, JANET_NUMBER) && janet_unwrap_number(key) == 0)) {
  ------------------
  |  |  839|  8.99M|#define janet_unwrap_number(x) ((x).number)
  ------------------
  |  Branch (36363:9): [True: 278M, False: 8.99M]
  |  Branch (36363:89): [True: 1.26M, False: 7.72M]
  ------------------
36364|   146M|        return janet_dict_find_deep(buckets, cap, key);
36365|   146M|    } else {
36366|   141M|        return janet_dict_find_shallow(buckets, cap, key);
36367|   141M|    }
36368|   287M|}
janet_dict_find_keyword:
36374|  84.7k|    const uint8_t *cstr, int32_t cstr_len) {
36375|  84.7k|    int32_t hash = janet_string_calchash(cstr, cstr_len);
36376|  84.7k|    int32_t index = janet_maphash(cap, hash);
  ------------------
  |  |  396|  84.7k|#define janet_maphash(cap, hash) ((uint32_t)(hash) & (cap - 1))
  ------------------
36377|  84.7k|    int32_t i;
36378|  84.7k|    const JanetKV *first_bucket = NULL;
36379|       |    /* Higher half */
36380|   127k|    for (i = index; i < cap; i++) {
  ------------------
  |  Branch (36380:21): [True: 127k, False: 0]
  ------------------
36381|   127k|        const JanetKV *kv = buckets + i;
36382|   127k|        if (janet_checktype(kv->key, JANET_NIL)) {
  ------------------
  |  |  806|   127k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 63.5k, False: 63.5k]
  |  |  |  Branch (806:6): [Folded, False: 127k]
  |  |  ------------------
  |  |  807|   127k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|   127k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|   127k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|   127k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|   127k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|   127k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36383|  63.5k|            if (janet_checktype(kv->value, JANET_NIL)) {
  ------------------
  |  |  806|  63.5k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 63.5k, False: 0]
  |  |  |  Branch (806:6): [Folded, False: 63.5k]
  |  |  ------------------
  |  |  807|  63.5k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  63.5k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  63.5k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  63.5k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  63.5k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  63.5k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36384|  63.5k|                return kv;
36385|  63.5k|            } else if (NULL == first_bucket) {
  ------------------
  |  Branch (36385:24): [True: 0, False: 0]
  ------------------
36386|      0|                first_bucket = kv;
36387|      0|            }
36388|  63.5k|        } else if (janet_checktype(kv->key, JANET_KEYWORD)) {
  ------------------
  |  |  806|  63.5k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 63.5k, False: 0]
  |  |  |  Branch (806:6): [Folded, False: 63.5k]
  |  |  ------------------
  |  |  807|  63.5k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  63.5k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  63.5k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  63.5k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  63.5k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  63.5k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36389|       |            /* Works for symbol and keyword, too */
36390|  63.5k|            JanetString str = janet_unwrap_string(kv->key);
  ------------------
  |  |  863|  63.5k|#define janet_unwrap_string(x) ((JanetString)janet_nanbox_to_pointer(x))
  ------------------
36391|  63.5k|            int32_t len = janet_string_length(str);
  ------------------
  |  | 1813|  63.5k|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  ------------------
  |  |  |  | 1812|  63.5k|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
36392|  63.5k|            if (hash == janet_string_hash(str) && len == cstr_len && !memcmp(str, cstr, len)) {
  ------------------
  |  | 1814|   127k|#define janet_string_hash(s) (janet_string_head(s)->hash)
  |  |  ------------------
  |  |  |  | 1812|  63.5k|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (36392:17): [True: 21.1k, False: 42.3k]
  |  Branch (36392:51): [True: 21.1k, False: 0]
  |  Branch (36392:70): [True: 21.1k, False: 0]
  ------------------
36393|  21.1k|                return buckets + i;
36394|  21.1k|            }
36395|  63.5k|        }
36396|   127k|    }
36397|       |    /* Lower half */
36398|      0|    for (i = 0; i < index; i++) {
  ------------------
  |  Branch (36398:17): [True: 0, False: 0]
  ------------------
36399|      0|        const JanetKV *kv = buckets + i;
36400|      0|        if (janet_checktype(kv->key, JANET_NIL)) {
  ------------------
  |  |  806|      0|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 0, False: 0]
  |  |  |  Branch (806:6): [Folded, False: 0]
  |  |  ------------------
  |  |  807|      0|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|      0|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|      0|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|      0|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36401|      0|            if (janet_checktype(kv->value, JANET_NIL)) {
  ------------------
  |  |  806|      0|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 0, False: 0]
  |  |  |  Branch (806:6): [Folded, False: 0]
  |  |  ------------------
  |  |  807|      0|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|      0|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|      0|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|      0|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36402|      0|                return kv;
36403|      0|            } else if (NULL == first_bucket) {
  ------------------
  |  Branch (36403:24): [True: 0, False: 0]
  ------------------
36404|      0|                first_bucket = kv;
36405|      0|            }
36406|      0|        } else if (janet_checktype(kv->key, JANET_KEYWORD)) {
  ------------------
  |  |  806|      0|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 0, False: 0]
  |  |  |  Branch (806:6): [Folded, False: 0]
  |  |  ------------------
  |  |  807|      0|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|      0|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|      0|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|      0|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36407|       |            /* Works for symbol and keyword, too */
36408|      0|            JanetString str = janet_unwrap_string(kv->key);
  ------------------
  |  |  863|      0|#define janet_unwrap_string(x) ((JanetString)janet_nanbox_to_pointer(x))
  ------------------
36409|      0|            int32_t len = janet_string_length(str);
  ------------------
  |  | 1813|      0|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  ------------------
  |  |  |  | 1812|      0|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
36410|      0|            if (hash == janet_string_hash(str) && len == cstr_len && !memcmp(str, cstr, len)) {
  ------------------
  |  | 1814|      0|#define janet_string_hash(s) (janet_string_head(s)->hash)
  |  |  ------------------
  |  |  |  | 1812|      0|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (36410:17): [True: 0, False: 0]
  |  Branch (36410:51): [True: 0, False: 0]
  |  Branch (36410:70): [True: 0, False: 0]
  ------------------
36411|      0|                return buckets + i;
36412|      0|            }
36413|      0|        }
36414|      0|    }
36415|      0|    return first_bucket;
36416|      0|}
janet_cstrcmp:
36441|  80.5k|int janet_cstrcmp(const uint8_t *str, const char *other) {
36442|  80.5k|    int32_t len = janet_string_length(str);
  ------------------
  |  | 1813|  80.5k|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  ------------------
  |  |  |  | 1812|  80.5k|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
36443|  80.5k|    int32_t index;
36444|   148k|    for (index = 0; index < len; index++) {
  ------------------
  |  Branch (36444:21): [True: 132k, False: 15.5k]
  ------------------
36445|   132k|        uint8_t c = str[index];
36446|   132k|        uint8_t k = ((const uint8_t *)other)[index];
36447|   132k|        if (c < k) return -1;
  ------------------
  |  Branch (36447:13): [True: 23.6k, False: 108k]
  ------------------
36448|   108k|        if (c > k) return 1;
  ------------------
  |  Branch (36448:13): [True: 41.3k, False: 67.5k]
  ------------------
36449|  67.5k|        if (k == '\0') break;
  ------------------
  |  Branch (36449:13): [True: 0, False: 67.5k]
  ------------------
36450|  67.5k|    }
36451|  15.5k|    return (other[index] == '\0') ? 0 : -1;
  ------------------
  |  Branch (36451:12): [True: 15.3k, False: 194]
  ------------------
36452|  80.5k|}
janet_strbinsearch:
36461|  15.7k|    const uint8_t *key) {
36462|  15.7k|    size_t low = 0;
36463|  15.7k|    size_t hi = tabcount;
36464|  15.7k|    const char *t = (const char *)tab;
36465|  80.8k|    while (low < hi) {
  ------------------
  |  Branch (36465:12): [True: 80.5k, False: 380]
  ------------------
36466|  80.5k|        size_t mid = low + ((hi - low) / 2);
36467|  80.5k|        const char **item = (const char **)(t + mid * itemsize);
36468|  80.5k|        const char *name = *item;
36469|  80.5k|        int comp = janet_cstrcmp(key, name);
36470|  80.5k|        if (comp < 0) {
  ------------------
  |  Branch (36470:13): [True: 23.8k, False: 56.6k]
  ------------------
36471|  23.8k|            hi = mid;
36472|  56.6k|        } else if (comp > 0) {
  ------------------
  |  Branch (36472:20): [True: 41.3k, False: 15.3k]
  ------------------
36473|  41.3k|            low = mid + 1;
36474|  41.3k|        } else {
36475|  15.3k|            return (const void *)item;
36476|  15.3k|        }
36477|  80.5k|    }
36478|    380|    return NULL;
36479|  15.7k|}
janet_registry_put:
36541|  2.48M|    int32_t source_line) {
36542|  2.48M|    if (janet_vm.registry_count == janet_vm.registry_cap) {
  ------------------
  |  Branch (36542:9): [True: 7.06k, False: 2.47M]
  ------------------
36543|  7.06k|        size_t newcap = (janet_vm.registry_count + 1) * 2;
36544|       |        /* Size it nicely with core by default */
36545|  7.06k|        if (newcap < 512) {
  ------------------
  |  Branch (36545:13): [True: 7.06k, False: 0]
  ------------------
36546|  7.06k|            newcap = 512;
36547|  7.06k|        }
36548|  7.06k|        void *newmem = janet_realloc(janet_vm.registry, newcap * sizeof(JanetCFunRegistry));
  ------------------
  |  | 2409|  7.06k|#define janet_realloc(X, Y) realloc((X), (Y))
  ------------------
36549|  7.06k|        if (NULL == newmem) {
  ------------------
  |  Branch (36549:13): [True: 0, False: 7.06k]
  ------------------
36550|      0|            JANET_OUT_OF_MEMORY;
  ------------------
  |  |  419|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (419:122): [Folded, False: 0]
  |  |  ------------------
  ------------------
36551|      0|        }
36552|  7.06k|        janet_vm.registry = newmem;
36553|  7.06k|        janet_vm.registry_cap = newcap;
36554|  7.06k|    }
36555|  2.48M|    JanetCFunRegistry value = {
36556|  2.48M|        key,
36557|  2.48M|        name,
36558|  2.48M|        name_prefix,
36559|  2.48M|        source_file,
36560|  2.48M|        source_line
36561|  2.48M|    };
36562|  2.48M|    janet_vm.registry[janet_vm.registry_count++] = value;
36563|  2.48M|    janet_vm.registry_dirty = 1;
36564|  2.48M|}
janet_register_abstract_type:
36690|  63.5k|void janet_register_abstract_type(const JanetAbstractType *at) {
36691|  63.5k|    janet_check_pointer_align((void *) at);
36692|  63.5k|    Janet sym = janet_csymbolv(at->name);
  ------------------
  |  | 1837|  63.5k|#define janet_csymbolv(cstr) janet_wrap_symbol(janet_csymbol(cstr))
  |  |  ------------------
  |  |  |  |  849|  63.5k|#define janet_wrap_symbol(s) janet_nanbox_wrap_c((s), JANET_SYMBOL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  828|  63.5k|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  793|  63.5k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  792|  63.5k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36693|  63.5k|    Janet check = janet_table_get(janet_vm.abstract_registry, sym);
36694|  63.5k|    if (!janet_checktype(check, JANET_NIL) && at != janet_unwrap_pointer(check)) {
  ------------------
  |  |  806|   127k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 63.5k]
  |  |  ------------------
  |  |  807|   127k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|   127k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  63.5k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  63.5k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  63.5k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  63.5k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if (!janet_checktype(check, JANET_NIL) && at != janet_unwrap_pointer(check)) {
  ------------------
  |  |  867|      0|#define janet_unwrap_pointer(x) (janet_nanbox_to_pointer(x))
  ------------------
  |  Branch (36694:9): [True: 0, False: 63.5k]
  |  Branch (36694:47): [True: 0, False: 0]
  ------------------
36695|      0|        janet_panicf("cannot register abstract type %s, "
36696|      0|                     "a type with the same name exists", at->name);
36697|      0|    }
36698|  63.5k|    janet_table_put(janet_vm.abstract_registry, sym, janet_wrap_pointer((void *) at));
  ------------------
  |  |  854|  63.5k|#define janet_wrap_pointer(s) janet_nanbox_wrap_((s), JANET_POINTER)
  |  |  ------------------
  |  |  |  |  825|  63.5k|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  63.5k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  63.5k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36699|  63.5k|}
janet_core_def_sm:
36710|  21.1k|void janet_core_def_sm(JanetTable *env, const char *name, Janet x, const void *p, const void *sf, int32_t sl) {
36711|  21.1k|    (void) sf;
36712|  21.1k|    (void) sl;
36713|  21.1k|    (void) p;
36714|  21.1k|    Janet key = janet_csymbolv(name);
  ------------------
  |  | 1837|  21.1k|#define janet_csymbolv(cstr) janet_wrap_symbol(janet_csymbol(cstr))
  |  |  ------------------
  |  |  |  |  849|  21.1k|#define janet_wrap_symbol(s) janet_nanbox_wrap_c((s), JANET_SYMBOL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  828|  21.1k|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  793|  21.1k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  792|  21.1k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36715|  21.1k|    janet_table_put(env, key, x);
36716|  21.1k|    if (janet_checktype(x, JANET_CFUNCTION)) {
  ------------------
  |  |  806|  21.1k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 0, False: 21.1k]
  |  |  |  Branch (806:6): [Folded, False: 21.1k]
  |  |  ------------------
  |  |  807|  21.1k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  21.1k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  21.1k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  21.1k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  21.1k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  21.1k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36717|      0|        janet_registry_put(janet_unwrap_cfunction(x), name, NULL, NULL, 0);
  ------------------
  |  |  869|      0|#define janet_unwrap_cfunction(x) ((JanetCFunction)janet_nanbox_to_pointer(x))
  ------------------
36718|      0|    }
36719|  21.1k|}
janet_core_cfuns_ext:
36721|   155k|void janet_core_cfuns_ext(JanetTable *env, const char *regprefix, const JanetRegExt *cfuns) {
36722|   155k|    (void) regprefix;
36723|  2.64M|    while (cfuns->name) {
  ------------------
  |  Branch (36723:12): [True: 2.48M, False: 155k]
  ------------------
36724|  2.48M|        janet_check_pointer_align(cfuns->cfun);
36725|  2.48M|        Janet fun = janet_wrap_cfunction(cfuns->cfun);
  ------------------
  |  |  853|  2.48M|#define janet_wrap_cfunction(s) janet_nanbox_wrap_((s), JANET_CFUNCTION)
  |  |  ------------------
  |  |  |  |  825|  2.48M|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  2.48M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  2.48M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36726|  2.48M|        janet_table_put(env, janet_csymbolv(cfuns->name), fun);
  ------------------
  |  | 1837|  2.48M|#define janet_csymbolv(cstr) janet_wrap_symbol(janet_csymbol(cstr))
  |  |  ------------------
  |  |  |  |  849|  2.48M|#define janet_wrap_symbol(s) janet_nanbox_wrap_c((s), JANET_SYMBOL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  828|  2.48M|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  793|  2.48M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  792|  2.48M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36727|  2.48M|        janet_registry_put(cfuns->cfun, cfuns->name, regprefix, cfuns->source_file, cfuns->source_line);
36728|  2.48M|        cfuns++;
36729|  2.48M|    }
36730|   155k|}
janet_binding_from_entry:
36733|  21.1k|JanetBinding janet_binding_from_entry(Janet entry) {
36734|  21.1k|    JanetTable *entry_table;
36735|  21.1k|    JanetBinding binding = {
36736|  21.1k|        JANET_BINDING_NONE,
36737|  21.1k|        janet_wrap_nil(),
  ------------------
  |  |  831|  21.1k|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|  21.1k|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  21.1k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  21.1k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36738|  21.1k|        JANET_BINDING_DEP_NONE
36739|  21.1k|    };
36740|       |
36741|       |    /* Check environment for entry */
36742|  21.1k|    if (!janet_checktype(entry, JANET_TABLE))
  ------------------
  |  |  806|  21.1k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 21.1k]
  |  |  ------------------
  |  |  807|  21.1k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  21.1k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  21.1k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  21.1k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  21.1k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  21.1k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (36742:9): [True: 0, False: 21.1k]
  ------------------
36743|      0|        return binding;
36744|  21.1k|    entry_table = janet_unwrap_table(entry);
  ------------------
  |  |  861|  21.1k|#define janet_unwrap_table(x) ((JanetTable *)janet_nanbox_to_pointer(x))
  ------------------
36745|       |
36746|  21.1k|    Janet deprecate = janet_table_get_keyword(entry_table, "deprecated");
36747|  21.1k|    int macro = janet_truthy(janet_table_get_keyword(entry_table, "macro"));
  ------------------
  |  |  818|  21.1k|    (!janet_checktype((x), JANET_NIL) && \
  |  |  ------------------
  |  |  |  |  806|  42.3k|    (((t) == JANET_NUMBER) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (806:6): [Folded, False: 21.1k]
  |  |  |  |  ------------------
  |  |  |  |  807|  42.3k|        ? janet_nanbox_isnumber(x) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  808|  42.3k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  800|  21.1k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  790|  21.1k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  793|  21.1k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  792|  21.1k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 0, False: 21.1k]
  |  |  ------------------
  |  |  819|  21.1k|     (!janet_checktype((x), JANET_BOOLEAN) || ((x).u64 & 0x1)))
  |  |  ------------------
  |  |  |  |  806|      0|    (((t) == JANET_NUMBER) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (806:6): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  807|      0|        ? janet_nanbox_isnumber(x) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  808|      0|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  800|      0|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  790|      0|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (819:7): [True: 0, False: 0]
  |  |  |  Branch (819:47): [True: 0, False: 0]
  |  |  ------------------
  ------------------
36748|  21.1k|    Janet value = janet_table_get_keyword(entry_table, "value");
36749|  21.1k|    Janet ref = janet_table_get_keyword(entry_table, "ref");
36750|       |
36751|  21.1k|    if (janet_checktype(deprecate, JANET_KEYWORD)) {
  ------------------
  |  |  806|  21.1k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 0, False: 21.1k]
  |  |  |  Branch (806:6): [Folded, False: 21.1k]
  |  |  ------------------
  |  |  807|  21.1k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  21.1k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  21.1k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  21.1k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  21.1k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  21.1k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36752|      0|        JanetKeyword depkw = janet_unwrap_keyword(deprecate);
  ------------------
  |  |  865|      0|#define janet_unwrap_keyword(x) ((const uint8_t *)janet_nanbox_to_pointer(x))
  ------------------
36753|      0|        if (!janet_cstrcmp(depkw, "relaxed")) {
  ------------------
  |  Branch (36753:13): [True: 0, False: 0]
  ------------------
36754|      0|            binding.deprecation = JANET_BINDING_DEP_RELAXED;
36755|      0|        } else if (!janet_cstrcmp(depkw, "normal")) {
  ------------------
  |  Branch (36755:20): [True: 0, False: 0]
  ------------------
36756|      0|            binding.deprecation = JANET_BINDING_DEP_NORMAL;
36757|      0|        } else if (!janet_cstrcmp(depkw, "strict")) {
  ------------------
  |  Branch (36757:20): [True: 0, False: 0]
  ------------------
36758|      0|            binding.deprecation = JANET_BINDING_DEP_STRICT;
36759|      0|        }
36760|  21.1k|    } else if (!janet_checktype(deprecate, JANET_NIL)) {
  ------------------
  |  |  806|  21.1k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 21.1k]
  |  |  ------------------
  |  |  807|  21.1k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  21.1k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  21.1k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  21.1k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  21.1k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  21.1k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (36760:16): [True: 0, False: 21.1k]
  ------------------
36761|      0|        binding.deprecation = JANET_BINDING_DEP_NORMAL;
36762|      0|    }
36763|       |
36764|  21.1k|    int ref_is_valid = janet_checktype(ref, JANET_ARRAY);
  ------------------
  |  |  806|  21.1k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 21.1k]
  |  |  ------------------
  |  |  807|  21.1k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  21.1k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  21.1k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  21.1k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  21.1k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  21.1k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36765|  21.1k|    int redef = ref_is_valid && janet_truthy(janet_table_get_keyword(entry_table, "redef"));
  ------------------
  |  |  818|  21.1k|    (!janet_checktype((x), JANET_NIL) && \
  |  |  ------------------
  |  |  |  |  806|      0|    (((t) == JANET_NUMBER) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (806:6): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  807|      0|        ? janet_nanbox_isnumber(x) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  808|      0|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  800|      0|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  790|      0|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 0, False: 0]
  |  |  ------------------
  |  |  819|  21.1k|     (!janet_checktype((x), JANET_BOOLEAN) || ((x).u64 & 0x1)))
  |  |  ------------------
  |  |  |  |  806|      0|    (((t) == JANET_NUMBER) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (806:6): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  807|      0|        ? janet_nanbox_isnumber(x) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  808|      0|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  800|      0|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  790|      0|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (819:7): [True: 0, False: 0]
  |  |  |  Branch (819:47): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (36765:17): [True: 0, False: 21.1k]
  ------------------
36766|       |
36767|  21.1k|    if (macro) {
  ------------------
  |  Branch (36767:9): [True: 0, False: 21.1k]
  ------------------
36768|      0|        binding.value = redef ? ref : value;
  ------------------
  |  Branch (36768:25): [True: 0, False: 0]
  ------------------
36769|      0|        binding.type = redef ? JANET_BINDING_DYNAMIC_MACRO : JANET_BINDING_MACRO;
  ------------------
  |  Branch (36769:24): [True: 0, False: 0]
  ------------------
36770|      0|        return binding;
36771|      0|    }
36772|       |
36773|  21.1k|    if (ref_is_valid) {
  ------------------
  |  Branch (36773:9): [True: 0, False: 21.1k]
  ------------------
36774|      0|        binding.value = ref;
36775|      0|        binding.type = redef ? JANET_BINDING_DYNAMIC_DEF : JANET_BINDING_VAR;
  ------------------
  |  Branch (36775:24): [True: 0, False: 0]
  ------------------
36776|  21.1k|    } else {
36777|  21.1k|        binding.value = value;
36778|  21.1k|        binding.type = JANET_BINDING_DEF;
36779|  21.1k|    }
36780|       |
36781|  21.1k|    return binding;
36782|  21.1k|}
janet_resolve_ext:
36837|  21.1k|JanetBinding janet_resolve_ext(JanetTable *env, const uint8_t *sym) {
36838|  21.1k|    Janet entry = janet_table_get(env, janet_wrap_symbol(sym));
  ------------------
  |  |  849|  21.1k|#define janet_wrap_symbol(s) janet_nanbox_wrap_c((s), JANET_SYMBOL)
  |  |  ------------------
  |  |  |  |  828|  21.1k|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  21.1k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  21.1k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36839|  21.1k|    return janet_binding_from_entry(entry);
36840|  21.1k|}
janet_resolve:
36842|  21.1k|JanetBindingType janet_resolve(JanetTable *env, const uint8_t *sym, Janet *out) {
36843|  21.1k|    JanetBinding binding = janet_resolve_ext(env, sym);
36844|  21.1k|    if (binding.type == JANET_BINDING_DYNAMIC_DEF || binding.type == JANET_BINDING_DYNAMIC_MACRO) {
  ------------------
  |  Branch (36844:9): [True: 0, False: 21.1k]
  |  Branch (36844:54): [True: 0, False: 21.1k]
  ------------------
36845|      0|        *out = janet_array_peek(janet_unwrap_array(binding.value));
  ------------------
  |  |  860|      0|#define janet_unwrap_array(x) ((JanetArray *)janet_nanbox_to_pointer(x))
  ------------------
36846|  21.1k|    } else {
36847|  21.1k|        *out = binding.value;
36848|  21.1k|    }
36849|  21.1k|    return binding.type;
36850|  21.1k|}
janet_resolve_core:
36853|  7.06k|Janet janet_resolve_core(const char *name) {
36854|  7.06k|    JanetTable *env = janet_core_env(NULL);
36855|  7.06k|    Janet out = janet_wrap_nil();
  ------------------
  |  |  831|  7.06k|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|  7.06k|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  7.06k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  7.06k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36856|  7.06k|    janet_resolve(env, janet_csymbol(name), &out);
36857|  7.06k|    return out;
36858|  7.06k|}
janet_indexed_view:
36862|  28.6M|int janet_indexed_view(Janet seq, const Janet **data, int32_t *len) {
36863|  28.6M|    if (janet_checktype(seq, JANET_ARRAY)) {
  ------------------
  |  |  806|  28.6M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 6.17M, False: 22.5M]
  |  |  |  Branch (806:6): [Folded, False: 28.6M]
  |  |  ------------------
  |  |  807|  28.6M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  28.6M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  28.6M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  28.6M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  28.6M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  28.6M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36864|  6.17M|        *data = janet_unwrap_array(seq)->data;
  ------------------
  |  |  860|  6.17M|#define janet_unwrap_array(x) ((JanetArray *)janet_nanbox_to_pointer(x))
  ------------------
36865|  6.17M|        *len = janet_unwrap_array(seq)->count;
  ------------------
  |  |  860|  6.17M|#define janet_unwrap_array(x) ((JanetArray *)janet_nanbox_to_pointer(x))
  ------------------
36866|  6.17M|        return 1;
36867|  22.5M|    } else if (janet_checktype(seq, JANET_TUPLE)) {
  ------------------
  |  |  806|  22.5M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 22.5M, False: 0]
  |  |  |  Branch (806:6): [Folded, False: 22.5M]
  |  |  ------------------
  |  |  807|  22.5M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  22.5M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  22.5M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  22.5M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  22.5M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  22.5M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36868|  22.5M|        *data = janet_unwrap_tuple(seq);
  ------------------
  |  |  858|  22.5M|#define janet_unwrap_tuple(x) ((JanetTuple)janet_nanbox_to_pointer(x))
  ------------------
36869|  22.5M|        *len = janet_tuple_length(janet_unwrap_tuple(seq));
  ------------------
  |  | 1802|  22.5M|#define janet_tuple_length(t) (janet_tuple_head(t)->length)
  |  |  ------------------
  |  |  |  | 1800|  22.5M|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
36870|  22.5M|        return 1;
36871|  22.5M|    }
36872|      0|    return 0;
36873|  28.6M|}
janet_bytes_view:
36877|  2.33k|int janet_bytes_view(Janet str, const uint8_t **data, int32_t *len) {
36878|  2.33k|    JanetType t = janet_type(str);
  ------------------
  |  |  795|  2.33k|    (isnan((x).number) \
  |  |  796|  2.33k|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|  2.33k|        : JANET_NUMBER)
  ------------------
  |  Branch (36878:19): [True: 2.33k, False: 0]
  ------------------
36879|  2.33k|    if (t == JANET_STRING || t == JANET_SYMBOL || t == JANET_KEYWORD) {
  ------------------
  |  Branch (36879:9): [True: 2.33k, False: 0]
  |  Branch (36879:30): [True: 0, False: 0]
  |  Branch (36879:51): [True: 0, False: 0]
  ------------------
36880|  2.33k|        *data = janet_unwrap_string(str);
  ------------------
  |  |  863|  2.33k|#define janet_unwrap_string(x) ((JanetString)janet_nanbox_to_pointer(x))
  ------------------
36881|  2.33k|        *len = janet_string_length(janet_unwrap_string(str));
  ------------------
  |  | 1813|  2.33k|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  ------------------
  |  |  |  | 1812|  2.33k|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
36882|  2.33k|        return 1;
36883|  2.33k|    } else if (t == JANET_BUFFER) {
  ------------------
  |  Branch (36883:16): [True: 0, False: 0]
  ------------------
36884|      0|        *data = janet_unwrap_buffer(str)->data;
  ------------------
  |  |  862|      0|#define janet_unwrap_buffer(x) ((JanetBuffer *)janet_nanbox_to_pointer(x))
  ------------------
36885|      0|        *len = janet_unwrap_buffer(str)->count;
  ------------------
  |  |  862|      0|#define janet_unwrap_buffer(x) ((JanetBuffer *)janet_nanbox_to_pointer(x))
  ------------------
36886|      0|        return 1;
36887|      0|    } else if (t == JANET_ABSTRACT) {
  ------------------
  |  Branch (36887:16): [True: 0, False: 0]
  ------------------
36888|      0|        void *abst = janet_unwrap_abstract(str);
  ------------------
  |  |  866|      0|#define janet_unwrap_abstract(x) (janet_nanbox_to_pointer(x))
  ------------------
36889|      0|        const JanetAbstractType *atype = janet_abstract_type(abst);
  ------------------
  |  | 1899|      0|#define janet_abstract_type(u) (janet_abstract_head(u)->type)
  |  |  ------------------
  |  |  |  | 1897|      0|#define janet_abstract_head(u) ((JanetAbstractHead *)((char *)u - offsetof(JanetAbstractHead, data)))
  |  |  ------------------
  ------------------
36890|      0|        if (NULL == atype->bytes) {
  ------------------
  |  Branch (36890:13): [True: 0, False: 0]
  ------------------
36891|      0|            return 0;
36892|      0|        }
36893|      0|        JanetByteView view = atype->bytes(abst, janet_abstract_size(abst));
  ------------------
  |  | 1900|      0|#define janet_abstract_size(u) (janet_abstract_head(u)->size)
  |  |  ------------------
  |  |  |  | 1897|      0|#define janet_abstract_head(u) ((JanetAbstractHead *)((char *)u - offsetof(JanetAbstractHead, data)))
  |  |  ------------------
  ------------------
36894|      0|        *data = view.bytes;
36895|      0|        *len = view.len;
36896|      0|        return 1;
36897|      0|    }
36898|      0|    return 0;
36899|  2.33k|}
janet_dictionary_view:
36904|  12.1M|int janet_dictionary_view(Janet tab, const JanetKV **data, int32_t *len, int32_t *cap) {
36905|  12.1M|    if (janet_checktype(tab, JANET_TABLE)) {
  ------------------
  |  |  806|  12.1M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 728k, False: 11.3M]
  |  |  |  Branch (806:6): [Folded, False: 12.1M]
  |  |  ------------------
  |  |  807|  12.1M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  12.1M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  12.1M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  12.1M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  12.1M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  12.1M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36906|   728k|        *data = janet_unwrap_table(tab)->data;
  ------------------
  |  |  861|   728k|#define janet_unwrap_table(x) ((JanetTable *)janet_nanbox_to_pointer(x))
  ------------------
36907|   728k|        *cap = janet_unwrap_table(tab)->capacity;
  ------------------
  |  |  861|   728k|#define janet_unwrap_table(x) ((JanetTable *)janet_nanbox_to_pointer(x))
  ------------------
36908|   728k|        *len = janet_unwrap_table(tab)->count;
  ------------------
  |  |  861|   728k|#define janet_unwrap_table(x) ((JanetTable *)janet_nanbox_to_pointer(x))
  ------------------
36909|   728k|        return 1;
36910|  11.3M|    } else if (janet_checktype(tab, JANET_STRUCT)) {
  ------------------
  |  |  806|  11.3M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 11.3M, False: 0]
  |  |  |  Branch (806:6): [Folded, False: 11.3M]
  |  |  ------------------
  |  |  807|  11.3M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  11.3M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  11.3M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  11.3M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  11.3M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  11.3M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36911|  11.3M|        *data = janet_unwrap_struct(tab);
  ------------------
  |  |  857|  11.3M|#define janet_unwrap_struct(x) ((JanetStruct)janet_nanbox_to_pointer(x))
  ------------------
36912|  11.3M|        *cap = janet_struct_capacity(janet_unwrap_struct(tab));
  ------------------
  |  | 1849|  11.3M|#define janet_struct_capacity(t) (janet_struct_head(t)->capacity)
  |  |  ------------------
  |  |  |  | 1846|  11.3M|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
36913|  11.3M|        *len = janet_struct_length(janet_unwrap_struct(tab));
  ------------------
  |  | 1848|  11.3M|#define janet_struct_length(t) (janet_struct_head(t)->length)
  |  |  ------------------
  |  |  |  | 1846|  11.3M|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
36914|  11.3M|        return 1;
36915|  11.3M|    }
36916|      0|    return 0;
36917|  12.1M|}
janet_checkint:
36919|  22.3k|int janet_checkint(Janet x) {
36920|  22.3k|    if (!janet_checktype(x, JANET_NUMBER))
  ------------------
  |  |  806|  22.3k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [True: 22.3k, Folded]
  |  |  ------------------
  |  |  807|  22.3k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|  22.3k|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 6.49k, False: 15.8k]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 15.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  22.3k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|      0|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|      0|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (36920:9): [True: 15.8k, False: 6.49k]
  ------------------
36921|  15.8k|        return 0;
36922|  6.49k|    double dval = janet_unwrap_number(x);
  ------------------
  |  |  839|  6.49k|#define janet_unwrap_number(x) ((x).number)
  ------------------
36923|       |    return janet_checkintrange(dval);
  ------------------
  |  |  962|  6.49k|#define janet_checkintrange(x) ((x) >= INT32_MIN && (x) <= INT32_MAX && (x) == (int32_t)(x))
  |  |  ------------------
  |  |  |  Branch (962:33): [True: 6.41k, False: 78]
  |  |  |  Branch (962:53): [True: 6.19k, False: 223]
  |  |  |  Branch (962:73): [True: 5.97k, False: 215]
  |  |  ------------------
  ------------------
36924|  22.3k|}
janet_sorted_keys:
37001|  12.1M|int32_t janet_sorted_keys(const JanetKV *dict, int32_t cap, int32_t *index_buffer) {
37002|       |
37003|       |    /* First, put populated indices into index_buffer */
37004|  12.1M|    int32_t next_index = 0;
37005|  51.2M|    for (int32_t i = 0; i < cap; i++) {
  ------------------
  |  Branch (37005:25): [True: 39.0M, False: 12.1M]
  ------------------
37006|  39.0M|        if (!janet_checktype(dict[i].key, JANET_NIL)) {
  ------------------
  |  |  806|  39.0M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 39.0M]
  |  |  ------------------
  |  |  807|  39.0M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  39.0M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  39.0M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  39.0M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  39.0M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  39.0M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (37006:13): [True: 9.18M, False: 29.9M]
  ------------------
37007|  9.18M|            index_buffer[next_index++] = i;
37008|  9.18M|        }
37009|  39.0M|    }
37010|       |
37011|       |    /* Next, sort those (simple insertion sort here for now) */
37012|  15.8M|    for (int32_t i = 1; i < next_index; i++) {
  ------------------
  |  Branch (37012:25): [True: 3.75M, False: 12.1M]
  ------------------
37013|  3.75M|        int32_t index_to_insert = index_buffer[i];
37014|  3.75M|        Janet lhs = dict[index_to_insert].key;
37015|  6.69M|        for (int32_t j = i - 1; j >= 0; j--) {
  ------------------
  |  Branch (37015:33): [True: 4.42M, False: 2.26M]
  ------------------
37016|  4.42M|            index_buffer[j + 1] = index_buffer[j];
37017|  4.42M|            Janet rhs = dict[index_buffer[j]].key;
37018|  4.42M|            if (janet_compare(lhs, rhs) >= 0) {
  ------------------
  |  Branch (37018:17): [True: 1.48M, False: 2.93M]
  ------------------
37019|  1.48M|                index_buffer[j + 1] = index_to_insert;
37020|  1.48M|                break;
37021|  2.93M|            } else if (j == 0) {
  ------------------
  |  Branch (37021:24): [True: 2.26M, False: 672k]
  ------------------
37022|  2.26M|                index_buffer[0] = index_to_insert;
37023|  2.26M|            }
37024|  4.42M|        }
37025|  3.75M|    }
37026|       |
37027|       |    /* Return number of indices found */
37028|  12.1M|    return next_index;
37029|  12.1M|}
array_allocate:
37262|  43.1M|void *array_allocate(size_t element_size, int32_t count) {
37263|  43.1M|    if (count < 0) return NULL;
  ------------------
  |  Branch (37263:9): [True: 0, False: 43.1M]
  ------------------
37264|  43.1M|    if ((size_t) count > (SIZE_MAX / element_size)) return NULL;
  ------------------
  |  Branch (37264:9): [True: 0, False: 43.1M]
  ------------------
37265|  43.1M|    return janet_malloc(element_size * count);
  ------------------
  |  | 2406|  43.1M|#define janet_malloc(X) malloc((X))
  ------------------
37266|  43.1M|}
janet_equals:
37568|  27.8M|int janet_equals(Janet x, Janet y) {
37569|  27.8M|    if (janet_type(x) != janet_type(y)) return 0;
  ------------------
  |  |  795|  27.8M|    (isnan((x).number) \
  |  |  796|  27.8M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|  27.8M|        : JANET_NUMBER)
  ------------------
                  if (janet_type(x) != janet_type(y)) return 0;
  ------------------
  |  |  795|  27.8M|    (isnan((x).number) \
  |  |  796|  27.8M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|  27.8M|        : JANET_NUMBER)
  ------------------
  |  Branch (37569:9): [True: 27.1M, False: 673k]
  |  Branch (37569:9): [True: 10.1M, False: 17.7M]
  |  Branch (37569:26): [True: 26.7M, False: 1.07M]
  ------------------
37570|  17.7M|    if (janet_checktypes(x, JANET_TFLAG_TUPLE | JANET_TFLAG_STRUCT)) return janet_equals_containers(x, y);
  ------------------
  |  |  969|  17.7M|#define janet_checktypes(x, tps) ((1 << janet_type(x)) & (tps))
  |  |  ------------------
  |  |  |  |  795|  17.7M|    (isnan((x).number) \
  |  |  |  |  796|  17.7M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  |  |  797|  17.7M|        : JANET_NUMBER)
  |  |  ------------------
  |  |  |  Branch (969:34): [True: 17.0M, False: 671k]
  |  |  ------------------
  ------------------
  |  Branch (37570:9): [True: 17.0M, False: 670k]
  ------------------
37571|   671k|    return janet_equals_leaf(x, y);
37572|  17.7M|}
janet_hash:
37584|   206M|int32_t janet_hash(Janet x) {
37585|   206M|    int32_t hash = 0;
37586|   206M|    switch (janet_type(x)) {
  ------------------
  |  |  795|   206M|    (isnan((x).number) \
  |  |  796|   206M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|   206M|        : JANET_NUMBER)
  ------------------
  |  Branch (37586:13): [True: 187M, False: 18.7M]
  ------------------
37587|  12.0M|        case JANET_NIL:
  ------------------
  |  Branch (37587:9): [True: 12.0M, False: 194M]
  ------------------
37588|  12.0M|            hash = 0;
37589|  12.0M|            break;
37590|  42.8k|        case JANET_BOOLEAN:
  ------------------
  |  Branch (37590:9): [True: 42.8k, False: 206M]
  ------------------
37591|  42.8k|            hash = janet_unwrap_boolean(x);
  ------------------
  |  |  838|  42.8k|#define janet_unwrap_boolean(x) ((x).u64 & 0x1)
  ------------------
37592|  42.8k|            break;
37593|  30.9M|        case JANET_STRING:
  ------------------
  |  Branch (37593:9): [True: 30.9M, False: 175M]
  ------------------
37594|  31.2M|        case JANET_SYMBOL:
  ------------------
  |  Branch (37594:9): [True: 353k, False: 206M]
  ------------------
37595|  31.8M|        case JANET_KEYWORD:
  ------------------
  |  Branch (37595:9): [True: 644k, False: 206M]
  ------------------
37596|  31.8M|            hash = janet_string_hash(janet_unwrap_string(x));
  ------------------
  |  | 1814|  31.8M|#define janet_string_hash(s) (janet_string_head(s)->hash)
  |  |  ------------------
  |  |  |  | 1812|  31.8M|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
37597|  31.8M|            break;
37598|  72.8M|        case JANET_TUPLE:
  ------------------
  |  Branch (37598:9): [True: 72.8M, False: 133M]
  ------------------
37599|  72.8M|            hash = janet_tuple_hash(janet_unwrap_tuple(x));
  ------------------
  |  | 1803|  72.8M|#define janet_tuple_hash(t) (janet_tuple_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1800|  72.8M|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
37600|  72.8M|            uint32_t inc = (janet_tuple_flag(janet_unwrap_tuple(x)) & JANET_TUPLE_FLAG_BRACKETCTOR) ? 1 : 0;
  ------------------
  |  | 1806|  72.8M|#define janet_tuple_flag(t) (janet_tuple_head(t)->gc.flags)
  |  |  ------------------
  |  |  |  | 1800|  72.8M|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
                          uint32_t inc = (janet_tuple_flag(janet_unwrap_tuple(x)) & JANET_TUPLE_FLAG_BRACKETCTOR) ? 1 : 0;
  ------------------
  |  | 1798|  72.8M|#define JANET_TUPLE_FLAG_BRACKETCTOR 0x10000
  ------------------
  |  Branch (37600:28): [True: 2.38M, False: 70.4M]
  ------------------
37601|  72.8M|            hash = (int32_t)((uint32_t)hash + inc); /* avoid overflow undefined behavior */
37602|  72.8M|            break;
37603|  34.6M|        case JANET_STRUCT:
  ------------------
  |  Branch (37603:9): [True: 34.6M, False: 172M]
  ------------------
37604|  34.6M|            hash = janet_struct_hash(janet_unwrap_struct(x));
  ------------------
  |  | 1850|  34.6M|#define janet_struct_hash(t) (janet_struct_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1846|  34.6M|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
37605|  34.6M|            break;
37606|  18.7M|        case JANET_NUMBER: {
  ------------------
  |  Branch (37606:9): [True: 18.7M, False: 187M]
  ------------------
37607|  18.7M|            union {
37608|  18.7M|                double d;
37609|  18.7M|                uint64_t u;
37610|  18.7M|            } as;
37611|  18.7M|            as.d = janet_unwrap_number(x);
  ------------------
  |  |  839|  18.7M|#define janet_unwrap_number(x) ((x).number)
  ------------------
37612|  18.7M|            as.d += 0.0; /* normalize negative 0 */
37613|  18.7M|            as.u = murmur64(as.u);
37614|  18.7M|            uint32_t hi = (uint32_t)(as.u >> 32);
37615|  18.7M|            hash = (int32_t)hi;
37616|  18.7M|            break;
37617|  31.2M|        }
37618|  1.73M|        case JANET_ABSTRACT: {
  ------------------
  |  Branch (37618:9): [True: 1.73M, False: 205M]
  ------------------
37619|  1.73M|            JanetAbstract xx = janet_unwrap_abstract(x);
  ------------------
  |  |  866|  1.73M|#define janet_unwrap_abstract(x) (janet_nanbox_to_pointer(x))
  ------------------
37620|  1.73M|            const JanetAbstractType *at = janet_abstract_type(xx);
  ------------------
  |  | 1899|  1.73M|#define janet_abstract_type(u) (janet_abstract_head(u)->type)
  |  |  ------------------
  |  |  |  | 1897|  1.73M|#define janet_abstract_head(u) ((JanetAbstractHead *)((char *)u - offsetof(JanetAbstractHead, data)))
  |  |  ------------------
  ------------------
37621|  1.73M|            if (at->hash != NULL) {
  ------------------
  |  Branch (37621:17): [True: 1.68M, False: 42.3k]
  ------------------
37622|  1.68M|                hash = at->hash(xx, janet_abstract_size(xx));
  ------------------
  |  | 1900|  1.68M|#define janet_abstract_size(u) (janet_abstract_head(u)->size)
  |  |  ------------------
  |  |  |  | 1897|  1.68M|#define janet_abstract_head(u) ((JanetAbstractHead *)((char *)u - offsetof(JanetAbstractHead, data)))
  |  |  ------------------
  ------------------
37623|  1.68M|                break;
37624|  1.68M|            }
37625|  1.73M|        }
37626|       |        /* fallthrough */
37627|  34.7M|        default:
  ------------------
  |  Branch (37627:9): [True: 34.7M, False: 172M]
  ------------------
37628|  34.7M|            if (sizeof(double) == sizeof(void *)) {
  ------------------
  |  Branch (37628:17): [True: 34.7M, Folded]
  ------------------
37629|       |                /* Assuming 8 byte pointer (8 byte aligned) */
37630|  34.7M|                uint64_t i = murmur64(janet_u64(x));
  ------------------
  |  |  788|  34.7M|#define janet_u64(x) ((x).u64)
  ------------------
37631|  34.7M|                hash = (int32_t)(i >> 32);
37632|  34.7M|            } else {
37633|       |                /* Assuming 4 byte pointer (or smaller) */
37634|      0|                uintptr_t diff = (uintptr_t) janet_unwrap_pointer(x);
  ------------------
  |  |  867|      0|#define janet_unwrap_pointer(x) (janet_nanbox_to_pointer(x))
  ------------------
37635|      0|                uint32_t hilo = (uint32_t) diff * 2654435769u;
37636|      0|                hash = (int32_t)((hilo << 16) | (hilo >> 16));
37637|      0|            }
37638|  34.7M|            break;
37639|   206M|    }
37640|   206M|    return hash;
37641|   206M|}
janet_compare:
37646|  4.42M|int janet_compare(Janet x, Janet y) {
37647|  4.42M|    janet_vm.traversal = janet_vm.traversal_base;
37648|  4.42M|    int status;
37649|  4.59M|    do {
37650|  4.59M|        JanetType tx = janet_type(x);
  ------------------
  |  |  795|  4.59M|    (isnan((x).number) \
  |  |  796|  4.59M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|  4.59M|        : JANET_NUMBER)
  ------------------
  |  Branch (37650:24): [True: 4.47M, False: 112k]
  ------------------
37651|  4.59M|        JanetType ty = janet_type(y);
  ------------------
  |  |  795|  4.59M|    (isnan((x).number) \
  |  |  796|  4.59M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|  4.59M|        : JANET_NUMBER)
  ------------------
  |  Branch (37651:24): [True: 3.91M, False: 675k]
  ------------------
37652|  4.59M|        if (tx != ty) return tx < ty ? -1 : 1;
  ------------------
  |  Branch (37652:13): [True: 1.88M, False: 2.70M]
  |  Branch (37652:30): [True: 658k, False: 1.23M]
  ------------------
37653|  2.70M|        switch (tx) {
37654|  1.25k|            case JANET_NIL:
  ------------------
  |  Branch (37654:13): [True: 1.25k, False: 2.70M]
  ------------------
37655|  1.25k|                break;
37656|     34|            case JANET_BOOLEAN: {
  ------------------
  |  Branch (37656:13): [True: 34, False: 2.70M]
  ------------------
37657|     34|                int diff = janet_unwrap_boolean(x) - janet_unwrap_boolean(y);
  ------------------
  |  |  838|     34|#define janet_unwrap_boolean(x) ((x).u64 & 0x1)
  ------------------
                              int diff = janet_unwrap_boolean(x) - janet_unwrap_boolean(y);
  ------------------
  |  |  838|     34|#define janet_unwrap_boolean(x) ((x).u64 & 0x1)
  ------------------
37658|     34|                if (diff) return diff;
  ------------------
  |  Branch (37658:21): [True: 0, False: 34]
  ------------------
37659|     34|                break;
37660|     34|            }
37661|  21.1k|            case JANET_NUMBER: {
  ------------------
  |  Branch (37661:13): [True: 21.1k, False: 2.68M]
  ------------------
37662|  21.1k|                double xx = janet_unwrap_number(x);
  ------------------
  |  |  839|  21.1k|#define janet_unwrap_number(x) ((x).number)
  ------------------
37663|  21.1k|                double yy = janet_unwrap_number(y);
  ------------------
  |  |  839|  21.1k|#define janet_unwrap_number(x) ((x).number)
  ------------------
37664|  21.1k|                if (xx == yy) {
  ------------------
  |  Branch (37664:21): [True: 125, False: 21.0k]
  ------------------
37665|    125|                    break;
37666|  21.0k|                } else {
37667|  21.0k|                    return (xx < yy) ? -1 : 1;
  ------------------
  |  Branch (37667:28): [True: 19.1k, False: 1.88k]
  ------------------
37668|  21.0k|                }
37669|  21.1k|            }
37670|    488|            case JANET_STRING:
  ------------------
  |  Branch (37670:13): [True: 488, False: 2.70M]
  ------------------
37671|  2.38M|            case JANET_SYMBOL:
  ------------------
  |  Branch (37671:13): [True: 2.38M, False: 314k]
  ------------------
37672|  2.39M|            case JANET_KEYWORD: {
  ------------------
  |  Branch (37672:13): [True: 2.62k, False: 2.69M]
  ------------------
37673|  2.39M|                int diff = janet_string_compare(janet_unwrap_string(x), janet_unwrap_string(y));
  ------------------
  |  |  863|  2.39M|#define janet_unwrap_string(x) ((JanetString)janet_nanbox_to_pointer(x))
  ------------------
                              int diff = janet_string_compare(janet_unwrap_string(x), janet_unwrap_string(y));
  ------------------
  |  |  863|  2.39M|#define janet_unwrap_string(x) ((JanetString)janet_nanbox_to_pointer(x))
  ------------------
37674|  2.39M|                if (diff) return diff;
  ------------------
  |  Branch (37674:21): [True: 2.30M, False: 82.4k]
  ------------------
37675|  82.4k|                break;
37676|  2.39M|            }
37677|  82.4k|            case JANET_ABSTRACT: {
  ------------------
  |  Branch (37677:13): [True: 5.85k, False: 2.69M]
  ------------------
37678|  5.85k|                int diff = janet_compare_abstract(janet_unwrap_abstract(x), janet_unwrap_abstract(y));
  ------------------
  |  |  866|  5.85k|#define janet_unwrap_abstract(x) (janet_nanbox_to_pointer(x))
  ------------------
                              int diff = janet_compare_abstract(janet_unwrap_abstract(x), janet_unwrap_abstract(y));
  ------------------
  |  |  866|  5.85k|#define janet_unwrap_abstract(x) (janet_nanbox_to_pointer(x))
  ------------------
37679|  5.85k|                if (diff) return diff;
  ------------------
  |  Branch (37679:21): [True: 5.77k, False: 77]
  ------------------
37680|     77|                break;
37681|  5.85k|            }
37682|  1.98k|            default: {
  ------------------
  |  Branch (37682:13): [True: 1.98k, False: 2.69M]
  ------------------
37683|  1.98k|                if (janet_unwrap_pointer(x) == janet_unwrap_pointer(y)) {
  ------------------
  |  |  867|  1.98k|#define janet_unwrap_pointer(x) (janet_nanbox_to_pointer(x))
  ------------------
                              if (janet_unwrap_pointer(x) == janet_unwrap_pointer(y)) {
  ------------------
  |  |  867|  1.98k|#define janet_unwrap_pointer(x) (janet_nanbox_to_pointer(x))
  ------------------
  |  Branch (37683:21): [True: 0, False: 1.98k]
  ------------------
37684|      0|                    break;
37685|  1.98k|                } else {
37686|  1.98k|                    return janet_unwrap_pointer(x) > janet_unwrap_pointer(y) ? 1 : -1;
  ------------------
  |  |  867|  1.98k|#define janet_unwrap_pointer(x) (janet_nanbox_to_pointer(x))
  ------------------
                                  return janet_unwrap_pointer(x) > janet_unwrap_pointer(y) ? 1 : -1;
  ------------------
  |  |  867|  1.98k|#define janet_unwrap_pointer(x) (janet_nanbox_to_pointer(x))
  ------------------
  |  Branch (37686:28): [True: 342, False: 1.64k]
  ------------------
37687|  1.98k|                }
37688|  1.98k|            }
37689|   242k|            case JANET_TUPLE: {
  ------------------
  |  Branch (37689:13): [True: 242k, False: 2.45M]
  ------------------
37690|   242k|                const Janet *lhs = janet_unwrap_tuple(x);
  ------------------
  |  |  858|   242k|#define janet_unwrap_tuple(x) ((JanetTuple)janet_nanbox_to_pointer(x))
  ------------------
37691|   242k|                const Janet *rhs = janet_unwrap_tuple(y);
  ------------------
  |  |  858|   242k|#define janet_unwrap_tuple(x) ((JanetTuple)janet_nanbox_to_pointer(x))
  ------------------
37692|   242k|                if (JANET_TUPLE_FLAG_BRACKETCTOR & (janet_tuple_flag(lhs) ^ janet_tuple_flag(rhs))) {
  ------------------
  |  | 1798|   242k|#define JANET_TUPLE_FLAG_BRACKETCTOR 0x10000
  ------------------
                              if (JANET_TUPLE_FLAG_BRACKETCTOR & (janet_tuple_flag(lhs) ^ janet_tuple_flag(rhs))) {
  ------------------
  |  | 1806|   242k|#define janet_tuple_flag(t) (janet_tuple_head(t)->gc.flags)
  |  |  ------------------
  |  |  |  | 1800|   242k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
                              if (JANET_TUPLE_FLAG_BRACKETCTOR & (janet_tuple_flag(lhs) ^ janet_tuple_flag(rhs))) {
  ------------------
  |  | 1806|   242k|#define janet_tuple_flag(t) (janet_tuple_head(t)->gc.flags)
  |  |  ------------------
  |  |  |  | 1800|   242k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (37692:21): [True: 90.8k, False: 152k]
  ------------------
37693|  90.8k|                    return (janet_tuple_flag(lhs) & JANET_TUPLE_FLAG_BRACKETCTOR) ? 1 : -1;
  ------------------
  |  | 1806|  90.8k|#define janet_tuple_flag(t) (janet_tuple_head(t)->gc.flags)
  |  |  ------------------
  |  |  |  | 1800|  90.8k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
                                  return (janet_tuple_flag(lhs) & JANET_TUPLE_FLAG_BRACKETCTOR) ? 1 : -1;
  ------------------
  |  | 1798|  90.8k|#define JANET_TUPLE_FLAG_BRACKETCTOR 0x10000
  ------------------
  |  Branch (37693:28): [True: 21.9k, False: 68.9k]
  ------------------
37694|  90.8k|                }
37695|   152k|                push_traversal_node(janet_tuple_head(lhs), janet_tuple_head(rhs), 1);
  ------------------
  |  | 1800|   152k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  ------------------
                              push_traversal_node(janet_tuple_head(lhs), janet_tuple_head(rhs), 1);
  ------------------
  |  | 1800|   152k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  ------------------
37696|   152k|                break;
37697|   242k|            }
37698|  37.7k|            case JANET_STRUCT: {
  ------------------
  |  Branch (37698:13): [True: 37.7k, False: 2.66M]
  ------------------
37699|  37.7k|                const JanetKV *lhs = janet_unwrap_struct(x);
  ------------------
  |  |  857|  37.7k|#define janet_unwrap_struct(x) ((JanetStruct)janet_nanbox_to_pointer(x))
  ------------------
37700|  37.7k|                const JanetKV *rhs = janet_unwrap_struct(y);
  ------------------
  |  |  857|  37.7k|#define janet_unwrap_struct(x) ((JanetStruct)janet_nanbox_to_pointer(x))
  ------------------
37701|  37.7k|                int32_t llen = janet_struct_capacity(lhs);
  ------------------
  |  | 1849|  37.7k|#define janet_struct_capacity(t) (janet_struct_head(t)->capacity)
  |  |  ------------------
  |  |  |  | 1846|  37.7k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
37702|  37.7k|                int32_t rlen = janet_struct_capacity(rhs);
  ------------------
  |  | 1849|  37.7k|#define janet_struct_capacity(t) (janet_struct_head(t)->capacity)
  |  |  ------------------
  |  |  |  | 1846|  37.7k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
37703|  37.7k|                int32_t lhash = janet_struct_hash(lhs);
  ------------------
  |  | 1850|  37.7k|#define janet_struct_hash(t) (janet_struct_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1846|  37.7k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
37704|  37.7k|                int32_t rhash = janet_struct_hash(rhs);
  ------------------
  |  | 1850|  37.7k|#define janet_struct_hash(t) (janet_struct_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1846|  37.7k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
37705|  37.7k|                if (llen < rlen) return -1;
  ------------------
  |  Branch (37705:21): [True: 17.4k, False: 20.2k]
  ------------------
37706|  20.2k|                if (llen > rlen) return 1;
  ------------------
  |  Branch (37706:21): [True: 4.80k, False: 15.4k]
  ------------------
37707|  15.4k|                if (lhash < rhash) return -1;
  ------------------
  |  Branch (37707:21): [True: 2.99k, False: 12.4k]
  ------------------
37708|  12.4k|                if (lhash > rhash) return 1;
  ------------------
  |  Branch (37708:21): [True: 11.8k, False: 576]
  ------------------
37709|    576|                push_traversal_node(janet_struct_head(lhs), janet_struct_head(rhs), 0);
  ------------------
  |  | 1846|    576|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  ------------------
                              push_traversal_node(janet_struct_head(lhs), janet_struct_head(rhs), 0);
  ------------------
  |  | 1846|    576|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  ------------------
37710|    576|                break;
37711|  12.4k|            }
37712|  2.70M|        }
37713|  2.70M|    } while (!(status = traversal_next(&x, &y)));
  ------------------
  |  Branch (37713:14): [True: 166k, False: 70.5k]
  ------------------
37714|  70.5k|    return status - 2;
37715|  4.42M|}
janet_v_grow:
38119|   226k|void *janet_v_grow(void *v, int32_t increment, int32_t itemsize) {
38120|   226k|    int32_t dbl_cur = (NULL != v) ? 2 * janet_v__cap(v) : 0;
  ------------------
  |  |  742|   201k|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  ------------------
  |  |  |  |  741|   201k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  ------------------
  ------------------
  |  Branch (38120:23): [True: 201k, False: 24.6k]
  ------------------
38121|   226k|    int32_t min_needed = janet_v_count(v) + increment;
  ------------------
  |  |  736|   226k|#define janet_v_count(v)        (((v) != NULL) ? janet_v__cnt(v) : 0)
  |  |  ------------------
  |  |  |  |  743|   201k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  741|   201k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (736:34): [True: 201k, False: 24.6k]
  |  |  ------------------
  ------------------
38122|   226k|    int32_t m = dbl_cur > min_needed ? dbl_cur : min_needed;
  ------------------
  |  Branch (38122:17): [True: 177k, False: 48.6k]
  ------------------
38123|   226k|    size_t newsize = ((size_t) itemsize) * m + sizeof(int32_t) * 2;
38124|   226k|    int32_t *p = (int32_t *) janet_srealloc(v ? janet_v__raw(v) : 0, newsize);
  ------------------
  |  |  741|   201k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  ------------------
  |  Branch (38124:45): [True: 201k, False: 24.6k]
  ------------------
38125|   226k|    if (!v) p[1] = 0;
  ------------------
  |  Branch (38125:9): [True: 24.6k, False: 201k]
  ------------------
38126|   226k|    p[0] = m;
38127|   226k|    return p + 2;
38128|   226k|}
janet_try_init:
39722|  5.06k|void janet_try_init(JanetTryState *state) {
39723|  5.06k|    state->stackn = janet_vm.stackn++;
39724|  5.06k|    state->gc_handle = janet_vm.gc_suspend;
39725|  5.06k|    state->vm_fiber = janet_vm.fiber;
39726|  5.06k|    state->vm_jmp_buf = janet_vm.signal_buf;
39727|  5.06k|    state->vm_return_reg = janet_vm.return_reg;
39728|  5.06k|    state->coerce_error = janet_vm.coerce_error;
39729|  5.06k|    janet_vm.return_reg = &(state->payload);
39730|  5.06k|    janet_vm.signal_buf = &(state->buf);
39731|  5.06k|    janet_vm.coerce_error = 0;
39732|  5.06k|}
janet_restore:
39734|  5.06k|void janet_restore(JanetTryState *state) {
39735|  5.06k|    janet_vm.stackn = state->stackn;
39736|  5.06k|    janet_vm.gc_suspend = state->gc_handle;
39737|  5.06k|    janet_vm.fiber = state->vm_fiber;
39738|  5.06k|    janet_vm.signal_buf = state->vm_jmp_buf;
39739|  5.06k|    janet_vm.return_reg = state->vm_return_reg;
39740|  5.06k|    janet_vm.coerce_error = state->coerce_error;
39741|  5.06k|}
janet_init:
39896|  7.06k|int janet_init(void) {
39897|       |
39898|       |    /* Garbage collection */
39899|  7.06k|    janet_vm.blocks = NULL;
39900|  7.06k|    janet_vm.weak_blocks = NULL;
39901|  7.06k|    janet_vm.next_collection = 0;
39902|  7.06k|    janet_vm.gc_interval = 0x400000;
39903|  7.06k|    janet_vm.block_count = 0;
39904|  7.06k|    janet_vm.gc_mark_phase = 0;
39905|       |
39906|  7.06k|    janet_symcache_init();
39907|       |
39908|       |    /* Initialize gc roots */
39909|  7.06k|    janet_vm.roots = NULL;
39910|  7.06k|    janet_vm.root_count = 0;
39911|  7.06k|    janet_vm.root_capacity = 0;
39912|       |
39913|       |    /* Scratch memory */
39914|  7.06k|    janet_vm.user = NULL;
39915|  7.06k|    janet_vm.scratch_mem = NULL;
39916|  7.06k|    janet_vm.scratch_len = 0;
39917|  7.06k|    janet_vm.scratch_cap = 0;
39918|       |
39919|       |    /* Sandbox flags */
39920|  7.06k|    janet_vm.sandbox_flags = 0;
39921|       |
39922|       |    /* Initialize registry */
39923|  7.06k|    janet_vm.registry = NULL;
39924|  7.06k|    janet_vm.registry_cap = 0;
39925|  7.06k|    janet_vm.registry_count = 0;
39926|  7.06k|    janet_vm.registry_dirty = 0;
39927|       |
39928|       |    /* Initialize abstract registry */
39929|  7.06k|    janet_vm.abstract_registry = janet_table(0);
39930|  7.06k|    janet_gcroot(janet_wrap_table(janet_vm.abstract_registry));
  ------------------
  |  |  846|  7.06k|#define janet_wrap_table(s) janet_nanbox_wrap_((s), JANET_TABLE)
  |  |  ------------------
  |  |  |  |  825|  7.06k|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  7.06k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  7.06k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
39931|       |
39932|       |    /* Traversal */
39933|  7.06k|    janet_vm.traversal = NULL;
39934|  7.06k|    janet_vm.traversal_base = NULL;
39935|  7.06k|    janet_vm.traversal_top = NULL;
39936|       |
39937|       |    /* Core env */
39938|  7.06k|    janet_vm.core_env = NULL;
39939|       |
39940|       |    /* Auto suspension */
39941|  7.06k|    janet_vm.auto_suspend = 0;
39942|       |
39943|       |    /* Dynamic bindings */
39944|  7.06k|    janet_vm.top_dyns = NULL;
39945|       |
39946|       |    /* Seed RNG */
39947|  7.06k|    janet_rng_seed(janet_default_rng(), 0);
39948|       |
39949|       |    /* Fibers */
39950|  7.06k|    janet_vm.fiber = NULL;
39951|  7.06k|    janet_vm.root_fiber = NULL;
39952|  7.06k|    janet_vm.stackn = 0;
39953|       |
39954|  7.06k|#ifdef JANET_EV
39955|  7.06k|    janet_ev_init();
39956|  7.06k|#endif
39957|  7.06k|#ifdef JANET_NET
39958|  7.06k|    janet_net_init();
39959|  7.06k|#endif
39960|  7.06k|    return 0;
39961|  7.06k|}
janet_deinit:
39976|  7.06k|void janet_deinit(void) {
39977|  7.06k|    janet_clear_memory();
39978|  7.06k|    janet_symcache_deinit();
39979|  7.06k|    janet_free(janet_vm.roots);
  ------------------
  |  | 2415|  7.06k|#define janet_free(X) free((X))
  ------------------
39980|  7.06k|    janet_vm.roots = NULL;
39981|  7.06k|    janet_vm.root_count = 0;
39982|  7.06k|    janet_vm.root_capacity = 0;
39983|  7.06k|    janet_vm.abstract_registry = NULL;
39984|  7.06k|    janet_vm.core_env = NULL;
39985|  7.06k|    janet_vm.top_dyns = NULL;
39986|  7.06k|    janet_vm.user = NULL;
39987|  7.06k|    janet_free(janet_vm.traversal_base);
  ------------------
  |  | 2415|  7.06k|#define janet_free(X) free((X))
  ------------------
39988|  7.06k|    janet_vm.fiber = NULL;
39989|  7.06k|    janet_vm.root_fiber = NULL;
39990|  7.06k|    janet_free(janet_vm.registry);
  ------------------
  |  | 2415|  7.06k|#define janet_free(X) free((X))
  ------------------
39991|       |    janet_vm.registry = NULL;
39992|  7.06k|#ifdef JANET_EV
39993|  7.06k|    janet_ev_deinit();
39994|  7.06k|#endif
39995|  7.06k|#ifdef JANET_NET
39996|  7.06k|    janet_net_deinit();
39997|  7.06k|#endif
39998|  7.06k|}
janet_memalloc_empty:
40166|  9.40M|void *janet_memalloc_empty(int32_t count) {
40167|  9.40M|    int32_t i;
40168|  9.40M|    void *mem = array_allocate(sizeof(JanetKV), count);
40169|  9.40M|    janet_vm.next_collection += (size_t) count * sizeof(JanetKV);
40170|  9.40M|    if (NULL == mem) {
  ------------------
  |  Branch (40170:9): [True: 0, False: 9.40M]
  ------------------
40171|      0|        JANET_OUT_OF_MEMORY;
  ------------------
  |  |  419|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (419:122): [Folded, False: 0]
  |  |  ------------------
  ------------------
40172|      0|    }
40173|  9.40M|    JanetKV *mmem = (JanetKV *)mem;
40174|   148M|    for (i = 0; i < count; i++) {
  ------------------
  |  Branch (40174:17): [True: 138M, False: 9.40M]
  ------------------
40175|   138M|        JanetKV *kv = mmem + i;
40176|   138M|        kv->key = janet_wrap_nil();
  ------------------
  |  |  831|   138M|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|   138M|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|   138M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|   138M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
40177|   138M|        kv->value = janet_wrap_nil();
  ------------------
  |  |  831|   138M|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|   138M|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|   138M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|   138M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
40178|   138M|    }
40179|  9.40M|    return mem;
40180|  9.40M|}
janet_memempty:
40182|  54.7k|void janet_memempty(JanetKV *mem, int32_t count) {
40183|  54.7k|    int32_t i;
40184|   934k|    for (i = 0; i < count; i++) {
  ------------------
  |  Branch (40184:17): [True: 879k, False: 54.7k]
  ------------------
40185|   879k|        mem[i].key = janet_wrap_nil();
  ------------------
  |  |  831|   879k|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|   879k|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|   879k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|   879k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
40186|   879k|        mem[i].value = janet_wrap_nil();
  ------------------
  |  |  831|   879k|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|   879k|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|   879k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|   879k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
40187|   879k|    }
40188|  54.7k|}
janet_wrap_number_safe:
40192|  49.4k|Janet janet_wrap_number_safe(double d) {
40193|  49.4k|    Janet ret;
40194|  49.4k|    ret.number = isnan(d) ? NAN : d;
  ------------------
  |  Branch (40194:18): [True: 7.06k, False: 42.3k]
  ------------------
40195|  49.4k|    return ret;
40196|  49.4k|}
janet_nanbox_to_pointer:
40198|   658M|void *janet_nanbox_to_pointer(Janet x) {
40199|   658M|    x.i64 &= JANET_NANBOX_PAYLOADBITS;
  ------------------
  |  |  791|   658M|#define JANET_NANBOX_PAYLOADBITS 0x00007FFFFFFFFFFFllu
  ------------------
40200|   658M|    x.u64 <<= JANET_NANBOX_64_POINTER_SHIFT; /* Alignment, usually 0 */
  ------------------
  |  |  341|   658M|#define JANET_NANBOX_64_POINTER_SHIFT 0
  ------------------
40201|   658M|    return x.pointer;
40202|   658M|}
janet_nanbox_from_pointer:
40204|  10.5M|Janet janet_nanbox_from_pointer(void *p, uint64_t tagmask) {
40205|  10.5M|    Janet ret;
40206|  10.5M|    ret.pointer = p;
40207|       |    /* Should be noop when pointer shift is 0 */
40208|       |    /*
40209|       |    janet_assert(!(ret.u64 & (uint64_t) ((1 << JANET_NANBOX_64_POINTER_SHIFT) - 1)), "unaligned pointer wrap");
40210|       |    */
40211|  10.5M|    ret.u64 >>= JANET_NANBOX_64_POINTER_SHIFT; /* Alignment, usually 0 */
  ------------------
  |  |  341|  10.5M|#define JANET_NANBOX_64_POINTER_SHIFT 0
  ------------------
40212|  10.5M|    ret.u64 |= tagmask;
40213|  10.5M|    return ret;
40214|  10.5M|}
janet_nanbox_from_cpointer:
40216|  44.2M|Janet janet_nanbox_from_cpointer(const void *p, uint64_t tagmask) {
40217|  44.2M|    Janet ret;
40218|  44.2M|    ret.pointer = (void *)p;
40219|       |    /* Should be noop when pointer shift is 0 */
40220|       |    /*
40221|       |    janet_assert(!(ret.u64 & (uint64_t) ((1 << JANET_NANBOX_64_POINTER_SHIFT) - 1)), "unaligned pointer wrap");
40222|       |    */
40223|  44.2M|    ret.u64 >>= JANET_NANBOX_64_POINTER_SHIFT; /* Alignment, usually 0 */
  ------------------
  |  |  341|  44.2M|#define JANET_NANBOX_64_POINTER_SHIFT 0
  ------------------
40224|  44.2M|    ret.u64 |= tagmask;
40225|  44.2M|    return ret;
40226|  44.2M|}
janet_nanbox_from_double:
40228|  68.8M|Janet janet_nanbox_from_double(double d) {
40229|  68.8M|    Janet ret;
40230|  68.8M|    ret.number = d;
40231|  68.8M|    return ret;
40232|  68.8M|}
janet_nanbox_from_bits:
40234|  1.22G|Janet janet_nanbox_from_bits(uint64_t bits) {
40235|  1.22G|    Janet ret;
40236|  1.22G|    ret.u64 = bits;
40237|  1.22G|    return ret;
40238|  1.22G|}
janet.c:janet_array_impl:
 1589|  26.1k|static void janet_array_impl(JanetArray *array, int32_t capacity) {
 1590|  26.1k|    Janet *data = NULL;
 1591|  26.1k|    if (capacity > 0) {
  ------------------
  |  Branch (1591:9): [True: 21.3k, False: 4.77k]
  ------------------
 1592|  21.3k|        janet_vm.next_collection += capacity * sizeof(Janet);
 1593|  21.3k|        data = (Janet *) array_allocate(sizeof(Janet), capacity);
 1594|  21.3k|        if (NULL == data) {
  ------------------
  |  Branch (1594:13): [True: 0, False: 21.3k]
  ------------------
 1595|      0|            JANET_OUT_OF_MEMORY;
  ------------------
  |  |  419|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (419:122): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1596|      0|        }
 1597|  21.3k|    }
 1598|  26.1k|    array->count = 0;
 1599|  26.1k|    array->capacity = capacity;
 1600|  26.1k|    array->data = data;
 1601|  26.1k|}
janet.c:janet_buffer_init_impl:
 3189|  19.5M|static JanetBuffer *janet_buffer_init_impl(JanetBuffer *buffer, int32_t capacity) {
 3190|  19.5M|    uint8_t *data = NULL;
 3191|  19.5M|    if (capacity < 4) capacity = 4;
  ------------------
  |  Branch (3191:9): [True: 7.46k, False: 19.5M]
  ------------------
 3192|  19.5M|    janet_gcpressure(capacity);
 3193|  19.5M|    data = array_allocate(sizeof(uint8_t), capacity);
 3194|  19.5M|    if (NULL == data) {
  ------------------
  |  Branch (3194:9): [True: 0, False: 19.5M]
  ------------------
 3195|      0|        JANET_OUT_OF_MEMORY;
  ------------------
  |  |  419|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (419:122): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3196|      0|    }
 3197|  19.5M|    buffer->count = 0;
 3198|  19.5M|    buffer->capacity = capacity;
 3199|  19.5M|    buffer->data = data;
 3200|  19.5M|    return buffer;
 3201|  19.5M|}
janet.c:janet_buffer_can_realloc:
 3182|  22.4M|static void janet_buffer_can_realloc(JanetBuffer *buffer) {
 3183|  22.4M|    if (buffer->gc.flags & JANET_BUFFER_FLAG_NO_REALLOC) {
  ------------------
  |  | 1780|  22.4M|#define JANET_BUFFER_FLAG_NO_REALLOC 0x10000
  ------------------
  |  Branch (3183:9): [True: 0, False: 22.4M]
  ------------------
 3184|      0|        janet_panic("buffer cannot reallocate pinned memory");
 3185|      0|    }
 3186|  22.4M|}
janet.c:janet_load_libs:
 9395|  7.06k|static void janet_load_libs(JanetTable *env) {
 9396|  7.06k|    JanetRegExt corelib_cfuns[] = {
 9397|  7.06k|        JANET_CORE_REG("native", janet_core_native),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9398|  7.06k|        JANET_CORE_REG("describe", janet_core_describe),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9399|  7.06k|        JANET_CORE_REG("string", janet_core_string),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9400|  7.06k|        JANET_CORE_REG("symbol", janet_core_symbol),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9401|  7.06k|        JANET_CORE_REG("keyword", janet_core_keyword),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9402|  7.06k|        JANET_CORE_REG("buffer", janet_core_buffer),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9403|  7.06k|        JANET_CORE_REG("abstract?", janet_core_is_abstract),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9404|  7.06k|        JANET_CORE_REG("table", janet_core_table),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9405|  7.06k|        JANET_CORE_REG("array", janet_core_array),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9406|  7.06k|        JANET_CORE_REG("scan-number", janet_core_scannumber),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9407|  7.06k|        JANET_CORE_REG("tuple", janet_core_tuple),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9408|  7.06k|        JANET_CORE_REG("struct", janet_core_struct),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9409|  7.06k|        JANET_CORE_REG("gensym", janet_core_gensym),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9410|  7.06k|        JANET_CORE_REG("gccollect", janet_core_gccollect),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9411|  7.06k|        JANET_CORE_REG("gcsetinterval", janet_core_gcsetinterval),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9412|  7.06k|        JANET_CORE_REG("gcinterval", janet_core_gcinterval),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9413|  7.06k|        JANET_CORE_REG("type", janet_core_type),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9414|  7.06k|        JANET_CORE_REG("hash", janet_core_hash),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9415|  7.06k|        JANET_CORE_REG("getline", janet_core_getline),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9416|  7.06k|        JANET_CORE_REG("dyn", janet_core_dyn),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9417|  7.06k|        JANET_CORE_REG("setdyn", janet_core_setdyn),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9418|  7.06k|        JANET_CORE_REG("trace", janet_core_trace),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9419|  7.06k|        JANET_CORE_REG("untrace", janet_core_untrace),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9420|  7.06k|        JANET_CORE_REG("module/expand-path", janet_core_expand_path),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9421|  7.06k|        JANET_CORE_REG("int?", janet_core_check_int),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9422|  7.06k|        JANET_CORE_REG("nat?", janet_core_check_nat),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9423|  7.06k|        JANET_CORE_REG("bytes?", janet_core_is_bytes),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9424|  7.06k|        JANET_CORE_REG("indexed?", janet_core_is_indexed),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9425|  7.06k|        JANET_CORE_REG("dictionary?", janet_core_is_dictionary),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9426|  7.06k|        JANET_CORE_REG("lengthable?", janet_core_is_lengthable),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9427|  7.06k|        JANET_CORE_REG("slice", janet_core_slice),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9428|  7.06k|        JANET_CORE_REG("range", janet_core_range),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9429|  7.06k|        JANET_CORE_REG("signal", janet_core_signal),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9430|  7.06k|        JANET_CORE_REG("memcmp", janet_core_memcmp),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9431|  7.06k|        JANET_CORE_REG("getproto", janet_core_getproto),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9432|  7.06k|        JANET_CORE_REG("sandbox", janet_core_sandbox),
  ------------------
  |  |  489|  7.06k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  7.06k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9433|  7.06k|        JANET_REG_END
  ------------------
  |  | 2110|  7.06k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
 9434|  7.06k|    };
 9435|       |    janet_core_cfuns_ext(env, NULL, corelib_cfuns);
 9436|  7.06k|    janet_lib_io(env);
 9437|  7.06k|    janet_lib_math(env);
 9438|  7.06k|    janet_lib_array(env);
 9439|  7.06k|    janet_lib_tuple(env);
 9440|  7.06k|    janet_lib_buffer(env);
 9441|  7.06k|    janet_lib_table(env);
 9442|  7.06k|    janet_lib_struct(env);
 9443|  7.06k|    janet_lib_fiber(env);
 9444|  7.06k|    janet_lib_os(env);
 9445|  7.06k|    janet_lib_parse(env);
 9446|  7.06k|    janet_lib_compile(env);
 9447|  7.06k|    janet_lib_debug(env);
 9448|  7.06k|    janet_lib_string(env);
 9449|  7.06k|    janet_lib_marsh(env);
 9450|  7.06k|#ifdef JANET_PEG
 9451|  7.06k|    janet_lib_peg(env);
 9452|  7.06k|#endif
 9453|  7.06k|#ifdef JANET_ASSEMBLER
 9454|  7.06k|    janet_lib_asm(env);
 9455|  7.06k|#endif
 9456|  7.06k|#ifdef JANET_INT_TYPES
 9457|  7.06k|    janet_lib_inttypes(env);
 9458|  7.06k|#endif
 9459|  7.06k|#ifdef JANET_EV
 9460|  7.06k|    janet_lib_ev(env);
 9461|  7.06k|#ifdef JANET_FILEWATCH
 9462|  7.06k|    janet_lib_filewatch(env);
 9463|  7.06k|#endif
 9464|  7.06k|#endif
 9465|  7.06k|#ifdef JANET_NET
 9466|  7.06k|    janet_lib_net(env);
 9467|  7.06k|#endif
 9468|  7.06k|#ifdef JANET_FFI
 9469|  7.06k|    janet_lib_ffi(env);
 9470|  7.06k|#endif
 9471|  7.06k|}
janet.c:janet_q_init:
10715|  7.06k|static void janet_q_init(JanetQueue *q) {
10716|       |    q->data = NULL;
10717|  7.06k|    q->head = 0;
10718|  7.06k|    q->tail = 0;
10719|  7.06k|    q->capacity = 0;
10720|  7.06k|}
janet.c:peek_timeout:
10797|  7.06k|static int peek_timeout(JanetTimeout *out) {
10798|  7.06k|    if (janet_vm.tq_count == 0) return 0;
  ------------------
  |  Branch (10798:9): [True: 7.06k, False: 0]
  ------------------
10799|      0|    *out = janet_vm.tq[0];
10800|      0|    return 1;
10801|  7.06k|}
janet.c:janet_q_deinit:
10722|  7.06k|static void janet_q_deinit(JanetQueue *q) {
10723|  7.06k|    janet_free(q->data);
  ------------------
  |  | 2415|  7.06k|#define janet_free(X) free((X))
  ------------------
10724|  7.06k|}
janet.c:janet_ev_setup_selfpipe:
12285|  7.06k|static void janet_ev_setup_selfpipe(void) {
12286|  7.06k|    if (janet_make_pipe(janet_vm.selfpipe, 1)) {
  ------------------
  |  Branch (12286:9): [True: 0, False: 7.06k]
  ------------------
12287|       |        JANET_EXIT("failed to initialize self pipe in event loop");
  ------------------
  |  |  378|      0|#define JANET_EXIT(m) do { \
  |  |  379|      0|    fprintf(stderr, "janet abort at %s:%d: %s\n",\
  |  |  380|      0|        __FILE__,\
  |  |  381|      0|        __LINE__,\
  |  |  382|      0|        (m));\
  |  |  383|      0|    abort();\
  |  |  384|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (384:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
12288|      0|    }
12289|  7.06k|}
janet.c:janet_ev_cleanup_selfpipe:
12308|  7.06k|static void janet_ev_cleanup_selfpipe(void) {
12309|  7.06k|    close(janet_vm.selfpipe[0]);
12310|  7.06k|    close(janet_vm.selfpipe[1]);
12311|  7.06k|}
janet.c:janet_deinit_block:
18318|  50.1M|static void janet_deinit_block(JanetGCObject *mem) {
18319|  50.1M|    switch (mem->flags & JANET_MEM_TYPEBITS) {
  ------------------
  |  |  652|  50.1M|#define JANET_MEM_TYPEBITS 0xFF
  ------------------
18320|  24.1M|        default:
  ------------------
  |  Branch (18320:9): [True: 24.1M, False: 25.9M]
  ------------------
18321|  26.9M|        case JANET_MEMORY_FUNCTION:
  ------------------
  |  Branch (18321:9): [True: 2.70M, False: 47.4M]
  ------------------
18322|  26.9M|            break; /* Do nothing for non gc types */
18323|  14.1M|        case JANET_MEMORY_SYMBOL:
  ------------------
  |  Branch (18323:9): [True: 14.1M, False: 36.0M]
  ------------------
18324|  14.1M|            janet_symbol_deinit(((JanetStringHead *) mem)->data);
18325|  14.1M|            break;
18326|  26.1k|        case JANET_MEMORY_ARRAY:
  ------------------
  |  Branch (18326:9): [True: 26.1k, False: 50.1M]
  ------------------
18327|  26.1k|        case JANET_MEMORY_ARRAY_WEAK:
  ------------------
  |  Branch (18327:9): [True: 0, False: 50.1M]
  ------------------
18328|  26.1k|            janet_free(((JanetArray *) mem)->data);
  ------------------
  |  | 2415|  26.1k|#define janet_free(X) free((X))
  ------------------
18329|  26.1k|            break;
18330|  5.18M|        case JANET_MEMORY_TABLE:
  ------------------
  |  Branch (18330:9): [True: 5.18M, False: 44.9M]
  ------------------
18331|  5.18M|        case JANET_MEMORY_TABLE_WEAKK:
  ------------------
  |  Branch (18331:9): [True: 0, False: 50.1M]
  ------------------
18332|  5.18M|        case JANET_MEMORY_TABLE_WEAKV:
  ------------------
  |  Branch (18332:9): [True: 0, False: 50.1M]
  ------------------
18333|  5.18M|        case JANET_MEMORY_TABLE_WEAKKV:
  ------------------
  |  Branch (18333:9): [True: 0, False: 50.1M]
  ------------------
18334|  5.18M|            janet_free(((JanetTable *) mem)->data);
  ------------------
  |  | 2415|  5.18M|#define janet_free(X) free((X))
  ------------------
18335|  5.18M|            break;
18336|      0|        case JANET_MEMORY_FIBER: {
  ------------------
  |  Branch (18336:9): [True: 0, False: 50.1M]
  ------------------
18337|      0|            JanetFiber *f = (JanetFiber *)mem;
18338|      0|#ifdef JANET_EV
18339|      0|            if (f->ev_state && !(f->flags & JANET_FIBER_EV_FLAG_IN_FLIGHT)) {
  ------------------
  |  |  824|      0|#define JANET_FIBER_EV_FLAG_IN_FLIGHT 0x1
  ------------------
  |  Branch (18339:17): [True: 0, False: 0]
  |  Branch (18339:32): [True: 0, False: 0]
  ------------------
18340|      0|                janet_ev_dec_refcount();
18341|      0|                janet_free(f->ev_state);
  ------------------
  |  | 2415|      0|#define janet_free(X) free((X))
  ------------------
18342|      0|            } else if (f->gc.flags & JANET_FIBER_EV_GCFLAG_SUSPENDED) {
  ------------------
  |  |  820|      0|#define JANET_FIBER_EV_GCFLAG_SUSPENDED 0x2000000
  ------------------
  |  Branch (18342:24): [True: 0, False: 0]
  ------------------
18343|      0|                janet_ev_dec_refcount();
18344|      0|            }
18345|      0|#endif
18346|      0|            janet_free(f->data);
  ------------------
  |  | 2415|      0|#define janet_free(X) free((X))
  ------------------
18347|      0|        }
18348|      0|        break;
18349|  13.6k|        case JANET_MEMORY_BUFFER:
  ------------------
  |  Branch (18349:9): [True: 13.6k, False: 50.1M]
  ------------------
18350|  13.6k|            janet_buffer_deinit((JanetBuffer *) mem);
18351|  13.6k|            break;
18352|  28.1k|        case JANET_MEMORY_ABSTRACT: {
  ------------------
  |  Branch (18352:9): [True: 28.1k, False: 50.1M]
  ------------------
18353|  28.1k|            JanetAbstractHead *head = (JanetAbstractHead *)mem;
18354|  28.1k|            if (head->type->gcperthread) {
  ------------------
  |  Branch (18354:17): [True: 0, False: 28.1k]
  ------------------
18355|      0|                janet_assert(!head->type->gcperthread(head->data, head->size), "per-thread finalizer failed");
  ------------------
  |  |  389|      0|#define janet_assert(c, m) do { \
  |  |  390|      0|    if (!(c)) JANET_EXIT((m)); \
  |  |  ------------------
  |  |  |  |  378|      0|#define JANET_EXIT(m) do { \
  |  |  |  |  379|      0|    fprintf(stderr, "janet abort at %s:%d: %s\n",\
  |  |  |  |  380|      0|        __FILE__,\
  |  |  |  |  381|      0|        __LINE__,\
  |  |  |  |  382|      0|        (m));\
  |  |  |  |  383|      0|    abort();\
  |  |  |  |  384|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (384:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (390:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  391|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (391:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
18356|      0|            }
18357|  28.1k|            if (head->type->gc) {
  ------------------
  |  Branch (18357:17): [True: 21.1k, False: 6.92k]
  ------------------
18358|  21.1k|                janet_assert(!head->type->gc(head->data, head->size), "finalizer failed");
  ------------------
  |  |  389|  21.1k|#define janet_assert(c, m) do { \
  |  |  390|  21.1k|    if (!(c)) JANET_EXIT((m)); \
  |  |  ------------------
  |  |  |  |  378|      0|#define JANET_EXIT(m) do { \
  |  |  |  |  379|      0|    fprintf(stderr, "janet abort at %s:%d: %s\n",\
  |  |  |  |  380|      0|        __FILE__,\
  |  |  |  |  381|      0|        __LINE__,\
  |  |  |  |  382|      0|        (m));\
  |  |  |  |  383|      0|    abort();\
  |  |  |  |  384|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (384:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (390:9): [True: 0, False: 21.1k]
  |  |  ------------------
  |  |  391|  21.1k|} while (0)
  |  |  ------------------
  |  |  |  Branch (391:10): [Folded, False: 21.1k]
  |  |  ------------------
  ------------------
18359|  21.1k|            }
18360|  28.1k|        }
18361|  28.1k|        break;
18362|  56.4k|        case JANET_MEMORY_FUNCENV: {
  ------------------
  |  Branch (18362:9): [True: 56.4k, False: 50.1M]
  ------------------
18363|  56.4k|            JanetFuncEnv *env = (JanetFuncEnv *)mem;
18364|  56.4k|            if (0 == env->offset)
  ------------------
  |  Branch (18364:17): [True: 56.4k, False: 0]
  ------------------
18365|  56.4k|                janet_free(env->as.values);
  ------------------
  |  | 2415|  56.4k|#define janet_free(X) free((X))
  ------------------
18366|  56.4k|        }
18367|  56.4k|        break;
18368|  3.79M|        case JANET_MEMORY_FUNCDEF: {
  ------------------
  |  Branch (18368:9): [True: 3.79M, False: 46.3M]
  ------------------
18369|  3.79M|            JanetFuncDef *def = (JanetFuncDef *)mem;
18370|       |            /* TODO - get this all with one alloc and one free */
18371|  3.79M|            janet_free(def->defs);
  ------------------
  |  | 2415|  3.79M|#define janet_free(X) free((X))
  ------------------
18372|  3.79M|            janet_free(def->environments);
  ------------------
  |  | 2415|  3.79M|#define janet_free(X) free((X))
  ------------------
18373|  3.79M|            janet_free(def->constants);
  ------------------
  |  | 2415|  3.79M|#define janet_free(X) free((X))
  ------------------
18374|  3.79M|            janet_free(def->bytecode);
  ------------------
  |  | 2415|  3.79M|#define janet_free(X) free((X))
  ------------------
18375|  3.79M|            janet_free(def->sourcemap);
  ------------------
  |  | 2415|  3.79M|#define janet_free(X) free((X))
  ------------------
18376|  3.79M|            janet_free(def->closure_bitset);
  ------------------
  |  | 2415|  3.79M|#define janet_free(X) free((X))
  ------------------
18377|  3.79M|            janet_free(def->symbolmap);
  ------------------
  |  | 2415|  3.79M|#define janet_free(X) free((X))
  ------------------
18378|  3.79M|        }
18379|  3.79M|        break;
18380|  50.1M|    }
18381|  50.1M|}
janet.c:janet_free_all_scratch:
18568|  7.06k|static void janet_free_all_scratch(void) {
18569|  4.72M|    for (size_t i = 0; i < janet_vm.scratch_len; i++) {
  ------------------
  |  Branch (18569:24): [True: 4.72M, False: 7.06k]
  ------------------
18570|  4.72M|        free_one_scratch(janet_vm.scratch_mem[i]);
18571|  4.72M|    }
18572|  7.06k|    janet_vm.scratch_len = 0;
18573|  7.06k|}
janet.c:janet_mem2scratch:
18575|  21.7M|static JanetScratch *janet_mem2scratch(void *mem) {
18576|  21.7M|    JanetScratch *s = (JanetScratch *)mem;
18577|  21.7M|    return s - 1;
18578|  21.7M|}
janet.c:free_one_scratch:
18560|  25.6M|static void free_one_scratch(JanetScratch *s) {
18561|  25.6M|    if (NULL != s->finalize) {
  ------------------
  |  Branch (18561:9): [True: 0, False: 25.6M]
  ------------------
18562|      0|        s->finalize((char *) s->mem);
18563|      0|    }
18564|  25.6M|    janet_free(s);
  ------------------
  |  | 2415|  25.6M|#define janet_free(X) free((X))
  ------------------
18565|  25.6M|}
janet.c:it_s64_tostring:
18861|  62.4k|static void it_s64_tostring(void *p, JanetBuffer *buffer) {
18862|  62.4k|    char str[32];
18863|       |    snprintf(str, sizeof(str), "%" PRId64, *((int64_t *)p));
18864|  62.4k|    janet_buffer_push_cstring(buffer, str);
18865|  62.4k|}
janet.c:janet_int64_compare:
18838|  2.46k|static int janet_int64_compare(void *p1, void *p2) {
18839|  2.46k|    int64_t x = *((int64_t *)p1);
18840|  2.46k|    int64_t y = *((int64_t *)p2);
18841|  2.46k|    return x == y ? 0 : x < y ? -1 : 1;
  ------------------
  |  Branch (18841:12): [True: 86, False: 2.37k]
  |  Branch (18841:25): [True: 109, False: 2.26k]
  ------------------
18842|  2.46k|}
janet.c:janet_int64_hash:
18832|  1.68M|static int32_t janet_int64_hash(void *p1, size_t size) {
18833|  1.68M|    (void) size;
18834|  1.68M|    int32_t *words = p1;
18835|  1.68M|    return words[0] ^ words[1];
18836|  1.68M|}
janet.c:it_u64_tostring:
18867|   499k|static void it_u64_tostring(void *p, JanetBuffer *buffer) {
18868|   499k|    char str[32];
18869|       |    snprintf(str, sizeof(str), "%" PRIu64, *((uint64_t *)p));
18870|   499k|    janet_buffer_push_cstring(buffer, str);
18871|   499k|}
janet.c:janet_uint64_compare:
18844|  1.71k|static int janet_uint64_compare(void *p1, void *p2) {
18845|  1.71k|    uint64_t x = *((uint64_t *)p1);
18846|  1.71k|    uint64_t y = *((uint64_t *)p2);
18847|  1.71k|    return x == y ? 0 : x < y ? -1 : 1;
  ------------------
  |  Branch (18847:12): [True: 145, False: 1.56k]
  |  Branch (18847:25): [True: 133, False: 1.43k]
  ------------------
18848|  1.71k|}
janet.c:makef:
19596|  21.1k|static void *makef(FILE *f, int32_t flags, size_t bufsize) {
19597|  21.1k|    JanetFile *iof = (JanetFile *) janet_abstract(&janet_file_type, sizeof(JanetFile));
19598|  21.1k|    iof->file = f;
19599|  21.1k|    iof->flags = flags;
19600|  21.1k|    iof->vbufsize = bufsize;
19601|  21.1k|#if !(defined(JANET_WINDOWS) || defined(JANET_PLAN9))
19602|       |    /* While we would like fopen to set cloexec by default (like O_CLOEXEC) with the e flag, that is
19603|       |     * not standard. */
19604|  21.1k|    if (!(flags & JANET_FILE_NOT_CLOSEABLE))
  ------------------
  |  | 2278|  21.1k|#define JANET_FILE_NOT_CLOSEABLE 16
  ------------------
  |  Branch (19604:9): [True: 0, False: 21.1k]
  ------------------
19605|      0|        fcntl(fileno(f), F_SETFD, FD_CLOEXEC);
19606|  21.1k|#endif
19607|  21.1k|    return iof;
19608|  21.1k|}
janet.c:cfun_io_gc:
19804|  21.1k|static int cfun_io_gc(void *p, size_t len) {
19805|  21.1k|    (void) len;
19806|  21.1k|    JanetFile *iof = (JanetFile *)p;
19807|  21.1k|    janet_file_close(iof);
19808|  21.1k|    return 0;
19809|  21.1k|}
janet.c:readint:
21088|   480M|static int32_t readint(UnmarshalState *st, const uint8_t **atdata) {
21089|   480M|    const uint8_t *data = *atdata;
21090|   480M|    int32_t ret;
21091|   480M|    MARSH_EOS(st, data);
  ------------------
  |  |21083|   480M|#define MARSH_EOS(st, data) do { \
  |  |21084|   480M|    if ((data) >= (st)->end) janet_panic("unexpected end of source");\
  |  |  ------------------
  |  |  |  Branch (21084:9): [True: 0, False: 480M]
  |  |  ------------------
  |  |21085|   480M|} while (0)
  |  |  ------------------
  |  |  |  Branch (21085:10): [Folded, False: 480M]
  |  |  ------------------
  ------------------
21092|   480M|    if (*data < 128) {
  ------------------
  |  Branch (21092:9): [True: 391M, False: 89.0M]
  ------------------
21093|   391M|        ret = *data++;
21094|   391M|    } else if (*data < 192) {
  ------------------
  |  Branch (21094:16): [True: 84.0M, False: 4.99M]
  ------------------
21095|  84.0M|        MARSH_EOS(st, data + 1);
  ------------------
  |  |21083|  84.0M|#define MARSH_EOS(st, data) do { \
  |  |21084|  84.0M|    if ((data) >= (st)->end) janet_panic("unexpected end of source");\
  |  |  ------------------
  |  |  |  Branch (21084:9): [True: 0, False: 84.0M]
  |  |  ------------------
  |  |21085|  84.0M|} while (0)
  |  |  ------------------
  |  |  |  Branch (21085:10): [Folded, False: 84.0M]
  |  |  ------------------
  ------------------
21096|  84.0M|        uint32_t uret = ((data[0] & 0x3F) << 8) + data[1];
21097|       |        /* Sign extend 18 MSBs */
21098|  84.0M|        uret |= (uret >> 13) ? 0xFFFFC000 : 0;
  ------------------
  |  Branch (21098:17): [True: 23.5M, False: 60.4M]
  ------------------
21099|  84.0M|        ret = (int32_t)uret;
21100|  84.0M|        data += 2;
21101|  84.0M|    } else if (*data == LB_INTEGER) {
  ------------------
  |  Branch (21101:16): [True: 4.99M, False: 0]
  ------------------
21102|  4.99M|        MARSH_EOS(st, data + 4);
  ------------------
  |  |21083|  4.99M|#define MARSH_EOS(st, data) do { \
  |  |21084|  4.99M|    if ((data) >= (st)->end) janet_panic("unexpected end of source");\
  |  |  ------------------
  |  |  |  Branch (21084:9): [True: 0, False: 4.99M]
  |  |  ------------------
  |  |21085|  4.99M|} while (0)
  |  |  ------------------
  |  |  |  Branch (21085:10): [Folded, False: 4.99M]
  |  |  ------------------
  ------------------
21103|  4.99M|        uint32_t ui = ((uint32_t)(data[1]) << 24) |
21104|  4.99M|                      ((uint32_t)(data[2]) << 16) |
21105|  4.99M|                      ((uint32_t)(data[3]) << 8) |
21106|  4.99M|                      (uint32_t)(data[4]);
21107|  4.99M|        ret = (int32_t)ui;
21108|  4.99M|        data += 5;
21109|  4.99M|    } else {
21110|      0|        janet_panicf("expected integer, got byte %x at index %d",
21111|      0|                     *data,
21112|      0|                     data - st->start);
21113|      0|        ret = 0;
21114|      0|    }
21115|   480M|    *atdata = data;
21116|   480M|    return ret;
21117|   480M|}
janet.c:unmarshal_one:
21710|   128M|    int flags) {
21711|   128M|    uint8_t lead;
21712|   128M|    MARSH_STACKCHECK;
  ------------------
  |  |20555|   128M|#define MARSH_STACKCHECK if ((flags & 0xFFFF) > JANET_RECURSION_GUARD) janet_panic("stack overflow")
  |  |  ------------------
  |  |  |  |  296|   128M|#define JANET_RECURSION_GUARD 1024
  |  |  ------------------
  |  |  |  Branch (20555:30): [True: 0, False: 128M]
  |  |  ------------------
  ------------------
21713|   128M|    MARSH_EOS(st, data);
  ------------------
  |  |21083|   128M|#define MARSH_EOS(st, data) do { \
  |  |21084|   128M|    if ((data) >= (st)->end) janet_panic("unexpected end of source");\
  |  |  ------------------
  |  |  |  Branch (21084:9): [True: 0, False: 128M]
  |  |  ------------------
  |  |21085|   128M|} while (0)
  |  |  ------------------
  |  |  |  Branch (21085:10): [Folded, False: 128M]
  |  |  ------------------
  ------------------
21714|   128M|    lead = data[0];
21715|   128M|    if (lead < LB_REAL) {
  ------------------
  |  Branch (21715:9): [True: 9.75M, False: 118M]
  ------------------
21716|  9.75M|        *out = janet_wrap_integer(readint(st, &data));
  ------------------
  |  |  967|  9.75M|#define janet_wrap_integer(x) janet_wrap_number((int32_t)(x))
  |  |  ------------------
  |  |  |  |  835|  9.75M|#define janet_wrap_number(r) janet_nanbox_from_double(r)
  |  |  ------------------
  ------------------
21717|  9.75M|        return data;
21718|  9.75M|    }
21719|   118M|    switch (lead) {
21720|   388k|        case LB_NIL:
  ------------------
  |  Branch (21720:9): [True: 388k, False: 118M]
  ------------------
21721|   388k|            *out = janet_wrap_nil();
  ------------------
  |  |  831|   388k|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|   388k|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|   388k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|   388k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21722|   388k|            return data + 1;
21723|      0|        case LB_FALSE:
  ------------------
  |  Branch (21723:9): [True: 0, False: 118M]
  ------------------
21724|      0|            *out = janet_wrap_false();
  ------------------
  |  |  833|      0|#define janet_wrap_false() janet_nanbox_from_payload(JANET_BOOLEAN, 0)
  |  |  ------------------
  |  |  |  |  822|      0|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21725|      0|            return data + 1;
21726|   939k|        case LB_TRUE:
  ------------------
  |  Branch (21726:9): [True: 939k, False: 117M]
  ------------------
21727|   939k|            *out = janet_wrap_true();
  ------------------
  |  |  832|   939k|#define janet_wrap_true() janet_nanbox_from_payload(JANET_BOOLEAN, 1)
  |  |  ------------------
  |  |  |  |  822|   939k|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|   939k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|   939k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21728|   939k|            return data + 1;
21729|  21.1k|        case LB_INTEGER:
  ------------------
  |  Branch (21729:9): [True: 21.1k, False: 118M]
  ------------------
21730|       |            /* Long integer */
21731|  21.1k|            MARSH_EOS(st, data + 4);
  ------------------
  |  |21083|  21.1k|#define MARSH_EOS(st, data) do { \
  |  |21084|  21.1k|    if ((data) >= (st)->end) janet_panic("unexpected end of source");\
  |  |  ------------------
  |  |  |  Branch (21084:9): [True: 0, False: 21.1k]
  |  |  ------------------
  |  |21085|  21.1k|} while (0)
  |  |  ------------------
  |  |  |  Branch (21085:10): [Folded, False: 21.1k]
  |  |  ------------------
  ------------------
21732|  21.1k|            uint32_t ui = ((uint32_t)(data[4])) |
21733|  21.1k|                          ((uint32_t)(data[3]) << 8) |
21734|  21.1k|                          ((uint32_t)(data[2]) << 16) |
21735|  21.1k|                          ((uint32_t)(data[1]) << 24);
21736|  21.1k|            int32_t si = (int32_t)ui;
21737|  21.1k|            *out = janet_wrap_integer(si);
  ------------------
  |  |  967|  21.1k|#define janet_wrap_integer(x) janet_wrap_number((int32_t)(x))
  |  |  ------------------
  |  |  |  |  835|  21.1k|#define janet_wrap_number(r) janet_nanbox_from_double(r)
  |  |  ------------------
  ------------------
21738|  21.1k|            return data + 5;
21739|  49.4k|        case LB_REAL:
  ------------------
  |  Branch (21739:9): [True: 49.4k, False: 118M]
  ------------------
21740|       |            /* Real */
21741|  49.4k|        {
21742|  49.4k|            union {
21743|  49.4k|                double d;
21744|  49.4k|                uint8_t bytes[8];
21745|  49.4k|            } u;
21746|  49.4k|            MARSH_EOS(st, data + 8);
  ------------------
  |  |21083|  49.4k|#define MARSH_EOS(st, data) do { \
  |  |21084|  49.4k|    if ((data) >= (st)->end) janet_panic("unexpected end of source");\
  |  |  ------------------
  |  |  |  Branch (21084:9): [True: 0, False: 49.4k]
  |  |  ------------------
  |  |21085|  49.4k|} while (0)
  |  |  ------------------
  |  |  |  Branch (21085:10): [Folded, False: 49.4k]
  |  |  ------------------
  ------------------
21747|       |#ifdef JANET_BIG_ENDIAN
21748|       |            u.bytes[0] = data[8];
21749|       |            u.bytes[1] = data[7];
21750|       |            u.bytes[2] = data[6];
21751|       |            u.bytes[3] = data[5];
21752|       |            u.bytes[4] = data[4];
21753|       |            u.bytes[5] = data[3];
21754|       |            u.bytes[6] = data[2];
21755|       |            u.bytes[7] = data[1];
21756|       |#else
21757|  49.4k|            memcpy(&u.bytes, data + 1, sizeof(double));
21758|  49.4k|#endif
21759|  49.4k|            *out = janet_wrap_number_safe(u.d);
21760|  49.4k|            janet_v_push(st->lookup, *out);
  ------------------
  |  |  734|  49.4k|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  746|  49.4k|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  745|  49.4k|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  743|  49.4k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|  49.4k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  742|  49.4k|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|  49.4k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (745:35): [True: 0, False: 49.4k]
  |  |  |  |  |  |  |  Branch (745:50): [True: 0, False: 49.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  747|      0|#define janet_v__grow(v, n)      ((v) = janet_v_grow((v), (n), sizeof(*(v))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  743|  49.4k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  741|  49.4k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21761|  49.4k|            return data + 9;
21762|  49.4k|        }
21763|  10.4M|        case LB_STRING:
  ------------------
  |  Branch (21763:9): [True: 10.4M, False: 108M]
  ------------------
21764|  23.6M|        case LB_SYMBOL:
  ------------------
  |  Branch (21764:9): [True: 13.2M, False: 105M]
  ------------------
21765|  23.6M|        case LB_BUFFER:
  ------------------
  |  Branch (21765:9): [True: 7.06k, False: 118M]
  ------------------
21766|  25.3M|        case LB_KEYWORD:
  ------------------
  |  Branch (21766:9): [True: 1.68M, False: 116M]
  ------------------
21767|  27.8M|        case LB_REGISTRY: {
  ------------------
  |  Branch (21767:9): [True: 2.50M, False: 116M]
  ------------------
21768|  27.8M|            data++;
21769|  27.8M|            int32_t len = readnat(st, &data);
21770|  27.8M|            MARSH_EOS(st, data - 1 + len);
  ------------------
  |  |21083|  27.8M|#define MARSH_EOS(st, data) do { \
  |  |21084|  27.8M|    if ((data) >= (st)->end) janet_panic("unexpected end of source");\
  |  |  ------------------
  |  |  |  Branch (21084:9): [True: 0, False: 27.8M]
  |  |  ------------------
  |  |21085|  27.8M|} while (0)
  |  |  ------------------
  |  |  |  Branch (21085:10): [Folded, False: 27.8M]
  |  |  ------------------
  ------------------
21771|  27.8M|            if (lead == LB_STRING) {
  ------------------
  |  Branch (21771:17): [True: 10.4M, False: 17.4M]
  ------------------
21772|  10.4M|                const uint8_t *str = janet_string(data, len);
21773|  10.4M|                *out = janet_wrap_string(str);
  ------------------
  |  |  848|  10.4M|#define janet_wrap_string(s) janet_nanbox_wrap_c((s), JANET_STRING)
  |  |  ------------------
  |  |  |  |  828|  10.4M|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  10.4M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  10.4M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21774|  17.4M|            } else if (lead == LB_SYMBOL) {
  ------------------
  |  Branch (21774:24): [True: 13.2M, False: 4.19M]
  ------------------
21775|  13.2M|                const uint8_t *str = janet_symbol(data, len);
21776|  13.2M|                *out = janet_wrap_symbol(str);
  ------------------
  |  |  849|  13.2M|#define janet_wrap_symbol(s) janet_nanbox_wrap_c((s), JANET_SYMBOL)
  |  |  ------------------
  |  |  |  |  828|  13.2M|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  13.2M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  13.2M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21777|  13.2M|            } else if (lead == LB_KEYWORD) {
  ------------------
  |  Branch (21777:24): [True: 1.68M, False: 2.51M]
  ------------------
21778|  1.68M|                const uint8_t *str = janet_keyword(data, len);
  ------------------
  |  | 1840|  1.68M|#define janet_keyword janet_symbol
  ------------------
21779|  1.68M|                *out = janet_wrap_keyword(str);
  ------------------
  |  |  850|  1.68M|#define janet_wrap_keyword(s) janet_nanbox_wrap_c((s), JANET_KEYWORD)
  |  |  ------------------
  |  |  |  |  828|  1.68M|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  1.68M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  1.68M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21780|  2.51M|            } else if (lead == LB_REGISTRY) {
  ------------------
  |  Branch (21780:24): [True: 2.50M, False: 7.06k]
  ------------------
21781|  2.50M|                if (st->reg) {
  ------------------
  |  Branch (21781:21): [True: 2.50M, False: 0]
  ------------------
21782|  2.50M|                    Janet regkey = janet_symbolv(data, len);
  ------------------
  |  | 1836|  2.50M|#define janet_symbolv(str, len) janet_wrap_symbol(janet_symbol((str), (len)))
  |  |  ------------------
  |  |  |  |  849|  2.50M|#define janet_wrap_symbol(s) janet_nanbox_wrap_c((s), JANET_SYMBOL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  828|  2.50M|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  793|  2.50M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  792|  2.50M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21783|  2.50M|                    *out = janet_table_get(st->reg, regkey);
21784|  2.50M|                } else {
21785|      0|                    *out = janet_wrap_nil();
  ------------------
  |  |  831|      0|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|      0|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21786|      0|                }
21787|  2.50M|            } else { /* (lead == LB_BUFFER) */
21788|  7.06k|                JanetBuffer *buffer = janet_buffer(len);
21789|  7.06k|                buffer->count = len;
21790|  7.06k|                safe_memcpy(buffer->data, data, len);
21791|  7.06k|                *out = janet_wrap_buffer(buffer);
  ------------------
  |  |  847|  7.06k|#define janet_wrap_buffer(s) janet_nanbox_wrap_((s), JANET_BUFFER)
  |  |  ------------------
  |  |  |  |  825|  7.06k|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  7.06k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  7.06k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21792|  7.06k|            }
21793|  27.8M|            janet_v_push(st->lookup, *out);
  ------------------
  |  |  734|  27.8M|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  746|  27.8M|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  745|  27.8M|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  743|  27.8M|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|  27.8M|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  742|  27.8M|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|  27.8M|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (745:35): [True: 0, False: 27.8M]
  |  |  |  |  |  |  |  Branch (745:50): [True: 77.6k, False: 27.7M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  747|  77.6k|#define janet_v__grow(v, n)      ((v) = janet_v_grow((v), (n), sizeof(*(v))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  743|  27.8M|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  741|  27.8M|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21794|  27.8M|            return data + len;
21795|  27.8M|        }
21796|      0|        case LB_FIBER: {
  ------------------
  |  Branch (21796:9): [True: 0, False: 118M]
  ------------------
21797|      0|            JanetFiber *fiber;
21798|      0|            data = unmarshal_one_fiber(st, data + 1, &fiber, flags + 1);
21799|      0|            *out = janet_wrap_fiber(fiber);
  ------------------
  |  |  844|      0|#define janet_wrap_fiber(s) janet_nanbox_wrap_((s), JANET_FIBER)
  |  |  ------------------
  |  |  |  |  825|      0|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21800|      0|            return data;
21801|  27.8M|        }
21802|  2.70M|        case LB_FUNCTION: {
  ------------------
  |  Branch (21802:9): [True: 2.70M, False: 115M]
  ------------------
21803|  2.70M|            JanetFunction *func;
21804|  2.70M|            JanetFuncDef *def;
21805|  2.70M|            data++;
21806|  2.70M|            int32_t len = readnat(st, &data);
21807|  2.70M|            if (len > 255) {
  ------------------
  |  Branch (21807:17): [True: 0, False: 2.70M]
  ------------------
21808|      0|                janet_panicf("invalid function - too many environments (%d)", len);
21809|      0|            }
21810|  2.70M|            func = janet_gcalloc(JANET_MEMORY_FUNCTION, sizeof(JanetFunction) +
21811|  2.70M|                                 len * sizeof(JanetFuncEnv));
21812|  2.70M|            func->def = NULL;
21813|  3.00M|            for (int32_t i = 0; i < len; i++) {
  ------------------
  |  Branch (21813:33): [True: 303k, False: 2.70M]
  ------------------
21814|   303k|                func->envs[i] = NULL;
21815|   303k|            }
21816|  2.70M|            *out = janet_wrap_function(func);
  ------------------
  |  |  852|  2.70M|#define janet_wrap_function(s) janet_nanbox_wrap_((s), JANET_FUNCTION)
  |  |  ------------------
  |  |  |  |  825|  2.70M|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  2.70M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  2.70M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21817|  2.70M|            janet_v_push(st->lookup, *out);
  ------------------
  |  |  734|  2.70M|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  746|  2.70M|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  745|  2.70M|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  743|  2.70M|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|  2.70M|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  742|  2.70M|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|  2.70M|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (745:35): [True: 0, False: 2.70M]
  |  |  |  |  |  |  |  Branch (745:50): [True: 0, False: 2.70M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  747|      0|#define janet_v__grow(v, n)      ((v) = janet_v_grow((v), (n), sizeof(*(v))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  743|  2.70M|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  741|  2.70M|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21818|  2.70M|            data = unmarshal_one_def(st, data, &def, flags + 1);
21819|  2.70M|            if (def->environments_length != len) {
  ------------------
  |  Branch (21819:17): [True: 0, False: 2.70M]
  ------------------
21820|      0|                janet_panicf("invalid function - env count %d does not match funcdef (%d)",
21821|      0|                             len, def->environments_length);
21822|      0|            }
21823|  2.70M|            func->def = def;
21824|  3.00M|            for (int32_t i = 0; i < len; i++) {
  ------------------
  |  Branch (21824:33): [True: 303k, False: 2.70M]
  ------------------
21825|   303k|                data = unmarshal_one_env(st, data, &(func->envs[i]), flags + 1);
21826|   303k|            }
21827|  2.70M|            return data;
21828|  2.70M|        }
21829|      0|        case LB_ABSTRACT: {
  ------------------
  |  Branch (21829:9): [True: 0, False: 118M]
  ------------------
21830|      0|            data++;
21831|      0|            return unmarshal_one_abstract(st, data, out, flags);
21832|  2.70M|        }
21833|  76.1M|        case LB_REFERENCE:
  ------------------
  |  Branch (21833:9): [True: 76.1M, False: 42.5M]
  ------------------
21834|  76.1M|        case LB_ARRAY:
  ------------------
  |  Branch (21834:9): [True: 21.1k, False: 118M]
  ------------------
21835|  76.1M|        case LB_ARRAY_WEAK:
  ------------------
  |  Branch (21835:9): [True: 0, False: 118M]
  ------------------
21836|  81.4M|        case LB_TUPLE:
  ------------------
  |  Branch (21836:9): [True: 5.31M, False: 113M]
  ------------------
21837|  81.5M|        case LB_STRUCT:
  ------------------
  |  Branch (21837:9): [True: 49.4k, False: 118M]
  ------------------
21838|  81.5M|        case LB_STRUCT_PROTO:
  ------------------
  |  Branch (21838:9): [True: 0, False: 118M]
  ------------------
21839|  86.6M|        case LB_TABLE:
  ------------------
  |  Branch (21839:9): [True: 5.16M, False: 113M]
  ------------------
21840|  86.6M|        case LB_TABLE_PROTO:
  ------------------
  |  Branch (21840:9): [True: 0, False: 118M]
  ------------------
21841|  86.6M|        case LB_TABLE_WEAKK:
  ------------------
  |  Branch (21841:9): [True: 0, False: 118M]
  ------------------
21842|  86.6M|        case LB_TABLE_WEAKV:
  ------------------
  |  Branch (21842:9): [True: 0, False: 118M]
  ------------------
21843|  86.6M|        case LB_TABLE_WEAKKV:
  ------------------
  |  Branch (21843:9): [True: 0, False: 118M]
  ------------------
21844|  86.6M|        case LB_TABLE_WEAKK_PROTO:
  ------------------
  |  Branch (21844:9): [True: 0, False: 118M]
  ------------------
21845|  86.6M|        case LB_TABLE_WEAKV_PROTO:
  ------------------
  |  Branch (21845:9): [True: 0, False: 118M]
  ------------------
21846|  86.6M|        case LB_TABLE_WEAKKV_PROTO:
  ------------------
  |  Branch (21846:9): [True: 0, False: 118M]
  ------------------
21847|       |            /* Things that open with integers */
21848|  86.6M|        {
21849|  86.6M|            data++;
21850|  86.6M|            int32_t len = readnat(st, &data);
21851|       |            /* DOS check */
21852|  86.6M|            if (lead != LB_REFERENCE) {
  ------------------
  |  Branch (21852:17): [True: 10.5M, False: 76.1M]
  ------------------
21853|  10.5M|                MARSH_EOS(st, data - 1 + len);
  ------------------
  |  |21083|  10.5M|#define MARSH_EOS(st, data) do { \
  |  |21084|  10.5M|    if ((data) >= (st)->end) janet_panic("unexpected end of source");\
  |  |  ------------------
  |  |  |  Branch (21084:9): [True: 0, False: 10.5M]
  |  |  ------------------
  |  |21085|  10.5M|} while (0)
  |  |  ------------------
  |  |  |  Branch (21085:10): [Folded, False: 10.5M]
  |  |  ------------------
  ------------------
21854|  10.5M|            }
21855|  86.6M|            if (lead == LB_ARRAY || lead == LB_ARRAY_WEAK) {
  ------------------
  |  Branch (21855:17): [True: 21.1k, False: 86.6M]
  |  Branch (21855:37): [True: 0, False: 86.6M]
  ------------------
21856|       |                /* Array */
21857|  21.1k|                JanetArray *array = (lead == LB_ARRAY_WEAK) ? janet_array_weak(len) : janet_array(len);
  ------------------
  |  Branch (21857:37): [True: 0, False: 21.1k]
  ------------------
21858|  21.1k|                array->count = len;
21859|  21.1k|                *out = janet_wrap_array(array);
  ------------------
  |  |  845|  21.1k|#define janet_wrap_array(s) janet_nanbox_wrap_((s), JANET_ARRAY)
  |  |  ------------------
  |  |  |  |  825|  21.1k|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  21.1k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  21.1k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21860|  21.1k|                janet_v_push(st->lookup, *out);
  ------------------
  |  |  734|  21.1k|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  746|  21.1k|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  745|  21.1k|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  743|  21.1k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|  21.1k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  742|  21.1k|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|  21.1k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (745:35): [True: 0, False: 21.1k]
  |  |  |  |  |  |  |  Branch (745:50): [True: 0, False: 21.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  747|      0|#define janet_v__grow(v, n)      ((v) = janet_v_grow((v), (n), sizeof(*(v))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  743|  21.1k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  741|  21.1k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21861|   183k|                for (int32_t i = 0; i < len; i++) {
  ------------------
  |  Branch (21861:37): [True: 162k, False: 21.1k]
  ------------------
21862|   162k|                    data = unmarshal_one(st, data, array->data + i, flags + 1);
21863|   162k|                }
21864|  86.6M|            } else if (lead == LB_TUPLE) {
  ------------------
  |  Branch (21864:24): [True: 5.31M, False: 81.3M]
  ------------------
21865|       |                /* Tuple */
21866|  5.31M|                Janet *tup = janet_tuple_begin(len);
21867|  5.31M|                int32_t flag = readint(st, &data);
21868|  5.31M|                janet_tuple_flag(tup) |= (int32_t)(((uint32_t) flag) << 16);  /* Avoid left shift of negative value */
  ------------------
  |  | 1806|  5.31M|#define janet_tuple_flag(t) (janet_tuple_head(t)->gc.flags)
  |  |  ------------------
  |  |  |  | 1800|  5.31M|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
21869|  21.0M|                for (int32_t i = 0; i < len; i++) {
  ------------------
  |  Branch (21869:37): [True: 15.7M, False: 5.31M]
  ------------------
21870|  15.7M|                    data = unmarshal_one(st, data, tup + i, flags + 1);
21871|  15.7M|                }
21872|  5.31M|                *out = janet_wrap_tuple(janet_tuple_end(tup));
  ------------------
  |  |  843|  5.31M|#define janet_wrap_tuple(s) janet_nanbox_wrap_c((s), JANET_TUPLE)
  |  |  ------------------
  |  |  |  |  828|  5.31M|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  5.31M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  5.31M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21873|  5.31M|                janet_v_push(st->lookup, *out);
  ------------------
  |  |  734|  5.31M|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  746|  5.31M|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  745|  5.31M|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  743|  5.31M|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|  5.31M|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  742|  5.31M|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|  5.31M|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (745:35): [True: 0, False: 5.31M]
  |  |  |  |  |  |  |  Branch (745:50): [True: 0, False: 5.31M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  747|      0|#define janet_v__grow(v, n)      ((v) = janet_v_grow((v), (n), sizeof(*(v))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  743|  5.31M|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  741|  5.31M|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21874|  81.3M|            } else if (lead == LB_STRUCT || lead == LB_STRUCT_PROTO) {
  ------------------
  |  Branch (21874:24): [True: 49.4k, False: 81.3M]
  |  Branch (21874:45): [True: 0, False: 81.3M]
  ------------------
21875|       |                /* Struct */
21876|  49.4k|                JanetKV *struct_ = janet_struct_begin(len);
21877|  49.4k|                if (lead == LB_STRUCT_PROTO) {
  ------------------
  |  Branch (21877:21): [True: 0, False: 49.4k]
  ------------------
21878|      0|                    Janet proto;
21879|      0|                    data = unmarshal_one(st, data, &proto, flags + 1);
21880|      0|                    janet_asserttype(proto, JANET_STRUCT, st);
21881|      0|                    janet_struct_proto(struct_) = janet_unwrap_struct(proto);
  ------------------
  |  | 1851|      0|#define janet_struct_proto(t) (janet_struct_head(t)->proto)
  |  |  ------------------
  |  |  |  | 1846|      0|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
                                  janet_struct_proto(struct_) = janet_unwrap_struct(proto);
  ------------------
  |  |  857|      0|#define janet_unwrap_struct(x) ((JanetStruct)janet_nanbox_to_pointer(x))
  ------------------
21882|      0|                }
21883|   381k|                for (int32_t i = 0; i < len; i++) {
  ------------------
  |  Branch (21883:37): [True: 331k, False: 49.4k]
  ------------------
21884|   331k|                    Janet key, value;
21885|   331k|                    data = unmarshal_one(st, data, &key, flags + 1);
21886|   331k|                    data = unmarshal_one(st, data, &value, flags + 1);
21887|   331k|                    janet_struct_put(struct_, key, value);
21888|   331k|                }
21889|  49.4k|                *out = janet_wrap_struct(janet_struct_end(struct_));
  ------------------
  |  |  842|  49.4k|#define janet_wrap_struct(s) janet_nanbox_wrap_c((s), JANET_STRUCT)
  |  |  ------------------
  |  |  |  |  828|  49.4k|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  49.4k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  49.4k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21890|  49.4k|                janet_v_push(st->lookup, *out);
  ------------------
  |  |  734|  49.4k|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  746|  49.4k|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  745|  49.4k|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  743|  49.4k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|  49.4k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  742|  49.4k|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|  49.4k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (745:35): [True: 0, False: 49.4k]
  |  |  |  |  |  |  |  Branch (745:50): [True: 0, False: 49.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  747|      0|#define janet_v__grow(v, n)      ((v) = janet_v_grow((v), (n), sizeof(*(v))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  743|  49.4k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  741|  49.4k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21891|  81.3M|            } else if (lead == LB_REFERENCE) {
  ------------------
  |  Branch (21891:24): [True: 76.1M, False: 5.16M]
  ------------------
21892|  76.1M|                if (len >= janet_v_count(st->lookup))
  ------------------
  |  |  736|  76.1M|#define janet_v_count(v)        (((v) != NULL) ? janet_v__cnt(v) : 0)
  |  |  ------------------
  |  |  |  |  743|  76.1M|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  741|  76.1M|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (736:34): [True: 76.1M, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (21892:21): [True: 0, False: 76.1M]
  ------------------
21893|      0|                    janet_panicf("invalid reference %d", len);
21894|  76.1M|                *out = st->lookup[len];
21895|  76.1M|            } else {
21896|       |                /* Table */
21897|  5.16M|                JanetTable *t;
21898|  5.16M|                if (lead == LB_TABLE_WEAKK_PROTO || lead == LB_TABLE_WEAKK) {
  ------------------
  |  Branch (21898:21): [True: 0, False: 5.16M]
  |  Branch (21898:53): [True: 0, False: 5.16M]
  ------------------
21899|      0|                    t = janet_table_weakk(len);
21900|  5.16M|                } else if (lead == LB_TABLE_WEAKV_PROTO || lead == LB_TABLE_WEAKV) {
  ------------------
  |  Branch (21900:28): [True: 0, False: 5.16M]
  |  Branch (21900:60): [True: 0, False: 5.16M]
  ------------------
21901|      0|                    t = janet_table_weakv(len);
21902|  5.16M|                } else if (lead == LB_TABLE_WEAKKV_PROTO || lead == LB_TABLE_WEAKKV) {
  ------------------
  |  Branch (21902:28): [True: 0, False: 5.16M]
  |  Branch (21902:61): [True: 0, False: 5.16M]
  ------------------
21903|      0|                    t = janet_table_weakkv(len);
21904|  5.16M|                } else {
21905|  5.16M|                    t = janet_table(len);
21906|  5.16M|                }
21907|  5.16M|                *out = janet_wrap_table(t);
  ------------------
  |  |  846|  5.16M|#define janet_wrap_table(s) janet_nanbox_wrap_((s), JANET_TABLE)
  |  |  ------------------
  |  |  |  |  825|  5.16M|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  5.16M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  5.16M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21908|  5.16M|                janet_v_push(st->lookup, *out);
  ------------------
  |  |  734|  5.16M|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  746|  5.16M|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  745|  5.16M|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  743|  5.15M|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|  5.15M|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  742|  5.15M|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|  5.15M|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (745:35): [True: 7.06k, False: 5.15M]
  |  |  |  |  |  |  |  Branch (745:50): [True: 14.1k, False: 5.14M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  747|  21.1k|#define janet_v__grow(v, n)      ((v) = janet_v_grow((v), (n), sizeof(*(v))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  743|  5.16M|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  741|  5.16M|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21909|  5.16M|                if (lead == LB_TABLE_PROTO || lead == LB_TABLE_WEAKK_PROTO || lead == LB_TABLE_WEAKV_PROTO || lead == LB_TABLE_WEAKKV_PROTO) {
  ------------------
  |  Branch (21909:21): [True: 0, False: 5.16M]
  |  Branch (21909:47): [True: 0, False: 5.16M]
  |  Branch (21909:79): [True: 0, False: 5.16M]
  |  Branch (21909:111): [True: 0, False: 5.16M]
  ------------------
21910|      0|                    Janet proto;
21911|      0|                    data = unmarshal_one(st, data, &proto, flags + 1);
21912|      0|                    janet_asserttype(proto, JANET_TABLE, st);
21913|      0|                    t->proto = janet_unwrap_table(proto);
  ------------------
  |  |  861|      0|#define janet_unwrap_table(x) ((JanetTable *)janet_nanbox_to_pointer(x))
  ------------------
21914|      0|                }
21915|  31.1M|                for (int32_t i = 0; i < len; i++) {
  ------------------
  |  Branch (21915:37): [True: 26.0M, False: 5.16M]
  ------------------
21916|  26.0M|                    Janet key, value;
21917|  26.0M|                    data = unmarshal_one(st, data, &key, flags + 1);
21918|  26.0M|                    data = unmarshal_one(st, data, &value, flags + 1);
21919|  26.0M|                    janet_table_put(t, key, value);
21920|  26.0M|                }
21921|  5.16M|            }
21922|  86.6M|            return data;
21923|  86.6M|        }
21924|      0|        case LB_UNSAFE_POINTER: {
  ------------------
  |  Branch (21924:9): [True: 0, False: 118M]
  ------------------
21925|      0|            MARSH_EOS(st, data + sizeof(void *));
  ------------------
  |  |21083|      0|#define MARSH_EOS(st, data) do { \
  |  |21084|      0|    if ((data) >= (st)->end) janet_panic("unexpected end of source");\
  |  |  ------------------
  |  |  |  Branch (21084:9): [True: 0, False: 0]
  |  |  ------------------
  |  |21085|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (21085:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
21926|      0|            data++;
21927|      0|            if (!(flags & JANET_MARSHAL_UNSAFE)) {
  ------------------
  |  | 1911|      0|#define JANET_MARSHAL_UNSAFE 0x20000
  ------------------
  |  Branch (21927:17): [True: 0, False: 0]
  ------------------
21928|      0|                janet_panicf("unsafe flag not given, "
21929|      0|                             "will not unmarshal raw pointer at index %d",
21930|      0|                             (int)(data - st->start));
21931|      0|            }
21932|      0|            union {
21933|      0|                void *ptr;
21934|      0|                uint8_t bytes[sizeof(void *)];
21935|      0|            } u;
21936|      0|            memcpy(u.bytes, data, sizeof(void *));
21937|      0|            data += sizeof(void *);
21938|      0|            *out = janet_wrap_pointer(u.ptr);
  ------------------
  |  |  854|      0|#define janet_wrap_pointer(s) janet_nanbox_wrap_((s), JANET_POINTER)
  |  |  ------------------
  |  |  |  |  825|      0|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21939|      0|            janet_v_push(st->lookup, *out);
  ------------------
  |  |  734|      0|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  746|      0|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  745|      0|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  743|      0|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|      0|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  742|      0|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|      0|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (745:35): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (745:50): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  747|      0|#define janet_v__grow(v, n)      ((v) = janet_v_grow((v), (n), sizeof(*(v))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  743|      0|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  741|      0|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21940|      0|            return data;
21941|      0|        }
21942|      0|#ifdef JANET_EV
21943|      0|        case LB_POINTER_BUFFER: {
  ------------------
  |  Branch (21943:9): [True: 0, False: 118M]
  ------------------
21944|      0|            data++;
21945|      0|            int32_t count = readnat(st, &data);
21946|      0|            int32_t capacity = readnat(st, &data);
21947|      0|            MARSH_EOS(st, data + sizeof(void *));
  ------------------
  |  |21083|      0|#define MARSH_EOS(st, data) do { \
  |  |21084|      0|    if ((data) >= (st)->end) janet_panic("unexpected end of source");\
  |  |  ------------------
  |  |  |  Branch (21084:9): [True: 0, False: 0]
  |  |  ------------------
  |  |21085|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (21085:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
21948|      0|            union {
21949|      0|                void *ptr;
21950|      0|                uint8_t bytes[sizeof(void *)];
21951|      0|            } u;
21952|      0|            if (!(flags & JANET_MARSHAL_UNSAFE)) {
  ------------------
  |  | 1911|      0|#define JANET_MARSHAL_UNSAFE 0x20000
  ------------------
  |  Branch (21952:17): [True: 0, False: 0]
  ------------------
21953|      0|                janet_panicf("unsafe flag not given, "
21954|      0|                             "will not unmarshal raw pointer at index %d",
21955|      0|                             (int)(data - st->start));
21956|      0|            }
21957|      0|            memcpy(u.bytes, data, sizeof(void *));
21958|      0|            data += sizeof(void *);
21959|      0|            JanetBuffer *buffer = janet_pointer_buffer_unsafe(u.ptr, capacity, count);
21960|      0|            *out = janet_wrap_buffer(buffer);
  ------------------
  |  |  847|      0|#define janet_wrap_buffer(s) janet_nanbox_wrap_((s), JANET_BUFFER)
  |  |  ------------------
  |  |  |  |  825|      0|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21961|      0|            janet_v_push(st->lookup, *out);
  ------------------
  |  |  734|      0|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  746|      0|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  745|      0|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  743|      0|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|      0|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  742|      0|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|      0|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (745:35): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (745:50): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  747|      0|#define janet_v__grow(v, n)      ((v) = janet_v_grow((v), (n), sizeof(*(v))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  743|      0|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  741|      0|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21962|      0|            return data;
21963|      0|        }
21964|      0|#endif
21965|      0|        case LB_UNSAFE_CFUNCTION: {
  ------------------
  |  Branch (21965:9): [True: 0, False: 118M]
  ------------------
21966|      0|            MARSH_EOS(st, data + sizeof(JanetCFunction));
  ------------------
  |  |21083|      0|#define MARSH_EOS(st, data) do { \
  |  |21084|      0|    if ((data) >= (st)->end) janet_panic("unexpected end of source");\
  |  |  ------------------
  |  |  |  Branch (21084:9): [True: 0, False: 0]
  |  |  ------------------
  |  |21085|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (21085:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
21967|      0|            data++;
21968|      0|            if (!(flags & JANET_MARSHAL_UNSAFE)) {
  ------------------
  |  | 1911|      0|#define JANET_MARSHAL_UNSAFE 0x20000
  ------------------
  |  Branch (21968:17): [True: 0, False: 0]
  ------------------
21969|      0|                janet_panicf("unsafe flag not given, "
21970|      0|                             "will not unmarshal function pointer at index %d",
21971|      0|                             (int)(data - st->start));
21972|      0|            }
21973|      0|            union {
21974|      0|                JanetCFunction ptr;
21975|      0|                uint8_t bytes[sizeof(JanetCFunction)];
21976|      0|            } u;
21977|      0|            memcpy(u.bytes, data, sizeof(JanetCFunction));
21978|      0|            data += sizeof(JanetCFunction);
21979|      0|            *out = janet_wrap_cfunction(u.ptr);
  ------------------
  |  |  853|      0|#define janet_wrap_cfunction(s) janet_nanbox_wrap_((s), JANET_CFUNCTION)
  |  |  ------------------
  |  |  |  |  825|      0|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21980|      0|            janet_v_push(st->lookup, *out);
  ------------------
  |  |  734|      0|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  746|      0|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  745|      0|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  743|      0|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|      0|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  742|      0|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|      0|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (745:35): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (745:50): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  747|      0|#define janet_v__grow(v, n)      ((v) = janet_v_grow((v), (n), sizeof(*(v))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  743|      0|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  741|      0|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21981|      0|            return data;
21982|      0|        }
21983|      0|#ifdef JANET_EV
21984|      0|        case LB_THREADED_ABSTRACT: {
  ------------------
  |  Branch (21984:9): [True: 0, False: 118M]
  ------------------
21985|      0|            MARSH_EOS(st, data + sizeof(void *));
  ------------------
  |  |21083|      0|#define MARSH_EOS(st, data) do { \
  |  |21084|      0|    if ((data) >= (st)->end) janet_panic("unexpected end of source");\
  |  |  ------------------
  |  |  |  Branch (21084:9): [True: 0, False: 0]
  |  |  ------------------
  |  |21085|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (21085:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
21986|      0|            data++;
21987|      0|            if (!(flags & JANET_MARSHAL_UNSAFE)) {
  ------------------
  |  | 1911|      0|#define JANET_MARSHAL_UNSAFE 0x20000
  ------------------
  |  Branch (21987:17): [True: 0, False: 0]
  ------------------
21988|      0|                janet_panicf("unsafe flag not given, "
21989|      0|                             "will not unmarshal threaded abstract pointer at index %d",
21990|      0|                             (int)(data - st->start));
21991|      0|            }
21992|      0|            union {
21993|      0|                void *ptr;
21994|      0|                uint8_t bytes[sizeof(void *)];
21995|      0|            } u;
21996|      0|            memcpy(u.bytes, data, sizeof(void *));
21997|      0|            data += sizeof(void *);
21998|       |
21999|      0|            if (flags & JANET_MARSHAL_DECREF) {
  ------------------
  |  |  387|      0|#define JANET_MARSHAL_DECREF 0x40000
  ------------------
  |  Branch (21999:17): [True: 0, False: 0]
  ------------------
22000|       |                /* Decrement immediately and don't bother putting into heap */
22001|      0|                janet_abstract_decref(u.ptr);
22002|      0|                *out = janet_wrap_nil();
  ------------------
  |  |  831|      0|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|      0|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
22003|      0|            } else {
22004|      0|                *out = janet_wrap_abstract(u.ptr);
  ------------------
  |  |  851|      0|#define janet_wrap_abstract(s) janet_nanbox_wrap_((s), JANET_ABSTRACT)
  |  |  ------------------
  |  |  |  |  825|      0|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
22005|      0|                Janet check = janet_table_get(&janet_vm.threaded_abstracts, *out);
22006|      0|                if (janet_checktype(check, JANET_NIL)) {
  ------------------
  |  |  806|      0|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 0, False: 0]
  |  |  |  Branch (806:6): [Folded, False: 0]
  |  |  ------------------
  |  |  807|      0|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|      0|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|      0|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|      0|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
22007|       |                    /* Transfers reference from threaded channel buffer to current heap */
22008|      0|                    janet_table_put(&janet_vm.threaded_abstracts, *out, janet_wrap_false());
  ------------------
  |  |  833|      0|#define janet_wrap_false() janet_nanbox_from_payload(JANET_BOOLEAN, 0)
  |  |  ------------------
  |  |  |  |  822|      0|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
22009|      0|                } else {
22010|       |                    /* Heap reference already accounted for, remove threaded channel reference. */
22011|      0|                    janet_abstract_decref(u.ptr);
22012|      0|                }
22013|      0|            }
22014|       |
22015|      0|            janet_v_push(st->lookup, *out);
  ------------------
  |  |  734|      0|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  746|      0|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  745|      0|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  743|      0|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|      0|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  742|      0|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|      0|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (745:35): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (745:50): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  747|      0|#define janet_v__grow(v, n)      ((v) = janet_v_grow((v), (n), sizeof(*(v))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  743|      0|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  741|      0|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
22016|      0|            return data;
22017|      0|        }
22018|      0|#endif
22019|      0|        default: {
  ------------------
  |  Branch (22019:9): [True: 0, False: 118M]
  ------------------
22020|      0|            janet_panicf("unknown byte %x at index %d",
22021|      0|                         *data,
22022|      0|                         (int)(data - st->start));
22023|      0|            return NULL;
22024|      0|        }
22025|   118M|    }
22026|   118M|}
janet.c:readnat:
21120|   147M|static int32_t readnat(UnmarshalState *st, const uint8_t **atdata) {
21121|   147M|    int32_t ret = readint(st, atdata);
21122|   147M|    if (ret < 0) {
  ------------------
  |  Branch (21122:9): [True: 0, False: 147M]
  ------------------
21123|      0|        janet_panicf("expected integer >= 0, got %d", ret);
21124|      0|    }
21125|   147M|    return ret;
21126|   147M|}
janet.c:unmarshal_one_def:
21259|  3.82M|    int flags) {
21260|  3.82M|    MARSH_STACKCHECK;
  ------------------
  |  |20555|  3.82M|#define MARSH_STACKCHECK if ((flags & 0xFFFF) > JANET_RECURSION_GUARD) janet_panic("stack overflow")
  |  |  ------------------
  |  |  |  |  296|  3.82M|#define JANET_RECURSION_GUARD 1024
  |  |  ------------------
  |  |  |  Branch (20555:30): [True: 0, False: 3.82M]
  |  |  ------------------
  ------------------
21261|  3.82M|    MARSH_EOS(st, data);
  ------------------
  |  |21083|  3.82M|#define MARSH_EOS(st, data) do { \
  |  |21084|  3.82M|    if ((data) >= (st)->end) janet_panic("unexpected end of source");\
  |  |  ------------------
  |  |  |  Branch (21084:9): [True: 0, False: 3.82M]
  |  |  ------------------
  |  |21085|  3.82M|} while (0)
  |  |  ------------------
  |  |  |  Branch (21085:10): [Folded, False: 3.82M]
  |  |  ------------------
  ------------------
21262|  3.82M|    if (*data == LB_FUNCDEF_REF) {
  ------------------
  |  Branch (21262:9): [True: 28.2k, False: 3.79M]
  ------------------
21263|  28.2k|        data++;
21264|  28.2k|        int32_t index = readint(st, &data);
21265|  28.2k|        if (index < 0 || index >= janet_v_count(st->lookup_defs) || NULL == st->lookup_defs[index])
  ------------------
  |  |  736|  56.4k|#define janet_v_count(v)        (((v) != NULL) ? janet_v__cnt(v) : 0)
  |  |  ------------------
  |  |  |  |  743|  28.2k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  741|  28.2k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (736:34): [True: 28.2k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (21265:13): [True: 0, False: 28.2k]
  |  Branch (21265:26): [True: 0, False: 28.2k]
  |  Branch (21265:69): [True: 0, False: 28.2k]
  ------------------
21266|      0|            janet_panicf("invalid funcdef reference %d", index);
21267|  28.2k|        *out = st->lookup_defs[index];
21268|  3.79M|    } else {
21269|       |        /* Initialize with values that will not break garbage collection
21270|       |         * if unmarshalling fails. */
21271|  3.79M|        JanetFuncDef *def = janet_gcalloc(JANET_MEMORY_FUNCDEF, sizeof(JanetFuncDef));
21272|  3.79M|        def->environments_length = 0;
21273|  3.79M|        def->defs_length = 0;
21274|  3.79M|        def->constants_length = 0;
21275|  3.79M|        def->bytecode_length = 0;
21276|  3.79M|        def->name = NULL;
21277|  3.79M|        def->source = NULL;
21278|  3.79M|        def->closure_bitset = NULL;
21279|  3.79M|        def->defs = NULL;
21280|  3.79M|        def->environments = NULL;
21281|  3.79M|        def->constants = NULL;
21282|  3.79M|        def->bytecode = NULL;
21283|  3.79M|        def->sourcemap = NULL;
21284|  3.79M|        def->symbolmap = NULL;
21285|  3.79M|        def->symbolmap_length = 0;
21286|  3.79M|        def->named_args_count = 0;
21287|       |        /* Not referenceable until fully unmarshalled */
21288|  3.79M|        int32_t def_index = janet_v_count(st->lookup_defs);
  ------------------
  |  |  736|  3.79M|#define janet_v_count(v)        (((v) != NULL) ? janet_v__cnt(v) : 0)
  |  |  ------------------
  |  |  |  |  743|  3.78M|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  741|  3.78M|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (736:34): [True: 3.78M, False: 7.06k]
  |  |  ------------------
  ------------------
21289|  3.79M|        janet_v_push(st->lookup_defs, NULL);
  ------------------
  |  |  734|  3.79M|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  746|  3.79M|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  745|  3.79M|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  743|  3.78M|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|  3.78M|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  742|  3.78M|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|  3.78M|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (745:35): [True: 7.06k, False: 3.78M]
  |  |  |  |  |  |  |  Branch (745:50): [True: 70.6k, False: 3.71M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  747|  77.6k|#define janet_v__grow(v, n)      ((v) = janet_v_grow((v), (n), sizeof(*(v))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  743|  3.79M|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  741|  3.79M|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21290|       |
21291|       |        /* Set default lengths to zero */
21292|  3.79M|        int32_t bytecode_length = 0;
21293|  3.79M|        int32_t constants_length = 0;
21294|  3.79M|        int32_t environments_length = 0;
21295|  3.79M|        int32_t defs_length = 0;
21296|  3.79M|        int32_t symbolmap_length = 0;
21297|       |
21298|       |        /* Read flags and other fixed values */
21299|  3.79M|        def->flags = readint(st, &data);
21300|  3.79M|        def->slotcount = readnat(st, &data);
21301|  3.79M|        def->arity = readnat(st, &data);
21302|  3.79M|        def->min_arity = readnat(st, &data);
21303|  3.79M|        def->max_arity = readnat(st, &data);
21304|       |
21305|       |        /* Read some lengths */
21306|  3.79M|        constants_length = readnat(st, &data);
21307|  3.79M|        bytecode_length = readnat(st, &data);
21308|  3.79M|        if (def->flags & JANET_FUNCDEF_FLAG_NAMEDARGS)
  ------------------
  |  | 1107|  3.79M|#define JANET_FUNCDEF_FLAG_NAMEDARGS 0x4000000
  ------------------
  |  Branch (21308:13): [True: 14.1k, False: 3.77M]
  ------------------
21309|  14.1k|            def->named_args_count = readnat(st, &data);
21310|  3.79M|        if (def->flags & JANET_FUNCDEF_FLAG_HASENVS)
  ------------------
  |  | 1103|  3.79M|#define JANET_FUNCDEF_FLAG_HASENVS 0x400000
  ------------------
  |  Branch (21310:13): [True: 3.55M, False: 233k]
  ------------------
21311|  3.55M|            environments_length = readnat(st, &data);
21312|  3.79M|        if (def->flags & JANET_FUNCDEF_FLAG_HASDEFS)
  ------------------
  |  | 1102|  3.79M|#define JANET_FUNCDEF_FLAG_HASDEFS 0x200000
  ------------------
  |  Branch (21312:13): [True: 508k, False: 3.28M]
  ------------------
21313|   508k|            defs_length = readnat(st, &data);
21314|  3.79M|        if (def->flags & JANET_FUNCDEF_FLAG_HASSYMBOLMAP)
  ------------------
  |  | 1099|  3.79M|#define JANET_FUNCDEF_FLAG_HASSYMBOLMAP 0x40000
  ------------------
  |  Branch (21314:13): [True: 3.50M, False: 282k]
  ------------------
21315|  3.50M|            symbolmap_length = readnat(st, &data);
21316|       |
21317|       |        /* Check name and source (optional) */
21318|  3.79M|        if (def->flags & JANET_FUNCDEF_FLAG_HASNAME) {
  ------------------
  |  | 1100|  3.79M|#define JANET_FUNCDEF_FLAG_HASNAME 0x80000
  ------------------
  |  Branch (21318:13): [True: 3.55M, False: 240k]
  ------------------
21319|  3.55M|            Janet x;
21320|  3.55M|            data = unmarshal_one(st, data, &x, flags + 1);
21321|  3.55M|            janet_asserttype(x, JANET_STRING, st);
21322|  3.55M|            def->name = janet_unwrap_string(x);
  ------------------
  |  |  863|  3.55M|#define janet_unwrap_string(x) ((JanetString)janet_nanbox_to_pointer(x))
  ------------------
21323|  3.55M|        }
21324|  3.79M|        if (def->flags & JANET_FUNCDEF_FLAG_HASSOURCE) {
  ------------------
  |  | 1101|  3.79M|#define JANET_FUNCDEF_FLAG_HASSOURCE 0x100000
  ------------------
  |  Branch (21324:13): [True: 3.55M, False: 233k]
  ------------------
21325|  3.55M|            Janet x;
21326|  3.55M|            data = unmarshal_one(st, data, &x, flags + 1);
21327|  3.55M|            janet_asserttype(x, JANET_STRING, st);
21328|  3.55M|            def->source = janet_unwrap_string(x);
  ------------------
  |  |  863|  3.55M|#define janet_unwrap_string(x) ((JanetString)janet_nanbox_to_pointer(x))
  ------------------
21329|  3.55M|        }
21330|       |
21331|       |        /* Unmarshal constants */
21332|  3.79M|        if (constants_length) {
  ------------------
  |  Branch (21332:13): [True: 2.89M, False: 896k]
  ------------------
21333|  2.89M|            def->constants = array_allocate(sizeof(Janet), constants_length);
21334|  2.89M|            if (!def->constants) {
  ------------------
  |  Branch (21334:17): [True: 0, False: 2.89M]
  ------------------
21335|      0|                JANET_OUT_OF_MEMORY;
  ------------------
  |  |  419|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (419:122): [Folded, False: 0]
  |  |  ------------------
  ------------------
21336|      0|            }
21337|  19.0M|            for (int32_t i = 0; i < constants_length; i++)
  ------------------
  |  Branch (21337:33): [True: 16.1M, False: 2.89M]
  ------------------
21338|  16.1M|                data = unmarshal_one(st, data, def->constants + i, flags + 1);
21339|  2.89M|        } else {
21340|   896k|            def->constants = NULL;
21341|   896k|        }
21342|  3.79M|        def->constants_length = constants_length;
21343|       |
21344|       |        /* Unmarshal symbol map, if needed */
21345|  3.79M|        if (def->flags & JANET_FUNCDEF_FLAG_HASSYMBOLMAP) {
  ------------------
  |  | 1099|  3.79M|#define JANET_FUNCDEF_FLAG_HASSYMBOLMAP 0x40000
  ------------------
  |  Branch (21345:13): [True: 3.50M, False: 282k]
  ------------------
21346|  3.50M|            def->symbolmap = array_allocate(sizeof(JanetSymbolMap), symbolmap_length);
21347|  3.50M|            if (def->symbolmap == NULL) {
  ------------------
  |  Branch (21347:17): [True: 0, False: 3.50M]
  ------------------
21348|      0|                JANET_OUT_OF_MEMORY;
  ------------------
  |  |  419|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (419:122): [Folded, False: 0]
  |  |  ------------------
  ------------------
21349|      0|            }
21350|  39.4M|            for (int32_t i = 0; i < symbolmap_length; i++) {
  ------------------
  |  Branch (21350:33): [True: 35.9M, False: 3.50M]
  ------------------
21351|  35.9M|                def->symbolmap[i].birth_pc = (uint32_t) readint(st, &data);
21352|  35.9M|                def->symbolmap[i].death_pc = (uint32_t) readint(st, &data);
21353|  35.9M|                def->symbolmap[i].slot_index = (uint32_t) readint(st, &data);
21354|  35.9M|                Janet value;
21355|  35.9M|                data = unmarshal_one(st, data, &value, flags + 1);
21356|  35.9M|                if (!janet_checktype(value, JANET_SYMBOL)) {
  ------------------
  |  |  806|  35.9M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 35.9M]
  |  |  ------------------
  |  |  807|  35.9M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  35.9M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  35.9M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  35.9M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  35.9M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  35.9M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (21356:21): [True: 0, False: 35.9M]
  ------------------
21357|      0|                    janet_panicf("corrupted symbolmap when unmarshalling debug info, got %v", value);
21358|      0|                }
21359|  35.9M|                def->symbolmap[i].symbol = janet_unwrap_symbol(value);
  ------------------
  |  |  864|  35.9M|#define janet_unwrap_symbol(x) ((JanetSymbol)janet_nanbox_to_pointer(x))
  ------------------
21360|  35.9M|            }
21361|  3.50M|            def->symbolmap_length = (uint32_t) symbolmap_length;
21362|  3.50M|        }
21363|       |
21364|       |        /* Unmarshal bytecode */
21365|  3.79M|        def->bytecode = array_allocate(sizeof(uint32_t), bytecode_length);
21366|  3.79M|        if (!def->bytecode) {
  ------------------
  |  Branch (21366:13): [True: 0, False: 3.79M]
  ------------------
21367|      0|            JANET_OUT_OF_MEMORY;
  ------------------
  |  |  419|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (419:122): [Folded, False: 0]
  |  |  ------------------
  ------------------
21368|      0|        }
21369|  3.79M|        data = janet_unmarshal_u32s(st, data, def->bytecode, bytecode_length);
21370|  3.79M|        def->bytecode_length = bytecode_length;
21371|       |
21372|       |        /* Unmarshal environments */
21373|  3.79M|        if (def->flags & JANET_FUNCDEF_FLAG_HASENVS) {
  ------------------
  |  | 1103|  3.79M|#define JANET_FUNCDEF_FLAG_HASENVS 0x400000
  ------------------
  |  Branch (21373:13): [True: 3.55M, False: 233k]
  ------------------
21374|  3.55M|            def->environments = janet_calloc(1, sizeof(int32_t) * (size_t) environments_length);
  ------------------
  |  | 2412|  3.55M|#define janet_calloc(X, Y) calloc((X), (Y))
  ------------------
21375|  3.55M|            if (!def->environments) {
  ------------------
  |  Branch (21375:17): [True: 0, False: 3.55M]
  ------------------
21376|      0|                JANET_OUT_OF_MEMORY;
  ------------------
  |  |  419|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (419:122): [Folded, False: 0]
  |  |  ------------------
  ------------------
21377|      0|            }
21378|  4.96M|            for (int32_t i = 0; i < environments_length; i++) {
  ------------------
  |  Branch (21378:33): [True: 1.40M, False: 3.55M]
  ------------------
21379|  1.40M|                def->environments[i] = readint(st, &data);
21380|  1.40M|            }
21381|  3.55M|        } else {
21382|   233k|            def->environments = NULL;
21383|   233k|        }
21384|  3.79M|        def->environments_length = environments_length;
21385|       |
21386|       |        /* Unmarshal sub funcdefs */
21387|  3.79M|        if (def->flags & JANET_FUNCDEF_FLAG_HASDEFS) {
  ------------------
  |  | 1102|  3.79M|#define JANET_FUNCDEF_FLAG_HASDEFS 0x200000
  ------------------
  |  Branch (21387:13): [True: 508k, False: 3.28M]
  ------------------
21388|   508k|            def->defs = janet_calloc(1, sizeof(JanetFuncDef *) * (size_t) defs_length);
  ------------------
  |  | 2412|   508k|#define janet_calloc(X, Y) calloc((X), (Y))
  ------------------
21389|   508k|            if (!def->defs) {
  ------------------
  |  Branch (21389:17): [True: 0, False: 508k]
  ------------------
21390|      0|                JANET_OUT_OF_MEMORY;
  ------------------
  |  |  419|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (419:122): [Folded, False: 0]
  |  |  ------------------
  ------------------
21391|      0|            }
21392|  1.62M|            for (int32_t i = 0; i < defs_length; i++) {
  ------------------
  |  Branch (21392:33): [True: 1.11M, False: 508k]
  ------------------
21393|  1.11M|                data = unmarshal_one_def(st, data, def->defs + i, flags + 1);
21394|  1.11M|            }
21395|  3.28M|        } else {
21396|  3.28M|            def->defs = NULL;
21397|  3.28M|        }
21398|  3.79M|        def->defs_length = defs_length;
21399|       |
21400|       |        /* Unmarshal source maps if needed */
21401|  3.79M|        if (def->flags & JANET_FUNCDEF_FLAG_HASSOURCEMAP) {
  ------------------
  |  | 1104|  3.79M|#define JANET_FUNCDEF_FLAG_HASSOURCEMAP 0x800000
  ------------------
  |  Branch (21401:13): [True: 3.55M, False: 233k]
  ------------------
21402|  3.55M|            int32_t current = 0;
21403|  3.55M|            def->sourcemap = array_allocate(sizeof(JanetSourceMapping), bytecode_length);
21404|  3.55M|            if (!def->sourcemap) {
  ------------------
  |  Branch (21404:17): [True: 0, False: 3.55M]
  ------------------
21405|      0|                JANET_OUT_OF_MEMORY;
  ------------------
  |  |  419|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (419:122): [Folded, False: 0]
  |  |  ------------------
  ------------------
21406|      0|            }
21407|   105M|            for (int32_t i = 0; i < bytecode_length; i++) {
  ------------------
  |  Branch (21407:33): [True: 102M, False: 3.55M]
  ------------------
21408|   102M|                current += readint(st, &data);
21409|   102M|                def->sourcemap[i].line = current;
21410|   102M|                def->sourcemap[i].column = readint(st, &data);
21411|   102M|            }
21412|  3.55M|        } else {
21413|   233k|            def->sourcemap = NULL;
21414|   233k|        }
21415|       |
21416|       |        /* Unmarshal closure bitset if needed */
21417|  3.79M|        if (def->flags & JANET_FUNCDEF_FLAG_HASCLOBITSET) {
  ------------------
  |  | 1106|  3.79M|#define JANET_FUNCDEF_FLAG_HASCLOBITSET 0x2000000
  ------------------
  |  Branch (21417:13): [True: 430k, False: 3.36M]
  ------------------
21418|   430k|            int32_t n = ((def->slotcount - 1) >> 5) + 1;
21419|   430k|            def->closure_bitset = array_allocate(sizeof(uint32_t), n);
21420|   430k|            if (NULL == def->closure_bitset) {
  ------------------
  |  Branch (21420:17): [True: 0, False: 430k]
  ------------------
21421|      0|                JANET_OUT_OF_MEMORY;
  ------------------
  |  |  419|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (419:122): [Folded, False: 0]
  |  |  ------------------
  ------------------
21422|      0|            }
21423|   430k|            data = janet_unmarshal_u32s(st, data, def->closure_bitset, n);
21424|   430k|        }
21425|       |
21426|       |        /* Validate */
21427|  3.79M|        int status;
21428|  3.79M|        if ((status = janet_verify(def))) {
  ------------------
  |  Branch (21428:13): [True: 0, False: 3.79M]
  ------------------
21429|      0|            janet_panicf("funcdef has invalid bytecode: %d", status);
21430|      0|        }
21431|       |
21432|       |        /* Set def */
21433|  3.79M|        st->lookup_defs[def_index] = def;
21434|  3.79M|        *out = def;
21435|  3.79M|    }
21436|  3.82M|    return data;
21437|  3.82M|}
janet.c:janet_unmarshal_u32s:
21241|  4.22M|static const uint8_t *janet_unmarshal_u32s(UnmarshalState *st, const uint8_t *data, uint32_t *into, int32_t n) {
21242|   109M|    for (int32_t i = 0; i < n; i++) {
  ------------------
  |  Branch (21242:25): [True: 105M, False: 4.22M]
  ------------------
21243|   105M|        MARSH_EOS(st, data + 3);
  ------------------
  |  |21083|   105M|#define MARSH_EOS(st, data) do { \
  |  |21084|   105M|    if ((data) >= (st)->end) janet_panic("unexpected end of source");\
  |  |  ------------------
  |  |  |  Branch (21084:9): [True: 0, False: 105M]
  |  |  ------------------
  |  |21085|   105M|} while (0)
  |  |  ------------------
  |  |  |  Branch (21085:10): [Folded, False: 105M]
  |  |  ------------------
  ------------------
21244|   105M|        into[i] =
21245|   105M|            (uint32_t)(data[0]) |
21246|   105M|            ((uint32_t)(data[1]) << 8) |
21247|   105M|            ((uint32_t)(data[2]) << 16) |
21248|   105M|            ((uint32_t)(data[3]) << 24);
21249|   105M|        data += 4;
21250|   105M|    }
21251|  4.22M|    return data;
21252|  4.22M|}
janet.c:unmarshal_one_env:
21197|   303k|    int flags) {
21198|   303k|    MARSH_EOS(st, data);
  ------------------
  |  |21083|   303k|#define MARSH_EOS(st, data) do { \
  |  |21084|   303k|    if ((data) >= (st)->end) janet_panic("unexpected end of source");\
  |  |  ------------------
  |  |  |  Branch (21084:9): [True: 0, False: 303k]
  |  |  ------------------
  |  |21085|   303k|} while (0)
  |  |  ------------------
  |  |  |  Branch (21085:10): [Folded, False: 303k]
  |  |  ------------------
  ------------------
21199|   303k|    if (*data == LB_FUNCENV_REF) {
  ------------------
  |  Branch (21199:9): [True: 247k, False: 56.4k]
  ------------------
21200|   247k|        data++;
21201|   247k|        int32_t index = readint(st, &data);
21202|   247k|        if (index < 0 || index >= janet_v_count(st->lookup_envs))
  ------------------
  |  |  736|   247k|#define janet_v_count(v)        (((v) != NULL) ? janet_v__cnt(v) : 0)
  |  |  ------------------
  |  |  |  |  743|   247k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  741|   247k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (736:34): [True: 247k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (21202:13): [True: 0, False: 247k]
  |  Branch (21202:26): [True: 0, False: 247k]
  ------------------
21203|      0|            janet_panicf("invalid funcenv reference %d", index);
21204|   247k|        *out = st->lookup_envs[index];
21205|   247k|    } else {
21206|  56.4k|        JanetFuncEnv *env = janet_gcalloc(JANET_MEMORY_FUNCENV, sizeof(JanetFuncEnv));
21207|  56.4k|        env->length = 0;
21208|  56.4k|        env->offset = 0;
21209|  56.4k|        env->as.values = NULL;
21210|  56.4k|        janet_v_push(st->lookup_envs, env);
  ------------------
  |  |  734|  56.4k|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  746|  56.4k|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  745|  56.4k|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  743|  49.4k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|  49.4k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  742|  49.4k|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|  49.4k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (745:35): [True: 7.06k, False: 49.4k]
  |  |  |  |  |  |  |  Branch (745:50): [True: 28.2k, False: 21.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  747|  35.3k|#define janet_v__grow(v, n)      ((v) = janet_v_grow((v), (n), sizeof(*(v))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  743|  56.4k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  741|  56.4k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21211|  56.4k|        int32_t offset = readnat(st, &data);
21212|  56.4k|        int32_t length = readnat(st, &data);
21213|  56.4k|        if (offset > 0) {
  ------------------
  |  Branch (21213:13): [True: 0, False: 56.4k]
  ------------------
21214|      0|            Janet fiberv;
21215|       |            /* On stack variant */
21216|      0|            data = unmarshal_one(st, data, &fiberv, flags);
21217|      0|            janet_asserttype(fiberv, JANET_FIBER, st);
21218|      0|            env->as.fiber = janet_unwrap_fiber(fiberv);
  ------------------
  |  |  859|      0|#define janet_unwrap_fiber(x) ((JanetFiber *)janet_nanbox_to_pointer(x))
  ------------------
21219|       |            /* Negative offset indicates untrusted input */
21220|      0|            env->offset = -offset;
21221|  56.4k|        } else {
21222|       |            /* Off stack variant */
21223|  56.4k|            if (length == 0) {
  ------------------
  |  Branch (21223:17): [True: 0, False: 56.4k]
  ------------------
21224|      0|                janet_panic("invalid funcenv length");
21225|      0|            }
21226|  56.4k|            env->as.values = array_allocate(sizeof(Janet), length);
21227|  56.4k|            if (!env->as.values) {
  ------------------
  |  Branch (21227:17): [True: 0, False: 56.4k]
  ------------------
21228|      0|                JANET_OUT_OF_MEMORY;
  ------------------
  |  |  419|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (419:122): [Folded, False: 0]
  |  |  ------------------
  ------------------
21229|      0|            }
21230|  56.4k|            env->offset = 0;
21231|   699k|            for (int32_t i = 0; i < length; i++)
  ------------------
  |  Branch (21231:33): [True: 642k, False: 56.4k]
  ------------------
21232|   642k|                data = unmarshal_one(st, data, env->as.values + i, flags);
21233|  56.4k|        }
21234|  56.4k|        env->length = length;
21235|  56.4k|        *out = env;
21236|  56.4k|    }
21237|   303k|    return data;
21238|   303k|}
janet.c:janet_asserttype:
21159|  7.11M|static void janet_asserttype(Janet x, JanetType t, UnmarshalState *st) {
21160|  7.11M|    if (!janet_checktype(x, t)) {
  ------------------
  |  |  806|  7.11M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [True: 0, False: 7.11M]
  |  |  ------------------
  |  |  807|  7.11M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  7.11M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  7.11M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  7.11M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  7.11M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  7.11M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (21160:9): [True: 0, False: 7.11M]
  ------------------
21161|       |#ifdef JANET_MARSHAL_DEBUG
21162|       |        dump_reference_table(st);
21163|       |#else
21164|      0|        (void) st;
21165|      0|#endif
21166|      0|        janet_panicf("expected type %T, got %v", 1 << t, x);
21167|      0|    }
21168|  7.11M|}
janet.c:janet_parser_checkdead:
27711|   260k|static void janet_parser_checkdead(JanetParser *parser) {
27712|   260k|    if (parser->flag) janet_panic("parser is dead, cannot consume");
  ------------------
  |  Branch (27712:9): [True: 0, False: 260k]
  ------------------
27713|   260k|    if (parser->error) janet_panic("parser has unchecked error, cannot consume");
  ------------------
  |  Branch (27713:9): [True: 0, False: 260k]
  ------------------
27714|   260k|}
janet.c:delim_error:
27221|  1.45k|static void delim_error(JanetParser *parser, size_t stack_index, char c, const char *msg) {
27222|  1.45k|    JanetParseState *s = parser->states + stack_index;
27223|  1.45k|    JanetBuffer *buffer = janet_buffer(40);
27224|  1.45k|    if (msg) {
  ------------------
  |  Branch (27224:9): [True: 1.45k, False: 0]
  ------------------
27225|  1.45k|        janet_buffer_push_cstring(buffer, msg);
27226|  1.45k|    }
27227|  1.45k|    if (c) {
  ------------------
  |  Branch (27227:9): [True: 80, False: 1.37k]
  ------------------
27228|     80|        janet_buffer_push_u8(buffer, c);
27229|     80|    }
27230|  1.45k|    if (stack_index > 0) {
  ------------------
  |  Branch (27230:9): [True: 1.39k, False: 62]
  ------------------
27231|  1.39k|        janet_buffer_push_cstring(buffer, ", ");
27232|  1.39k|        if (s->flags & PFLAG_PARENS) {
  ------------------
  |  |27157|  1.39k|#define PFLAG_PARENS 0x400
  ------------------
  |  Branch (27232:13): [True: 86, False: 1.30k]
  ------------------
27233|     86|            janet_buffer_push_u8(buffer, '(');
27234|  1.30k|        } else if (s->flags & PFLAG_SQRBRACKETS) {
  ------------------
  |  |27158|  1.30k|#define PFLAG_SQRBRACKETS 0x800
  ------------------
  |  Branch (27234:20): [True: 73, False: 1.23k]
  ------------------
27235|     73|            janet_buffer_push_u8(buffer, '[');
27236|  1.23k|        } else if (s->flags & PFLAG_CURLYBRACKETS) {
  ------------------
  |  |27159|  1.23k|#define PFLAG_CURLYBRACKETS 0x1000
  ------------------
  |  Branch (27236:20): [True: 124, False: 1.10k]
  ------------------
27237|    124|            janet_buffer_push_u8(buffer, '{');
27238|  1.10k|        } else if (s->flags & PFLAG_STRING) {
  ------------------
  |  |27160|  1.10k|#define PFLAG_STRING 0x2000
  ------------------
  |  Branch (27238:20): [True: 370, False: 739]
  ------------------
27239|    370|            janet_buffer_push_u8(buffer, '"');
27240|    739|        } else if (s->flags & PFLAG_LONGSTRING) {
  ------------------
  |  |27161|    739|#define PFLAG_LONGSTRING 0x4000
  ------------------
  |  Branch (27240:20): [True: 153, False: 586]
  ------------------
27241|    153|            int32_t i;
27242|  2.39k|            for (i = 0; i < s->argn; i++) {
  ------------------
  |  Branch (27242:25): [True: 2.24k, False: 153]
  ------------------
27243|  2.24k|                janet_buffer_push_u8(buffer, '`');
27244|  2.24k|            }
27245|    153|        }
27246|  1.39k|        janet_formatb(buffer, " opened at line %d, column %d", (int32_t) s->line, (int32_t) s->column);
27247|  1.39k|    }
27248|  1.45k|    parser->error = (const char *) janet_string(buffer->data, buffer->count);
27249|  1.45k|    parser->flag |= JANET_PARSER_GENERATED_ERROR;
  ------------------
  |  |27051|  1.45k|#define JANET_PARSER_GENERATED_ERROR 0x2
  ------------------
27250|  1.45k|}
janet.c:pushstate:
27167|   103k|static void pushstate(JanetParser *p, Consumer consumer, int flags) {
27168|   103k|    JanetParseState s;
27169|   103k|    s.counter = 0;
27170|   103k|    s.argn = 0;
27171|   103k|    s.flags = flags;
27172|   103k|    s.consumer = consumer;
27173|   103k|    s.line = p->line;
27174|   103k|    s.column = p->column;
27175|   103k|    _pushstate(p, s);
27176|   103k|}
janet.c:root:
27638|   135k|static int root(JanetParser *p, JanetParseState *state, uint8_t c) {
27639|   135k|    switch (c) {
27640|  62.2k|        default:
  ------------------
  |  Branch (27640:9): [True: 62.2k, False: 73.2k]
  ------------------
27641|  62.2k|            if (is_whitespace(c)) return 1;
  ------------------
  |  Branch (27641:17): [True: 27.9k, False: 34.2k]
  ------------------
27642|  34.2k|            if (!janet_is_symbol_char(c)) {
  ------------------
  |  Branch (27642:17): [True: 104, False: 34.1k]
  ------------------
27643|    104|                p->error = "unexpected character";
27644|    104|                return 1;
27645|    104|            }
27646|  34.1k|            pushstate(p, tokenchar, PFLAG_TOKEN);
  ------------------
  |  |27165|  34.1k|#define PFLAG_TOKEN 0x40000
  ------------------
27647|  34.1k|            return 0;
27648|  18.6k|        case '\'':
  ------------------
  |  Branch (27648:9): [True: 18.6k, False: 116k]
  ------------------
27649|  23.8k|        case ',':
  ------------------
  |  Branch (27649:9): [True: 5.19k, False: 130k]
  ------------------
27650|  27.4k|        case ';':
  ------------------
  |  Branch (27650:9): [True: 3.58k, False: 131k]
  ------------------
27651|  31.1k|        case '~':
  ------------------
  |  Branch (27651:9): [True: 3.67k, False: 131k]
  ------------------
27652|  33.9k|        case '|':
  ------------------
  |  Branch (27652:9): [True: 2.79k, False: 132k]
  ------------------
27653|  33.9k|            pushstate(p, root, PFLAG_READERMAC | c);
  ------------------
  |  |27162|  33.9k|#define PFLAG_READERMAC 0x8000
  ------------------
27654|  33.9k|            return 1;
27655|  3.94k|        case '"':
  ------------------
  |  Branch (27655:9): [True: 3.94k, False: 131k]
  ------------------
27656|  3.94k|            pushstate(p, stringchar, PFLAG_STRING);
  ------------------
  |  |27160|  3.94k|#define PFLAG_STRING 0x2000
  ------------------
27657|  3.94k|            return 1;
27658|    544|        case '#':
  ------------------
  |  Branch (27658:9): [True: 544, False: 134k]
  ------------------
27659|    544|            pushstate(p, comment, PFLAG_COMMENT);
  ------------------
  |  |27164|    544|#define PFLAG_COMMENT 0x20000
  ------------------
27660|    544|            return 1;
27661|  3.97k|        case '@':
  ------------------
  |  Branch (27661:9): [True: 3.97k, False: 131k]
  ------------------
27662|  3.97k|            pushstate(p, atsign, PFLAG_ATSYM);
  ------------------
  |  |27163|  3.97k|#define PFLAG_ATSYM 0x10000
  ------------------
27663|  3.97k|            return 1;
27664|  1.29k|        case '`':
  ------------------
  |  Branch (27664:9): [True: 1.29k, False: 134k]
  ------------------
27665|  1.29k|            pushstate(p, longstring, PFLAG_LONGSTRING);
  ------------------
  |  |27161|  1.29k|#define PFLAG_LONGSTRING 0x4000
  ------------------
27666|  1.29k|            return 1;
27667|  3.08k|        case ')':
  ------------------
  |  Branch (27667:9): [True: 3.08k, False: 132k]
  ------------------
27668|  7.16k|        case ']':
  ------------------
  |  Branch (27668:9): [True: 4.08k, False: 131k]
  ------------------
27669|  14.4k|        case '}': {
  ------------------
  |  Branch (27669:9): [True: 7.24k, False: 128k]
  ------------------
27670|  14.4k|            Janet ds;
27671|  14.4k|            if (p->statecount == 1) {
  ------------------
  |  Branch (27671:17): [True: 62, False: 14.3k]
  ------------------
27672|     62|                delim_error(p, 0, c, "unexpected closing delimiter ");
27673|     62|                return 1;
27674|     62|            }
27675|  14.3k|            if ((c == ')' && (state->flags & PFLAG_PARENS)) ||
  ------------------
  |  |27157|  3.07k|#define PFLAG_PARENS 0x400
  ------------------
  |  Branch (27675:18): [True: 3.07k, False: 11.2k]
  |  Branch (27675:30): [True: 3.07k, False: 3]
  ------------------
27676|  11.2k|                    (c == ']' && (state->flags & PFLAG_SQRBRACKETS))) {
  ------------------
  |  |27158|  4.07k|#define PFLAG_SQRBRACKETS 0x800
  ------------------
  |  Branch (27676:22): [True: 4.07k, False: 7.20k]
  |  Branch (27676:34): [True: 4.06k, False: 7]
  ------------------
27677|  7.13k|                if (state->flags & PFLAG_ATSYM) {
  ------------------
  |  |27163|  7.13k|#define PFLAG_ATSYM 0x10000
  ------------------
  |  Branch (27677:21): [True: 275, False: 6.86k]
  ------------------
27678|    275|                    ds = close_array(p, state);
27679|  6.86k|                } else {
27680|  6.86k|                    ds = close_tuple(p, state, c == ']' ? JANET_TUPLE_FLAG_BRACKETCTOR : 0);
  ------------------
  |  | 1798|  3.80k|#define JANET_TUPLE_FLAG_BRACKETCTOR 0x10000
  ------------------
  |  Branch (27680:48): [True: 3.80k, False: 3.06k]
  ------------------
27681|  6.86k|                }
27682|  7.21k|            } else if (c == '}' && (state->flags & PFLAG_CURLYBRACKETS)) {
  ------------------
  |  |27159|  7.20k|#define PFLAG_CURLYBRACKETS 0x1000
  ------------------
  |  Branch (27682:24): [True: 7.20k, False: 10]
  |  Branch (27682:36): [True: 7.19k, False: 8]
  ------------------
27683|  7.19k|                if (state->argn & 1) {
  ------------------
  |  Branch (27683:21): [True: 20, False: 7.17k]
  ------------------
27684|     20|                    p->error = "struct and table literals expect even number of arguments";
27685|     20|                    return 1;
27686|     20|                }
27687|  7.17k|                if (state->flags & PFLAG_ATSYM) {
  ------------------
  |  |27163|  7.17k|#define PFLAG_ATSYM 0x10000
  ------------------
  |  Branch (27687:21): [True: 2.14k, False: 5.03k]
  ------------------
27688|  2.14k|                    ds = close_table(p, state);
27689|  5.03k|                } else {
27690|  5.03k|                    ds = close_struct(p, state);
27691|  5.03k|                }
27692|  7.17k|            } else {
27693|     18|                delim_error(p, p->statecount - 1, c, "mismatched delimiter ");
27694|     18|                return 1;
27695|     18|            }
27696|  14.3k|            popstate(p, ds);
27697|  14.3k|        }
27698|      0|        return 1;
27699|  4.09k|        case '(':
  ------------------
  |  Branch (27699:9): [True: 4.09k, False: 131k]
  ------------------
27700|  4.09k|            pushstate(p, root, PFLAG_CONTAINER | PFLAG_PARENS);
  ------------------
  |  |27155|  4.09k|#define PFLAG_CONTAINER 0x100
  ------------------
                          pushstate(p, root, PFLAG_CONTAINER | PFLAG_PARENS);
  ------------------
  |  |27157|  4.09k|#define PFLAG_PARENS 0x400
  ------------------
27701|  4.09k|            return 1;
27702|  4.64k|        case '[':
  ------------------
  |  Branch (27702:9): [True: 4.64k, False: 130k]
  ------------------
27703|  4.64k|            pushstate(p, root, PFLAG_CONTAINER | PFLAG_SQRBRACKETS);
  ------------------
  |  |27155|  4.64k|#define PFLAG_CONTAINER 0x100
  ------------------
                          pushstate(p, root, PFLAG_CONTAINER | PFLAG_SQRBRACKETS);
  ------------------
  |  |27158|  4.64k|#define PFLAG_SQRBRACKETS 0x800
  ------------------
27704|  4.64k|            return 1;
27705|  6.37k|        case '{':
  ------------------
  |  Branch (27705:9): [True: 6.37k, False: 129k]
  ------------------
27706|  6.37k|            pushstate(p, root, PFLAG_CONTAINER | PFLAG_CURLYBRACKETS);
  ------------------
  |  |27155|  6.37k|#define PFLAG_CONTAINER 0x100
  ------------------
                          pushstate(p, root, PFLAG_CONTAINER | PFLAG_CURLYBRACKETS);
  ------------------
  |  |27159|  6.37k|#define PFLAG_CURLYBRACKETS 0x1000
  ------------------
27707|  6.37k|            return 1;
27708|   135k|    }
27709|   135k|}
janet.c:is_whitespace:
27054|  62.2k|static int is_whitespace(uint8_t c) {
27055|  62.2k|    return c == ' '
  ------------------
  |  Branch (27055:12): [True: 2.18k, False: 60.0k]
  ------------------
27056|  60.0k|           || c == '\t'
  ------------------
  |  Branch (27056:15): [True: 1.10k, False: 58.9k]
  ------------------
27057|  58.9k|           || c == '\n'
  ------------------
  |  Branch (27057:15): [True: 7.34k, False: 51.5k]
  ------------------
27058|  51.5k|           || c == '\r'
  ------------------
  |  Branch (27058:15): [True: 1.29k, False: 50.2k]
  ------------------
27059|  50.2k|           || c == '\0'
  ------------------
  |  Branch (27059:15): [True: 14.2k, False: 36.0k]
  ------------------
27060|  36.0k|           || c == '\v'
  ------------------
  |  Branch (27060:15): [True: 1.39k, False: 34.6k]
  ------------------
27061|  34.6k|           || c == '\f';
  ------------------
  |  Branch (27061:15): [True: 398, False: 34.2k]
  ------------------
27062|  62.2k|}
janet.c:stringchar:
27433|  14.4k|static int stringchar(JanetParser *p, JanetParseState *state, uint8_t c) {
27434|       |    /* Enter escape */
27435|  14.4k|    if (c == '\\') {
  ------------------
  |  Branch (27435:9): [True: 2.12k, False: 12.3k]
  ------------------
27436|  2.12k|        state->consumer = escape1;
27437|  2.12k|        return 1;
27438|  2.12k|    }
27439|       |    /* String end */
27440|  12.3k|    if (c == '"') {
  ------------------
  |  Branch (27440:9): [True: 3.80k, False: 8.53k]
  ------------------
27441|  3.80k|        return stringend(p, state);
27442|  3.80k|    }
27443|       |    /* normal char */
27444|  8.53k|    if (c != '\n' && c != '\r')
  ------------------
  |  Branch (27444:9): [True: 8.02k, False: 511]
  |  Branch (27444:22): [True: 7.76k, False: 257]
  ------------------
27445|  7.76k|        push_buf(p, c);
27446|  8.53k|    return 1;
27447|  12.3k|}
janet.c:escape1:
27348|  2.12k|static int escape1(JanetParser *p, JanetParseState *state, uint8_t c) {
27349|  2.12k|    int e = checkescape(c);
27350|  2.12k|    if (e < 0) {
  ------------------
  |  Branch (27350:9): [True: 30, False: 2.09k]
  ------------------
27351|     30|        p->error = "invalid string escape sequence";
27352|     30|        return 1;
27353|     30|    }
27354|  2.09k|    if (c == 'x') {
  ------------------
  |  Branch (27354:9): [True: 265, False: 1.82k]
  ------------------
27355|    265|        state->counter = 2;
27356|    265|        state->argn = 0;
27357|    265|        state->consumer = escapeh;
27358|  1.82k|    } else if (c == 'u' || c == 'U') {
  ------------------
  |  Branch (27358:16): [True: 306, False: 1.52k]
  |  Branch (27358:28): [True: 261, False: 1.26k]
  ------------------
27359|    567|        state->counter = c == 'u' ? 4 : 6;
  ------------------
  |  Branch (27359:26): [True: 306, False: 261]
  ------------------
27360|    567|        state->argn = 0;
27361|    567|        state->consumer = escapeu;
27362|  1.26k|    } else {
27363|  1.26k|        push_buf(p, (uint8_t) e);
27364|  1.26k|        state->consumer = stringchar;
27365|  1.26k|    }
27366|  2.09k|    return 1;
27367|  2.12k|}
janet.c:checkescape:
27252|  2.12k|static int checkescape(uint8_t c) {
27253|  2.12k|    switch (c) {
27254|     30|        default:
  ------------------
  |  Branch (27254:9): [True: 30, False: 2.09k]
  ------------------
27255|     30|            return -1;
27256|    265|        case 'x':
  ------------------
  |  Branch (27256:9): [True: 265, False: 1.85k]
  ------------------
27257|    571|        case 'u':
  ------------------
  |  Branch (27257:9): [True: 306, False: 1.81k]
  ------------------
27258|    832|        case 'U':
  ------------------
  |  Branch (27258:9): [True: 261, False: 1.86k]
  ------------------
27259|    832|            return 1;
27260|     87|        case 'n':
  ------------------
  |  Branch (27260:9): [True: 87, False: 2.03k]
  ------------------
27261|     87|            return '\n';
27262|     80|        case 't':
  ------------------
  |  Branch (27262:9): [True: 80, False: 2.04k]
  ------------------
27263|     80|            return '\t';
27264|     72|        case 'r':
  ------------------
  |  Branch (27264:9): [True: 72, False: 2.05k]
  ------------------
27265|     72|            return '\r';
27266|     80|        case '0':
  ------------------
  |  Branch (27266:9): [True: 80, False: 2.04k]
  ------------------
27267|     80|            return '\0';
27268|     89|        case 'z':
  ------------------
  |  Branch (27268:9): [True: 89, False: 2.03k]
  ------------------
27269|     89|            return '\0';
27270|     73|        case 'f':
  ------------------
  |  Branch (27270:9): [True: 73, False: 2.04k]
  ------------------
27271|     73|            return '\f';
27272|    109|        case 'v':
  ------------------
  |  Branch (27272:9): [True: 109, False: 2.01k]
  ------------------
27273|    109|            return '\v';
27274|     85|        case 'a':
  ------------------
  |  Branch (27274:9): [True: 85, False: 2.03k]
  ------------------
27275|     85|            return '\a';
27276|     74|        case 'b':
  ------------------
  |  Branch (27276:9): [True: 74, False: 2.04k]
  ------------------
27277|     74|            return '\b';
27278|     80|        case '\'':
  ------------------
  |  Branch (27278:9): [True: 80, False: 2.04k]
  ------------------
27279|     80|            return '\'';
27280|     72|        case '?':
  ------------------
  |  Branch (27280:9): [True: 72, False: 2.05k]
  ------------------
27281|     72|            return '?';
27282|     77|        case 'e':
  ------------------
  |  Branch (27282:9): [True: 77, False: 2.04k]
  ------------------
27283|     77|            return 27;
27284|    116|        case '"':
  ------------------
  |  Branch (27284:9): [True: 116, False: 2.00k]
  ------------------
27285|    116|            return '"';
27286|    166|        case '\\':
  ------------------
  |  Branch (27286:9): [True: 166, False: 1.95k]
  ------------------
27287|    166|            return '\\';
27288|  2.12k|    }
27289|  2.12k|}
janet.c:escapeh:
27312|    501|static int escapeh(JanetParser *p, JanetParseState *state, uint8_t c) {
27313|    501|    int digit = to_hex(c);
27314|    501|    if (digit < 0) {
  ------------------
  |  Branch (27314:9): [True: 48, False: 453]
  ------------------
27315|     48|        p->error = "invalid hex digit in hex escape";
27316|     48|        return 1;
27317|     48|    }
27318|    453|    state->argn = (state->argn << 4) + digit;
27319|    453|    state->counter--;
27320|    453|    if (!state->counter) {
  ------------------
  |  Branch (27320:9): [True: 217, False: 236]
  ------------------
27321|    217|        push_buf(p, (uint8_t)(state->argn & 0xFF));
27322|    217|        state->argn = 0;
27323|    217|        state->consumer = stringchar;
27324|    217|    }
27325|    453|    return 1;
27326|    501|}
janet.c:to_hex:
27117|  3.08k|static int to_hex(uint8_t c) {
27118|  3.08k|    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (27118:9): [True: 3.00k, False: 74]
  |  Branch (27118:21): [True: 1.35k, False: 1.65k]
  ------------------
27119|  1.35k|        return c - '0';
27120|  1.72k|    } else if (c >= 'A' && c <= 'F') {
  ------------------
  |  Branch (27120:16): [True: 1.65k, False: 79]
  |  Branch (27120:28): [True: 1.10k, False: 550]
  ------------------
27121|  1.10k|        return 10 + c - 'A';
27122|  1.10k|    } else if (c >= 'a' && c <= 'f') {
  ------------------
  |  Branch (27122:16): [True: 536, False: 93]
  |  Branch (27122:28): [True: 507, False: 29]
  ------------------
27123|    507|        return 10 + c - 'a';
27124|    507|    } else {
27125|    122|        return -1;
27126|    122|    }
27127|  3.08k|}
janet.c:escapeu:
27328|  2.57k|static int escapeu(JanetParser *p, JanetParseState *state, uint8_t c) {
27329|  2.57k|    int digit = to_hex(c);
27330|  2.57k|    if (digit < 0) {
  ------------------
  |  Branch (27330:9): [True: 74, False: 2.50k]
  ------------------
27331|     74|        p->error = "invalid hex digit in unicode escape";
27332|     74|        return 1;
27333|     74|    }
27334|  2.50k|    state->argn = (state->argn << 4) + digit;
27335|  2.50k|    state->counter--;
27336|  2.50k|    if (!state->counter) {
  ------------------
  |  Branch (27336:9): [True: 493, False: 2.01k]
  ------------------
27337|    493|        if (state->argn > 0x10FFFF) {
  ------------------
  |  Branch (27337:13): [True: 4, False: 489]
  ------------------
27338|      4|            p->error = "invalid unicode codepoint";
27339|      4|            return 1;
27340|      4|        }
27341|    489|        write_codepoint(p, state->argn);
27342|    489|        state->argn = 0;
27343|    489|        state->consumer = stringchar;
27344|    489|    }
27345|  2.50k|    return 1;
27346|  2.50k|}
janet.c:write_codepoint:
27294|    489|static void write_codepoint(JanetParser *p, int32_t codepoint) {
27295|    489|    if (codepoint <= 0x7F) {
  ------------------
  |  Branch (27295:9): [True: 42, False: 447]
  ------------------
27296|     42|        push_buf(p, (uint8_t) codepoint);
27297|    447|    } else if (codepoint <= 0x7FF) {
  ------------------
  |  Branch (27297:16): [True: 84, False: 363]
  ------------------
27298|     84|        push_buf(p, (uint8_t)((codepoint >>  6) & 0x1F) | 0xC0);
27299|     84|        push_buf(p, (uint8_t)((codepoint >>  0) & 0x3F) | 0x80);
27300|    363|    } else if (codepoint <= 0xFFFF) {
  ------------------
  |  Branch (27300:16): [True: 153, False: 210]
  ------------------
27301|    153|        push_buf(p, (uint8_t)((codepoint >> 12) & 0x0F) | 0xE0);
27302|    153|        push_buf(p, (uint8_t)((codepoint >>  6) & 0x3F) | 0x80);
27303|    153|        push_buf(p, (uint8_t)((codepoint >>  0) & 0x3F) | 0x80);
27304|    210|    } else {
27305|    210|        push_buf(p, (uint8_t)((codepoint >> 18) & 0x07) | 0xF0);
27306|    210|        push_buf(p, (uint8_t)((codepoint >> 12) & 0x3F) | 0x80);
27307|    210|        push_buf(p, (uint8_t)((codepoint >>  6) & 0x3F) | 0x80);
27308|    210|        push_buf(p, (uint8_t)((codepoint >>  0) & 0x3F) | 0x80);
27309|    210|    }
27310|    489|}
janet.c:stringend:
27369|  5.10k|static int stringend(JanetParser *p, JanetParseState *state) {
27370|  5.10k|    Janet ret;
27371|  5.10k|    uint8_t *bufstart = p->buf;
27372|  5.10k|    int32_t buflen = (int32_t) p->bufcount;
27373|  5.10k|    if (state->flags & PFLAG_LONGSTRING) {
  ------------------
  |  |27161|  5.10k|#define PFLAG_LONGSTRING 0x4000
  ------------------
  |  Branch (27373:9): [True: 1.30k, False: 3.80k]
  ------------------
27374|       |        /* Post process to remove leading whitespace */
27375|  1.30k|        JanetParseState top = p->states[p->statecount - 1];
27376|  1.30k|        int32_t indent_col = (int32_t) top.column - 1;
27377|  1.30k|        uint8_t *r = bufstart, *end = r + buflen;
27378|       |        /* Unless there are only spaces before EOLs, disable reindenting */
27379|  1.30k|        int reindent = 1;
27380|  8.30k|        while (reindent && (r < end)) {
  ------------------
  |  Branch (27380:16): [True: 8.17k, False: 137]
  |  Branch (27380:28): [True: 7.00k, False: 1.16k]
  ------------------
27381|  7.00k|            if (*r++ == '\n') {
  ------------------
  |  Branch (27381:17): [True: 1.42k, False: 5.57k]
  ------------------
27382|  1.51k|                for (int32_t j = 0; (r < end) && (*r != '\n') && (j < indent_col); j++, r++) {
  ------------------
  |  Branch (27382:37): [True: 1.01k, False: 500]
  |  Branch (27382:50): [True: 583, False: 436]
  |  Branch (27382:66): [True: 269, False: 314]
  ------------------
27383|    269|                    if (*r != ' ') {
  ------------------
  |  Branch (27383:25): [True: 177, False: 92]
  ------------------
27384|    177|                        reindent = 0;
27385|    177|                        break;
27386|    177|                    }
27387|    269|                }
27388|  1.42k|                if ((r + 1) < end && *r == '\r' && *(r + 1) == '\n') reindent = 1;
  ------------------
  |  Branch (27388:21): [True: 792, False: 635]
  |  Branch (27388:38): [True: 287, False: 505]
  |  Branch (27388:52): [True: 190, False: 97]
  ------------------
27389|  1.42k|            }
27390|  7.00k|        }
27391|       |        /* Now reindent if able */
27392|  1.30k|        if (reindent) {
  ------------------
  |  Branch (27392:13): [True: 1.16k, False: 137]
  ------------------
27393|  1.16k|            uint8_t *w = bufstart;
27394|  1.16k|            r = bufstart;
27395|  7.67k|            while (r < end) {
  ------------------
  |  Branch (27395:20): [True: 6.50k, False: 1.16k]
  ------------------
27396|  6.50k|                if (*r == '\n') {
  ------------------
  |  Branch (27396:21): [True: 1.24k, False: 5.26k]
  ------------------
27397|  1.24k|                    *w++ = *r++;
27398|  1.33k|                    for (int32_t j = 0; (r < end) && (*r != '\n') && (j < indent_col); j++, r++);
  ------------------
  |  Branch (27398:41): [True: 839, False: 500]
  |  Branch (27398:54): [True: 410, False: 429]
  |  Branch (27398:70): [True: 96, False: 314]
  ------------------
27399|  1.24k|                    if ((r + 1) < end && *r == '\r' && *(r + 1) == '\n') *w++ = *r++;
  ------------------
  |  Branch (27399:25): [True: 684, False: 559]
  |  Branch (27399:42): [True: 238, False: 446]
  |  Branch (27399:56): [True: 150, False: 88]
  ------------------
27400|  5.26k|                } else {
27401|  5.26k|                    *w++ = *r++;
27402|  5.26k|                }
27403|  6.50k|            }
27404|  1.16k|            buflen = (int32_t)(w - bufstart);
27405|  1.16k|        }
27406|       |        /* Check for leading EOL so we can remove it */
27407|  1.30k|        if (buflen > 1 && bufstart[0] == '\r' && bufstart[1] == '\n') { /* Windows EOL */
  ------------------
  |  Branch (27407:13): [True: 770, False: 534]
  |  Branch (27407:27): [True: 185, False: 585]
  |  Branch (27407:50): [True: 96, False: 89]
  ------------------
27408|     96|            buflen = buflen - 2;
27409|     96|            bufstart = bufstart + 2;
27410|  1.20k|        } else if (buflen > 0 && bufstart[0] == '\n') { /* Unix EOL */
  ------------------
  |  Branch (27410:20): [True: 1.20k, False: 0]
  |  Branch (27410:34): [True: 459, False: 749]
  ------------------
27411|    459|            buflen--;
27412|    459|            bufstart++;
27413|    459|        }
27414|       |        /* Check for trailing EOL so we can remove it */
27415|  1.30k|        if (buflen > 1 && bufstart[buflen - 2] == '\r' && bufstart[buflen - 1] == '\n') { /* Windows EOL */
  ------------------
  |  Branch (27415:13): [True: 612, False: 692]
  |  Branch (27415:27): [True: 140, False: 472]
  |  Branch (27415:59): [True: 40, False: 100]
  ------------------
27416|     40|            buflen = buflen - 2;
27417|  1.26k|        } else if (buflen > 0 && bufstart[buflen - 1] == '\n') { /* Unix EOL */
  ------------------
  |  Branch (27417:20): [True: 917, False: 347]
  |  Branch (27417:34): [True: 118, False: 799]
  ------------------
27418|    118|            buflen--;
27419|    118|        }
27420|  1.30k|    }
27421|  5.10k|    if (state->flags & PFLAG_BUFFER) {
  ------------------
  |  |27156|  5.10k|#define PFLAG_BUFFER 0x200
  ------------------
  |  Branch (27421:9): [True: 462, False: 4.64k]
  ------------------
27422|    462|        JanetBuffer *b = janet_buffer(buflen);
27423|    462|        janet_buffer_push_bytes(b, bufstart, buflen);
27424|    462|        ret = janet_wrap_buffer(b);
  ------------------
  |  |  847|    462|#define janet_wrap_buffer(s) janet_nanbox_wrap_((s), JANET_BUFFER)
  |  |  ------------------
  |  |  |  |  825|    462|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|    462|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|    462|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
27425|  4.64k|    } else {
27426|  4.64k|        ret = janet_wrap_string(janet_string(bufstart, buflen));
  ------------------
  |  |  848|  4.64k|#define janet_wrap_string(s) janet_nanbox_wrap_c((s), JANET_STRING)
  |  |  ------------------
  |  |  |  |  828|  4.64k|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  4.64k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  4.64k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
27427|  4.64k|    }
27428|  5.10k|    p->bufcount = 0;
27429|  5.10k|    popstate(p, ret);
27430|  5.10k|    return 1;
27431|  5.10k|}
janet.c:comment:
27515|  6.01k|static int comment(JanetParser *p, JanetParseState *state, uint8_t c) {
27516|  6.01k|    (void) state;
27517|  6.01k|    if (c == '\n') {
  ------------------
  |  Branch (27517:9): [True: 544, False: 5.47k]
  ------------------
27518|    544|        p->statecount--;
27519|    544|        p->bufcount = 0;
27520|  5.47k|    } else {
27521|  5.47k|        push_buf(p, c);
27522|  5.47k|    }
27523|  6.01k|    return 1;
27524|  6.01k|}
janet.c:atsign:
27610|  3.97k|static int atsign(JanetParser *p, JanetParseState *state, uint8_t c) {
27611|  3.97k|    (void) state;
27612|  3.97k|    p->statecount--;
27613|  3.97k|    switch (c) {
27614|  2.27k|        case '{':
  ------------------
  |  Branch (27614:9): [True: 2.27k, False: 1.69k]
  ------------------
27615|  2.27k|            pushstate(p, root, PFLAG_CONTAINER | PFLAG_CURLYBRACKETS | PFLAG_ATSYM);
  ------------------
  |  |27155|  2.27k|#define PFLAG_CONTAINER 0x100
  ------------------
                          pushstate(p, root, PFLAG_CONTAINER | PFLAG_CURLYBRACKETS | PFLAG_ATSYM);
  ------------------
  |  |27159|  2.27k|#define PFLAG_CURLYBRACKETS 0x1000
  ------------------
                          pushstate(p, root, PFLAG_CONTAINER | PFLAG_CURLYBRACKETS | PFLAG_ATSYM);
  ------------------
  |  |27163|  2.27k|#define PFLAG_ATSYM 0x10000
  ------------------
27616|  2.27k|            return 1;
27617|    316|        case '"':
  ------------------
  |  Branch (27617:9): [True: 316, False: 3.65k]
  ------------------
27618|    316|            pushstate(p, stringchar, PFLAG_BUFFER | PFLAG_STRING);
  ------------------
  |  |27156|    316|#define PFLAG_BUFFER 0x200
  ------------------
                          pushstate(p, stringchar, PFLAG_BUFFER | PFLAG_STRING);
  ------------------
  |  |27160|    316|#define PFLAG_STRING 0x2000
  ------------------
27619|    316|            return 1;
27620|    158|        case '`':
  ------------------
  |  Branch (27620:9): [True: 158, False: 3.81k]
  ------------------
27621|    158|            pushstate(p, longstring, PFLAG_BUFFER | PFLAG_LONGSTRING);
  ------------------
  |  |27156|    158|#define PFLAG_BUFFER 0x200
  ------------------
                          pushstate(p, longstring, PFLAG_BUFFER | PFLAG_LONGSTRING);
  ------------------
  |  |27161|    158|#define PFLAG_LONGSTRING 0x4000
  ------------------
27622|    158|            return 1;
27623|    305|        case '[':
  ------------------
  |  Branch (27623:9): [True: 305, False: 3.66k]
  ------------------
27624|    305|            pushstate(p, root, PFLAG_CONTAINER | PFLAG_SQRBRACKETS | PFLAG_ATSYM);
  ------------------
  |  |27155|    305|#define PFLAG_CONTAINER 0x100
  ------------------
                          pushstate(p, root, PFLAG_CONTAINER | PFLAG_SQRBRACKETS | PFLAG_ATSYM);
  ------------------
  |  |27158|    305|#define PFLAG_SQRBRACKETS 0x800
  ------------------
                          pushstate(p, root, PFLAG_CONTAINER | PFLAG_SQRBRACKETS | PFLAG_ATSYM);
  ------------------
  |  |27163|    305|#define PFLAG_ATSYM 0x10000
  ------------------
27625|    305|            return 1;
27626|    106|        case '(':
  ------------------
  |  Branch (27626:9): [True: 106, False: 3.86k]
  ------------------
27627|    106|            pushstate(p, root, PFLAG_CONTAINER | PFLAG_PARENS | PFLAG_ATSYM);
  ------------------
  |  |27155|    106|#define PFLAG_CONTAINER 0x100
  ------------------
                          pushstate(p, root, PFLAG_CONTAINER | PFLAG_PARENS | PFLAG_ATSYM);
  ------------------
  |  |27157|    106|#define PFLAG_PARENS 0x400
  ------------------
                          pushstate(p, root, PFLAG_CONTAINER | PFLAG_PARENS | PFLAG_ATSYM);
  ------------------
  |  |27163|    106|#define PFLAG_ATSYM 0x10000
  ------------------
27628|    106|            return 1;
27629|    813|        default:
  ------------------
  |  Branch (27629:9): [True: 813, False: 3.16k]
  ------------------
27630|    813|            break;
27631|  3.97k|    }
27632|    813|    pushstate(p, tokenchar, PFLAG_TOKEN);
  ------------------
  |  |27165|    813|#define PFLAG_TOKEN 0x40000
  ------------------
27633|    813|    push_buf(p, '@'); /* Push the leading at-sign that was dropped */
27634|    813|    return 0;
27635|  3.97k|}
janet.c:longstring:
27566|  13.9k|static int longstring(JanetParser *p, JanetParseState *state, uint8_t c) {
27567|  13.9k|    if (state->flags & PFLAG_INSTRING) {
  ------------------
  |  |27564|  13.9k|#define PFLAG_INSTRING 0x100000
  ------------------
  |  Branch (27567:9): [True: 8.26k, False: 5.69k]
  ------------------
27568|       |        /* We are inside the long string */
27569|  8.26k|        if (c == '`') {
  ------------------
  |  Branch (27569:13): [True: 1.50k, False: 6.75k]
  ------------------
27570|  1.50k|            state->flags |= PFLAG_END_CANDIDATE;
  ------------------
  |  |27565|  1.50k|#define PFLAG_END_CANDIDATE 0x200000
  ------------------
27571|  1.50k|            state->flags &= ~PFLAG_INSTRING;
  ------------------
  |  |27564|  1.50k|#define PFLAG_INSTRING 0x100000
  ------------------
27572|  1.50k|            state->counter = 1; /* Use counter to keep track of number of '=' seen */
27573|  1.50k|            return 1;
27574|  1.50k|        }
27575|  6.75k|        push_buf(p, c);
27576|  6.75k|        return 1;
27577|  8.26k|    } else if (state->flags & PFLAG_END_CANDIDATE) {
  ------------------
  |  |27565|  5.69k|#define PFLAG_END_CANDIDATE 0x200000
  ------------------
  |  Branch (27577:16): [True: 2.03k, False: 3.65k]
  ------------------
27578|  2.03k|        int i;
27579|       |        /* We are checking a potential end of the string */
27580|  2.03k|        if (state->counter == state->argn) {
  ------------------
  |  Branch (27580:13): [True: 1.30k, False: 734]
  ------------------
27581|  1.30k|            stringend(p, state);
27582|  1.30k|            return 0;
27583|  1.30k|        }
27584|    734|        if (c == '`' && state->counter < state->argn) {
  ------------------
  |  Branch (27584:13): [True: 533, False: 201]
  |  Branch (27584:25): [True: 533, False: 0]
  ------------------
27585|    533|            state->counter++;
27586|    533|            return 1;
27587|    533|        }
27588|       |        /* Failed end candidate */
27589|    831|        for (i = 0; i < state->counter; i++) {
  ------------------
  |  Branch (27589:21): [True: 630, False: 201]
  ------------------
27590|    630|            push_buf(p, '`');
27591|    630|        }
27592|    201|        push_buf(p, c);
27593|    201|        state->counter = 0;
27594|    201|        state->flags &= ~PFLAG_END_CANDIDATE;
  ------------------
  |  |27565|    201|#define PFLAG_END_CANDIDATE 0x200000
  ------------------
27595|    201|        state->flags |= PFLAG_INSTRING;
  ------------------
  |  |27564|    201|#define PFLAG_INSTRING 0x100000
  ------------------
27596|    201|        return 1;
27597|  3.65k|    } else {
27598|       |        /* We are at beginning of string */
27599|  3.65k|        state->argn++;
27600|  3.65k|        if (c != '`') {
  ------------------
  |  Branch (27600:13): [True: 1.45k, False: 2.19k]
  ------------------
27601|  1.45k|            state->flags |= PFLAG_INSTRING;
  ------------------
  |  |27564|  1.45k|#define PFLAG_INSTRING 0x100000
  ------------------
27602|  1.45k|            push_buf(p, c);
27603|  1.45k|        }
27604|  3.65k|        return 1;
27605|  3.65k|    }
27606|  13.9k|}
janet.c:close_array:
27534|    275|static Janet close_array(JanetParser *p, JanetParseState *state) {
27535|    275|    JanetArray *array = janet_array(state->argn);
27536|    775|    for (int32_t i = state->argn - 1; i >= 0; i--)
  ------------------
  |  Branch (27536:39): [True: 500, False: 275]
  ------------------
27537|    500|        array->data[i] = p->args[--p->argcount];
27538|    275|    array->count = state->argn;
27539|    275|    return janet_wrap_array(array);
  ------------------
  |  |  845|    275|#define janet_wrap_array(s) janet_nanbox_wrap_((s), JANET_ARRAY)
  |  |  ------------------
  |  |  |  |  825|    275|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|    275|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|    275|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
27540|    275|}
janet.c:close_tuple:
27526|  6.86k|static Janet close_tuple(JanetParser *p, JanetParseState *state, int32_t flag) {
27527|  6.86k|    Janet *ret = janet_tuple_begin(state->argn);
27528|  6.86k|    janet_tuple_flag(ret) |= flag;
  ------------------
  |  | 1806|  6.86k|#define janet_tuple_flag(t) (janet_tuple_head(t)->gc.flags)
  |  |  ------------------
  |  |  |  | 1800|  6.86k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
27529|  25.4k|    for (int32_t i = state->argn - 1; i >= 0; i--)
  ------------------
  |  Branch (27529:39): [True: 18.6k, False: 6.86k]
  ------------------
27530|  18.6k|        ret[i] = p->args[--p->argcount];
27531|  6.86k|    return janet_wrap_tuple(janet_tuple_end(ret));
  ------------------
  |  |  843|  6.86k|#define janet_wrap_tuple(s) janet_nanbox_wrap_c((s), JANET_TUPLE)
  |  |  ------------------
  |  |  |  |  828|  6.86k|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  6.86k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  6.86k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
27532|  6.86k|}
janet.c:close_table:
27553|  2.14k|static Janet close_table(JanetParser *p, JanetParseState *state) {
27554|  2.14k|    JanetTable *table = janet_table(state->argn >> 1);
27555|  5.01k|    for (size_t i = p->argcount - state->argn; i < p->argcount; i += 2) {
  ------------------
  |  Branch (27555:48): [True: 2.86k, False: 2.14k]
  ------------------
27556|  2.86k|        Janet key = p->args[i];
27557|  2.86k|        Janet value = p->args[i + 1];
27558|  2.86k|        janet_table_put(table, key, value);
27559|  2.86k|    }
27560|  2.14k|    p->argcount -= state->argn;
27561|  2.14k|    return janet_wrap_table(table);
  ------------------
  |  |  846|  2.14k|#define janet_wrap_table(s) janet_nanbox_wrap_((s), JANET_TABLE)
  |  |  ------------------
  |  |  |  |  825|  2.14k|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  2.14k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  2.14k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
27562|  2.14k|}
janet.c:close_struct:
27542|  5.03k|static Janet close_struct(JanetParser *p, JanetParseState *state) {
27543|  5.03k|    JanetKV *st = janet_struct_begin(state->argn >> 1);
27544|  10.0k|    for (size_t i = p->argcount - state->argn; i < p->argcount; i += 2) {
  ------------------
  |  Branch (27544:48): [True: 4.98k, False: 5.03k]
  ------------------
27545|  4.98k|        Janet key = p->args[i];
27546|  4.98k|        Janet value = p->args[i + 1];
27547|  4.98k|        janet_struct_put(st, key, value);
27548|  4.98k|    }
27549|  5.03k|    p->argcount -= state->argn;
27550|  5.03k|    return janet_wrap_struct(janet_struct_end(st));
  ------------------
  |  |  842|  5.03k|#define janet_wrap_struct(s) janet_nanbox_wrap_c((s), JANET_STRUCT)
  |  |  ------------------
  |  |  |  |  828|  5.03k|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  5.03k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  5.03k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
27551|  5.03k|}
janet.c:popstate:
27178|  53.6k|static void popstate(JanetParser *p, Janet val) {
27179|  86.0k|    for (;;) {
27180|  86.0k|        JanetParseState top = p->states[--p->statecount];
27181|  86.0k|        JanetParseState *newtop = p->states + p->statecount - 1;
27182|       |        /* Source mapping info */
27183|  86.0k|        if (janet_checktype(val, JANET_TUPLE)) {
  ------------------
  |  |  806|  86.0k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 39.2k, False: 46.7k]
  |  |  |  Branch (806:6): [Folded, False: 86.0k]
  |  |  ------------------
  |  |  807|  86.0k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  86.0k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  86.0k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  86.0k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  86.0k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  86.0k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
27184|  39.2k|            janet_tuple_sm_line(janet_unwrap_tuple(val)) = (int32_t) top.line;
  ------------------
  |  | 1804|  39.2k|#define janet_tuple_sm_line(t) (janet_tuple_head(t)->sm_line)
  |  |  ------------------
  |  |  |  | 1800|  39.2k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
27185|  39.2k|            janet_tuple_sm_column(janet_unwrap_tuple(val)) = (int32_t) top.column;
  ------------------
  |  | 1805|  39.2k|#define janet_tuple_sm_column(t) (janet_tuple_head(t)->sm_column)
  |  |  ------------------
  |  |  |  | 1800|  39.2k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
27186|  39.2k|        }
27187|  86.0k|        if (newtop->flags & PFLAG_CONTAINER) {
  ------------------
  |  |27155|  86.0k|#define PFLAG_CONTAINER 0x100
  ------------------
  |  Branch (27187:13): [True: 53.6k, False: 32.3k]
  ------------------
27188|  53.6k|            newtop->argn++;
27189|       |            /* Keep track of number of values in the root state */
27190|  53.6k|            if (p->statecount == 1) {
  ------------------
  |  Branch (27190:17): [True: 13.9k, False: 39.6k]
  ------------------
27191|  13.9k|                p->pending++;
27192|       |                /* Root items are always wrapped in a tuple for source map info. */
27193|  13.9k|                const Janet *tup = janet_tuple_n(&val, 1);
27194|  13.9k|                janet_tuple_sm_line(tup) = (int32_t) top.line;
  ------------------
  |  | 1804|  13.9k|#define janet_tuple_sm_line(t) (janet_tuple_head(t)->sm_line)
  |  |  ------------------
  |  |  |  | 1800|  13.9k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
27195|  13.9k|                janet_tuple_sm_column(tup) = (int32_t) top.column;
  ------------------
  |  | 1805|  13.9k|#define janet_tuple_sm_column(t) (janet_tuple_head(t)->sm_column)
  |  |  ------------------
  |  |  |  | 1800|  13.9k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
27196|  13.9k|                val = janet_wrap_tuple(tup);
  ------------------
  |  |  843|  13.9k|#define janet_wrap_tuple(s) janet_nanbox_wrap_c((s), JANET_TUPLE)
  |  |  ------------------
  |  |  |  |  828|  13.9k|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  13.9k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  13.9k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
27197|  13.9k|            }
27198|  53.6k|            push_arg(p, val);
27199|  53.6k|            return;
27200|  53.6k|        } else if (newtop->flags & PFLAG_READERMAC) {
  ------------------
  |  |27162|  32.3k|#define PFLAG_READERMAC 0x8000
  ------------------
  |  Branch (27200:20): [True: 32.3k, False: 0]
  ------------------
27201|  32.3k|            Janet *t = janet_tuple_begin(2);
27202|  32.3k|            int c = newtop->flags & 0xFF;
27203|  32.3k|            const char *which =
27204|  32.3k|                (c == '\'') ? "quote" :
  ------------------
  |  Branch (27204:17): [True: 17.6k, False: 14.6k]
  ------------------
27205|  32.3k|                (c == ',') ? "unquote" :
  ------------------
  |  Branch (27205:17): [True: 5.08k, False: 9.59k]
  ------------------
27206|  14.6k|                (c == ';') ? "splice" :
  ------------------
  |  Branch (27206:17): [True: 3.39k, False: 6.19k]
  ------------------
27207|  9.59k|                (c == '|') ? "short-fn" :
  ------------------
  |  Branch (27207:17): [True: 2.74k, False: 3.45k]
  ------------------
27208|  6.19k|                (c == '~') ? "quasiquote" : "<unknown>";
  ------------------
  |  Branch (27208:17): [True: 3.45k, False: 0]
  ------------------
27209|  32.3k|            t[0] = janet_csymbolv(which);
  ------------------
  |  | 1837|  32.3k|#define janet_csymbolv(cstr) janet_wrap_symbol(janet_csymbol(cstr))
  |  |  ------------------
  |  |  |  |  849|  32.3k|#define janet_wrap_symbol(s) janet_nanbox_wrap_c((s), JANET_SYMBOL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  828|  32.3k|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  793|  32.3k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  792|  32.3k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
27210|  32.3k|            t[1] = val;
27211|       |            /* Quote source mapping info */
27212|  32.3k|            janet_tuple_sm_line(t) = (int32_t) newtop->line;
  ------------------
  |  | 1804|  32.3k|#define janet_tuple_sm_line(t) (janet_tuple_head(t)->sm_line)
  |  |  ------------------
  |  |  |  | 1800|  32.3k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
27213|  32.3k|            janet_tuple_sm_column(t) = (int32_t) newtop->column;
  ------------------
  |  | 1805|  32.3k|#define janet_tuple_sm_column(t) (janet_tuple_head(t)->sm_column)
  |  |  ------------------
  |  |  |  | 1800|  32.3k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
27214|  32.3k|            val = janet_wrap_tuple(janet_tuple_end(t));
  ------------------
  |  |  843|  32.3k|#define janet_wrap_tuple(s) janet_nanbox_wrap_c((s), JANET_TUPLE)
  |  |  ------------------
  |  |  |  |  828|  32.3k|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  32.3k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  32.3k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
27215|  32.3k|        } else {
27216|      0|            return;
27217|      0|        }
27218|  86.0k|    }
27219|  53.6k|}
janet.c:tokenchar:
27462|   145k|static int tokenchar(JanetParser *p, JanetParseState *state, uint8_t c) {
27463|   145k|    Janet ret;
27464|   145k|    double numval;
27465|   145k|    int32_t blen;
27466|   145k|    if (janet_is_symbol_char(c)) {
  ------------------
  |  Branch (27466:9): [True: 110k, False: 34.9k]
  ------------------
27467|   110k|        push_buf(p, (uint8_t) c);
27468|   110k|        if (c > 127) state->argn = 1; /* Use to indicate non ascii */
  ------------------
  |  Branch (27468:13): [True: 4.22k, False: 105k]
  ------------------
27469|   110k|        return 1;
27470|   110k|    }
27471|       |    /* Token finished */
27472|  34.9k|    blen = (int32_t) p->bufcount;
27473|  34.9k|    int start_dig = p->buf[0] >= '0' && p->buf[0] <= '9';
  ------------------
  |  Branch (27473:21): [True: 25.4k, False: 9.51k]
  |  Branch (27473:41): [True: 12.2k, False: 13.1k]
  ------------------
27474|  34.9k|    int start_num = start_dig || p->buf[0] == '-' || p->buf[0] == '+' || p->buf[0] == '.';
  ------------------
  |  Branch (27474:21): [True: 12.2k, False: 22.6k]
  |  Branch (27474:34): [True: 3.01k, False: 19.6k]
  |  Branch (27474:54): [True: 1.60k, False: 18.0k]
  |  Branch (27474:74): [True: 2.21k, False: 15.8k]
  ------------------
27475|  34.9k|    if (p->buf[0] == ':') {
  ------------------
  |  Branch (27475:9): [True: 1.80k, False: 33.1k]
  ------------------
27476|       |        /* Don't do full utf-8 check unless we have seen non ascii characters. */
27477|  1.80k|        int valid = (!state->argn) || janet_valid_utf8(p->buf + 1, blen - 1);
  ------------------
  |  Branch (27477:21): [True: 1.61k, False: 192]
  |  Branch (27477:39): [True: 143, False: 49]
  ------------------
27478|  1.80k|        if (!valid) {
  ------------------
  |  Branch (27478:13): [True: 49, False: 1.75k]
  ------------------
27479|     49|            p->error = "invalid utf-8 in keyword";
27480|     49|            return 0;
27481|     49|        }
27482|  1.75k|        ret = janet_keywordv(p->buf + 1, blen - 1);
  ------------------
  |  | 1842|  1.75k|#define janet_keywordv(str, len) janet_wrap_keyword(janet_keyword((str), (len)))
  |  |  ------------------
  |  |  |  |  850|  1.75k|#define janet_wrap_keyword(s) janet_nanbox_wrap_c((s), JANET_KEYWORD)
  |  |  |  |  ------------------
  |  |  |  |  |  |  828|  1.75k|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  793|  1.75k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  792|  1.75k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
27483|  1.75k|#ifdef JANET_INT_TYPES
27484|  33.1k|    } else if (start_num && !janet_scan_numeric(p->buf, blen, &ret)) {
  ------------------
  |  Branch (27484:16): [True: 19.1k, False: 14.0k]
  |  Branch (27484:29): [True: 14.0k, False: 5.05k]
  ------------------
27485|  14.0k|        (void) numval;
27486|       |#else
27487|       |    } else if (start_num && !janet_scan_number(p->buf, blen, &numval)) {
27488|       |        ret = janet_wrap_number(numval);
27489|       |#endif
27490|  19.0k|    } else if (!check_str_const("nil", p->buf, blen)) {
  ------------------
  |  Branch (27490:16): [True: 358, False: 18.7k]
  ------------------
27491|    358|        ret = janet_wrap_nil();
  ------------------
  |  |  831|    358|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|    358|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|    358|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|    358|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
27492|  18.7k|    } else if (!check_str_const("false", p->buf, blen)) {
  ------------------
  |  Branch (27492:16): [True: 111, False: 18.5k]
  ------------------
27493|    111|        ret = janet_wrap_false();
  ------------------
  |  |  833|    111|#define janet_wrap_false() janet_nanbox_from_payload(JANET_BOOLEAN, 0)
  |  |  ------------------
  |  |  |  |  822|    111|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|    111|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|    111|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
27494|  18.5k|    } else if (!check_str_const("true", p->buf, blen)) {
  ------------------
  |  Branch (27494:16): [True: 82, False: 18.5k]
  ------------------
27495|     82|        ret = janet_wrap_true();
  ------------------
  |  |  832|     82|#define janet_wrap_true() janet_nanbox_from_payload(JANET_BOOLEAN, 1)
  |  |  ------------------
  |  |  |  |  822|     82|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|     82|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|     82|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
27496|  18.5k|    } else {
27497|  18.5k|        if (start_dig) {
  ------------------
  |  Branch (27497:13): [True: 406, False: 18.1k]
  ------------------
27498|    406|            p->error = "symbol literal cannot start with a digit";
27499|    406|            return 0;
27500|  18.1k|        } else {
27501|       |            /* Don't do full utf-8 check unless we have seen non ascii characters. */
27502|  18.1k|            int valid = (!state->argn) || janet_valid_utf8(p->buf, blen);
  ------------------
  |  Branch (27502:25): [True: 17.4k, False: 692]
  |  Branch (27502:43): [True: 428, False: 264]
  ------------------
27503|  18.1k|            if (!valid) {
  ------------------
  |  Branch (27503:17): [True: 264, False: 17.8k]
  ------------------
27504|    264|                p->error = "invalid utf-8 in symbol";
27505|    264|                return 0;
27506|    264|            }
27507|  17.8k|            ret = janet_symbolv(p->buf, blen);
  ------------------
  |  | 1836|  17.8k|#define janet_symbolv(str, len) janet_wrap_symbol(janet_symbol((str), (len)))
  |  |  ------------------
  |  |  |  |  849|  17.8k|#define janet_wrap_symbol(s) janet_nanbox_wrap_c((s), JANET_SYMBOL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  828|  17.8k|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  793|  17.8k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  792|  17.8k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
27508|  17.8k|        }
27509|  18.5k|    }
27510|  34.2k|    p->bufcount = 0;
27511|  34.2k|    popstate(p, ret);
27512|  34.2k|    return 0;
27513|  34.9k|}
janet.c:check_str_const:
27450|  56.3k|static int check_str_const(const char *cstr, const uint8_t *str, int32_t len) {
27451|  56.3k|    int32_t index;
27452|  60.4k|    for (index = 0; index < len; index++) {
  ------------------
  |  Branch (27452:21): [True: 59.2k, False: 1.21k]
  ------------------
27453|  59.2k|        uint8_t c = str[index];
27454|  59.2k|        uint8_t k = ((const uint8_t *)cstr)[index];
27455|  59.2k|        if (c < k) return -1;
  ------------------
  |  Branch (27455:13): [True: 45.8k, False: 13.3k]
  ------------------
27456|  13.3k|        if (c > k) return 1;
  ------------------
  |  Branch (27456:13): [True: 9.32k, False: 4.04k]
  ------------------
27457|  4.04k|        if (k == '\0') break;
  ------------------
  |  Branch (27457:13): [True: 0, False: 4.04k]
  ------------------
27458|  4.04k|    }
27459|  1.21k|    return (cstr[index] == '\0') ? 0 : -1;
  ------------------
  |  Branch (27459:12): [True: 551, False: 661]
  ------------------
27460|  56.3k|}
janet.c:size_padded:
29988|  4.67k|static size_t size_padded(size_t offset, size_t size) {
29989|  4.67k|    size_t x = size + offset - 1;
29990|  4.67k|    return x - (x % size);
29991|  4.67k|}
janet.c:compile_peg:
30263|  5.06k|static JanetPeg *compile_peg(Janet x) {
30264|  5.06k|    Builder builder;
30265|  5.06k|    builder.grammar = janet_table(0);
30266|  5.06k|    builder.default_grammar = NULL;
30267|  5.06k|    {
30268|  5.06k|        Janet default_grammarv = janet_dyn("peg-grammar");
30269|  5.06k|        if (janet_checktype(default_grammarv, JANET_TABLE)) {
  ------------------
  |  |  806|  5.06k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 0, False: 5.06k]
  |  |  |  Branch (806:6): [Folded, False: 5.06k]
  |  |  ------------------
  |  |  807|  5.06k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  5.06k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  5.06k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  5.06k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  5.06k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  5.06k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
30270|      0|            builder.default_grammar = janet_unwrap_table(default_grammarv);
  ------------------
  |  |  861|      0|#define janet_unwrap_table(x) ((JanetTable *)janet_nanbox_to_pointer(x))
  ------------------
30271|      0|        }
30272|  5.06k|    }
30273|  5.06k|    builder.tags = janet_table(0);
30274|  5.06k|    builder.constants = NULL;
30275|  5.06k|    builder.bytecode = NULL;
30276|  5.06k|    builder.nexttag = 1;
30277|  5.06k|    builder.form = x;
30278|  5.06k|    builder.depth = JANET_RECURSION_GUARD;
  ------------------
  |  |  296|  5.06k|#define JANET_RECURSION_GUARD 1024
  ------------------
30279|  5.06k|    builder.has_backref = 0;
30280|  5.06k|    peg_compile1(&builder, x);
30281|  5.06k|    JanetPeg *peg = make_peg(&builder);
30282|  5.06k|    builder_cleanup(&builder);
30283|  5.06k|    return peg;
30284|  5.06k|}
janet.c:peg_compile1:
29799|  24.4k|static uint32_t peg_compile1(Builder *b, Janet peg) {
29800|       |
29801|       |    /* Keep track of the form being compiled for error purposes */
29802|  24.4k|    Janet old_form = b->form;
29803|  24.4k|    JanetTable *old_grammar = b->grammar;
29804|  24.4k|    b->form = peg;
29805|       |
29806|       |    /* Resolve keyword references */
29807|  24.4k|    int i = JANET_RECURSION_GUARD;
  ------------------
  |  |  296|  24.4k|#define JANET_RECURSION_GUARD 1024
  ------------------
29808|  24.4k|    JanetTable *grammar = old_grammar;
29809|  24.4k|    for (; i > 0 && janet_checktype(peg, JANET_KEYWORD); --i) {
  ------------------
  |  |  806|  24.4k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 43, False: 24.3k]
  |  |  |  Branch (806:6): [Folded, False: 24.4k]
  |  |  ------------------
  |  |  807|  24.4k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  24.4k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  24.4k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  24.4k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  24.4k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  24.4k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (29809:12): [True: 24.4k, False: 0]
  ------------------
29810|     43|        Janet nextPeg = janet_table_get_ex(grammar, peg, &grammar);
29811|     43|        if (!grammar || janet_checktype(nextPeg, JANET_NIL)) {
  ------------------
  |  |  806|     43|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 43, False: 0]
  |  |  |  Branch (806:6): [Folded, False: 43]
  |  |  ------------------
  |  |  807|     43|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|     43|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|     43|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|     43|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|     43|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|     43|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (29811:13): [True: 0, False: 43]
  ------------------
29812|     43|            nextPeg = (b->default_grammar == NULL)
  ------------------
  |  Branch (29812:23): [True: 43, False: 0]
  ------------------
29813|     43|                      ? janet_wrap_nil()
  ------------------
  |  |  831|     43|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|     43|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|     43|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|     43|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29814|     43|                      : janet_table_get(b->default_grammar, peg);
29815|     43|            if (janet_checktype(nextPeg, JANET_NIL)) {
  ------------------
  |  |  806|     43|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 43, False: 0]
  |  |  |  Branch (806:6): [Folded, False: 43]
  |  |  ------------------
  |  |  807|     43|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|     43|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|     43|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|     43|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|     43|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|     43|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29816|     43|                peg_panic(b, "unknown rule");
29817|     43|            }
29818|     43|        }
29819|      0|        peg = nextPeg;
29820|      0|        b->form = peg;
29821|      0|        b->grammar = grammar;
29822|      0|    }
29823|  24.3k|    if (i == 0)
  ------------------
  |  Branch (29823:9): [True: 0, False: 24.3k]
  ------------------
29824|      0|        peg_panic(b, "reference chain too deep");
29825|       |
29826|       |    /* Check cache - for tuples we check only the local cache, as
29827|       |     * in a different grammar, the same tuple can compile to a different
29828|       |     * rule - for example, (+ :a :b) depends on whatever :a and :b are bound to. */
29829|  24.3k|    Janet check = janet_checktype(peg, JANET_TUPLE)
  ------------------
  |  |  806|  24.3k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 17.7k, False: 6.57k]
  |  |  |  Branch (806:6): [Folded, False: 24.3k]
  |  |  ------------------
  |  |  807|  24.3k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  24.3k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  24.3k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  24.3k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  24.3k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  24.3k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29830|  24.3k|                  ? janet_table_rawget(grammar, peg)
29831|  24.3k|                  : janet_table_get(grammar, peg);
29832|  24.3k|    if (!janet_checktype(check, JANET_NIL)) {
  ------------------
  |  |  806|  24.3k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 24.3k]
  |  |  ------------------
  |  |  807|  24.3k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  24.3k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  24.3k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  24.3k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  24.3k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  24.3k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (29832:9): [True: 1.46k, False: 22.9k]
  ------------------
29833|  1.46k|        b->form = old_form;
29834|  1.46k|        b->grammar = old_grammar;
29835|  1.46k|        return (uint32_t) janet_unwrap_number(check);
  ------------------
  |  |  839|  1.46k|#define janet_unwrap_number(x) ((x).number)
  ------------------
29836|  1.46k|    }
29837|       |
29838|       |    /* Check depth */
29839|  22.9k|    if (b->depth-- == 0)
  ------------------
  |  Branch (29839:9): [True: 0, False: 22.9k]
  ------------------
29840|      0|        peg_panic(b, "peg grammar recursed too deeply");
29841|       |
29842|       |    /* The final rule to return */
29843|  22.9k|    uint32_t rule = janet_v_count(b->bytecode);
  ------------------
  |  |  736|  22.9k|#define janet_v_count(v)        (((v) != NULL) ? janet_v__cnt(v) : 0)
  |  |  ------------------
  |  |  |  |  743|  17.8k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  741|  17.8k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (736:34): [True: 17.8k, False: 5.02k]
  |  |  ------------------
  ------------------
29844|       |
29845|       |    /* Add to cache. Do not cache structs, as we don't yet know
29846|       |     * what rule they will return! We can just as effectively cache
29847|       |     * the structs main rule. */
29848|  22.9k|    if (!janet_checktype(peg, JANET_STRUCT)) {
  ------------------
  |  |  806|  22.9k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 22.9k]
  |  |  ------------------
  |  |  807|  22.9k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  22.9k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  22.9k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  22.9k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  22.9k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  22.9k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (29848:9): [True: 22.5k, False: 371]
  ------------------
29849|  22.5k|        JanetTable *which_grammar = grammar;
29850|       |        /* If we are a primitive pattern, add to the global cache (root grammar table) */
29851|  22.5k|        if (!janet_checktype(peg, JANET_TUPLE)) {
  ------------------
  |  |  806|  22.5k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 22.5k]
  |  |  ------------------
  |  |  807|  22.5k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  22.5k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  22.5k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  22.5k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  22.5k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  22.5k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (29851:13): [True: 5.13k, False: 17.3k]
  ------------------
29852|  5.13k|            while (which_grammar->proto)
  ------------------
  |  Branch (29852:20): [True: 0, False: 5.13k]
  ------------------
29853|      0|                which_grammar = which_grammar->proto;
29854|  5.13k|        }
29855|  22.5k|        janet_table_put(which_grammar, peg, janet_wrap_number(rule));
  ------------------
  |  |  835|  22.5k|#define janet_wrap_number(r) janet_nanbox_from_double(r)
  ------------------
29856|  22.5k|    }
29857|       |
29858|  22.9k|    switch (janet_type(peg)) {
  ------------------
  |  |  795|  22.9k|    (isnan((x).number) \
  |  |  796|  22.9k|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|  22.9k|        : JANET_NUMBER)
  ------------------
  |  Branch (29858:13): [True: 19.7k, False: 3.14k]
  ------------------
29859|    628|        default:
  ------------------
  |  Branch (29859:9): [True: 628, False: 22.2k]
  ------------------
29860|    628|            peg_panic(b, "unexpected peg source");
29861|      0|            return 0;
29862|       |
29863|     21|        case JANET_BOOLEAN: {
  ------------------
  |  Branch (29863:9): [True: 21, False: 22.8k]
  ------------------
29864|     21|            int n = janet_unwrap_boolean(peg);
  ------------------
  |  |  838|     21|#define janet_unwrap_boolean(x) ((x).u64 & 0x1)
  ------------------
29865|     21|            Reserve r = reserve(b, 2);
29866|     21|            emit_1(r, n ? RULE_NCHAR : RULE_NOTNCHAR, 0);
  ------------------
  |  Branch (29866:23): [True: 10, False: 11]
  ------------------
29867|     21|            break;
29868|      0|        }
29869|  3.14k|        case JANET_NUMBER: {
  ------------------
  |  Branch (29869:9): [True: 3.14k, False: 19.7k]
  ------------------
29870|  3.14k|            int32_t n = peg_getinteger(b, peg);
29871|  3.14k|            Reserve r = reserve(b, 2);
29872|  3.14k|            if (n < 0) {
  ------------------
  |  Branch (29872:17): [True: 200, False: 2.94k]
  ------------------
29873|    200|                if (n == INT32_MIN) {
  ------------------
  |  Branch (29873:21): [True: 2, False: 198]
  ------------------
29874|       |                    /* Since buffers can't hold this many characters, will
29875|       |                     * always match. Avoid undefined behavior negating INT32_MIN. */
29876|      2|                    emit_1(r, RULE_NCHAR, 0);
29877|    198|                } else {
29878|    198|                    emit_1(r, RULE_NOTNCHAR, -n);
29879|    198|                }
29880|  2.94k|            } else {
29881|  2.94k|                emit_1(r, RULE_NCHAR, n);
29882|  2.94k|            }
29883|  3.14k|            break;
29884|      0|        }
29885|    929|        case JANET_STRING: {
  ------------------
  |  Branch (29885:9): [True: 929, False: 21.9k]
  ------------------
29886|    929|            const uint8_t *str = janet_unwrap_string(peg);
  ------------------
  |  |  863|    929|#define janet_unwrap_string(x) ((JanetString)janet_nanbox_to_pointer(x))
  ------------------
29887|    929|            int32_t len = janet_string_length(str);
  ------------------
  |  | 1813|    929|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  ------------------
  |  |  |  | 1812|    929|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
29888|    929|            emit_bytes(b, RULE_LITERAL, len, str);
29889|    929|            break;
29890|      0|        }
29891|    163|        case JANET_BUFFER: {
  ------------------
  |  Branch (29891:9): [True: 163, False: 22.7k]
  ------------------
29892|    163|            const JanetBuffer *buf = janet_unwrap_buffer(peg);
  ------------------
  |  |  862|    163|#define janet_unwrap_buffer(x) ((JanetBuffer *)janet_nanbox_to_pointer(x))
  ------------------
29893|    163|            emit_bytes(b, RULE_LITERAL, buf->count, buf->data);
29894|    163|            break;
29895|      0|        }
29896|    249|        case JANET_TABLE: {
  ------------------
  |  Branch (29896:9): [True: 249, False: 22.6k]
  ------------------
29897|       |            /* Build grammar table */
29898|    249|            JanetTable *new_grammar = janet_table_clone(janet_unwrap_table(peg));
  ------------------
  |  |  861|    249|#define janet_unwrap_table(x) ((JanetTable *)janet_nanbox_to_pointer(x))
  ------------------
29899|    249|            new_grammar->proto = grammar;
29900|    249|            b->grammar = grammar = new_grammar;
29901|       |            /* Run the main rule */
29902|    249|            Janet main_rule = janet_table_rawget(grammar, janet_ckeywordv("main"));
  ------------------
  |  | 1843|    249|#define janet_ckeywordv(cstr) janet_wrap_keyword(janet_ckeyword(cstr))
  |  |  ------------------
  |  |  |  |  850|    249|#define janet_wrap_keyword(s) janet_nanbox_wrap_c((s), JANET_KEYWORD)
  |  |  |  |  ------------------
  |  |  |  |  |  |  828|    249|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  793|    249|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  792|    249|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29903|    249|            if (janet_checktype(main_rule, JANET_NIL))
  ------------------
  |  |  806|    249|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 249, False: 0]
  |  |  |  Branch (806:6): [Folded, False: 249]
  |  |  ------------------
  |  |  807|    249|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|    249|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|    249|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|    249|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|    249|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|    249|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29904|    249|                peg_panic(b, "grammar requires :main rule");
29905|      0|            rule = peg_compile1(b, main_rule);
29906|      0|            break;
29907|    249|        }
29908|    371|        case JANET_STRUCT: {
  ------------------
  |  Branch (29908:9): [True: 371, False: 22.5k]
  ------------------
29909|       |            /* Build grammar table */
29910|    371|            const JanetKV *st = janet_unwrap_struct(peg);
  ------------------
  |  |  857|    371|#define janet_unwrap_struct(x) ((JanetStruct)janet_nanbox_to_pointer(x))
  ------------------
29911|    371|            JanetTable *new_grammar = janet_table(2 * janet_struct_capacity(st));
  ------------------
  |  | 1849|    371|#define janet_struct_capacity(t) (janet_struct_head(t)->capacity)
  |  |  ------------------
  |  |  |  | 1846|    371|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
29912|  4.28k|            for (int32_t i = 0; i < janet_struct_capacity(st); i++) {
  ------------------
  |  | 1849|  4.28k|#define janet_struct_capacity(t) (janet_struct_head(t)->capacity)
  |  |  ------------------
  |  |  |  | 1846|  4.28k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (29912:33): [True: 3.91k, False: 371]
  ------------------
29913|  3.91k|                if (janet_checktype(st[i].key, JANET_KEYWORD)) {
  ------------------
  |  |  806|  3.91k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 63, False: 3.85k]
  |  |  |  Branch (806:6): [Folded, False: 3.91k]
  |  |  ------------------
  |  |  807|  3.91k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  3.91k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  3.91k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  3.91k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  3.91k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  3.91k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29914|     63|                    janet_table_put(new_grammar, st[i].key, st[i].value);
29915|     63|                }
29916|  3.91k|            }
29917|    371|            new_grammar->proto = grammar;
29918|    371|            b->grammar = grammar = new_grammar;
29919|       |            /* Run the main rule */
29920|    371|            Janet main_rule = janet_table_rawget(grammar, janet_ckeywordv("main"));
  ------------------
  |  | 1843|    371|#define janet_ckeywordv(cstr) janet_wrap_keyword(janet_ckeyword(cstr))
  |  |  ------------------
  |  |  |  |  850|    371|#define janet_wrap_keyword(s) janet_nanbox_wrap_c((s), JANET_KEYWORD)
  |  |  |  |  ------------------
  |  |  |  |  |  |  828|    371|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  793|    371|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  792|    371|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29921|    371|            if (janet_checktype(main_rule, JANET_NIL))
  ------------------
  |  |  806|    371|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 371, False: 0]
  |  |  |  Branch (806:6): [Folded, False: 371]
  |  |  ------------------
  |  |  807|    371|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|    371|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|    371|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|    371|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|    371|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|    371|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29922|    371|                peg_panic(b, "grammar requires :main rule");
29923|      0|            rule = peg_compile1(b, main_rule);
29924|      0|            break;
29925|    371|        }
29926|  17.3k|        case JANET_TUPLE: {
  ------------------
  |  Branch (29926:9): [True: 17.3k, False: 5.50k]
  ------------------
29927|  17.3k|            const Janet *tup = janet_unwrap_tuple(peg);
  ------------------
  |  |  858|  17.3k|#define janet_unwrap_tuple(x) ((JanetTuple)janet_nanbox_to_pointer(x))
  ------------------
29928|  17.3k|            int32_t len = janet_tuple_length(tup);
  ------------------
  |  | 1802|  17.3k|#define janet_tuple_length(t) (janet_tuple_head(t)->length)
  |  |  ------------------
  |  |  |  | 1800|  17.3k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
29929|  17.3k|            if (len == 0) peg_panic(b, "tuple in grammar must have non-zero length");
  ------------------
  |  Branch (29929:17): [True: 18, False: 17.3k]
  ------------------
29930|  17.3k|            if (janet_checkint(tup[0])) {
  ------------------
  |  Branch (29930:17): [True: 1.50k, False: 15.8k]
  ------------------
29931|  1.50k|                int32_t n = janet_unwrap_integer(tup[0]);
  ------------------
  |  |  966|  1.50k|#define janet_unwrap_integer(x) ((int32_t) janet_unwrap_number(x))
  |  |  ------------------
  |  |  |  |  839|  1.50k|#define janet_unwrap_number(x) ((x).number)
  |  |  ------------------
  ------------------
29932|  1.50k|                if (n < 0) {
  ------------------
  |  Branch (29932:21): [True: 37, False: 1.47k]
  ------------------
29933|     37|                    peg_panicf(b, "expected non-negative integer, got %d", n);
  ------------------
  |  |29240|     37|#define peg_panicf(b,...) peg_panic((b), (const char *) janet_formatc(__VA_ARGS__))
  ------------------
29934|     37|                }
29935|  1.47k|                spec_repeat(b, len, tup);
29936|  1.47k|                break;
29937|  1.50k|            }
29938|  15.8k|            if (!janet_checktype(tup[0], JANET_SYMBOL))
  ------------------
  |  |  806|  15.8k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 15.8k]
  |  |  ------------------
  |  |  807|  15.8k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  15.8k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  15.8k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  15.8k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  15.8k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  15.8k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (29938:17): [True: 130, False: 15.7k]
  ------------------
29939|    130|                peg_panicf(b, "expected grammar command, found %v", tup[0]);
  ------------------
  |  |29240|    130|#define peg_panicf(b,...) peg_panic((b), (const char *) janet_formatc(__VA_ARGS__))
  ------------------
29940|  15.7k|            const uint8_t *sym = janet_unwrap_symbol(tup[0]);
  ------------------
  |  |  864|  15.7k|#define janet_unwrap_symbol(x) ((JanetSymbol)janet_nanbox_to_pointer(x))
  ------------------
29941|  15.7k|            const SpecialPair *sp = janet_strbinsearch(
29942|  15.7k|                                        &peg_specials,
29943|  15.7k|                                        sizeof(peg_specials) / sizeof(SpecialPair),
29944|  15.7k|                                        sizeof(SpecialPair),
29945|  15.7k|                                        sym);
29946|  15.7k|            if (sp) {
  ------------------
  |  Branch (29946:17): [True: 15.3k, False: 380]
  ------------------
29947|  15.3k|                sp->special(b, len - 1, tup + 1);
29948|  15.3k|            } else {
29949|    380|                peg_panicf(b, "unknown special %S", sym);
  ------------------
  |  |29240|    380|#define peg_panicf(b,...) peg_panic((b), (const char *) janet_formatc(__VA_ARGS__))
  ------------------
29950|    380|            }
29951|  15.3k|            break;
29952|  15.7k|        }
29953|  22.9k|    }
29954|       |
29955|       |    /* Increase depth again */
29956|  17.1k|    b->depth++;
29957|  17.1k|    b->form = old_form;
29958|  17.1k|    b->grammar = old_grammar;
29959|  17.1k|    return rule;
29960|  22.9k|}
janet.c:peg_panic:
29235|  2.72k|JANET_NO_RETURN static void peg_panic(Builder *b, const char *msg) {
29236|  2.72k|    builder_cleanup(b);
29237|  2.72k|    janet_panicf("grammar error in %p, %s", b->form, msg);
29238|  2.72k|}
janet.c:reserve:
29326|  18.3k|static Reserve reserve(Builder *b, int32_t size) {
29327|  18.3k|    Reserve r;
29328|  18.3k|    r.index = janet_v_count(b->bytecode);
  ------------------
  |  |  736|  18.3k|#define janet_v_count(v)        (((v) != NULL) ? janet_v__cnt(v) : 0)
  |  |  ------------------
  |  |  |  |  743|  15.9k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  741|  15.9k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (736:34): [True: 15.9k, False: 2.45k]
  |  |  ------------------
  ------------------
29329|  18.3k|    r.builder = b;
29330|  18.3k|    r.size = size;
29331|  72.1k|    for (int32_t i = 0; i < size; i++)
  ------------------
  |  Branch (29331:25): [True: 53.7k, False: 18.3k]
  ------------------
29332|       |        janet_v_push(b->bytecode, 0);
  ------------------
  |  |  734|  53.7k|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  746|  53.7k|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  745|  53.7k|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  743|  51.3k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|  51.3k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  742|  51.3k|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|  51.3k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (745:35): [True: 2.45k, False: 51.3k]
  |  |  |  |  |  |  |  Branch (745:50): [True: 9.03k, False: 42.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  747|  11.4k|#define janet_v__grow(v, n)      ((v) = janet_v_grow((v), (n), sizeof(*(v))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  743|  53.7k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  741|  53.7k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29333|  18.3k|    return r;
29334|  18.3k|}
janet.c:emit_1:
29355|  3.21k|static void emit_1(Reserve r, uint32_t op, uint32_t arg) {
29356|  3.21k|    emit_rule(r, op, 1, &arg);
29357|  3.21k|}
janet.c:emit_rule:
29337|  15.1k|static void emit_rule(Reserve r, int32_t op, int32_t n, const uint32_t *body) {
29338|  15.1k|    janet_assert(r.size == n + 1, "bad reserve");
  ------------------
  |  |  389|  15.1k|#define janet_assert(c, m) do { \
  |  |  390|  15.1k|    if (!(c)) JANET_EXIT((m)); \
  |  |  ------------------
  |  |  |  |  378|      0|#define JANET_EXIT(m) do { \
  |  |  |  |  379|      0|    fprintf(stderr, "janet abort at %s:%d: %s\n",\
  |  |  |  |  380|      0|        __FILE__,\
  |  |  |  |  381|      0|        __LINE__,\
  |  |  |  |  382|      0|        (m));\
  |  |  |  |  383|      0|    abort();\
  |  |  |  |  384|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (384:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (390:9): [True: 0, False: 15.1k]
  |  |  ------------------
  |  |  391|  15.1k|} while (0)
  |  |  ------------------
  |  |  |  Branch (391:10): [Folded, False: 15.1k]
  |  |  ------------------
  ------------------
29339|  15.1k|    r.builder->bytecode[r.index] = op;
29340|  15.1k|    memcpy(r.builder->bytecode + r.index + 1, body, n * sizeof(uint32_t));
29341|  15.1k|}
janet.c:peg_getinteger:
29276|  4.97k|static int32_t peg_getinteger(Builder *b, Janet x) {
29277|  4.97k|    if (!janet_checkint(x))
  ------------------
  |  Branch (29277:9): [True: 503, False: 4.47k]
  ------------------
29278|    503|        peg_panicf(b, "expected integer, got %v", x);
  ------------------
  |  |29240|    503|#define peg_panicf(b,...) peg_panic((b), (const char *) janet_formatc(__VA_ARGS__))
  ------------------
29279|  4.47k|    return janet_unwrap_integer(x);
  ------------------
  |  |  966|  4.47k|#define janet_unwrap_integer(x) ((int32_t) janet_unwrap_number(x))
  |  |  ------------------
  |  |  |  |  839|  4.47k|#define janet_unwrap_number(x) ((x).number)
  |  |  ------------------
  ------------------
29280|  4.97k|}
janet.c:emit_bytes:
29344|  1.09k|static void emit_bytes(Builder *b, uint32_t op, int32_t len, const uint8_t *bytes) {
29345|  1.09k|    uint32_t next_rule = janet_v_count(b->bytecode);
  ------------------
  |  |  736|  1.09k|#define janet_v_count(v)        (((v) != NULL) ? janet_v__cnt(v) : 0)
  |  |  ------------------
  |  |  |  |  743|    906|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  741|    906|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (736:34): [True: 906, False: 186]
  |  |  ------------------
  ------------------
29346|  1.09k|    janet_v_push(b->bytecode, op);
  ------------------
  |  |  734|  1.09k|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  746|  1.09k|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  745|  1.09k|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  743|    906|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|    906|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  742|    906|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|    906|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (745:35): [True: 186, False: 906]
  |  |  |  |  |  |  |  Branch (745:50): [True: 113, False: 793]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  747|    299|#define janet_v__grow(v, n)      ((v) = janet_v_grow((v), (n), sizeof(*(v))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  743|  1.09k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  741|  1.09k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29347|  1.09k|    janet_v_push(b->bytecode, len);
  ------------------
  |  |  734|  1.09k|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  746|  1.09k|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  745|  1.09k|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  743|  1.09k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|  1.09k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  742|  1.09k|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|  1.09k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (745:35): [True: 0, False: 1.09k]
  |  |  |  |  |  |  |  Branch (745:50): [True: 252, False: 840]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  747|    252|#define janet_v__grow(v, n)      ((v) = janet_v_grow((v), (n), sizeof(*(v))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  743|  1.09k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  741|  1.09k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29348|  1.09k|    int32_t words = ((len + 3) >> 2);
29349|  2.28k|    for (int32_t i = 0; i < words; i++)
  ------------------
  |  Branch (29349:25): [True: 1.18k, False: 1.09k]
  ------------------
29350|       |        janet_v_push(b->bytecode, 0);
  ------------------
  |  |  734|  1.18k|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  746|  1.18k|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  745|  1.18k|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  743|  1.18k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|  1.18k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  742|  1.18k|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|  1.18k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (745:35): [True: 0, False: 1.18k]
  |  |  |  |  |  |  |  Branch (745:50): [True: 291, False: 897]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  747|    291|#define janet_v__grow(v, n)      ((v) = janet_v_grow((v), (n), sizeof(*(v))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  743|  1.18k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  741|  1.18k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29351|  1.09k|    memcpy(b->bytecode + next_rule + 2, bytes, len);
29352|  1.09k|}
janet.c:spec_repeat:
29499|  1.53k|static void spec_repeat(Builder *b, int32_t argc, const Janet *argv) {
29500|  1.53k|    peg_fixarity(b, argc, 2);
29501|  1.53k|    Reserve r = reserve(b, 4);
29502|  1.53k|    int32_t n = peg_getnat(b, argv[0]);
29503|  1.53k|    uint32_t subrule = peg_compile1(b, argv[1]);
29504|  1.53k|    emit_3(r, RULE_BETWEEN, n, n, subrule);
29505|  1.53k|}
janet.c:peg_fixarity:
29242|  2.38k|static void peg_fixarity(Builder *b, int32_t argc, int32_t arity) {
29243|  2.38k|    if (argc != arity) {
  ------------------
  |  Branch (29243:9): [True: 76, False: 2.31k]
  ------------------
29244|     76|        peg_panicf(b, "expected %d argument%s, got %d",
  ------------------
  |  |29240|    152|#define peg_panicf(b,...) peg_panic((b), (const char *) janet_formatc(__VA_ARGS__))
  |  |  ------------------
  |  |  |  Branch (29240:71): [True: 19, False: 57]
  |  |  ------------------
  ------------------
29245|     76|                   arity,
29246|     76|                   arity == 1 ? "" : "s",
29247|     76|                   argc);
29248|     76|    }
29249|  2.38k|}
janet.c:peg_getnat:
29282|  1.76k|static int32_t peg_getnat(Builder *b, Janet x) {
29283|  1.76k|    int32_t i = peg_getinteger(b, x);
29284|  1.76k|    if (i < 0)
  ------------------
  |  Branch (29284:9): [True: 100, False: 1.66k]
  ------------------
29285|    100|        peg_panicf(b, "expected non-negative integer, got %v", x);
  ------------------
  |  |29240|    100|#define peg_panicf(b,...) peg_panic((b), (const char *) janet_formatc(__VA_ARGS__))
  ------------------
29286|  1.66k|    return i;
29287|  1.76k|}
janet.c:emit_3:
29362|  2.19k|static void emit_3(Reserve r, uint32_t op, uint32_t arg1, uint32_t arg2, uint32_t arg3) {
29363|  2.19k|    uint32_t arr[3] = {arg1, arg2, arg3};
29364|  2.19k|    emit_rule(r, op, 3, arr);
29365|  2.19k|}
janet.c:spec_not:
29515|     61|static void spec_not(Builder *b, int32_t argc, const Janet *argv) {
29516|     61|    spec_onerule(b, argc, argv, RULE_NOT);
29517|     61|}
janet.c:spec_onerule:
29508|    221|static void spec_onerule(Builder *b, int32_t argc, const Janet *argv, uint32_t op) {
29509|    221|    peg_fixarity(b, argc, 1);
29510|    221|    Reserve r = reserve(b, 2);
29511|    221|    uint32_t rule = peg_compile1(b, argv[0]);
29512|    221|    emit_1(r, op, rule);
29513|    221|}
janet.c:spec_position:
29607|     84|static void spec_position(Builder *b, int32_t argc, const Janet *argv) {
29608|     84|    spec_tag1(b, argc, argv, RULE_POSITION);
29609|     84|}
janet.c:spec_tag1:
29599|    291|static void spec_tag1(Builder *b, int32_t argc, const Janet *argv, uint32_t op) {
29600|    291|    peg_arity(b, argc, 0, 1);
29601|    291|    Reserve r = reserve(b, 2);
29602|    291|    uint32_t tag = (argc) ? emit_tag(b, argv[0]) : 0;
  ------------------
  |  Branch (29602:20): [True: 11, False: 280]
  ------------------
29603|    291|    (void) argv;
29604|    291|    emit_1(r, op, tag);
29605|    291|}
janet.c:peg_arity:
29251|  13.4k|static void peg_arity(Builder *b, int32_t arity, int32_t min, int32_t max) {
29252|  13.4k|    if (min >= 0 && arity < min)
  ------------------
  |  Branch (29252:9): [True: 13.4k, False: 0]
  |  Branch (29252:21): [True: 28, False: 13.3k]
  ------------------
29253|     28|        peg_panicf(b, "arity mismatch, expected at least %d, got %d", min, arity);
  ------------------
  |  |29240|     28|#define peg_panicf(b,...) peg_panic((b), (const char *) janet_formatc(__VA_ARGS__))
  ------------------
29254|  13.3k|    if (max >= 0 && arity > max)
  ------------------
  |  Branch (29254:9): [True: 13.2k, False: 105]
  |  Branch (29254:21): [True: 22, False: 13.2k]
  ------------------
29255|     22|        peg_panicf(b, "arity mismatch, expected at most %d, got %d", max, arity);
  ------------------
  |  |29240|     22|#define peg_panicf(b,...) peg_panic((b), (const char *) janet_formatc(__VA_ARGS__))
  ------------------
29256|  13.3k|}
janet.c:emit_tag:
29299|    349|static uint32_t emit_tag(Builder *b, Janet t) {
29300|    349|    if (!janet_checktype(t, JANET_KEYWORD))
  ------------------
  |  |  806|    349|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 349]
  |  |  ------------------
  |  |  807|    349|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|    349|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|    349|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|    349|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|    349|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|    349|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (29300:9): [True: 32, False: 317]
  ------------------
29301|     32|        peg_panicf(b, "expected keyword for capture tag, got %v", t);
  ------------------
  |  |29240|     32|#define peg_panicf(b,...) peg_panic((b), (const char *) janet_formatc(__VA_ARGS__))
  ------------------
29302|    317|    Janet check = janet_table_get(b->tags, t);
29303|    317|    if (janet_checktype(check, JANET_NIL)) {
  ------------------
  |  |  806|    317|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 268, False: 49]
  |  |  |  Branch (806:6): [Folded, False: 317]
  |  |  ------------------
  |  |  807|    317|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|    317|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|    317|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|    317|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|    317|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|    317|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29304|    268|        uint32_t tag = b->nexttag++;
29305|    268|        if (tag > 255) {
  ------------------
  |  Branch (29305:13): [True: 0, False: 268]
  ------------------
29306|      0|            peg_panic(b, "too many tags - up to 255 tags are supported per peg");
29307|      0|        }
29308|    268|        Janet val = janet_wrap_number(tag);
  ------------------
  |  |  835|    268|#define janet_wrap_number(r) janet_nanbox_from_double(r)
  ------------------
29309|    268|        janet_table_put(b->tags, t, val);
29310|    268|        return tag;
29311|    268|    } else {
29312|     49|        return (uint32_t) janet_unwrap_number(check);
  ------------------
  |  |  839|     49|#define janet_unwrap_number(x) ((x).number)
  ------------------
29313|     49|    }
29314|    317|}
janet.c:spec_accumulate:
29552|    223|static void spec_accumulate(Builder *b, int32_t argc, const Janet *argv) {
29553|    223|    spec_cap1(b, argc, argv, RULE_ACCUMULATE);
29554|    223|}
janet.c:spec_cap1:
29541|  11.2k|static void spec_cap1(Builder *b, int32_t argc, const Janet *argv, uint32_t op) {
29542|  11.2k|    peg_arity(b, argc, 1, 2);
29543|  11.2k|    Reserve r = reserve(b, 3);
29544|  11.2k|    uint32_t tag = (argc == 2) ? emit_tag(b, argv[1]) : 0;
  ------------------
  |  Branch (29544:20): [True: 34, False: 11.2k]
  ------------------
29545|  11.2k|    uint32_t rule = peg_compile1(b, argv[0]);
29546|  11.2k|    emit_2(r, op, rule, tag);
29547|  11.2k|}
janet.c:emit_2:
29358|  9.19k|static void emit_2(Reserve r, uint32_t op, uint32_t arg1, uint32_t arg2) {
29359|  9.19k|    uint32_t arr[2] = {arg1, arg2};
29360|  9.19k|    emit_rule(r, op, 2, arr);
29361|  9.19k|}
janet.c:spec_sequence:
29430|    554|static void spec_sequence(Builder *b, int32_t argc, const Janet *argv) {
29431|    554|    spec_variadic(b, argc, argv, RULE_SEQUENCE);
29432|    554|}
janet.c:spec_variadic:
29415|  1.01k|static void spec_variadic(Builder *b, int32_t argc, const Janet *argv, uint32_t op) {
29416|  1.01k|    uint32_t rule = janet_v_count(b->bytecode);
  ------------------
  |  |  736|  1.01k|#define janet_v_count(v)        (((v) != NULL) ? janet_v__cnt(v) : 0)
  |  |  ------------------
  |  |  |  |  743|    793|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  741|    793|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (736:34): [True: 793, False: 221]
  |  |  ------------------
  ------------------
29417|  1.01k|    janet_v_push(b->bytecode, op);
  ------------------
  |  |  734|  1.01k|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  746|  1.01k|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  745|  1.01k|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  743|    793|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|    793|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  742|    793|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|    793|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (745:35): [True: 221, False: 793]
  |  |  |  |  |  |  |  Branch (745:50): [True: 215, False: 578]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  747|    436|#define janet_v__grow(v, n)      ((v) = janet_v_grow((v), (n), sizeof(*(v))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  743|  1.01k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  741|  1.01k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29418|  1.01k|    janet_v_push(b->bytecode, argc);
  ------------------
  |  |  734|  1.01k|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  746|  1.01k|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  745|  1.01k|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  743|  1.01k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|  1.01k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  742|  1.01k|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|  1.01k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (745:35): [True: 0, False: 1.01k]
  |  |  |  |  |  |  |  Branch (745:50): [True: 292, False: 722]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  747|    292|#define janet_v__grow(v, n)      ((v) = janet_v_grow((v), (n), sizeof(*(v))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  743|  1.01k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  741|  1.01k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29419|  5.90k|    for (int32_t i = 0; i < argc; i++)
  ------------------
  |  Branch (29419:25): [True: 4.88k, False: 1.01k]
  ------------------
29420|  4.88k|        janet_v_push(b->bytecode, 0);
  ------------------
  |  |  734|  4.88k|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  746|  4.88k|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  745|  4.88k|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  743|  4.88k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|  4.88k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  742|  4.88k|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|  4.88k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (745:35): [True: 0, False: 4.88k]
  |  |  |  |  |  |  |  Branch (745:50): [True: 878, False: 4.01k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  747|    878|#define janet_v__grow(v, n)      ((v) = janet_v_grow((v), (n), sizeof(*(v))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  743|  4.88k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  741|  4.88k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29421|  5.71k|    for (int32_t i = 0; i < argc; i++) {
  ------------------
  |  Branch (29421:25): [True: 4.69k, False: 1.01k]
  ------------------
29422|  4.69k|        uint32_t rulei = peg_compile1(b, argv[i]);
29423|  4.69k|        b->bytecode[rule + 2 + i] = rulei;
29424|  4.69k|    }
29425|  1.01k|}
janet.c:spec_choice:
29427|    460|static void spec_choice(Builder *b, int32_t argc, const Janet *argv) {
29428|    460|    spec_variadic(b, argc, argv, RULE_CHOICE);
29429|    460|}
janet.c:spec_reference:
29590|    167|static void spec_reference(Builder *b, int32_t argc, const Janet *argv) {
29591|    167|    peg_arity(b, argc, 1, 2);
29592|    167|    Reserve r = reserve(b, 3);
29593|    167|    uint32_t search = emit_tag(b, argv[0]);
29594|    167|    uint32_t tag = (argc == 2) ? emit_tag(b, argv[1]) : 0;
  ------------------
  |  Branch (29594:20): [True: 60, False: 107]
  ------------------
29595|    167|    b->has_backref = 1;
29596|    167|    emit_2(r, RULE_GETTAG, search, tag);
29597|    167|}
janet.c:spec_replace:
29645|    622|static void spec_replace(Builder *b, int32_t argc, const Janet *argv) {
29646|    622|    peg_arity(b, argc, 2, 3);
29647|    622|    Reserve r = reserve(b, 4);
29648|    622|    uint32_t subrule = peg_compile1(b, argv[0]);
29649|    622|    uint32_t constant = emit_constant(b, argv[1]);
29650|    622|    uint32_t tag = (argc == 3) ? emit_tag(b, argv[2]) : 0;
  ------------------
  |  Branch (29650:20): [True: 68, False: 554]
  ------------------
29651|    622|    emit_3(r, RULE_REPLACE, subrule, constant, tag);
29652|    622|}
janet.c:emit_constant:
29293|    605|static uint32_t emit_constant(Builder *b, Janet c) {
29294|    605|    uint32_t cindex = (uint32_t) janet_v_count(b->constants);
  ------------------
  |  |  736|    605|#define janet_v_count(v)        (((v) != NULL) ? janet_v__cnt(v) : 0)
  |  |  ------------------
  |  |  |  |  743|     49|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  741|     49|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (736:34): [True: 49, False: 556]
  |  |  ------------------
  ------------------
29295|       |    janet_v_push(b->constants, c);
  ------------------
  |  |  734|    605|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  746|    605|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  745|    605|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  743|     49|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|     49|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  742|     49|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  741|     49|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (745:35): [True: 556, False: 49]
  |  |  |  |  |  |  |  Branch (745:50): [True: 43, False: 6]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  747|    599|#define janet_v__grow(v, n)      ((v) = janet_v_grow((v), (n), sizeof(*(v))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  743|    605|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  741|    605|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29296|    605|    return cindex;
29297|    605|}
janet.c:spec_capture:
29549|  11.0k|static void spec_capture(Builder *b, int32_t argc, const Janet *argv) {
29550|  11.0k|    spec_cap1(b, argc, argv, RULE_CAPTURE);
29551|  11.0k|}
janet.c:spec_look:
29405|    117|static void spec_look(Builder *b, int32_t argc, const Janet *argv) {
29406|    117|    peg_arity(b, argc, 1, 2);
29407|    117|    Reserve r = reserve(b, 3);
29408|    117|    int32_t rulearg = argc == 2 ? 1 : 0;
  ------------------
  |  Branch (29408:23): [True: 57, False: 60]
  ------------------
29409|    117|    int32_t offset = argc == 2 ? peg_getinteger(b, argv[0]) : 0;
  ------------------
  |  Branch (29409:22): [True: 57, False: 60]
  ------------------
29410|    117|    uint32_t subrule = peg_compile1(b, argv[rulearg]);
29411|    117|    emit_2(r, RULE_LOOK, (uint32_t) offset, subrule);
29412|    117|}
janet.c:spec_opt:
29492|    100|static void spec_opt(Builder *b, int32_t argc, const Janet *argv) {
29493|    100|    peg_fixarity(b, argc, 1);
29494|    100|    Reserve r = reserve(b, 4);
29495|    100|    uint32_t subrule = peg_compile1(b, argv[0]);
29496|    100|    emit_3(r, RULE_BETWEEN, 0, 1, subrule);
29497|    100|}
janet.c:spec_debug:
29637|    529|static void spec_debug(Builder *b, int32_t argc, const Janet *argv) {
29638|    529|    peg_arity(b, argc, 0, 0);
29639|    529|    Reserve r = reserve(b, 1);
29640|    529|    uint32_t empty = 0;
29641|    529|    (void) argv;
29642|    529|    emit_rule(r, RULE_DEBUG, 0, &empty);
29643|    529|}
janet.c:spec_any:
29472|     50|static void spec_any(Builder *b, int32_t argc, const Janet *argv) {
29473|     50|    spec_repeater(b, argc, argv, 0);
29474|     50|}
janet.c:spec_repeater:
29462|     50|static void spec_repeater(Builder *b, int32_t argc, const Janet *argv, int32_t min) {
29463|     50|    peg_fixarity(b, argc, 1);
29464|     50|    Reserve r = reserve(b, 4);
29465|     50|    uint32_t subrule = peg_compile1(b, argv[0]);
29466|       |    emit_3(r, RULE_BETWEEN, min, UINT32_MAX, subrule);
29467|     50|}
janet.c:spec_matchtime_splice:
29672|     34|static void spec_matchtime_splice(Builder *b, int32_t argc, const Janet *argv) {
29673|     34|    spec_matchtime_impl(b, argc, argv, RULE_MATCHSPLICE);
29674|     34|}
janet.c:spec_matchtime_impl:
29654|     51|static void spec_matchtime_impl(Builder *b, int32_t argc, const Janet *argv, uint32_t op) {
29655|     51|    peg_arity(b, argc, 2, 3);
29656|     51|    Reserve r = reserve(b, 4);
29657|     51|    uint32_t subrule = peg_compile1(b, argv[0]);
29658|     51|    Janet fun = argv[1];
29659|     51|    if (!janet_checktype(fun, JANET_FUNCTION) &&
  ------------------
  |  |  806|    102|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 51]
  |  |  ------------------
  |  |  807|    102|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|    102|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|     51|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|     51|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|     51|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|     51|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (29659:9): [True: 11, False: 40]
  ------------------
29660|     11|            !janet_checktype(fun, JANET_CFUNCTION)) {
  ------------------
  |  |  806|     11|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 11]
  |  |  ------------------
  |  |  807|     11|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|     11|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|     11|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|     11|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|     11|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|     11|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (29660:13): [True: 11, False: 0]
  ------------------
29661|     11|        peg_panicf(b, "expected function or cfunction, got %v", fun);
  ------------------
  |  |29240|     11|#define peg_panicf(b,...) peg_panic((b), (const char *) janet_formatc(__VA_ARGS__))
  ------------------
29662|     11|    }
29663|     40|    uint32_t tag = (argc == 3) ? emit_tag(b, argv[2]) : 0;
  ------------------
  |  Branch (29663:20): [True: 0, False: 40]
  ------------------
29664|     40|    uint32_t cindex = emit_constant(b, fun);
29665|     40|    emit_3(r, op, subrule, cindex, tag);
29666|     40|}
janet.c:spec_matchtime:
29668|     17|static void spec_matchtime(Builder *b, int32_t argc, const Janet *argv) {
29669|     17|    spec_matchtime_impl(b, argc, argv, RULE_MATCHTIME);
29670|     17|}
janet.c:spec_column:
29613|     54|static void spec_column(Builder *b, int32_t argc, const Janet *argv) {
29614|     54|    spec_tag1(b, argc, argv, RULE_COLUMN);
29615|     54|}
janet.c:spec_error:
29518|     48|static void spec_error(Builder *b, int32_t argc, const Janet *argv) {
29519|     48|    if (argc == 0) {
  ------------------
  |  Branch (29519:9): [True: 24, False: 24]
  ------------------
29520|     24|        Reserve r = reserve(b, 2);
29521|     24|        uint32_t rule = peg_compile1(b, janet_wrap_number(0));
  ------------------
  |  |  835|     24|#define janet_wrap_number(r) janet_nanbox_from_double(r)
  ------------------
29522|     24|        emit_1(r, RULE_ERROR, rule);
29523|     24|    } else {
29524|     24|        spec_onerule(b, argc, argv, RULE_ERROR);
29525|     24|    }
29526|     48|}
janet.c:spec_if:
29443|     51|static void spec_if(Builder *b, int32_t argc, const Janet *argv) {
29444|     51|    spec_branch(b, argc, argv, RULE_IF);
29445|     51|}
janet.c:spec_branch:
29435|     51|static void spec_branch(Builder *b, int32_t argc, const Janet *argv, uint32_t rule) {
29436|     51|    peg_fixarity(b, argc, 2);
29437|     51|    Reserve r = reserve(b, 3);
29438|     51|    uint32_t rule_a = peg_compile1(b, argv[0]);
29439|     51|    uint32_t rule_b = peg_compile1(b, argv[1]);
29440|     51|    emit_2(r, rule, rule_a, rule_b);
29441|     51|}
janet.c:spec_int_le:
29720|    124|static void spec_int_le(Builder *b, int32_t argc, const Janet *argv) {
29721|    124|    spec_readint(b, argc, argv, 0x10u);
29722|    124|}
janet.c:spec_readint:
29706|    161|static void spec_readint(Builder *b, int32_t argc, const Janet *argv, uint32_t mask) {
29707|    161|    peg_arity(b, argc, 1, 2);
29708|    161|    Reserve r = reserve(b, 3);
29709|    161|    uint32_t tag = (argc == 2) ? emit_tag(b, argv[1]) : 0;
  ------------------
  |  Branch (29709:20): [True: 10, False: 151]
  ------------------
29710|    161|    int32_t width = peg_getnat(b, argv[0]);
29711|    161|    if ((width < 0) || (width > JANET_MAX_READINT_WIDTH)) {
  ------------------
  |  |29701|    108|#define JANET_MAX_READINT_WIDTH 8
  ------------------
  |  Branch (29711:9): [True: 53, False: 108]
  |  Branch (29711:24): [True: 28, False: 80]
  ------------------
29712|     28|        peg_panicf(b, "width must be between 0 and %d, got %d", JANET_MAX_READINT_WIDTH, width);
  ------------------
  |  |29240|     28|#define peg_panicf(b,...) peg_panic((b), (const char *) janet_formatc(__VA_ARGS__))
  ------------------
29713|     28|    }
29714|    133|    emit_2(r, RULE_READINT, mask | ((uint32_t) width), tag);
29715|    133|}
janet.c:spec_line:
29610|    153|static void spec_line(Builder *b, int32_t argc, const Janet *argv) {
29611|    153|    spec_tag1(b, argc, argv, RULE_LINE);
29612|    153|}
janet.c:spec_nth:
29562|    130|static void spec_nth(Builder *b, int32_t argc, const Janet *argv) {
29563|    130|    peg_arity(b, argc, 2, 3);
29564|    130|    Reserve r = reserve(b, 4);
29565|    130|    uint32_t nth = peg_getnat(b, argv[0]);
29566|    130|    uint32_t rule = peg_compile1(b, argv[1]);
29567|    130|    uint32_t tag = (argc == 3) ? emit_tag(b, argv[2]) : 0;
  ------------------
  |  Branch (29567:20): [True: 1, False: 129]
  ------------------
29568|    130|    emit_3(r, RULE_NTH, nth, rule, tag);
29569|    130|}
janet.c:spec_range:
29375|    106|static void spec_range(Builder *b, int32_t argc, const Janet *argv) {
29376|    106|    peg_arity(b, argc, 1, -1);
29377|    106|    if (argc == 1) {
  ------------------
  |  Branch (29377:9): [True: 58, False: 48]
  ------------------
29378|     58|        Reserve r = reserve(b, 2);
29379|     58|        const uint8_t *str = peg_getrange(b, argv[0]);
29380|     58|        uint32_t arg = str[0] | (str[1] << 16);
29381|     58|        emit_1(r, RULE_RANGE, arg);
29382|     58|    } else {
29383|       |        /* Compile as a set */
29384|     48|        Reserve r = reserve(b, 9);
29385|     48|        uint32_t bitmap[8] = {0};
29386|    167|        for (int32_t i = 0; i < argc; i++) {
  ------------------
  |  Branch (29386:29): [True: 119, False: 48]
  ------------------
29387|    119|            const uint8_t *str = peg_getrange(b, argv[i]);
29388|  7.57k|            for (uint32_t c = str[0]; c <= str[1]; c++)
  ------------------
  |  Branch (29388:39): [True: 7.45k, False: 119]
  ------------------
29389|  7.45k|                bitmap_set(bitmap, c);
29390|    119|        }
29391|     48|        emit_rule(r, RULE_SET, 8, bitmap);
29392|     48|    }
29393|    106|}
janet.c:peg_getrange:
29265|    177|static const uint8_t *peg_getrange(Builder *b, Janet x) {
29266|    177|    if (!janet_checktype(x, JANET_STRING))
  ------------------
  |  |  806|    177|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 177]
  |  |  ------------------
  |  |  807|    177|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|    177|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|    177|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|    177|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|    177|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|    177|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (29266:9): [True: 36, False: 141]
  ------------------
29267|     36|        peg_panic(b, "expected string for character range");
29268|    141|    const uint8_t *str = janet_unwrap_string(x);
  ------------------
  |  |  863|    141|#define janet_unwrap_string(x) ((JanetString)janet_nanbox_to_pointer(x))
  ------------------
29269|    141|    if (janet_string_length(str) != 2)
  ------------------
  |  | 1813|    141|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  ------------------
  |  |  |  | 1812|    141|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (29269:9): [True: 18, False: 123]
  ------------------
29270|     18|        peg_panicf(b, "expected string to have length 2, got %v", x);
  ------------------
  |  |29240|     18|#define peg_panicf(b,...) peg_panic((b), (const char *) janet_formatc(__VA_ARGS__))
  ------------------
29271|    123|    if (str[1] < str[0])
  ------------------
  |  Branch (29271:9): [True: 3, False: 120]
  ------------------
29272|      3|        peg_panicf(b, "range %v is empty", x);
  ------------------
  |  |29240|      3|#define peg_panicf(b,...) peg_panic((b), (const char *) janet_formatc(__VA_ARGS__))
  ------------------
29273|    120|    return str;
29274|    123|}
janet.c:bitmap_set:
29371|  8.27k|static void bitmap_set(uint32_t *bitmap, uint8_t c) {
29372|  8.27k|    bitmap[c >> 5] |= ((uint32_t)1) << (c & 0x1F);
29373|  8.27k|}
janet.c:spec_set:
29395|     43|static void spec_set(Builder *b, int32_t argc, const Janet *argv) {
29396|     43|    peg_fixarity(b, argc, 1);
29397|     43|    Reserve r = reserve(b, 9);
29398|     43|    const uint8_t *str = peg_getset(b, argv[0]);
29399|     43|    uint32_t bitmap[8] = {0};
29400|    861|    for (int32_t i = 0; i < janet_string_length(str); i++)
  ------------------
  |  | 1813|    861|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  ------------------
  |  |  |  | 1812|    861|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (29400:25): [True: 818, False: 43]
  ------------------
29401|    818|        bitmap_set(bitmap, str[i]);
29402|     43|    emit_rule(r, RULE_SET, 8, bitmap);
29403|     43|}
janet.c:peg_getset:
29258|     41|static const uint8_t *peg_getset(Builder *b, Janet x) {
29259|     41|    if (!janet_checktype(x, JANET_STRING))
  ------------------
  |  |  806|     41|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 41]
  |  |  ------------------
  |  |  807|     41|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|     41|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|     41|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|     41|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|     41|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|     41|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (29259:9): [True: 10, False: 31]
  ------------------
29260|     10|        peg_panic(b, "expected string for character set");
29261|     31|    const uint8_t *str = janet_unwrap_string(x);
  ------------------
  |  |  863|     31|#define janet_unwrap_string(x) ((JanetString)janet_nanbox_to_pointer(x))
  ------------------
29262|     31|    return str;
29263|     41|}
janet.c:spec_sub:
29676|     75|static void spec_sub(Builder *b, int32_t argc, const Janet *argv) {
29677|     75|    peg_fixarity(b, argc, 2);
29678|     75|    Reserve r = reserve(b, 3);
29679|     75|    uint32_t subrule1 = peg_compile1(b, argv[0]);
29680|     75|    uint32_t subrule2 = peg_compile1(b, argv[1]);
29681|     75|    emit_2(r, RULE_SUB, subrule1, subrule2);
29682|     75|}
janet.c:spec_til:
29684|    314|static void spec_til(Builder *b, int32_t argc, const Janet *argv) {
29685|    314|    peg_fixarity(b, argc, 2);
29686|    314|    Reserve r = reserve(b, 3);
29687|    314|    uint32_t subrule1 = peg_compile1(b, argv[0]);
29688|    314|    uint32_t subrule2 = peg_compile1(b, argv[1]);
29689|    314|    emit_2(r, RULE_TIL, subrule1, subrule2);
29690|    314|}
janet.c:spec_to:
29527|    136|static void spec_to(Builder *b, int32_t argc, const Janet *argv) {
29528|    136|    spec_onerule(b, argc, argv, RULE_TO);
29529|    136|}
janet.c:spec_uint_le:
29717|     37|static void spec_uint_le(Builder *b, int32_t argc, const Janet *argv) {
29718|     37|    spec_readint(b, argc, argv, 0x0u);
29719|     37|}
janet.c:make_peg:
30244|  2.33k|static JanetPeg *make_peg(Builder *b) {
30245|  2.33k|    size_t bytecode_start = size_padded(sizeof(JanetPeg), sizeof(uint32_t));
30246|  2.33k|    size_t bytecode_size = janet_v_count(b->bytecode) * sizeof(uint32_t);
  ------------------
  |  |  736|  2.33k|#define janet_v_count(v)        (((v) != NULL) ? janet_v__cnt(v) : 0)
  |  |  ------------------
  |  |  |  |  743|  2.33k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  741|  2.33k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (736:34): [True: 2.33k, False: 0]
  |  |  ------------------
  ------------------
30247|  2.33k|    size_t constants_start = size_padded(bytecode_start + bytecode_size, sizeof(Janet));
30248|  2.33k|    size_t constants_size = janet_v_count(b->constants) * sizeof(Janet);
  ------------------
  |  |  736|  2.33k|#define janet_v_count(v)        (((v) != NULL) ? janet_v__cnt(v) : 0)
  |  |  ------------------
  |  |  |  |  743|    549|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  741|    549|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (736:34): [True: 549, False: 1.78k]
  |  |  ------------------
  ------------------
30249|  2.33k|    size_t total_size = constants_start + constants_size;
30250|  2.33k|    char *mem = janet_abstract(&janet_peg_type, total_size);
30251|  2.33k|    JanetPeg *peg = (JanetPeg *)mem;
30252|  2.33k|    peg->bytecode = (uint32_t *)(mem + bytecode_start);
30253|  2.33k|    peg->constants = (Janet *)(mem + constants_start);
30254|  2.33k|    peg->num_constants = janet_v_count(b->constants);
  ------------------
  |  |  736|  2.33k|#define janet_v_count(v)        (((v) != NULL) ? janet_v__cnt(v) : 0)
  |  |  ------------------
  |  |  |  |  743|    549|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  741|    549|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (736:34): [True: 549, False: 1.78k]
  |  |  ------------------
  ------------------
30255|  2.33k|    safe_memcpy(peg->bytecode, b->bytecode, bytecode_size);
30256|  2.33k|    safe_memcpy(peg->constants, b->constants, constants_size);
30257|       |    peg->bytecode_len = janet_v_count(b->bytecode);
  ------------------
  |  |  736|  2.33k|#define janet_v_count(v)        (((v) != NULL) ? janet_v__cnt(v) : 0)
  |  |  ------------------
  |  |  |  |  743|  2.33k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  741|  2.33k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (736:34): [True: 2.33k, False: 0]
  |  |  ------------------
  ------------------
30258|  2.33k|    peg->has_backref = b->has_backref;
30259|  2.33k|    return peg;
30260|  2.33k|}
janet.c:builder_cleanup:
29230|  5.06k|static void builder_cleanup(Builder *b) {
29231|  5.06k|    janet_v_free(b->constants);
  ------------------
  |  |  733|  5.06k|#define janet_v_free(v)         (((v) != NULL) ? (janet_sfree(janet_v__raw(v)), 0) : 0)
  |  |  ------------------
  |  |  |  |  741|    556|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  ------------------
  |  |  |  Branch (733:34): [True: 556, False: 4.50k]
  |  |  ------------------
  ------------------
29232|       |    janet_v_free(b->bytecode);
  ------------------
  |  |  733|  5.06k|#define janet_v_free(v)         (((v) != NULL) ? (janet_sfree(janet_v__raw(v)), 0) : 0)
  |  |  ------------------
  |  |  |  |  741|  2.86k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  ------------------
  |  |  |  Branch (733:34): [True: 2.86k, False: 2.19k]
  |  |  ------------------
  ------------------
29233|  5.06k|}
janet.c:peg_cfun_init:
30312|  5.06k|static PegCall peg_cfun_init(int32_t argc, Janet *argv, int get_replace) {
30313|  5.06k|    PegCall ret;
30314|  5.06k|    int32_t min = get_replace ? 3 : 2;
  ------------------
  |  Branch (30314:19): [True: 0, False: 5.06k]
  ------------------
30315|  5.06k|    janet_arity(argc, min, -1);
30316|  5.06k|    if (janet_checktype(argv[0], JANET_ABSTRACT) &&
  ------------------
  |  |  806|  10.1k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 222, False: 4.83k]
  |  |  |  Branch (806:6): [Folded, False: 5.06k]
  |  |  ------------------
  |  |  807|  10.1k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  10.1k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  5.06k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  5.06k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  5.06k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  5.06k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
30317|    222|            janet_abstract_type(janet_unwrap_abstract(argv[0])) == &janet_peg_type) {
  ------------------
  |  | 1899|    222|#define janet_abstract_type(u) (janet_abstract_head(u)->type)
  |  |  ------------------
  |  |  |  | 1897|    222|#define janet_abstract_head(u) ((JanetAbstractHead *)((char *)u - offsetof(JanetAbstractHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (30317:13): [True: 0, False: 222]
  ------------------
30318|      0|        ret.peg = janet_unwrap_abstract(argv[0]);
  ------------------
  |  |  866|      0|#define janet_unwrap_abstract(x) (janet_nanbox_to_pointer(x))
  ------------------
30319|  5.06k|    } else {
30320|  5.06k|        ret.peg = compile_peg(argv[0]);
30321|  5.06k|    }
30322|  5.06k|    int input_loc = 1;
30323|  5.06k|    if (get_replace) {
  ------------------
  |  Branch (30323:9): [True: 0, False: 5.06k]
  ------------------
30324|      0|        ret.subst = argv[1];
30325|      0|        input_loc = 2;
30326|      0|    }
30327|  5.06k|    ret.bytes = janet_getbytes(argv, input_loc);
30328|  5.06k|    if (janet_checktype(argv[input_loc], JANET_BUFFER)) {
  ------------------
  |  |  806|  5.06k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 0, False: 5.06k]
  |  |  |  Branch (806:6): [Folded, False: 5.06k]
  |  |  ------------------
  |  |  807|  5.06k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  5.06k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  5.06k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  5.06k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  5.06k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  5.06k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
30329|      0|        ret.input_buffer = janet_unwrap_buffer(argv[input_loc]);
  ------------------
  |  |  862|      0|#define janet_unwrap_buffer(x) ((JanetBuffer *)janet_nanbox_to_pointer(x))
  ------------------
30330|      0|        ret.old_flags = ret.input_buffer->gc.flags;
30331|      0|        ret.input_buffer->gc.flags |= JANET_BUFFER_FLAG_NO_REALLOC;
  ------------------
  |  | 1780|      0|#define JANET_BUFFER_FLAG_NO_REALLOC 0x10000
  ------------------
30332|  5.06k|    } else {
30333|  5.06k|        ret.input_buffer = NULL;
30334|  5.06k|    }
30335|  5.06k|    if (argc > min) {
  ------------------
  |  Branch (30335:9): [True: 0, False: 5.06k]
  ------------------
30336|      0|        ret.start = janet_gethalfrange(argv, min, ret.bytes.len, "offset");
30337|      0|        ret.s.extrac = argc - min - 1;
30338|      0|        ret.s.extrav = janet_tuple_n(argv + min + 1, argc - min - 1);
30339|  5.06k|    } else {
30340|  5.06k|        ret.start = 0;
30341|  5.06k|        ret.s.extrac = 0;
30342|  5.06k|        ret.s.extrav = NULL;
30343|  5.06k|    }
30344|  5.06k|    ret.s.mode = PEG_MODE_NORMAL;
30345|  5.06k|    ret.s.text_start = ret.bytes.bytes;
30346|  5.06k|    ret.s.text_end = ret.bytes.bytes + ret.bytes.len;
30347|  5.06k|    ret.s.outer_text_end = ret.s.text_end;
30348|  5.06k|    ret.s.depth = JANET_RECURSION_GUARD;
  ------------------
  |  |  296|  5.06k|#define JANET_RECURSION_GUARD 1024
  ------------------
30349|  5.06k|    ret.s.captures = janet_array(0);
30350|  5.06k|    ret.s.tagged_captures = janet_array(0);
30351|  5.06k|    ret.s.scratch = janet_buffer(10);
30352|  5.06k|    ret.s.tags = janet_buffer(10);
30353|  5.06k|    ret.s.constants = ret.peg->constants;
30354|  5.06k|    ret.s.bytecode = ret.peg->bytecode;
30355|       |    ret.s.linemap = NULL;
30356|  5.06k|    ret.s.linemaplen = -1;
30357|  5.06k|    ret.s.has_backref = ret.peg->has_backref;
30358|  5.06k|    return ret;
30359|  5.06k|}
janet.c:peg_rule:
28538|   275M|    const uint8_t *text) {
28539|   278M|tail:
28540|   278M|    switch (*rule) {
28541|      0|        default:
  ------------------
  |  Branch (28541:9): [True: 0, False: 278M]
  ------------------
28542|      0|            janet_panic("unexpected opcode");
28543|      0|            return NULL;
28544|       |
28545|   128M|        case RULE_LITERAL: {
  ------------------
  |  Branch (28545:9): [True: 128M, False: 150M]
  ------------------
28546|   128M|            uint32_t len = rule[1];
28547|   128M|            if (text + len > s->text_end) return NULL;
  ------------------
  |  Branch (28547:17): [True: 136k, False: 127M]
  ------------------
28548|   127M|            return memcmp(text, rule + 2, len) ? NULL : text + len;
  ------------------
  |  Branch (28548:20): [True: 924k, False: 127M]
  ------------------
28549|   128M|        }
28550|       |
28551|   406k|        case RULE_DEBUG: {
  ------------------
  |  Branch (28551:9): [True: 406k, False: 277M]
  ------------------
28552|   406k|            char buffer[32] = {0};
28553|   406k|            size_t len = (size_t)(s->outer_text_end - text);
28554|   406k|            memcpy(buffer, text, (len > 31 ? 31 : len));
  ------------------
  |  Branch (28554:35): [True: 4.70k, False: 401k]
  ------------------
28555|   406k|            janet_eprintf("?? at [%s] (index %d)\n", buffer, (int32_t)(text - s->text_start));
  ------------------
  |  | 2195|   406k|#define janet_eprintf(...) janet_dynprintf("err", stderr, __VA_ARGS__)
  ------------------
28556|   406k|            int has_color = janet_truthy(janet_dyn("err-color"));
  ------------------
  |  |  818|   406k|    (!janet_checktype((x), JANET_NIL) && \
  |  |  ------------------
  |  |  |  |  806|   812k|    (((t) == JANET_NUMBER) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (806:6): [Folded, False: 406k]
  |  |  |  |  ------------------
  |  |  |  |  807|   812k|        ? janet_nanbox_isnumber(x) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  808|   812k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  800|   406k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  790|   406k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  793|   406k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  792|   406k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 0, False: 406k]
  |  |  ------------------
  |  |  819|   406k|     (!janet_checktype((x), JANET_BOOLEAN) || ((x).u64 & 0x1)))
  |  |  ------------------
  |  |  |  |  806|      0|    (((t) == JANET_NUMBER) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (806:6): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  807|      0|        ? janet_nanbox_isnumber(x) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  808|      0|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  800|      0|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  790|      0|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (819:7): [True: 0, False: 0]
  |  |  |  Branch (819:47): [True: 0, False: 0]
  |  |  ------------------
  ------------------
28557|       |            /* Accumulate buffer */
28558|   406k|            if (s->scratch->count) {
  ------------------
  |  Branch (28558:17): [True: 72.3k, False: 334k]
  ------------------
28559|  72.3k|                janet_eprintf("accumulate buffer: %v\n", janet_wrap_buffer(s->scratch));
  ------------------
  |  | 2195|  72.3k|#define janet_eprintf(...) janet_dynprintf("err", stderr, __VA_ARGS__)
  ------------------
28560|  72.3k|            }
28561|       |            /* Normal captures */
28562|   406k|            if (s->captures->count) {
  ------------------
  |  Branch (28562:17): [True: 311k, False: 94.9k]
  ------------------
28563|   311k|                janet_eprintf("stack [%d]:\n", s->captures->count);
  ------------------
  |  | 2195|   311k|#define janet_eprintf(...) janet_dynprintf("err", stderr, __VA_ARGS__)
  ------------------
28564|  17.7M|                for (int32_t i = 0; i < s->captures->count; i++) {
  ------------------
  |  Branch (28564:37): [True: 17.4M, False: 311k]
  ------------------
28565|  17.4M|                    if (has_color) {
  ------------------
  |  Branch (28565:25): [True: 0, False: 17.4M]
  ------------------
28566|      0|                        janet_eprintf("  [%d]: %M\n", i, s->captures->data[i]);
  ------------------
  |  | 2195|      0|#define janet_eprintf(...) janet_dynprintf("err", stderr, __VA_ARGS__)
  ------------------
28567|  17.4M|                    } else {
28568|  17.4M|                        janet_eprintf("  [%d]: %m\n", i, s->captures->data[i]);
  ------------------
  |  | 2195|  17.4M|#define janet_eprintf(...) janet_dynprintf("err", stderr, __VA_ARGS__)
  ------------------
28569|  17.4M|                    }
28570|  17.4M|                }
28571|   311k|            }
28572|       |            /* Tagged captures */
28573|   406k|            if (s->tagged_captures->count) {
  ------------------
  |  Branch (28573:17): [True: 4.61k, False: 401k]
  ------------------
28574|  4.61k|                janet_eprintf("tag stack [%d]:\n", s->tagged_captures->count);
  ------------------
  |  | 2195|  4.61k|#define janet_eprintf(...) janet_dynprintf("err", stderr, __VA_ARGS__)
  ------------------
28575|  1.24M|                for (int32_t i = 0; i < s->tagged_captures->count; i++) {
  ------------------
  |  Branch (28575:37): [True: 1.23M, False: 4.61k]
  ------------------
28576|  1.23M|                    if (has_color) {
  ------------------
  |  Branch (28576:25): [True: 0, False: 1.23M]
  ------------------
28577|      0|                        janet_eprintf("  [%d] tag=%d: %M\n", i, (int32_t) s->tags->data[i], s->tagged_captures->data[i]);
  ------------------
  |  | 2195|      0|#define janet_eprintf(...) janet_dynprintf("err", stderr, __VA_ARGS__)
  ------------------
28578|  1.23M|                    } else {
28579|  1.23M|                        janet_eprintf("  [%d] tag=%d: %m\n", i, (int32_t) s->tags->data[i], s->tagged_captures->data[i]);
  ------------------
  |  | 2195|  1.23M|#define janet_eprintf(...) janet_dynprintf("err", stderr, __VA_ARGS__)
  ------------------
28580|  1.23M|                    }
28581|  1.23M|                }
28582|  4.61k|            }
28583|   406k|            return text;
28584|   128M|        }
28585|       |
28586|  69.2M|        case RULE_NCHAR: {
  ------------------
  |  Branch (28586:9): [True: 69.2M, False: 209M]
  ------------------
28587|  69.2M|            uint32_t n = rule[1];
28588|  69.2M|            return (text + n > s->text_end) ? NULL : text + n;
  ------------------
  |  Branch (28588:20): [True: 2.71M, False: 66.5M]
  ------------------
28589|   128M|        }
28590|       |
28591|  11.2k|        case RULE_NOTNCHAR: {
  ------------------
  |  Branch (28591:9): [True: 11.2k, False: 278M]
  ------------------
28592|  11.2k|            uint32_t n = rule[1];
28593|  11.2k|            return (text + n > s->text_end) ? text : NULL;
  ------------------
  |  Branch (28593:20): [True: 7.78k, False: 3.47k]
  ------------------
28594|   128M|        }
28595|       |
28596|    659|        case RULE_RANGE: {
  ------------------
  |  Branch (28596:9): [True: 659, False: 278M]
  ------------------
28597|    659|            uint8_t lo = rule[1] & 0xFF;
28598|    659|            uint8_t hi = (rule[1] >> 16) & 0xFF;
28599|    659|            return (text < s->text_end &&
  ------------------
  |  Branch (28599:21): [True: 636, False: 23]
  ------------------
28600|    636|                    text[0] >= lo &&
  ------------------
  |  Branch (28600:21): [True: 436, False: 200]
  ------------------
28601|    436|                    text[0] <= hi)
  ------------------
  |  Branch (28601:21): [True: 202, False: 234]
  ------------------
28602|    659|                   ? text + 1
28603|    659|                   : NULL;
28604|   128M|        }
28605|       |
28606|    220|        case RULE_SET: {
  ------------------
  |  Branch (28606:9): [True: 220, False: 278M]
  ------------------
28607|    220|            if (text >= s->text_end) return NULL;
  ------------------
  |  Branch (28607:17): [True: 8, False: 212]
  ------------------
28608|    212|            uint32_t word = rule[1 + (text[0] >> 5)];
28609|    212|            uint32_t mask = (uint32_t)1 << (text[0] & 0x1F);
28610|    212|            return (word & mask)
  ------------------
  |  Branch (28610:20): [True: 9, False: 203]
  ------------------
28611|    212|                   ? text + 1
28612|    212|                   : NULL;
28613|    220|        }
28614|       |
28615|  16.7k|        case RULE_LOOK: {
  ------------------
  |  Branch (28615:9): [True: 16.7k, False: 278M]
  ------------------
28616|  16.7k|            text += ((int32_t *)rule)[1];
28617|  16.7k|            if (text < s->text_start || text > s->text_end) return NULL;
  ------------------
  |  Branch (28617:17): [True: 353, False: 16.3k]
  |  Branch (28617:41): [True: 593, False: 15.7k]
  ------------------
28618|  15.7k|            down1(s);
  ------------------
  |  |28523|  15.7k|#define down1(s) do { \
  |  |28524|  15.7k|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28524:9): [True: 0, False: 15.7k]
  |  |  ------------------
  |  |28525|  15.7k|} while (0)
  |  |  ------------------
  |  |  |  Branch (28525:10): [Folded, False: 15.7k]
  |  |  ------------------
  ------------------
28619|  15.7k|            const uint8_t *result = peg_rule(s, s->bytecode + rule[2], text);
28620|  15.7k|            up1(s);
  ------------------
  |  |28526|  15.7k|#define up1(s) ((s)->depth++)
  ------------------
28621|  15.7k|            text -= ((int32_t *)rule)[1];
28622|  15.7k|            return result ? text : NULL;
  ------------------
  |  Branch (28622:20): [True: 15.2k, False: 565]
  ------------------
28623|  15.7k|        }
28624|       |
28625|   306k|        case RULE_CHOICE: {
  ------------------
  |  Branch (28625:9): [True: 306k, False: 277M]
  ------------------
28626|   306k|            uint32_t len = rule[1];
28627|   306k|            const uint32_t *args = rule + 2;
28628|   306k|            if (len == 0) return NULL;
  ------------------
  |  Branch (28628:17): [True: 10.8k, False: 295k]
  ------------------
28629|   295k|            down1(s);
  ------------------
  |  |28523|   295k|#define down1(s) do { \
  |  |28524|   295k|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28524:9): [True: 0, False: 295k]
  |  |  ------------------
  |  |28525|   295k|} while (0)
  |  |  ------------------
  |  |  |  Branch (28525:10): [Folded, False: 295k]
  |  |  ------------------
  ------------------
28630|   295k|            CapState cs = cap_save(s);
28631|   378k|            for (uint32_t i = 0; i < len - 1; i++) {
  ------------------
  |  Branch (28631:34): [True: 316k, False: 62.7k]
  ------------------
28632|   316k|                const uint8_t *result = peg_rule(s, s->bytecode + args[i], text);
28633|   316k|                if (result) {
  ------------------
  |  Branch (28633:21): [True: 232k, False: 83.6k]
  ------------------
28634|   232k|                    up1(s);
  ------------------
  |  |28526|   232k|#define up1(s) ((s)->depth++)
  ------------------
28635|   232k|                    return result;
28636|   232k|                }
28637|  83.6k|                cap_load(s, cs);
28638|  83.6k|            }
28639|  62.7k|            up1(s);
  ------------------
  |  |28526|  62.7k|#define up1(s) ((s)->depth++)
  ------------------
28640|  62.7k|            rule = s->bytecode + args[len - 1];
28641|  62.7k|            goto tail;
28642|   295k|        }
28643|       |
28644|  4.00M|        case RULE_SEQUENCE: {
  ------------------
  |  Branch (28644:9): [True: 4.00M, False: 274M]
  ------------------
28645|  4.00M|            uint32_t len = rule[1];
28646|  4.00M|            const uint32_t *args = rule + 2;
28647|  4.00M|            if (len == 0) return text;
  ------------------
  |  Branch (28647:17): [True: 601k, False: 3.40M]
  ------------------
28648|  3.40M|            down1(s);
  ------------------
  |  |28523|  3.40M|#define down1(s) do { \
  |  |28524|  3.40M|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28524:9): [True: 0, False: 3.40M]
  |  |  ------------------
  |  |28525|  3.40M|} while (0)
  |  |  ------------------
  |  |  |  Branch (28525:10): [Folded, False: 3.40M]
  |  |  ------------------
  ------------------
28649|  16.4M|            for (uint32_t i = 0; text && i < len - 1; i++)
  ------------------
  |  Branch (28649:34): [True: 16.1M, False: 268k]
  |  Branch (28649:42): [True: 13.0M, False: 3.13M]
  ------------------
28650|  13.0M|                text = peg_rule(s, s->bytecode + args[i], text);
28651|  3.40M|            up1(s);
  ------------------
  |  |28526|  3.40M|#define up1(s) ((s)->depth++)
  ------------------
28652|  3.40M|            if (!text) return NULL;
  ------------------
  |  Branch (28652:17): [True: 268k, False: 3.13M]
  ------------------
28653|  3.13M|            rule = s->bytecode + args[len - 1];
28654|  3.13M|            goto tail;
28655|  3.40M|        }
28656|       |
28657|  11.5k|        case RULE_IF: {
  ------------------
  |  Branch (28657:9): [True: 11.5k, False: 278M]
  ------------------
28658|  11.5k|            const uint32_t *rule_a = s->bytecode + rule[1];
28659|  11.5k|            const uint32_t *rule_b = s->bytecode + rule[2];
28660|  11.5k|            down1(s);
  ------------------
  |  |28523|  11.5k|#define down1(s) do { \
  |  |28524|  11.5k|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28524:9): [True: 0, False: 11.5k]
  |  |  ------------------
  |  |28525|  11.5k|} while (0)
  |  |  ------------------
  |  |  |  Branch (28525:10): [Folded, False: 11.5k]
  |  |  ------------------
  ------------------
28661|  11.5k|            const uint8_t *result = peg_rule(s, rule_a, text);
28662|  11.5k|            up1(s);
  ------------------
  |  |28526|  11.5k|#define up1(s) ((s)->depth++)
  ------------------
28663|  11.5k|            if (!result) return NULL;
  ------------------
  |  Branch (28663:17): [True: 268, False: 11.2k]
  ------------------
28664|  11.2k|            rule = rule_b;
28665|  11.2k|            goto tail;
28666|  11.5k|        }
28667|      0|        case RULE_IFNOT: {
  ------------------
  |  Branch (28667:9): [True: 0, False: 278M]
  ------------------
28668|      0|            const uint32_t *rule_a = s->bytecode + rule[1];
28669|      0|            const uint32_t *rule_b = s->bytecode + rule[2];
28670|      0|            down1(s);
  ------------------
  |  |28523|      0|#define down1(s) do { \
  |  |28524|      0|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28524:9): [True: 0, False: 0]
  |  |  ------------------
  |  |28525|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (28525:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
28671|      0|            CapState cs = cap_save(s);
28672|      0|            const uint8_t *result = peg_rule(s, rule_a, text);
28673|      0|            if (!!result) {
  ------------------
  |  Branch (28673:17): [True: 0, False: 0]
  ------------------
28674|      0|                up1(s);
  ------------------
  |  |28526|      0|#define up1(s) ((s)->depth++)
  ------------------
28675|      0|                return NULL;
28676|      0|            } else {
28677|      0|                cap_load(s, cs);
28678|      0|                up1(s);
  ------------------
  |  |28526|      0|#define up1(s) ((s)->depth++)
  ------------------
28679|      0|                rule = rule_b;
28680|      0|                goto tail;
28681|      0|            }
28682|      0|        }
28683|       |
28684|  11.2k|        case RULE_NOT: {
  ------------------
  |  Branch (28684:9): [True: 11.2k, False: 278M]
  ------------------
28685|  11.2k|            const uint32_t *rule_a = s->bytecode + rule[1];
28686|  11.2k|            down1(s);
  ------------------
  |  |28523|  11.2k|#define down1(s) do { \
  |  |28524|  11.2k|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28524:9): [True: 0, False: 11.2k]
  |  |  ------------------
  |  |28525|  11.2k|} while (0)
  |  |  ------------------
  |  |  |  Branch (28525:10): [Folded, False: 11.2k]
  |  |  ------------------
  ------------------
28687|  11.2k|            CapState cs = cap_save(s);
28688|  11.2k|            const uint8_t *result = peg_rule(s, rule_a, text);
28689|  11.2k|            if (result) {
  ------------------
  |  Branch (28689:17): [True: 230, False: 11.0k]
  ------------------
28690|    230|                up1(s);
  ------------------
  |  |28526|    230|#define up1(s) ((s)->depth++)
  ------------------
28691|    230|                return NULL;
28692|  11.0k|            } else {
28693|  11.0k|                cap_load(s, cs);
28694|  11.0k|                up1(s);
  ------------------
  |  |28526|  11.0k|#define up1(s) ((s)->depth++)
  ------------------
28695|  11.0k|                return text;
28696|  11.0k|            }
28697|  11.2k|        }
28698|       |
28699|      0|        case RULE_THRU:
  ------------------
  |  Branch (28699:9): [True: 0, False: 278M]
  ------------------
28700|  20.6k|        case RULE_TO: {
  ------------------
  |  Branch (28700:9): [True: 20.6k, False: 278M]
  ------------------
28701|  20.6k|            const uint32_t *rule_a = s->bytecode + rule[1];
28702|  20.6k|            const uint8_t *next_text = NULL;
28703|  20.6k|            CapState cs = cap_save(s);
28704|  20.6k|            down1(s);
  ------------------
  |  |28523|  20.6k|#define down1(s) do { \
  |  |28524|  20.6k|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28524:9): [True: 0, False: 20.6k]
  |  |  ------------------
  |  |28525|  20.6k|} while (0)
  |  |  ------------------
  |  |  |  Branch (28525:10): [Folded, False: 20.6k]
  |  |  ------------------
  ------------------
28705|   940k|            while (text <= s->text_end) {
  ------------------
  |  Branch (28705:20): [True: 920k, False: 19.8k]
  ------------------
28706|   920k|                CapState cs2 = cap_save(s);
28707|   920k|                next_text = peg_rule(s, rule_a, text);
28708|   920k|                if (next_text) {
  ------------------
  |  Branch (28708:21): [True: 737, False: 919k]
  ------------------
28709|    737|                    if (rule[0] == RULE_TO) cap_load(s, cs2);
  ------------------
  |  Branch (28709:25): [True: 737, False: 0]
  ------------------
28710|    737|                    break;
28711|    737|                }
28712|   919k|                cap_load(s, cs2);
28713|   919k|                text++;
28714|   919k|            }
28715|  20.6k|            up1(s);
  ------------------
  |  |28526|  20.6k|#define up1(s) ((s)->depth++)
  ------------------
28716|  20.6k|            if (text > s->text_end) {
  ------------------
  |  Branch (28716:17): [True: 19.8k, False: 737]
  ------------------
28717|  19.8k|                cap_load(s, cs);
28718|  19.8k|                return NULL;
28719|  19.8k|            }
28720|    737|            return rule[0] == RULE_TO ? text : next_text;
  ------------------
  |  Branch (28720:20): [True: 737, False: 0]
  ------------------
28721|  20.6k|        }
28722|       |
28723|   545k|        case RULE_BETWEEN: {
  ------------------
  |  Branch (28723:9): [True: 545k, False: 277M]
  ------------------
28724|   545k|            uint32_t lo = rule[1];
28725|   545k|            uint32_t hi = rule[2];
28726|   545k|            const uint32_t *rule_a = s->bytecode + rule[3];
28727|   545k|            uint32_t captured = 0;
28728|   545k|            const uint8_t *next_text;
28729|   545k|            CapState cs = cap_save(s);
28730|   545k|            down1(s);
  ------------------
  |  |28523|   545k|#define down1(s) do { \
  |  |28524|   545k|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28524:9): [True: 0, False: 545k]
  |  |  ------------------
  |  |28525|   545k|} while (0)
  |  |  ------------------
  |  |  |  Branch (28525:10): [Folded, False: 545k]
  |  |  ------------------
  ------------------
28731|   189M|            while (captured < hi) {
  ------------------
  |  Branch (28731:20): [True: 189M, False: 94.8k]
  ------------------
28732|   189M|                CapState cs2 = cap_save(s);
28733|   189M|                next_text = peg_rule(s, rule_a, text);
28734|   189M|                if (!next_text || ((next_text == text) && (hi == UINT32_MAX))) {
  ------------------
  |  Branch (28734:21): [True: 124k, False: 189M]
  |  Branch (28734:36): [True: 186M, False: 2.15M]
  |  Branch (28734:59): [True: 326k, False: 186M]
  ------------------
28735|   450k|                    cap_load(s, cs2);
28736|   450k|                    break;
28737|   450k|                }
28738|   188M|                captured++;
28739|   188M|                text = next_text;
28740|   188M|            }
28741|   545k|            up1(s);
  ------------------
  |  |28526|   545k|#define up1(s) ((s)->depth++)
  ------------------
28742|   545k|            if (captured < lo) {
  ------------------
  |  Branch (28742:17): [True: 765, False: 544k]
  ------------------
28743|    765|                cap_load(s, cs);
28744|    765|                return NULL;
28745|    765|            }
28746|   544k|            return text;
28747|   545k|        }
28748|       |
28749|       |        /* Capturing rules */
28750|       |
28751|  40.3k|        case RULE_GETTAG: {
  ------------------
  |  Branch (28751:9): [True: 40.3k, False: 278M]
  ------------------
28752|  40.3k|            uint32_t search = rule[1];
28753|  40.3k|            uint32_t tag = rule[2];
28754|   540M|            for (int32_t i = s->tags->count - 1; i >= 0; i--) {
  ------------------
  |  Branch (28754:50): [True: 540M, False: 38.2k]
  ------------------
28755|   540M|                if (s->tags->data[i] == search) {
  ------------------
  |  Branch (28755:21): [True: 2.06k, False: 540M]
  ------------------
28756|  2.06k|                    pushcap(s, s->tagged_captures->data[i], tag);
28757|  2.06k|                    return text;
28758|  2.06k|                }
28759|   540M|            }
28760|  38.2k|            return NULL;
28761|  40.3k|        }
28762|       |
28763|   679k|        case RULE_POSITION: {
  ------------------
  |  Branch (28763:9): [True: 679k, False: 277M]
  ------------------
28764|   679k|            pushcap(s, janet_wrap_number((double)(text - s->text_start)), rule[1]);
  ------------------
  |  |  835|   679k|#define janet_wrap_number(r) janet_nanbox_from_double(r)
  ------------------
28765|   679k|            return text;
28766|  40.3k|        }
28767|       |
28768|  4.08M|        case RULE_LINE: {
  ------------------
  |  Branch (28768:9): [True: 4.08M, False: 274M]
  ------------------
28769|  4.08M|            LineCol lc = get_linecol_from_position(s, (int32_t)(text - s->text_start));
28770|  4.08M|            pushcap(s, janet_wrap_number((double)(lc.line)), rule[1]);
  ------------------
  |  |  835|  4.08M|#define janet_wrap_number(r) janet_nanbox_from_double(r)
  ------------------
28771|  4.08M|            return text;
28772|  40.3k|        }
28773|       |
28774|  1.91M|        case RULE_COLUMN: {
  ------------------
  |  Branch (28774:9): [True: 1.91M, False: 276M]
  ------------------
28775|  1.91M|            LineCol lc = get_linecol_from_position(s, (int32_t)(text - s->text_start));
28776|  1.91M|            pushcap(s, janet_wrap_number((double)(lc.col)), rule[1]);
  ------------------
  |  |  835|  1.91M|#define janet_wrap_number(r) janet_nanbox_from_double(r)
  ------------------
28777|  1.91M|            return text;
28778|  40.3k|        }
28779|       |
28780|      0|        case RULE_ARGUMENT: {
  ------------------
  |  Branch (28780:9): [True: 0, False: 278M]
  ------------------
28781|      0|            int32_t index = ((int32_t *)rule)[1];
28782|      0|            Janet capture = (index >= s->extrac || index < 0) ? janet_wrap_nil() : s->extrav[index];
  ------------------
  |  |  831|      0|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|      0|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (28782:30): [True: 0, False: 0]
  |  Branch (28782:52): [True: 0, False: 0]
  ------------------
28783|      0|            pushcap(s, capture, rule[2]);
28784|      0|            return text;
28785|  40.3k|        }
28786|       |
28787|      0|        case RULE_CONSTANT: {
  ------------------
  |  Branch (28787:9): [True: 0, False: 278M]
  ------------------
28788|      0|            pushcap(s, s->constants[rule[1]], rule[2]);
28789|      0|            return text;
28790|  40.3k|        }
28791|       |
28792|  10.4M|        case RULE_CAPTURE: {
  ------------------
  |  Branch (28792:9): [True: 10.4M, False: 267M]
  ------------------
28793|  10.4M|            down1(s);
  ------------------
  |  |28523|  10.4M|#define down1(s) do { \
  |  |28524|  10.4M|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28524:9): [True: 0, False: 10.4M]
  |  |  ------------------
  |  |28525|  10.4M|} while (0)
  |  |  ------------------
  |  |  |  Branch (28525:10): [Folded, False: 10.4M]
  |  |  ------------------
  ------------------
28794|  10.4M|            const uint8_t *result = peg_rule(s, s->bytecode + rule[1], text);
28795|  10.4M|            up1(s);
  ------------------
  |  |28526|  10.4M|#define up1(s) ((s)->depth++)
  ------------------
28796|  10.4M|            if (!result) return NULL;
  ------------------
  |  Branch (28796:17): [True: 2.42M, False: 8.06M]
  ------------------
28797|       |            /* Specialized pushcap - avoid intermediate string creation */
28798|  8.06M|            if (!s->has_backref && s->mode == PEG_MODE_ACCUMULATE) {
  ------------------
  |  Branch (28798:17): [True: 8.01M, False: 44.7k]
  |  Branch (28798:36): [True: 1.69k, False: 8.01M]
  ------------------
28799|  1.69k|                janet_buffer_push_bytes(s->scratch, text, (int32_t)(result - text));
28800|  8.06M|            } else {
28801|  8.06M|                uint32_t tag = rule[2];
28802|  8.06M|                pushcap(s, janet_stringv(text, (int32_t)(result - text)), tag);
  ------------------
  |  | 1827|  8.06M|#define janet_stringv(str, len) janet_wrap_string(janet_string((str), (len)))
  |  |  ------------------
  |  |  |  |  848|  8.06M|#define janet_wrap_string(s) janet_nanbox_wrap_c((s), JANET_STRING)
  |  |  |  |  ------------------
  |  |  |  |  |  |  828|  8.06M|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  793|  8.06M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  792|  8.06M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
28803|  8.06M|            }
28804|  8.06M|            return result;
28805|  10.4M|        }
28806|       |
28807|      0|        case RULE_CAPTURE_NUM: {
  ------------------
  |  Branch (28807:9): [True: 0, False: 278M]
  ------------------
28808|      0|            down1(s);
  ------------------
  |  |28523|      0|#define down1(s) do { \
  |  |28524|      0|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28524:9): [True: 0, False: 0]
  |  |  ------------------
  |  |28525|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (28525:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
28809|      0|            const uint8_t *result = peg_rule(s, s->bytecode + rule[1], text);
28810|      0|            up1(s);
  ------------------
  |  |28526|      0|#define up1(s) ((s)->depth++)
  ------------------
28811|      0|            if (!result) return NULL;
  ------------------
  |  Branch (28811:17): [True: 0, False: 0]
  ------------------
28812|       |            /* check number parsing */
28813|      0|            double x = 0.0;
28814|      0|            int32_t base = (int32_t) rule[2];
28815|      0|            if (janet_scan_number_base(text, (int32_t)(result - text), base, &x)) return NULL;
  ------------------
  |  Branch (28815:17): [True: 0, False: 0]
  ------------------
28816|       |            /* Specialized pushcap - avoid intermediate string creation */
28817|      0|            if (!s->has_backref && s->mode == PEG_MODE_ACCUMULATE) {
  ------------------
  |  Branch (28817:17): [True: 0, False: 0]
  |  Branch (28817:36): [True: 0, False: 0]
  ------------------
28818|      0|                janet_buffer_push_bytes(s->scratch, text, (int32_t)(result - text));
28819|      0|            } else {
28820|      0|                uint32_t tag = rule[3];
28821|      0|                pushcap(s, janet_wrap_number(x), tag);
  ------------------
  |  |  835|      0|#define janet_wrap_number(r) janet_nanbox_from_double(r)
  ------------------
28822|      0|            }
28823|      0|            return result;
28824|      0|        }
28825|       |
28826|   243k|        case RULE_ACCUMULATE: {
  ------------------
  |  Branch (28826:9): [True: 243k, False: 278M]
  ------------------
28827|   243k|            uint32_t tag = rule[2];
28828|   243k|            int oldmode = s->mode;
28829|   243k|            if (!tag && oldmode == PEG_MODE_ACCUMULATE) {
  ------------------
  |  Branch (28829:17): [True: 241k, False: 2.19k]
  |  Branch (28829:25): [True: 1.05k, False: 240k]
  ------------------
28830|  1.05k|                rule = s->bytecode + rule[1];
28831|  1.05k|                goto tail;
28832|  1.05k|            }
28833|   242k|            CapState cs = cap_save(s);
28834|   242k|            s->mode = PEG_MODE_ACCUMULATE;
28835|   242k|            down1(s);
  ------------------
  |  |28523|   242k|#define down1(s) do { \
  |  |28524|   242k|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28524:9): [True: 0, False: 242k]
  |  |  ------------------
  |  |28525|   242k|} while (0)
  |  |  ------------------
  |  |  |  Branch (28525:10): [Folded, False: 242k]
  |  |  ------------------
  ------------------
28836|   242k|            const uint8_t *result = peg_rule(s, s->bytecode + rule[1], text);
28837|   242k|            up1(s);
  ------------------
  |  |28526|   242k|#define up1(s) ((s)->depth++)
  ------------------
28838|   242k|            s->mode = oldmode;
28839|   242k|            if (!result) return NULL;
  ------------------
  |  Branch (28839:17): [True: 353, False: 241k]
  ------------------
28840|   241k|            Janet cap = janet_stringv(s->scratch->data + cs.scratch,
  ------------------
  |  | 1827|   241k|#define janet_stringv(str, len) janet_wrap_string(janet_string((str), (len)))
  |  |  ------------------
  |  |  |  |  848|   241k|#define janet_wrap_string(s) janet_nanbox_wrap_c((s), JANET_STRING)
  |  |  |  |  ------------------
  |  |  |  |  |  |  828|   241k|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  793|   241k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  792|   241k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
28841|   241k|                                      s->scratch->count - cs.scratch);
28842|   241k|            cap_load_keept(s, cs);
28843|   241k|            pushcap(s, cap, tag);
28844|   241k|            return result;
28845|   242k|        }
28846|       |
28847|      0|        case RULE_DROP: {
  ------------------
  |  Branch (28847:9): [True: 0, False: 278M]
  ------------------
28848|      0|            CapState cs = cap_save(s);
28849|      0|            down1(s);
  ------------------
  |  |28523|      0|#define down1(s) do { \
  |  |28524|      0|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28524:9): [True: 0, False: 0]
  |  |  ------------------
  |  |28525|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (28525:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
28850|      0|            const uint8_t *result = peg_rule(s, s->bytecode + rule[1], text);
28851|      0|            up1(s);
  ------------------
  |  |28526|      0|#define up1(s) ((s)->depth++)
  ------------------
28852|      0|            if (!result) return NULL;
  ------------------
  |  Branch (28852:17): [True: 0, False: 0]
  ------------------
28853|      0|            cap_load(s, cs);
28854|      0|            return result;
28855|      0|        }
28856|       |
28857|      0|        case RULE_ONLY_TAGS: {
  ------------------
  |  Branch (28857:9): [True: 0, False: 278M]
  ------------------
28858|      0|            CapState cs = cap_save(s);
28859|      0|            down1(s);
  ------------------
  |  |28523|      0|#define down1(s) do { \
  |  |28524|      0|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28524:9): [True: 0, False: 0]
  |  |  ------------------
  |  |28525|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (28525:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
28860|      0|            const uint8_t *result = peg_rule(s, s->bytecode + rule[1], text);
28861|      0|            up1(s);
  ------------------
  |  |28526|      0|#define up1(s) ((s)->depth++)
  ------------------
28862|      0|            if (!result) return NULL;
  ------------------
  |  Branch (28862:17): [True: 0, False: 0]
  ------------------
28863|      0|            cap_load_keept(s, cs);
28864|      0|            return result;
28865|      0|        }
28866|       |
28867|      0|        case RULE_GROUP: {
  ------------------
  |  Branch (28867:9): [True: 0, False: 278M]
  ------------------
28868|      0|            uint32_t tag = rule[2];
28869|      0|            int oldmode = s->mode;
28870|      0|            CapState cs = cap_save(s);
28871|      0|            s->mode = PEG_MODE_NORMAL;
28872|      0|            down1(s);
  ------------------
  |  |28523|      0|#define down1(s) do { \
  |  |28524|      0|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28524:9): [True: 0, False: 0]
  |  |  ------------------
  |  |28525|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (28525:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
28873|      0|            const uint8_t *result = peg_rule(s, s->bytecode + rule[1], text);
28874|      0|            up1(s);
  ------------------
  |  |28526|      0|#define up1(s) ((s)->depth++)
  ------------------
28875|      0|            s->mode = oldmode;
28876|      0|            if (!result) return NULL;
  ------------------
  |  Branch (28876:17): [True: 0, False: 0]
  ------------------
28877|      0|            int32_t num_sub_captures = s->captures->count - cs.cap;
28878|      0|            JanetArray *sub_captures = janet_array(num_sub_captures);
28879|      0|            safe_memcpy(sub_captures->data,
28880|      0|                        s->captures->data + cs.cap,
28881|      0|                        sizeof(Janet) * num_sub_captures);
28882|      0|            sub_captures->count = num_sub_captures;
28883|      0|            cap_load_keept(s, cs);
28884|      0|            pushcap(s, janet_wrap_array(sub_captures), tag);
  ------------------
  |  |  845|      0|#define janet_wrap_array(s) janet_nanbox_wrap_((s), JANET_ARRAY)
  |  |  ------------------
  |  |  |  |  825|      0|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
28885|      0|            return result;
28886|      0|        }
28887|       |
28888|  21.4k|        case RULE_NTH: {
  ------------------
  |  Branch (28888:9): [True: 21.4k, False: 278M]
  ------------------
28889|  21.4k|            uint32_t nth = rule[1];
28890|  21.4k|            if (nth > INT32_MAX) nth = INT32_MAX;
  ------------------
  |  Branch (28890:17): [True: 0, False: 21.4k]
  ------------------
28891|  21.4k|            uint32_t tag = rule[3];
28892|  21.4k|            int oldmode = s->mode;
28893|  21.4k|            CapState cs = cap_save(s);
28894|  21.4k|            s->mode = PEG_MODE_NORMAL;
28895|  21.4k|            down1(s);
  ------------------
  |  |28523|  21.4k|#define down1(s) do { \
  |  |28524|  21.4k|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28524:9): [True: 0, False: 21.4k]
  |  |  ------------------
  |  |28525|  21.4k|} while (0)
  |  |  ------------------
  |  |  |  Branch (28525:10): [Folded, False: 21.4k]
  |  |  ------------------
  ------------------
28896|  21.4k|            const uint8_t *result = peg_rule(s, s->bytecode + rule[2], text);
28897|  21.4k|            up1(s);
  ------------------
  |  |28526|  21.4k|#define up1(s) ((s)->depth++)
  ------------------
28898|  21.4k|            s->mode = oldmode;
28899|  21.4k|            if (!result) return NULL;
  ------------------
  |  Branch (28899:17): [True: 21.2k, False: 242]
  ------------------
28900|    242|            int32_t num_sub_captures = s->captures->count - cs.cap;
28901|    242|            Janet cap;
28902|    242|            if (num_sub_captures > (int32_t) nth) {
  ------------------
  |  Branch (28902:17): [True: 9, False: 233]
  ------------------
28903|      9|                cap = s->captures->data[cs.cap + nth];
28904|    233|            } else {
28905|    233|                return NULL;
28906|    233|            }
28907|      9|            cap_load_keept(s, cs);
28908|      9|            pushcap(s, cap, tag);
28909|      9|            return result;
28910|    242|        }
28911|       |
28912|    419|        case RULE_SUB: {
  ------------------
  |  Branch (28912:9): [True: 419, False: 278M]
  ------------------
28913|    419|            const uint8_t *text_start = text;
28914|    419|            const uint32_t *rule_window = s->bytecode + rule[1];
28915|    419|            const uint32_t *rule_subpattern = s->bytecode + rule[2];
28916|    419|            down1(s);
  ------------------
  |  |28523|    419|#define down1(s) do { \
  |  |28524|    419|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28524:9): [True: 0, False: 419]
  |  |  ------------------
  |  |28525|    419|} while (0)
  |  |  ------------------
  |  |  |  Branch (28525:10): [Folded, False: 419]
  |  |  ------------------
  ------------------
28917|    419|            const uint8_t *window_end = peg_rule(s, rule_window, text);
28918|    419|            up1(s);
  ------------------
  |  |28526|    419|#define up1(s) ((s)->depth++)
  ------------------
28919|    419|            if (!window_end) {
  ------------------
  |  Branch (28919:17): [True: 210, False: 209]
  ------------------
28920|    210|                return NULL;
28921|    210|            }
28922|    209|            const uint8_t *saved_end = s->text_end;
28923|    209|            s->text_end = window_end;
28924|    209|            down1(s);
  ------------------
  |  |28523|    209|#define down1(s) do { \
  |  |28524|    209|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28524:9): [True: 0, False: 209]
  |  |  ------------------
  |  |28525|    209|} while (0)
  |  |  ------------------
  |  |  |  Branch (28525:10): [Folded, False: 209]
  |  |  ------------------
  ------------------
28925|    209|            const uint8_t *next_text = peg_rule(s, rule_subpattern, text_start);
28926|    209|            up1(s);
  ------------------
  |  |28526|    209|#define up1(s) ((s)->depth++)
  ------------------
28927|    209|            s->text_end = saved_end;
28928|       |
28929|    209|            if (!next_text) {
  ------------------
  |  Branch (28929:17): [True: 208, False: 1]
  ------------------
28930|    208|                return NULL;
28931|    208|            }
28932|       |
28933|      1|            return window_end;
28934|    209|        }
28935|       |
28936|  2.45k|        case RULE_TIL: {
  ------------------
  |  Branch (28936:9): [True: 2.45k, False: 278M]
  ------------------
28937|  2.45k|            const uint32_t *rule_terminus = s->bytecode + rule[1];
28938|  2.45k|            const uint32_t *rule_subpattern = s->bytecode + rule[2];
28939|       |
28940|  2.45k|            const uint8_t *terminus_start = text;
28941|  2.45k|            const uint8_t *terminus_end = NULL;
28942|  2.45k|            down1(s);
  ------------------
  |  |28523|  2.45k|#define down1(s) do { \
  |  |28524|  2.45k|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28524:9): [True: 0, False: 2.45k]
  |  |  ------------------
  |  |28525|  2.45k|} while (0)
  |  |  ------------------
  |  |  |  Branch (28525:10): [Folded, False: 2.45k]
  |  |  ------------------
  ------------------
28943|  2.71M|            while (terminus_start <= s->text_end) {
  ------------------
  |  Branch (28943:20): [True: 2.71M, False: 1.60k]
  ------------------
28944|  2.71M|                CapState cs2 = cap_save(s);
28945|  2.71M|                terminus_end = peg_rule(s, rule_terminus, terminus_start);
28946|  2.71M|                cap_load(s, cs2);
28947|  2.71M|                if (terminus_end) {
  ------------------
  |  Branch (28947:21): [True: 845, False: 2.71M]
  ------------------
28948|    845|                    break;
28949|    845|                }
28950|  2.71M|                terminus_start++;
28951|  2.71M|            }
28952|  2.45k|            up1(s);
  ------------------
  |  |28526|  2.45k|#define up1(s) ((s)->depth++)
  ------------------
28953|       |
28954|  2.45k|            if (!terminus_end) {
  ------------------
  |  Branch (28954:17): [True: 1.60k, False: 845]
  ------------------
28955|  1.60k|                return NULL;
28956|  1.60k|            }
28957|       |
28958|    845|            const uint8_t *saved_end = s->text_end;
28959|    845|            s->text_end = terminus_start;
28960|    845|            down1(s);
  ------------------
  |  |28523|    845|#define down1(s) do { \
  |  |28524|    845|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28524:9): [True: 0, False: 845]
  |  |  ------------------
  |  |28525|    845|} while (0)
  |  |  ------------------
  |  |  |  Branch (28525:10): [Folded, False: 845]
  |  |  ------------------
  ------------------
28961|    845|            const uint8_t *matched = peg_rule(s, rule_subpattern, text);
28962|    845|            up1(s);
  ------------------
  |  |28526|    845|#define up1(s) ((s)->depth++)
  ------------------
28963|    845|            s->text_end = saved_end;
28964|       |
28965|    845|            if (!matched) {
  ------------------
  |  Branch (28965:17): [True: 640, False: 205]
  ------------------
28966|    640|                return NULL;
28967|    640|            }
28968|       |
28969|    205|            return terminus_end;
28970|    845|        }
28971|       |
28972|      0|        case RULE_SPLIT: {
  ------------------
  |  Branch (28972:9): [True: 0, False: 278M]
  ------------------
28973|      0|            const uint8_t *saved_end = s->text_end;
28974|      0|            const uint32_t *rule_separator = s->bytecode + rule[1];
28975|      0|            const uint32_t *rule_subpattern = s->bytecode + rule[2];
28976|       |
28977|      0|            const uint8_t *chunk_start = text;
28978|      0|            const uint8_t *chunk_end = NULL;
28979|       |
28980|      0|            while (text <= saved_end) {
  ------------------
  |  Branch (28980:20): [True: 0, False: 0]
  ------------------
28981|       |                /* Find next split (or end of text) */
28982|      0|                CapState cs = cap_save(s);
28983|      0|                down1(s);
  ------------------
  |  |28523|      0|#define down1(s) do { \
  |  |28524|      0|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28524:9): [True: 0, False: 0]
  |  |  ------------------
  |  |28525|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (28525:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
28984|      0|                while (text <= saved_end) {
  ------------------
  |  Branch (28984:24): [True: 0, False: 0]
  ------------------
28985|      0|                    chunk_end = text;
28986|      0|                    const uint8_t *check = peg_rule(s, rule_separator, text);
28987|      0|                    cap_load(s, cs);
28988|      0|                    if (check) {
  ------------------
  |  Branch (28988:25): [True: 0, False: 0]
  ------------------
28989|      0|                        text = check;
28990|      0|                        break;
28991|      0|                    }
28992|      0|                    text++;
28993|      0|                }
28994|      0|                up1(s);
  ------------------
  |  |28526|      0|#define up1(s) ((s)->depth++)
  ------------------
28995|       |
28996|       |                /* Match between splits */
28997|      0|                s->text_end = chunk_end;
28998|      0|                down1(s);
  ------------------
  |  |28523|      0|#define down1(s) do { \
  |  |28524|      0|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28524:9): [True: 0, False: 0]
  |  |  ------------------
  |  |28525|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (28525:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
28999|      0|                const uint8_t *subpattern_end = peg_rule(s, rule_subpattern, chunk_start);
29000|      0|                up1(s);
  ------------------
  |  |28526|      0|#define up1(s) ((s)->depth++)
  ------------------
29001|      0|                s->text_end = saved_end;
29002|      0|                if (!subpattern_end) return NULL; /* Don't match anything */
  ------------------
  |  Branch (29002:21): [True: 0, False: 0]
  ------------------
29003|       |
29004|       |                /* Ensure forward progress */
29005|      0|                if (text == chunk_start) return NULL;
  ------------------
  |  Branch (29005:21): [True: 0, False: 0]
  ------------------
29006|      0|                chunk_start = text;
29007|      0|            }
29008|       |
29009|      0|            s->text_end = saved_end;
29010|      0|            return s->text_end;
29011|      0|        }
29012|       |
29013|  58.0M|        case RULE_REPLACE:
  ------------------
  |  Branch (29013:9): [True: 58.0M, False: 220M]
  ------------------
29014|  58.0M|        case RULE_MATCHSPLICE:
  ------------------
  |  Branch (29014:9): [True: 0, False: 278M]
  ------------------
29015|  58.0M|        case RULE_MATCHTIME: {
  ------------------
  |  Branch (29015:9): [True: 0, False: 278M]
  ------------------
29016|  58.0M|            uint32_t tag = rule[3];
29017|  58.0M|            int oldmode = s->mode;
29018|  58.0M|            CapState cs = cap_save(s);
29019|  58.0M|            s->mode = PEG_MODE_NORMAL;
29020|  58.0M|            down1(s);
  ------------------
  |  |28523|  58.0M|#define down1(s) do { \
  |  |28524|  58.0M|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28524:9): [True: 0, False: 58.0M]
  |  |  ------------------
  |  |28525|  58.0M|} while (0)
  |  |  ------------------
  |  |  |  Branch (28525:10): [Folded, False: 58.0M]
  |  |  ------------------
  ------------------
29021|  58.0M|            const uint8_t *result = peg_rule(s, s->bytecode + rule[1], text);
29022|  58.0M|            up1(s);
  ------------------
  |  |28526|  58.0M|#define up1(s) ((s)->depth++)
  ------------------
29023|  58.0M|            s->mode = oldmode;
29024|  58.0M|            if (!result) return NULL;
  ------------------
  |  Branch (29024:17): [True: 2.40k, False: 58.0M]
  ------------------
29025|       |
29026|  58.0M|            Janet cap = janet_wrap_nil();
  ------------------
  |  |  831|  58.0M|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|  58.0M|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  58.0M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  58.0M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29027|  58.0M|            Janet constant = s->constants[rule[2]];
29028|  58.0M|            switch (janet_type(constant)) {
  ------------------
  |  |  795|  58.0M|    (isnan((x).number) \
  |  |  796|  58.0M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|  58.0M|        : JANET_NUMBER)
  ------------------
  |  Branch (29028:21): [True: 58.0M, False: 1.98k]
  ------------------
29029|  44.1M|                default:
  ------------------
  |  Branch (29029:17): [True: 44.1M, False: 13.9M]
  ------------------
29030|  44.1M|                    cap = constant;
29031|  44.1M|                    break;
29032|  13.9M|                case JANET_STRUCT:
  ------------------
  |  Branch (29032:17): [True: 13.9M, False: 44.1M]
  ------------------
29033|  13.9M|                    if (s->captures->count) {
  ------------------
  |  Branch (29033:25): [True: 13.9M, False: 1.98k]
  ------------------
29034|  13.9M|                        cap = janet_struct_get(janet_unwrap_struct(constant),
  ------------------
  |  |  857|  13.9M|#define janet_unwrap_struct(x) ((JanetStruct)janet_nanbox_to_pointer(x))
  ------------------
29035|  13.9M|                                               s->captures->data[s->captures->count - 1]);
29036|  13.9M|                    }
29037|  13.9M|                    break;
29038|  19.1k|                case JANET_TABLE:
  ------------------
  |  Branch (29038:17): [True: 19.1k, False: 58.0M]
  ------------------
29039|  19.1k|                    if (s->captures->count) {
  ------------------
  |  Branch (29039:25): [True: 19.1k, False: 11]
  ------------------
29040|  19.1k|                        cap = janet_table_get(janet_unwrap_table(constant),
  ------------------
  |  |  861|  19.1k|#define janet_unwrap_table(x) ((JanetTable *)janet_nanbox_to_pointer(x))
  ------------------
29041|  19.1k|                                              s->captures->data[s->captures->count - 1]);
29042|  19.1k|                    }
29043|  19.1k|                    break;
29044|      0|                case JANET_CFUNCTION:
  ------------------
  |  Branch (29044:17): [True: 0, False: 58.0M]
  ------------------
29045|      0|                    cap = janet_unwrap_cfunction(constant)(s->captures->count - cs.cap,
  ------------------
  |  |  869|      0|#define janet_unwrap_cfunction(x) ((JanetCFunction)janet_nanbox_to_pointer(x))
  ------------------
29046|      0|                                                           s->captures->data + cs.cap);
29047|      0|                    break;
29048|      0|                case JANET_FUNCTION:
  ------------------
  |  Branch (29048:17): [True: 0, False: 58.0M]
  ------------------
29049|      0|                    cap = janet_call(janet_unwrap_function(constant),
  ------------------
  |  |  868|      0|#define janet_unwrap_function(x) ((JanetFunction *)janet_nanbox_to_pointer(x))
  ------------------
29050|      0|                                     s->captures->count - cs.cap,
29051|      0|                                     s->captures->data + cs.cap);
29052|      0|                    break;
29053|  58.0M|            }
29054|  58.0M|            cap_load_keept(s, cs);
29055|  58.0M|            if (rule[0] != RULE_REPLACE && !janet_truthy(cap)) return NULL; /* matchtime or matchtime flatten */
  ------------------
  |  |  818|      0|    (!janet_checktype((x), JANET_NIL) && \
  |  |  ------------------
  |  |  |  |  806|      0|    (((t) == JANET_NUMBER) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (806:6): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  807|      0|        ? janet_nanbox_isnumber(x) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  808|      0|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  800|      0|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  790|      0|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 0, False: 0]
  |  |  ------------------
  |  |  819|      0|     (!janet_checktype((x), JANET_BOOLEAN) || ((x).u64 & 0x1)))
  |  |  ------------------
  |  |  |  |  806|      0|    (((t) == JANET_NUMBER) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (806:6): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  807|      0|        ? janet_nanbox_isnumber(x) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  808|      0|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  800|      0|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  790|      0|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (819:7): [True: 0, False: 0]
  |  |  |  Branch (819:47): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (29055:17): [True: 0, False: 58.0M]
  ------------------
29056|  58.0M|            const Janet *elements = NULL;
29057|  58.0M|            int32_t len = 0;
29058|  58.0M|            if ((rule[0] == RULE_MATCHSPLICE) && janet_indexed_view(cap, &elements, &len)) {
  ------------------
  |  Branch (29058:17): [True: 0, False: 58.0M]
  |  Branch (29058:50): [True: 0, False: 0]
  ------------------
29059|       |                /* unpack and flatten capture */
29060|      0|                for (int32_t i = 0; i < len; i++) {
  ------------------
  |  Branch (29060:37): [True: 0, False: 0]
  ------------------
29061|      0|                    pushcap(s, elements[i], tag);
29062|      0|                }
29063|  58.0M|            } else {
29064|  58.0M|                pushcap(s, cap, tag);
29065|  58.0M|            }
29066|  58.0M|            return result;
29067|  58.0M|        }
29068|       |
29069|     40|        case RULE_ERROR: {
  ------------------
  |  Branch (29069:9): [True: 40, False: 278M]
  ------------------
29070|     40|            int oldmode = s->mode;
29071|     40|            s->mode = PEG_MODE_NORMAL;
29072|     40|            int32_t old_cap = s->captures->count;
29073|     40|            down1(s);
  ------------------
  |  |28523|     40|#define down1(s) do { \
  |  |28524|     40|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28524:9): [True: 0, False: 40]
  |  |  ------------------
  |  |28525|     40|} while (0)
  |  |  ------------------
  |  |  |  Branch (28525:10): [Folded, False: 40]
  |  |  ------------------
  ------------------
29074|     40|            const uint8_t *result = peg_rule(s, s->bytecode + rule[1], text);
29075|     40|            up1(s);
  ------------------
  |  |28526|     40|#define up1(s) ((s)->depth++)
  ------------------
29076|     40|            s->mode = oldmode;
29077|     40|            if (!result) return NULL;
  ------------------
  |  Branch (29077:17): [True: 8, False: 32]
  ------------------
29078|     32|            if (s->captures->count > old_cap) {
  ------------------
  |  Branch (29078:17): [True: 3, False: 29]
  ------------------
29079|       |                /* Throw last capture */
29080|      3|                janet_panicv(s->captures->data[s->captures->count - 1]);
29081|     29|            } else {
29082|       |                /* Throw generic error */
29083|     29|                int32_t start = (int32_t)(text - s->text_start);
29084|     29|                LineCol lc = get_linecol_from_position(s, start);
29085|     29|                janet_panicf("match error at line %d, column %d", lc.line, lc.col);
29086|     29|            }
29087|      0|            return NULL;
29088|     32|        }
29089|       |
29090|      0|        case RULE_BACKMATCH: {
  ------------------
  |  Branch (29090:9): [True: 0, False: 278M]
  ------------------
29091|      0|            uint32_t search = rule[1];
29092|      0|            for (int32_t i = s->tags->count - 1; i >= 0; i--) {
  ------------------
  |  Branch (29092:50): [True: 0, False: 0]
  ------------------
29093|      0|                if (s->tags->data[i] == search) {
  ------------------
  |  Branch (29093:21): [True: 0, False: 0]
  ------------------
29094|      0|                    Janet capture = s->tagged_captures->data[i];
29095|      0|                    if (!janet_checktype(capture, JANET_STRING))
  ------------------
  |  |  806|      0|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 0]
  |  |  ------------------
  |  |  807|      0|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|      0|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|      0|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|      0|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (29095:25): [True: 0, False: 0]
  ------------------
29096|      0|                        return NULL;
29097|      0|                    const uint8_t *bytes = janet_unwrap_string(capture);
  ------------------
  |  |  863|      0|#define janet_unwrap_string(x) ((JanetString)janet_nanbox_to_pointer(x))
  ------------------
29098|      0|                    int32_t len = janet_string_length(bytes);
  ------------------
  |  | 1813|      0|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  ------------------
  |  |  |  | 1812|      0|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
29099|      0|                    if (text + len > s->text_end)
  ------------------
  |  Branch (29099:25): [True: 0, False: 0]
  ------------------
29100|      0|                        return NULL;
29101|      0|                    return memcmp(text, bytes, len) ? NULL : text + len;
  ------------------
  |  Branch (29101:28): [True: 0, False: 0]
  ------------------
29102|      0|                }
29103|      0|            }
29104|      0|            return NULL;
29105|      0|        }
29106|       |
29107|      0|        case RULE_LENPREFIX: {
  ------------------
  |  Branch (29107:9): [True: 0, False: 278M]
  ------------------
29108|      0|            int oldmode = s->mode;
29109|      0|            s->mode = PEG_MODE_NORMAL;
29110|      0|            const uint8_t *next_text;
29111|      0|            CapState cs = cap_save(s);
29112|      0|            down1(s);
  ------------------
  |  |28523|      0|#define down1(s) do { \
  |  |28524|      0|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28524:9): [True: 0, False: 0]
  |  |  ------------------
  |  |28525|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (28525:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
29113|      0|            next_text = peg_rule(s, s->bytecode + rule[1], text);
29114|      0|            up1(s);
  ------------------
  |  |28526|      0|#define up1(s) ((s)->depth++)
  ------------------
29115|      0|            if (NULL == next_text) return NULL;
  ------------------
  |  Branch (29115:17): [True: 0, False: 0]
  ------------------
29116|      0|            s->mode = oldmode;
29117|      0|            int32_t num_sub_captures = s->captures->count - cs.cap;
29118|      0|            Janet lencap;
29119|      0|            if (num_sub_captures <= 0 ||
  ------------------
  |  Branch (29119:17): [True: 0, False: 0]
  ------------------
29120|      0|                    (lencap = s->captures->data[cs.cap], !janet_checkint(lencap))) {
  ------------------
  |  Branch (29120:21): [True: 0, False: 0]
  ------------------
29121|      0|                cap_load(s, cs);
29122|      0|                return NULL;
29123|      0|            }
29124|      0|            int32_t nrep = janet_unwrap_integer(lencap);
  ------------------
  |  |  966|      0|#define janet_unwrap_integer(x) ((int32_t) janet_unwrap_number(x))
  |  |  ------------------
  |  |  |  |  839|      0|#define janet_unwrap_number(x) ((x).number)
  |  |  ------------------
  ------------------
29125|       |            /* drop captures from len pattern */
29126|      0|            cap_load(s, cs);
29127|      0|            for (int32_t i = 0; i < nrep; i++) {
  ------------------
  |  Branch (29127:33): [True: 0, False: 0]
  ------------------
29128|      0|                down1(s);
  ------------------
  |  |28523|      0|#define down1(s) do { \
  |  |28524|      0|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28524:9): [True: 0, False: 0]
  |  |  ------------------
  |  |28525|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (28525:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
29129|      0|                next_text = peg_rule(s, s->bytecode + rule[2], next_text);
29130|      0|                up1(s);
  ------------------
  |  |28526|      0|#define up1(s) ((s)->depth++)
  ------------------
29131|      0|                if (NULL == next_text) {
  ------------------
  |  Branch (29131:21): [True: 0, False: 0]
  ------------------
29132|      0|                    cap_load(s, cs);
29133|      0|                    return NULL;
29134|      0|                }
29135|      0|            }
29136|      0|            return next_text;
29137|      0|        }
29138|       |
29139|  5.91k|        case RULE_READINT: {
  ------------------
  |  Branch (29139:9): [True: 5.91k, False: 278M]
  ------------------
29140|  5.91k|            uint32_t tag = rule[2];
29141|  5.91k|            uint32_t signedness = rule[1] & 0x10;
29142|  5.91k|            uint32_t endianness = rule[1] & 0x20;
29143|  5.91k|            int width = (int)(rule[1] & 0xF);
29144|  5.91k|            if (text + width > s->text_end) return NULL;
  ------------------
  |  Branch (29144:17): [True: 1.97k, False: 3.94k]
  ------------------
29145|  3.94k|            uint64_t accum = 0;
29146|  3.94k|            if (endianness) {
  ------------------
  |  Branch (29146:17): [True: 0, False: 3.94k]
  ------------------
29147|       |                /* BE */
29148|      0|                for (int i = 0; i < width; i++) accum = (accum << 8) | text[i];
  ------------------
  |  Branch (29148:33): [True: 0, False: 0]
  ------------------
29149|  3.94k|            } else {
29150|       |                /* LE */
29151|  23.7k|                for (int i = width - 1; i >= 0; i--) accum = (accum << 8) | text[i];
  ------------------
  |  Branch (29151:41): [True: 19.7k, False: 3.94k]
  ------------------
29152|  3.94k|            }
29153|       |
29154|  3.94k|            Janet capture_value;
29155|       |            /* We can only parse integeres of greater than 6 bytes reliable if int-types are enabled.
29156|       |             * Otherwise, we may lose precision, so 6 is the maximum size when int-types are disabled. */
29157|  3.94k|#ifdef JANET_INT_TYPES
29158|  3.94k|            if (width > 6) {
  ------------------
  |  Branch (29158:17): [True: 1.35k, False: 2.59k]
  ------------------
29159|  1.35k|                if (signedness) {
  ------------------
  |  Branch (29159:21): [True: 874, False: 476]
  ------------------
29160|    874|                    capture_value = janet_wrap_s64(peg_convert_u64_s64(accum, width));
29161|    874|                } else {
29162|    476|                    capture_value = janet_wrap_u64(accum);
29163|    476|                }
29164|  1.35k|            } else
29165|  2.59k|#endif
29166|  2.59k|            {
29167|  2.59k|                double double_value;
29168|  2.59k|                if (signedness) {
  ------------------
  |  Branch (29168:21): [True: 2.11k, False: 482]
  ------------------
29169|  2.11k|                    double_value = (double)(peg_convert_u64_s64(accum, width));
29170|  2.11k|                } else {
29171|    482|                    double_value = (double)accum;
29172|    482|                }
29173|  2.59k|                capture_value = janet_wrap_number(double_value);
  ------------------
  |  |  835|  2.59k|#define janet_wrap_number(r) janet_nanbox_from_double(r)
  ------------------
29174|  2.59k|            }
29175|       |
29176|  3.94k|            pushcap(s, capture_value, tag);
29177|  3.94k|            return text + width;
29178|  5.91k|        }
29179|       |
29180|      0|        case RULE_UNREF: {
  ------------------
  |  Branch (29180:9): [True: 0, False: 278M]
  ------------------
29181|      0|            int32_t tcap = s->tags->count;
29182|      0|            down1(s);
  ------------------
  |  |28523|      0|#define down1(s) do { \
  |  |28524|      0|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28524:9): [True: 0, False: 0]
  |  |  ------------------
  |  |28525|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (28525:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
29183|      0|            const uint8_t *result = peg_rule(s, s->bytecode + rule[1], text);
29184|      0|            up1(s);
  ------------------
  |  |28526|      0|#define up1(s) ((s)->depth++)
  ------------------
29185|      0|            if (!result) return NULL;
  ------------------
  |  Branch (29185:17): [True: 0, False: 0]
  ------------------
29186|      0|            int32_t final_tcap = s->tags->count;
29187|       |            /* Truncate tagged captures to not include items of the given tag */
29188|      0|            int32_t w = tcap;
29189|       |            /* If no tag is given, drop ALL tagged captures */
29190|      0|            if (rule[2]) {
  ------------------
  |  Branch (29190:17): [True: 0, False: 0]
  ------------------
29191|      0|                for (int32_t i = tcap; i < final_tcap; i++) {
  ------------------
  |  Branch (29191:40): [True: 0, False: 0]
  ------------------
29192|      0|                    if (s->tags->data[i] != (0xFF & rule[2])) {
  ------------------
  |  Branch (29192:25): [True: 0, False: 0]
  ------------------
29193|      0|                        s->tags->data[w] = s->tags->data[i];
29194|      0|                        s->tagged_captures->data[w] = s->tagged_captures->data[i];
29195|      0|                        w++;
29196|      0|                    }
29197|      0|                }
29198|      0|            }
29199|      0|            s->tags->count = w;
29200|      0|            s->tagged_captures->count = w;
29201|      0|            return result;
29202|      0|        }
29203|       |
29204|   278M|    }
29205|   278M|}
janet.c:cap_save:
28427|   252M|static CapState cap_save(PegState *s) {
28428|   252M|    CapState cs;
28429|   252M|    cs.scratch = s->scratch->count;
28430|   252M|    cs.cap = s->captures->count;
28431|   252M|    cs.tcap = s->tagged_captures->count;
28432|   252M|    return cs;
28433|   252M|}
janet.c:cap_load:
28436|  4.20M|static void cap_load(PegState *s, CapState cs) {
28437|  4.20M|    s->scratch->count = cs.scratch;
28438|  4.20M|    s->captures->count = cs.cap;
28439|  4.20M|    s->tags->count = cs.tcap;
28440|  4.20M|    s->tagged_captures->count = cs.tcap;
28441|  4.20M|}
janet.c:pushcap:
28451|  73.0M|static void pushcap(PegState *s, Janet capture, uint32_t tag) {
28452|  73.0M|    if (s->mode == PEG_MODE_ACCUMULATE) {
  ------------------
  |  Branch (28452:9): [True: 44.3M, False: 28.7M]
  ------------------
28453|  44.3M|        janet_to_string_b(s->scratch, capture);
28454|  44.3M|    }
28455|  73.0M|    if (s->mode == PEG_MODE_NORMAL) {
  ------------------
  |  Branch (28455:9): [True: 28.7M, False: 44.3M]
  ------------------
28456|  28.7M|        janet_array_push(s->captures, capture);
28457|  28.7M|    }
28458|  73.0M|    if (s->has_backref) {
  ------------------
  |  Branch (28458:9): [True: 1.73M, False: 71.3M]
  ------------------
28459|  1.73M|        janet_array_push(s->tagged_captures, capture);
28460|  1.73M|        janet_buffer_push_u8(s->tags, tag);
28461|  1.73M|    }
28462|  73.0M|}
janet.c:get_linecol_from_position:
28470|  5.99M|static LineCol get_linecol_from_position(PegState *s, int32_t position) {
28471|       |    /* Generate if not made yet */
28472|  5.99M|    if (s->linemaplen < 0) {
  ------------------
  |  Branch (28472:9): [True: 203, False: 5.99M]
  ------------------
28473|    203|        int32_t newline_count = 0;
28474|  3.41M|        for (const uint8_t *c = s->text_start; c < s->outer_text_end; c++) {
  ------------------
  |  Branch (28474:48): [True: 3.41M, False: 203]
  ------------------
28475|  3.41M|            if (*c == '\n') newline_count++;
  ------------------
  |  Branch (28475:17): [True: 2.16M, False: 1.25M]
  ------------------
28476|  3.41M|        }
28477|    203|        int32_t *mem = janet_smalloc(sizeof(int32_t) * newline_count);
28478|    203|        size_t index = 0;
28479|  3.41M|        for (const uint8_t *c = s->text_start; c < s->outer_text_end; c++) {
  ------------------
  |  Branch (28479:48): [True: 3.41M, False: 203]
  ------------------
28480|  3.41M|            if (*c == '\n') mem[index++] = (int32_t)(c - s->text_start);
  ------------------
  |  Branch (28480:17): [True: 2.16M, False: 1.25M]
  ------------------
28481|  3.41M|        }
28482|    203|        s->linemaplen = newline_count;
28483|    203|        s->linemap = mem;
28484|    203|    }
28485|       |    /* Do binary search for line. Slightly modified from classic binary search:
28486|       |     * - if we find that our current character is a line break, just return immediately.
28487|       |     *   a newline character is consider to be on the same line as the character before
28488|       |     *   (\n is line terminator, not line separator).
28489|       |     * - in the not-found case, we still want to find the greatest-indexed newline that
28490|       |     *   is before position. we use that to calculate the line and column.
28491|       |     * - in the case that lo = 0 and s->linemap[0] is still greater than position, we
28492|       |     *   are on the first line and our column is position + 1. */
28493|  5.99M|    int32_t hi = s->linemaplen; /* hi is greater than the actual line */
28494|  5.99M|    int32_t lo = 0; /* lo is less than or equal to the actual line */
28495|  5.99M|    LineCol ret;
28496|  51.7M|    while (lo + 1 < hi) {
  ------------------
  |  Branch (28496:12): [True: 45.7M, False: 5.99M]
  ------------------
28497|  45.7M|        int32_t mid = lo + (hi - lo) / 2;
28498|  45.7M|        if (s->linemap[mid] >= position) {
  ------------------
  |  Branch (28498:13): [True: 25.1M, False: 20.5M]
  ------------------
28499|  25.1M|            hi = mid;
28500|  25.1M|        } else {
28501|  20.5M|            lo = mid;
28502|  20.5M|        }
28503|  45.7M|    }
28504|       |    /* first line case */
28505|  5.99M|    if (s->linemaplen == 0 || (lo == 0 && s->linemap[0] >= position)) {
  ------------------
  |  Branch (28505:9): [True: 1.46M, False: 4.53M]
  |  Branch (28505:32): [True: 2.21M, False: 2.31M]
  |  Branch (28505:43): [True: 2.21M, False: 1.15k]
  ------------------
28506|  3.67M|        ret.line = 1;
28507|  3.67M|        ret.col = position + 1;
28508|  3.67M|    } else {
28509|  2.32M|        ret.line = lo + 2;
28510|  2.32M|        ret.col = position - s->linemap[lo];
28511|  2.32M|    }
28512|  5.99M|    return ret;
28513|  5.99M|}
janet.c:cap_load_keept:
28445|  58.3M|static void cap_load_keept(PegState *s, CapState cs) {
28446|  58.3M|    s->scratch->count = cs.scratch;
28447|  58.3M|    s->captures->count = cs.cap;
28448|  58.3M|}
janet.c:peg_convert_u64_s64:
28516|  2.98k|static int64_t peg_convert_u64_s64(uint64_t from, int width) {
28517|  2.98k|    if (width == 0) return 0; /* Avoid undefined shift */
  ------------------
  |  Branch (28517:9): [True: 233, False: 2.75k]
  ------------------
28518|  2.75k|    int shift = 8 * (8 - width);
28519|  2.75k|    return ((int64_t)(from << shift)) >> shift;
28520|  2.98k|}
janet.c:number_to_string_b:
30564|  6.62M|static void number_to_string_b(JanetBuffer *buffer, double x) {
30565|  6.62M|    janet_buffer_extra(buffer, BUFSIZE);
  ------------------
  |  |30558|  6.62M|#define BUFSIZE 64
  ------------------
30566|  6.62M|    const char *fmt = (x == floor(x) &&
  ------------------
  |  Branch (30566:24): [True: 6.37M, False: 251k]
  ------------------
30567|  6.37M|                       x <= JANET_INTMAX_DOUBLE &&
  ------------------
  |  |  165|  12.9M|#define JANET_INTMAX_DOUBLE 9007199254740992.0
  ------------------
  |  Branch (30567:24): [True: 6.30M, False: 69.4k]
  ------------------
30568|  6.30M|                       x >= JANET_INTMIN_DOUBLE) ? "%.0f" : ("%." STR(DBL_DIG) "g");
  ------------------
  |  |  166|  6.30M|#define JANET_INTMIN_DOUBLE (-9007199254740992.0)
  ------------------
  |  Branch (30568:24): [True: 6.30M, False: 2.71k]
  ------------------
30569|  6.62M|    int count;
30570|  6.62M|    if (x == 0.0) {
  ------------------
  |  Branch (30570:9): [True: 595k, False: 6.02M]
  ------------------
30571|       |        /* Prevent printing of '-0' */
30572|   595k|        count = 1;
30573|   595k|        buffer->data[buffer->count] = '0';
30574|  6.02M|    } else {
30575|  6.02M|        count = snprintf((char *) buffer->data + buffer->count, BUFSIZE, fmt, x);
  ------------------
  |  |30558|  6.02M|#define BUFSIZE 64
  ------------------
30576|  6.02M|    }
30577|  6.62M|    buffer->count += count;
30578|  6.62M|}
janet.c:string_description_b:
30624|  35.1M|static void string_description_b(JanetBuffer *buffer, const char *title, void *pointer) {
30625|  35.1M|    janet_buffer_extra(buffer, BUFSIZE);
  ------------------
  |  |30558|  35.1M|#define BUFSIZE 64
  ------------------
30626|  35.1M|    uint8_t *c = buffer->data + buffer->count;
30627|  35.1M|    int32_t i;
30628|  35.1M|    union {
30629|  35.1M|        uint8_t bytes[sizeof(void *)];
30630|  35.1M|        void *p;
30631|  35.1M|    } pbuf;
30632|       |
30633|  35.1M|    pbuf.p = pointer;
30634|  35.1M|    *c++ = '<';
30635|       |    /* Maximum of 32 bytes for abstract type name */
30636|   211M|    for (i = 0; i < 32 && title[i]; ++i)
  ------------------
  |  Branch (30636:17): [True: 211M, False: 0]
  |  Branch (30636:27): [True: 175M, False: 35.1M]
  ------------------
30637|   175M|        *c++ = ((uint8_t *)title) [i];
30638|  35.1M|    *c++ = ' ';
30639|  35.1M|    *c++ = '0';
30640|  35.1M|    *c++ = 'x';
30641|  35.1M|#if defined(JANET_NANBOX_64)
30642|  35.1M|#define POINTSIZE 6
30643|       |#else
30644|       |#define POINTSIZE (sizeof(void *))
30645|       |#endif
30646|   246M|    for (i = POINTSIZE; i > 0; --i) {
  ------------------
  |  |30642|  35.1M|#define POINTSIZE 6
  ------------------
  |  Branch (30646:25): [True: 211M, False: 35.1M]
  ------------------
30647|   211M|        uint8_t byte = pbuf.bytes[i - 1];
30648|   211M|        *c++ = HEX(byte >> 4);
  ------------------
  |  |30620|   211M|#define HEX(i) (((uint8_t *) janet_base64)[(i)])
  ------------------
30649|   211M|        *c++ = HEX(byte & 0xF);
  ------------------
  |  |30620|   211M|#define HEX(i) (((uint8_t *) janet_base64)[(i)])
  ------------------
30650|   211M|    }
30651|  35.1M|    *c++ = '>';
30652|  35.1M|    buffer->count = (int32_t)(c - buffer->data);
30653|  35.1M|#undef POINTSIZE
30654|  35.1M|}
janet.c:janet_escape_string_b:
30726|  7.64M|static void janet_escape_string_b(JanetBuffer *buffer, const uint8_t *str) {
30727|       |    janet_escape_string_impl(buffer, str, janet_string_length(str));
  ------------------
  |  | 1813|  7.64M|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  ------------------
  |  |  |  | 1812|  7.64M|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
30728|  7.64M|}
janet.c:janet_escape_string_impl:
30656|  7.72M|static int janet_escape_string_impl(JanetBuffer *buffer, const uint8_t *str, int32_t len) {
30657|  7.72M|    janet_buffer_push_u8(buffer, '"');
30658|  7.72M|    int align = 1;
30659|   264M|    for (int32_t i = 0; i < len; ++i) {
  ------------------
  |  Branch (30659:25): [True: 256M, False: 7.72M]
  ------------------
30660|   256M|        uint8_t c = str[i];
30661|   256M|        switch (c) {
30662|   120k|            case '"':
  ------------------
  |  Branch (30662:13): [True: 120k, False: 256M]
  ------------------
30663|   120k|                janet_buffer_push_bytes(buffer, (const uint8_t *)"\\\"", 2);
30664|   120k|                align += 2;
30665|   120k|                break;
30666|  8.20M|            case '\n':
  ------------------
  |  Branch (30666:13): [True: 8.20M, False: 248M]
  ------------------
30667|  8.20M|                janet_buffer_push_bytes(buffer, (const uint8_t *)"\\n", 2);
30668|  8.20M|                align += 2;
30669|  8.20M|                break;
30670|   235k|            case '\r':
  ------------------
  |  Branch (30670:13): [True: 235k, False: 256M]
  ------------------
30671|   235k|                janet_buffer_push_bytes(buffer, (const uint8_t *)"\\r", 2);
30672|   235k|                align += 2;
30673|   235k|                break;
30674|  2.71M|            case '\0':
  ------------------
  |  Branch (30674:13): [True: 2.71M, False: 254M]
  ------------------
30675|  2.71M|                janet_buffer_push_bytes(buffer, (const uint8_t *)"\\0", 2);
30676|  2.71M|                align += 2;
30677|  2.71M|                break;
30678|  65.2k|            case '\f':
  ------------------
  |  Branch (30678:13): [True: 65.2k, False: 256M]
  ------------------
30679|  65.2k|                janet_buffer_push_bytes(buffer, (const uint8_t *)"\\f", 2);
30680|  65.2k|                align += 2;
30681|  65.2k|                break;
30682|  43.7k|            case '\v':
  ------------------
  |  Branch (30682:13): [True: 43.7k, False: 256M]
  ------------------
30683|  43.7k|                janet_buffer_push_bytes(buffer, (const uint8_t *)"\\v", 2);
30684|  43.7k|                align += 2;
30685|  43.7k|                break;
30686|  6.78k|            case '\a':
  ------------------
  |  Branch (30686:13): [True: 6.78k, False: 256M]
  ------------------
30687|  6.78k|                janet_buffer_push_bytes(buffer, (const uint8_t *)"\\a", 2);
30688|  6.78k|                align += 2;
30689|  6.78k|                break;
30690|  8.38k|            case '\b':
  ------------------
  |  Branch (30690:13): [True: 8.38k, False: 256M]
  ------------------
30691|  8.38k|                janet_buffer_push_bytes(buffer, (const uint8_t *)"\\b", 2);
30692|  8.38k|                align += 2;
30693|  8.38k|                break;
30694|   171k|            case 27:
  ------------------
  |  Branch (30694:13): [True: 171k, False: 256M]
  ------------------
30695|   171k|                janet_buffer_push_bytes(buffer, (const uint8_t *)"\\e", 2);
30696|   171k|                align += 2;
30697|   171k|                break;
30698|   105k|            case '\\':
  ------------------
  |  Branch (30698:13): [True: 105k, False: 256M]
  ------------------
30699|   105k|                janet_buffer_push_bytes(buffer, (const uint8_t *)"\\\\", 2);
30700|   105k|                align += 2;
30701|   105k|                break;
30702|  15.6k|            case '\t':
  ------------------
  |  Branch (30702:13): [True: 15.6k, False: 256M]
  ------------------
30703|  15.6k|                janet_buffer_push_bytes(buffer, (const uint8_t *)"\\t", 2);
30704|  15.6k|                align += 2;
30705|  15.6k|                break;
30706|   245M|            default:
  ------------------
  |  Branch (30706:13): [True: 245M, False: 11.6M]
  ------------------
30707|   245M|                if (c < 32 || c > 126) {
  ------------------
  |  Branch (30707:21): [True: 739k, False: 244M]
  |  Branch (30707:31): [True: 2.01M, False: 242M]
  ------------------
30708|  2.75M|                    uint8_t buf[4];
30709|  2.75M|                    buf[0] = '\\';
30710|  2.75M|                    buf[1] = 'x';
30711|  2.75M|                    buf[2] = janet_base64[(c >> 4) & 0xF];
30712|  2.75M|                    buf[3] = janet_base64[c & 0xF];
30713|  2.75M|                    janet_buffer_push_bytes(buffer, buf, 4);
30714|  2.75M|                    align += 4;
30715|   242M|                } else {
30716|   242M|                    janet_buffer_push_u8(buffer, c);
30717|   242M|                    align++;
30718|   242M|                }
30719|   245M|                break;
30720|   256M|        }
30721|   256M|    }
30722|  7.72M|    janet_buffer_push_u8(buffer, '"');
30723|  7.72M|    return align + 1;
30724|  7.72M|}
janet.c:janet_escape_buffer_b:
30730|  86.0k|static void janet_escape_buffer_b(JanetBuffer *buffer, JanetBuffer *bx) {
30731|  86.0k|    if (bx == buffer) {
  ------------------
  |  Branch (30731:9): [True: 0, False: 86.0k]
  ------------------
30732|       |        /* Ensures buffer won't resize while escaping */
30733|      0|        int64_t new_size = 6 * (int64_t) bx->count + 3;
30734|      0|        if (new_size > INT32_MAX) janet_panic("buffer overflow");
  ------------------
  |  Branch (30734:13): [True: 0, False: 0]
  ------------------
30735|      0|        janet_buffer_ensure(bx, (int32_t) new_size, 1);
30736|      0|    }
30737|  86.0k|    janet_buffer_push_u8(buffer, '@');
30738|  86.0k|    janet_escape_string_impl(buffer, bx->data, bx->count);
30739|  86.0k|}
janet.c:janet_pretty_:
31353|  18.7M|                                  int flags, Janet x, int32_t startlen, int32_t lookback_barrier) {
31354|  18.7M|    struct pretty S;
31355|  18.7M|    if (NULL == buffer) {
  ------------------
  |  Branch (31355:9): [True: 0, False: 18.7M]
  ------------------
31356|      0|        buffer = janet_buffer(0);
31357|      0|    }
31358|  18.7M|    S.buffer = buffer;
31359|  18.7M|    S.depth = depth;
31360|  18.7M|    S.width = width;
31361|  18.7M|    S.align = 0;
31362|  18.7M|    S.flags = flags;
31363|  18.7M|    S.bufstartlen = startlen;
31364|  18.7M|    S.lookback_barrier = lookback_barrier;
31365|  18.7M|    S.keysort_capacity = 0;
31366|       |    S.keysort_buffer = NULL;
31367|  18.7M|    S.keysort_start = 0;
31368|  18.7M|    janet_table_init(&S.seen, 10);
31369|  18.7M|    janet_pretty_one(&S, x);
31370|  18.7M|    backtrack_newlines(&S);
31371|  18.7M|    janet_table_deinit(&S.seen);
31372|  18.7M|    return S.buffer;
31373|  18.7M|}
janet.c:janet_pretty_one:
31120|  97.7M|static void janet_pretty_one(struct pretty *S, Janet x) {
31121|       |    /* Add to seen */
31122|  97.7M|    switch (janet_type(x)) {
  ------------------
  |  |  795|  97.7M|    (isnan((x).number) \
  |  |  796|  97.7M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|  97.7M|        : JANET_NUMBER)
  ------------------
  |  Branch (31122:13): [True: 91.3M, False: 6.39M]
  ------------------
31123|  1.74M|        case JANET_NIL:
  ------------------
  |  Branch (31123:9): [True: 1.74M, False: 95.9M]
  ------------------
31124|  8.14M|        case JANET_NUMBER:
  ------------------
  |  Branch (31124:9): [True: 6.39M, False: 91.3M]
  ------------------
31125|  45.3M|        case JANET_SYMBOL:
  ------------------
  |  Branch (31125:9): [True: 37.1M, False: 60.5M]
  ------------------
31126|  45.3M|        case JANET_BOOLEAN:
  ------------------
  |  Branch (31126:9): [True: 243, False: 97.7M]
  ------------------
31127|  45.3M|            break;
31128|  52.3M|        default: {
  ------------------
  |  Branch (31128:9): [True: 52.3M, False: 45.3M]
  ------------------
31129|  52.3M|            Janet seenid = janet_table_get(&S->seen, x);
31130|  52.3M|            if (janet_checktype(seenid, JANET_NUMBER)) {
  ------------------
  |  |  806|  52.3M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 0, False: 52.3M]
  |  |  |  Branch (806:6): [True: 52.3M, Folded]
  |  |  ------------------
  |  |  807|  52.3M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|  52.3M|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 52.3M]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 52.3M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  52.3M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|      0|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|      0|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
31131|      0|                if (S->flags & JANET_PRETTY_COLOR) {
  ------------------
  |  | 1967|      0|#define JANET_PRETTY_COLOR 1
  ------------------
  |  Branch (31131:21): [True: 0, False: 0]
  ------------------
31132|      0|                    janet_buffer_push_cstring(S->buffer, janet_cycle_color);
31133|      0|                }
31134|      0|                janet_buffer_push_cstring(S->buffer, "<cycle ");
31135|      0|                S->align += 8 + integer_to_string_b(S->buffer, janet_unwrap_integer(seenid));
  ------------------
  |  |  966|      0|#define janet_unwrap_integer(x) ((int32_t) janet_unwrap_number(x))
  |  |  ------------------
  |  |  |  |  839|      0|#define janet_unwrap_number(x) ((x).number)
  |  |  ------------------
  ------------------
31136|      0|                janet_buffer_push_u8(S->buffer, '>');
31137|      0|                if (S->flags & JANET_PRETTY_COLOR) {
  ------------------
  |  | 1967|      0|#define JANET_PRETTY_COLOR 1
  ------------------
  |  Branch (31137:21): [True: 0, False: 0]
  ------------------
31138|      0|                    janet_buffer_push_cstring(S->buffer, "\x1B[0m");
31139|      0|                }
31140|      0|                return;
31141|  52.3M|            } else {
31142|  52.3M|                janet_table_put(&S->seen, x, janet_wrap_integer(S->seen.count));
  ------------------
  |  |  967|  52.3M|#define janet_wrap_integer(x) janet_wrap_number((int32_t)(x))
  |  |  ------------------
  |  |  |  |  835|  52.3M|#define janet_wrap_number(r) janet_nanbox_from_double(r)
  |  |  ------------------
  ------------------
31143|  52.3M|                break;
31144|  52.3M|            }
31145|  52.3M|        }
31146|  97.7M|    }
31147|       |
31148|  97.7M|    switch (janet_type(x)) {
  ------------------
  |  |  795|  97.7M|    (isnan((x).number) \
  |  |  796|  97.7M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|  97.7M|        : JANET_NUMBER)
  ------------------
  |  Branch (31148:13): [True: 91.3M, False: 6.39M]
  ------------------
31149|  56.8M|        default: {
  ------------------
  |  Branch (31149:9): [True: 56.8M, False: 40.8M]
  ------------------
31150|  56.8M|            const char *color = janet_pretty_colors[janet_type(x)];
  ------------------
  |  |  795|  56.8M|    (isnan((x).number) \
  |  |  796|  56.8M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|  56.8M|        : JANET_NUMBER)
  ------------------
  |  Branch (31150:53): [True: 50.5M, False: 6.39M]
  ------------------
31151|  56.8M|            if (color && (S->flags & JANET_PRETTY_COLOR)) {
  ------------------
  |  | 1967|  56.8M|#define JANET_PRETTY_COLOR 1
  ------------------
  |  Branch (31151:17): [True: 56.8M, False: 0]
  |  Branch (31151:26): [True: 0, False: 56.8M]
  ------------------
31152|      0|                janet_buffer_push_cstring(S->buffer, color);
31153|      0|            }
31154|  56.8M|            if (janet_checktype(x, JANET_BUFFER) && janet_unwrap_buffer(x) == S->buffer) {
  ------------------
  |  |  806|   113M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 13.6k, False: 56.8M]
  |  |  |  Branch (806:6): [Folded, False: 56.8M]
  |  |  ------------------
  |  |  807|   113M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|   113M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  56.8M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  56.8M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  56.8M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  56.8M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          if (janet_checktype(x, JANET_BUFFER) && janet_unwrap_buffer(x) == S->buffer) {
  ------------------
  |  |  862|  13.6k|#define janet_unwrap_buffer(x) ((JanetBuffer *)janet_nanbox_to_pointer(x))
  ------------------
  |  Branch (31154:53): [True: 0, False: 13.6k]
  ------------------
31155|      0|                int64_t new_size = (int64_t) S->buffer->count + S->bufstartlen * 4 + 3;
31156|      0|                if (new_size > INT32_MAX) janet_panic("buffer overflow");
  ------------------
  |  Branch (31156:21): [True: 0, False: 0]
  ------------------
31157|      0|                janet_buffer_ensure(S->buffer, (int32_t) new_size, 1);
31158|      0|                janet_buffer_push_u8(S->buffer, '@');
31159|       |                /* Use start len to print to self better */
31160|      0|                S->align += 1 + janet_escape_string_impl(S->buffer, S->buffer->data, S->bufstartlen);
31161|  56.8M|            } else {
31162|  56.8M|                S->align -= S->buffer->count;
31163|  56.8M|                janet_description_b(S->buffer, x);
31164|  56.8M|                S->align += S->buffer->count;
31165|  56.8M|            }
31166|  56.8M|            if (color && (S->flags & JANET_PRETTY_COLOR)) {
  ------------------
  |  | 1967|  56.8M|#define JANET_PRETTY_COLOR 1
  ------------------
  |  Branch (31166:17): [True: 56.8M, False: 0]
  |  Branch (31166:26): [True: 0, False: 56.8M]
  ------------------
31167|      0|                janet_buffer_push_cstring(S->buffer, "\x1B[0m");
31168|      0|            }
31169|  56.8M|            break;
31170|  56.8M|        }
31171|  6.17M|        case JANET_ARRAY:
  ------------------
  |  Branch (31171:9): [True: 6.17M, False: 91.5M]
  ------------------
31172|  28.6M|        case JANET_TUPLE: {
  ------------------
  |  Branch (31172:9): [True: 22.5M, False: 75.1M]
  ------------------
31173|  28.6M|            int32_t i = 0, len = 0;
31174|  28.6M|            const Janet *arr = NULL;
31175|  28.6M|            int isarray = janet_checktype(x, JANET_ARRAY);
  ------------------
  |  |  806|  28.6M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 28.6M]
  |  |  ------------------
  |  |  807|  28.6M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  28.6M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  28.6M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  28.6M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  28.6M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  28.6M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
31176|  28.6M|            janet_indexed_view(x, &arr, &len);
31177|  28.6M|            int hasbrackets = !isarray && (janet_tuple_flag(arr) & JANET_TUPLE_FLAG_BRACKETCTOR);
  ------------------
  |  | 1806|  22.5M|#define janet_tuple_flag(t) (janet_tuple_head(t)->gc.flags)
  |  |  ------------------
  |  |  |  | 1800|  22.5M|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
                          int hasbrackets = !isarray && (janet_tuple_flag(arr) & JANET_TUPLE_FLAG_BRACKETCTOR);
  ------------------
  |  | 1798|  22.5M|#define JANET_TUPLE_FLAG_BRACKETCTOR 0x10000
  ------------------
  |  Branch (31177:31): [True: 22.5M, False: 6.17M]
  |  Branch (31177:43): [True: 629k, False: 21.8M]
  ------------------
31178|  28.6M|            const char *startstr = isarray ? "@[" : hasbrackets ? "[" : "(";
  ------------------
  |  Branch (31178:36): [True: 6.17M, False: 22.5M]
  |  Branch (31178:53): [True: 629k, False: 21.8M]
  ------------------
31179|  28.6M|            const char endchar = isarray ? ']' : hasbrackets ? ']' : ')';
  ------------------
  |  Branch (31179:34): [True: 6.17M, False: 22.5M]
  |  Branch (31179:50): [True: 629k, False: 21.8M]
  ------------------
31180|  28.6M|            janet_buffer_push_cstring(S->buffer, startstr);
31181|  28.6M|            S->align += (int32_t) strlen(startstr);
31182|  28.6M|            const int align = S->leaf_align = S->align;
31183|  28.6M|            S->depth--;
31184|  28.6M|            if (S->depth == 0) {
  ------------------
  |  Branch (31184:17): [True: 0, False: 28.6M]
  ------------------
31185|      0|                janet_buffer_push_cstring(S->buffer, "...");
31186|      0|                S->align += 3;
31187|  28.6M|            } else {
31188|  28.6M|                if (len > JANET_PRETTY_ARRAY_LIMIT && !(S->flags & JANET_PRETTY_NOTRUNC)) {
  ------------------
  |  |31117|  57.3M|#define JANET_PRETTY_ARRAY_LIMIT 160
  ------------------
                              if (len > JANET_PRETTY_ARRAY_LIMIT && !(S->flags & JANET_PRETTY_NOTRUNC)) {
  ------------------
  |  | 1969|      0|#define JANET_PRETTY_NOTRUNC 4
  ------------------
  |  Branch (31188:21): [True: 0, False: 28.6M]
  |  Branch (31188:55): [True: 0, False: 0]
  ------------------
31189|      0|                    for (i = 0; i < 3; i++) {
  ------------------
  |  Branch (31189:33): [True: 0, False: 0]
  ------------------
31190|      0|                        if (i) print_newline(S, align);
  ------------------
  |  Branch (31190:29): [True: 0, False: 0]
  ------------------
31191|      0|                        janet_pretty_one(S, arr[i]);
31192|      0|                    }
31193|      0|                    print_newline(S, align);
31194|      0|                    janet_buffer_push_cstring(S->buffer, "...");
31195|      0|                    S->align += 3;
31196|      0|                    for (i = len - 3; i < len; i++) {
  ------------------
  |  Branch (31196:39): [True: 0, False: 0]
  ------------------
31197|      0|                        print_newline(S, align);
31198|      0|                        janet_pretty_one(S, arr[i]);
31199|      0|                    }
31200|  28.6M|                } else {
31201|  89.3M|                    for (i = 0; i < len; i++) {
  ------------------
  |  Branch (31201:33): [True: 60.6M, False: 28.6M]
  ------------------
31202|  60.6M|                        if (i) print_newline(S, align);
  ------------------
  |  Branch (31202:29): [True: 32.0M, False: 28.6M]
  ------------------
31203|  60.6M|                        janet_pretty_one(S, arr[i]);
31204|  60.6M|                    }
31205|  28.6M|                }
31206|  28.6M|            }
31207|  28.6M|            S->depth++;
31208|  28.6M|            janet_buffer_push_u8(S->buffer, endchar);
31209|  28.6M|            S->align++;
31210|  28.6M|            break;
31211|  6.17M|        }
31212|  11.3M|        case JANET_STRUCT:
  ------------------
  |  Branch (31212:9): [True: 11.3M, False: 86.3M]
  ------------------
31213|  12.1M|        case JANET_TABLE: {
  ------------------
  |  Branch (31213:9): [True: 728k, False: 96.9M]
  ------------------
31214|  12.1M|            int istable = janet_checktype(x, JANET_TABLE);
  ------------------
  |  |  806|  12.1M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 12.1M]
  |  |  ------------------
  |  |  807|  12.1M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  12.1M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  12.1M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  12.1M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  12.1M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  12.1M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
31215|       |
31216|       |            /* For object-like tables, print class name */
31217|  12.1M|            if (istable) {
  ------------------
  |  Branch (31217:17): [True: 728k, False: 11.3M]
  ------------------
31218|   728k|                JanetTable *t = janet_unwrap_table(x);
  ------------------
  |  |  861|   728k|#define janet_unwrap_table(x) ((JanetTable *)janet_nanbox_to_pointer(x))
  ------------------
31219|   728k|                JanetTable *proto = t->proto;
31220|   728k|                S->align++;
31221|   728k|                janet_buffer_push_cstring(S->buffer, "@");
31222|   728k|                if (NULL != proto) {
  ------------------
  |  Branch (31222:21): [True: 0, False: 728k]
  ------------------
31223|      0|                    Janet name = janet_table_get(proto, janet_ckeywordv("_name"));
  ------------------
  |  | 1843|      0|#define janet_ckeywordv(cstr) janet_wrap_keyword(janet_ckeyword(cstr))
  |  |  ------------------
  |  |  |  |  850|      0|#define janet_wrap_keyword(s) janet_nanbox_wrap_c((s), JANET_KEYWORD)
  |  |  |  |  ------------------
  |  |  |  |  |  |  828|      0|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
31224|      0|                    const uint8_t *n;
31225|      0|                    int32_t len;
31226|      0|                    if (janet_bytes_view(name, &n, &len)) {
  ------------------
  |  Branch (31226:25): [True: 0, False: 0]
  ------------------
31227|      0|                        if (S->flags & JANET_PRETTY_COLOR) {
  ------------------
  |  | 1967|      0|#define JANET_PRETTY_COLOR 1
  ------------------
  |  Branch (31227:29): [True: 0, False: 0]
  ------------------
31228|      0|                            janet_buffer_push_cstring(S->buffer, janet_class_color);
31229|      0|                        }
31230|      0|                        janet_buffer_push_bytes(S->buffer, n, len);
31231|      0|                        S->align += len;
31232|      0|                        if (S->flags & JANET_PRETTY_COLOR) {
  ------------------
  |  | 1967|      0|#define JANET_PRETTY_COLOR 1
  ------------------
  |  Branch (31232:29): [True: 0, False: 0]
  ------------------
31233|      0|                            janet_buffer_push_cstring(S->buffer, "\x1B[0m");
31234|      0|                        }
31235|      0|                    }
31236|      0|                }
31237|  11.3M|            } else {
31238|  11.3M|                JanetStruct st = janet_unwrap_struct(x);
  ------------------
  |  |  857|  11.3M|#define janet_unwrap_struct(x) ((JanetStruct)janet_nanbox_to_pointer(x))
  ------------------
31239|  11.3M|                JanetStruct proto = janet_struct_proto(st);
  ------------------
  |  | 1851|  11.3M|#define janet_struct_proto(t) (janet_struct_head(t)->proto)
  |  |  ------------------
  |  |  |  | 1846|  11.3M|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
31240|  11.3M|                if (NULL != proto) {
  ------------------
  |  Branch (31240:21): [True: 0, False: 11.3M]
  ------------------
31241|      0|                    Janet name = janet_struct_get(proto, janet_ckeywordv("_name"));
  ------------------
  |  | 1843|      0|#define janet_ckeywordv(cstr) janet_wrap_keyword(janet_ckeyword(cstr))
  |  |  ------------------
  |  |  |  |  850|      0|#define janet_wrap_keyword(s) janet_nanbox_wrap_c((s), JANET_KEYWORD)
  |  |  |  |  ------------------
  |  |  |  |  |  |  828|      0|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
31242|      0|                    const uint8_t *n;
31243|      0|                    int32_t len;
31244|      0|                    if (janet_bytes_view(name, &n, &len)) {
  ------------------
  |  Branch (31244:25): [True: 0, False: 0]
  ------------------
31245|      0|                        if (S->flags & JANET_PRETTY_COLOR) {
  ------------------
  |  | 1967|      0|#define JANET_PRETTY_COLOR 1
  ------------------
  |  Branch (31245:29): [True: 0, False: 0]
  ------------------
31246|      0|                            janet_buffer_push_cstring(S->buffer, janet_class_color);
31247|      0|                        }
31248|      0|                        janet_buffer_push_bytes(S->buffer, n, len);
31249|      0|                        S->align += len;
31250|      0|                        if (S->flags & JANET_PRETTY_COLOR) {
  ------------------
  |  | 1967|      0|#define JANET_PRETTY_COLOR 1
  ------------------
  |  Branch (31250:29): [True: 0, False: 0]
  ------------------
31251|      0|                            janet_buffer_push_cstring(S->buffer, "\x1B[0m");
31252|      0|                        }
31253|      0|                    }
31254|      0|                }
31255|  11.3M|            }
31256|  12.1M|            janet_buffer_push_u8(S->buffer, '{');
31257|  12.1M|            const int align = S->leaf_align = ++S->align;
31258|       |
31259|  12.1M|            S->depth--;
31260|  12.1M|            if (S->depth == 0) {
  ------------------
  |  Branch (31260:17): [True: 0, False: 12.1M]
  ------------------
31261|      0|                janet_buffer_push_cstring(S->buffer, "...");
31262|      0|                S->align += 3;
31263|  12.1M|            } else {
31264|  12.1M|                int32_t len = 0, cap = 0;
31265|  12.1M|                const JanetKV *kvs = NULL;
31266|  12.1M|                janet_dictionary_view(x, &kvs, &len, &cap);
31267|  12.1M|                int32_t ks_start = S->keysort_start;
31268|  12.1M|                int truncated = 0;
31269|       |
31270|       |                /* Shortcut for huge dictionaries, don't bother sorting keys */
31271|  12.1M|                if (len > JANET_PRETTY_DICT_KEYSORT_LIMIT) {
  ------------------
  |  |31116|  12.1M|#define JANET_PRETTY_DICT_KEYSORT_LIMIT 2000
  ------------------
  |  Branch (31271:21): [True: 0, False: 12.1M]
  ------------------
31272|      0|                    if (!(S->flags & JANET_PRETTY_NOTRUNC)) {
  ------------------
  |  | 1969|      0|#define JANET_PRETTY_NOTRUNC 4
  ------------------
  |  Branch (31272:25): [True: 0, False: 0]
  ------------------
31273|      0|                        len = JANET_PRETTY_DICT_LIMIT;
  ------------------
  |  |31115|      0|#define JANET_PRETTY_DICT_LIMIT 30
  ------------------
31274|      0|                        truncated = 1;
31275|      0|                    }
31276|      0|                    int32_t j = 0;
31277|      0|                    for (int32_t i = 0; i < len; i++) {
  ------------------
  |  Branch (31277:41): [True: 0, False: 0]
  ------------------
31278|      0|                        while (janet_checktype(kvs[j].key, JANET_NIL)) j++;
  ------------------
  |  |  806|      0|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 0, False: 0]
  |  |  |  Branch (806:6): [Folded, False: 0]
  |  |  ------------------
  |  |  807|      0|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|      0|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|      0|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|      0|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
31279|      0|                        if (i) print_newline(S, align);
  ------------------
  |  Branch (31279:29): [True: 0, False: 0]
  ------------------
31280|      0|                        janet_pretty_one(S, kvs[j].key);
31281|      0|                        janet_buffer_push_u8(S->buffer, ' ');
31282|      0|                        S->align++;
31283|      0|                        janet_pretty_one(S, kvs[j].value);
31284|      0|                        j++;
31285|      0|                    }
31286|      0|                    if (truncated) {
  ------------------
  |  Branch (31286:25): [True: 0, False: 0]
  ------------------
31287|      0|                        print_newline(S, align);
31288|      0|                        janet_buffer_push_cstring(S->buffer, "...");
31289|      0|                        S->align += 3;
31290|      0|                    }
31291|  12.1M|                } else {
31292|       |                    /* Sorted keys dictionaries */
31293|       |
31294|       |                    /* Ensure buffer is large enough to sort keys. */
31295|  12.1M|                    int64_t mincap = (int64_t) len + (int64_t) ks_start;
31296|  12.1M|                    if (mincap > INT32_MAX) {
  ------------------
  |  Branch (31296:25): [True: 0, False: 12.1M]
  ------------------
31297|      0|                        truncated = 1;
31298|      0|                        len = 0;
31299|      0|                        mincap = ks_start;
31300|      0|                    }
31301|       |
31302|  12.1M|                    if (S->keysort_capacity < mincap) {
  ------------------
  |  Branch (31302:25): [True: 5.33M, False: 6.78M]
  ------------------
31303|  5.33M|                        if (mincap >= INT32_MAX / 2) {
  ------------------
  |  Branch (31303:29): [True: 0, False: 5.33M]
  ------------------
31304|      0|                            S->keysort_capacity = INT32_MAX;
31305|  5.33M|                        } else {
31306|  5.33M|                            S->keysort_capacity = (int32_t)(mincap * 2);
31307|  5.33M|                        }
31308|  5.33M|                        S->keysort_buffer = janet_srealloc(S->keysort_buffer, sizeof(int32_t) * S->keysort_capacity);
31309|  5.33M|                        if (NULL == S->keysort_buffer) {
  ------------------
  |  Branch (31309:29): [True: 0, False: 5.33M]
  ------------------
31310|      0|                            JANET_OUT_OF_MEMORY;
  ------------------
  |  |  419|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (419:122): [Folded, False: 0]
  |  |  ------------------
  ------------------
31311|      0|                        }
31312|  5.33M|                    }
31313|       |
31314|  12.1M|                    janet_sorted_keys(kvs, cap, S->keysort_buffer == NULL ? NULL : S->keysort_buffer + ks_start);
  ------------------
  |  Branch (31314:49): [True: 192k, False: 11.9M]
  ------------------
31315|  12.1M|                    S->keysort_start += len;
31316|  12.1M|                    if (!(S->flags & JANET_PRETTY_NOTRUNC) && (len > JANET_PRETTY_DICT_LIMIT)) {
  ------------------
  |  | 1969|  12.1M|#define JANET_PRETTY_NOTRUNC 4
  ------------------
                                  if (!(S->flags & JANET_PRETTY_NOTRUNC) && (len > JANET_PRETTY_DICT_LIMIT)) {
  ------------------
  |  |31115|  3.27k|#define JANET_PRETTY_DICT_LIMIT 30
  ------------------
  |  Branch (31316:25): [True: 3.27k, False: 12.1M]
  |  Branch (31316:63): [True: 12, False: 3.26k]
  ------------------
31317|     12|                        len = JANET_PRETTY_DICT_LIMIT;
  ------------------
  |  |31115|     12|#define JANET_PRETTY_DICT_LIMIT 30
  ------------------
31318|     12|                        truncated = 1;
31319|     12|                    }
31320|       |
31321|  21.3M|                    for (int32_t i = 0; i < len; i++) {
  ------------------
  |  Branch (31321:41): [True: 9.18M, False: 12.1M]
  ------------------
31322|  9.18M|                        if (i) print_newline(S, align);
  ------------------
  |  Branch (31322:29): [True: 3.75M, False: 5.43M]
  ------------------
31323|  9.18M|                        int32_t j = S->keysort_buffer[i + ks_start];
31324|  9.18M|                        janet_pretty_one(S, kvs[j].key);
31325|  9.18M|                        janet_buffer_push_u8(S->buffer, ' ');
31326|  9.18M|                        S->align++;
31327|  9.18M|                        janet_pretty_one(S, kvs[j].value);
31328|  9.18M|                    }
31329|       |
31330|  12.1M|                    if (truncated) {
  ------------------
  |  Branch (31330:25): [True: 12, False: 12.1M]
  ------------------
31331|     12|                        print_newline(S, align);
31332|     12|                        janet_buffer_push_cstring(S->buffer, "...");
31333|     12|                        S->align += 3;
31334|     12|                    }
31335|       |
31336|  12.1M|                }
31337|  12.1M|                S->keysort_start = ks_start;
31338|  12.1M|            }
31339|  12.1M|            S->depth++;
31340|  12.1M|            janet_buffer_push_u8(S->buffer, '}');
31341|  12.1M|            S->align++;
31342|  12.1M|            break;
31343|  12.1M|        }
31344|  97.7M|    }
31345|       |    /* Remove from seen */
31346|  97.7M|    janet_table_remove(&S->seen, x);
31347|  97.7M|    return;
31348|  97.7M|}
janet.c:print_newline:
31079|  35.7M|static void print_newline(struct pretty *S, int align) {
31080|  35.7M|    int i;
31081|  35.7M|    if (S->flags & JANET_PRETTY_ONELINE) {
  ------------------
  |  | 1968|  35.7M|#define JANET_PRETTY_ONELINE 2
  ------------------
  |  Branch (31081:9): [True: 0, False: 35.7M]
  ------------------
31082|      0|        janet_buffer_push_u8(S->buffer, ' ');
31083|      0|        return;
31084|      0|    }
31085|  35.7M|    backtrack_newlines(S);
31086|  35.7M|    janet_buffer_push_u8(S->buffer, '\n');
31087|  35.7M|    S->leaf_align = S->align = align;
31088|   168M|    for (i = 0; i < S->align; i++) {
  ------------------
  |  Branch (31088:17): [True: 132M, False: 35.7M]
  ------------------
31089|   132M|        janet_buffer_push_u8(S->buffer, ' ');
31090|   132M|    }
31091|  35.7M|}
janet.c:backtrack_newlines:
31019|  54.4M|static void backtrack_newlines(const struct pretty *S) {
31020|  54.4M|    if (S->flags & JANET_PRETTY_ONELINE || S->buffer->count <= 0)
  ------------------
  |  | 1968|   108M|#define JANET_PRETTY_ONELINE 2
  ------------------
  |  Branch (31020:9): [True: 0, False: 54.4M]
  |  Branch (31020:44): [True: 0, False: 54.4M]
  ------------------
31021|      0|        return;
31022|  54.4M|    switch (S->buffer->data[S->buffer->count - 1]) {
31023|  4.90M|        case ')':
  ------------------
  |  Branch (31023:9): [True: 4.90M, False: 49.5M]
  ------------------
31024|  10.8M|        case '}':
  ------------------
  |  Branch (31024:9): [True: 5.94M, False: 48.5M]
  ------------------
31025|  17.2M|        case ']':
  ------------------
  |  Branch (31025:9): [True: 6.42M, False: 48.0M]
  ------------------
31026|  17.2M|            break;
31027|  37.2M|        default:
  ------------------
  |  Branch (31027:9): [True: 37.2M, False: 17.2M]
  ------------------
31028|  37.2M|            return;
31029|  54.4M|    }
31030|  17.2M|    int32_t removed = 0;
31031|  17.2M|    int32_t old_count = S->buffer->count;
31032|  17.2M|    int32_t offset = old_count;
31033|  17.2M|    int32_t b0 = S->lookback_barrier;
31034|  17.2M|    int32_t columns = S->width;
31035|  17.2M|    int32_t align = 0;
31036|   306M|    while (--offset >= b0) {
  ------------------
  |  Branch (31036:12): [True: 301M, False: 5.01M]
  ------------------
31037|   301M|        const char *s = (const char *)S->buffer->data + offset;
31038|   301M|        if (*s == '\n') {
  ------------------
  |  Branch (31038:13): [True: 24.0M, False: 277M]
  ------------------
31039|  24.0M|            if (align < S->leaf_align) {
  ------------------
  |  Branch (31039:17): [True: 12.2M, False: 11.8M]
  ------------------
31040|  12.2M|                break;
31041|  12.2M|            }
31042|  11.8M|            columns += align;
31043|  11.8M|            removed += align;
31044|  11.8M|            align = 0;
31045|   277M|        } else if (*s == ' ') {
  ------------------
  |  Branch (31045:20): [True: 102M, False: 175M]
  ------------------
31046|   102M|            align++;
31047|   175M|        } else {
31048|   175M|            align = 0;
31049|       |            /* Don't count color sequences: \x1B(0|3\d)m */
31050|   175M|            if (S->flags & JANET_PRETTY_COLOR && *s == 'm') {
  ------------------
  |  | 1967|   350M|#define JANET_PRETTY_COLOR 1
  ------------------
  |  Branch (31050:17): [True: 0, False: 175M]
  |  Branch (31050:50): [True: 0, False: 0]
  ------------------
31051|      0|                if (offset >= (3 + b0) && strncmp("\x1B[0m", s - 3, 4) == 0) {
  ------------------
  |  Branch (31051:21): [True: 0, False: 0]
  |  Branch (31051:43): [True: 0, False: 0]
  ------------------
31052|      0|                    offset -= 3;
31053|      0|                    columns++;
31054|      0|                } else if (offset >= (4 + b0) && strncmp("\x1B[3", s - 4, 3) == 0) {
  ------------------
  |  Branch (31054:28): [True: 0, False: 0]
  |  Branch (31054:50): [True: 0, False: 0]
  ------------------
31055|      0|                    offset -= 4;
31056|      0|                    columns++;
31057|      0|                }
31058|      0|            }
31059|   175M|        }
31060|   289M|        if (--columns <= 0) {
  ------------------
  |  Branch (31060:13): [True: 68.1k, False: 289M]
  ------------------
31061|  68.1k|            return;
31062|  68.1k|        }
31063|   289M|    }
31064|  17.2M|    offset++; /* Don't mess with the last newline we found */
31065|  17.2M|    janet_assert(offset >= b0, "bad buffer index");
  ------------------
  |  |  389|  17.2M|#define janet_assert(c, m) do { \
  |  |  390|  17.2M|    if (!(c)) JANET_EXIT((m)); \
  |  |  ------------------
  |  |  |  |  378|      0|#define JANET_EXIT(m) do { \
  |  |  |  |  379|      0|    fprintf(stderr, "janet abort at %s:%d: %s\n",\
  |  |  |  |  380|      0|        __FILE__,\
  |  |  |  |  381|      0|        __LINE__,\
  |  |  |  |  382|      0|        (m));\
  |  |  |  |  383|      0|    abort();\
  |  |  |  |  384|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (384:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (390:9): [True: 0, False: 17.2M]
  |  |  ------------------
  |  |  391|  17.2M|} while (0)
  |  |  ------------------
  |  |  |  Branch (391:10): [Folded, False: 17.2M]
  |  |  ------------------
  ------------------
31066|  17.2M|    S->buffer->count -= removed;
31067|   252M|    for (int32_t i = offset; i < S->buffer->count; i++) {
  ------------------
  |  Branch (31067:30): [True: 235M, False: 17.2M]
  ------------------
31068|   235M|        if (S->buffer->data[offset] == '\n') {
  ------------------
  |  Branch (31068:13): [True: 11.4M, False: 223M]
  ------------------
31069|  11.4M|            S->buffer->data[i] = ' ';
31070|  57.4M|            while (S->buffer->data[++offset] == ' ') {
  ------------------
  |  Branch (31070:20): [True: 45.9M, False: 11.4M]
  ------------------
31071|  45.9M|                janet_assert(offset < old_count, "bad replacement of newline");
  ------------------
  |  |  389|  45.9M|#define janet_assert(c, m) do { \
  |  |  390|  45.9M|    if (!(c)) JANET_EXIT((m)); \
  |  |  ------------------
  |  |  |  |  378|      0|#define JANET_EXIT(m) do { \
  |  |  |  |  379|      0|    fprintf(stderr, "janet abort at %s:%d: %s\n",\
  |  |  |  |  380|      0|        __FILE__,\
  |  |  |  |  381|      0|        __LINE__,\
  |  |  |  |  382|      0|        (m));\
  |  |  |  |  383|      0|    abort();\
  |  |  |  |  384|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (384:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (390:9): [True: 0, False: 45.9M]
  |  |  ------------------
  |  |  391|  45.9M|} while (0)
  |  |  ------------------
  |  |  |  Branch (391:10): [Folded, False: 45.9M]
  |  |  ------------------
  ------------------
31072|  45.9M|            }
31073|   223M|        } else {
31074|   223M|            S->buffer->data[i] = S->buffer->data[offset++];
31075|   223M|        }
31076|   235M|    }
31077|  17.2M|}
janet.c:scanformat:
31472|  39.8M|    char precision[3]) {
31473|  39.8M|    const char *p = strfrmt;
31474|       |
31475|       |    /* Parse strfrmt */
31476|  39.8M|    memset(width, '\0', 3);
31477|  39.8M|    memset(precision, '\0', 3);
31478|  39.8M|    while (*p != '\0' && strchr(FMT_FLAGS, *p) != NULL)
  ------------------
  |  |31438|  39.8M|#define FMT_FLAGS "-+ #0"
  ------------------
  |  Branch (31478:12): [True: 39.8M, False: 0]
  |  Branch (31478:26): [True: 0, False: 39.8M]
  ------------------
31479|      0|        p++; /* skip flags */
31480|  39.8M|    if ((size_t)(p - strfrmt) >= sizeof(FMT_FLAGS)) janet_panic("invalid format (repeated flags)");
  ------------------
  |  |31438|  39.8M|#define FMT_FLAGS "-+ #0"
  ------------------
  |  Branch (31480:9): [True: 0, False: 39.8M]
  ------------------
31481|  39.8M|    if (isdigit((int)(*p)))
  ------------------
  |  Branch (31481:9): [True: 0, False: 39.8M]
  ------------------
31482|      0|        width[0] = *p++; /* skip width */
31483|  39.8M|    if (isdigit((int)(*p)))
  ------------------
  |  Branch (31483:9): [True: 0, False: 39.8M]
  ------------------
31484|      0|        width[1] = *p++; /* (2 digits at most) */
31485|  39.8M|    if (*p == '.') {
  ------------------
  |  Branch (31485:9): [True: 0, False: 39.8M]
  ------------------
31486|      0|        p++;
31487|      0|        if (isdigit((int)(*p)))
  ------------------
  |  Branch (31487:13): [True: 0, False: 0]
  ------------------
31488|      0|            precision[0] = *p++; /* skip precision */
31489|      0|        if (isdigit((int)(*p)))
  ------------------
  |  Branch (31489:13): [True: 0, False: 0]
  ------------------
31490|      0|            precision[1] = *p++; /* (2 digits at most) */
31491|      0|    }
31492|  39.8M|    if (isdigit((int)(*p)))
  ------------------
  |  Branch (31492:9): [True: 0, False: 39.8M]
  ------------------
31493|      0|        janet_panic("invalid format (width or precision too long)");
31494|       |
31495|       |    /* Write to form - replace characters with fixed size stuff */
31496|  39.8M|    *(form++) = '%';
31497|  39.8M|    const char *p2 = strfrmt;
31498|  79.7M|    while (p2 <= p) {
  ------------------
  |  Branch (31498:12): [True: 39.8M, False: 39.8M]
  ------------------
31499|  39.8M|        char *loc = strchr(FMT_REPLACE_INTTYPES, *p2);
  ------------------
  |  |31439|  39.8M|#define FMT_REPLACE_INTTYPES "diouxX"
  ------------------
31500|  39.8M|        if (loc != NULL && *loc != '\0') {
  ------------------
  |  Branch (31500:13): [True: 20.6M, False: 19.1M]
  |  Branch (31500:28): [True: 20.6M, False: 0]
  ------------------
31501|  20.6M|            const char *mapping = get_fmt_mapping(*p2++);
31502|  20.6M|            size_t len = strlen(mapping);
31503|  20.6M|            memcpy(form, mapping, len);
31504|  20.6M|            form += len;
31505|  20.6M|        } else {
31506|  19.1M|            *(form++) = *(p2++);
31507|  19.1M|        }
31508|  39.8M|    }
31509|  39.8M|    *form = '\0';
31510|       |
31511|  39.8M|    return p;
31512|  39.8M|}
janet.c:get_fmt_mapping:
31460|  20.6M|static const char *get_fmt_mapping(char c) {
31461|  62.0M|    for (size_t i = 0; i < (sizeof(format_mappings) / sizeof(struct FmtMapping)); i++) {
  ------------------
  |  Branch (31461:24): [True: 62.0M, False: 0]
  ------------------
31462|  62.0M|        if (format_mappings[i].c == c)
  ------------------
  |  Branch (31462:13): [True: 20.6M, False: 41.3M]
  ------------------
31463|  20.6M|            return format_mappings[i].mapping;
31464|  62.0M|    }
31465|      0|    janet_assert(0, "bad format mapping");
  ------------------
  |  |  389|      0|#define janet_assert(c, m) do { \
  |  |  390|      0|    if (!(c)) JANET_EXIT((m)); \
  |  |  ------------------
  |  |  |  |  378|      0|#define JANET_EXIT(m) do { \
  |  |  |  |  379|      0|    fprintf(stderr, "janet abort at %s:%d: %s\n",\
  |  |  |  |  380|      0|        __FILE__,\
  |  |  |  |  381|      0|        __LINE__,\
  |  |  |  |  382|      0|        (m));\
  |  |  |  |  383|      0|    abort();\
  |  |  |  |  384|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (384:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (390:9): [True: 0, Folded]
  |  |  ------------------
  |  |  391|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (391:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
31466|      0|}
janet.c:bignat_zero:
34323|  15.8k|static void bignat_zero(struct BigNat *x) {
34324|  15.8k|    x->first_digit = 0;
34325|  15.8k|    x->n = 0;
34326|  15.8k|    x->cap = 0;
34327|       |    x->digits = NULL;
34328|  15.8k|}
janet.c:bignat_muladd:
34355|  50.4k|static void bignat_muladd(struct BigNat *mant, uint32_t factor, uint32_t term) {
34356|  50.4k|    int32_t i;
34357|  50.4k|    uint64_t carry = ((uint64_t) mant->first_digit) * factor + term;
34358|  50.4k|    mant->first_digit = carry % BIGNAT_BASE;
  ------------------
  |  |34312|  50.4k|#define BIGNAT_BASE 0x80000000U
  ------------------
34359|  50.4k|    carry /= BIGNAT_BASE;
  ------------------
  |  |34312|  50.4k|#define BIGNAT_BASE 0x80000000U
  ------------------
34360|   381k|    for (i = 0; i < mant->n; i++) {
  ------------------
  |  Branch (34360:17): [True: 330k, False: 50.4k]
  ------------------
34361|   330k|        carry += ((uint64_t) mant->digits[i]) * factor;
34362|   330k|        mant->digits[i] = carry % BIGNAT_BASE;
  ------------------
  |  |34312|   330k|#define BIGNAT_BASE 0x80000000U
  ------------------
34363|   330k|        carry /= BIGNAT_BASE;
  ------------------
  |  |34312|   330k|#define BIGNAT_BASE 0x80000000U
  ------------------
34364|   330k|    }
34365|  50.4k|    if (carry) bignat_append(mant, (uint32_t) carry);
  ------------------
  |  Branch (34365:9): [True: 10.7k, False: 39.6k]
  ------------------
34366|  50.4k|}
janet.c:bignat_append:
34348|  10.7k|static void bignat_append(struct BigNat *mant, uint32_t dig) {
34349|  10.7k|    bignat_extra(mant, 1)[0] = dig;
34350|  10.7k|}
janet.c:bignat_extra:
34331|  11.8k|static uint32_t *bignat_extra(struct BigNat *mant, int32_t n) {
34332|  11.8k|    int32_t oldn = mant->n;
34333|  11.8k|    int32_t newn = oldn + n;
34334|  11.8k|    if (mant->cap < newn) {
  ------------------
  |  Branch (34334:9): [True: 3.60k, False: 8.22k]
  ------------------
34335|  3.60k|        int32_t newcap = 2 * newn;
34336|  3.60k|        uint32_t *mem = janet_realloc(mant->digits, (size_t) newcap * sizeof(uint32_t));
  ------------------
  |  | 2409|  3.60k|#define janet_realloc(X, Y) realloc((X), (Y))
  ------------------
34337|  3.60k|        if (NULL == mem) {
  ------------------
  |  Branch (34337:13): [True: 0, False: 3.60k]
  ------------------
34338|      0|            JANET_OUT_OF_MEMORY;
  ------------------
  |  |  419|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (419:122): [Folded, False: 0]
  |  |  ------------------
  ------------------
34339|      0|        }
34340|  3.60k|        mant->cap = newcap;
34341|  3.60k|        mant->digits = mem;
34342|  3.60k|    }
34343|  11.8k|    mant->n = newn;
34344|  11.8k|    return mant->digits + oldn;
34345|  11.8k|}
janet.c:convert:
34451|  11.6k|    int32_t exponent) {
34452|       |
34453|  11.6k|    int32_t exponent2 = 0;
34454|       |
34455|       |    /* Approximate exponent in base 2 of mant and exponent. This should get us a good estimate of the final size of the
34456|       |     * number, within * 2^32 or so. */
34457|  11.6k|    int64_t mant_exp2_approx = mant->n * 32 + 16;
34458|  11.6k|    int64_t exp_exp2_approx = (int64_t)(floor(log2(base) * exponent));
34459|  11.6k|    int64_t exp2_approx = mant_exp2_approx + exp_exp2_approx;
34460|       |
34461|       |    /* Short circuit zero, huge, and small numbers. We use the exponent range of valid IEEE754 doubles (-1022, 1023)
34462|       |     * with a healthy buffer to allow for inaccuracies in the approximation and denormailzed numbers. */
34463|  11.6k|    if (mant->n == 0 && mant->first_digit == 0)
  ------------------
  |  Branch (34463:9): [True: 11.3k, False: 274]
  |  Branch (34463:25): [True: 1.66k, False: 9.72k]
  ------------------
34464|  1.66k|        return negative ? -0.0 : 0.0;
  ------------------
  |  Branch (34464:16): [True: 81, False: 1.58k]
  ------------------
34465|  9.99k|    if (exp2_approx > 1176)
  ------------------
  |  Branch (34465:9): [True: 111, False: 9.88k]
  ------------------
34466|    111|        return negative ? -INFINITY : INFINITY;
  ------------------
  |  Branch (34466:16): [True: 20, False: 91]
  ------------------
34467|  9.88k|    if (exp2_approx < -1175)
  ------------------
  |  Branch (34467:9): [True: 93, False: 9.79k]
  ------------------
34468|     93|        return negative ? -0.0 : 0.0;
  ------------------
  |  Branch (34468:16): [True: 0, False: 93]
  ------------------
34469|       |
34470|       |    /* Final value is X = mant * base ^ exponent * 2 ^ exponent2
34471|       |     * Get exponent to zero while holding X constant. */
34472|       |
34473|       |    /* Positive exponents are simple */
34474|  33.6k|    for (; exponent > 3; exponent -= 4) bignat_muladd(mant, base * base * base * base, 0);
  ------------------
  |  Branch (34474:12): [True: 23.8k, False: 9.79k]
  ------------------
34475|  10.5k|    for (; exponent > 1; exponent -= 2) bignat_muladd(mant, base * base, 0);
  ------------------
  |  Branch (34475:12): [True: 720, False: 9.79k]
  ------------------
34476|  10.5k|    for (; exponent > 0; exponent -= 1) bignat_muladd(mant, base, 0);
  ------------------
  |  Branch (34476:12): [True: 739, False: 9.79k]
  ------------------
34477|       |
34478|       |    /* Negative exponents are tricky - we don't want to loose bits
34479|       |     * from integer division, so we need to premultiply. */
34480|  9.79k|    if (exponent < 0) {
  ------------------
  |  Branch (34480:9): [True: 1.09k, False: 8.69k]
  ------------------
34481|  1.09k|        int32_t shamt = 5 - exponent / 4;
34482|  1.09k|        bignat_lshift_n(mant, shamt);
34483|  1.09k|        exponent2 -= shamt * BIGNAT_NBIT;
  ------------------
  |  |34311|  1.09k|#define BIGNAT_NBIT 31
  ------------------
34484|  8.85k|        for (; exponent < -3; exponent += 4) bignat_div(mant, base * base * base * base);
  ------------------
  |  Branch (34484:16): [True: 7.75k, False: 1.09k]
  ------------------
34485|  1.47k|        for (; exponent < -1; exponent += 2) bignat_div(mant, base * base);
  ------------------
  |  Branch (34485:16): [True: 378, False: 1.09k]
  ------------------
34486|  1.87k|        for (; exponent <  0; exponent += 1) bignat_div(mant, base);
  ------------------
  |  Branch (34486:16): [True: 771, False: 1.09k]
  ------------------
34487|  1.09k|    }
34488|       |
34489|  9.79k|    return negative
  ------------------
  |  Branch (34489:12): [True: 1.11k, False: 8.68k]
  ------------------
34490|  9.79k|           ? -bignat_extract(mant, exponent2)
34491|  9.79k|           : bignat_extract(mant, exponent2);
34492|  9.88k|}
janet.c:bignat_lshift_n:
34387|  1.09k|static void bignat_lshift_n(struct BigNat *mant, int n) {
34388|  1.09k|    if (!n) return;
  ------------------
  |  Branch (34388:9): [True: 0, False: 1.09k]
  ------------------
34389|  1.09k|    int32_t oldn = mant->n;
34390|  1.09k|    bignat_extra(mant, n);
34391|  1.09k|    memmove(mant->digits + n, mant->digits, sizeof(uint32_t) * oldn);
34392|  1.09k|    memset(mant->digits, 0, sizeof(uint32_t) * (n - 1));
34393|  1.09k|    mant->digits[n - 1] = mant->first_digit;
34394|  1.09k|    mant->first_digit = 0;
34395|  1.09k|}
janet.c:bignat_div:
34369|  8.90k|static void bignat_div(struct BigNat *mant, uint32_t divisor) {
34370|  8.90k|    int32_t i;
34371|  8.90k|    uint32_t quotient, remainder;
34372|  8.90k|    uint64_t dividend;
34373|  8.90k|    remainder = 0, quotient = 0;
34374|  1.20M|    for (i = mant->n - 1; i >= 0; i--) {
  ------------------
  |  Branch (34374:27): [True: 1.19M, False: 8.90k]
  ------------------
34375|  1.19M|        dividend = ((uint64_t)remainder * BIGNAT_BASE) + mant->digits[i];
  ------------------
  |  |34312|  1.19M|#define BIGNAT_BASE 0x80000000U
  ------------------
34376|  1.19M|        if (i < mant->n - 1) mant->digits[i + 1] = quotient;
  ------------------
  |  Branch (34376:13): [True: 1.18M, False: 8.90k]
  ------------------
34377|  1.19M|        quotient = (uint32_t)(dividend / divisor);
34378|  1.19M|        remainder = (uint32_t)(dividend % divisor);
34379|  1.19M|        mant->digits[i] = remainder;
34380|  1.19M|    }
34381|  8.90k|    dividend = ((uint64_t)remainder * BIGNAT_BASE) + mant->first_digit;
  ------------------
  |  |34312|  8.90k|#define BIGNAT_BASE 0x80000000U
  ------------------
34382|  8.90k|    if (mant->n && mant->digits[mant->n - 1] == 0) mant->n--;
  ------------------
  |  Branch (34382:9): [True: 8.90k, False: 0]
  |  Branch (34382:20): [True: 2.59k, False: 6.30k]
  ------------------
34383|  8.90k|    mant->first_digit = (uint32_t)(dividend / divisor);
34384|  8.90k|}
janet.c:bignat_extract:
34412|  9.79k|static double bignat_extract(struct BigNat *mant, int32_t exponent2) {
34413|  9.79k|    uint64_t top53;
34414|  9.79k|    int32_t n = mant->n;
34415|       |    /* Get most significant 53 bits from mant. Bit 52 (0 indexed) should
34416|       |     * always be 1. This is essentially a large right shift on mant.*/
34417|  9.79k|    if (n) {
  ------------------
  |  Branch (34417:9): [True: 2.13k, False: 7.65k]
  ------------------
34418|       |        /* Two or more digits */
34419|  2.13k|        uint64_t d1 = mant->digits[n - 1]; /* MSD (non-zero) */
34420|  2.13k|        uint64_t d2 = (n == 1) ? mant->first_digit : mant->digits[n - 2];
  ------------------
  |  Branch (34420:23): [True: 356, False: 1.78k]
  ------------------
34421|  2.13k|        uint64_t d3 = (n > 2) ? mant->digits[n - 3] : (n == 2) ? mant->first_digit : 0;
  ------------------
  |  Branch (34421:23): [True: 1.57k, False: 563]
  |  Branch (34421:55): [True: 207, False: 356]
  ------------------
34422|  2.13k|        int lz = clz((uint32_t) d1);
  ------------------
  |  |34398|  2.13k|#define clz(x) __builtin_clz(x)
  ------------------
34423|  2.13k|        int nbits = 32 - lz;
34424|       |        /* First get 54 bits */
34425|  2.13k|        top53 = (d2 << (54 - BIGNAT_NBIT)) + (d3 >> (2 * BIGNAT_NBIT - 54));
  ------------------
  |  |34311|  2.13k|#define BIGNAT_NBIT 31
  ------------------
                      top53 = (d2 << (54 - BIGNAT_NBIT)) + (d3 >> (2 * BIGNAT_NBIT - 54));
  ------------------
  |  |34311|  2.13k|#define BIGNAT_NBIT 31
  ------------------
34426|  2.13k|        top53 >>= nbits;
34427|  2.13k|        top53 |= (d1 << (54 - nbits));
34428|       |        /* Rounding based on lowest bit of 54 */
34429|  2.13k|        if (top53 & 1) top53++;
  ------------------
  |  Branch (34429:13): [True: 738, False: 1.39k]
  ------------------
34430|  2.13k|        top53 >>= 1;
34431|  2.13k|        if (top53 > 0x1FffffFFFFffffUL) {
  ------------------
  |  Branch (34431:13): [True: 37, False: 2.10k]
  ------------------
34432|     37|            top53 >>= 1;
34433|     37|            exponent2++;
34434|     37|        }
34435|       |        /* Correct exponent - to correct for large right shift to mantissa. */
34436|  2.13k|        exponent2 += (nbits - 53) + BIGNAT_NBIT * n;
  ------------------
  |  |34311|  2.13k|#define BIGNAT_NBIT 31
  ------------------
34437|  7.65k|    } else {
34438|       |        /* One digit */
34439|  7.65k|        top53 = mant->first_digit;
34440|  7.65k|    }
34441|  9.79k|    return ldexp((double)top53, exponent2);
34442|  9.79k|}
janet.c:scan_uint64:
34652|  3.23k|    int *neg) {
34653|  3.23k|    const uint8_t *end = str + len;
34654|  3.23k|    int seenadigit = 0;
34655|  3.23k|    int base = 10;
34656|  3.23k|    *neg = 0;
34657|  3.23k|    *out = 0;
34658|  3.23k|    uint64_t accum = 0;
34659|  3.23k|    if (len > JANET_NUMBER_LENGTH_RIDICULOUS) return 0;
  ------------------
  |  |34296|  3.23k|#define JANET_NUMBER_LENGTH_RIDICULOUS 0xFFFF
  ------------------
  |  Branch (34659:9): [True: 0, False: 3.23k]
  ------------------
34660|       |    /* Get sign */
34661|  3.23k|    if (str >= end) return 0;
  ------------------
  |  Branch (34661:9): [True: 0, False: 3.23k]
  ------------------
34662|  3.23k|    if (*str == '-') {
  ------------------
  |  Branch (34662:9): [True: 638, False: 2.59k]
  ------------------
34663|    638|        *neg = 1;
34664|    638|        str++;
34665|  2.59k|    } else if (*str == '+') {
  ------------------
  |  Branch (34665:16): [True: 236, False: 2.36k]
  ------------------
34666|    236|        str++;
34667|    236|    }
34668|       |    /* Check for leading 0x or digit digit r */
34669|  3.23k|    if (str + 1 < end && str[0] == '0' && str[1] == 'x') {
  ------------------
  |  Branch (34669:9): [True: 1.82k, False: 1.41k]
  |  Branch (34669:26): [True: 383, False: 1.44k]
  |  Branch (34669:43): [True: 52, False: 331]
  ------------------
34670|     52|        base = 16;
34671|     52|        str += 2;
34672|  3.18k|    } else if (str + 1 < end  &&
  ------------------
  |  Branch (34672:16): [True: 1.77k, False: 1.41k]
  ------------------
34673|  1.77k|               str[0] >= '0' && str[0] <= '9' &&
  ------------------
  |  Branch (34673:16): [True: 1.68k, False: 85]
  |  Branch (34673:33): [True: 1.59k, False: 92]
  ------------------
34674|  1.59k|               str[1] == 'r') {
  ------------------
  |  Branch (34674:16): [True: 38, False: 1.55k]
  ------------------
34675|     38|        base = str[0] - '0';
34676|     38|        str += 2;
34677|  3.14k|    } else if (str + 2 < end  &&
  ------------------
  |  Branch (34677:16): [True: 1.25k, False: 1.89k]
  ------------------
34678|  1.25k|               str[0] >= '0' && str[0] <= '9' &&
  ------------------
  |  Branch (34678:16): [True: 1.19k, False: 56]
  |  Branch (34678:33): [True: 1.13k, False: 68]
  ------------------
34679|  1.13k|               str[1] >= '0' && str[1] <= '9' &&
  ------------------
  |  Branch (34679:16): [True: 1.09k, False: 40]
  |  Branch (34679:33): [True: 993, False: 98]
  ------------------
34680|    993|               str[2] == 'r') {
  ------------------
  |  Branch (34680:16): [True: 93, False: 900]
  ------------------
34681|     93|        base = 10 * (str[0] - '0') + (str[1] - '0');
34682|     93|        if (base < 2 || base > 36) return 0;
  ------------------
  |  Branch (34682:13): [True: 18, False: 75]
  |  Branch (34682:25): [True: 24, False: 51]
  ------------------
34683|     51|        str += 3;
34684|     51|    }
34685|       |
34686|       |    /* Skip leading zeros */
34687|  4.30k|    while (str < end && *str == '0') {
  ------------------
  |  Branch (34687:12): [True: 3.64k, False: 651]
  |  Branch (34687:25): [True: 1.10k, False: 2.54k]
  ------------------
34688|  1.10k|        seenadigit = 1;
34689|  1.10k|        str++;
34690|  1.10k|    }
34691|       |    /* Parse significant digits */
34692|  15.0k|    while (str < end) {
  ------------------
  |  Branch (34692:12): [True: 12.3k, False: 2.68k]
  ------------------
34693|  12.3k|        if (*str == '_') {
  ------------------
  |  Branch (34693:13): [True: 602, False: 11.7k]
  ------------------
34694|    602|            if (!seenadigit) return 0;
  ------------------
  |  Branch (34694:17): [True: 124, False: 478]
  ------------------
34695|  11.7k|        } else {
34696|  11.7k|            int digit = digit_lookup[*str & 0x7F];
34697|  11.7k|            if (*str > 127 || digit >= base) return 0;
  ------------------
  |  Branch (34697:17): [True: 48, False: 11.6k]
  |  Branch (34697:31): [True: 265, False: 11.4k]
  ------------------
34698|  11.4k|            if (accum > (UINT64_MAX - digit) / base) return 0;
  ------------------
  |  Branch (34698:17): [True: 67, False: 11.3k]
  ------------------
34699|  11.3k|            accum = accum * base + digit;
34700|  11.3k|            seenadigit = 1;
34701|  11.3k|        }
34702|  11.8k|        str++;
34703|  11.8k|    }
34704|       |
34705|  2.68k|    if (!seenadigit) return 0;
  ------------------
  |  Branch (34705:9): [True: 168, False: 2.52k]
  ------------------
34706|  2.52k|    *out = accum;
34707|  2.52k|    return 1;
34708|  2.68k|}
janet.c:janet_symcache_findmem:
35180|  45.1M|    int *success) {
35181|  45.1M|    uint32_t bounds[4];
35182|  45.1M|    uint32_t i, j, index;
35183|  45.1M|    const uint8_t **firstEmpty = NULL;
35184|       |
35185|       |    /* We will search two ranges - index to the end,
35186|       |     * and 0 to the index. */
35187|  45.1M|    index = (uint32_t)hash & (janet_vm.cache_capacity - 1);
35188|  45.1M|    bounds[0] = index;
35189|  45.1M|    bounds[1] = janet_vm.cache_capacity;
35190|  45.1M|    bounds[2] = 0;
35191|  45.1M|    bounds[3] = index;
35192|  45.1M|    for (j = 0; j < 4; j += 2)
  ------------------
  |  Branch (35192:17): [True: 45.1M, False: 0]
  ------------------
35193|  70.0M|        for (i = bounds[j]; i < bounds[j + 1]; ++i) {
  ------------------
  |  Branch (35193:29): [True: 69.9M, False: 28.3k]
  ------------------
35194|  69.9M|            const uint8_t *test = janet_vm.cache[i];
35195|       |            /* Check empty spots */
35196|  69.9M|            if (NULL == test) {
  ------------------
  |  Branch (35196:17): [True: 25.0M, False: 44.9M]
  ------------------
35197|  25.0M|                if (NULL == firstEmpty)
  ------------------
  |  Branch (35197:21): [True: 25.0M, False: 0]
  ------------------
35198|  25.0M|                    firstEmpty = janet_vm.cache + i;
35199|  25.0M|                goto notfound;
35200|  25.0M|            }
35201|       |            /* Check for marked deleted */
35202|  44.9M|            if (JANET_SYMCACHE_DELETED == test) {
  ------------------
  |  Branch (35202:17): [True: 7.12k, False: 44.9M]
  ------------------
35203|  7.12k|                if (firstEmpty == NULL)
  ------------------
  |  Branch (35203:21): [True: 7.08k, False: 38]
  ------------------
35204|  7.08k|                    firstEmpty = janet_vm.cache + i;
35205|  7.12k|                continue;
35206|  7.12k|            }
35207|  44.9M|            if (janet_string_equalconst(test, str, len, hash)) {
  ------------------
  |  Branch (35207:17): [True: 20.0M, False: 24.8M]
  ------------------
35208|       |                /* Replace first deleted */
35209|  20.0M|                *success = 1;
35210|  20.0M|                if (firstEmpty != NULL) {
  ------------------
  |  Branch (35210:21): [True: 7.08k, False: 20.0M]
  ------------------
35211|  7.08k|                    *firstEmpty = test;
35212|  7.08k|                    janet_vm.cache[i] = JANET_SYMCACHE_DELETED;
35213|  7.08k|                    return firstEmpty;
35214|  7.08k|                }
35215|  20.0M|                return janet_vm.cache + i;
35216|  20.0M|            }
35217|  44.9M|        }
35218|  25.0M|notfound:
35219|  25.0M|    *success = 0;
35220|  25.0M|    janet_assert(firstEmpty != NULL, "symcache failed to get memory");
  ------------------
  |  |  389|  25.0M|#define janet_assert(c, m) do { \
  |  |  390|  25.0M|    if (!(c)) JANET_EXIT((m)); \
  |  |  ------------------
  |  |  |  |  378|      0|#define JANET_EXIT(m) do { \
  |  |  |  |  379|      0|    fprintf(stderr, "janet abort at %s:%d: %s\n",\
  |  |  |  |  380|      0|        __FILE__,\
  |  |  |  |  381|      0|        __LINE__,\
  |  |  |  |  382|      0|        (m));\
  |  |  |  |  383|      0|    abort();\
  |  |  |  |  384|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (384:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (390:9): [True: 0, False: 25.0M]
  |  |  ------------------
  |  |  391|  25.0M|} while (0)
  |  |  ------------------
  |  |  |  Branch (391:10): [Folded, False: 25.0M]
  |  |  ------------------
  ------------------
35221|  25.0M|    return firstEmpty;
35222|  25.0M|}
janet.c:janet_symcache_put:
35258|  14.1M|static void janet_symcache_put(const uint8_t *x, const uint8_t **bucket) {
35259|  14.1M|    if ((janet_vm.cache_count + janet_vm.cache_deleted) * 2 > janet_vm.cache_capacity) {
  ------------------
  |  Branch (35259:9): [True: 14.1k, False: 14.1M]
  ------------------
35260|  14.1k|        int status;
35261|  14.1k|        janet_cache_resize(janet_tablen((2 * janet_vm.cache_count + 1)));
35262|  14.1k|        bucket = janet_symcache_find(x, &status);
  ------------------
  |  |35225|  14.1k|    janet_symcache_findmem((str), janet_string_length(str), janet_string_hash(str), (success))
  |  |  ------------------
  |  |  |  | 1813|  14.1k|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1812|  14.1k|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   janet_symcache_findmem((str), janet_string_length(str), janet_string_hash(str), (success))
  |  |  ------------------
  |  |  |  | 1814|  14.1k|#define janet_string_hash(s) (janet_string_head(s)->hash)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1812|  14.1k|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
35263|  14.1k|    }
35264|       |    /* Add x to the cache */
35265|  14.1M|    janet_vm.cache_count++;
35266|  14.1M|    *bucket = x;
35267|  14.1M|}
janet.c:janet_cache_resize:
35228|  14.1k|static void janet_cache_resize(uint32_t newCapacity) {
35229|  14.1k|    uint32_t i, oldCapacity;
35230|  14.1k|    const uint8_t **oldCache = janet_vm.cache;
35231|  14.1k|    const uint8_t **newCache = janet_calloc(1, (size_t) newCapacity * sizeof(const uint8_t *));
  ------------------
  |  | 2412|  14.1k|#define janet_calloc(X, Y) calloc((X), (Y))
  ------------------
35232|  14.1k|    if (newCache == NULL) {
  ------------------
  |  Branch (35232:9): [True: 0, False: 14.1k]
  ------------------
35233|      0|        JANET_OUT_OF_MEMORY;
  ------------------
  |  |  419|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (419:122): [Folded, False: 0]
  |  |  ------------------
  ------------------
35234|      0|    }
35235|  14.1k|    oldCapacity = janet_vm.cache_capacity;
35236|  14.1k|    janet_vm.cache = newCache;
35237|  14.1k|    janet_vm.cache_capacity = newCapacity;
35238|  14.1k|    janet_vm.cache_deleted = 0;
35239|       |    /* Add all of the old cache entries back */
35240|  21.7M|    for (i = 0; i < oldCapacity; ++i) {
  ------------------
  |  Branch (35240:17): [True: 21.7M, False: 14.1k]
  ------------------
35241|  21.7M|        int status;
35242|  21.7M|        const uint8_t **bucket;
35243|  21.7M|        const uint8_t *x = oldCache[i];
35244|  21.7M|        if (x != NULL && x != JANET_SYMCACHE_DELETED) {
  ------------------
  |  Branch (35244:13): [True: 10.8M, False: 10.8M]
  |  Branch (35244:26): [True: 10.8M, False: 0]
  ------------------
35245|  10.8M|            bucket = janet_symcache_find(x, &status);
  ------------------
  |  |35225|  10.8M|    janet_symcache_findmem((str), janet_string_length(str), janet_string_hash(str), (success))
  |  |  ------------------
  |  |  |  | 1813|  10.8M|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1812|  10.8M|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   janet_symcache_findmem((str), janet_string_length(str), janet_string_hash(str), (success))
  |  |  ------------------
  |  |  |  | 1814|  10.8M|#define janet_string_hash(s) (janet_string_head(s)->hash)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1812|  10.8M|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
35246|  10.8M|            if (status || bucket == NULL) {
  ------------------
  |  Branch (35246:17): [True: 0, False: 10.8M]
  |  Branch (35246:27): [True: 0, False: 10.8M]
  ------------------
35247|       |                /* there was a problem with the algorithm. */
35248|      0|                break;
35249|      0|            }
35250|  10.8M|            *bucket = x;
35251|  10.8M|        }
35252|  21.7M|    }
35253|       |    /* Free the old cache */
35254|  14.1k|    janet_free((void *)oldCache);
  ------------------
  |  | 2415|  14.1k|#define janet_free(X) free((X))
  ------------------
35255|  14.1k|}
janet.c:janet_table_init_impl:
35399|  23.9M|static JanetTable *janet_table_init_impl(JanetTable *table, int32_t capacity, int stackalloc) {
35400|  23.9M|    JanetKV *data;
35401|  23.9M|    capacity = janet_tablen(capacity);
35402|  23.9M|    if (stackalloc) table->gc.flags = JANET_TABLE_FLAG_STACK;
  ------------------
  |  |35385|  18.7M|#define JANET_TABLE_FLAG_STACK 0x10000
  ------------------
  |  Branch (35402:9): [True: 18.7M, False: 5.21M]
  ------------------
35403|  23.9M|    if (capacity) {
  ------------------
  |  Branch (35403:9): [True: 23.9M, False: 0]
  ------------------
35404|  23.9M|        if (stackalloc) {
  ------------------
  |  Branch (35404:13): [True: 18.7M, False: 5.21M]
  ------------------
35405|  18.7M|            data = janet_memalloc_empty_local(capacity);
35406|  18.7M|        } else {
35407|  5.21M|            data = (JanetKV *) janet_memalloc_empty(capacity);
35408|  5.21M|            if (NULL == data) {
  ------------------
  |  Branch (35408:17): [True: 0, False: 5.21M]
  ------------------
35409|      0|                JANET_OUT_OF_MEMORY;
  ------------------
  |  |  419|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (419:122): [Folded, False: 0]
  |  |  ------------------
  ------------------
35410|      0|            }
35411|  5.21M|        }
35412|  23.9M|        table->data = data;
35413|  23.9M|        table->capacity = capacity;
35414|  23.9M|    } else {
35415|      0|        table->data = NULL;
35416|      0|        table->capacity = 0;
35417|      0|    }
35418|  23.9M|    table->count = 0;
35419|  23.9M|    table->deleted = 0;
35420|       |    table->proto = NULL;
35421|  23.9M|    return table;
35422|  23.9M|}
janet.c:janet_memalloc_empty_local:
35387|  20.8M|static void *janet_memalloc_empty_local(int32_t count) {
35388|  20.8M|    int32_t i;
35389|  20.8M|    void *mem = janet_smalloc((size_t) count * sizeof(JanetKV));
35390|  20.8M|    JanetKV *mmem = (JanetKV *)mem;
35391|   345M|    for (i = 0; i < count; i++) {
  ------------------
  |  Branch (35391:17): [True: 324M, False: 20.8M]
  ------------------
35392|   324M|        JanetKV *kv = mmem + i;
35393|   324M|        kv->key = janet_wrap_nil();
  ------------------
  |  |  831|   324M|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|   324M|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|   324M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|   324M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
35394|   324M|        kv->value = janet_wrap_nil();
  ------------------
  |  |  831|   324M|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|   324M|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|   324M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|   324M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
35395|   324M|    }
35396|  20.8M|    return mem;
35397|  20.8M|}
janet.c:janet_table_rehash:
35472|  6.37M|static void janet_table_rehash(JanetTable *t, int32_t size) {
35473|  6.37M|    JanetKV *olddata = t->data;
35474|  6.37M|    JanetKV *newdata;
35475|  6.37M|    int islocal = t->gc.flags & JANET_TABLE_FLAG_STACK;
  ------------------
  |  |35385|  6.37M|#define JANET_TABLE_FLAG_STACK 0x10000
  ------------------
35476|  6.37M|    if (islocal) {
  ------------------
  |  Branch (35476:9): [True: 2.18M, False: 4.19M]
  ------------------
35477|  2.18M|        newdata = (JanetKV *) janet_memalloc_empty_local(size);
35478|  4.19M|    } else {
35479|  4.19M|        newdata = (JanetKV *) janet_memalloc_empty(size);
35480|  4.19M|        if (NULL == newdata) {
  ------------------
  |  Branch (35480:13): [True: 0, False: 4.19M]
  ------------------
35481|      0|            JANET_OUT_OF_MEMORY;
  ------------------
  |  |  419|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (419:122): [Folded, False: 0]
  |  |  ------------------
  ------------------
35482|      0|        }
35483|  4.19M|    }
35484|  6.37M|    int32_t oldcapacity = t->capacity;
35485|  6.37M|    t->data = newdata;
35486|  6.37M|    t->capacity = size;
35487|  6.37M|    t->deleted = 0;
35488|  87.5M|    for (int32_t i = 0; i < oldcapacity; i++) {
  ------------------
  |  Branch (35488:25): [True: 81.1M, False: 6.37M]
  ------------------
35489|  81.1M|        JanetKV *kv = olddata + i;
35490|  81.1M|        if (!janet_checktype(kv->key, JANET_NIL)) {
  ------------------
  |  |  806|  81.1M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 81.1M]
  |  |  ------------------
  |  |  807|  81.1M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  81.1M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  81.1M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  81.1M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  81.1M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  81.1M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (35490:13): [True: 29.2M, False: 51.8M]
  ------------------
35491|  29.2M|            JanetKV *newkv = janet_table_find(t, kv->key);
35492|  29.2M|            *newkv = *kv;
35493|  29.2M|        }
35494|  81.1M|    }
35495|  6.37M|    if (islocal) {
  ------------------
  |  Branch (35495:9): [True: 2.18M, False: 4.19M]
  ------------------
35496|  2.18M|        janet_sfree(olddata);
35497|  4.19M|    } else {
35498|  4.19M|        janet_free(olddata);
  ------------------
  |  | 2415|  4.19M|#define janet_free(X) free((X))
  ------------------
35499|  4.19M|    }
35500|  6.37M|}
janet.c:janet_check_pointer_align:
36624|  2.54M|static void janet_check_pointer_align(void *p) {
36625|  2.54M|    (void) p;
36626|       |#if defined(JANET_NANBOX_64) && JANET_NANBOX_64_POINTER_SHIFT != 0
36627|       |    union {
36628|       |        void *p;
36629|       |        uintptr_t u;
36630|       |    } un;
36631|       |    un.p = p;
36632|       |    janet_assert(!(un.u & (uintptr_t)((1 << JANET_NANBOX_64_POINTER_SHIFT) - 1)),
36633|       |                 "unaligned pointer wrap - cfunction pointers and abstract types must be aligned with this nanboxing configuration.");
36634|       |#endif
36635|  2.54M|}
janet.c:janet_equals_containers:
37534|  17.0M|static int janet_equals_containers(Janet x, Janet y) {
37535|  17.0M|    janet_vm.traversal = janet_vm.traversal_base;
37536|  17.0M|    do {
37537|  17.0M|        if (janet_type(x) != janet_type(y)) return 0;
  ------------------
  |  |  795|  17.0M|    (isnan((x).number) \
  |  |  796|  17.0M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|  17.0M|        : JANET_NUMBER)
  ------------------
                      if (janet_type(x) != janet_type(y)) return 0;
  ------------------
  |  |  795|  17.0M|    (isnan((x).number) \
  |  |  796|  17.0M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|  17.0M|        : JANET_NUMBER)
  ------------------
  |  Branch (37537:13): [True: 17.0M, False: 228]
  |  Branch (37537:13): [True: 82, False: 17.0M]
  |  Branch (37537:30): [True: 17.0M, False: 199]
  ------------------
37538|  17.0M|        switch (janet_type(x)) {
  ------------------
  |  |  795|  17.0M|    (isnan((x).number) \
  |  |  796|  17.0M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|  17.0M|        : JANET_NUMBER)
  ------------------
  |  Branch (37538:17): [True: 17.0M, False: 194]
  ------------------
37539|  2.16k|            default:
  ------------------
  |  Branch (37539:13): [True: 2.16k, False: 17.0M]
  ------------------
37540|  2.16k|                if (!janet_equals_leaf(x, y)) return 0;
  ------------------
  |  Branch (37540:21): [True: 140, False: 2.02k]
  ------------------
37541|  2.02k|                break;
37542|  12.3M|            case JANET_TUPLE: {
  ------------------
  |  Branch (37542:13): [True: 12.3M, False: 4.76M]
  ------------------
37543|  12.3M|                const Janet *t1 = janet_unwrap_tuple(x);
  ------------------
  |  |  858|  12.3M|#define janet_unwrap_tuple(x) ((JanetTuple)janet_nanbox_to_pointer(x))
  ------------------
37544|  12.3M|                const Janet *t2 = janet_unwrap_tuple(y);
  ------------------
  |  |  858|  12.3M|#define janet_unwrap_tuple(x) ((JanetTuple)janet_nanbox_to_pointer(x))
  ------------------
37545|  12.3M|                if (t1 == t2) break;
  ------------------
  |  Branch (37545:21): [True: 0, False: 12.3M]
  ------------------
37546|  12.3M|                if (JANET_TUPLE_FLAG_BRACKETCTOR & (janet_tuple_flag(t1) ^ janet_tuple_flag(t2))) return 0;
  ------------------
  |  | 1798|  12.3M|#define JANET_TUPLE_FLAG_BRACKETCTOR 0x10000
  ------------------
                              if (JANET_TUPLE_FLAG_BRACKETCTOR & (janet_tuple_flag(t1) ^ janet_tuple_flag(t2))) return 0;
  ------------------
  |  | 1806|  12.3M|#define janet_tuple_flag(t) (janet_tuple_head(t)->gc.flags)
  |  |  ------------------
  |  |  |  | 1800|  12.3M|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
                              if (JANET_TUPLE_FLAG_BRACKETCTOR & (janet_tuple_flag(t1) ^ janet_tuple_flag(t2))) return 0;
  ------------------
  |  | 1806|  12.3M|#define janet_tuple_flag(t) (janet_tuple_head(t)->gc.flags)
  |  |  ------------------
  |  |  |  | 1800|  12.3M|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (37546:21): [True: 1.88M, False: 10.4M]
  ------------------
37547|  10.4M|                if (janet_tuple_hash(t1) != janet_tuple_hash(t2)) return 0;
  ------------------
  |  | 1803|  10.4M|#define janet_tuple_hash(t) (janet_tuple_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1800|  10.4M|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
                              if (janet_tuple_hash(t1) != janet_tuple_hash(t2)) return 0;
  ------------------
  |  | 1803|  10.4M|#define janet_tuple_hash(t) (janet_tuple_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1800|  10.4M|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (37547:21): [True: 10.4M, False: 1.19k]
  ------------------
37548|  1.19k|                if (janet_tuple_length(t1) != janet_tuple_length(t2)) return 0;
  ------------------
  |  | 1802|  1.19k|#define janet_tuple_length(t) (janet_tuple_head(t)->length)
  |  |  ------------------
  |  |  |  | 1800|  1.19k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
                              if (janet_tuple_length(t1) != janet_tuple_length(t2)) return 0;
  ------------------
  |  | 1802|  1.19k|#define janet_tuple_length(t) (janet_tuple_head(t)->length)
  |  |  ------------------
  |  |  |  | 1800|  1.19k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (37548:21): [True: 0, False: 1.19k]
  ------------------
37549|  1.19k|                push_traversal_node(janet_tuple_head(t1), janet_tuple_head(t2), 0);
  ------------------
  |  | 1800|  1.19k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  ------------------
                              push_traversal_node(janet_tuple_head(t1), janet_tuple_head(t2), 0);
  ------------------
  |  | 1800|  1.19k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  ------------------
37550|  1.19k|                break;
37551|  1.19k|            }
37552|  4.76M|            case JANET_STRUCT: {
  ------------------
  |  Branch (37552:13): [True: 4.76M, False: 12.3M]
  ------------------
37553|  4.76M|                const JanetKV *s1 = janet_unwrap_struct(x);
  ------------------
  |  |  857|  4.76M|#define janet_unwrap_struct(x) ((JanetStruct)janet_nanbox_to_pointer(x))
  ------------------
37554|  4.76M|                const JanetKV *s2 = janet_unwrap_struct(y);
  ------------------
  |  |  857|  4.76M|#define janet_unwrap_struct(x) ((JanetStruct)janet_nanbox_to_pointer(x))
  ------------------
37555|  4.76M|                if (s1 == s2) break;
  ------------------
  |  Branch (37555:21): [True: 0, False: 4.76M]
  ------------------
37556|  4.76M|                if (janet_struct_hash(s1) != janet_struct_hash(s2)) return 0;
  ------------------
  |  | 1850|  4.76M|#define janet_struct_hash(t) (janet_struct_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1846|  4.76M|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
                              if (janet_struct_hash(s1) != janet_struct_hash(s2)) return 0;
  ------------------
  |  | 1850|  4.76M|#define janet_struct_hash(t) (janet_struct_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1846|  4.76M|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (37556:21): [True: 4.76M, False: 170]
  ------------------
37557|    170|                if (janet_struct_length(s1) != janet_struct_length(s2)) return 0;
  ------------------
  |  | 1848|    170|#define janet_struct_length(t) (janet_struct_head(t)->length)
  |  |  ------------------
  |  |  |  | 1846|    170|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
                              if (janet_struct_length(s1) != janet_struct_length(s2)) return 0;
  ------------------
  |  | 1848|    170|#define janet_struct_length(t) (janet_struct_head(t)->length)
  |  |  ------------------
  |  |  |  | 1846|    170|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (37557:21): [True: 0, False: 170]
  ------------------
37558|    170|                if (janet_struct_proto(s1) && !janet_struct_proto(s2)) return 0;
  ------------------
  |  | 1851|    340|#define janet_struct_proto(t) (janet_struct_head(t)->proto)
  |  |  ------------------
  |  |  |  | 1846|    170|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  |  |  |  Branch (1851:31): [True: 0, False: 170]
  |  |  ------------------
  ------------------
                              if (janet_struct_proto(s1) && !janet_struct_proto(s2)) return 0;
  ------------------
  |  | 1851|      0|#define janet_struct_proto(t) (janet_struct_head(t)->proto)
  |  |  ------------------
  |  |  |  | 1846|      0|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (37558:47): [True: 0, False: 0]
  ------------------
37559|    170|                if (!janet_struct_proto(s1) && janet_struct_proto(s2)) return 0;
  ------------------
  |  | 1851|    340|#define janet_struct_proto(t) (janet_struct_head(t)->proto)
  |  |  ------------------
  |  |  |  | 1846|    170|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
                              if (!janet_struct_proto(s1) && janet_struct_proto(s2)) return 0;
  ------------------
  |  | 1851|    170|#define janet_struct_proto(t) (janet_struct_head(t)->proto)
  |  |  ------------------
  |  |  |  | 1846|    170|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  |  |  |  Branch (1851:31): [True: 0, False: 170]
  |  |  ------------------
  ------------------
  |  Branch (37559:21): [True: 170, False: 0]
  ------------------
37560|    170|                push_traversal_node(janet_struct_head(s1), janet_struct_head(s2), 0);
  ------------------
  |  | 1846|    170|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  ------------------
                              push_traversal_node(janet_struct_head(s1), janet_struct_head(s2), 0);
  ------------------
  |  | 1846|    170|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  ------------------
37561|    170|                break;
37562|    170|            }
37563|  17.0M|        }
37564|  17.0M|    } while (!traversal_next(&x, &y));
  ------------------
  |  Branch (37564:14): [True: 2.68k, False: 705]
  ------------------
37565|    705|    return 1;
37566|  17.0M|}
janet.c:janet_equals_leaf:
37521|   674k|static int janet_equals_leaf(Janet x, Janet y) {
37522|   674k|    switch (janet_type(x)) {
  ------------------
  |  |  795|   674k|    (isnan((x).number) \
  |  |  796|   674k|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|   674k|        : JANET_NUMBER)
  ------------------
  |  Branch (37522:13): [True: 3.73k, False: 670k]
  ------------------
37523|   670k|        case JANET_NUMBER:
  ------------------
  |  Branch (37523:9): [True: 670k, False: 3.73k]
  ------------------
37524|   670k|            return janet_unwrap_number(x) == janet_unwrap_number(y);
  ------------------
  |  |  839|   670k|#define janet_unwrap_number(x) ((x).number)
  ------------------
                          return janet_unwrap_number(x) == janet_unwrap_number(y);
  ------------------
  |  |  839|   670k|#define janet_unwrap_number(x) ((x).number)
  ------------------
37525|  1.67k|        case JANET_STRING:
  ------------------
  |  Branch (37525:9): [True: 1.67k, False: 672k]
  ------------------
37526|  1.67k|            return janet_string_equal(janet_unwrap_string(x), janet_unwrap_string(y));
  ------------------
  |  |  863|  1.67k|#define janet_unwrap_string(x) ((JanetString)janet_nanbox_to_pointer(x))
  ------------------
                          return janet_string_equal(janet_unwrap_string(x), janet_unwrap_string(y));
  ------------------
  |  |  863|  1.67k|#define janet_unwrap_string(x) ((JanetString)janet_nanbox_to_pointer(x))
  ------------------
37527|    441|        case JANET_ABSTRACT:
  ------------------
  |  Branch (37527:9): [True: 441, False: 673k]
  ------------------
37528|    441|            return !janet_compare_abstract(janet_unwrap_abstract(x), janet_unwrap_abstract(y));
  ------------------
  |  |  866|    441|#define janet_unwrap_abstract(x) (janet_nanbox_to_pointer(x))
  ------------------
                          return !janet_compare_abstract(janet_unwrap_abstract(x), janet_unwrap_abstract(y));
  ------------------
  |  |  866|    441|#define janet_unwrap_abstract(x) (janet_nanbox_to_pointer(x))
  ------------------
37529|  1.61k|        default:
  ------------------
  |  Branch (37529:9): [True: 1.61k, False: 672k]
  ------------------
37530|  1.61k|            return janet_bitwise_same(x, y);
  ------------------
  |  |  401|  1.61k|#define janet_bitwise_same(x, y) (janet_u64(x) == janet_u64(y))
  |  |  ------------------
  |  |  |  |  788|  1.61k|#define janet_u64(x) ((x).u64)
  |  |  ------------------
  |  |               #define janet_bitwise_same(x, y) (janet_u64(x) == janet_u64(y))
  |  |  ------------------
  |  |  |  |  788|  1.61k|#define janet_u64(x) ((x).u64)
  |  |  ------------------
  ------------------
37531|   674k|    }
37532|   674k|}
janet.c:murmur64:
37574|  53.5M|static uint64_t murmur64(uint64_t h) {
37575|  53.5M|    h ^= h >> 33;
37576|  53.5M|    h *= 0xff51afd7ed558ccdUL;
37577|  53.5M|    h ^= h >> 33;
37578|  53.5M|    h *= 0xc4ceb9fe1a85ec53UL;
37579|  53.5M|    h ^= h >> 33;
37580|  53.5M|    return h;
37581|  53.5M|}
janet.c:janet_compare_abstract:
37507|  6.29k|static int janet_compare_abstract(JanetAbstract xx, JanetAbstract yy) {
37508|  6.29k|    if (xx == yy) return 0;
  ------------------
  |  Branch (37508:9): [True: 0, False: 6.29k]
  ------------------
37509|  6.29k|    const JanetAbstractType *xt = janet_abstract_type(xx);
  ------------------
  |  | 1899|  6.29k|#define janet_abstract_type(u) (janet_abstract_head(u)->type)
  |  |  ------------------
  |  |  |  | 1897|  6.29k|#define janet_abstract_head(u) ((JanetAbstractHead *)((char *)u - offsetof(JanetAbstractHead, data)))
  |  |  ------------------
  ------------------
37510|  6.29k|    const JanetAbstractType *yt = janet_abstract_type(yy);
  ------------------
  |  | 1899|  6.29k|#define janet_abstract_type(u) (janet_abstract_head(u)->type)
  |  |  ------------------
  |  |  |  | 1897|  6.29k|#define janet_abstract_head(u) ((JanetAbstractHead *)((char *)u - offsetof(JanetAbstractHead, data)))
  |  |  ------------------
  ------------------
37511|  6.29k|    if (xt != yt) {
  ------------------
  |  Branch (37511:9): [True: 2.06k, False: 4.23k]
  ------------------
37512|  2.06k|        return xt > yt ? 1 : -1;
  ------------------
  |  Branch (37512:16): [True: 23, False: 2.03k]
  ------------------
37513|  2.06k|    }
37514|  4.23k|    if (xt->compare == NULL) {
  ------------------
  |  Branch (37514:9): [True: 65, False: 4.17k]
  ------------------
37515|     65|        return xx > yy ? 1 : -1;
  ------------------
  |  Branch (37515:16): [True: 9, False: 56]
  ------------------
37516|     65|    }
37517|  4.17k|    return xt->compare(xx, yy);
37518|  4.23k|}
janet.c:push_traversal_node:
37305|   154k|static void push_traversal_node(void *lhs, void *rhs, int32_t index2) {
37306|   154k|    JanetTraversalNode node;
37307|   154k|    node.self = (JanetGCObject *) lhs;
37308|   154k|    node.other = (JanetGCObject *) rhs;
37309|   154k|    node.index = 0;
37310|   154k|    node.index2 = index2;
37311|   154k|    int is_new = janet_vm.traversal_base == NULL;
37312|   154k|    if (is_new || (janet_vm.traversal + 1 >= janet_vm.traversal_top)) {
  ------------------
  |  Branch (37312:9): [True: 507, False: 153k]
  |  Branch (37312:19): [True: 0, False: 153k]
  ------------------
37313|    507|        size_t oldsize = is_new ? 0 : (janet_vm.traversal - janet_vm.traversal_base);
  ------------------
  |  Branch (37313:26): [True: 507, False: 0]
  ------------------
37314|    507|        size_t newsize = 2 * oldsize + 1;
37315|    507|        if (newsize < 128) {
  ------------------
  |  Branch (37315:13): [True: 507, False: 0]
  ------------------
37316|    507|            newsize = 128;
37317|    507|        }
37318|    507|        JanetTraversalNode *tn = janet_realloc(janet_vm.traversal_base, newsize * sizeof(JanetTraversalNode));
  ------------------
  |  | 2409|    507|#define janet_realloc(X, Y) realloc((X), (Y))
  ------------------
37319|    507|        if (tn == NULL) {
  ------------------
  |  Branch (37319:13): [True: 0, False: 507]
  ------------------
37320|      0|            JANET_OUT_OF_MEMORY;
  ------------------
  |  |  419|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (419:122): [Folded, False: 0]
  |  |  ------------------
  ------------------
37321|      0|        }
37322|    507|        janet_vm.traversal_base = tn;
37323|    507|        janet_vm.traversal_top = janet_vm.traversal_base + newsize;
37324|    507|        janet_vm.traversal = janet_vm.traversal_base + oldsize;
37325|    507|    }
37326|   154k|    *(++janet_vm.traversal) = node;
37327|   154k|}
janet.c:traversal_next:
37337|   240k|static int traversal_next(Janet *x, Janet *y) {
37338|   240k|    JanetTraversalNode *t = janet_vm.traversal;
37339|   241k|    while (t && t > janet_vm.traversal_base) {
  ------------------
  |  Branch (37339:12): [True: 241k, False: 260]
  |  Branch (37339:17): [True: 239k, False: 1.45k]
  ------------------
37340|   239k|        JanetGCObject *self = t->self;
37341|   239k|        JanetTupleHead *tself = (JanetTupleHead *)self;
37342|   239k|        JanetStructHead *sself = (JanetStructHead *)self;
37343|   239k|        JanetGCObject *other = t->other;
37344|   239k|        JanetTupleHead *tother = (JanetTupleHead *)other;
37345|   239k|        JanetStructHead *sother = (JanetStructHead *)other;
37346|   239k|        if ((self->flags & JANET_MEM_TYPEBITS) == JANET_MEMORY_TUPLE) {
  ------------------
  |  |  652|   239k|#define JANET_MEM_TYPEBITS 0xFF
  ------------------
  |  Branch (37346:13): [True: 237k, False: 2.37k]
  ------------------
37347|       |            /* Node is a tuple at index t->index */
37348|   237k|            if (t->index < tself->length && t->index < tother->length) {
  ------------------
  |  Branch (37348:17): [True: 215k, False: 22.2k]
  |  Branch (37348:45): [True: 167k, False: 48.2k]
  ------------------
37349|   167k|                int32_t index = t->index++;
37350|   167k|                *x = tself->data[index];
37351|   167k|                *y = tother->data[index];
37352|   167k|                janet_vm.traversal = t;
37353|   167k|                return 0;
37354|   167k|            }
37355|  70.4k|            if (t->index2 && tself->length != tother->length) {
  ------------------
  |  Branch (37355:17): [True: 69.7k, False: 701]
  |  Branch (37355:30): [True: 69.5k, False: 233]
  ------------------
37356|  69.5k|                return tself->length > tother->length ? 3 : 1;
  ------------------
  |  Branch (37356:24): [True: 48.2k, False: 21.3k]
  ------------------
37357|  69.5k|            }
37358|  70.4k|        } else {
37359|       |            /* Node is a struct at index t->index: if t->index2 is true, we should return the values. */
37360|  2.37k|            if (t->index2) {
  ------------------
  |  Branch (37360:17): [True: 816, False: 1.56k]
  ------------------
37361|    816|                t->index2 = 0;
37362|    816|                int32_t index = t->index++;
37363|    816|                *x = sself->data[index].value;
37364|    816|                *y = sother->data[index].value;
37365|    816|                janet_vm.traversal = t;
37366|    816|                return 0;
37367|    816|            }
37368|  1.56k|            for (int32_t i = t->index; i < sself->capacity; i++) {
  ------------------
  |  Branch (37368:40): [True: 816, False: 746]
  ------------------
37369|    816|                t->index2 = 1;
37370|    816|                *x = sself->data[t->index].key;
37371|    816|                *y = sother->data[t->index].key;
37372|    816|                janet_vm.traversal = t;
37373|    816|                return 0;
37374|    816|            }
37375|       |            /* Traverse prototype */
37376|    746|            JanetStruct sproto = sself->proto;
37377|    746|            JanetStruct oproto = sother->proto;
37378|    746|            if (sproto && !oproto) return 3;
  ------------------
  |  Branch (37378:17): [True: 0, False: 746]
  |  Branch (37378:27): [True: 0, False: 0]
  ------------------
37379|    746|            if (!sproto && oproto) return 1;
  ------------------
  |  Branch (37379:17): [True: 746, False: 0]
  |  Branch (37379:28): [True: 0, False: 746]
  ------------------
37380|    746|            if (oproto && sproto) {
  ------------------
  |  Branch (37380:17): [True: 0, False: 746]
  |  Branch (37380:27): [True: 0, False: 0]
  ------------------
37381|      0|                *x = janet_wrap_struct(sproto);
  ------------------
  |  |  842|      0|#define janet_wrap_struct(s) janet_nanbox_wrap_c((s), JANET_STRUCT)
  |  |  ------------------
  |  |  |  |  828|      0|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
37382|      0|                *y = janet_wrap_struct(oproto);
  ------------------
  |  |  842|      0|#define janet_wrap_struct(s) janet_nanbox_wrap_c((s), JANET_STRUCT)
  |  |  ------------------
  |  |  |  |  828|      0|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
37383|      0|                janet_vm.traversal = t - 1;
37384|      0|                return 0;
37385|      0|            }
37386|    746|        }
37387|  1.68k|        t--;
37388|  1.68k|    }
37389|  1.71k|    janet_vm.traversal = t;
37390|  1.71k|    return 2;
37391|   240k|}

LLVMFuzzerTestOneInput:
    7|  7.06k|int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
    8|  7.06k|    if (size < 2 || size > JANET_PEG_FUZZ_MAX_INPUT)
  ------------------
  |  |    5|  7.06k|#define JANET_PEG_FUZZ_MAX_INPUT (1U << 20)
  ------------------
  |  Branch (8:9): [True: 1, False: 7.06k]
  |  Branch (8:21): [True: 0, False: 7.06k]
  ------------------
    9|      1|        return 0;
   10|       |
   11|       |    /* Byte 0 selects the split point for a Janet PEG pattern and subject. */
   12|  7.06k|    size_t patlen = (size_t)data[0] % (size - 1);
   13|  7.06k|    const uint8_t *patsrc = data + 1;
   14|  7.06k|    const uint8_t *text = data + 1 + patlen;
   15|  7.06k|    size_t textlen = size - 1 - patlen;
   16|       |
   17|  7.06k|    janet_init();
   18|       |
   19|  7.06k|    JanetParser parser;
   20|  7.06k|    janet_parser_init(&parser);
   21|  7.06k|    Janet matchfn = janet_resolve_core("peg/match");
   22|  7.06k|    if (janet_checktype(matchfn, JANET_CFUNCTION)) {
  ------------------
  |  |  806|  7.06k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 7.06k, False: 0]
  |  |  |  Branch (806:6): [Folded, False: 7.06k]
  |  |  ------------------
  |  |  807|  7.06k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  7.06k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  7.06k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  7.06k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  7.06k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  7.06k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   23|  7.06k|        JanetCFunction cfun = janet_unwrap_cfunction(matchfn);
  ------------------
  |  |  869|  7.06k|#define janet_unwrap_cfunction(x) ((JanetCFunction)janet_nanbox_to_pointer(x))
  ------------------
   24|       |
   25|       |        /* Stop after parser errors: consuming again would panic. */
   26|   253k|        for (size_t i = 0; i < patlen; i++) {
  ------------------
  |  Branch (26:28): [True: 247k, False: 6.54k]
  ------------------
   27|   247k|            janet_parser_consume(&parser, patsrc[i]);
   28|   247k|            if (janet_parser_status(&parser) == JANET_PARSE_ERROR)
  ------------------
  |  Branch (28:17): [True: 520, False: 246k]
  ------------------
   29|    520|                break;
   30|   247k|        }
   31|  7.06k|        if (janet_parser_status(&parser) != JANET_PARSE_ERROR)
  ------------------
  |  Branch (31:13): [True: 6.54k, False: 520]
  ------------------
   32|  6.54k|            janet_parser_eof(&parser);
   33|       |
   34|  7.06k|        if (janet_parser_status(&parser) != JANET_PARSE_ERROR &&
  ------------------
  |  Branch (34:13): [True: 5.16k, False: 1.89k]
  ------------------
   35|  5.16k|                janet_parser_has_more(&parser)) {
  ------------------
  |  Branch (35:17): [True: 5.06k, False: 108]
  ------------------
   36|  5.06k|            Janet pattern = janet_parser_produce(&parser);
   37|  5.06k|            JanetTryState tstate;
   38|  5.06k|            if (janet_try(&tstate) == JANET_SIGNAL_OK) {
  ------------------
  |  | 1981|  5.06k|#define janet_try(state) (janet_try_init(state), (JanetSignal) setjmp((state)->buf))
  ------------------
  |  Branch (38:17): [True: 5.06k, False: 0]
  ------------------
   39|  5.06k|                Janet argv[2];
   40|  5.06k|                argv[0] = pattern;
   41|  5.06k|                argv[1] = janet_stringv(text, (int32_t)textlen);
  ------------------
  |  | 1827|  5.06k|#define janet_stringv(str, len) janet_wrap_string(janet_string((str), (len)))
  |  |  ------------------
  |  |  |  |  848|  5.06k|#define janet_wrap_string(s) janet_nanbox_wrap_c((s), JANET_STRING)
  |  |  |  |  ------------------
  |  |  |  |  |  |  828|  5.06k|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  793|  5.06k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  792|  5.06k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   42|  5.06k|                cfun(2, argv);
   43|  5.06k|            }
   44|  5.06k|            janet_restore(&tstate);
   45|  5.06k|        }
   46|  7.06k|    }
   47|       |
   48|  7.06k|    janet_parser_deinit(&parser);
   49|  7.06k|    janet_deinit();
   50|  7.06k|    return 0;
   51|  7.06k|}

