janet_abstract_begin:
 1389|  47.5k|void *janet_abstract_begin(const JanetAbstractType *atype, size_t size) {
 1390|  47.5k|    JanetAbstractHead *header = janet_gcalloc(JANET_MEMORY_NONE,
 1391|  47.5k|        sizeof(JanetAbstractHead) + size);
 1392|  47.5k|    header->size = size;
 1393|  47.5k|    header->type = atype;
 1394|  47.5k|    return (void *) & (header->data);
 1395|  47.5k|}
janet_abstract_end:
 1397|  47.5k|void *janet_abstract_end(void *x) {
 1398|  47.5k|    janet_gc_settype((void *)(janet_abstract_head(x)), JANET_MEMORY_ABSTRACT);
  ------------------
  |  |  679|  47.5k|#define janet_gc_settype(m, t) ((janet_gc_header(m)->flags |= (0xFF & (t))))
  |  |  ------------------
  |  |  |  |  673|  47.5k|#define janet_gc_header(mem) ((JanetGCObject *)(mem))
  |  |  ------------------
  ------------------
 1399|  47.5k|    return x;
 1400|  47.5k|}
janet_abstract:
 1402|  47.5k|void *janet_abstract(const JanetAbstractType *atype, size_t size) {
 1403|  47.5k|    return janet_abstract_end(janet_abstract_begin(atype, size));
 1404|  47.5k|}
janet_array:
 1621|  22.4k|JanetArray *janet_array(int32_t capacity) {
 1622|  22.4k|    JanetArray *array = janet_gcalloc(JANET_MEMORY_ARRAY, sizeof(JanetArray));
 1623|  22.4k|    janet_array_impl(array, capacity);
 1624|  22.4k|    return array;
 1625|  22.4k|}
janet_array_ensure:
 1648|  14.5M|void janet_array_ensure(JanetArray *array, int32_t capacity, int32_t growth) {
 1649|  14.5M|    Janet *newData;
 1650|  14.5M|    Janet *old = array->data;
 1651|  14.5M|    if (capacity <= array->capacity) return;
  ------------------
  |  Branch (1651:9): [True: 14.5M, False: 3.16k]
  ------------------
 1652|  3.16k|    int64_t new_capacity = ((int64_t) capacity) * growth;
 1653|  3.16k|    if (new_capacity > INT32_MAX) new_capacity = INT32_MAX;
  ------------------
  |  Branch (1653:9): [True: 0, False: 3.16k]
  ------------------
 1654|  3.16k|    capacity = (int32_t) new_capacity;
 1655|  3.16k|    newData = janet_realloc(old, capacity * sizeof(Janet));
  ------------------
  |  | 2409|  3.16k|#define janet_realloc(X, Y) realloc((X), (Y))
  ------------------
 1656|  3.16k|    if (NULL == newData) {
  ------------------
  |  Branch (1656:9): [True: 0, False: 3.16k]
  ------------------
 1657|      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]
  |  |  ------------------
  ------------------
 1658|      0|    }
 1659|  3.16k|    janet_vm.next_collection += (capacity - array->capacity) * sizeof(Janet);
 1660|  3.16k|    array->data = newData;
 1661|  3.16k|    array->capacity = capacity;
 1662|  3.16k|}
janet_array_push:
 1679|  14.5M|void janet_array_push(JanetArray *array, Janet x) {
 1680|  14.5M|    if (array->count == INT32_MAX) {
  ------------------
  |  Branch (1680:9): [True: 0, False: 14.5M]
  ------------------
 1681|      0|        janet_panic("array overflow");
 1682|      0|    }
 1683|  14.5M|    int32_t newcount = array->count + 1;
 1684|  14.5M|    janet_array_ensure(array, newcount, 2);
 1685|  14.5M|    array->data[array->count] = x;
 1686|  14.5M|    array->count = newcount;
 1687|  14.5M|}
janet_lib_array:
 1978|  6.14k|void janet_lib_array(JanetTable *env) {
 1979|  6.14k|    JanetRegExt array_cfuns[] = {
 1980|  6.14k|        JANET_CORE_REG("array/new", cfun_array_new),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 1981|  6.14k|        JANET_CORE_REG("array/weak", cfun_array_weak),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 1982|  6.14k|        JANET_CORE_REG("array/new-filled", cfun_array_new_filled),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 1983|  6.14k|        JANET_CORE_REG("array/fill", cfun_array_fill),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 1984|  6.14k|        JANET_CORE_REG("array/pop", cfun_array_pop),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 1985|  6.14k|        JANET_CORE_REG("array/peek", cfun_array_peek),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 1986|  6.14k|        JANET_CORE_REG("array/push", cfun_array_push),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 1987|  6.14k|        JANET_CORE_REG("array/ensure", cfun_array_ensure),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 1988|  6.14k|        JANET_CORE_REG("array/slice", cfun_array_slice),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 1989|  6.14k|        JANET_CORE_REG("array/concat", cfun_array_concat),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 1990|  6.14k|        JANET_CORE_REG("array/insert", cfun_array_insert),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 1991|  6.14k|        JANET_CORE_REG("array/remove", cfun_array_remove),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 1992|  6.14k|        JANET_CORE_REG("array/trim", cfun_array_trim),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 1993|  6.14k|        JANET_CORE_REG("array/clear", cfun_array_clear),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 1994|  6.14k|        JANET_CORE_REG("array/join", cfun_array_join),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 1995|  6.14k|        JANET_REG_END
  ------------------
  |  | 2110|  6.14k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
 1996|  6.14k|    };
 1997|       |    janet_core_cfuns_ext(env, NULL, array_cfuns);
 1998|  6.14k|}
janet_lib_asm:
 3143|  6.14k|void janet_lib_asm(JanetTable *env) {
 3144|  6.14k|    JanetRegExt asm_cfuns[] = {
 3145|  6.14k|        JANET_CORE_REG("asm", cfun_asm),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3146|  6.14k|        JANET_CORE_REG("disasm", cfun_disasm),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3147|  6.14k|        JANET_REG_END
  ------------------
  |  | 2110|  6.14k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
 3148|  6.14k|    };
 3149|       |    janet_core_cfuns_ext(env, NULL, asm_cfuns);
 3150|  6.14k|}
janet_buffer_init:
 3211|  18.8M|JanetBuffer *janet_buffer_init(JanetBuffer *buffer, int32_t capacity) {
 3212|  18.8M|    janet_buffer_init_impl(buffer, capacity);
 3213|  18.8M|    buffer->gc.data.next = NULL;
 3214|  18.8M|    buffer->gc.flags = JANET_MEM_DISABLED;
  ------------------
  |  |  677|  18.8M|#define JANET_MEM_DISABLED 0x200
  ------------------
 3215|  18.8M|    return buffer;
 3216|  18.8M|}
janet_buffer_deinit:
 3231|  18.8M|void janet_buffer_deinit(JanetBuffer *buffer) {
 3232|  18.8M|    if (!(buffer->gc.flags & JANET_BUFFER_FLAG_NO_REALLOC)) {
  ------------------
  |  | 1780|  18.8M|#define JANET_BUFFER_FLAG_NO_REALLOC 0x10000
  ------------------
  |  Branch (3232:9): [True: 18.8M, False: 0]
  ------------------
 3233|  18.8M|        janet_free(buffer->data);
  ------------------
  |  | 2415|  18.8M|#define janet_free(X) free((X))
  ------------------
 3234|       |        buffer->data = NULL;
 3235|  18.8M|    }
 3236|  18.8M|}
janet_buffer:
 3239|  11.8k|JanetBuffer *janet_buffer(int32_t capacity) {
 3240|  11.8k|    JanetBuffer *buffer = janet_gcalloc(JANET_MEMORY_BUFFER, sizeof(JanetBuffer));
 3241|  11.8k|    return janet_buffer_init_impl(buffer, capacity);
 3242|  11.8k|}
janet_buffer_extra:
 3275|   410M|void janet_buffer_extra(JanetBuffer *buffer, int32_t n) {
 3276|       |    /* Check for buffer overflow */
 3277|   410M|    if ((int64_t)n + buffer->count > INT32_MAX) {
  ------------------
  |  Branch (3277:9): [True: 0, False: 410M]
  ------------------
 3278|      0|        janet_panic("buffer overflow");
 3279|      0|    }
 3280|   410M|    int32_t new_size = buffer->count + n;
 3281|   410M|    if (new_size > buffer->capacity) {
  ------------------
  |  Branch (3281:9): [True: 13.5M, False: 397M]
  ------------------
 3282|  13.5M|        janet_buffer_can_realloc(buffer);
 3283|  13.5M|        int32_t new_capacity = (new_size > (INT32_MAX / 2)) ? INT32_MAX : (new_size * 2);
  ------------------
  |  Branch (3283:32): [True: 0, False: 13.5M]
  ------------------
 3284|  13.5M|        uint8_t *new_data = janet_realloc(buffer->data, new_capacity * sizeof(uint8_t));
  ------------------
  |  | 2409|  13.5M|#define janet_realloc(X, Y) realloc((X), (Y))
  ------------------
 3285|  13.5M|        janet_gcpressure(new_capacity - buffer->capacity);
 3286|  13.5M|        if (NULL == new_data) {
  ------------------
  |  Branch (3286:13): [True: 0, False: 13.5M]
  ------------------
 3287|      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]
  |  |  ------------------
  ------------------
 3288|      0|        }
 3289|  13.5M|        buffer->data = new_data;
 3290|  13.5M|        buffer->capacity = new_capacity;
 3291|  13.5M|    }
 3292|   410M|}
janet_buffer_push_cstring:
 3295|  13.3M|void janet_buffer_push_cstring(JanetBuffer *buffer, const char *cstring) {
 3296|  13.3M|    int32_t len = (int32_t) strlen(cstring);
 3297|  13.3M|    janet_buffer_push_bytes(buffer, (const uint8_t *) cstring, len);
 3298|  13.3M|}
janet_buffer_push_bytes:
 3301|  79.2M|void janet_buffer_push_bytes(JanetBuffer *buffer, const uint8_t *string, int32_t length) {
 3302|  79.2M|    if (0 == length) return;
  ------------------
  |  Branch (3302:9): [True: 1.35M, False: 77.9M]
  ------------------
 3303|  77.9M|    janet_buffer_extra(buffer, length);
 3304|  77.9M|    memcpy(buffer->data + buffer->count, string, length);
 3305|  77.9M|    buffer->count += length;
 3306|  77.9M|}
janet_buffer_push_u8:
 3313|   322M|void janet_buffer_push_u8(JanetBuffer *buffer, uint8_t byte) {
 3314|   322M|    janet_buffer_extra(buffer, 1);
 3315|   322M|    buffer->data[buffer->count] = byte;
 3316|   322M|    buffer->count++;
 3317|   322M|}
janet_lib_buffer:
 3837|  6.14k|void janet_lib_buffer(JanetTable *env) {
 3838|  6.14k|    JanetRegExt buffer_cfuns[] = {
 3839|  6.14k|        JANET_CORE_REG("buffer/new", cfun_buffer_new),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3840|  6.14k|        JANET_CORE_REG("buffer/new-filled", cfun_buffer_new_filled),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3841|  6.14k|        JANET_CORE_REG("buffer/from-bytes", cfun_buffer_frombytes),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3842|  6.14k|        JANET_CORE_REG("buffer/fill", cfun_buffer_fill),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3843|  6.14k|        JANET_CORE_REG("buffer/trim", cfun_buffer_trim),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3844|  6.14k|        JANET_CORE_REG("buffer/push-byte", cfun_buffer_u8),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3845|  6.14k|        JANET_CORE_REG("buffer/push-word", cfun_buffer_word),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3846|  6.14k|        JANET_CORE_REG("buffer/push-string", cfun_buffer_chars),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3847|  6.14k|        JANET_CORE_REG("buffer/push-uint16", cfun_buffer_push_uint16),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3848|  6.14k|        JANET_CORE_REG("buffer/push-uint32", cfun_buffer_push_uint32),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3849|  6.14k|        JANET_CORE_REG("buffer/push-uint64", cfun_buffer_push_uint64),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3850|  6.14k|        JANET_CORE_REG("buffer/push-float32", cfun_buffer_push_float32),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3851|  6.14k|        JANET_CORE_REG("buffer/push-float64", cfun_buffer_push_float64),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3852|  6.14k|        JANET_CORE_REG("buffer/push", cfun_buffer_push),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3853|  6.14k|        JANET_CORE_REG("buffer/push-at", cfun_buffer_push_at),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3854|  6.14k|        JANET_CORE_REG("buffer/popn", cfun_buffer_popn),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3855|  6.14k|        JANET_CORE_REG("buffer/clear", cfun_buffer_clear),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3856|  6.14k|        JANET_CORE_REG("buffer/slice", cfun_buffer_slice),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3857|  6.14k|        JANET_CORE_REG("buffer/bit-set", cfun_buffer_bitset),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3858|  6.14k|        JANET_CORE_REG("buffer/bit-clear", cfun_buffer_bitclear),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3859|  6.14k|        JANET_CORE_REG("buffer/bit", cfun_buffer_bitget),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3860|  6.14k|        JANET_CORE_REG("buffer/bit-toggle", cfun_buffer_bittoggle),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3861|  6.14k|        JANET_CORE_REG("buffer/blit", cfun_buffer_blit),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3862|  6.14k|        JANET_CORE_REG("buffer/format", cfun_buffer_format),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3863|  6.14k|        JANET_CORE_REG("buffer/format-at", cfun_buffer_format_at),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 3864|  6.14k|        JANET_REG_END
  ------------------
  |  | 2110|  6.14k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
 3865|  6.14k|    };
 3866|       |    janet_core_cfuns_ext(env, NULL, buffer_cfuns);
 3867|  6.14k|}
janet_verify:
 5644|  3.28M|int janet_verify(JanetFuncDef *def) {
 5645|  3.28M|    int vargs = !!(def->flags & JANET_FUNCDEF_FLAG_VARARG);
  ------------------
  |  | 1097|  3.28M|#define JANET_FUNCDEF_FLAG_VARARG 0x10000
  ------------------
 5646|  3.28M|    int32_t i;
 5647|  3.28M|    int32_t maxslot = def->arity + vargs;
 5648|  3.28M|    int32_t sc = def->slotcount;
 5649|       |
 5650|  3.28M|    if (def->environments_length > 256) return 15;
  ------------------
  |  Branch (5650:9): [True: 0, False: 3.28M]
  ------------------
 5651|  3.28M|    if (def->bytecode_length == 0) return 1;
  ------------------
  |  Branch (5651:9): [True: 0, False: 3.28M]
  ------------------
 5652|       |
 5653|  3.28M|    if (maxslot > sc) return 2;
  ------------------
  |  Branch (5653:9): [True: 0, False: 3.28M]
  ------------------
 5654|       |
 5655|       |    /* Verify each instruction */
 5656|  94.0M|    for (i = 0; i < def->bytecode_length; i++) {
  ------------------
  |  Branch (5656:17): [True: 90.7M, False: 3.28M]
  ------------------
 5657|  90.7M|        uint32_t instr = def->bytecode[i];
 5658|       |        /* Check for invalid instructions */
 5659|  90.7M|        if ((instr & 0x7F) >= JOP_INSTRUCTION_COUNT) {
  ------------------
  |  Branch (5659:13): [True: 0, False: 90.7M]
  ------------------
 5660|      0|            return 3;
 5661|      0|        }
 5662|  90.7M|        enum JanetInstructionType type = janet_instructions[instr & 0x7F];
 5663|  90.7M|        switch (type) {
  ------------------
  |  Branch (5663:17): [True: 90.7M, False: 0]
  ------------------
 5664|   472k|            case JINT_0:
  ------------------
  |  Branch (5664:13): [True: 472k, False: 90.3M]
  ------------------
 5665|   472k|                continue;
 5666|  17.4M|            case JINT_S: {
  ------------------
  |  Branch (5666:13): [True: 17.4M, False: 73.3M]
  ------------------
 5667|  17.4M|                if ((int32_t)(instr >> 8) >= sc) return 4;
  ------------------
  |  Branch (5667:21): [True: 0, False: 17.4M]
  ------------------
 5668|  17.4M|                continue;
 5669|  17.4M|            }
 5670|  17.4M|            case JINT_SI:
  ------------------
  |  Branch (5670:13): [True: 2.08M, False: 88.7M]
  ------------------
 5671|  2.08M|            case JINT_SU:
  ------------------
  |  Branch (5671:13): [True: 0, False: 90.7M]
  ------------------
 5672|  2.08M|            case JINT_ST: {
  ------------------
  |  Branch (5672:13): [True: 0, False: 90.7M]
  ------------------
 5673|  2.08M|                if ((int32_t)((instr >> 8) & 0xFF) >= sc) return 4;
  ------------------
  |  Branch (5673:21): [True: 0, False: 2.08M]
  ------------------
 5674|  2.08M|                continue;
 5675|  2.08M|            }
 5676|  3.82M|            case JINT_L: {
  ------------------
  |  Branch (5676:13): [True: 3.82M, False: 86.9M]
  ------------------
 5677|  3.82M|                int32_t jumpdest = i + (((int32_t)instr) >> 8);
 5678|  3.82M|                if (jumpdest < 0 || jumpdest >= def->bytecode_length) return 5;
  ------------------
  |  Branch (5678:21): [True: 0, False: 3.82M]
  |  Branch (5678:37): [True: 0, False: 3.82M]
  ------------------
 5679|  3.82M|                continue;
 5680|  3.82M|            }
 5681|  24.2M|            case JINT_SS: {
  ------------------
  |  Branch (5681:13): [True: 24.2M, False: 66.5M]
  ------------------
 5682|  24.2M|                if ((int32_t)((instr >> 8) & 0xFF) >= sc ||
  ------------------
  |  Branch (5682:21): [True: 0, False: 24.2M]
  ------------------
 5683|  24.2M|                        (int32_t)(instr >> 16) >= sc) return 4;
  ------------------
  |  Branch (5683:25): [True: 0, False: 24.2M]
  ------------------
 5684|  24.2M|                continue;
 5685|  24.2M|            }
 5686|  24.2M|            case JINT_SSI:
  ------------------
  |  Branch (5686:13): [True: 1.60M, False: 89.1M]
  ------------------
 5687|  2.55M|            case JINT_SSU: {
  ------------------
  |  Branch (5687:13): [True: 952k, False: 89.8M]
  ------------------
 5688|  2.55M|                if ((int32_t)((instr >> 8) & 0xFF) >= sc ||
  ------------------
  |  Branch (5688:21): [True: 0, False: 2.55M]
  ------------------
 5689|  2.55M|                        (int32_t)((instr >> 16) & 0xFF) >= sc) return 4;
  ------------------
  |  Branch (5689:25): [True: 0, False: 2.55M]
  ------------------
 5690|  2.55M|                continue;
 5691|  2.55M|            }
 5692|  6.63M|            case JINT_SL: {
  ------------------
  |  Branch (5692:13): [True: 6.63M, False: 84.1M]
  ------------------
 5693|  6.63M|                int32_t jumpdest = i + (((int32_t)instr) >> 16);
 5694|  6.63M|                if ((int32_t)((instr >> 8) & 0xFF) >= sc) return 4;
  ------------------
  |  Branch (5694:21): [True: 0, False: 6.63M]
  ------------------
 5695|  6.63M|                if (jumpdest < 0 || jumpdest >= def->bytecode_length) return 5;
  ------------------
  |  Branch (5695:21): [True: 0, False: 6.63M]
  |  Branch (5695:37): [True: 0, False: 6.63M]
  ------------------
 5696|  6.63M|                continue;
 5697|  6.63M|            }
 5698|  12.2M|            case JINT_SSS: {
  ------------------
  |  Branch (5698:13): [True: 12.2M, False: 78.5M]
  ------------------
 5699|  12.2M|                if (((int32_t)(instr >> 8) & 0xFF) >= sc ||
  ------------------
  |  Branch (5699:21): [True: 0, False: 12.2M]
  ------------------
 5700|  12.2M|                        ((int32_t)(instr >> 16) & 0xFF) >= sc ||
  ------------------
  |  Branch (5700:25): [True: 0, False: 12.2M]
  ------------------
 5701|  12.2M|                        ((int32_t)(instr >> 24) & 0xFF) >= sc) return 4;
  ------------------
  |  Branch (5701:25): [True: 0, False: 12.2M]
  ------------------
 5702|  12.2M|                continue;
 5703|  12.2M|            }
 5704|  12.2M|            case JINT_SD: {
  ------------------
  |  Branch (5704:13): [True: 958k, False: 89.8M]
  ------------------
 5705|   958k|                if ((int32_t)((instr >> 8) & 0xFF) >= sc) return 4;
  ------------------
  |  Branch (5705:21): [True: 0, False: 958k]
  ------------------
 5706|   958k|                if ((int32_t)(instr >> 16) >= def->defs_length) return 6;
  ------------------
  |  Branch (5706:21): [True: 0, False: 958k]
  ------------------
 5707|   958k|                continue;
 5708|   958k|            }
 5709|  16.5M|            case JINT_SC: {
  ------------------
  |  Branch (5709:13): [True: 16.5M, False: 74.2M]
  ------------------
 5710|  16.5M|                if ((int32_t)((instr >> 8) & 0xFF) >= sc) return 4;
  ------------------
  |  Branch (5710:21): [True: 0, False: 16.5M]
  ------------------
 5711|  16.5M|                if ((int32_t)(instr >> 16) >= def->constants_length) return 7;
  ------------------
  |  Branch (5711:21): [True: 0, False: 16.5M]
  ------------------
 5712|  16.5M|                continue;
 5713|  16.5M|            }
 5714|  16.5M|            case JINT_SES: {
  ------------------
  |  Branch (5714:13): [True: 3.74M, False: 87.0M]
  ------------------
 5715|       |                /* How can we check the last slot index? We need info parent funcdefs. Resort
 5716|       |                 * to runtime checks for now. Maybe invalid upvalue references could be defaulted
 5717|       |                 * to nil? (don't commit to this in the long term, though) */
 5718|  3.74M|                if ((int32_t)((instr >> 8) & 0xFF) >= sc) return 4;
  ------------------
  |  Branch (5718:21): [True: 0, False: 3.74M]
  ------------------
 5719|  3.74M|                if ((int32_t)((instr >> 16) & 0xFF) >= def->environments_length) return 8;
  ------------------
  |  Branch (5719:21): [True: 0, False: 3.74M]
  ------------------
 5720|  3.74M|                continue;
 5721|  3.74M|            }
 5722|  90.7M|        }
 5723|  90.7M|    }
 5724|       |
 5725|       |    /* Verify last instruction is either a jump, return, return-nil, or tailcall. Eventually,
 5726|       |     * some real flow analysis would be ideal, but this should be very effective. Will completely
 5727|       |     * prevent running over the end of bytecode. However, valid functions with dead code will
 5728|       |     * be rejected. */
 5729|  3.28M|    {
 5730|  3.28M|        uint32_t lastop = def->bytecode[def->bytecode_length - 1] & 0xFF;
 5731|  3.28M|        switch (lastop) {
 5732|      0|            default:
  ------------------
  |  Branch (5732:13): [True: 0, False: 3.28M]
  ------------------
 5733|      0|                return 9;
 5734|  1.93M|            case JOP_RETURN:
  ------------------
  |  Branch (5734:13): [True: 1.93M, False: 1.35M]
  ------------------
 5735|  2.18M|            case JOP_RETURN_NIL:
  ------------------
  |  Branch (5735:13): [True: 251k, False: 3.03M]
  ------------------
 5736|  2.19M|            case JOP_JUMP:
  ------------------
  |  Branch (5736:13): [True: 6.14k, False: 3.27M]
  ------------------
 5737|  2.23M|            case JOP_ERROR:
  ------------------
  |  Branch (5737:13): [True: 42.9k, False: 3.24M]
  ------------------
 5738|  3.28M|            case JOP_TAILCALL:
  ------------------
  |  Branch (5738:13): [True: 1.05M, False: 2.23M]
  ------------------
 5739|  3.28M|                break;
 5740|  3.28M|        }
 5741|  3.28M|    }
 5742|       |
 5743|       |    /* Verify debug info - slotmapping, etc. */
 5744|  34.5M|    for (int32_t i = def->symbolmap_length - 1; i >= 0; i--) {
  ------------------
  |  Branch (5744:49): [True: 31.2M, False: 3.28M]
  ------------------
 5745|  31.2M|        JanetSymbolMap jsm = def->symbolmap[i];
 5746|  31.2M|        if (jsm.birth_pc == UINT32_MAX) {
  ------------------
  |  Branch (5746:13): [True: 16.1M, False: 15.1M]
  ------------------
 5747|  16.1M|            if (jsm.death_pc >= (uint32_t) def->environments_length) {
  ------------------
  |  Branch (5747:17): [True: 0, False: 16.1M]
  ------------------
 5748|      0|                return 10;
 5749|       |                /* We should also check jsm.slot_index */
 5750|      0|            }
 5751|  16.1M|        } else {
 5752|  15.1M|            if (jsm.slot_index >= (uint32_t) def->slotcount) {
  ------------------
  |  Branch (5752:17): [True: 0, False: 15.1M]
  ------------------
 5753|      0|                return 11;
 5754|      0|            }
 5755|  15.1M|            if (jsm.birth_pc != UINT32_MAX && jsm.birth_pc >= (uint32_t) def->bytecode_length) {
  ------------------
  |  Branch (5755:17): [True: 15.1M, False: 0]
  |  Branch (5755:47): [True: 0, False: 15.1M]
  ------------------
 5756|      0|                return 12;
 5757|      0|            }
 5758|  15.1M|            if (jsm.death_pc != UINT32_MAX && jsm.death_pc > (uint32_t) def->bytecode_length) {
  ------------------
  |  Branch (5758:17): [True: 15.1M, False: 0]
  |  Branch (5758:47): [True: 0, False: 15.1M]
  ------------------
 5759|      0|                return 13;
 5760|      0|            }
 5761|  15.1M|        }
 5762|  31.2M|        if (jsm.symbol == NULL) {
  ------------------
  |  Branch (5762:13): [True: 0, False: 31.2M]
  ------------------
 5763|      0|            return 14;
 5764|      0|        }
 5765|  31.2M|    }
 5766|       |
 5767|  3.28M|    return 0;
 5768|  3.28M|}
janet_signalv:
 5878|  2.37k|void janet_signalv(JanetSignal sig, Janet message) {
 5879|  2.37k|    if (janet_vm.return_reg != NULL) {
  ------------------
  |  Branch (5879:9): [True: 2.37k, False: 0]
  ------------------
 5880|       |        /* Should match logic in janet_call for coercing everything not ok to an error (no awaits, yields, etc.) */
 5881|  2.37k|        if (janet_vm.coerce_error && sig != JANET_SIGNAL_OK) {
  ------------------
  |  Branch (5881:13): [True: 0, False: 2.37k]
  |  Branch (5881:38): [True: 0, False: 0]
  ------------------
 5882|      0|#ifdef JANET_EV
 5883|      0|            if (NULL != janet_vm.root_fiber && sig == JANET_SIGNAL_EVENT) {
  ------------------
  |  Branch (5883:17): [True: 0, False: 0]
  |  Branch (5883:48): [True: 0, False: 0]
  ------------------
 5884|      0|                janet_vm.root_fiber->sched_id++;
 5885|      0|            }
 5886|      0|#endif
 5887|      0|            if (sig != JANET_SIGNAL_ERROR) {
  ------------------
  |  Branch (5887:17): [True: 0, False: 0]
  ------------------
 5888|      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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5889|      0|            }
 5890|      0|            sig = JANET_SIGNAL_ERROR;
 5891|      0|        }
 5892|  2.37k|        *janet_vm.return_reg = message;
 5893|  2.37k|        if (NULL != janet_vm.fiber) {
  ------------------
  |  Branch (5893:13): [True: 0, False: 2.37k]
  ------------------
 5894|      0|            janet_vm.fiber->flags |= JANET_FIBER_DID_LONGJUMP;
  ------------------
  |  |  837|      0|#define JANET_FIBER_DID_LONGJUMP     0x8000000
  ------------------
 5895|      0|        }
 5896|       |#if defined(JANET_BSD) || defined(JANET_APPLE)
 5897|       |        _longjmp(*janet_vm.signal_buf, sig);
 5898|       |#else
 5899|  2.37k|        longjmp(*janet_vm.signal_buf, sig);
 5900|  2.37k|#endif
 5901|  2.37k|    } else {
 5902|      0|        const char *str = (const char *)janet_formatc("janet top level signal - %v\n", message);
 5903|      0|        janet_top_level_signal(str);
 5904|      0|    }
 5905|  2.37k|}
janet_panicv:
 5907|  2.37k|void janet_panicv(Janet message) {
 5908|  2.37k|    janet_signalv(JANET_SIGNAL_ERROR, message);
 5909|  2.37k|}
janet_panicf:
 5911|  2.37k|void janet_panicf(const char *format, ...) {
 5912|  2.37k|    va_list args;
 5913|  2.37k|    const uint8_t *ret;
 5914|  2.37k|    JanetBuffer buffer;
 5915|  2.37k|    int32_t len = 0;
 5916|  57.5k|    while (format[len]) len++;
  ------------------
  |  Branch (5916:12): [True: 55.2k, False: 2.37k]
  ------------------
 5917|  2.37k|    janet_buffer_init(&buffer, len);
 5918|  2.37k|    va_start(args, format);
 5919|  2.37k|    janet_formatbv(&buffer, format, args);
 5920|       |    va_end(args);
 5921|  2.37k|    ret = janet_string(buffer.data, buffer.count);
 5922|  2.37k|    janet_buffer_deinit(&buffer);
 5923|  2.37k|    janet_panics(ret);
 5924|  2.37k|}
janet_panics:
 5930|  2.37k|void janet_panics(const uint8_t *message) {
 5931|  2.37k|    janet_panicv(janet_wrap_string(message));
  ------------------
  |  |  848|  2.37k|#define janet_wrap_string(s) janet_nanbox_wrap_c((s), JANET_STRING)
  |  |  ------------------
  |  |  |  |  828|  2.37k|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  2.37k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  2.37k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5932|  2.37k|}
janet_arity:
 5947|  4.20k|void janet_arity(int32_t arity, int32_t min, int32_t max) {
 5948|  4.20k|    if (min >= 0 && arity < min)
  ------------------
  |  Branch (5948:9): [True: 4.20k, False: 0]
  |  Branch (5948:21): [True: 0, False: 4.20k]
  ------------------
 5949|      0|        janet_panicf("arity mismatch, expected at least %d, got %d", min, arity);
 5950|  4.20k|    if (max >= 0 && arity > max)
  ------------------
  |  Branch (5950:9): [True: 0, False: 4.20k]
  |  Branch (5950:21): [True: 0, False: 0]
  ------------------
 5951|      0|        janet_panicf("arity mismatch, expected at most %d, got %d", max, arity);
 5952|  4.20k|}
janet_getbytes:
 6246|  1.89k|JanetByteView janet_getbytes(const Janet *argv, int32_t n) {
 6247|  1.89k|    Janet x = argv[n];
 6248|  1.89k|    JanetByteView view;
 6249|  1.89k|    if (!janet_bytes_view(x, &view.bytes, &view.len)) {
  ------------------
  |  Branch (6249:9): [True: 0, False: 1.89k]
  ------------------
 6250|      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)
  |  |  ------------------
  ------------------
 6251|      0|    }
 6252|  1.89k|    return view;
 6253|  1.89k|}
janet_dyn:
 6287|  19.0M|Janet janet_dyn(const char *name) {
 6288|  19.0M|    if (!janet_vm.fiber) {
  ------------------
  |  Branch (6288:9): [True: 19.0M, False: 0]
  ------------------
 6289|  19.0M|        if (!janet_vm.top_dyns) return janet_wrap_nil();
  ------------------
  |  |  831|  19.0M|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|  19.0M|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  19.0M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  19.0M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6289:13): [True: 19.0M, False: 0]
  ------------------
 6290|      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)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6291|  19.0M|    }
 6292|      0|    if (janet_vm.fiber->env) {
  ------------------
  |  Branch (6292:9): [True: 0, False: 0]
  ------------------
 6293|      0|        return janet_table_get_keyword(janet_vm.fiber->env, name);
 6294|      0|    } else {
 6295|      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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6296|      0|    }
 6297|      0|}
janet_lib_compile:
 8261|  6.14k|void janet_lib_compile(JanetTable *env) {
 8262|  6.14k|    JanetRegExt cfuns[] = {
 8263|  6.14k|        JANET_CORE_REG("compile", cfun_compile),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 8264|  6.14k|        JANET_REG_END
  ------------------
  |  | 2110|  6.14k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
 8265|  6.14k|    };
 8266|       |    janet_core_cfuns_ext(env, NULL, cfuns);
 8267|  6.14k|}
janet_core_env:
 9672|  6.14k|JanetTable *janet_core_env(JanetTable *replacements) {
 9673|       |    /* Memoize core env, ignoring replacements the second time around. */
 9674|  6.14k|    if (NULL != janet_vm.core_env) {
  ------------------
  |  Branch (9674:9): [True: 0, False: 6.14k]
  ------------------
 9675|      0|        return janet_vm.core_env;
 9676|      0|    }
 9677|       |
 9678|  6.14k|    JanetTable *dict = janet_core_lookup_table(replacements);
 9679|       |
 9680|       |    /* Unmarshal bytecode */
 9681|  6.14k|    Janet marsh_out = janet_unmarshal(
 9682|  6.14k|                          janet_core_image,
 9683|  6.14k|                          janet_core_image_size,
 9684|  6.14k|                          0,
 9685|  6.14k|                          dict,
 9686|  6.14k|                          NULL);
 9687|       |
 9688|       |    /* Memoize */
 9689|  6.14k|    janet_gcroot(marsh_out);
 9690|  6.14k|    JanetTable *env = janet_unwrap_table(marsh_out);
  ------------------
  |  |  861|  6.14k|#define janet_unwrap_table(x) ((JanetTable *)janet_nanbox_to_pointer(x))
  ------------------
 9691|  6.14k|    janet_vm.core_env = env;
 9692|       |
 9693|       |    /* Invert image dict manually here. We can't do this in boot.janet as it
 9694|       |     * breaks deterministic builds */
 9695|  6.14k|    Janet lidv, midv;
 9696|  6.14k|    lidv = midv = janet_wrap_nil();
  ------------------
  |  |  831|  6.14k|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|  6.14k|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  6.14k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  6.14k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9697|  6.14k|    janet_resolve(env, janet_csymbol("load-image-dict"), &lidv);
 9698|  6.14k|    janet_resolve(env, janet_csymbol("make-image-dict"), &midv);
 9699|       |
 9700|       |    /* Check that we actually got tables - if we are using a smaller corelib, may not exist */
 9701|  6.14k|    if (janet_checktype(lidv, JANET_TABLE) && janet_checktype(midv, JANET_TABLE)) {
  ------------------
  |  |  806|  12.2k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 6.14k, False: 0]
  |  |  |  Branch (806:6): [Folded, False: 6.14k]
  |  |  ------------------
  |  |  807|  12.2k|        ? 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.2k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  6.14k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  6.14k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  6.14k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  6.14k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if (janet_checktype(lidv, JANET_TABLE) && janet_checktype(midv, JANET_TABLE)) {
  ------------------
  |  |  806|  6.14k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 6.14k, False: 0]
  |  |  |  Branch (806:6): [Folded, False: 6.14k]
  |  |  ------------------
  |  |  807|  6.14k|        ? 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|  6.14k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  6.14k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  6.14k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  6.14k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  6.14k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9702|  6.14k|        JanetTable *lid = janet_unwrap_table(lidv);
  ------------------
  |  |  861|  6.14k|#define janet_unwrap_table(x) ((JanetTable *)janet_nanbox_to_pointer(x))
  ------------------
 9703|  6.14k|        JanetTable *mid = janet_unwrap_table(midv);
  ------------------
  |  |  861|  6.14k|#define janet_unwrap_table(x) ((JanetTable *)janet_nanbox_to_pointer(x))
  ------------------
 9704|  12.5M|        for (int32_t i = 0; i < lid->capacity; i++) {
  ------------------
  |  Branch (9704:29): [True: 12.5M, False: 6.14k]
  ------------------
 9705|  12.5M|            const JanetKV *kv = lid->data + i;
 9706|  12.5M|            if (!janet_checktype(kv->key, JANET_NIL)) {
  ------------------
  |  |  806|  12.5M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 12.5M]
  |  |  ------------------
  |  |  807|  12.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|  12.5M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  12.5M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  12.5M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  12.5M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  12.5M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (9706:17): [True: 4.04M, False: 8.53M]
  ------------------
 9707|  4.04M|                janet_table_put(mid, kv->value, kv->key);
 9708|  4.04M|            }
 9709|  12.5M|        }
 9710|  6.14k|    }
 9711|       |
 9712|  6.14k|    return env;
 9713|  6.14k|}
janet_core_lookup_table:
 9717|  6.14k|JanetTable *janet_core_lookup_table(JanetTable *replacements) {
 9718|  6.14k|    JanetTable *dict = janet_table(512);
 9719|  6.14k|    janet_load_libs(dict);
 9720|       |
 9721|       |    /* Add replacements */
 9722|  6.14k|    if (replacements != NULL) {
  ------------------
  |  Branch (9722:9): [True: 0, False: 6.14k]
  ------------------
 9723|      0|        for (int32_t i = 0; i < replacements->capacity; i++) {
  ------------------
  |  Branch (9723:29): [True: 0, False: 0]
  ------------------
 9724|      0|            JanetKV kv = replacements->data[i];
 9725|      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 (9725:17): [True: 0, False: 0]
  ------------------
 9726|      0|                janet_table_put(dict, kv.key, kv.value);
 9727|       |                /* Add replacement functions to registry? */
 9728|      0|            }
 9729|      0|        }
 9730|      0|    }
 9731|       |
 9732|  6.14k|    return dict;
 9733|  6.14k|}
janet_lib_debug:
10185|  6.14k|void janet_lib_debug(JanetTable *env) {
10186|  6.14k|    JanetRegExt debug_cfuns[] = {
10187|  6.14k|        JANET_CORE_REG("debug/break", cfun_debug_break),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
10188|  6.14k|        JANET_CORE_REG("debug/unbreak", cfun_debug_unbreak),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
10189|  6.14k|        JANET_CORE_REG("debug/fbreak", cfun_debug_fbreak),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
10190|  6.14k|        JANET_CORE_REG("debug/unfbreak", cfun_debug_unfbreak),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
10191|  6.14k|        JANET_CORE_REG("debug/arg-stack", cfun_debug_argstack),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
10192|  6.14k|        JANET_CORE_REG("debug/stack", cfun_debug_stack),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
10193|  6.14k|        JANET_CORE_REG("debug/stacktrace", cfun_debug_stacktrace),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
10194|  6.14k|        JANET_CORE_REG("debug/lineage", cfun_debug_lineage),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
10195|  6.14k|        JANET_CORE_REG("debug/step", cfun_debug_step),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
10196|  6.14k|        JANET_REG_END
  ------------------
  |  | 2110|  6.14k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
10197|  6.14k|    };
10198|       |    janet_core_cfuns_ext(env, NULL, debug_cfuns);
10199|  6.14k|}
janet_ev_init_common:
11165|  6.14k|void janet_ev_init_common(void) {
11166|  6.14k|    janet_q_init(&janet_vm.spawn);
11167|  6.14k|    janet_vm.tq = NULL;
11168|  6.14k|    janet_vm.tq_count = 0;
11169|  6.14k|    janet_vm.tq_capacity = 0;
11170|  6.14k|    janet_table_init_raw(&janet_vm.threaded_abstracts, 0);
11171|  6.14k|    janet_table_init_raw(&janet_vm.active_tasks, 0);
11172|  6.14k|    janet_table_init_raw(&janet_vm.signal_handlers, 0);
11173|  6.14k|    janet_rng_seed(&janet_vm.ev_rng, 0);
11174|  6.14k|#ifndef JANET_WINDOWS
11175|  6.14k|    pthread_attr_init(&janet_vm.new_thread_attr);
11176|       |    pthread_attr_setdetachstate(&janet_vm.new_thread_attr, PTHREAD_CREATE_DETACHED);
11177|  6.14k|#endif
11178|  6.14k|}
janet_ev_deinit_common:
11211|  6.14k|void janet_ev_deinit_common(void) {
11212|  6.14k|    JanetTimeout to;
11213|  6.14k|    while (peek_timeout(&to)) {
  ------------------
  |  Branch (11213:12): [True: 0, False: 6.14k]
  ------------------
11214|      0|        handle_timeout_worker(to, 1);
11215|      0|        pop_timeout(0);
11216|      0|    }
11217|  6.14k|    janet_q_deinit(&janet_vm.spawn);
11218|  6.14k|    janet_free(janet_vm.tq);
  ------------------
  |  | 2415|  6.14k|#define janet_free(X) free((X))
  ------------------
11219|  6.14k|    janet_table_deinit(&janet_vm.threaded_abstracts);
11220|  6.14k|    janet_table_deinit(&janet_vm.active_tasks);
11221|  6.14k|    janet_table_deinit(&janet_vm.signal_handlers);
11222|  6.14k|#ifndef JANET_WINDOWS
11223|  6.14k|    pthread_attr_destroy(&janet_vm.new_thread_attr);
11224|  6.14k|#endif
11225|  6.14k|}
janet_ev_init:
12502|  6.14k|void janet_ev_init(void) {
12503|  6.14k|    janet_ev_init_common();
12504|  6.14k|    janet_ev_setup_selfpipe();
12505|  6.14k|    janet_vm.epoll = epoll_create1(EPOLL_CLOEXEC);
12506|  6.14k|    janet_vm.timerfd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC | TFD_NONBLOCK);
12507|  6.14k|    janet_vm.timer_enabled = 0;
12508|  6.14k|    if (janet_vm.epoll == -1 || janet_vm.timerfd == -1) goto error;
  ------------------
  |  Branch (12508:9): [True: 0, False: 6.14k]
  |  Branch (12508:33): [True: 0, False: 6.14k]
  ------------------
12509|  6.14k|    struct epoll_event ev;
12510|  6.14k|    ev.events = EPOLLIN | EPOLLET;
12511|  6.14k|    ev.data.ptr = &janet_vm.timerfd;
12512|  6.14k|    if (-1 == epoll_ctl(janet_vm.epoll, EPOLL_CTL_ADD, janet_vm.timerfd, &ev)) goto error;
  ------------------
  |  Branch (12512:9): [True: 0, False: 6.14k]
  ------------------
12513|  6.14k|    ev.events = EPOLLIN | EPOLLET;
12514|  6.14k|    ev.data.ptr = janet_vm.selfpipe;
12515|  6.14k|    if (-1 == epoll_ctl(janet_vm.epoll, EPOLL_CTL_ADD, janet_vm.selfpipe[0], &ev)) goto error;
  ------------------
  |  Branch (12515:9): [True: 0, False: 6.14k]
  ------------------
12516|  6.14k|    return;
12517|  6.14k|error:
12518|       |    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]
  |  |  ------------------
  ------------------
12519|      0|}
janet_ev_deinit:
12521|  6.14k|void janet_ev_deinit(void) {
12522|  6.14k|    janet_ev_deinit_common();
12523|  6.14k|    close(janet_vm.epoll);
12524|  6.14k|    close(janet_vm.timerfd);
12525|  6.14k|    janet_ev_cleanup_selfpipe();
12526|  6.14k|    janet_vm.epoll = 0;
12527|  6.14k|}
janet_make_pipe:
13624|  6.14k|int janet_make_pipe(JanetHandle handles[2], int mode) {
13625|       |#ifdef JANET_WINDOWS
13626|       |    /*
13627|       |     * On windows, the built in CreatePipe function doesn't support overlapped IO
13628|       |     * so we lift from the windows source code and modify for our own version.
13629|       |     */
13630|       |    JanetHandle shandle, chandle;
13631|       |    CHAR PipeNameBuffer[MAX_PATH];
13632|       |    SECURITY_ATTRIBUTES saAttr;
13633|       |    memset(&saAttr, 0, sizeof(saAttr));
13634|       |    saAttr.nLength = sizeof(saAttr);
13635|       |    saAttr.bInheritHandle = TRUE;
13636|       |    if (mode == 3) {
13637|       |        /* No overlapped IO involved, just call CreatePipe */
13638|       |        if (!CreatePipe(handles, handles + 1, &saAttr, 0)) return -1;
13639|       |        return 0;
13640|       |    }
13641|       |    snprintf(PipeNameBuffer,
13642|       |             sizeof(PipeNameBuffer),
13643|       |             "\\\\.\\Pipe\\JanetPipeFile.%08x.%08x",
13644|       |             (unsigned int) GetCurrentProcessId(),
13645|       |             (unsigned int) InterlockedIncrement(&PipeSerialNumber));
13646|       |
13647|       |    /* server handle goes to subprocess */
13648|       |    shandle = CreateNamedPipeA(
13649|       |                  PipeNameBuffer,
13650|       |                  (mode == 2 ? PIPE_ACCESS_INBOUND : PIPE_ACCESS_OUTBOUND) | FILE_FLAG_OVERLAPPED,
13651|       |                  PIPE_TYPE_BYTE | PIPE_WAIT,
13652|       |                  255,           /* Max number of pipes for duplication. */
13653|       |                  4096,          /* Out buffer size */
13654|       |                  4096,          /* In buffer size */
13655|       |                  120 * 1000,    /* Timeout in ms */
13656|       |                  &saAttr);
13657|       |    if (shandle == INVALID_HANDLE_VALUE) {
13658|       |        return -1;
13659|       |    }
13660|       |
13661|       |    /* we keep client handle */
13662|       |    chandle = CreateFileA(
13663|       |                  PipeNameBuffer,
13664|       |                  (mode == 2 ? GENERIC_WRITE : GENERIC_READ),
13665|       |                  0,
13666|       |                  &saAttr,
13667|       |                  OPEN_EXISTING,
13668|       |                  FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED,
13669|       |                  NULL);
13670|       |
13671|       |    if (chandle == INVALID_HANDLE_VALUE) {
13672|       |        CloseHandle(shandle);
13673|       |        return -1;
13674|       |    }
13675|       |    if (mode == 2) {
13676|       |        handles[0] = shandle;
13677|       |        handles[1] = chandle;
13678|       |    } else {
13679|       |        handles[0] = chandle;
13680|       |        handles[1] = shandle;
13681|       |    }
13682|       |    return 0;
13683|       |#else
13684|  6.14k|    if (pipe(handles)) return -1;
  ------------------
  |  Branch (13684:9): [True: 0, False: 6.14k]
  ------------------
13685|  6.14k|    if (mode != 2 && fcntl(handles[0], F_SETFD, FD_CLOEXEC)) goto error;
  ------------------
  |  Branch (13685:9): [True: 6.14k, False: 0]
  |  Branch (13685:22): [True: 0, False: 6.14k]
  ------------------
13686|  6.14k|    if (mode != 1 && fcntl(handles[1], F_SETFD, FD_CLOEXEC)) goto error;
  ------------------
  |  Branch (13686:9): [True: 0, False: 6.14k]
  |  Branch (13686:22): [True: 0, False: 0]
  ------------------
13687|  6.14k|    if (mode != 2 && mode != 3 && fcntl(handles[0], F_SETFL, O_NONBLOCK)) goto error;
  ------------------
  |  Branch (13687:9): [True: 6.14k, False: 0]
  |  Branch (13687:22): [True: 6.14k, False: 0]
  |  Branch (13687:35): [True: 0, False: 6.14k]
  ------------------
13688|  6.14k|    if (mode != 1 && mode != 3 && fcntl(handles[1], F_SETFL, O_NONBLOCK)) goto error;
  ------------------
  |  Branch (13688:9): [True: 0, False: 6.14k]
  |  Branch (13688:22): [True: 0, False: 0]
  |  Branch (13688:35): [True: 0, False: 0]
  ------------------
13689|  6.14k|    return 0;
13690|      0|error:
13691|      0|    close(handles[0]);
13692|      0|    close(handles[1]);
13693|      0|    return -1;
13694|  6.14k|#endif
13695|  6.14k|}
janet_lib_ev:
14280|  6.14k|void janet_lib_ev(JanetTable *env) {
14281|  6.14k|    JanetRegExt ev_cfuns_ext[] = {
14282|  6.14k|        JANET_CORE_REG("ev/give", cfun_channel_push),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14283|  6.14k|        JANET_CORE_REG("ev/take", cfun_channel_pop),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14284|  6.14k|        JANET_CORE_REG("ev/full", cfun_channel_full),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14285|  6.14k|        JANET_CORE_REG("ev/capacity", cfun_channel_capacity),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14286|  6.14k|        JANET_CORE_REG("ev/count", cfun_channel_count),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14287|  6.14k|        JANET_CORE_REG("ev/select", cfun_channel_choice),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14288|  6.14k|        JANET_CORE_REG("ev/rselect", cfun_channel_rchoice),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14289|  6.14k|        JANET_CORE_REG("ev/chan", cfun_channel_new),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14290|  6.14k|        JANET_CORE_REG("ev/thread-chan", cfun_channel_new_threaded),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14291|  6.14k|        JANET_CORE_REG("ev/chan-close", cfun_channel_close),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14292|  6.14k|        JANET_CORE_REG("ev/go", cfun_ev_go),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14293|  6.14k|        JANET_CORE_REG("ev/thread", cfun_ev_thread),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14294|  6.14k|        JANET_CORE_REG("ev/give-supervisor", cfun_ev_give_supervisor),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14295|  6.14k|        JANET_CORE_REG("ev/sleep", cfun_ev_sleep),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14296|  6.14k|        JANET_CORE_REG("ev/deadline", cfun_ev_deadline),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14297|  6.14k|        JANET_CORE_REG("ev/cancel", cfun_ev_cancel),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14298|  6.14k|        JANET_CORE_REG("ev/close", janet_cfun_stream_close),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14299|  6.14k|        JANET_CORE_REG("ev/read", janet_cfun_stream_read),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14300|  6.14k|        JANET_CORE_REG("ev/chunk", janet_cfun_stream_chunk),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14301|  6.14k|        JANET_CORE_REG("ev/write", janet_cfun_stream_write),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14302|  6.14k|        JANET_CORE_REG("ev/lock", janet_cfun_mutex),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14303|  6.14k|        JANET_CORE_REG("ev/acquire-lock", janet_cfun_mutex_acquire),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14304|  6.14k|        JANET_CORE_REG("ev/release-lock", janet_cfun_mutex_release),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14305|  6.14k|        JANET_CORE_REG("ev/rwlock", janet_cfun_rwlock),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14306|  6.14k|        JANET_CORE_REG("ev/acquire-rlock", janet_cfun_rwlock_read_lock),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14307|  6.14k|        JANET_CORE_REG("ev/acquire-wlock", janet_cfun_rwlock_write_lock),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14308|  6.14k|        JANET_CORE_REG("ev/release-rlock", janet_cfun_rwlock_read_release),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14309|  6.14k|        JANET_CORE_REG("ev/release-wlock", janet_cfun_rwlock_write_release),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14310|  6.14k|        JANET_CORE_REG("ev/to-file", janet_cfun_to_file),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14311|  6.14k|        JANET_CORE_REG("ev/all-tasks", janet_cfun_ev_all_tasks),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
14312|  6.14k|        JANET_REG_END
  ------------------
  |  | 2110|  6.14k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
14313|  6.14k|    };
14314|       |
14315|       |    janet_core_cfuns_ext(env, NULL, ev_cfuns_ext);
14316|  6.14k|    janet_register_abstract_type(&janet_stream_type);
14317|  6.14k|    janet_register_abstract_type(&janet_channel_type);
14318|  6.14k|    janet_register_abstract_type(&janet_mutex_type);
14319|  6.14k|    janet_register_abstract_type(&janet_rwlock_type);
14320|  6.14k|}
janet_lib_ffi:
16250|  6.14k|void janet_lib_ffi(JanetTable *env) {
16251|  6.14k|    JanetRegExt ffi_cfuns[] = {
16252|  6.14k|        JANET_CORE_REG("ffi/native", janet_core_raw_native),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16253|  6.14k|        JANET_CORE_REG("ffi/lookup", janet_core_native_lookup),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16254|  6.14k|        JANET_CORE_REG("ffi/close", janet_core_native_close),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16255|  6.14k|        JANET_CORE_REG("ffi/signature", cfun_ffi_signature),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16256|  6.14k|        JANET_CORE_REG("ffi/call", cfun_ffi_call),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16257|  6.14k|        JANET_CORE_REG("ffi/struct", cfun_ffi_struct),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16258|  6.14k|        JANET_CORE_REG("ffi/write", cfun_ffi_buffer_write),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16259|  6.14k|        JANET_CORE_REG("ffi/read", cfun_ffi_buffer_read),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16260|  6.14k|        JANET_CORE_REG("ffi/size", cfun_ffi_size),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16261|  6.14k|        JANET_CORE_REG("ffi/align", cfun_ffi_align),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16262|  6.14k|        JANET_CORE_REG("ffi/trampoline", cfun_ffi_get_callback_trampoline),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16263|  6.14k|        JANET_CORE_REG("ffi/jitfn", cfun_ffi_jitfn),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16264|  6.14k|        JANET_CORE_REG("ffi/malloc", cfun_ffi_malloc),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16265|  6.14k|        JANET_CORE_REG("ffi/free", cfun_ffi_free),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16266|  6.14k|        JANET_CORE_REG("ffi/pointer-buffer", cfun_ffi_pointer_buffer),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16267|  6.14k|        JANET_CORE_REG("ffi/pointer-cfunction", cfun_ffi_pointer_cfunction),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16268|  6.14k|        JANET_CORE_REG("ffi/calling-conventions", cfun_ffi_supported_calling_conventions),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16269|  6.14k|        JANET_REG_END
  ------------------
  |  | 2110|  6.14k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
16270|  6.14k|    };
16271|       |    janet_core_cfuns_ext(env, NULL, ffi_cfuns);
16272|  6.14k|}
janet_lib_fiber:
16952|  6.14k|void janet_lib_fiber(JanetTable *env) {
16953|  6.14k|    JanetRegExt fiber_cfuns[] = {
16954|  6.14k|        JANET_CORE_REG("fiber/new", cfun_fiber_new),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16955|  6.14k|        JANET_CORE_REG("fiber/status", cfun_fiber_status),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16956|  6.14k|        JANET_CORE_REG("fiber/root", cfun_fiber_root),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16957|  6.14k|        JANET_CORE_REG("fiber/current", cfun_fiber_current),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16958|  6.14k|        JANET_CORE_REG("fiber/maxstack", cfun_fiber_maxstack),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16959|  6.14k|        JANET_CORE_REG("fiber/setmaxstack", cfun_fiber_setmaxstack),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16960|  6.14k|        JANET_CORE_REG("fiber/getenv", cfun_fiber_getenv),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16961|  6.14k|        JANET_CORE_REG("fiber/setenv", cfun_fiber_setenv),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16962|  6.14k|        JANET_CORE_REG("fiber/can-resume?", cfun_fiber_can_resume),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16963|  6.14k|        JANET_CORE_REG("fiber/last-value", cfun_fiber_last_value),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
16964|  6.14k|        JANET_REG_END
  ------------------
  |  | 2110|  6.14k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
16965|  6.14k|    };
16966|       |    janet_core_cfuns_ext(env, NULL, fiber_cfuns);
16967|  6.14k|}
janet_lib_filewatch:
17962|  6.14k|void janet_lib_filewatch(JanetTable *env) {
17963|  6.14k|    JanetRegExt cfuns[] = {
17964|  6.14k|        JANET_CORE_REG("filewatch/new", cfun_filewatch_make),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
17965|  6.14k|        JANET_CORE_REG("filewatch/add", cfun_filewatch_add),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
17966|  6.14k|        JANET_CORE_REG("filewatch/remove", cfun_filewatch_remove),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
17967|  6.14k|        JANET_CORE_REG("filewatch/listen", cfun_filewatch_listen),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
17968|  6.14k|        JANET_CORE_REG("filewatch/unlisten", cfun_filewatch_unlisten),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
17969|  6.14k|        JANET_REG_END
  ------------------
  |  | 2110|  6.14k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
17970|  6.14k|    };
17971|       |    janet_core_cfuns_ext(env, NULL, cfuns);
17972|  6.14k|}
janet_gcpressure:
18032|  32.3M|void janet_gcpressure(size_t s) {
18033|  32.3M|    janet_vm.next_collection += s;
18034|  32.3M|}
janet_gcalloc:
18506|  49.4M|void *janet_gcalloc(enum JanetMemoryType type, size_t size) {
18507|  49.4M|    JanetGCObject *mem;
18508|       |
18509|       |    /* Make sure everything is inited */
18510|  49.4M|    janet_assert(NULL != janet_vm.cache, "please initialize janet before use");
  ------------------
  |  |  389|  49.4M|#define janet_assert(c, m) do { \
  |  |  390|  49.4M|    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: 49.4M]
  |  |  ------------------
  |  |  391|  49.4M|} while (0)
  |  |  ------------------
  |  |  |  Branch (391:10): [Folded, False: 49.4M]
  |  |  ------------------
  ------------------
18511|  49.4M|    mem = janet_malloc(size);
  ------------------
  |  | 2406|  49.4M|#define janet_malloc(X) malloc((X))
  ------------------
18512|       |
18513|       |    /* Check for bad malloc */
18514|  49.4M|    if (NULL == mem) {
  ------------------
  |  Branch (18514:9): [True: 0, False: 49.4M]
  ------------------
18515|      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]
  |  |  ------------------
  ------------------
18516|      0|    }
18517|       |
18518|       |    /* Configure block */
18519|  49.4M|    mem->flags = type;
18520|       |
18521|       |    /* Prepend block to heap list */
18522|  49.4M|    janet_vm.next_collection += size;
18523|  49.4M|    if (type < JANET_MEMORY_TABLE_WEAKK) {
  ------------------
  |  Branch (18523:9): [True: 49.4M, False: 0]
  ------------------
18524|       |        /* normal heap */
18525|  49.4M|        mem->data.next = janet_vm.blocks;
18526|  49.4M|        janet_vm.blocks = mem;
18527|  49.4M|    } else {
18528|       |        /* weak heap */
18529|      0|        mem->data.next = janet_vm.weak_blocks;
18530|      0|        janet_vm.weak_blocks = mem;
18531|      0|    }
18532|  49.4M|    janet_vm.block_count++;
18533|       |
18534|  49.4M|    return (void *)mem;
18535|  49.4M|}
janet_gcroot:
18596|  12.2k|void janet_gcroot(Janet root) {
18597|  12.2k|    size_t newcount = janet_vm.root_count + 1;
18598|  12.2k|    if (newcount > janet_vm.root_capacity) {
  ------------------
  |  Branch (18598:9): [True: 6.14k, False: 6.14k]
  ------------------
18599|  6.14k|        size_t newcap = 2 * newcount;
18600|  6.14k|        janet_vm.roots = janet_realloc(janet_vm.roots, sizeof(Janet) * newcap);
  ------------------
  |  | 2409|  6.14k|#define janet_realloc(X, Y) realloc((X), (Y))
  ------------------
18601|  6.14k|        if (NULL == janet_vm.roots) {
  ------------------
  |  Branch (18601:13): [True: 0, False: 6.14k]
  ------------------
18602|      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]
  |  |  ------------------
  ------------------
18603|      0|        }
18604|  6.14k|        janet_vm.root_capacity = newcap;
18605|  6.14k|    }
18606|  12.2k|    janet_vm.roots[janet_vm.root_count] = root;
18607|  12.2k|    janet_vm.root_count = newcount;
18608|  12.2k|}
janet_clear_memory:
18654|  6.14k|void janet_clear_memory(void) {
18655|  6.14k|#ifdef JANET_EV
18656|  6.14k|    JanetKV *items = janet_vm.threaded_abstracts.data;
18657|  12.2k|    for (int32_t i = 0; i < janet_vm.threaded_abstracts.capacity; i++) {
  ------------------
  |  Branch (18657:25): [True: 6.14k, False: 6.14k]
  ------------------
18658|  6.14k|        if (janet_checktype(items[i].key, JANET_ABSTRACT)) {
  ------------------
  |  |  806|  6.14k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 0, False: 6.14k]
  |  |  |  Branch (806:6): [Folded, False: 6.14k]
  |  |  ------------------
  |  |  807|  6.14k|        ? 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|  6.14k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  6.14k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  6.14k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  6.14k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  6.14k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
18659|      0|            void *abst = janet_unwrap_abstract(items[i].key);
  ------------------
  |  |  866|      0|#define janet_unwrap_abstract(x) (janet_nanbox_to_pointer(x))
  ------------------
18660|      0|            JanetAbstractHead *head = janet_abstract_head(abst);
  ------------------
  |  | 1897|      0|#define janet_abstract_head(u) ((JanetAbstractHead *)((char *)u - offsetof(JanetAbstractHead, data)))
  ------------------
18661|      0|            if (head->type->gcperthread) {
  ------------------
  |  Branch (18661:17): [True: 0, False: 0]
  ------------------
18662|      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]
  |  |  ------------------
  ------------------
18663|      0|            }
18664|      0|            janet_abstract_decref_maybe_free(abst);
18665|      0|        }
18666|  6.14k|    }
18667|  6.14k|#endif
18668|  6.14k|    JanetGCObject *current = janet_vm.blocks;
18669|  49.4M|    while (NULL != current) {
  ------------------
  |  Branch (18669:12): [True: 49.4M, False: 6.14k]
  ------------------
18670|  49.4M|        janet_deinit_block(current);
18671|  49.4M|        JanetGCObject *next = current->data.next;
18672|  49.4M|        janet_free(current);
  ------------------
  |  | 2415|  49.4M|#define janet_free(X) free((X))
  ------------------
18673|  49.4M|        current = next;
18674|  49.4M|    }
18675|  6.14k|    janet_vm.blocks = NULL;
18676|  6.14k|    janet_free_all_scratch();
18677|  6.14k|    janet_free(janet_vm.scratch_mem);
  ------------------
  |  | 2415|  6.14k|#define janet_free(X) free((X))
  ------------------
18678|  6.14k|}
janet_smalloc:
18692|  21.4M|void *janet_smalloc(size_t size) {
18693|  21.4M|    JanetScratch *s = janet_malloc(sizeof(JanetScratch) + size);
  ------------------
  |  | 2406|  21.4M|#define janet_malloc(X) malloc((X))
  ------------------
18694|  21.4M|    if (NULL == s) {
  ------------------
  |  Branch (18694:9): [True: 0, False: 21.4M]
  ------------------
18695|      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]
  |  |  ------------------
  ------------------
18696|      0|    }
18697|  21.4M|    s->finalize = NULL;
18698|  21.4M|    if (janet_vm.scratch_len == janet_vm.scratch_cap) {
  ------------------
  |  Branch (18698:9): [True: 12.7k, False: 21.4M]
  ------------------
18699|  12.7k|        size_t newcap = 2 * janet_vm.scratch_cap + 2;
18700|  12.7k|        JanetScratch **newmem = (JanetScratch **) janet_realloc(janet_vm.scratch_mem, newcap * sizeof(JanetScratch));
  ------------------
  |  | 2409|  12.7k|#define janet_realloc(X, Y) realloc((X), (Y))
  ------------------
18701|  12.7k|        if (NULL == newmem) {
  ------------------
  |  Branch (18701:13): [True: 0, False: 12.7k]
  ------------------
18702|      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]
  |  |  ------------------
  ------------------
18703|      0|        }
18704|  12.7k|        janet_vm.scratch_cap = newcap;
18705|  12.7k|        janet_vm.scratch_mem = newmem;
18706|  12.7k|    }
18707|  21.4M|    janet_vm.scratch_mem[janet_vm.scratch_len++] = s;
18708|  21.4M|    return (char *)(s->mem);
18709|  21.4M|}
janet_srealloc:
18721|  2.47M|void *janet_srealloc(void *mem, size_t size) {
18722|  2.47M|    if (NULL == mem) return janet_smalloc(size);
  ------------------
  |  Branch (18722:9): [True: 2.19M, False: 283k]
  ------------------
18723|   283k|    JanetScratch *s = janet_mem2scratch(mem);
18724|   283k|    if (janet_vm.scratch_len) {
  ------------------
  |  Branch (18724:9): [True: 283k, False: 0]
  ------------------
18725|   399k|        for (size_t i = janet_vm.scratch_len - 1; ; i--) {
18726|   399k|            if (janet_vm.scratch_mem[i] == s) {
  ------------------
  |  Branch (18726:17): [True: 283k, False: 116k]
  ------------------
18727|   283k|                JanetScratch *news = janet_realloc(s, size + sizeof(JanetScratch));
  ------------------
  |  | 2409|   283k|#define janet_realloc(X, Y) realloc((X), (Y))
  ------------------
18728|   283k|                if (NULL == news) {
  ------------------
  |  Branch (18728:21): [True: 0, False: 283k]
  ------------------
18729|      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]
  |  |  ------------------
  ------------------
18730|      0|                }
18731|   283k|                janet_vm.scratch_mem[i] = news;
18732|   283k|                return (char *)(news->mem);
18733|   283k|            }
18734|   116k|            if (i == 0) break;
  ------------------
  |  Branch (18734:17): [True: 0, False: 116k]
  ------------------
18735|   116k|        }
18736|   283k|    }
18737|      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]
  |  |  ------------------
  ------------------
18738|      0|}
janet_sfree:
18745|  19.2M|void janet_sfree(void *mem) {
18746|  19.2M|    if (NULL == mem) return;
  ------------------
  |  Branch (18746:9): [True: 0, False: 19.2M]
  ------------------
18747|  19.2M|    JanetScratch *s = janet_mem2scratch(mem);
18748|  19.2M|    if (janet_vm.scratch_len) {
  ------------------
  |  Branch (18748:9): [True: 19.2M, False: 0]
  ------------------
18749|  22.8M|        for (size_t i = janet_vm.scratch_len - 1; ; i--) {
18750|  22.8M|            if (janet_vm.scratch_mem[i] == s) {
  ------------------
  |  Branch (18750:17): [True: 19.2M, False: 3.56M]
  ------------------
18751|  19.2M|                janet_vm.scratch_mem[i] = janet_vm.scratch_mem[--janet_vm.scratch_len];
18752|  19.2M|                free_one_scratch(s);
18753|  19.2M|                return;
18754|  19.2M|            }
18755|  3.56M|            if (i == 0) break;
  ------------------
  |  Branch (18755:17): [True: 0, False: 3.56M]
  ------------------
18756|  3.56M|        }
18757|  19.2M|    }
18758|      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]
  |  |  ------------------
  ------------------
18759|      0|}
janet_wrap_s64:
18944|  8.62k|Janet janet_wrap_s64(int64_t x) {
18945|  8.62k|    int64_t *box = janet_abstract(&janet_s64_type, sizeof(int64_t));
18946|  8.62k|    *box = (int64_t)x;
18947|  8.62k|    return janet_wrap_abstract(box);
  ------------------
  |  |  851|  8.62k|#define janet_wrap_abstract(s) janet_nanbox_wrap_((s), JANET_ABSTRACT)
  |  |  ------------------
  |  |  |  |  825|  8.62k|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  8.62k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  8.62k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
18948|  8.62k|}
janet_wrap_u64:
18950|  18.5k|Janet janet_wrap_u64(uint64_t x) {
18951|  18.5k|    uint64_t *box = janet_abstract(&janet_u64_type, sizeof(uint64_t));
18952|  18.5k|    *box = (uint64_t)x;
18953|  18.5k|    return janet_wrap_abstract(box);
  ------------------
  |  |  851|  18.5k|#define janet_wrap_abstract(s) janet_nanbox_wrap_((s), JANET_ABSTRACT)
  |  |  ------------------
  |  |  |  |  825|  18.5k|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  18.5k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  18.5k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
18954|  18.5k|}
janet_lib_inttypes:
19436|  6.14k|void janet_lib_inttypes(JanetTable *env) {
19437|  6.14k|    JanetRegExt it_cfuns[] = {
19438|  6.14k|        JANET_CORE_REG("int/s64", cfun_it_s64_new),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
19439|  6.14k|        JANET_CORE_REG("int/u64", cfun_it_u64_new),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
19440|  6.14k|        JANET_CORE_REG("int/to-number", cfun_to_number),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
19441|  6.14k|        JANET_CORE_REG("int/to-bytes", cfun_to_bytes),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
19442|  6.14k|        JANET_REG_END
  ------------------
  |  | 2110|  6.14k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
19443|  6.14k|    };
19444|       |    janet_core_cfuns_ext(env, NULL, it_cfuns);
19445|  6.14k|    janet_register_abstract_type(&janet_s64_type);
19446|  6.14k|    janet_register_abstract_type(&janet_u64_type);
19447|  6.14k|}
janet_file_close:
19763|  18.4k|int janet_file_close(JanetFile *file) {
19764|  18.4k|    int ret = 0;
19765|  18.4k|    if (!(file->flags & (JANET_FILE_NOT_CLOSEABLE | JANET_FILE_CLOSED))) {
  ------------------
  |  | 2278|  18.4k|#define JANET_FILE_NOT_CLOSEABLE 16
  ------------------
                  if (!(file->flags & (JANET_FILE_NOT_CLOSEABLE | JANET_FILE_CLOSED))) {
  ------------------
  |  | 2279|  18.4k|#define JANET_FILE_CLOSED 32
  ------------------
  |  Branch (19765:9): [True: 0, False: 18.4k]
  ------------------
19766|      0|        ret = fclose(file->file);
19767|      0|        file->flags |= JANET_FILE_CLOSED;
  ------------------
  |  | 2279|      0|#define JANET_FILE_CLOSED 32
  ------------------
19768|      0|        file->file = NULL; /* NULL dereference is easier to debug then other problems */
19769|      0|        return ret;
19770|      0|    }
19771|  18.4k|    return 0;
19772|  18.4k|}
janet_dynprintf:
20201|  18.8M|void janet_dynprintf(const char *name, FILE *dflt_file, const char *format, ...) {
20202|  18.8M|    va_list args;
20203|  18.8M|    va_start(args, format);
20204|  18.8M|    JanetType xtype;
20205|  18.8M|    Janet x;
20206|  18.8M|    if (!name || name[0] == '\0') { /* Allow NULL or empty string to just use dflt_file directly */
  ------------------
  |  Branch (20206:9): [True: 0, False: 18.8M]
  |  Branch (20206:18): [True: 0, False: 18.8M]
  ------------------
20207|      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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
20208|      0|        xtype = JANET_NIL;
20209|  18.8M|    } else {
20210|  18.8M|        x = janet_dyn(name);
20211|  18.8M|        xtype = janet_type(x);
  ------------------
  |  |  795|  18.8M|    (isnan((x).number) \
  |  |  796|  18.8M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|  18.8M|        : JANET_NUMBER)
  ------------------
  |  Branch (20211:17): [True: 18.8M, False: 0]
  ------------------
20212|  18.8M|    }
20213|  18.8M|    switch (xtype) {
20214|      0|        default:
  ------------------
  |  Branch (20214:9): [True: 0, False: 18.8M]
  ------------------
20215|       |            /* Other values simply do nothing */
20216|      0|            break;
20217|  18.8M|        case JANET_NIL:
  ------------------
  |  Branch (20217:9): [True: 18.8M, False: 0]
  ------------------
20218|  18.8M|        case JANET_ABSTRACT: {
  ------------------
  |  Branch (20218:9): [True: 0, False: 18.8M]
  ------------------
20219|  18.8M|            FILE *f = dflt_file;
20220|  18.8M|            JanetBuffer buffer;
20221|  18.8M|            int32_t len = 0;
20222|   239M|            while (format[len]) len++;
  ------------------
  |  Branch (20222:20): [True: 220M, False: 18.8M]
  ------------------
20223|  18.8M|            janet_buffer_init(&buffer, len);
20224|  18.8M|            janet_formatbv(&buffer, format, args);
20225|  18.8M|            if (xtype == JANET_ABSTRACT) {
  ------------------
  |  Branch (20225:17): [True: 0, False: 18.8M]
  ------------------
20226|      0|                void *abstract = janet_unwrap_abstract(x);
  ------------------
  |  |  866|      0|#define janet_unwrap_abstract(x) (janet_nanbox_to_pointer(x))
  ------------------
20227|      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 (20227:21): [True: 0, False: 0]
  ------------------
20228|      0|                    break;
20229|      0|                JanetFile *iofile = abstract;
20230|      0|                io_assert_writeable(iofile);
20231|      0|                f = iofile->file;
20232|      0|            }
20233|  18.8M|            fwrite(buffer.data, buffer.count, 1, f);
20234|  18.8M|            janet_buffer_deinit(&buffer);
20235|  18.8M|            break;
20236|  18.8M|        }
20237|      0|        case JANET_FUNCTION: {
  ------------------
  |  Branch (20237:9): [True: 0, False: 18.8M]
  ------------------
20238|      0|            JanetFunction *fun = janet_unwrap_function(x);
  ------------------
  |  |  868|      0|#define janet_unwrap_function(x) ((JanetFunction *)janet_nanbox_to_pointer(x))
  ------------------
20239|      0|            int32_t len = 0;
20240|      0|            while (format[len]) len++;
  ------------------
  |  Branch (20240:20): [True: 0, False: 0]
  ------------------
20241|      0|            JanetBuffer *buf = janet_buffer(len);
20242|      0|            janet_formatbv(buf, format, args);
20243|      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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
20244|      0|            janet_call(fun, 1, args);
20245|      0|            break;
20246|  18.8M|        }
20247|      0|        case JANET_BUFFER:
  ------------------
  |  Branch (20247:9): [True: 0, False: 18.8M]
  ------------------
20248|      0|            janet_formatbv(janet_unwrap_buffer(x), format, args);
  ------------------
  |  |  862|      0|#define janet_unwrap_buffer(x) ((JanetBuffer *)janet_nanbox_to_pointer(x))
  ------------------
20249|      0|            break;
20250|  18.8M|    }
20251|  18.8M|    va_end(args);
20252|  18.8M|    return;
20253|  18.8M|}
janet_makefile:
20271|  18.4k|Janet janet_makefile(FILE *f, int32_t flags) {
20272|  18.4k|    return janet_wrap_abstract(makef(f, flags, BUFSIZ));
  ------------------
  |  |  851|  18.4k|#define janet_wrap_abstract(s) janet_nanbox_wrap_((s), JANET_ABSTRACT)
  |  |  ------------------
  |  |  |  |  825|  18.4k|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
20273|  18.4k|}
janet_lib_io:
20286|  6.14k|void janet_lib_io(JanetTable *env) {
20287|  6.14k|    JanetRegExt io_cfuns[] = {
20288|  6.14k|        JANET_CORE_REG("print", cfun_io_print),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20289|  6.14k|        JANET_CORE_REG("prin", cfun_io_prin),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20290|  6.14k|        JANET_CORE_REG("printf", cfun_io_printf),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20291|  6.14k|        JANET_CORE_REG("prinf", cfun_io_prinf),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20292|  6.14k|        JANET_CORE_REG("eprin", cfun_io_eprin),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20293|  6.14k|        JANET_CORE_REG("eprint", cfun_io_eprint),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20294|  6.14k|        JANET_CORE_REG("eprintf", cfun_io_eprintf),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20295|  6.14k|        JANET_CORE_REG("eprinf", cfun_io_eprinf),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20296|  6.14k|        JANET_CORE_REG("xprint", cfun_io_xprint),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20297|  6.14k|        JANET_CORE_REG("xprin", cfun_io_xprin),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20298|  6.14k|        JANET_CORE_REG("xprintf", cfun_io_xprintf),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20299|  6.14k|        JANET_CORE_REG("xprinf", cfun_io_xprinf),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20300|  6.14k|        JANET_CORE_REG("flush", cfun_io_flush),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20301|  6.14k|        JANET_CORE_REG("eflush", cfun_io_eflush),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20302|  6.14k|        JANET_CORE_REG("file/temp", cfun_io_temp),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20303|  6.14k|        JANET_CORE_REG("file/open", cfun_io_fopen),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20304|  6.14k|        JANET_CORE_REG("file/close", cfun_io_fclose),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20305|  6.14k|        JANET_CORE_REG("file/read", cfun_io_fread),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20306|  6.14k|        JANET_CORE_REG("file/write", cfun_io_fwrite),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20307|  6.14k|        JANET_CORE_REG("file/flush", cfun_io_fflush),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20308|  6.14k|        JANET_CORE_REG("file/seek", cfun_io_fseek),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20309|  6.14k|        JANET_CORE_REG("file/tell", cfun_io_ftell),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
20310|  6.14k|        JANET_REG_END
  ------------------
  |  | 2110|  6.14k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
20311|  6.14k|    };
20312|  6.14k|    janet_core_cfuns_ext(env, NULL, io_cfuns);
20313|  6.14k|    janet_register_abstract_type(&janet_file_type);
20314|  6.14k|    int default_flags = JANET_FILE_NOT_CLOSEABLE | JANET_FILE_SERIALIZABLE;
  ------------------
  |  | 2278|  6.14k|#define JANET_FILE_NOT_CLOSEABLE 16
  ------------------
                  int default_flags = JANET_FILE_NOT_CLOSEABLE | JANET_FILE_SERIALIZABLE;
  ------------------
  |  | 2281|  6.14k|#define JANET_FILE_SERIALIZABLE 128
  ------------------
20315|       |    /* stdout */
20316|  6.14k|    JANET_CORE_DEF(env, "stdout",
  ------------------
  |  |  520|  6.14k|#define JANET_CORE_DEF(ENV, NAME, X, DOC) janet_core_def_sm(ENV, NAME, X, DOC, NULL, 0)
  ------------------
20317|  6.14k|                   janet_makefile(stdout, JANET_FILE_APPEND | default_flags),
20318|  6.14k|                   "The standard output file.");
20319|       |    /* stderr */
20320|  6.14k|    JANET_CORE_DEF(env, "stderr",
  ------------------
  |  |  520|  6.14k|#define JANET_CORE_DEF(ENV, NAME, X, DOC) janet_core_def_sm(ENV, NAME, X, DOC, NULL, 0)
  ------------------
20321|  6.14k|                   janet_makefile(stderr, JANET_FILE_APPEND | default_flags),
20322|  6.14k|                   "The standard error file.");
20323|       |    /* stdin */
20324|  6.14k|    JANET_CORE_DEF(env, "stdin",
  ------------------
  |  |  520|  6.14k|#define JANET_CORE_DEF(ENV, NAME, X, DOC) janet_core_def_sm(ENV, NAME, X, DOC, NULL, 0)
  ------------------
20325|  6.14k|                   janet_makefile(stdin, JANET_FILE_READ | default_flags),
20326|  6.14k|                   "The standard input file.");
20327|       |
20328|  6.14k|}
janet_unmarshal:
21991|  6.14k|    const uint8_t **next) {
21992|  6.14k|    UnmarshalState st;
21993|  6.14k|    st.start = bytes;
21994|  6.14k|    st.end = bytes + len;
21995|  6.14k|    st.lookup_defs = NULL;
21996|  6.14k|    st.lookup_envs = NULL;
21997|  6.14k|    st.lookup = NULL;
21998|  6.14k|    st.reg = reg;
21999|  6.14k|    Janet out;
22000|  6.14k|    const uint8_t *nextbytes = unmarshal_one(&st, bytes, &out, flags);
22001|  6.14k|    if (next) *next = nextbytes;
  ------------------
  |  Branch (22001:9): [True: 0, False: 6.14k]
  ------------------
22002|  6.14k|    janet_v_free(st.lookup_defs);
  ------------------
  |  |  756|  6.14k|#define janet_v_free(v)         (((v) != NULL) ? (janet_sfree(janet_v__raw(v)), 0) : 0)
  |  |  ------------------
  |  |  |  |  764|  6.14k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  ------------------
  |  |  |  Branch (756:34): [True: 6.14k, False: 0]
  |  |  ------------------
  ------------------
22003|  6.14k|    janet_v_free(st.lookup_envs);
  ------------------
  |  |  756|  6.14k|#define janet_v_free(v)         (((v) != NULL) ? (janet_sfree(janet_v__raw(v)), 0) : 0)
  |  |  ------------------
  |  |  |  |  764|  6.14k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  ------------------
  |  |  |  Branch (756:34): [True: 6.14k, False: 0]
  |  |  ------------------
  ------------------
22004|       |    janet_v_free(st.lookup);
  ------------------
  |  |  756|  6.14k|#define janet_v_free(v)         (((v) != NULL) ? (janet_sfree(janet_v__raw(v)), 0) : 0)
  |  |  ------------------
  |  |  |  |  764|  6.14k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  ------------------
  |  |  |  Branch (756:34): [True: 6.14k, False: 0]
  |  |  ------------------
  ------------------
22005|  6.14k|    return out;
22006|  6.14k|}
janet_lib_marsh:
22067|  6.14k|void janet_lib_marsh(JanetTable *env) {
22068|  6.14k|    JanetRegExt marsh_cfuns[] = {
22069|  6.14k|        JANET_CORE_REG("marshal", cfun_marshal),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22070|  6.14k|        JANET_CORE_REG("unmarshal", cfun_unmarshal),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22071|  6.14k|        JANET_CORE_REG("env-lookup", cfun_env_lookup),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22072|  6.14k|        JANET_REG_END
  ------------------
  |  | 2110|  6.14k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
22073|  6.14k|    };
22074|       |    janet_core_cfuns_ext(env, NULL, marsh_cfuns);
22075|  6.14k|}
janet_default_rng:
22150|  6.14k|JanetRNG *janet_default_rng(void) {
22151|  6.14k|    return &janet_vm.rng;
22152|  6.14k|}
janet_rng_seed:
22154|  12.2k|void janet_rng_seed(JanetRNG *rng, uint32_t seed) {
22155|  12.2k|    rng->a = seed;
22156|  12.2k|    rng->b = 0x97654321u;
22157|  12.2k|    rng->c = 123871873u;
22158|  12.2k|    rng->d = 0xf23f56c8u;
22159|  12.2k|    rng->counter = 0u;
22160|       |    /* First several numbers aren't that random. */
22161|   208k|    for (int i = 0; i < 16; i++) janet_rng_u32(rng);
  ------------------
  |  Branch (22161:21): [True: 196k, False: 12.2k]
  ------------------
22162|  12.2k|}
janet_rng_u32:
22178|   196k|uint32_t janet_rng_u32(JanetRNG *rng) {
22179|       |    /* Algorithm "xorwow" from p. 5 of Marsaglia, "Xorshift RNGs" */
22180|   196k|    uint32_t t = rng->d;
22181|   196k|    uint32_t const s = rng->a;
22182|   196k|    rng->d = rng->c;
22183|   196k|    rng->c = rng->b;
22184|   196k|    rng->b = s;
22185|   196k|    t ^= t >> 2;
22186|   196k|    t ^= t << 1;
22187|   196k|    t ^= s ^ (s << 4);
22188|   196k|    rng->a = t;
22189|   196k|    rng->counter += 362437;
22190|   196k|    return t + rng->counter;
22191|   196k|}
janet_lib_math:
22458|  6.14k|void janet_lib_math(JanetTable *env) {
22459|  6.14k|    JanetRegExt math_cfuns[] = {
22460|  6.14k|        JANET_CORE_REG("not", janet_not),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22461|  6.14k|        JANET_CORE_REG("math/random", janet_rand),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22462|  6.14k|        JANET_CORE_REG("math/seedrandom", janet_srand),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22463|  6.14k|        JANET_CORE_REG("math/cos", janet_cos),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22464|  6.14k|        JANET_CORE_REG("math/sin", janet_sin),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22465|  6.14k|        JANET_CORE_REG("math/tan", janet_tan),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22466|  6.14k|        JANET_CORE_REG("math/acos", janet_acos),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22467|  6.14k|        JANET_CORE_REG("math/asin", janet_asin),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22468|  6.14k|        JANET_CORE_REG("math/atan", janet_atan),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22469|  6.14k|        JANET_CORE_REG("math/exp", janet_exp),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22470|  6.14k|        JANET_CORE_REG("math/log", janet_log),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22471|  6.14k|        JANET_CORE_REG("math/log10", janet_log10),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22472|  6.14k|        JANET_CORE_REG("math/log2", janet_log2),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22473|  6.14k|        JANET_CORE_REG("math/sqrt", janet_sqrt),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22474|  6.14k|#ifndef JANET_PLAN9
22475|  6.14k|        JANET_CORE_REG("math/cbrt", janet_cbrt),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22476|  6.14k|        JANET_CORE_REG("math/gamma", janet_tgamma),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22477|  6.14k|        JANET_CORE_REG("math/log-gamma", janet_lgamma),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22478|  6.14k|        JANET_CORE_REG("math/erfc", janet_erfc),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22479|  6.14k|        JANET_CORE_REG("math/erf", janet_erf),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22480|  6.14k|        JANET_CORE_REG("math/expm1", janet_expm1),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22481|  6.14k|        JANET_CORE_REG("math/atanh", janet_atanh),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22482|  6.14k|        JANET_CORE_REG("math/asinh", janet_asinh),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22483|  6.14k|        JANET_CORE_REG("math/next", janet_nextafter),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22484|  6.14k|#endif
22485|  6.14k|        JANET_CORE_REG("math/floor", janet_floor),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22486|  6.14k|        JANET_CORE_REG("math/ceil", janet_ceil),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22487|  6.14k|        JANET_CORE_REG("math/pow", janet_pow),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22488|  6.14k|        JANET_CORE_REG("math/abs", janet_fabs),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22489|  6.14k|        JANET_CORE_REG("math/sinh", janet_sinh),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22490|  6.14k|        JANET_CORE_REG("math/cosh", janet_cosh),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22491|  6.14k|        JANET_CORE_REG("math/tanh", janet_tanh),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22492|  6.14k|        JANET_CORE_REG("math/acosh", janet_acosh),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22493|  6.14k|        JANET_CORE_REG("math/atan2", janet_atan2),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22494|  6.14k|        JANET_CORE_REG("math/rng", cfun_rng_make),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22495|  6.14k|        JANET_CORE_REG("math/rng-uniform", cfun_rng_uniform),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22496|  6.14k|        JANET_CORE_REG("math/rng-int", cfun_rng_int),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22497|  6.14k|        JANET_CORE_REG("math/rng-buffer", cfun_rng_buffer),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22498|  6.14k|        JANET_CORE_REG("math/hypot", janet_hypot),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22499|  6.14k|        JANET_CORE_REG("math/exp2", janet_exp2),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22500|  6.14k|        JANET_CORE_REG("math/log1p", janet_log1p),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22501|  6.14k|        JANET_CORE_REG("math/trunc", janet_trunc),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22502|  6.14k|        JANET_CORE_REG("math/round", janet_round),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22503|  6.14k|        JANET_CORE_REG("math/gcd", janet_cfun_gcd),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22504|  6.14k|        JANET_CORE_REG("math/lcm", janet_cfun_lcm),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22505|  6.14k|        JANET_CORE_REG("math/frexp", janet_cfun_frexp),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22506|  6.14k|        JANET_CORE_REG("math/ldexp", janet_cfun_ldexp),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
22507|  6.14k|        JANET_REG_END
  ------------------
  |  | 2110|  6.14k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
22508|  6.14k|    };
22509|  6.14k|    janet_core_cfuns_ext(env, NULL, math_cfuns);
22510|  6.14k|    janet_register_abstract_type(&janet_rng_type);
22511|       |#ifdef JANET_BOOTSTRAP
22512|       |    JANET_CORE_DEF(env, "math/pi", janet_wrap_number(3.1415926535897931),
22513|       |                   "The value pi.");
22514|       |    JANET_CORE_DEF(env, "math/e", janet_wrap_number(2.7182818284590451),
22515|       |                   "The base of the natural log.");
22516|       |    JANET_CORE_DEF(env, "math/inf", janet_wrap_number(INFINITY),
22517|       |                   "The number representing positive infinity");
22518|       |    JANET_CORE_DEF(env, "math/-inf", janet_wrap_number(-INFINITY),
22519|       |                   "The number representing negative infinity");
22520|       |    JANET_CORE_DEF(env, "math/int32-min", janet_wrap_number(INT32_MIN),
22521|       |                   "The minimum contiguous integer representable by a 32 bit signed integer");
22522|       |    JANET_CORE_DEF(env, "math/int32-max", janet_wrap_number(INT32_MAX),
22523|       |                   "The maximum contiguous integer representable by a 32 bit signed integer");
22524|       |    JANET_CORE_DEF(env, "math/int-min", janet_wrap_number(JANET_INTMIN_DOUBLE),
22525|       |                   "The minimum contiguous integer representable by a double (-(2^53))");
22526|       |    JANET_CORE_DEF(env, "math/int-max", janet_wrap_number(JANET_INTMAX_DOUBLE),
22527|       |                   "The maximum contiguous integer representable by a double (2^53)");
22528|       |#ifdef NAN
22529|       |    JANET_CORE_DEF(env, "math/nan", janet_wrap_number(NAN), "Not a number (IEEE-754 NaN)");
22530|       |#else
22531|       |    JANET_CORE_DEF(env, "math/nan", janet_wrap_number(0.0 / 0.0), "Not a number (IEEE-754 NaN)");
22532|       |#endif
22533|       |#endif
22534|  6.14k|}
janet_lib_net:
23805|  6.14k|void janet_lib_net(JanetTable *env) {
23806|  6.14k|    JanetRegExt net_cfuns[] = {
23807|  6.14k|        JANET_CORE_REG("net/address", cfun_net_sockaddr),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
23808|  6.14k|        JANET_CORE_REG("net/listen", cfun_net_listen),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
23809|  6.14k|        JANET_CORE_REG("net/socket", cfun_net_socket),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
23810|  6.14k|        JANET_CORE_REG("net/accept", cfun_stream_accept),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
23811|  6.14k|        JANET_CORE_REG("net/accept-loop", cfun_stream_accept_loop),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
23812|  6.14k|        JANET_CORE_REG("net/read", cfun_stream_read),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
23813|  6.14k|        JANET_CORE_REG("net/chunk", cfun_stream_chunk),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
23814|  6.14k|        JANET_CORE_REG("net/write", cfun_stream_write),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
23815|  6.14k|        JANET_CORE_REG("net/send-to", cfun_stream_send_to),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
23816|  6.14k|        JANET_CORE_REG("net/recv-from", cfun_stream_recv_from),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
23817|  6.14k|        JANET_CORE_REG("net/flush", cfun_stream_flush),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
23818|  6.14k|        JANET_CORE_REG("net/connect", cfun_net_connect),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
23819|  6.14k|        JANET_CORE_REG("net/shutdown", cfun_net_shutdown),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
23820|  6.14k|        JANET_CORE_REG("net/peername", cfun_net_getpeername),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
23821|  6.14k|        JANET_CORE_REG("net/localname", cfun_net_getsockname),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
23822|  6.14k|        JANET_CORE_REG("net/address-unpack", cfun_net_address_unpack),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
23823|  6.14k|        JANET_CORE_REG("net/setsockopt", cfun_net_setsockopt),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
23824|  6.14k|        JANET_REG_END
  ------------------
  |  | 2110|  6.14k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
23825|  6.14k|    };
23826|       |    janet_core_cfuns_ext(env, NULL, net_cfuns);
23827|  6.14k|}
janet_net_init:
23829|  6.14k|void janet_net_init(void) {
23830|       |#ifdef JANET_WINDOWS
23831|       |    WSADATA wsaData;
23832|       |    janet_assert(!WSAStartup(MAKEWORD(2, 2), &wsaData), "could not start winsock");
23833|       |    janet_vm.connect_ex_loaded = 0;
23834|       |    janet_vm.connect_ex = NULL;
23835|       |#endif
23836|  6.14k|}
janet_net_deinit:
23838|  6.14k|void janet_net_deinit(void) {
23839|       |#ifdef JANET_WINDOWS
23840|       |    WSACleanup();
23841|       |#endif
23842|  6.14k|}
janet_lib_os:
26854|  6.14k|void janet_lib_os(JanetTable *env) {
26855|       |#if !defined(JANET_REDUCED_OS) && defined(JANET_WINDOWS) && defined(JANET_THREADS)
26856|       |    /* During start up, the top-most abstract machine (thread)
26857|       |     * in the thread tree sets up the critical section. */
26858|       |    static volatile long env_lock_initializing = 0;
26859|       |    static volatile long env_lock_initialized = 0;
26860|       |    if (!InterlockedExchange(&env_lock_initializing, 1)) {
26861|       |        InitializeCriticalSection(&env_lock);
26862|       |        InterlockedOr(&env_lock_initialized, 1);
26863|       |    } else {
26864|       |        while (!InterlockedOr(&env_lock_initialized, 0)) {
26865|       |            Sleep(0);
26866|       |        }
26867|       |    }
26868|       |
26869|       |#endif
26870|  6.14k|#ifndef JANET_NO_PROCESSES
26871|  6.14k|#endif
26872|  6.14k|    JanetRegExt os_cfuns[] = {
26873|  6.14k|        JANET_CORE_REG("os/exit", os_exit),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26874|  6.14k|        JANET_CORE_REG("os/which", os_which),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26875|  6.14k|        JANET_CORE_REG("os/arch", os_arch),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26876|  6.14k|        JANET_CORE_REG("os/compiler", os_compiler),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26877|  6.14k|#ifndef JANET_REDUCED_OS
26878|       |
26879|       |        /* misc (un-sandboxed) */
26880|  6.14k|        JANET_CORE_REG("os/cpu-count", os_cpu_count),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26881|  6.14k|        JANET_CORE_REG("os/cwd", os_cwd),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26882|  6.14k|        JANET_CORE_REG("os/cryptorand", os_cryptorand),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26883|  6.14k|        JANET_CORE_REG("os/perm-string", os_permission_string),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26884|  6.14k|        JANET_CORE_REG("os/perm-int", os_permission_int),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26885|  6.14k|        JANET_CORE_REG("os/mktime", os_mktime),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26886|  6.14k|        JANET_CORE_REG("os/time", os_time), /* not high resolution */
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26887|  6.14k|        JANET_CORE_REG("os/date", os_date), /* not high resolution */
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26888|  6.14k|        JANET_CORE_REG("os/strftime", os_strftime),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26889|  6.14k|        JANET_CORE_REG("os/sleep", os_sleep),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26890|  6.14k|        JANET_CORE_REG("os/isatty", os_isatty),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26891|  6.14k|#ifndef JANET_NO_LOCALES
26892|  6.14k|        JANET_CORE_REG("os/setlocale", os_setlocale),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26893|  6.14k|#endif
26894|       |
26895|       |        /* env functions */
26896|  6.14k|#ifndef JANET_PLAN9
26897|  6.14k|        JANET_CORE_REG("os/environ", os_environ),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26898|  6.14k|#endif
26899|  6.14k|        JANET_CORE_REG("os/getenv", os_getenv),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26900|  6.14k|        JANET_CORE_REG("os/setenv", os_setenv),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26901|       |
26902|       |        /* fs read */
26903|  6.14k|        JANET_CORE_REG("os/dir", os_dir),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26904|  6.14k|        JANET_CORE_REG("os/stat", os_stat),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26905|  6.14k|        JANET_CORE_REG("os/lstat", os_lstat),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26906|  6.14k|        JANET_CORE_REG("os/realpath", os_realpath),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26907|  6.14k|        JANET_CORE_REG("os/cd", os_cd),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26908|  6.14k|#ifndef JANET_NO_UMASK
26909|  6.14k|        JANET_CORE_REG("os/umask", os_umask),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26910|  6.14k|#endif
26911|  6.14k|#ifndef JANET_NO_SYMLINKS
26912|  6.14k|        JANET_CORE_REG("os/readlink", os_readlink),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26913|  6.14k|#endif
26914|       |
26915|       |        /* fs write */
26916|  6.14k|        JANET_CORE_REG("os/mkdir", os_mkdir),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26917|  6.14k|        JANET_CORE_REG("os/rmdir", os_rmdir),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26918|  6.14k|        JANET_CORE_REG("os/rm", os_remove),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26919|  6.14k|        JANET_CORE_REG("os/link", os_link),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26920|  6.14k|        JANET_CORE_REG("os/rename", os_rename),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26921|  6.14k|        JANET_CORE_REG("os/chmod", os_chmod),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26922|  6.14k|        JANET_CORE_REG("os/touch", os_touch),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26923|  6.14k|#ifndef JANET_NO_SYMLINKS
26924|  6.14k|        JANET_CORE_REG("os/symlink", os_symlink),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26925|  6.14k|#endif
26926|       |
26927|       |        /* processes */
26928|  6.14k|#ifndef JANET_NO_PROCESSES
26929|  6.14k|        JANET_CORE_REG("os/execute", os_execute),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26930|  6.14k|        JANET_CORE_REG("os/spawn", os_spawn),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26931|  6.14k|        JANET_CORE_REG("os/shell", os_shell),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26932|  6.14k|        JANET_CORE_REG("os/posix-fork", os_posix_fork),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26933|  6.14k|        JANET_CORE_REG("os/posix-exec", os_posix_exec),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26934|  6.14k|        JANET_CORE_REG("os/posix-chroot", os_posix_chroot),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26935|       |        /* no need to sandbox process management if you can't create processes
26936|       |         * (allows for limited functionality if use exposes C-functions to create specific processes) */
26937|  6.14k|        JANET_CORE_REG("os/proc-wait", os_proc_wait),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26938|  6.14k|        JANET_CORE_REG("os/proc-kill", os_proc_kill),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26939|  6.14k|        JANET_CORE_REG("os/proc-close", os_proc_close),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26940|  6.14k|        JANET_CORE_REG("os/getpid", os_proc_getpid),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26941|  6.14k|#ifdef JANET_EV
26942|  6.14k|        JANET_CORE_REG("os/sigaction", os_sigaction),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26943|  6.14k|#endif
26944|  6.14k|#endif
26945|       |
26946|       |        /* high resolution timers */
26947|  6.14k|        JANET_CORE_REG("os/clock", os_clock),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26948|       |
26949|  6.14k|#ifdef JANET_EV
26950|  6.14k|        JANET_CORE_REG("os/open", os_open), /* fs read and write */
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26951|  6.14k|        JANET_CORE_REG("os/pipe", os_pipe),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
26952|  6.14k|#endif
26953|  6.14k|#endif
26954|  6.14k|        JANET_REG_END
  ------------------
  |  | 2110|  6.14k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
26955|  6.14k|    };
26956|       |    janet_core_cfuns_ext(env, NULL, os_cfuns);
26957|  6.14k|}
janet_is_symbol_char:
27017|   164k|int janet_is_symbol_char(uint8_t c) {
27018|   164k|    return symchars[c >> 5] & ((uint32_t)1 << (c & 0x1F));
27019|   164k|}
janet_valid_utf8:
27024|    854|int janet_valid_utf8(const uint8_t *str, int32_t len) {
27025|    854|    int32_t i = 0;
27026|    854|    int32_t j;
27027|  4.24k|    while (i < len) {
  ------------------
  |  Branch (27027:12): [True: 3.70k, False: 540]
  ------------------
27028|  3.70k|        int32_t nexti;
27029|  3.70k|        uint8_t c = str[i];
27030|       |
27031|       |        /* Check the number of bytes in code point */
27032|  3.70k|        if (c < 0x80) nexti = i + 1;
  ------------------
  |  Branch (27032:13): [True: 2.43k, False: 1.26k]
  ------------------
27033|  1.26k|        else if ((c >> 5) == 0x06) nexti = i + 2;
  ------------------
  |  Branch (27033:18): [True: 528, False: 741]
  ------------------
27034|    741|        else if ((c >> 4) == 0x0E) nexti = i + 3;
  ------------------
  |  Branch (27034:18): [True: 352, False: 389]
  ------------------
27035|    389|        else if ((c >> 3) == 0x1E) nexti = i + 4;
  ------------------
  |  Branch (27035:18): [True: 246, False: 143]
  ------------------
27036|       |        /* Don't allow 5 or 6 byte code points */
27037|    143|        else return 0;
27038|       |
27039|       |        /* No overflow */
27040|  3.56k|        if (nexti > len) return 0;
  ------------------
  |  Branch (27040:13): [True: 89, False: 3.47k]
  ------------------
27041|       |
27042|       |        /* Ensure trailing bytes are well formed (10XX XXXX) */
27043|  5.21k|        for (j = i + 1; j < nexti; j++) {
  ------------------
  |  Branch (27043:25): [True: 1.79k, False: 3.42k]
  ------------------
27044|  1.79k|            if ((str[j] >> 6) != 2) return 0;
  ------------------
  |  Branch (27044:17): [True: 55, False: 1.74k]
  ------------------
27045|  1.79k|        }
27046|       |
27047|       |        /* Check for overlong encoding */
27048|  3.42k|        if ((nexti == i + 2) && str[i] < 0xC2) return 0;
  ------------------
  |  Branch (27048:13): [True: 440, False: 2.98k]
  |  Branch (27048:33): [True: 8, False: 432]
  ------------------
27049|  3.41k|        if ((str[i] == 0xE0) && str[i + 1] < 0xA0) return 0;
  ------------------
  |  Branch (27049:13): [True: 176, False: 3.23k]
  |  Branch (27049:33): [True: 11, False: 165]
  ------------------
27050|  3.40k|        if ((str[i] == 0xF0) && str[i + 1] < 0x90) return 0;
  ------------------
  |  Branch (27050:13): [True: 89, False: 3.31k]
  |  Branch (27050:33): [True: 8, False: 81]
  ------------------
27051|       |
27052|  3.39k|        i = nexti;
27053|  3.39k|    }
27054|    540|    return 1;
27055|    854|}
janet_parser_consume:
27659|   239k|void janet_parser_consume(JanetParser *parser, uint8_t c) {
27660|   239k|    int consumed = 0;
27661|   239k|    janet_parser_checkdead(parser);
27662|   239k|    if (c == '\r') {
  ------------------
  |  Branch (27662:9): [True: 1.97k, False: 237k]
  ------------------
27663|  1.97k|        parser->line++;
27664|  1.97k|        parser->column = 0;
27665|   237k|    } else if (c == '\n') {
  ------------------
  |  Branch (27665:16): [True: 9.45k, False: 228k]
  ------------------
27666|  9.45k|        parser->column = 0;
27667|  9.45k|        if (parser->lookback != '\r')
  ------------------
  |  Branch (27667:13): [True: 8.85k, False: 596]
  ------------------
27668|  8.85k|            parser->line++;
27669|   228k|    } else {
27670|   228k|        parser->column++;
27671|   228k|    }
27672|   541k|    while (!consumed && !parser->error) {
  ------------------
  |  Branch (27672:12): [True: 302k, False: 238k]
  |  Branch (27672:25): [True: 301k, False: 699]
  ------------------
27673|   301k|        JanetParseState *state = parser->states + parser->statecount - 1;
27674|   301k|        consumed = state->consumer(parser, state, c);
27675|   301k|    }
27676|   239k|    parser->lookback = c;
27677|   239k|}
janet_parser_eof:
27679|  5.55k|void janet_parser_eof(JanetParser *parser) {
27680|  5.55k|    janet_parser_checkdead(parser);
27681|  5.55k|    size_t oldcolumn = parser->column;
27682|  5.55k|    size_t oldline = parser->line;
27683|  5.55k|    janet_parser_consume(parser, '\n');
27684|  5.55k|    if (parser->statecount > 1) {
  ------------------
  |  Branch (27684:9): [True: 1.27k, False: 4.27k]
  ------------------
27685|  1.27k|        delim_error(parser, parser->statecount - 1, 0, "unexpected end of source");
27686|  1.27k|    }
27687|  5.55k|    parser->line = oldline;
27688|  5.55k|    parser->column = oldcolumn;
27689|  5.55k|    parser->flag |= JANET_PARSER_DEAD;
  ------------------
  |  |26991|  5.55k|#define JANET_PARSER_DEAD 0x1
  ------------------
27690|  5.55k|}
janet_parser_status:
27692|   246k|enum JanetParserStatus janet_parser_status(JanetParser *parser) {
27693|   246k|    if (parser->error) return JANET_PARSE_ERROR;
  ------------------
  |  Branch (27693:9): [True: 3.04k, False: 243k]
  ------------------
27694|   243k|    if (parser->flag) return JANET_PARSE_DEAD;
  ------------------
  |  Branch (27694:9): [True: 4.27k, False: 238k]
  ------------------
27695|   238k|    if (parser->statecount > 1) return JANET_PARSE_PENDING;
  ------------------
  |  Branch (27695:9): [True: 226k, False: 12.7k]
  ------------------
27696|  12.7k|    return JANET_PARSE_ROOT;
27697|   238k|}
janet_parser_produce:
27718|  4.20k|Janet janet_parser_produce(JanetParser *parser) {
27719|  4.20k|    Janet ret;
27720|  4.20k|    size_t i;
27721|  4.20k|    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 (27721:9): [True: 0, False: 4.20k]
  ------------------
27722|  4.20k|    ret = janet_unwrap_tuple(parser->args[0])[0];
  ------------------
  |  |  858|  4.20k|#define janet_unwrap_tuple(x) ((JanetTuple)janet_nanbox_to_pointer(x))
  ------------------
27723|  9.03k|    for (i = 1; i < parser->argcount; i++) {
  ------------------
  |  Branch (27723:17): [True: 4.82k, False: 4.20k]
  ------------------
27724|  4.82k|        parser->args[i - 1] = parser->args[i];
27725|  4.82k|    }
27726|  4.20k|    parser->pending--;
27727|  4.20k|    parser->argcount--;
27728|  4.20k|    parser->states[0].argn--;
27729|  4.20k|    return ret;
27730|  4.20k|}
janet_parser_init:
27746|  6.14k|void janet_parser_init(JanetParser *parser) {
27747|  6.14k|    parser->args = NULL;
27748|  6.14k|    parser->states = NULL;
27749|  6.14k|    parser->buf = NULL;
27750|  6.14k|    parser->argcount = 0;
27751|  6.14k|    parser->argcap = 0;
27752|  6.14k|    parser->bufcount = 0;
27753|  6.14k|    parser->bufcap = 0;
27754|  6.14k|    parser->statecount = 0;
27755|  6.14k|    parser->statecap = 0;
27756|  6.14k|    parser->error = NULL;
27757|  6.14k|    parser->lookback = -1;
27758|  6.14k|    parser->line = 1;
27759|  6.14k|    parser->column = 0;
27760|  6.14k|    parser->pending = 0;
27761|  6.14k|    parser->flag = 0;
27762|       |
27763|  6.14k|    pushstate(parser, root, PFLAG_CONTAINER);
  ------------------
  |  |27096|  6.14k|#define PFLAG_CONTAINER 0x100
  ------------------
27764|  6.14k|}
janet_parser_deinit:
27766|  6.14k|void janet_parser_deinit(JanetParser *parser) {
27767|  6.14k|    janet_free(parser->args);
  ------------------
  |  | 2415|  6.14k|#define janet_free(X) free((X))
  ------------------
27768|  6.14k|    janet_free(parser->buf);
  ------------------
  |  | 2415|  6.14k|#define janet_free(X) free((X))
  ------------------
27769|  6.14k|    janet_free(parser->states);
  ------------------
  |  | 2415|  6.14k|#define janet_free(X) free((X))
  ------------------
27770|  6.14k|}
janet_parser_has_more:
27817|  4.27k|int janet_parser_has_more(JanetParser *parser) {
27818|  4.27k|    return !!parser->pending;
27819|  4.27k|}
janet_lib_parse:
28271|  6.14k|void janet_lib_parse(JanetTable *env) {
28272|  6.14k|    JanetRegExt parse_cfuns[] = {
28273|  6.14k|        JANET_CORE_REG("parser/new", cfun_parse_parser),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
28274|  6.14k|        JANET_CORE_REG("parser/clone", cfun_parse_clone),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
28275|  6.14k|        JANET_CORE_REG("parser/has-more", cfun_parse_has_more),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
28276|  6.14k|        JANET_CORE_REG("parser/produce", cfun_parse_produce),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
28277|  6.14k|        JANET_CORE_REG("parser/consume", cfun_parse_consume),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
28278|  6.14k|        JANET_CORE_REG("parser/byte", cfun_parse_byte),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
28279|  6.14k|        JANET_CORE_REG("parser/error", cfun_parse_error),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
28280|  6.14k|        JANET_CORE_REG("parser/status", cfun_parse_status),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
28281|  6.14k|        JANET_CORE_REG("parser/flush", cfun_parse_flush),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
28282|  6.14k|        JANET_CORE_REG("parser/state", cfun_parse_state),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
28283|  6.14k|        JANET_CORE_REG("parser/where", cfun_parse_where),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
28284|  6.14k|        JANET_CORE_REG("parser/eof", cfun_parse_eof),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
28285|  6.14k|        JANET_CORE_REG("parser/insert", cfun_parse_insert),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
28286|  6.14k|        JANET_REG_END
  ------------------
  |  | 2110|  6.14k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
28287|  6.14k|    };
28288|       |    janet_core_cfuns_ext(env, NULL, parse_cfuns);
28289|  6.14k|}
cfun_peg_match:
30306|  4.20k|              "Returns nil if text does not match the language defined by peg. The syntax of PEGs is documented on the Janet website.") {
30307|  4.20k|    PegCall c = peg_cfun_init(argc, argv, 0);
30308|  4.20k|    const uint8_t *result = peg_rule(&c.s, c.s.bytecode, c.bytes.bytes + c.start);
30309|  4.20k|    return result ? janet_wrap_array(c.s.captures) : janet_wrap_nil();
  ------------------
  |  |  845|  1.05k|#define janet_wrap_array(s) janet_nanbox_wrap_((s), JANET_ARRAY)
  |  |  ------------------
  |  |  |  |  825|  1.05k|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  1.05k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  1.05k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  return result ? janet_wrap_array(c.s.captures) : janet_wrap_nil();
  ------------------
  |  |  831|  3.15k|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|  3.15k|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  3.15k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  3.15k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (30309:12): [True: 1.05k, False: 3.15k]
  ------------------
30310|  4.20k|}
janet_lib_peg:
30407|  6.14k|void janet_lib_peg(JanetTable *env) {
30408|  6.14k|    JanetRegExt cfuns[] = {
30409|  6.14k|        JANET_CORE_REG("peg/compile", cfun_peg_compile),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
30410|  6.14k|        JANET_CORE_REG("peg/match", cfun_peg_match),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
30411|  6.14k|        JANET_CORE_REG("peg/find", cfun_peg_find),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
30412|  6.14k|        JANET_CORE_REG("peg/find-all", cfun_peg_find_all),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
30413|  6.14k|        JANET_CORE_REG("peg/replace", cfun_peg_replace),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
30414|  6.14k|        JANET_CORE_REG("peg/replace-all", cfun_peg_replace_all),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
30415|  6.14k|        JANET_REG_END
  ------------------
  |  | 2110|  6.14k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
30416|  6.14k|    };
30417|       |    janet_core_cfuns_ext(env, NULL, cfuns);
30418|  6.14k|    janet_register_abstract_type(&janet_peg_type);
30419|  6.14k|}
janet_to_string_b:
30649|  21.7M|void janet_to_string_b(JanetBuffer *buffer, Janet x) {
30650|  21.7M|    switch (janet_type(x)) {
  ------------------
  |  |  795|  21.7M|    (isnan((x).number) \
  |  |  796|  21.7M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|  21.7M|        : JANET_NUMBER)
  ------------------
  |  Branch (30650:13): [True: 11.7M, False: 10.0M]
  ------------------
30651|  54.5k|        case JANET_NIL:
  ------------------
  |  Branch (30651:9): [True: 54.5k, False: 21.7M]
  ------------------
30652|  54.5k|            janet_buffer_push_cstring(buffer, "");
30653|  54.5k|            break;
30654|  5.47k|        case JANET_BOOLEAN:
  ------------------
  |  Branch (30654:9): [True: 5.47k, False: 21.7M]
  ------------------
30655|  5.47k|            janet_buffer_push_cstring(buffer,
30656|  5.47k|                                      janet_unwrap_boolean(x) ? "true" : "false");
  ------------------
  |  |  838|  5.47k|#define janet_unwrap_boolean(x) ((x).u64 & 0x1)
  |  |  ------------------
  |  |  |  Branch (838:33): [True: 5.46k, False: 14]
  |  |  ------------------
  ------------------
30657|  5.47k|            break;
30658|  10.0M|        case JANET_NUMBER:
  ------------------
  |  Branch (30658:9): [True: 10.0M, False: 11.7M]
  ------------------
30659|  10.0M|            number_to_string_b(buffer, janet_unwrap_number(x));
  ------------------
  |  |  839|  10.0M|#define janet_unwrap_number(x) ((x).number)
  ------------------
30660|  10.0M|            break;
30661|  1.66k|        case JANET_STRING:
  ------------------
  |  Branch (30661:9): [True: 1.66k, False: 21.7M]
  ------------------
30662|  10.4M|        case JANET_SYMBOL:
  ------------------
  |  Branch (30662:9): [True: 10.4M, False: 11.2M]
  ------------------
30663|  11.7M|        case JANET_KEYWORD:
  ------------------
  |  Branch (30663:9): [True: 1.23M, False: 20.5M]
  ------------------
30664|  11.7M|            janet_buffer_push_bytes(buffer,
30665|  11.7M|                                    janet_unwrap_string(x),
  ------------------
  |  |  863|  11.7M|#define janet_unwrap_string(x) ((JanetString)janet_nanbox_to_pointer(x))
  ------------------
30666|  11.7M|                                    janet_string_length(janet_unwrap_string(x)));
  ------------------
  |  | 1813|  11.7M|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  ------------------
  |  |  |  | 1812|  11.7M|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
30667|  11.7M|            break;
30668|      0|        case JANET_BUFFER: {
  ------------------
  |  Branch (30668:9): [True: 0, False: 21.7M]
  ------------------
30669|      0|            JanetBuffer *to = janet_unwrap_buffer(x);
  ------------------
  |  |  862|      0|#define janet_unwrap_buffer(x) ((JanetBuffer *)janet_nanbox_to_pointer(x))
  ------------------
30670|       |            /* Prevent resizing buffer while appending */
30671|      0|            if (buffer == to) janet_buffer_extra(buffer, to->count);
  ------------------
  |  Branch (30671:17): [True: 0, False: 0]
  ------------------
30672|      0|            janet_buffer_push_bytes(buffer, to->data, to->count);
30673|      0|            break;
30674|  10.4M|        }
30675|      0|        case JANET_ABSTRACT: {
  ------------------
  |  Branch (30675:9): [True: 0, False: 21.7M]
  ------------------
30676|      0|            JanetAbstract p = janet_unwrap_abstract(x);
  ------------------
  |  |  866|      0|#define janet_unwrap_abstract(x) (janet_nanbox_to_pointer(x))
  ------------------
30677|      0|            const JanetAbstractType *t = janet_abstract_type(p);
  ------------------
  |  | 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)))
  |  |  ------------------
  ------------------
30678|      0|            if (t->tostring != NULL) {
  ------------------
  |  Branch (30678:17): [True: 0, False: 0]
  ------------------
30679|      0|                t->tostring(p, buffer);
30680|      0|            } else {
30681|      0|                string_description_b(buffer, t->name, p);
30682|      0|            }
30683|      0|        }
30684|      0|        return;
30685|      0|        case JANET_CFUNCTION: {
  ------------------
  |  Branch (30685:9): [True: 0, False: 21.7M]
  ------------------
30686|      0|            JanetCFunRegistry *reg = janet_registry_get(janet_unwrap_cfunction(x));
  ------------------
  |  |  869|      0|#define janet_unwrap_cfunction(x) ((JanetCFunction)janet_nanbox_to_pointer(x))
  ------------------
30687|      0|            if (NULL != reg) {
  ------------------
  |  Branch (30687:17): [True: 0, False: 0]
  ------------------
30688|      0|                janet_buffer_push_cstring(buffer, "<cfunction ");
30689|      0|                if (NULL != reg->name_prefix) {
  ------------------
  |  Branch (30689:21): [True: 0, False: 0]
  ------------------
30690|      0|                    janet_buffer_push_cstring(buffer, reg->name_prefix);
30691|      0|                    janet_buffer_push_u8(buffer, '/');
30692|      0|                }
30693|      0|                janet_buffer_push_cstring(buffer, reg->name);
30694|      0|                janet_buffer_push_u8(buffer, '>');
30695|      0|                break;
30696|      0|            }
30697|      0|            goto fallthrough;
30698|      0|        }
30699|      0|        case JANET_FUNCTION: {
  ------------------
  |  Branch (30699:9): [True: 0, False: 21.7M]
  ------------------
30700|      0|            JanetFunction *fun = janet_unwrap_function(x);
  ------------------
  |  |  868|      0|#define janet_unwrap_function(x) ((JanetFunction *)janet_nanbox_to_pointer(x))
  ------------------
30701|      0|            JanetFuncDef *def = fun->def;
30702|      0|            if (def == NULL) {
  ------------------
  |  Branch (30702:17): [True: 0, False: 0]
  ------------------
30703|      0|                janet_buffer_push_cstring(buffer, "<incomplete function>");
30704|      0|                break;
30705|      0|            }
30706|      0|            if (def->name) {
  ------------------
  |  Branch (30706:17): [True: 0, False: 0]
  ------------------
30707|      0|                const uint8_t *n = def->name;
30708|      0|                janet_buffer_push_cstring(buffer, "<function ");
30709|      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)))
  |  |  ------------------
  ------------------
30710|      0|                janet_buffer_push_u8(buffer, '>');
30711|      0|                break;
30712|      0|            }
30713|      0|            goto fallthrough;
30714|      0|        }
30715|      0|    fallthrough:
30716|  3.09k|        default:
  ------------------
  |  Branch (30716:9): [True: 3.09k, False: 21.7M]
  ------------------
30717|  3.09k|            string_description_b(buffer, janet_type_names[janet_type(x)], janet_unwrap_pointer(x));
  ------------------
  |  |  795|  3.09k|    (isnan((x).number) \
  |  |  796|  3.09k|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|  3.09k|        : JANET_NUMBER)
  ------------------
                          string_description_b(buffer, janet_type_names[janet_type(x)], janet_unwrap_pointer(x));
  ------------------
  |  |  867|  3.09k|#define janet_unwrap_pointer(x) (janet_nanbox_to_pointer(x))
  ------------------
  |  Branch (30717:59): [True: 3.09k, False: 0]
  ------------------
30718|  3.09k|            break;
30719|  21.7M|    }
30720|  21.7M|}
janet_description_b:
30735|  36.0M|void janet_description_b(JanetBuffer *buffer, Janet x) {
30736|  36.0M|    switch (janet_type(x)) {
  ------------------
  |  |  795|  36.0M|    (isnan((x).number) \
  |  |  796|  36.0M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|  36.0M|        : JANET_NUMBER)
  ------------------
  |  Branch (30736:13): [True: 26.1M, False: 9.93M]
  ------------------
30737|  20.4M|        default:
  ------------------
  |  Branch (30737:9): [True: 20.4M, False: 15.6M]
  ------------------
30738|  20.4M|            break;
30739|  20.4M|        case JANET_NIL:
  ------------------
  |  Branch (30739:9): [True: 964k, False: 35.1M]
  ------------------
30740|   964k|            janet_buffer_push_cstring(buffer, "nil");
30741|   964k|            return;
30742|  1.23M|        case JANET_KEYWORD:
  ------------------
  |  Branch (30742:9): [True: 1.23M, False: 34.8M]
  ------------------
30743|  1.23M|            janet_buffer_push_u8(buffer, ':');
30744|  1.23M|            break;
30745|  13.0M|        case JANET_STRING:
  ------------------
  |  Branch (30745:9): [True: 13.0M, False: 23.0M]
  ------------------
30746|  13.0M|            janet_escape_string_b(buffer, janet_unwrap_string(x));
  ------------------
  |  |  863|  13.0M|#define janet_unwrap_string(x) ((JanetString)janet_nanbox_to_pointer(x))
  ------------------
30747|  13.0M|            return;
30748|  14.6k|        case JANET_BUFFER: {
  ------------------
  |  Branch (30748:9): [True: 14.6k, False: 36.0M]
  ------------------
30749|  14.6k|            JanetBuffer *b = janet_unwrap_buffer(x);
  ------------------
  |  |  862|  14.6k|#define janet_unwrap_buffer(x) ((JanetBuffer *)janet_nanbox_to_pointer(x))
  ------------------
30750|  14.6k|            janet_escape_buffer_b(buffer, b);
30751|  14.6k|            return;
30752|      0|        }
30753|   405k|        case JANET_ABSTRACT: {
  ------------------
  |  Branch (30753:9): [True: 405k, False: 35.6M]
  ------------------
30754|   405k|            JanetAbstract p = janet_unwrap_abstract(x);
  ------------------
  |  |  866|   405k|#define janet_unwrap_abstract(x) (janet_nanbox_to_pointer(x))
  ------------------
30755|   405k|            const JanetAbstractType *t = janet_abstract_type(p);
  ------------------
  |  | 1899|   405k|#define janet_abstract_type(u) (janet_abstract_head(u)->type)
  |  |  ------------------
  |  |  |  | 1897|   405k|#define janet_abstract_head(u) ((JanetAbstractHead *)((char *)u - offsetof(JanetAbstractHead, data)))
  |  |  ------------------
  ------------------
30756|   405k|            if (t->tostring != NULL) {
  ------------------
  |  Branch (30756:17): [True: 405k, False: 0]
  ------------------
30757|   405k|                janet_buffer_push_cstring(buffer, "<");
30758|   405k|                janet_buffer_push_cstring(buffer, t->name);
30759|   405k|                janet_buffer_push_cstring(buffer, " ");
30760|   405k|                t->tostring(p, buffer);
30761|   405k|                janet_buffer_push_cstring(buffer, ">");
30762|   405k|            } else {
30763|      0|                string_description_b(buffer, t->name, p);
30764|      0|            }
30765|   405k|            return;
30766|      0|        }
30767|  36.0M|    }
30768|  21.6M|    janet_to_string_b(buffer, x);
30769|  21.6M|}
janet_formatbv:
31422|  18.8M|void janet_formatbv(JanetBuffer *b, const char *format, va_list args) {
31423|  18.8M|    const char *format_end = format + strlen(format);
31424|  18.8M|    const char *c = format;
31425|  18.8M|    int32_t startlen = b->count;
31426|   200M|    while (c < format_end) {
  ------------------
  |  Branch (31426:12): [True: 181M, False: 18.8M]
  ------------------
31427|   181M|        if (*c != '%') {
  ------------------
  |  Branch (31427:13): [True: 142M, False: 39.0M]
  ------------------
31428|   142M|            janet_buffer_push_u8(b, (uint8_t) *c++);
31429|   142M|        } else if (*++c == '%') {
  ------------------
  |  Branch (31429:20): [True: 0, False: 39.0M]
  ------------------
31430|      0|            janet_buffer_push_u8(b, (uint8_t) *c++);
31431|  39.0M|        } else {
31432|  39.0M|            char form[MAX_FORMAT], item[MAX_ITEM];
31433|  39.0M|            char width[3], precision[3];
31434|  39.0M|            int nb = 0; /* number of bytes in added item */
31435|  39.0M|            c = scanformat(c, form, width, precision);
31436|  39.0M|            switch (*c++) {
31437|      0|                case 'c': {
  ------------------
  |  Branch (31437:17): [True: 0, False: 39.0M]
  ------------------
31438|      0|                    int n = va_arg(args, int);
31439|      0|                    nb = snprintf(item, MAX_ITEM, form, n);
  ------------------
  |  |31345|      0|#define MAX_ITEM  256
  ------------------
31440|      0|                    break;
31441|      0|                }
31442|  20.4M|                case 'd':
  ------------------
  |  Branch (31442:17): [True: 20.4M, False: 18.6M]
  ------------------
31443|  20.4M|                case 'i': {
  ------------------
  |  Branch (31443:17): [True: 0, False: 39.0M]
  ------------------
31444|  20.4M|                    int64_t n = (int64_t) va_arg(args, int32_t);
31445|  20.4M|                    nb = snprintf(item, MAX_ITEM, form, n);
  ------------------
  |  |31345|  20.4M|#define MAX_ITEM  256
  ------------------
31446|  20.4M|                    break;
31447|  20.4M|                }
31448|      0|                case 'D':
  ------------------
  |  Branch (31448:17): [True: 0, False: 39.0M]
  ------------------
31449|      0|                case 'I': {
  ------------------
  |  Branch (31449:17): [True: 0, False: 39.0M]
  ------------------
31450|      0|                    int64_t n = va_arg(args, int64_t);
31451|      0|                    nb = snprintf(item, MAX_ITEM, form, n);
  ------------------
  |  |31345|      0|#define MAX_ITEM  256
  ------------------
31452|      0|                    break;
31453|      0|                }
31454|      0|                case 'x':
  ------------------
  |  Branch (31454:17): [True: 0, False: 39.0M]
  ------------------
31455|      0|                case 'X':
  ------------------
  |  Branch (31455:17): [True: 0, False: 39.0M]
  ------------------
31456|      0|                case 'o':
  ------------------
  |  Branch (31456:17): [True: 0, False: 39.0M]
  ------------------
31457|      0|                case 'u': {
  ------------------
  |  Branch (31457:17): [True: 0, False: 39.0M]
  ------------------
31458|      0|                    uint64_t n = va_arg(args, uint64_t);
31459|      0|                    nb = snprintf(item, MAX_ITEM, form, n);
  ------------------
  |  |31345|      0|#define MAX_ITEM  256
  ------------------
31460|      0|                    break;
31461|      0|                }
31462|      0|                case 'a':
  ------------------
  |  Branch (31462:17): [True: 0, False: 39.0M]
  ------------------
31463|      0|                case 'A':
  ------------------
  |  Branch (31463:17): [True: 0, False: 39.0M]
  ------------------
31464|      0|                case 'e':
  ------------------
  |  Branch (31464:17): [True: 0, False: 39.0M]
  ------------------
31465|      0|                case 'E':
  ------------------
  |  Branch (31465:17): [True: 0, False: 39.0M]
  ------------------
31466|      0|                case 'f':
  ------------------
  |  Branch (31466:17): [True: 0, False: 39.0M]
  ------------------
31467|      0|                case 'g':
  ------------------
  |  Branch (31467:17): [True: 0, False: 39.0M]
  ------------------
31468|      0|                case 'G': {
  ------------------
  |  Branch (31468:17): [True: 0, False: 39.0M]
  ------------------
31469|      0|                    double d = va_arg(args, double);
31470|      0|                    nb = snprintf(item, MAX_ITEM, form, d);
  ------------------
  |  |31345|      0|#define MAX_ITEM  256
  ------------------
31471|      0|                    break;
31472|      0|                }
31473|   208k|                case 's':
  ------------------
  |  Branch (31473:17): [True: 208k, False: 38.8M]
  ------------------
31474|   208k|                case 'S': {
  ------------------
  |  Branch (31474:17): [True: 416, False: 39.0M]
  ------------------
31475|   208k|                    const char *str = va_arg(args, const char *);
31476|   208k|                    int32_t len = (c[-1] == 's')
  ------------------
  |  Branch (31476:35): [True: 208k, False: 416]
  ------------------
31477|   208k|                                  ? (int32_t) strlen(str)
31478|   208k|                                  : janet_string_length((JanetString) str);
  ------------------
  |  | 1813|    416|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  ------------------
  |  |  |  | 1812|    416|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
31479|   208k|                    if (form[2] == '\0')
  ------------------
  |  Branch (31479:25): [True: 208k, False: 0]
  ------------------
31480|   208k|                        janet_buffer_push_bytes(b, (const uint8_t *) str, len);
31481|      0|                    else {
31482|      0|                        if (len != (int32_t) strlen((const char *) str))
  ------------------
  |  Branch (31482:29): [True: 0, False: 0]
  ------------------
31483|      0|                            janet_panic("string contains zeros");
31484|      0|                        if (!strchr(form, '.') && len >= 100) {
  ------------------
  |  Branch (31484:29): [True: 0, False: 0]
  |  Branch (31484:51): [True: 0, False: 0]
  ------------------
31485|      0|                            janet_panic("no precision and string is too long to be formatted");
31486|      0|                        } else {
31487|      0|                            nb = snprintf(item, MAX_ITEM, form, str);
  ------------------
  |  |31345|      0|#define MAX_ITEM  256
  ------------------
31488|      0|                        }
31489|      0|                    }
31490|   208k|                    break;
31491|   208k|                }
31492|   208k|                case 'V':
  ------------------
  |  Branch (31492:17): [True: 0, False: 39.0M]
  ------------------
31493|      0|                    janet_to_string_b(b, va_arg(args, Janet));
31494|      0|                    break;
31495|  8.88k|                case 'v':
  ------------------
  |  Branch (31495:17): [True: 8.88k, False: 39.0M]
  ------------------
31496|  8.88k|                    janet_description_b(b, va_arg(args, Janet));
31497|  8.88k|                    break;
31498|      0|                case 't':
  ------------------
  |  Branch (31498:17): [True: 0, False: 39.0M]
  ------------------
31499|      0|                    janet_buffer_push_cstring(b, typestr(va_arg(args, Janet)));
31500|      0|                    break;
31501|      0|                case 'T': {
  ------------------
  |  Branch (31501:17): [True: 0, False: 39.0M]
  ------------------
31502|      0|                    int types = va_arg(args, int);
31503|      0|                    pushtypes(b, types);
31504|      0|                    break;
31505|   208k|                }
31506|      0|                case 'M':
  ------------------
  |  Branch (31506:17): [True: 0, False: 39.0M]
  ------------------
31507|  18.4M|                case 'm':
  ------------------
  |  Branch (31507:17): [True: 18.4M, False: 20.6M]
  ------------------
31508|  18.4M|                case 'N':
  ------------------
  |  Branch (31508:17): [True: 0, False: 39.0M]
  ------------------
31509|  18.4M|                case 'n':
  ------------------
  |  Branch (31509:17): [True: 0, False: 39.0M]
  ------------------
31510|  18.4M|                case 'Q':
  ------------------
  |  Branch (31510:17): [True: 0, False: 39.0M]
  ------------------
31511|  18.4M|                case 'q':
  ------------------
  |  Branch (31511:17): [True: 0, False: 39.0M]
  ------------------
31512|  18.4M|                case 'P':
  ------------------
  |  Branch (31512:17): [True: 0, False: 39.0M]
  ------------------
31513|  18.4M|                case 'p': { /* janet pretty , precision = depth */
  ------------------
  |  Branch (31513:17): [True: 2.31k, False: 39.0M]
  ------------------
31514|  18.4M|                    int depth = atoi(precision);
31515|  18.4M|                    if (depth < 1) depth = JANET_RECURSION_GUARD;
  ------------------
  |  |  296|  18.4M|#define JANET_RECURSION_GUARD 1024
  ------------------
  |  Branch (31515:25): [True: 18.4M, False: 0]
  ------------------
31516|  18.4M|                    char d = c[-1];
31517|  18.4M|                    int has_color = (d == 'P') || (d == 'Q') || (d == 'M') || (d == 'N');
  ------------------
  |  Branch (31517:37): [True: 0, False: 18.4M]
  |  Branch (31517:51): [True: 0, False: 18.4M]
  |  Branch (31517:65): [True: 0, False: 18.4M]
  |  Branch (31517:79): [True: 0, False: 18.4M]
  ------------------
31518|  18.4M|                    int has_oneline = (d == 'Q') || (d == 'q') || (d == 'N') || (d == 'n');
  ------------------
  |  Branch (31518:39): [True: 0, False: 18.4M]
  |  Branch (31518:53): [True: 0, False: 18.4M]
  |  Branch (31518:67): [True: 0, False: 18.4M]
  |  Branch (31518:81): [True: 0, False: 18.4M]
  ------------------
31519|  18.4M|                    int has_notrunc = (d == 'M') || (d == 'm') || (d == 'N') || (d == 'n');
  ------------------
  |  Branch (31519:39): [True: 0, False: 18.4M]
  |  Branch (31519:53): [True: 18.4M, False: 2.31k]
  |  Branch (31519:67): [True: 0, False: 2.31k]
  |  Branch (31519:81): [True: 0, False: 2.31k]
  ------------------
31520|  18.4M|                    int columns = atoi(width);
31521|  18.4M|                    if (columns == 0) {
  ------------------
  |  Branch (31521:25): [True: 18.4M, False: 0]
  ------------------
31522|  18.4M|                        columns = JANET_COLUMNS;
  ------------------
  |  |31258|  18.4M|#define JANET_COLUMNS 80
  ------------------
31523|  18.4M|                    } else if (columns < 0) {
  ------------------
  |  Branch (31523:32): [True: 0, False: 0]
  ------------------
31524|      0|                        has_oneline = 1;
31525|      0|                    }
31526|  18.4M|                    int flags = 0;
31527|  18.4M|                    flags |= has_color ? JANET_PRETTY_COLOR : 0;
  ------------------
  |  | 1967|      0|#define JANET_PRETTY_COLOR 1
  ------------------
  |  Branch (31527:30): [True: 0, False: 18.4M]
  ------------------
31528|  18.4M|                    flags |= has_oneline ? JANET_PRETTY_ONELINE : 0;
  ------------------
  |  | 1968|      0|#define JANET_PRETTY_ONELINE 2
  ------------------
  |  Branch (31528:30): [True: 0, False: 18.4M]
  ------------------
31529|  18.4M|                    flags |= has_notrunc ? JANET_PRETTY_NOTRUNC : 0;
  ------------------
  |  | 1969|  18.4M|#define JANET_PRETTY_NOTRUNC 4
  ------------------
  |  Branch (31529:30): [True: 18.4M, False: 2.31k]
  ------------------
31530|  18.4M|                    janet_pretty_(b, depth, columns, flags,
31531|  18.4M|                                  va_arg(args, Janet), startlen, b->count);
31532|  18.4M|                    break;
31533|  18.4M|                }
31534|      0|                case 'j': {
  ------------------
  |  Branch (31534:17): [True: 0, False: 39.0M]
  ------------------
31535|      0|                    int depth = atoi(precision);
31536|      0|                    if (depth < 1) {
  ------------------
  |  Branch (31536:25): [True: 0, False: 0]
  ------------------
31537|      0|                        depth = JANET_RECURSION_GUARD;
  ------------------
  |  |  296|      0|#define JANET_RECURSION_GUARD 1024
  ------------------
31538|      0|                    }
31539|      0|                    janet_jdn_(b, depth, va_arg(args, Janet), startlen, b->count);
31540|      0|                    break;
31541|  18.4M|                }
31542|      0|                default: {
  ------------------
  |  Branch (31542:17): [True: 0, False: 39.0M]
  ------------------
31543|       |                    /* also treat cases 'nLlh' */
31544|      0|                    janet_panicf("invalid conversion '%s' to 'format'",
31545|      0|                                 form);
31546|  18.4M|                }
31547|  39.0M|            }
31548|  39.0M|            if (nb >= MAX_ITEM)
  ------------------
  |  |31345|  39.0M|#define MAX_ITEM  256
  ------------------
  |  Branch (31548:17): [True: 0, False: 39.0M]
  ------------------
31549|      0|                janet_panic("format buffer overflow");
31550|  39.0M|            if (nb > 0)
  ------------------
  |  Branch (31550:17): [True: 20.4M, False: 18.6M]
  ------------------
31551|  20.4M|                janet_buffer_push_bytes(b, (uint8_t *) item, nb);
31552|  39.0M|        }
31553|       |
31554|   181M|    }
31555|  18.8M|}
janet_formatc:
31559|  1.24k|const uint8_t *janet_formatc(const char *format, ...) {
31560|  1.24k|    va_list args;
31561|  1.24k|    const uint8_t *ret;
31562|  1.24k|    JanetBuffer buffer;
31563|  1.24k|    int32_t len = 0;
31564|       |
31565|       |    /* Calculate length, init buffer and args */
31566|  33.3k|    while (format[len]) len++;
  ------------------
  |  Branch (31566:12): [True: 32.0k, False: 1.24k]
  ------------------
31567|  1.24k|    janet_buffer_init(&buffer, len);
31568|  1.24k|    va_start(args, format);
31569|       |
31570|       |    /* Run format */
31571|  1.24k|    janet_formatbv(&buffer, format, args);
31572|       |
31573|       |    /* Iterate length */
31574|  1.24k|    va_end(args);
31575|       |
31576|  1.24k|    ret = janet_string(buffer.data, buffer.count);
31577|  1.24k|    janet_buffer_deinit(&buffer);
31578|  1.24k|    return ret;
31579|  1.24k|}
janet_formatb:
31581|  1.30k|JanetBuffer *janet_formatb(JanetBuffer *buffer, const char *format, ...) {
31582|  1.30k|    va_list args;
31583|  1.30k|    va_start(args, format);
31584|  1.30k|    janet_formatbv(buffer, format, args);
31585|       |    va_end(args);
31586|  1.30k|    return buffer;
31587|  1.30k|}
janet_string:
33498|  22.1M|const uint8_t *janet_string(const uint8_t *buf, int32_t len) {
33499|  22.1M|    JanetStringHead *head = janet_gcalloc(JANET_MEMORY_STRING, sizeof(JanetStringHead) + (size_t) len + 1);
33500|  22.1M|    head->length = len;
33501|  22.1M|    head->hash = janet_string_calchash(buf, len);
33502|  22.1M|    uint8_t *data = (uint8_t *)head->data;
33503|  22.1M|    safe_memcpy(data, buf, len);
33504|  22.1M|    data[len] = 0;
33505|  22.1M|    return data;
33506|  22.1M|}
janet_string_compare:
33509|   333k|int janet_string_compare(const uint8_t *lhs, const uint8_t *rhs) {
33510|   333k|    int32_t xlen = janet_string_length(lhs);
  ------------------
  |  | 1813|   333k|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  ------------------
  |  |  |  | 1812|   333k|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
33511|   333k|    int32_t ylen = janet_string_length(rhs);
  ------------------
  |  | 1813|   333k|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  ------------------
  |  |  |  | 1812|   333k|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
33512|   333k|    int32_t len = xlen > ylen ? ylen : xlen;
  ------------------
  |  Branch (33512:19): [True: 4.41k, False: 328k]
  ------------------
33513|   333k|    int res = memcmp(lhs, rhs, len);
33514|   333k|    if (res) return res > 0 ? 1 : -1;
  ------------------
  |  Branch (33514:9): [True: 310k, False: 22.9k]
  |  Branch (33514:21): [True: 286k, False: 23.9k]
  ------------------
33515|  22.9k|    if (xlen == ylen) return 0;
  ------------------
  |  Branch (33515:9): [True: 3.54k, False: 19.4k]
  ------------------
33516|  19.4k|    return xlen < ylen ? -1 : 1;
  ------------------
  |  Branch (33516:12): [True: 18.2k, False: 1.19k]
  ------------------
33517|  22.9k|}
janet_string_equalconst:
33520|  39.1M|int janet_string_equalconst(const uint8_t *lhs, const uint8_t *rhs, int32_t rlen, int32_t rhash) {
33521|  39.1M|    int32_t lhash = janet_string_hash(lhs);
  ------------------
  |  | 1814|  39.1M|#define janet_string_hash(s) (janet_string_head(s)->hash)
  |  |  ------------------
  |  |  |  | 1812|  39.1M|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
33522|  39.1M|    int32_t llen = janet_string_length(lhs);
  ------------------
  |  | 1813|  39.1M|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  ------------------
  |  |  |  | 1812|  39.1M|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
33523|  39.1M|    if (lhash != rhash || llen != rlen)
  ------------------
  |  Branch (33523:9): [True: 17.4M, False: 21.6M]
  |  Branch (33523:27): [True: 17, False: 21.6M]
  ------------------
33524|  17.4M|        return 0;
33525|  21.6M|    if (lhs == rhs)
  ------------------
  |  Branch (33525:9): [True: 12.2M, False: 9.37M]
  ------------------
33526|  12.2M|        return 1;
33527|  9.37M|    return !memcmp(lhs, rhs, rlen);
33528|  21.6M|}
janet_string_equal:
33531|  1.44k|int janet_string_equal(const uint8_t *lhs, const uint8_t *rhs) {
33532|  1.44k|    return janet_string_equalconst(lhs, rhs,
33533|  1.44k|                                   janet_string_length(rhs), janet_string_hash(rhs));
  ------------------
  |  | 1813|  1.44k|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  ------------------
  |  |  |  | 1812|  1.44k|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
                                                 janet_string_length(rhs), janet_string_hash(rhs));
  ------------------
  |  | 1814|  1.44k|#define janet_string_hash(s) (janet_string_head(s)->hash)
  |  |  ------------------
  |  |  |  | 1812|  1.44k|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
33534|  1.44k|}
janet_lib_string:
34106|  6.14k|void janet_lib_string(JanetTable *env) {
34107|  6.14k|    JanetRegExt string_cfuns[] = {
34108|  6.14k|        JANET_CORE_REG("string/slice", cfun_string_slice),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34109|  6.14k|        JANET_CORE_REG("keyword/slice", cfun_keyword_slice),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34110|  6.14k|        JANET_CORE_REG("symbol/slice", cfun_symbol_slice),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34111|  6.14k|        JANET_CORE_REG("string/repeat", cfun_string_repeat),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34112|  6.14k|        JANET_CORE_REG("string/bytes", cfun_string_bytes),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34113|  6.14k|        JANET_CORE_REG("string/from-bytes", cfun_string_frombytes),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34114|  6.14k|        JANET_CORE_REG("string/ascii-lower", cfun_string_asciilower),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34115|  6.14k|        JANET_CORE_REG("string/ascii-upper", cfun_string_asciiupper),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34116|  6.14k|        JANET_CORE_REG("string/reverse", cfun_string_reverse),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34117|  6.14k|        JANET_CORE_REG("string/find", cfun_string_find),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34118|  6.14k|        JANET_CORE_REG("string/find-all", cfun_string_findall),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34119|  6.14k|        JANET_CORE_REG("string/has-prefix?", cfun_string_hasprefix),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34120|  6.14k|        JANET_CORE_REG("string/has-suffix?", cfun_string_hassuffix),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34121|  6.14k|        JANET_CORE_REG("string/replace", cfun_string_replace),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34122|  6.14k|        JANET_CORE_REG("string/replace-all", cfun_string_replaceall),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34123|  6.14k|        JANET_CORE_REG("string/split", cfun_string_split),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34124|  6.14k|        JANET_CORE_REG("string/check-set", cfun_string_checkset),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34125|  6.14k|        JANET_CORE_REG("string/join", cfun_string_join),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34126|  6.14k|        JANET_CORE_REG("string/format", cfun_string_format),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34127|  6.14k|        JANET_CORE_REG("string/trim", cfun_string_trim),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34128|  6.14k|        JANET_CORE_REG("string/triml", cfun_string_triml),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34129|  6.14k|        JANET_CORE_REG("string/trimr", cfun_string_trimr),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34130|  6.14k|        JANET_REG_END
  ------------------
  |  | 2110|  6.14k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
34131|  6.14k|    };
34132|       |    janet_core_cfuns_ext(env, NULL, string_cfuns);
34133|  6.14k|}
janet_scan_number_base:
34394|  14.2k|    double *out) {
34395|  14.2k|    const uint8_t *end = str + len;
34396|  14.2k|    int seenadigit = 0;
34397|  14.2k|    int ex = 0;
34398|  14.2k|    int seenpoint = 0;
34399|  14.2k|    int foundexp = 0;
34400|  14.2k|    int neg = 0;
34401|  14.2k|    struct BigNat mant;
34402|  14.2k|    bignat_zero(&mant);
34403|       |
34404|       |    /* Prevent some kinds of overflow bugs relating to the exponent
34405|       |     * overflowing.  For example, if a string was passed 2GB worth of 0s after
34406|       |     * the decimal point, exponent could wrap around and become positive. It's
34407|       |     * easier to reject ridiculously large inputs than to check for overflows.
34408|       |     * */
34409|  14.2k|    if (len > JANET_NUMBER_LENGTH_RIDICULOUS) goto error;
  ------------------
  |  |34190|  14.2k|#define JANET_NUMBER_LENGTH_RIDICULOUS 0xFFFF
  ------------------
  |  Branch (34409:9): [True: 0, False: 14.2k]
  ------------------
34410|       |
34411|       |    /* Get sign */
34412|  14.2k|    if (str >= end) goto error;
  ------------------
  |  Branch (34412:9): [True: 0, False: 14.2k]
  ------------------
34413|  14.2k|    if (*str == '-') {
  ------------------
  |  Branch (34413:9): [True: 1.87k, False: 12.3k]
  ------------------
34414|  1.87k|        neg = 1;
34415|  1.87k|        str++;
34416|  12.3k|    } else if (*str == '+') {
  ------------------
  |  Branch (34416:16): [True: 1.25k, False: 11.1k]
  ------------------
34417|  1.25k|        str++;
34418|  1.25k|    }
34419|       |
34420|       |    /* Check for leading 0x or digit digit r */
34421|  14.2k|    if (base == 0) {
  ------------------
  |  Branch (34421:9): [True: 14.2k, False: 0]
  ------------------
34422|  14.2k|        if (str + 1 < end && str[0] == '0' && str[1] == 'x') {
  ------------------
  |  Branch (34422:13): [True: 7.97k, False: 6.25k]
  |  Branch (34422:30): [True: 1.27k, False: 6.70k]
  |  Branch (34422:47): [True: 308, False: 966]
  ------------------
34423|    308|            base = 16;
34424|    308|            str += 2;
34425|  13.9k|        } else if (str + 1 < end  &&
  ------------------
  |  Branch (34425:20): [True: 7.66k, False: 6.25k]
  ------------------
34426|  7.66k|                   str[0] >= '0' && str[0] <= '9' &&
  ------------------
  |  Branch (34426:20): [True: 5.94k, False: 1.72k]
  |  Branch (34426:37): [True: 5.52k, False: 420]
  ------------------
34427|  5.52k|                   str[1] == 'r') {
  ------------------
  |  Branch (34427:20): [True: 95, False: 5.43k]
  ------------------
34428|     95|            base = str[0] - '0';
34429|     95|            str += 2;
34430|  13.8k|        } else if (str + 2 < end  &&
  ------------------
  |  Branch (34430:20): [True: 4.86k, False: 8.96k]
  ------------------
34431|  4.86k|                   str[0] >= '0' && str[0] <= '9' &&
  ------------------
  |  Branch (34431:20): [True: 3.99k, False: 868]
  |  Branch (34431:37): [True: 3.81k, False: 181]
  ------------------
34432|  3.81k|                   str[1] >= '0' && str[1] <= '9' &&
  ------------------
  |  Branch (34432:20): [True: 2.59k, False: 1.21k]
  |  Branch (34432:37): [True: 2.11k, False: 484]
  ------------------
34433|  2.11k|                   str[2] == 'r') {
  ------------------
  |  Branch (34433:20): [True: 167, False: 1.94k]
  ------------------
34434|    167|            base = 10 * (str[0] - '0') + (str[1] - '0');
34435|    167|            if (base < 2 || base > 36) goto error;
  ------------------
  |  Branch (34435:17): [True: 34, False: 133]
  |  Branch (34435:29): [True: 49, False: 84]
  ------------------
34436|     84|            str += 3;
34437|     84|        }
34438|  14.2k|    }
34439|       |
34440|       |    /* If still base is 0, set to default (10) */
34441|  14.1k|    if (base == 0) {
  ------------------
  |  Branch (34441:9): [True: 13.7k, False: 406]
  ------------------
34442|  13.7k|        base = 10;
34443|  13.7k|    }
34444|  14.1k|    int exp_base = base;
34445|       |
34446|       |    /* Skip leading zeros */
34447|  19.4k|    while (str < end && (*str == '0' || *str == '.')) {
  ------------------
  |  Branch (34447:12): [True: 16.6k, False: 2.87k]
  |  Branch (34447:26): [True: 2.83k, False: 13.7k]
  |  Branch (34447:41): [True: 2.75k, False: 11.0k]
  ------------------
34448|  5.59k|        if (seenpoint) ex--;
  ------------------
  |  Branch (34448:13): [True: 678, False: 4.91k]
  ------------------
34449|  5.59k|        if (*str == '.') {
  ------------------
  |  Branch (34449:13): [True: 2.75k, False: 2.83k]
  ------------------
34450|  2.75k|            if (seenpoint) goto error;
  ------------------
  |  Branch (34450:17): [True: 266, False: 2.49k]
  ------------------
34451|  2.49k|            seenpoint = 1;
34452|  2.83k|        } else {
34453|  2.83k|            seenadigit = 1;
34454|  2.83k|        }
34455|  5.32k|        str++;
34456|  5.32k|    }
34457|       |
34458|       |    /* Parse significant digits */
34459|  39.2k|    while (str < end) {
  ------------------
  |  Branch (34459:12): [True: 28.9k, False: 10.2k]
  ------------------
34460|  28.9k|        if (*str == '.') {
  ------------------
  |  Branch (34460:13): [True: 759, False: 28.1k]
  ------------------
34461|    759|            if (seenpoint) goto error;
  ------------------
  |  Branch (34461:17): [True: 95, False: 664]
  ------------------
34462|    664|            seenpoint = 1;
34463|  28.1k|        } else if (*str == '&') {
  ------------------
  |  Branch (34463:20): [True: 1.27k, False: 26.9k]
  ------------------
34464|  1.27k|            foundexp = 1;
34465|  1.27k|            break;
34466|  26.9k|        } else if (base == 16 && (*str == 'P' || *str == 'p')) { /* IEEE hex float */
  ------------------
  |  Branch (34466:20): [True: 2.03k, False: 24.8k]
  |  Branch (34466:35): [True: 35, False: 2.00k]
  |  Branch (34466:50): [True: 99, False: 1.90k]
  ------------------
34467|    134|            foundexp = 1;
34468|    134|            exp_base = 10;
34469|    134|            base = 2;
34470|    134|            ex *= 4; /* We need to correct the current exponent after we change the base */
34471|    134|            break;
34472|  26.7k|        } else if (base == 10 && (*str == 'E' || *str == 'e')) {
  ------------------
  |  Branch (34472:20): [True: 24.1k, False: 2.65k]
  |  Branch (34472:35): [True: 278, False: 23.8k]
  |  Branch (34472:50): [True: 318, False: 23.5k]
  ------------------
34473|    596|            foundexp = 1;
34474|    596|            break;
34475|  26.1k|        } else if (*str == '_') {
  ------------------
  |  Branch (34475:20): [True: 874, False: 25.3k]
  ------------------
34476|    874|            if (!seenadigit) goto error;
  ------------------
  |  Branch (34476:17): [True: 242, False: 632]
  ------------------
34477|  25.3k|        } else {
34478|  25.3k|            int digit = digit_lookup[*str & 0x7F];
34479|  25.3k|            if (*str > 127 || digit >= base) goto error;
  ------------------
  |  Branch (34479:17): [True: 120, False: 25.1k]
  |  Branch (34479:31): [True: 1.15k, False: 24.0k]
  ------------------
34480|  24.0k|            if (seenpoint) ex--;
  ------------------
  |  Branch (34480:17): [True: 4.18k, False: 19.8k]
  ------------------
34481|  24.0k|            bignat_muladd(&mant, base, digit);
34482|  24.0k|            seenadigit = 1;
34483|  24.0k|        }
34484|  25.3k|        str++;
34485|  25.3k|    }
34486|       |
34487|  12.2k|    if (!seenadigit)
  ------------------
  |  Branch (34487:9): [True: 1.71k, False: 10.5k]
  ------------------
34488|  1.71k|        goto error;
34489|       |
34490|       |    /* Read exponent */
34491|  10.5k|    if (str < end && foundexp) {
  ------------------
  |  Branch (34491:9): [True: 1.96k, False: 8.58k]
  |  Branch (34491:22): [True: 1.96k, False: 0]
  ------------------
34492|  1.96k|        int eneg = 0;
34493|  1.96k|        int32_t ee = 0;
34494|  1.96k|        seenadigit = 0;
34495|  1.96k|        str++;
34496|  1.96k|        if (str >= end) goto error;
  ------------------
  |  Branch (34496:13): [True: 114, False: 1.85k]
  ------------------
34497|  1.85k|        if (*str == '-') {
  ------------------
  |  Branch (34497:13): [True: 229, False: 1.62k]
  ------------------
34498|    229|            eneg = 1;
34499|    229|            str++;
34500|  1.62k|        } else if (*str == '+') {
  ------------------
  |  Branch (34500:20): [True: 67, False: 1.55k]
  ------------------
34501|     67|            str++;
34502|     67|        }
34503|       |        /* Skip leading 0s in exponent */
34504|  2.59k|        while (str < end && *str == '0') {
  ------------------
  |  Branch (34504:16): [True: 2.31k, False: 276]
  |  Branch (34504:29): [True: 739, False: 1.57k]
  ------------------
34505|    739|            str++;
34506|    739|            seenadigit = 1;
34507|    739|        }
34508|  5.58k|        while (str < end) {
  ------------------
  |  Branch (34508:16): [True: 3.93k, False: 1.65k]
  ------------------
34509|  3.93k|            int digit = digit_lookup[*str & 0x7F];
34510|  3.93k|            if (*str > 127 || digit >= exp_base) goto error;
  ------------------
  |  Branch (34510:17): [True: 39, False: 3.89k]
  |  Branch (34510:31): [True: 160, False: 3.73k]
  ------------------
34511|  3.73k|            if (ee < (INT32_MAX / 40)) {
  ------------------
  |  Branch (34511:17): [True: 3.31k, False: 416]
  ------------------
34512|  3.31k|                ee = exp_base * ee + digit;
34513|  3.31k|            }
34514|  3.73k|            str++;
34515|  3.73k|            seenadigit = 1;
34516|  3.73k|        }
34517|  1.65k|        if (eneg) ex -= ee;
  ------------------
  |  Branch (34517:13): [True: 226, False: 1.42k]
  ------------------
34518|  1.42k|        else ex += ee;
34519|  1.65k|    }
34520|       |
34521|  10.2k|    if (!seenadigit)
  ------------------
  |  Branch (34521:9): [True: 28, False: 10.2k]
  ------------------
34522|     28|        goto error;
34523|       |
34524|  10.2k|    *out = convert(neg, &mant, base, ex);
34525|  10.2k|    janet_free(mant.digits);
  ------------------
  |  | 2415|  10.2k|#define janet_free(X) free((X))
  ------------------
34526|  10.2k|    return 0;
34527|       |
34528|  4.02k|error:
34529|  4.02k|    janet_free(mant.digits);
  ------------------
  |  | 2415|  4.02k|#define janet_free(X) free((X))
  ------------------
34530|  4.02k|    return 1;
34531|  10.2k|}
janet_scan_int64:
34604|  1.37k|int janet_scan_int64(const uint8_t *str, int32_t len, int64_t *out) {
34605|  1.37k|    int neg;
34606|  1.37k|    uint64_t bi;
34607|  1.37k|    if (scan_uint64(str, len, &bi, &neg)) {
  ------------------
  |  Branch (34607:9): [True: 944, False: 431]
  ------------------
34608|    944|        if (neg && bi <= ((UINT64_MAX / 2) + 1)) {
  ------------------
  |  Branch (34608:13): [True: 237, False: 707]
  |  Branch (34608:20): [True: 222, False: 15]
  ------------------
34609|    222|            if (bi > INT64_MAX) {
  ------------------
  |  Branch (34609:17): [True: 1, False: 221]
  ------------------
34610|      1|                *out = INT64_MIN;
34611|    221|            } else {
34612|    221|                *out = -((int64_t) bi);
34613|    221|            }
34614|    222|            return 1;
34615|    222|        }
34616|    722|        if (!neg && bi <= INT64_MAX) {
  ------------------
  |  Branch (34616:13): [True: 707, False: 15]
  |  Branch (34616:21): [True: 654, False: 53]
  ------------------
34617|    654|            *out = (int64_t) bi;
34618|    654|            return 1;
34619|    654|        }
34620|    722|    }
34621|    499|    return 0;
34622|  1.37k|}
janet_scan_uint64:
34624|  1.56k|int janet_scan_uint64(const uint8_t *str, int32_t len, uint64_t *out) {
34625|  1.56k|    int neg;
34626|  1.56k|    uint64_t bi;
34627|  1.56k|    if (scan_uint64(str, len, &bi, &neg)) {
  ------------------
  |  Branch (34627:9): [True: 1.33k, False: 228]
  ------------------
34628|  1.33k|        if (!neg) {
  ------------------
  |  Branch (34628:13): [True: 1.29k, False: 38]
  ------------------
34629|  1.29k|            *out = bi;
34630|  1.29k|            return 1;
34631|  1.29k|        }
34632|  1.33k|    }
34633|    266|    return 0;
34634|  1.56k|}
janet_scan_numeric:
34641|  17.2k|    Janet *out) {
34642|  17.2k|    int result;
34643|  17.2k|    double num;
34644|  17.2k|    int64_t i64 = 0;
34645|  17.2k|    uint64_t u64 = 0;
34646|  17.2k|    if (len < 2 || str[len - 2] != ':') {
  ------------------
  |  Branch (34646:9): [True: 5.68k, False: 11.5k]
  |  Branch (34646:20): [True: 8.45k, False: 3.07k]
  ------------------
34647|  14.1k|        result = janet_scan_number_base(str, len, 0, &num);
34648|  14.1k|        *out = janet_wrap_number(num);
  ------------------
  |  |  835|  14.1k|#define janet_wrap_number(r) janet_nanbox_from_double(r)
  ------------------
34649|  14.1k|        return result;
34650|  14.1k|    }
34651|  3.07k|    switch (str[len - 1]) {
34652|     50|        default:
  ------------------
  |  Branch (34652:9): [True: 50, False: 3.02k]
  ------------------
34653|     50|            return 1;
34654|     85|        case 'n':
  ------------------
  |  Branch (34654:9): [True: 85, False: 2.98k]
  ------------------
34655|     85|            result = janet_scan_number_base(str, len - 2, 0, &num);
34656|     85|            *out = janet_wrap_number(num);
  ------------------
  |  |  835|     85|#define janet_wrap_number(r) janet_nanbox_from_double(r)
  ------------------
34657|     85|            return result;
34658|       |        /* Condition is inverted janet_scan_int64 and janet_scan_uint64 */
34659|  1.37k|        case 's':
  ------------------
  |  Branch (34659:9): [True: 1.37k, False: 1.69k]
  ------------------
34660|  1.37k|            result = !janet_scan_int64(str, len - 2, &i64);
34661|  1.37k|            *out = janet_wrap_s64(i64);
34662|  1.37k|            return result;
34663|  1.56k|        case 'u':
  ------------------
  |  Branch (34663:9): [True: 1.56k, False: 1.51k]
  ------------------
34664|  1.56k|            result = !janet_scan_uint64(str, len - 2, &u64);
34665|  1.56k|            *out = janet_wrap_u64(u64);
34666|  1.56k|            return result;
34667|  3.07k|    }
34668|  3.07k|}
janet_struct_begin:
34722|  47.4k|JanetKV *janet_struct_begin(int32_t count) {
34723|       |    /* Calculate capacity as power of 2 after 2 * count. */
34724|  47.4k|    int32_t capacity = janet_tablen(2 * count);
34725|  47.4k|    if (capacity < 0) capacity = janet_tablen(count + 1);
  ------------------
  |  Branch (34725:9): [True: 0, False: 47.4k]
  ------------------
34726|       |
34727|  47.4k|    size_t size = sizeof(JanetStructHead) + (size_t) capacity * sizeof(JanetKV);
34728|  47.4k|    JanetStructHead *head = janet_gcalloc(JANET_MEMORY_STRUCT, size);
34729|  47.4k|    head->length = count;
34730|  47.4k|    head->capacity = capacity;
34731|  47.4k|    head->hash = 0;
34732|  47.4k|    head->proto = NULL;
34733|       |
34734|  47.4k|    JanetKV *st = (JanetKV *)(head->data);
34735|  47.4k|    janet_memempty(st, capacity);
34736|  47.4k|    return st;
34737|  47.4k|}
janet_struct_find:
34740|  1.08k|const JanetKV *janet_struct_find(const JanetKV *st, Janet key) {
34741|       |    return janet_dict_find(st, janet_struct_capacity(st), key);
  ------------------
  |  | 1849|  1.08k|#define janet_struct_capacity(t) (janet_struct_head(t)->capacity)
  |  |  ------------------
  |  |  |  | 1846|  1.08k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
34742|  1.08k|}
janet_struct_put_ext:
34752|   294k|void janet_struct_put_ext(JanetKV *st, Janet key, Janet value, int replace) {
34753|   294k|    int32_t cap = janet_struct_capacity(st);
  ------------------
  |  | 1849|   294k|#define janet_struct_capacity(t) (janet_struct_head(t)->capacity)
  |  |  ------------------
  |  |  |  | 1846|   294k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
34754|   294k|    int32_t hash = janet_hash(key);
34755|   294k|    int32_t index = janet_maphash(cap, hash);
  ------------------
  |  |  396|   294k|#define janet_maphash(cap, hash) ((uint32_t)(hash) & (cap - 1))
  ------------------
34756|   294k|    int32_t i, j, dist;
34757|   294k|    int32_t bounds[4] = {index, cap, 0, index};
34758|   294k|    if (janet_checktype(key, JANET_NIL) || janet_checktype(value, JANET_NIL)) return;
  ------------------
  |  |  806|   589k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 21, False: 294k]
  |  |  |  Branch (806:6): [Folded, False: 294k]
  |  |  ------------------
  |  |  807|   589k|        ? 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|   589k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|   294k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|   294k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|   294k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|   294k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if (janet_checktype(key, JANET_NIL) || janet_checktype(value, JANET_NIL)) return;
  ------------------
  |  |  806|   294k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 20, False: 294k]
  |  |  |  Branch (806:6): [Folded, False: 294k]
  |  |  ------------------
  |  |  807|   294k|        ? 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|   294k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|   294k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|   294k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|   294k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|   294k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
34759|   294k|    if (janet_checktype(key, JANET_NUMBER) && isnan(janet_unwrap_number(key))) return;
  ------------------
  |  |  806|   589k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 740, False: 293k]
  |  |  |  Branch (806:6): [True: 294k, Folded]
  |  |  ------------------
  |  |  807|   589k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|   294k|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 740, False: 293k]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 293k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|   589k|        : 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 (34759:47): [True: 0, False: 740]
  ------------------
34760|       |    /* Avoid extra items */
34761|   294k|    if (janet_struct_hash(st) == janet_struct_length(st)) return;
  ------------------
  |  | 1850|   294k|#define janet_struct_hash(t) (janet_struct_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1846|   294k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
                  if (janet_struct_hash(st) == janet_struct_length(st)) return;
  ------------------
  |  | 1848|   294k|#define janet_struct_length(t) (janet_struct_head(t)->length)
  |  |  ------------------
  |  |  |  | 1846|   294k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (34761:9): [True: 0, False: 294k]
  ------------------
34762|   294k|    for (dist = 0, j = 0; j < 4; j += 2)
  ------------------
  |  Branch (34762:27): [True: 294k, False: 0]
  ------------------
34763|   420k|        for (i = bounds[j]; i < bounds[j + 1]; i++, dist++) {
  ------------------
  |  Branch (34763:29): [True: 420k, False: 149]
  ------------------
34764|   420k|            int status;
34765|   420k|            int32_t otherhash;
34766|   420k|            int32_t otherindex, otherdist;
34767|   420k|            JanetKV *kv = st + i;
34768|       |            /* We found an empty slot, so just add key and value */
34769|   420k|            if (janet_checktype(kv->key, JANET_NIL)) {
  ------------------
  |  |  806|   420k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 293k, False: 126k]
  |  |  |  Branch (806:6): [Folded, False: 420k]
  |  |  ------------------
  |  |  807|   420k|        ? 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|   420k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|   420k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|   420k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|   420k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|   420k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
34770|   293k|                kv->key = key;
34771|   293k|                kv->value = value;
34772|       |                /* Update the temporary count */
34773|   293k|                janet_struct_hash(st)++;
  ------------------
  |  | 1850|   293k|#define janet_struct_hash(t) (janet_struct_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1846|   293k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
34774|   293k|                return;
34775|   293k|            }
34776|       |            /* Robinhood hashing - check if colliding kv pair
34777|       |             * is closer to their source than current. We use robinhood
34778|       |             * hashing to ensure that equivalent structs that are constructed
34779|       |             * with different order have the same internal layout, and therefor
34780|       |             * will compare properly - i.e., {1 2 3 4} should equal {3 4 1 2}.
34781|       |             * Collisions are resolved via an insertion sort insertion. */
34782|   126k|            otherhash = janet_hash(kv->key);
34783|   126k|            otherindex = janet_maphash(cap, otherhash);
  ------------------
  |  |  396|   126k|#define janet_maphash(cap, hash) ((uint32_t)(hash) & (cap - 1))
  ------------------
34784|   126k|            otherdist = (i + cap - otherindex) & (cap - 1);
34785|   126k|            if (dist < otherdist)
  ------------------
  |  Branch (34785:17): [True: 62.3k, False: 64.1k]
  ------------------
34786|  62.3k|                status = -1;
34787|  64.1k|            else if (otherdist < dist)
  ------------------
  |  Branch (34787:22): [True: 563, False: 63.5k]
  ------------------
34788|    563|                status = 1;
34789|  63.5k|            else if (hash < otherhash)
  ------------------
  |  Branch (34789:22): [True: 62.1k, False: 1.41k]
  ------------------
34790|  62.1k|                status = -1;
34791|  1.41k|            else if (otherhash < hash)
  ------------------
  |  Branch (34791:22): [True: 588, False: 822]
  ------------------
34792|    588|                status = 1;
34793|    822|            else
34794|    822|                status = janet_compare(key, kv->key);
34795|       |            /* If other is closer to their ideal slot */
34796|   126k|            if (status == 1) {
  ------------------
  |  Branch (34796:17): [True: 1.16k, False: 125k]
  ------------------
34797|       |                /* Swap current kv pair with pair in slot */
34798|  1.16k|                JanetKV temp = *kv;
34799|  1.16k|                kv->key = key;
34800|  1.16k|                kv->value = value;
34801|  1.16k|                key = temp.key;
34802|  1.16k|                value = temp.value;
34803|       |                /* Save dist and hash of new kv pair */
34804|  1.16k|                dist = otherdist;
34805|  1.16k|                hash = otherhash;
34806|   125k|            } else if (status == 0) {
  ------------------
  |  Branch (34806:24): [True: 800, False: 124k]
  ------------------
34807|    800|                if (replace) {
  ------------------
  |  Branch (34807:21): [True: 800, False: 0]
  ------------------
34808|       |                    /* A key was added to the struct more than once - replace old value */
34809|    800|                    kv->value = value;
34810|    800|                }
34811|    800|                return;
34812|    800|            }
34813|   126k|        }
34814|   294k|}
janet_struct_put:
34816|   294k|void janet_struct_put(JanetKV *st, Janet key, Janet value) {
34817|   294k|    janet_struct_put_ext(st, key, value, 1);
34818|   294k|}
janet_struct_end:
34821|  47.2k|const JanetKV *janet_struct_end(JanetKV *st) {
34822|  47.2k|    if (janet_struct_hash(st) != janet_struct_length(st)) {
  ------------------
  |  | 1850|  47.2k|#define janet_struct_hash(t) (janet_struct_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1846|  47.2k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
                  if (janet_struct_hash(st) != janet_struct_length(st)) {
  ------------------
  |  | 1848|  47.2k|#define janet_struct_length(t) (janet_struct_head(t)->length)
  |  |  ------------------
  |  |  |  | 1846|  47.2k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (34822:9): [True: 232, False: 46.9k]
  ------------------
34823|       |        /* Error building struct, probably duplicate values. We need to rebuild
34824|       |         * the struct using only the values that went in. The second creation should always
34825|       |         * succeed. */
34826|    232|        JanetKV *newst = janet_struct_begin(janet_struct_hash(st));
  ------------------
  |  | 1850|    232|#define janet_struct_hash(t) (janet_struct_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1846|    232|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
34827|  7.23k|        for (int32_t i = 0; i < janet_struct_capacity(st); i++) {
  ------------------
  |  | 1849|  7.23k|#define janet_struct_capacity(t) (janet_struct_head(t)->capacity)
  |  |  ------------------
  |  |  |  | 1846|  7.23k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (34827:29): [True: 7.00k, False: 232]
  ------------------
34828|  7.00k|            JanetKV *kv = st + i;
34829|  7.00k|            if (!janet_checktype(kv->key, JANET_NIL)) {
  ------------------
  |  |  806|  7.00k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 7.00k]
  |  |  ------------------
  |  |  807|  7.00k|        ? 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.00k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  7.00k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  7.00k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  7.00k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  7.00k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (34829:17): [True: 1.39k, False: 5.60k]
  ------------------
34830|  1.39k|                janet_struct_put(newst, kv->key, kv->value);
34831|  1.39k|            }
34832|  7.00k|        }
34833|    232|        janet_struct_proto(newst) = janet_struct_proto(st);
  ------------------
  |  | 1851|    232|#define janet_struct_proto(t) (janet_struct_head(t)->proto)
  |  |  ------------------
  |  |  |  | 1846|    232|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
                      janet_struct_proto(newst) = janet_struct_proto(st);
  ------------------
  |  | 1851|    232|#define janet_struct_proto(t) (janet_struct_head(t)->proto)
  |  |  ------------------
  |  |  |  | 1846|    232|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
34834|    232|        st = newst;
34835|    232|    }
34836|  47.2k|    janet_struct_hash(st) = janet_kv_calchash(st, janet_struct_capacity(st));
  ------------------
  |  | 1850|  47.2k|#define janet_struct_hash(t) (janet_struct_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1846|  47.2k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
                  janet_struct_hash(st) = janet_kv_calchash(st, janet_struct_capacity(st));
  ------------------
  |  | 1849|  47.2k|#define janet_struct_capacity(t) (janet_struct_head(t)->capacity)
  |  |  ------------------
  |  |  |  | 1846|  47.2k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
34837|  47.2k|    if (janet_struct_proto(st)) {
  ------------------
  |  | 1851|  47.2k|#define janet_struct_proto(t) (janet_struct_head(t)->proto)
  |  |  ------------------
  |  |  |  | 1846|  47.2k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  |  |  |  Branch (1851:31): [True: 0, False: 47.2k]
  |  |  ------------------
  ------------------
34838|      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)))
  |  |  ------------------
  ------------------
34839|      0|    }
34840|  47.2k|    return (const JanetKV *)st;
34841|  47.2k|}
janet_struct_get:
34850|  1.08k|Janet janet_struct_get(const JanetKV *st, Janet key) {
34851|  2.05k|    for (int i = JANET_MAX_PROTO_DEPTH; st && i; --i, st = janet_struct_proto(st)) {
  ------------------
  |  |  299|  1.08k|#define JANET_MAX_PROTO_DEPTH 200
  ------------------
                  for (int i = JANET_MAX_PROTO_DEPTH; st && i; --i, st = janet_struct_proto(st)) {
  ------------------
  |  | 1851|    964|#define janet_struct_proto(t) (janet_struct_head(t)->proto)
  |  |  ------------------
  |  |  |  | 1846|    964|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (34851:41): [True: 1.08k, False: 964]
  |  Branch (34851:47): [True: 1.08k, False: 0]
  ------------------
34852|  1.08k|        const JanetKV *kv = janet_struct_find(st, key);
34853|  1.08k|        if (NULL != kv && !janet_checktype(kv->key, JANET_NIL)) {
  ------------------
  |  |  806|  1.08k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 1.08k]
  |  |  ------------------
  |  |  807|  1.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|  1.08k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  1.08k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  1.08k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  1.08k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  1.08k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (34853:13): [True: 1.08k, False: 0]
  |  Branch (34853:27): [True: 124, False: 964]
  ------------------
34854|    124|            return kv->value;
34855|    124|        }
34856|  1.08k|    }
34857|    964|    return janet_wrap_nil();
  ------------------
  |  |  831|    964|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|    964|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|    964|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|    964|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
34858|  1.08k|}
janet_lib_struct:
34988|  6.14k|void janet_lib_struct(JanetTable *env) {
34989|  6.14k|    JanetRegExt struct_cfuns[] = {
34990|  6.14k|        JANET_CORE_REG("struct/with-proto", cfun_struct_with_proto),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34991|  6.14k|        JANET_CORE_REG("struct/getproto", cfun_struct_getproto),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34992|  6.14k|        JANET_CORE_REG("struct/proto-flatten", cfun_struct_flatten),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34993|  6.14k|        JANET_CORE_REG("struct/to-table", cfun_struct_to_table),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34994|  6.14k|        JANET_CORE_REG("struct/rawget", cfun_struct_rawget),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
34995|  6.14k|        JANET_REG_END
  ------------------
  |  | 2110|  6.14k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
34996|  6.14k|    };
34997|       |    janet_core_cfuns_ext(env, NULL, struct_cfuns);
34998|  6.14k|}
janet_symcache_init:
35043|  6.14k|void janet_symcache_init() {
35044|  6.14k|    janet_vm.cache_capacity = 1024;
35045|  6.14k|    janet_vm.cache = janet_calloc(1, (size_t) janet_vm.cache_capacity * sizeof(const uint8_t *));
  ------------------
  |  | 2412|  6.14k|#define janet_calloc(X, Y) calloc((X), (Y))
  ------------------
35046|  6.14k|    if (NULL == janet_vm.cache) {
  ------------------
  |  Branch (35046:9): [True: 0, False: 6.14k]
  ------------------
35047|      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]
  |  |  ------------------
  ------------------
35048|      0|    }
35049|  6.14k|    memset(&janet_vm.gensym_counter, '0', sizeof(janet_vm.gensym_counter));
35050|  6.14k|    janet_vm.gensym_counter[0] = '_';
35051|  6.14k|    janet_vm.cache_count = 0;
35052|  6.14k|    janet_vm.cache_deleted = 0;
35053|  6.14k|}
janet_symcache_deinit:
35056|  6.14k|void janet_symcache_deinit() {
35057|  6.14k|    janet_free((void *)janet_vm.cache);
  ------------------
  |  | 2415|  6.14k|#define janet_free(X) free((X))
  ------------------
35058|       |    janet_vm.cache = NULL;
35059|  6.14k|    janet_vm.cache_capacity = 0;
35060|  6.14k|    janet_vm.cache_count = 0;
35061|  6.14k|    janet_vm.cache_deleted = 0;
35062|  6.14k|}
janet_symbol_deinit:
35164|  12.2M|void janet_symbol_deinit(const uint8_t *sym) {
35165|  12.2M|    int status = 0;
35166|  12.2M|    const uint8_t **bucket = janet_symcache_find(sym, &status);
  ------------------
  |  |35119|  12.2M|    janet_symcache_findmem((str), janet_string_length(str), janet_string_hash(str), (success))
  |  |  ------------------
  |  |  |  | 1813|  12.2M|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1812|  12.2M|#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|  12.2M|#define janet_string_hash(s) (janet_string_head(s)->hash)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1812|  12.2M|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
35167|  12.2M|    if (status) {
  ------------------
  |  Branch (35167:9): [True: 12.2M, False: 0]
  ------------------
35168|  12.2M|        janet_vm.cache_count--;
35169|  12.2M|        janet_vm.cache_deleted++;
35170|  12.2M|        *bucket = JANET_SYMCACHE_DELETED;
35171|  12.2M|    }
35172|  12.2M|}
janet_symbol:
35175|  17.4M|const uint8_t *janet_symbol(const uint8_t *str, int32_t len) {
35176|  17.4M|    int32_t hash = janet_string_calchash(str, len);
35177|  17.4M|    uint8_t *newstr;
35178|  17.4M|    int success = 0;
35179|  17.4M|    const uint8_t **bucket = janet_symcache_findmem(str, len, hash, &success);
35180|  17.4M|    if (success)
  ------------------
  |  Branch (35180:9): [True: 5.12M, False: 12.2M]
  ------------------
35181|  5.12M|        return *bucket;
35182|  12.2M|    JanetStringHead *head = janet_gcalloc(JANET_MEMORY_SYMBOL, sizeof(JanetStringHead) + (size_t) len + 1);
35183|  12.2M|    head->hash = hash;
35184|  12.2M|    head->length = len;
35185|  12.2M|    newstr = (uint8_t *)(head->data);
35186|  12.2M|    safe_memcpy(newstr, str, len);
35187|  12.2M|    newstr[len] = 0;
35188|  12.2M|    janet_symcache_put((const uint8_t *)newstr, bucket);
35189|  12.2M|    return newstr;
35190|  17.4M|}
janet_csymbol:
35193|  2.28M|const uint8_t *janet_csymbol(const char *cstr) {
35194|  2.28M|    return janet_symbol((const uint8_t *)cstr, (int32_t) strlen(cstr));
35195|  2.28M|}
janet_table_init:
35319|  18.4M|JanetTable *janet_table_init(JanetTable *table, int32_t capacity) {
35320|  18.4M|    return janet_table_init_impl(table, capacity, 1);
35321|  18.4M|}
janet_table_init_raw:
35324|  18.4k|JanetTable *janet_table_init_raw(JanetTable *table, int32_t capacity) {
35325|  18.4k|    return janet_table_init_impl(table, capacity, 0);
35326|  18.4k|}
janet_table_deinit:
35329|  18.4M|void janet_table_deinit(JanetTable *table) {
35330|  18.4M|    if (table->gc.flags & JANET_TABLE_FLAG_STACK) {
  ------------------
  |  |35279|  18.4M|#define JANET_TABLE_FLAG_STACK 0x10000
  ------------------
  |  Branch (35330:9): [True: 18.4M, False: 18.4k]
  ------------------
35331|  18.4M|        janet_sfree(table->data);
35332|  18.4M|    } else {
35333|  18.4k|        janet_free(table->data);
  ------------------
  |  | 2415|  18.4k|#define janet_free(X) free((X))
  ------------------
35334|  18.4k|    }
35335|  18.4M|}
janet_table:
35339|  4.51M|JanetTable *janet_table(int32_t capacity) {
35340|  4.51M|    JanetTable *table = janet_gcalloc(JANET_MEMORY_TABLE, sizeof(JanetTable));
35341|  4.51M|    return janet_table_init_impl(table, capacity, 0);
35342|  4.51M|}
janet_table_find:
35361|   171M|JanetKV *janet_table_find(JanetTable *t, Janet key) {
35362|   171M|    return (JanetKV *) janet_dict_find(t->data, t->capacity, key);
35363|   171M|}
janet_table_get:
35397|  32.6M|Janet janet_table_get(JanetTable *t, Janet key) {
35398|  63.1M|    for (int i = JANET_MAX_PROTO_DEPTH; t && i; t = t->proto, --i) {
  ------------------
  |  |  299|  32.6M|#define JANET_MAX_PROTO_DEPTH 200
  ------------------
  |  Branch (35398:41): [True: 32.6M, False: 30.4M]
  |  Branch (35398:46): [True: 32.6M, False: 0]
  ------------------
35399|  32.6M|        JanetKV *bucket = janet_table_find(t, key);
35400|  32.6M|        if (NULL != bucket && !janet_checktype(bucket->key, JANET_NIL))
  ------------------
  |  |  806|  32.6M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 32.6M]
  |  |  ------------------
  |  |  807|  32.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|  32.6M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  32.6M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  32.6M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  32.6M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  32.6M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (35400:13): [True: 32.6M, False: 0]
  |  Branch (35400:31): [True: 2.19M, False: 30.4M]
  ------------------
35401|  2.19M|            return bucket->value;
35402|  32.6M|    }
35403|  30.4M|    return janet_wrap_nil();
  ------------------
  |  |  831|  30.4M|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|  30.4M|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  30.4M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  30.4M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
35404|  32.6M|}
janet_table_get_keyword:
35407|  73.7k|Janet janet_table_get_keyword(JanetTable *t, const char *keyword) {
35408|  73.7k|    int32_t keyword_len = (int32_t) strlen(keyword);
35409|   128k|    for (int i = JANET_MAX_PROTO_DEPTH; t && i; t = t->proto, --i) {
  ------------------
  |  |  299|  73.7k|#define JANET_MAX_PROTO_DEPTH 200
  ------------------
  |  Branch (35409:41): [True: 73.7k, False: 55.2k]
  |  Branch (35409:46): [True: 73.7k, False: 0]
  ------------------
35410|  73.7k|        JanetKV *bucket = (JanetKV *) janet_dict_find_keyword(t->data, t->capacity, (const uint8_t *) keyword, keyword_len);
35411|  73.7k|        if (NULL != bucket && !janet_checktype(bucket->key, JANET_NIL))
  ------------------
  |  |  806|  73.7k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 73.7k]
  |  |  ------------------
  |  |  807|  73.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|  73.7k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  73.7k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  73.7k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  73.7k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  73.7k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (35411:13): [True: 73.7k, False: 0]
  |  Branch (35411:31): [True: 18.4k, False: 55.2k]
  ------------------
35412|  18.4k|            return bucket->value;
35413|  73.7k|    }
35414|  55.2k|    return janet_wrap_nil();
  ------------------
  |  |  831|  55.2k|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|  55.2k|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  55.2k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  55.2k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
35415|  73.7k|}
janet_table_get_ex:
35418|     40|Janet janet_table_get_ex(JanetTable *t, Janet key, JanetTable **which) {
35419|     80|    for (int i = JANET_MAX_PROTO_DEPTH; t && i; t = t->proto, --i) {
  ------------------
  |  |  299|     40|#define JANET_MAX_PROTO_DEPTH 200
  ------------------
  |  Branch (35419:41): [True: 40, False: 40]
  |  Branch (35419:46): [True: 40, False: 0]
  ------------------
35420|     40|        JanetKV *bucket = janet_table_find(t, key);
35421|     40|        if (NULL != bucket && !janet_checktype(bucket->key, JANET_NIL)) {
  ------------------
  |  |  806|     40|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 40]
  |  |  ------------------
  |  |  807|     40|        ? 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|     40|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|     40|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|     40|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|     40|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|     40|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (35421:13): [True: 40, False: 0]
  |  Branch (35421:31): [True: 0, False: 40]
  ------------------
35422|      0|            *which = t;
35423|      0|            return bucket->value;
35424|      0|        }
35425|     40|    }
35426|     40|    return janet_wrap_nil();
  ------------------
  |  |  831|     40|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|     40|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|     40|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|     40|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
35427|     40|}
janet_table_rawget:
35430|  14.9k|Janet janet_table_rawget(JanetTable *t, Janet key) {
35431|  14.9k|    JanetKV *bucket = janet_table_find(t, key);
35432|  14.9k|    if (NULL != bucket && !janet_checktype(bucket->key, JANET_NIL))
  ------------------
  |  |  806|  14.9k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 14.9k]
  |  |  ------------------
  |  |  807|  14.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|  14.9k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  14.9k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  14.9k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  14.9k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  14.9k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (35432:9): [True: 14.9k, False: 0]
  |  Branch (35432:27): [True: 329, False: 14.5k]
  ------------------
35433|    329|        return bucket->value;
35434|  14.5k|    else
35435|  14.5k|        return janet_wrap_nil();
  ------------------
  |  |  831|  14.5k|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|  14.5k|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  14.5k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  14.5k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
35436|  14.9k|}
janet_table_remove:
35440|  51.8M|Janet janet_table_remove(JanetTable *t, Janet key) {
35441|  51.8M|    JanetKV *bucket = janet_table_find(t, key);
35442|  51.8M|    if (NULL != bucket && !janet_checktype(bucket->key, JANET_NIL)) {
  ------------------
  |  |  806|  51.8M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 51.8M]
  |  |  ------------------
  |  |  807|  51.8M|        ? 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|  51.8M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  51.8M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  51.8M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  51.8M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  51.8M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (35442:9): [True: 51.8M, False: 0]
  |  Branch (35442:27): [True: 30.4M, False: 21.3M]
  ------------------
35443|  30.4M|        Janet ret = bucket->value;
35444|  30.4M|        t->count--;
35445|  30.4M|        t->deleted++;
35446|  30.4M|        bucket->key = janet_wrap_nil();
  ------------------
  |  |  831|  30.4M|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|  30.4M|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  30.4M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  30.4M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
35447|  30.4M|        bucket->value = janet_wrap_false();
  ------------------
  |  |  833|  30.4M|#define janet_wrap_false() janet_nanbox_from_payload(JANET_BOOLEAN, 0)
  |  |  ------------------
  |  |  |  |  822|  30.4M|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  30.4M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  30.4M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
35448|  30.4M|        return ret;
35449|  30.4M|    } else {
35450|  21.3M|        return janet_wrap_nil();
  ------------------
  |  |  831|  21.3M|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|  21.3M|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  21.3M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  21.3M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
35451|  21.3M|    }
35452|  51.8M|}
janet_table_put:
35455|  59.3M|void janet_table_put(JanetTable *t, Janet key, Janet value) {
35456|  59.3M|    if (janet_checktype(key, JANET_NIL)) return;
  ------------------
  |  |  806|  59.3M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 21, False: 59.3M]
  |  |  |  Branch (806:6): [Folded, False: 59.3M]
  |  |  ------------------
  |  |  807|  59.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|  59.3M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  59.3M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  59.3M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  59.3M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  59.3M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
35457|  59.3M|    if (janet_checktype(key, JANET_NUMBER) && isnan(janet_unwrap_number(key))) return;
  ------------------
  |  |  806|   118M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 2.90k, False: 59.3M]
  |  |  |  Branch (806:6): [True: 59.3M, Folded]
  |  |  ------------------
  |  |  807|   118M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|  59.3M|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 2.90k, False: 59.3M]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 59.3M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|   118M|        : 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 (35457:47): [True: 0, False: 2.90k]
  ------------------
35458|  59.3M|    if (janet_checktype(value, JANET_NIL)) {
  ------------------
  |  |  806|  59.3M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 46, False: 59.3M]
  |  |  |  Branch (806:6): [Folded, False: 59.3M]
  |  |  ------------------
  |  |  807|  59.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|  59.3M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  59.3M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  59.3M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  59.3M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  59.3M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
35459|     46|        janet_table_remove(t, key);
35460|  59.3M|    } else {
35461|  59.3M|        JanetKV *bucket = janet_table_find(t, key);
35462|  59.3M|        if (NULL != bucket && !janet_checktype(bucket->key, JANET_NIL)) {
  ------------------
  |  |  806|  59.3M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 59.3M]
  |  |  ------------------
  |  |  807|  59.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|  59.3M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  59.3M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  59.3M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  59.3M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  59.3M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (35462:13): [True: 59.3M, False: 0]
  |  Branch (35462:31): [True: 383, False: 59.3M]
  ------------------
35463|    383|            bucket->value = value;
35464|  59.3M|        } else {
35465|  59.3M|            if (NULL == bucket || 2 * (t->count + t->deleted + 1) > t->capacity) {
  ------------------
  |  Branch (35465:17): [True: 0, False: 59.3M]
  |  Branch (35465:35): [True: 4.42M, False: 54.9M]
  ------------------
35466|  4.42M|                janet_table_rehash(t, janet_tablen(2 * t->count + 2));
35467|  4.42M|                bucket = janet_table_find(t, key);
35468|  4.42M|            }
35469|  59.3M|            if (janet_checktype(bucket->value, JANET_BOOLEAN))
  ------------------
  |  |  806|  59.3M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 0, False: 59.3M]
  |  |  |  Branch (806:6): [Folded, False: 59.3M]
  |  |  ------------------
  |  |  807|  59.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|  59.3M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  59.3M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  59.3M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  59.3M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  59.3M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
35470|      0|                --t->deleted;
35471|  59.3M|            bucket->key = key;
35472|  59.3M|            bucket->value = value;
35473|  59.3M|            ++t->count;
35474|  59.3M|        }
35475|  59.3M|    }
35476|  59.3M|}
janet_table_clone:
35505|    210|JanetTable *janet_table_clone(JanetTable *table) {
35506|    210|    JanetTable *newTable = janet_gcalloc(JANET_MEMORY_TABLE, sizeof(JanetTable));
35507|    210|    newTable->count = table->count;
35508|    210|    newTable->capacity = table->capacity;
35509|    210|    newTable->deleted = table->deleted;
35510|    210|    newTable->proto = table->proto;
35511|    210|    newTable->data = array_allocate(sizeof(JanetKV), newTable->capacity);
35512|    210|    if (NULL == newTable->data) {
  ------------------
  |  Branch (35512:9): [True: 0, False: 210]
  ------------------
35513|      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]
  |  |  ------------------
  ------------------
35514|      0|    }
35515|    210|    memcpy(newTable->data, table->data, (size_t) table->capacity * sizeof(JanetKV));
35516|    210|    return newTable;
35517|    210|}
janet_lib_table:
35685|  6.14k|void janet_lib_table(JanetTable *env) {
35686|  6.14k|    JanetRegExt table_cfuns[] = {
35687|  6.14k|        JANET_CORE_REG("table/new", cfun_table_new),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35688|  6.14k|        JANET_CORE_REG("table/weak", cfun_table_weak),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35689|  6.14k|        JANET_CORE_REG("table/weak-keys", cfun_table_weak_keys),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35690|  6.14k|        JANET_CORE_REG("table/weak-values", cfun_table_weak_values),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35691|  6.14k|        JANET_CORE_REG("table/to-struct", cfun_table_tostruct),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35692|  6.14k|        JANET_CORE_REG("table/getproto", cfun_table_getproto),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35693|  6.14k|        JANET_CORE_REG("table/setproto", cfun_table_setproto),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35694|  6.14k|        JANET_CORE_REG("table/rawget", cfun_table_rawget),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35695|  6.14k|        JANET_CORE_REG("table/clone", cfun_table_clone),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35696|  6.14k|        JANET_CORE_REG("table/clear", cfun_table_clear),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35697|  6.14k|        JANET_CORE_REG("table/proto-flatten", cfun_table_proto_flatten),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35698|  6.14k|        JANET_REG_END
  ------------------
  |  | 2110|  6.14k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
35699|  6.14k|    };
35700|       |    janet_core_cfuns_ext(env, NULL, table_cfuns);
35701|  6.14k|}
janet_tuple_begin:
35740|  4.66M|Janet *janet_tuple_begin(int32_t length) {
35741|  4.66M|    size_t size = sizeof(JanetTupleHead) + ((size_t) length * sizeof(Janet));
35742|  4.66M|    JanetTupleHead *head = janet_gcalloc(JANET_MEMORY_TUPLE, size);
35743|  4.66M|    head->sm_line = -1;
35744|  4.66M|    head->sm_column = -1;
35745|  4.66M|    head->length = length;
35746|  4.66M|    return (Janet *)(head->data);
35747|  4.66M|}
janet_tuple_end:
35750|  4.66M|const Janet *janet_tuple_end(Janet *tuple) {
35751|  4.66M|    janet_tuple_hash(tuple) = janet_array_calchash(tuple, janet_tuple_length(tuple));
  ------------------
  |  | 1803|  4.66M|#define janet_tuple_hash(t) (janet_tuple_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1800|  4.66M|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
                  janet_tuple_hash(tuple) = janet_array_calchash(tuple, janet_tuple_length(tuple));
  ------------------
  |  | 1802|  4.66M|#define janet_tuple_length(t) (janet_tuple_head(t)->length)
  |  |  ------------------
  |  |  |  | 1800|  4.66M|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
35752|  4.66M|    return (const Janet *)tuple;
35753|  4.66M|}
janet_tuple_n:
35756|  12.6k|const Janet *janet_tuple_n(const Janet *values, int32_t n) {
35757|  12.6k|    Janet *t = janet_tuple_begin(n);
35758|  12.6k|    safe_memcpy(t, values, sizeof(Janet) * n);
35759|  12.6k|    return janet_tuple_end(t);
35760|  12.6k|}
janet_lib_tuple:
35860|  6.14k|void janet_lib_tuple(JanetTable *env) {
35861|  6.14k|    JanetRegExt tuple_cfuns[] = {
35862|  6.14k|        JANET_CORE_REG("tuple/brackets", cfun_tuple_brackets),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35863|  6.14k|        JANET_CORE_REG("tuple/slice", cfun_tuple_slice),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35864|  6.14k|        JANET_CORE_REG("tuple/type", cfun_tuple_type),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35865|  6.14k|        JANET_CORE_REG("tuple/sourcemap", cfun_tuple_sourcemap),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35866|  6.14k|        JANET_CORE_REG("tuple/setmap", cfun_tuple_setmap),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35867|  6.14k|        JANET_CORE_REG("tuple/join", cfun_tuple_join),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
35868|  6.14k|        JANET_REG_END
  ------------------
  |  | 2110|  6.14k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
35869|  6.14k|    };
35870|       |    janet_core_cfuns_ext(env, NULL, tuple_cfuns);
35871|  6.14k|}
janet_hash_mix:
35997|  44.8M|uint32_t janet_hash_mix(uint32_t input, uint32_t more) {
35998|  44.8M|    uint32_t mix1 = (more + 0x9e3779b9 + (input << 6) + (input >> 2));
35999|  44.8M|    return input ^ (0x9e3779b9 + (mix1 << 6) + (mix1 >> 2));
36000|  44.8M|}
janet_string_calchash:
36004|  39.6M|int32_t janet_string_calchash(const uint8_t *str, int32_t len) {
36005|  39.6M|    if (NULL == str || len == 0) return 5381;
  ------------------
  |  Branch (36005:9): [True: 551, False: 39.6M]
  |  Branch (36005:24): [True: 10.0M, False: 29.5M]
  ------------------
36006|  29.5M|    const uint8_t *end = str + len;
36007|  29.5M|    uint32_t hash = 5381;
36008|  5.21G|    while (str < end)
  ------------------
  |  Branch (36008:12): [True: 5.18G, False: 29.5M]
  ------------------
36009|  5.18G|        hash = (hash << 5) + hash + *str++;
36010|  29.5M|    hash = janet_hash_mix(hash, (uint32_t) len);
36011|  29.5M|    return (int32_t) hash;
36012|  39.6M|}
janet_array_calchash:
36127|  4.66M|int32_t janet_array_calchash(const Janet *array, int32_t len) {
36128|  4.66M|    const Janet *end = array + len;
36129|  4.66M|    uint32_t hash = 33;
36130|  18.4M|    while (array < end) {
  ------------------
  |  Branch (36130:12): [True: 13.7M, False: 4.66M]
  ------------------
36131|  13.7M|        hash = janet_hash_mix(hash, janet_hash(*array++));
36132|  13.7M|    }
36133|  4.66M|    return (int32_t) hash;
36134|  4.66M|}
janet_kv_calchash:
36137|  47.2k|int32_t janet_kv_calchash(const JanetKV *kvs, int32_t len) {
36138|  47.2k|    const JanetKV *end = kvs + len;
36139|  47.2k|    uint32_t hash = 33;
36140|   805k|    while (kvs < end) {
  ------------------
  |  Branch (36140:12): [True: 758k, False: 47.2k]
  ------------------
36141|   758k|        hash = janet_hash_mix(hash, janet_hash(kvs->key));
36142|   758k|        hash = janet_hash_mix(hash, janet_hash(kvs->value));
36143|   758k|        kvs++;
36144|   758k|    }
36145|  47.2k|    return (int32_t) hash;
36146|  47.2k|}
janet_tablen:
36150|  27.4M|int32_t janet_tablen(int32_t n) {
36151|  27.4M|    if (n < 0) return 0;
  ------------------
  |  Branch (36151:9): [True: 0, False: 27.4M]
  ------------------
36152|  27.4M|    n |= n >> 1;
36153|  27.4M|    n |= n >> 2;
36154|  27.4M|    n |= n >> 4;
36155|  27.4M|    n |= n >> 8;
36156|  27.4M|    n |= n >> 16;
36157|  27.4M|    return n == INT32_MAX ? INT32_MAX : n + 1;
  ------------------
  |  Branch (36157:12): [True: 0, False: 27.4M]
  ------------------
36158|  27.4M|}
safe_memcpy:
36161|  34.4M|void safe_memcpy(void *dest, const void *src, size_t len) {
36162|  34.4M|    if (!len) return;
  ------------------
  |  Branch (36162:9): [True: 10.0M, False: 24.3M]
  ------------------
36163|  24.3M|    memcpy(dest, src, len);
36164|  24.3M|}
janet_dict_find_deep:
36168|  84.9M|const JanetKV *janet_dict_find_deep(const JanetKV *buckets, int32_t cap, Janet key) {
36169|  84.9M|    int32_t index = janet_maphash(cap, janet_hash(key));
  ------------------
  |  |  396|  84.9M|#define janet_maphash(cap, hash) ((uint32_t)(hash) & (cap - 1))
  ------------------
36170|  84.9M|    int32_t i;
36171|  84.9M|    const JanetKV *first_bucket = NULL;
36172|       |    /* Higher half */
36173|   111M|    for (i = index; i < cap; i++) {
  ------------------
  |  Branch (36173:21): [True: 109M, False: 1.81M]
  ------------------
36174|   109M|        const JanetKV *kv = buckets + i;
36175|   109M|        if (janet_checktype(kv->key, JANET_NIL)) {
  ------------------
  |  |  806|   109M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 66.3M, False: 43.0M]
  |  |  |  Branch (806:6): [Folded, False: 109M]
  |  |  ------------------
  |  |  807|   109M|        ? 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|   109M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|   109M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|   109M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|   109M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|   109M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36176|  66.3M|            if (janet_checktype(kv->value, JANET_NIL)) {
  ------------------
  |  |  806|  66.3M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 56.7M, False: 9.58M]
  |  |  |  Branch (806:6): [Folded, False: 66.3M]
  |  |  ------------------
  |  |  807|  66.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|  66.3M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  66.3M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  66.3M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  66.3M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  66.3M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36177|  56.7M|                return kv;
36178|  56.7M|            } else if (NULL == first_bucket) {
  ------------------
  |  Branch (36178:24): [True: 5.59M, False: 3.98M]
  ------------------
36179|  5.59M|                first_bucket = kv;
36180|  5.59M|            }
36181|  66.3M|        } else if (janet_bitwise_same(kv->key, key) || janet_equals(kv->key, key)) {
  ------------------
  |  |  401|  86.1M|#define janet_bitwise_same(x, y) (janet_u64(x) == janet_u64(y))
  |  |  ------------------
  |  |  |  |  788|  43.0M|#define janet_u64(x) ((x).u64)
  |  |  ------------------
  |  |               #define janet_bitwise_same(x, y) (janet_u64(x) == janet_u64(y))
  |  |  ------------------
  |  |  |  |  788|  43.0M|#define janet_u64(x) ((x).u64)
  |  |  ------------------
  |  |  |  Branch (401:34): [True: 26.3M, False: 16.6M]
  |  |  ------------------
  ------------------
  |  Branch (36181:56): [True: 1.30k, False: 16.6M]
  ------------------
36182|  26.3M|            return buckets + i;
36183|  26.3M|        }
36184|   109M|    }
36185|       |    /* Lower half */
36186|  1.82M|    for (i = 0; i < index; i++) {
  ------------------
  |  Branch (36186:17): [True: 1.82M, False: 0]
  ------------------
36187|  1.82M|        const JanetKV *kv = buckets + i;
36188|  1.82M|        if (janet_checktype(kv->key, JANET_NIL)) {
  ------------------
  |  |  806|  1.82M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 1.21M, False: 609k]
  |  |  |  Branch (806:6): [Folded, False: 1.82M]
  |  |  ------------------
  |  |  807|  1.82M|        ? 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|  1.82M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  1.82M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  1.82M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  1.82M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  1.82M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36189|  1.21M|            if (janet_checktype(kv->value, JANET_NIL)) {
  ------------------
  |  |  806|  1.21M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 1.21M, False: 4.99k]
  |  |  |  Branch (806:6): [Folded, False: 1.21M]
  |  |  ------------------
  |  |  807|  1.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|  1.21M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  1.21M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  1.21M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  1.21M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  1.21M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36190|  1.21M|                return kv;
36191|  1.21M|            } else if (NULL == first_bucket) {
  ------------------
  |  Branch (36191:24): [True: 3.82k, False: 1.16k]
  ------------------
36192|  3.82k|                first_bucket = kv;
36193|  3.82k|            }
36194|  1.21M|        } else if (janet_bitwise_same(kv->key, key) || janet_equals(kv->key, key)) {
  ------------------
  |  |  401|  1.21M|#define janet_bitwise_same(x, y) (janet_u64(x) == janet_u64(y))
  |  |  ------------------
  |  |  |  |  788|   609k|#define janet_u64(x) ((x).u64)
  |  |  ------------------
  |  |               #define janet_bitwise_same(x, y) (janet_u64(x) == janet_u64(y))
  |  |  ------------------
  |  |  |  |  788|   609k|#define janet_u64(x) ((x).u64)
  |  |  ------------------
  |  |  |  Branch (401:34): [True: 603k, False: 6.72k]
  |  |  ------------------
  ------------------
  |  Branch (36194:56): [True: 115, False: 6.60k]
  ------------------
36195|   603k|            return buckets + i;
36196|   603k|        }
36197|  1.82M|    }
36198|      0|    return first_bucket;
36199|  1.81M|}
janet_dict_find_keyword:
36205|  73.7k|    const uint8_t *cstr, int32_t cstr_len) {
36206|  73.7k|    int32_t hash = janet_string_calchash(cstr, cstr_len);
36207|  73.7k|    int32_t index = janet_maphash(cap, hash);
  ------------------
  |  |  396|  73.7k|#define janet_maphash(cap, hash) ((uint32_t)(hash) & (cap - 1))
  ------------------
36208|  73.7k|    int32_t i;
36209|  73.7k|    const JanetKV *first_bucket = NULL;
36210|       |    /* Higher half */
36211|   110k|    for (i = index; i < cap; i++) {
  ------------------
  |  Branch (36211:21): [True: 110k, False: 0]
  ------------------
36212|   110k|        const JanetKV *kv = buckets + i;
36213|   110k|        if (janet_checktype(kv->key, JANET_NIL)) {
  ------------------
  |  |  806|   110k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 55.2k, False: 55.2k]
  |  |  |  Branch (806:6): [Folded, False: 110k]
  |  |  ------------------
  |  |  807|   110k|        ? 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|   110k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|   110k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|   110k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|   110k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|   110k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36214|  55.2k|            if (janet_checktype(kv->value, JANET_NIL)) {
  ------------------
  |  |  806|  55.2k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 55.2k, False: 0]
  |  |  |  Branch (806:6): [Folded, False: 55.2k]
  |  |  ------------------
  |  |  807|  55.2k|        ? 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.2k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  55.2k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  55.2k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  55.2k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  55.2k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36215|  55.2k|                return kv;
36216|  55.2k|            } else if (NULL == first_bucket) {
  ------------------
  |  Branch (36216:24): [True: 0, False: 0]
  ------------------
36217|      0|                first_bucket = kv;
36218|      0|            }
36219|  55.2k|        } else if (janet_checktype(kv->key, JANET_KEYWORD)) {
  ------------------
  |  |  806|  55.2k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 55.2k, False: 0]
  |  |  |  Branch (806:6): [Folded, False: 55.2k]
  |  |  ------------------
  |  |  807|  55.2k|        ? 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.2k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  55.2k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  55.2k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  55.2k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  55.2k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36220|       |            /* Works for symbol and keyword, too */
36221|  55.2k|            JanetString str = janet_unwrap_string(kv->key);
  ------------------
  |  |  863|  55.2k|#define janet_unwrap_string(x) ((JanetString)janet_nanbox_to_pointer(x))
  ------------------
36222|  55.2k|            int32_t len = janet_string_length(str);
  ------------------
  |  | 1813|  55.2k|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  ------------------
  |  |  |  | 1812|  55.2k|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
36223|  55.2k|            if (hash == janet_string_hash(str) && len == cstr_len && !memcmp(str, cstr, len)) {
  ------------------
  |  | 1814|   110k|#define janet_string_hash(s) (janet_string_head(s)->hash)
  |  |  ------------------
  |  |  |  | 1812|  55.2k|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (36223:17): [True: 18.4k, False: 36.8k]
  |  Branch (36223:51): [True: 18.4k, False: 0]
  |  Branch (36223:70): [True: 18.4k, False: 0]
  ------------------
36224|  18.4k|                return buckets + i;
36225|  18.4k|            }
36226|  55.2k|        }
36227|   110k|    }
36228|       |    /* Lower half */
36229|      0|    for (i = 0; i < index; i++) {
  ------------------
  |  Branch (36229:17): [True: 0, False: 0]
  ------------------
36230|      0|        const JanetKV *kv = buckets + i;
36231|      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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36232|      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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36233|      0|                return kv;
36234|      0|            } else if (NULL == first_bucket) {
  ------------------
  |  Branch (36234:24): [True: 0, False: 0]
  ------------------
36235|      0|                first_bucket = kv;
36236|      0|            }
36237|      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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36238|       |            /* Works for symbol and keyword, too */
36239|      0|            JanetString str = janet_unwrap_string(kv->key);
  ------------------
  |  |  863|      0|#define janet_unwrap_string(x) ((JanetString)janet_nanbox_to_pointer(x))
  ------------------
36240|      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)))
  |  |  ------------------
  ------------------
36241|      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 (36241:17): [True: 0, False: 0]
  |  Branch (36241:51): [True: 0, False: 0]
  |  Branch (36241:70): [True: 0, False: 0]
  ------------------
36242|      0|                return buckets + i;
36243|      0|            }
36244|      0|        }
36245|      0|    }
36246|      0|    return first_bucket;
36247|      0|}
janet_cstrcmp:
36272|  65.1k|int janet_cstrcmp(const uint8_t *str, const char *other) {
36273|  65.1k|    int32_t len = janet_string_length(str);
  ------------------
  |  | 1813|  65.1k|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  ------------------
  |  |  |  | 1812|  65.1k|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
36274|  65.1k|    int32_t index;
36275|   120k|    for (index = 0; index < len; index++) {
  ------------------
  |  Branch (36275:21): [True: 108k, False: 12.4k]
  ------------------
36276|   108k|        uint8_t c = str[index];
36277|   108k|        uint8_t k = ((const uint8_t *)other)[index];
36278|   108k|        if (c < k) return -1;
  ------------------
  |  Branch (36278:13): [True: 18.5k, False: 89.6k]
  ------------------
36279|  89.6k|        if (c > k) return 1;
  ------------------
  |  Branch (36279:13): [True: 34.1k, False: 55.4k]
  ------------------
36280|  55.4k|        if (k == '\0') break;
  ------------------
  |  Branch (36280:13): [True: 0, False: 55.4k]
  ------------------
36281|  55.4k|    }
36282|  12.4k|    return (other[index] == '\0') ? 0 : -1;
  ------------------
  |  Branch (36282:12): [True: 12.3k, False: 124]
  ------------------
36283|  65.1k|}
janet_strbinsearch:
36292|  12.7k|    const uint8_t *key) {
36293|  12.7k|    size_t low = 0;
36294|  12.7k|    size_t hi = tabcount;
36295|  12.7k|    const char *t = (const char *)tab;
36296|  65.6k|    while (low < hi) {
  ------------------
  |  Branch (36296:12): [True: 65.1k, False: 416]
  ------------------
36297|  65.1k|        size_t mid = low + ((hi - low) / 2);
36298|  65.1k|        const char **item = (const char **)(t + mid * itemsize);
36299|  65.1k|        const char *name = *item;
36300|  65.1k|        int comp = janet_cstrcmp(key, name);
36301|  65.1k|        if (comp < 0) {
  ------------------
  |  Branch (36301:13): [True: 18.7k, False: 46.4k]
  ------------------
36302|  18.7k|            hi = mid;
36303|  46.4k|        } else if (comp > 0) {
  ------------------
  |  Branch (36303:20): [True: 34.1k, False: 12.3k]
  ------------------
36304|  34.1k|            low = mid + 1;
36305|  34.1k|        } else {
36306|  12.3k|            return (const void *)item;
36307|  12.3k|        }
36308|  65.1k|    }
36309|    416|    return NULL;
36310|  12.7k|}
janet_registry_put:
36372|  2.16M|    int32_t source_line) {
36373|  2.16M|    if (janet_vm.registry_count == janet_vm.registry_cap) {
  ------------------
  |  Branch (36373:9): [True: 6.14k, False: 2.15M]
  ------------------
36374|  6.14k|        size_t newcap = (janet_vm.registry_count + 1) * 2;
36375|       |        /* Size it nicely with core by default */
36376|  6.14k|        if (newcap < 512) {
  ------------------
  |  Branch (36376:13): [True: 6.14k, False: 0]
  ------------------
36377|  6.14k|            newcap = 512;
36378|  6.14k|        }
36379|  6.14k|        void *newmem = janet_realloc(janet_vm.registry, newcap * sizeof(JanetCFunRegistry));
  ------------------
  |  | 2409|  6.14k|#define janet_realloc(X, Y) realloc((X), (Y))
  ------------------
36380|  6.14k|        if (NULL == newmem) {
  ------------------
  |  Branch (36380:13): [True: 0, False: 6.14k]
  ------------------
36381|      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]
  |  |  ------------------
  ------------------
36382|      0|        }
36383|  6.14k|        janet_vm.registry = newmem;
36384|  6.14k|        janet_vm.registry_cap = newcap;
36385|  6.14k|    }
36386|  2.16M|    JanetCFunRegistry value = {
36387|  2.16M|        key,
36388|  2.16M|        name,
36389|  2.16M|        name_prefix,
36390|  2.16M|        source_file,
36391|  2.16M|        source_line
36392|  2.16M|    };
36393|  2.16M|    janet_vm.registry[janet_vm.registry_count++] = value;
36394|  2.16M|    janet_vm.registry_dirty = 1;
36395|  2.16M|}
janet_register_abstract_type:
36521|  55.2k|void janet_register_abstract_type(const JanetAbstractType *at) {
36522|  55.2k|    janet_check_pointer_align((void *) at);
36523|  55.2k|    Janet sym = janet_csymbolv(at->name);
  ------------------
  |  | 1837|  55.2k|#define janet_csymbolv(cstr) janet_wrap_symbol(janet_csymbol(cstr))
  |  |  ------------------
  |  |  |  |  849|  55.2k|#define janet_wrap_symbol(s) janet_nanbox_wrap_c((s), JANET_SYMBOL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  828|  55.2k|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  793|  55.2k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  792|  55.2k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36524|  55.2k|    Janet check = janet_table_get(janet_vm.abstract_registry, sym);
36525|  55.2k|    if (!janet_checktype(check, JANET_NIL) && at != janet_unwrap_pointer(check)) {
  ------------------
  |  |  806|   110k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 55.2k]
  |  |  ------------------
  |  |  807|   110k|        ? 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|   110k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  55.2k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  55.2k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  55.2k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  55.2k|#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 (36525:9): [True: 0, False: 55.2k]
  |  Branch (36525:47): [True: 0, False: 0]
  ------------------
36526|      0|        janet_panicf("cannot register abstract type %s, "
36527|      0|                     "a type with the same name exists", at->name);
36528|      0|    }
36529|  55.2k|    janet_table_put(janet_vm.abstract_registry, sym, janet_wrap_pointer((void *) at));
  ------------------
  |  |  854|  55.2k|#define janet_wrap_pointer(s) janet_nanbox_wrap_((s), JANET_POINTER)
  |  |  ------------------
  |  |  |  |  825|  55.2k|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  55.2k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  55.2k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36530|  55.2k|}
janet_core_def_sm:
36541|  18.4k|void janet_core_def_sm(JanetTable *env, const char *name, Janet x, const void *p, const void *sf, int32_t sl) {
36542|  18.4k|    (void) sf;
36543|  18.4k|    (void) sl;
36544|  18.4k|    (void) p;
36545|  18.4k|    Janet key = janet_csymbolv(name);
  ------------------
  |  | 1837|  18.4k|#define janet_csymbolv(cstr) janet_wrap_symbol(janet_csymbol(cstr))
  |  |  ------------------
  |  |  |  |  849|  18.4k|#define janet_wrap_symbol(s) janet_nanbox_wrap_c((s), JANET_SYMBOL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  828|  18.4k|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  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)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36546|  18.4k|    janet_table_put(env, key, x);
36547|  18.4k|    if (janet_checktype(x, JANET_CFUNCTION)) {
  ------------------
  |  |  806|  18.4k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 0, False: 18.4k]
  |  |  |  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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36548|      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))
  ------------------
36549|      0|    }
36550|  18.4k|}
janet_core_cfuns_ext:
36552|   135k|void janet_core_cfuns_ext(JanetTable *env, const char *regprefix, const JanetRegExt *cfuns) {
36553|   135k|    (void) regprefix;
36554|  2.29M|    while (cfuns->name) {
  ------------------
  |  Branch (36554:12): [True: 2.16M, False: 135k]
  ------------------
36555|  2.16M|        janet_check_pointer_align(cfuns->cfun);
36556|  2.16M|        Janet fun = janet_wrap_cfunction(cfuns->cfun);
  ------------------
  |  |  853|  2.16M|#define janet_wrap_cfunction(s) janet_nanbox_wrap_((s), JANET_CFUNCTION)
  |  |  ------------------
  |  |  |  |  825|  2.16M|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  2.16M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  2.16M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36557|  2.16M|        janet_table_put(env, janet_csymbolv(cfuns->name), fun);
  ------------------
  |  | 1837|  2.16M|#define janet_csymbolv(cstr) janet_wrap_symbol(janet_csymbol(cstr))
  |  |  ------------------
  |  |  |  |  849|  2.16M|#define janet_wrap_symbol(s) janet_nanbox_wrap_c((s), JANET_SYMBOL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  828|  2.16M|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  793|  2.16M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  792|  2.16M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36558|  2.16M|        janet_registry_put(cfuns->cfun, cfuns->name, regprefix, cfuns->source_file, cfuns->source_line);
36559|  2.16M|        cfuns++;
36560|  2.16M|    }
36561|   135k|}
janet_binding_from_entry:
36564|  18.4k|JanetBinding janet_binding_from_entry(Janet entry) {
36565|  18.4k|    JanetTable *entry_table;
36566|  18.4k|    JanetBinding binding = {
36567|  18.4k|        JANET_BINDING_NONE,
36568|  18.4k|        janet_wrap_nil(),
  ------------------
  |  |  831|  18.4k|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|  18.4k|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36569|  18.4k|        JANET_BINDING_DEP_NONE
36570|  18.4k|    };
36571|       |
36572|       |    /* Check environment for entry */
36573|  18.4k|    if (!janet_checktype(entry, JANET_TABLE))
  ------------------
  |  |  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 (36573:9): [True: 0, False: 18.4k]
  ------------------
36574|      0|        return binding;
36575|  18.4k|    entry_table = janet_unwrap_table(entry);
  ------------------
  |  |  861|  18.4k|#define janet_unwrap_table(x) ((JanetTable *)janet_nanbox_to_pointer(x))
  ------------------
36576|       |
36577|  18.4k|    Janet deprecate = janet_table_get_keyword(entry_table, "deprecated");
36578|  18.4k|    int macro = janet_truthy(janet_table_get_keyword(entry_table, "macro"));
  ------------------
  |  |  818|  18.4k|    (!janet_checktype((x), JANET_NIL) && \
  |  |  ------------------
  |  |  |  |  806|  36.8k|    (((t) == JANET_NUMBER) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (806:6): [Folded, False: 18.4k]
  |  |  |  |  ------------------
  |  |  |  |  807|  36.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|  36.8k|        : 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 (818:6): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |  819|  18.4k|     (!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]
  |  |  ------------------
  ------------------
36579|  18.4k|    Janet value = janet_table_get_keyword(entry_table, "value");
36580|  18.4k|    Janet ref = janet_table_get_keyword(entry_table, "ref");
36581|       |
36582|  18.4k|    if (janet_checktype(deprecate, JANET_KEYWORD)) {
  ------------------
  |  |  806|  18.4k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 0, False: 18.4k]
  |  |  |  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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36583|      0|        JanetKeyword depkw = janet_unwrap_keyword(deprecate);
  ------------------
  |  |  865|      0|#define janet_unwrap_keyword(x) ((const uint8_t *)janet_nanbox_to_pointer(x))
  ------------------
36584|      0|        if (!janet_cstrcmp(depkw, "relaxed")) {
  ------------------
  |  Branch (36584:13): [True: 0, False: 0]
  ------------------
36585|      0|            binding.deprecation = JANET_BINDING_DEP_RELAXED;
36586|      0|        } else if (!janet_cstrcmp(depkw, "normal")) {
  ------------------
  |  Branch (36586:20): [True: 0, False: 0]
  ------------------
36587|      0|            binding.deprecation = JANET_BINDING_DEP_NORMAL;
36588|      0|        } else if (!janet_cstrcmp(depkw, "strict")) {
  ------------------
  |  Branch (36588:20): [True: 0, False: 0]
  ------------------
36589|      0|            binding.deprecation = JANET_BINDING_DEP_STRICT;
36590|      0|        }
36591|  18.4k|    } else if (!janet_checktype(deprecate, 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 (36591:16): [True: 0, False: 18.4k]
  ------------------
36592|      0|        binding.deprecation = JANET_BINDING_DEP_NORMAL;
36593|      0|    }
36594|       |
36595|  18.4k|    int ref_is_valid = janet_checktype(ref, JANET_ARRAY);
  ------------------
  |  |  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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36596|  18.4k|    int redef = ref_is_valid && janet_truthy(janet_table_get_keyword(entry_table, "redef"));
  ------------------
  |  |  818|  18.4k|    (!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|  18.4k|     (!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 (36596:17): [True: 0, False: 18.4k]
  ------------------
36597|       |
36598|  18.4k|    if (macro) {
  ------------------
  |  Branch (36598:9): [True: 0, False: 18.4k]
  ------------------
36599|      0|        binding.value = redef ? ref : value;
  ------------------
  |  Branch (36599:25): [True: 0, False: 0]
  ------------------
36600|      0|        binding.type = redef ? JANET_BINDING_DYNAMIC_MACRO : JANET_BINDING_MACRO;
  ------------------
  |  Branch (36600:24): [True: 0, False: 0]
  ------------------
36601|      0|        return binding;
36602|      0|    }
36603|       |
36604|  18.4k|    if (ref_is_valid) {
  ------------------
  |  Branch (36604:9): [True: 0, False: 18.4k]
  ------------------
36605|      0|        binding.value = ref;
36606|      0|        binding.type = redef ? JANET_BINDING_DYNAMIC_DEF : JANET_BINDING_VAR;
  ------------------
  |  Branch (36606:24): [True: 0, False: 0]
  ------------------
36607|  18.4k|    } else {
36608|  18.4k|        binding.value = value;
36609|  18.4k|        binding.type = JANET_BINDING_DEF;
36610|  18.4k|    }
36611|       |
36612|  18.4k|    return binding;
36613|  18.4k|}
janet_resolve_ext:
36668|  18.4k|JanetBinding janet_resolve_ext(JanetTable *env, const uint8_t *sym) {
36669|  18.4k|    Janet entry = janet_table_get(env, janet_wrap_symbol(sym));
  ------------------
  |  |  849|  18.4k|#define janet_wrap_symbol(s) janet_nanbox_wrap_c((s), JANET_SYMBOL)
  |  |  ------------------
  |  |  |  |  828|  18.4k|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36670|  18.4k|    return janet_binding_from_entry(entry);
36671|  18.4k|}
janet_resolve:
36673|  18.4k|JanetBindingType janet_resolve(JanetTable *env, const uint8_t *sym, Janet *out) {
36674|  18.4k|    JanetBinding binding = janet_resolve_ext(env, sym);
36675|  18.4k|    if (binding.type == JANET_BINDING_DYNAMIC_DEF || binding.type == JANET_BINDING_DYNAMIC_MACRO) {
  ------------------
  |  Branch (36675:9): [True: 0, False: 18.4k]
  |  Branch (36675:54): [True: 0, False: 18.4k]
  ------------------
36676|      0|        *out = janet_array_peek(janet_unwrap_array(binding.value));
  ------------------
  |  |  860|      0|#define janet_unwrap_array(x) ((JanetArray *)janet_nanbox_to_pointer(x))
  ------------------
36677|  18.4k|    } else {
36678|  18.4k|        *out = binding.value;
36679|  18.4k|    }
36680|  18.4k|    return binding.type;
36681|  18.4k|}
janet_resolve_core:
36684|  6.14k|Janet janet_resolve_core(const char *name) {
36685|  6.14k|    JanetTable *env = janet_core_env(NULL);
36686|  6.14k|    Janet out = janet_wrap_nil();
  ------------------
  |  |  831|  6.14k|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|  6.14k|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  6.14k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  6.14k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36687|  6.14k|    janet_resolve(env, janet_csymbol(name), &out);
36688|  6.14k|    return out;
36689|  6.14k|}
janet_indexed_view:
36693|  9.69M|int janet_indexed_view(Janet seq, const Janet **data, int32_t *len) {
36694|  9.69M|    if (janet_checktype(seq, JANET_ARRAY)) {
  ------------------
  |  |  806|  9.69M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 1.63M, False: 8.06M]
  |  |  |  Branch (806:6): [Folded, False: 9.69M]
  |  |  ------------------
  |  |  807|  9.69M|        ? 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.69M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  9.69M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  9.69M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  9.69M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  9.69M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36695|  1.63M|        *data = janet_unwrap_array(seq)->data;
  ------------------
  |  |  860|  1.63M|#define janet_unwrap_array(x) ((JanetArray *)janet_nanbox_to_pointer(x))
  ------------------
36696|  1.63M|        *len = janet_unwrap_array(seq)->count;
  ------------------
  |  |  860|  1.63M|#define janet_unwrap_array(x) ((JanetArray *)janet_nanbox_to_pointer(x))
  ------------------
36697|  1.63M|        return 1;
36698|  8.06M|    } else if (janet_checktype(seq, JANET_TUPLE)) {
  ------------------
  |  |  806|  8.06M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 8.06M, False: 0]
  |  |  |  Branch (806:6): [Folded, False: 8.06M]
  |  |  ------------------
  |  |  807|  8.06M|        ? 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.06M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  8.06M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  8.06M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36699|  8.06M|        *data = janet_unwrap_tuple(seq);
  ------------------
  |  |  858|  8.06M|#define janet_unwrap_tuple(x) ((JanetTuple)janet_nanbox_to_pointer(x))
  ------------------
36700|  8.06M|        *len = janet_tuple_length(janet_unwrap_tuple(seq));
  ------------------
  |  | 1802|  8.06M|#define janet_tuple_length(t) (janet_tuple_head(t)->length)
  |  |  ------------------
  |  |  |  | 1800|  8.06M|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
36701|  8.06M|        return 1;
36702|  8.06M|    }
36703|      0|    return 0;
36704|  9.69M|}
janet_bytes_view:
36708|  1.89k|int janet_bytes_view(Janet str, const uint8_t **data, int32_t *len) {
36709|  1.89k|    JanetType t = janet_type(str);
  ------------------
  |  |  795|  1.89k|    (isnan((x).number) \
  |  |  796|  1.89k|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|  1.89k|        : JANET_NUMBER)
  ------------------
  |  Branch (36709:19): [True: 1.89k, False: 0]
  ------------------
36710|  1.89k|    if (t == JANET_STRING || t == JANET_SYMBOL || t == JANET_KEYWORD) {
  ------------------
  |  Branch (36710:9): [True: 1.89k, False: 0]
  |  Branch (36710:30): [True: 0, False: 0]
  |  Branch (36710:51): [True: 0, False: 0]
  ------------------
36711|  1.89k|        *data = janet_unwrap_string(str);
  ------------------
  |  |  863|  1.89k|#define janet_unwrap_string(x) ((JanetString)janet_nanbox_to_pointer(x))
  ------------------
36712|  1.89k|        *len = janet_string_length(janet_unwrap_string(str));
  ------------------
  |  | 1813|  1.89k|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  ------------------
  |  |  |  | 1812|  1.89k|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
36713|  1.89k|        return 1;
36714|  1.89k|    } else if (t == JANET_BUFFER) {
  ------------------
  |  Branch (36714:16): [True: 0, False: 0]
  ------------------
36715|      0|        *data = janet_unwrap_buffer(str)->data;
  ------------------
  |  |  862|      0|#define janet_unwrap_buffer(x) ((JanetBuffer *)janet_nanbox_to_pointer(x))
  ------------------
36716|      0|        *len = janet_unwrap_buffer(str)->count;
  ------------------
  |  |  862|      0|#define janet_unwrap_buffer(x) ((JanetBuffer *)janet_nanbox_to_pointer(x))
  ------------------
36717|      0|        return 1;
36718|      0|    } else if (t == JANET_ABSTRACT) {
  ------------------
  |  Branch (36718:16): [True: 0, False: 0]
  ------------------
36719|      0|        void *abst = janet_unwrap_abstract(str);
  ------------------
  |  |  866|      0|#define janet_unwrap_abstract(x) (janet_nanbox_to_pointer(x))
  ------------------
36720|      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)))
  |  |  ------------------
  ------------------
36721|      0|        if (NULL == atype->bytes) {
  ------------------
  |  Branch (36721:13): [True: 0, False: 0]
  ------------------
36722|      0|            return 0;
36723|      0|        }
36724|      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)))
  |  |  ------------------
  ------------------
36725|      0|        *data = view.bytes;
36726|      0|        *len = view.len;
36727|      0|        return 1;
36728|      0|    }
36729|      0|    return 0;
36730|  1.89k|}
janet_dictionary_view:
36735|  6.06M|int janet_dictionary_view(Janet tab, const JanetKV **data, int32_t *len, int32_t *cap) {
36736|  6.06M|    if (janet_checktype(tab, JANET_TABLE)) {
  ------------------
  |  |  806|  6.06M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 571k, False: 5.49M]
  |  |  |  Branch (806:6): [Folded, False: 6.06M]
  |  |  ------------------
  |  |  807|  6.06M|        ? 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|  6.06M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  6.06M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  6.06M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  6.06M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  6.06M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36737|   571k|        *data = janet_unwrap_table(tab)->data;
  ------------------
  |  |  861|   571k|#define janet_unwrap_table(x) ((JanetTable *)janet_nanbox_to_pointer(x))
  ------------------
36738|   571k|        *cap = janet_unwrap_table(tab)->capacity;
  ------------------
  |  |  861|   571k|#define janet_unwrap_table(x) ((JanetTable *)janet_nanbox_to_pointer(x))
  ------------------
36739|   571k|        *len = janet_unwrap_table(tab)->count;
  ------------------
  |  |  861|   571k|#define janet_unwrap_table(x) ((JanetTable *)janet_nanbox_to_pointer(x))
  ------------------
36740|   571k|        return 1;
36741|  5.49M|    } else if (janet_checktype(tab, JANET_STRUCT)) {
  ------------------
  |  |  806|  5.49M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 5.49M, False: 0]
  |  |  |  Branch (806:6): [Folded, False: 5.49M]
  |  |  ------------------
  |  |  807|  5.49M|        ? 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.49M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  5.49M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  5.49M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  5.49M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  5.49M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
36742|  5.49M|        *data = janet_unwrap_struct(tab);
  ------------------
  |  |  857|  5.49M|#define janet_unwrap_struct(x) ((JanetStruct)janet_nanbox_to_pointer(x))
  ------------------
36743|  5.49M|        *cap = janet_struct_capacity(janet_unwrap_struct(tab));
  ------------------
  |  | 1849|  5.49M|#define janet_struct_capacity(t) (janet_struct_head(t)->capacity)
  |  |  ------------------
  |  |  |  | 1846|  5.49M|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
36744|  5.49M|        *len = janet_struct_length(janet_unwrap_struct(tab));
  ------------------
  |  | 1848|  5.49M|#define janet_struct_length(t) (janet_struct_head(t)->length)
  |  |  ------------------
  |  |  |  | 1846|  5.49M|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
36745|  5.49M|        return 1;
36746|  5.49M|    }
36747|      0|    return 0;
36748|  6.06M|}
janet_checkint:
36750|  18.0k|int janet_checkint(Janet x) {
36751|  18.0k|    if (!janet_checktype(x, JANET_NUMBER))
  ------------------
  |  |  806|  18.0k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [True: 18.0k, Folded]
  |  |  ------------------
  |  |  807|  18.0k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|  18.0k|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 5.18k, False: 12.8k]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 12.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  18.0k|        : 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 (36751:9): [True: 12.8k, False: 5.18k]
  ------------------
36752|  12.8k|        return 0;
36753|  5.18k|    double dval = janet_unwrap_number(x);
  ------------------
  |  |  839|  5.18k|#define janet_unwrap_number(x) ((x).number)
  ------------------
36754|       |    return janet_checkintrange(dval);
  ------------------
  |  |  962|  5.18k|#define janet_checkintrange(x) ((x) >= INT32_MIN && (x) <= INT32_MAX && (x) == (int32_t)(x))
  |  |  ------------------
  |  |  |  Branch (962:33): [True: 5.13k, False: 56]
  |  |  |  Branch (962:53): [True: 4.93k, False: 202]
  |  |  |  Branch (962:73): [True: 4.73k, False: 197]
  |  |  ------------------
  ------------------
36755|  18.0k|}
janet_sorted_keys:
36832|  6.06M|int32_t janet_sorted_keys(const JanetKV *dict, int32_t cap, int32_t *index_buffer) {
36833|       |
36834|       |    /* First, put populated indices into index_buffer */
36835|  6.06M|    int32_t next_index = 0;
36836|  33.3M|    for (int32_t i = 0; i < cap; i++) {
  ------------------
  |  Branch (36836:25): [True: 27.3M, False: 6.06M]
  ------------------
36837|  27.3M|        if (!janet_checktype(dict[i].key, JANET_NIL)) {
  ------------------
  |  |  806|  27.3M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 27.3M]
  |  |  ------------------
  |  |  807|  27.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|  27.3M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  27.3M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  27.3M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  27.3M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  27.3M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (36837:13): [True: 6.88M, False: 20.4M]
  ------------------
36838|  6.88M|            index_buffer[next_index++] = i;
36839|  6.88M|        }
36840|  27.3M|    }
36841|       |
36842|       |    /* Next, sort those (simple insertion sort here for now) */
36843|  9.54M|    for (int32_t i = 1; i < next_index; i++) {
  ------------------
  |  Branch (36843:25): [True: 3.47M, False: 6.06M]
  ------------------
36844|  3.47M|        int32_t index_to_insert = index_buffer[i];
36845|  3.47M|        Janet lhs = dict[index_to_insert].key;
36846|  5.91M|        for (int32_t j = i - 1; j >= 0; j--) {
  ------------------
  |  Branch (36846:33): [True: 4.56M, False: 1.34M]
  ------------------
36847|  4.56M|            index_buffer[j + 1] = index_buffer[j];
36848|  4.56M|            Janet rhs = dict[index_buffer[j]].key;
36849|  4.56M|            if (janet_compare(lhs, rhs) >= 0) {
  ------------------
  |  Branch (36849:17): [True: 2.12M, False: 2.43M]
  ------------------
36850|  2.12M|                index_buffer[j + 1] = index_to_insert;
36851|  2.12M|                break;
36852|  2.43M|            } else if (j == 0) {
  ------------------
  |  Branch (36852:24): [True: 1.34M, False: 1.08M]
  ------------------
36853|  1.34M|                index_buffer[0] = index_to_insert;
36854|  1.34M|            }
36855|  4.56M|        }
36856|  3.47M|    }
36857|       |
36858|       |    /* Return number of indices found */
36859|  6.06M|    return next_index;
36860|       |
36861|  6.06M|}
array_allocate:
37094|  39.4M|void *array_allocate(size_t element_size, int32_t count) {
37095|  39.4M|    if (count < 0) return NULL;
  ------------------
  |  Branch (37095:9): [True: 0, False: 39.4M]
  ------------------
37096|  39.4M|    if ((size_t) count > (SIZE_MAX / element_size)) return NULL;
  ------------------
  |  Branch (37096:9): [True: 0, False: 39.4M]
  ------------------
37097|  39.4M|    return janet_malloc(element_size * count);
  ------------------
  |  | 2406|  39.4M|#define janet_malloc(X) malloc((X))
  ------------------
37098|  39.4M|}
janet_equals:
37400|  16.6M|int janet_equals(Janet x, Janet y) {
37401|  16.6M|    if (janet_type(x) != janet_type(y)) return 0;
  ------------------
  |  |  795|  16.6M|    (isnan((x).number) \
  |  |  796|  16.6M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|  16.6M|        : JANET_NUMBER)
  ------------------
                  if (janet_type(x) != janet_type(y)) return 0;
  ------------------
  |  |  795|  16.6M|    (isnan((x).number) \
  |  |  796|  16.6M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|  16.6M|        : JANET_NUMBER)
  ------------------
  |  Branch (37401:9): [True: 16.6M, False: 1.79k]
  |  Branch (37401:9): [True: 10.6M, False: 6.02M]
  |  Branch (37401:26): [True: 16.6M, False: 6.93k]
  ------------------
37402|  6.02M|    if (janet_checktypes(x, JANET_TFLAG_TUPLE | JANET_TFLAG_STRUCT)) return janet_equals_containers(x, y);
  ------------------
  |  |  969|  6.02M|#define janet_checktypes(x, tps) ((1 << janet_type(x)) & (tps))
  |  |  ------------------
  |  |  |  |  795|  6.02M|    (isnan((x).number) \
  |  |  |  |  796|  6.02M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  |  |  797|  6.02M|        : JANET_NUMBER)
  |  |  ------------------
  |  |  |  Branch (969:34): [True: 6.02M, False: 1.77k]
  |  |  ------------------
  ------------------
  |  Branch (37402:9): [True: 6.02M, False: 180]
  ------------------
37403|  1.77k|    return janet_equals_leaf(x, y);
37404|  6.02M|}
janet_hash:
37416|   128M|int32_t janet_hash(Janet x) {
37417|   128M|    int32_t hash = 0;
37418|   128M|    switch (janet_type(x)) {
  ------------------
  |  |  795|   128M|    (isnan((x).number) \
  |  |  796|   128M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|   128M|        : JANET_NUMBER)
  ------------------
  |  Branch (37418:13): [True: 109M, False: 18.4M]
  ------------------
37419|  1.90M|        case JANET_NIL:
  ------------------
  |  Branch (37419:9): [True: 1.90M, False: 126M]
  ------------------
37420|  1.90M|            hash = 0;
37421|  1.90M|            break;
37422|  42.5k|        case JANET_BOOLEAN:
  ------------------
  |  Branch (37422:9): [True: 42.5k, False: 128M]
  ------------------
37423|  42.5k|            hash = janet_unwrap_boolean(x);
  ------------------
  |  |  838|  42.5k|#define janet_unwrap_boolean(x) ((x).u64 & 0x1)
  ------------------
37424|  42.5k|            break;
37425|  44.1M|        case JANET_STRING:
  ------------------
  |  Branch (37425:9): [True: 44.1M, False: 83.9M]
  ------------------
37426|  44.4M|        case JANET_SYMBOL:
  ------------------
  |  Branch (37426:9): [True: 311k, False: 127M]
  ------------------
37427|  45.0M|        case JANET_KEYWORD:
  ------------------
  |  Branch (37427:9): [True: 560k, False: 127M]
  ------------------
37428|  45.0M|            hash = janet_string_hash(janet_unwrap_string(x));
  ------------------
  |  | 1814|  45.0M|#define janet_string_hash(s) (janet_string_head(s)->hash)
  |  |  ------------------
  |  |  |  | 1812|  45.0M|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
37429|  45.0M|            break;
37430|  25.8M|        case JANET_TUPLE:
  ------------------
  |  Branch (37430:9): [True: 25.8M, False: 102M]
  ------------------
37431|  25.8M|            hash = janet_tuple_hash(janet_unwrap_tuple(x));
  ------------------
  |  | 1803|  25.8M|#define janet_tuple_hash(t) (janet_tuple_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1800|  25.8M|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
37432|  25.8M|            uint32_t inc = (janet_tuple_flag(janet_unwrap_tuple(x)) & JANET_TUPLE_FLAG_BRACKETCTOR) ? 1 : 0;
  ------------------
  |  | 1806|  25.8M|#define janet_tuple_flag(t) (janet_tuple_head(t)->gc.flags)
  |  |  ------------------
  |  |  |  | 1800|  25.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|  25.8M|#define JANET_TUPLE_FLAG_BRACKETCTOR 0x10000
  ------------------
  |  Branch (37432:28): [True: 9.83M, False: 16.0M]
  ------------------
37433|  25.8M|            hash = (int32_t)((uint32_t)hash + inc); /* avoid overflow undefined behavior */
37434|  25.8M|            break;
37435|  17.7M|        case JANET_STRUCT:
  ------------------
  |  Branch (37435:9): [True: 17.7M, False: 110M]
  ------------------
37436|  17.7M|            hash = janet_struct_hash(janet_unwrap_struct(x));
  ------------------
  |  | 1850|  17.7M|#define janet_struct_hash(t) (janet_struct_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1846|  17.7M|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
37437|  17.7M|            break;
37438|  18.4M|        case JANET_NUMBER: {
  ------------------
  |  Branch (37438:9): [True: 18.4M, False: 109M]
  ------------------
37439|  18.4M|            union {
37440|  18.4M|                double d;
37441|  18.4M|                uint64_t u;
37442|  18.4M|            } as;
37443|  18.4M|            as.d = janet_unwrap_number(x);
  ------------------
  |  |  839|  18.4M|#define janet_unwrap_number(x) ((x).number)
  ------------------
37444|  18.4M|            as.d += 0.0; /* normalize negative 0 */
37445|  18.4M|            as.u = murmur64(as.u);
37446|  18.4M|            uint32_t hi = (uint32_t)(as.u >> 32);
37447|  18.4M|            hash = (int32_t)hi;
37448|  18.4M|            break;
37449|  44.4M|        }
37450|  1.25M|        case JANET_ABSTRACT: {
  ------------------
  |  Branch (37450:9): [True: 1.25M, False: 126M]
  ------------------
37451|  1.25M|            JanetAbstract xx = janet_unwrap_abstract(x);
  ------------------
  |  |  866|  1.25M|#define janet_unwrap_abstract(x) (janet_nanbox_to_pointer(x))
  ------------------
37452|  1.25M|            const JanetAbstractType *at = janet_abstract_type(xx);
  ------------------
  |  | 1899|  1.25M|#define janet_abstract_type(u) (janet_abstract_head(u)->type)
  |  |  ------------------
  |  |  |  | 1897|  1.25M|#define janet_abstract_head(u) ((JanetAbstractHead *)((char *)u - offsetof(JanetAbstractHead, data)))
  |  |  ------------------
  ------------------
37453|  1.25M|            if (at->hash != NULL) {
  ------------------
  |  Branch (37453:17): [True: 1.21M, False: 36.8k]
  ------------------
37454|  1.21M|                hash = at->hash(xx, janet_abstract_size(xx));
  ------------------
  |  | 1900|  1.21M|#define janet_abstract_size(u) (janet_abstract_head(u)->size)
  |  |  ------------------
  |  |  |  | 1897|  1.21M|#define janet_abstract_head(u) ((JanetAbstractHead *)((char *)u - offsetof(JanetAbstractHead, data)))
  |  |  ------------------
  ------------------
37455|  1.21M|                break;
37456|  1.21M|            }
37457|  1.25M|        }
37458|       |        /* fallthrough */
37459|  17.7M|        default:
  ------------------
  |  Branch (37459:9): [True: 17.7M, False: 110M]
  ------------------
37460|  17.7M|            if (sizeof(double) == sizeof(void *)) {
  ------------------
  |  Branch (37460:17): [True: 17.7M, Folded]
  ------------------
37461|       |                /* Assuming 8 byte pointer (8 byte aligned) */
37462|  17.7M|                uint64_t i = murmur64(janet_u64(x));
  ------------------
  |  |  788|  17.7M|#define janet_u64(x) ((x).u64)
  ------------------
37463|  17.7M|                hash = (int32_t)(i >> 32);
37464|  17.7M|            } else {
37465|       |                /* Assuming 4 byte pointer (or smaller) */
37466|      0|                uintptr_t diff = (uintptr_t) janet_unwrap_pointer(x);
  ------------------
  |  |  867|      0|#define janet_unwrap_pointer(x) (janet_nanbox_to_pointer(x))
  ------------------
37467|      0|                uint32_t hilo = (uint32_t) diff * 2654435769u;
37468|      0|                hash = (int32_t)((hilo << 16) | (hilo >> 16));
37469|      0|            }
37470|  17.7M|            break;
37471|   128M|    }
37472|   128M|    return hash;
37473|   128M|}
janet_compare:
37478|  4.56M|int janet_compare(Janet x, Janet y) {
37479|  4.56M|    janet_vm.traversal = janet_vm.traversal_base;
37480|  4.56M|    int status;
37481|  4.57M|    do {
37482|  4.57M|        JanetType tx = janet_type(x);
  ------------------
  |  |  795|  4.57M|    (isnan((x).number) \
  |  |  796|  4.57M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|  4.57M|        : JANET_NUMBER)
  ------------------
  |  Branch (37482:24): [True: 2.07M, False: 2.49M]
  ------------------
37483|  4.57M|        JanetType ty = janet_type(y);
  ------------------
  |  |  795|  4.57M|    (isnan((x).number) \
  |  |  796|  4.57M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|  4.57M|        : JANET_NUMBER)
  ------------------
  |  Branch (37483:24): [True: 1.92M, False: 2.64M]
  ------------------
37484|  4.57M|        if (tx != ty) return tx < ty ? -1 : 1;
  ------------------
  |  Branch (37484:13): [True: 2.02M, False: 2.55M]
  |  Branch (37484:30): [True: 946k, False: 1.07M]
  ------------------
37485|  2.55M|        switch (tx) {
37486|    756|            case JANET_NIL:
  ------------------
  |  Branch (37486:13): [True: 756, False: 2.55M]
  ------------------
37487|    756|                break;
37488|     22|            case JANET_BOOLEAN: {
  ------------------
  |  Branch (37488:13): [True: 22, False: 2.55M]
  ------------------
37489|     22|                int diff = janet_unwrap_boolean(x) - janet_unwrap_boolean(y);
  ------------------
  |  |  838|     22|#define janet_unwrap_boolean(x) ((x).u64 & 0x1)
  ------------------
                              int diff = janet_unwrap_boolean(x) - janet_unwrap_boolean(y);
  ------------------
  |  |  838|     22|#define janet_unwrap_boolean(x) ((x).u64 & 0x1)
  ------------------
37490|     22|                if (diff) return diff;
  ------------------
  |  Branch (37490:21): [True: 0, False: 22]
  ------------------
37491|     22|                break;
37492|     22|            }
37493|  1.57M|            case JANET_NUMBER: {
  ------------------
  |  Branch (37493:13): [True: 1.57M, False: 975k]
  ------------------
37494|  1.57M|                double xx = janet_unwrap_number(x);
  ------------------
  |  |  839|  1.57M|#define janet_unwrap_number(x) ((x).number)
  ------------------
37495|  1.57M|                double yy = janet_unwrap_number(y);
  ------------------
  |  |  839|  1.57M|#define janet_unwrap_number(x) ((x).number)
  ------------------
37496|  1.57M|                if (xx == yy) {
  ------------------
  |  Branch (37496:21): [True: 96, False: 1.57M]
  ------------------
37497|     96|                    break;
37498|  1.57M|                } else {
37499|  1.57M|                    return (xx < yy) ? -1 : 1;
  ------------------
  |  Branch (37499:28): [True: 977k, False: 598k]
  ------------------
37500|  1.57M|                }
37501|  1.57M|            }
37502|    196|            case JANET_STRING:
  ------------------
  |  Branch (37502:13): [True: 196, False: 2.55M]
  ------------------
37503|   332k|            case JANET_SYMBOL:
  ------------------
  |  Branch (37503:13): [True: 332k, False: 2.21M]
  ------------------
37504|   333k|            case JANET_KEYWORD: {
  ------------------
  |  Branch (37504:13): [True: 121, False: 2.55M]
  ------------------
37505|   333k|                int diff = janet_string_compare(janet_unwrap_string(x), janet_unwrap_string(y));
  ------------------
  |  |  863|   333k|#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|   333k|#define janet_unwrap_string(x) ((JanetString)janet_nanbox_to_pointer(x))
  ------------------
37506|   333k|                if (diff) return diff;
  ------------------
  |  Branch (37506:21): [True: 329k, False: 3.54k]
  ------------------
37507|  3.54k|                break;
37508|   333k|            }
37509|  3.54k|            case JANET_ABSTRACT: {
  ------------------
  |  Branch (37509:13): [True: 672, False: 2.55M]
  ------------------
37510|    672|                int diff = janet_compare_abstract(janet_unwrap_abstract(x), janet_unwrap_abstract(y));
  ------------------
  |  |  866|    672|#define janet_unwrap_abstract(x) (janet_nanbox_to_pointer(x))
  ------------------
                              int diff = janet_compare_abstract(janet_unwrap_abstract(x), janet_unwrap_abstract(y));
  ------------------
  |  |  866|    672|#define janet_unwrap_abstract(x) (janet_nanbox_to_pointer(x))
  ------------------
37511|    672|                if (diff) return diff;
  ------------------
  |  Branch (37511:21): [True: 610, False: 62]
  ------------------
37512|     62|                break;
37513|    672|            }
37514|    367|            default: {
  ------------------
  |  Branch (37514:13): [True: 367, False: 2.55M]
  ------------------
37515|    367|                if (janet_unwrap_pointer(x) == janet_unwrap_pointer(y)) {
  ------------------
  |  |  867|    367|#define janet_unwrap_pointer(x) (janet_nanbox_to_pointer(x))
  ------------------
                              if (janet_unwrap_pointer(x) == janet_unwrap_pointer(y)) {
  ------------------
  |  |  867|    367|#define janet_unwrap_pointer(x) (janet_nanbox_to_pointer(x))
  ------------------
  |  Branch (37515:21): [True: 0, False: 367]
  ------------------
37516|      0|                    break;
37517|    367|                } else {
37518|    367|                    return janet_unwrap_pointer(x) > janet_unwrap_pointer(y) ? 1 : -1;
  ------------------
  |  |  867|    367|#define janet_unwrap_pointer(x) (janet_nanbox_to_pointer(x))
  ------------------
                                  return janet_unwrap_pointer(x) > janet_unwrap_pointer(y) ? 1 : -1;
  ------------------
  |  |  867|    367|#define janet_unwrap_pointer(x) (janet_nanbox_to_pointer(x))
  ------------------
  |  Branch (37518:28): [True: 85, False: 282]
  ------------------
37519|    367|                }
37520|    367|            }
37521|  4.20k|            case JANET_TUPLE: {
  ------------------
  |  Branch (37521:13): [True: 4.20k, False: 2.54M]
  ------------------
37522|  4.20k|                const Janet *lhs = janet_unwrap_tuple(x);
  ------------------
  |  |  858|  4.20k|#define janet_unwrap_tuple(x) ((JanetTuple)janet_nanbox_to_pointer(x))
  ------------------
37523|  4.20k|                const Janet *rhs = janet_unwrap_tuple(y);
  ------------------
  |  |  858|  4.20k|#define janet_unwrap_tuple(x) ((JanetTuple)janet_nanbox_to_pointer(x))
  ------------------
37524|  4.20k|                if (JANET_TUPLE_FLAG_BRACKETCTOR & (janet_tuple_flag(lhs) ^ janet_tuple_flag(rhs))) {
  ------------------
  |  | 1798|  4.20k|#define JANET_TUPLE_FLAG_BRACKETCTOR 0x10000
  ------------------
                              if (JANET_TUPLE_FLAG_BRACKETCTOR & (janet_tuple_flag(lhs) ^ janet_tuple_flag(rhs))) {
  ------------------
  |  | 1806|  4.20k|#define janet_tuple_flag(t) (janet_tuple_head(t)->gc.flags)
  |  |  ------------------
  |  |  |  | 1800|  4.20k|#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|  4.20k|#define janet_tuple_flag(t) (janet_tuple_head(t)->gc.flags)
  |  |  ------------------
  |  |  |  | 1800|  4.20k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (37524:21): [True: 74, False: 4.13k]
  ------------------
37525|     74|                    return (janet_tuple_flag(lhs) & JANET_TUPLE_FLAG_BRACKETCTOR) ? 1 : -1;
  ------------------
  |  | 1806|     74|#define janet_tuple_flag(t) (janet_tuple_head(t)->gc.flags)
  |  |  ------------------
  |  |  |  | 1800|     74|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
                                  return (janet_tuple_flag(lhs) & JANET_TUPLE_FLAG_BRACKETCTOR) ? 1 : -1;
  ------------------
  |  | 1798|     74|#define JANET_TUPLE_FLAG_BRACKETCTOR 0x10000
  ------------------
  |  Branch (37525:28): [True: 9, False: 65]
  ------------------
37526|     74|                }
37527|  4.13k|                push_traversal_node(janet_tuple_head(lhs), janet_tuple_head(rhs), 1);
  ------------------
  |  | 1800|  4.13k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  ------------------
                              push_traversal_node(janet_tuple_head(lhs), janet_tuple_head(rhs), 1);
  ------------------
  |  | 1800|  4.13k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  ------------------
37528|  4.13k|                break;
37529|  4.20k|            }
37530|   636k|            case JANET_STRUCT: {
  ------------------
  |  Branch (37530:13): [True: 636k, False: 1.91M]
  ------------------
37531|   636k|                const JanetKV *lhs = janet_unwrap_struct(x);
  ------------------
  |  |  857|   636k|#define janet_unwrap_struct(x) ((JanetStruct)janet_nanbox_to_pointer(x))
  ------------------
37532|   636k|                const JanetKV *rhs = janet_unwrap_struct(y);
  ------------------
  |  |  857|   636k|#define janet_unwrap_struct(x) ((JanetStruct)janet_nanbox_to_pointer(x))
  ------------------
37533|   636k|                int32_t llen = janet_struct_capacity(lhs);
  ------------------
  |  | 1849|   636k|#define janet_struct_capacity(t) (janet_struct_head(t)->capacity)
  |  |  ------------------
  |  |  |  | 1846|   636k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
37534|   636k|                int32_t rlen = janet_struct_capacity(rhs);
  ------------------
  |  | 1849|   636k|#define janet_struct_capacity(t) (janet_struct_head(t)->capacity)
  |  |  ------------------
  |  |  |  | 1846|   636k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
37535|   636k|                int32_t lhash = janet_struct_hash(lhs);
  ------------------
  |  | 1850|   636k|#define janet_struct_hash(t) (janet_struct_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1846|   636k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
37536|   636k|                int32_t rhash = janet_struct_hash(rhs);
  ------------------
  |  | 1850|   636k|#define janet_struct_hash(t) (janet_struct_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1846|   636k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
37537|   636k|                if (llen < rlen) return -1;
  ------------------
  |  Branch (37537:21): [True: 310k, False: 325k]
  ------------------
37538|   325k|                if (llen > rlen) return 1;
  ------------------
  |  Branch (37538:21): [True: 8.22k, False: 317k]
  ------------------
37539|   317k|                if (lhash < rhash) return -1;
  ------------------
  |  Branch (37539:21): [True: 157k, False: 159k]
  ------------------
37540|   159k|                if (lhash > rhash) return 1;
  ------------------
  |  Branch (37540:21): [True: 159k, False: 329]
  ------------------
37541|    329|                push_traversal_node(janet_struct_head(lhs), janet_struct_head(rhs), 0);
  ------------------
  |  | 1846|    329|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  ------------------
                              push_traversal_node(janet_struct_head(lhs), janet_struct_head(rhs), 0);
  ------------------
  |  | 1846|    329|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  ------------------
37542|    329|                break;
37543|   159k|            }
37544|  2.55M|        }
37545|  2.55M|    } while (!(status = traversal_next(&x, &y)));
  ------------------
  |  Branch (37545:14): [True: 8.07k, False: 865]
  ------------------
37546|    865|    return status - 2;
37547|  4.56M|}
janet_v_grow:
37951|   195k|void *janet_v_grow(void *v, int32_t increment, int32_t itemsize) {
37952|   195k|    int32_t dbl_cur = (NULL != v) ? 2 * janet_v__cap(v) : 0;
  ------------------
  |  |  765|   174k|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  ------------------
  |  |  |  |  764|   174k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  ------------------
  ------------------
  |  Branch (37952:23): [True: 174k, False: 21.0k]
  ------------------
37953|   195k|    int32_t min_needed = janet_v_count(v) + increment;
  ------------------
  |  |  759|   195k|#define janet_v_count(v)        (((v) != NULL) ? janet_v__cnt(v) : 0)
  |  |  ------------------
  |  |  |  |  766|   174k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  764|   174k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (759:34): [True: 174k, False: 21.0k]
  |  |  ------------------
  ------------------
37954|   195k|    int32_t m = dbl_cur > min_needed ? dbl_cur : min_needed;
  ------------------
  |  Branch (37954:17): [True: 153k, False: 41.7k]
  ------------------
37955|   195k|    size_t newsize = ((size_t) itemsize) * m + sizeof(int32_t) * 2;
37956|   195k|    int32_t *p = (int32_t *) janet_srealloc(v ? janet_v__raw(v) : 0, newsize);
  ------------------
  |  |  764|   174k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  ------------------
  |  Branch (37956:45): [True: 174k, False: 21.0k]
  ------------------
37957|   195k|    if (!v) p[1] = 0;
  ------------------
  |  Branch (37957:9): [True: 21.0k, False: 174k]
  ------------------
37958|   195k|    p[0] = m;
37959|   195k|    return p + 2;
37960|   195k|}
janet_try_init:
39467|  4.20k|void janet_try_init(JanetTryState *state) {
39468|  4.20k|    state->stackn = janet_vm.stackn++;
39469|  4.20k|    state->gc_handle = janet_vm.gc_suspend;
39470|  4.20k|    state->vm_fiber = janet_vm.fiber;
39471|  4.20k|    state->vm_jmp_buf = janet_vm.signal_buf;
39472|  4.20k|    state->vm_return_reg = janet_vm.return_reg;
39473|  4.20k|    state->coerce_error = janet_vm.coerce_error;
39474|  4.20k|    janet_vm.return_reg = &(state->payload);
39475|  4.20k|    janet_vm.signal_buf = &(state->buf);
39476|  4.20k|    janet_vm.coerce_error = 0;
39477|  4.20k|}
janet_restore:
39479|  4.20k|void janet_restore(JanetTryState *state) {
39480|  4.20k|    janet_vm.stackn = state->stackn;
39481|  4.20k|    janet_vm.gc_suspend = state->gc_handle;
39482|  4.20k|    janet_vm.fiber = state->vm_fiber;
39483|  4.20k|    janet_vm.signal_buf = state->vm_jmp_buf;
39484|  4.20k|    janet_vm.return_reg = state->vm_return_reg;
39485|  4.20k|    janet_vm.coerce_error = state->coerce_error;
39486|  4.20k|}
janet_init:
39641|  6.14k|int janet_init(void) {
39642|       |
39643|       |    /* Garbage collection */
39644|  6.14k|    janet_vm.blocks = NULL;
39645|  6.14k|    janet_vm.weak_blocks = NULL;
39646|  6.14k|    janet_vm.next_collection = 0;
39647|  6.14k|    janet_vm.gc_interval = 0x400000;
39648|  6.14k|    janet_vm.block_count = 0;
39649|  6.14k|    janet_vm.gc_mark_phase = 0;
39650|       |
39651|  6.14k|    janet_symcache_init();
39652|       |
39653|       |    /* Initialize gc roots */
39654|  6.14k|    janet_vm.roots = NULL;
39655|  6.14k|    janet_vm.root_count = 0;
39656|  6.14k|    janet_vm.root_capacity = 0;
39657|       |
39658|       |    /* Scratch memory */
39659|  6.14k|    janet_vm.user = NULL;
39660|  6.14k|    janet_vm.scratch_mem = NULL;
39661|  6.14k|    janet_vm.scratch_len = 0;
39662|  6.14k|    janet_vm.scratch_cap = 0;
39663|       |
39664|       |    /* Sandbox flags */
39665|  6.14k|    janet_vm.sandbox_flags = 0;
39666|       |
39667|       |    /* Initialize registry */
39668|  6.14k|    janet_vm.registry = NULL;
39669|  6.14k|    janet_vm.registry_cap = 0;
39670|  6.14k|    janet_vm.registry_count = 0;
39671|  6.14k|    janet_vm.registry_dirty = 0;
39672|       |
39673|       |    /* Initialize abstract registry */
39674|  6.14k|    janet_vm.abstract_registry = janet_table(0);
39675|  6.14k|    janet_gcroot(janet_wrap_table(janet_vm.abstract_registry));
  ------------------
  |  |  846|  6.14k|#define janet_wrap_table(s) janet_nanbox_wrap_((s), JANET_TABLE)
  |  |  ------------------
  |  |  |  |  825|  6.14k|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  6.14k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  6.14k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
39676|       |
39677|       |    /* Traversal */
39678|  6.14k|    janet_vm.traversal = NULL;
39679|  6.14k|    janet_vm.traversal_base = NULL;
39680|  6.14k|    janet_vm.traversal_top = NULL;
39681|       |
39682|       |    /* Core env */
39683|  6.14k|    janet_vm.core_env = NULL;
39684|       |
39685|       |    /* Auto suspension */
39686|  6.14k|    janet_vm.auto_suspend = 0;
39687|       |
39688|       |    /* Dynamic bindings */
39689|  6.14k|    janet_vm.top_dyns = NULL;
39690|       |
39691|       |    /* Seed RNG */
39692|  6.14k|    janet_rng_seed(janet_default_rng(), 0);
39693|       |
39694|       |    /* Fibers */
39695|  6.14k|    janet_vm.fiber = NULL;
39696|  6.14k|    janet_vm.root_fiber = NULL;
39697|  6.14k|    janet_vm.stackn = 0;
39698|       |
39699|  6.14k|#ifdef JANET_EV
39700|  6.14k|    janet_ev_init();
39701|  6.14k|#endif
39702|  6.14k|#ifdef JANET_NET
39703|  6.14k|    janet_net_init();
39704|  6.14k|#endif
39705|  6.14k|    return 0;
39706|  6.14k|}
janet_deinit:
39721|  6.14k|void janet_deinit(void) {
39722|  6.14k|    janet_clear_memory();
39723|  6.14k|    janet_symcache_deinit();
39724|  6.14k|    janet_free(janet_vm.roots);
  ------------------
  |  | 2415|  6.14k|#define janet_free(X) free((X))
  ------------------
39725|  6.14k|    janet_vm.roots = NULL;
39726|  6.14k|    janet_vm.root_count = 0;
39727|  6.14k|    janet_vm.root_capacity = 0;
39728|  6.14k|    janet_vm.abstract_registry = NULL;
39729|  6.14k|    janet_vm.core_env = NULL;
39730|  6.14k|    janet_vm.top_dyns = NULL;
39731|  6.14k|    janet_vm.user = NULL;
39732|  6.14k|    janet_free(janet_vm.traversal_base);
  ------------------
  |  | 2415|  6.14k|#define janet_free(X) free((X))
  ------------------
39733|  6.14k|    janet_vm.fiber = NULL;
39734|  6.14k|    janet_vm.root_fiber = NULL;
39735|  6.14k|    janet_free(janet_vm.registry);
  ------------------
  |  | 2415|  6.14k|#define janet_free(X) free((X))
  ------------------
39736|       |    janet_vm.registry = NULL;
39737|  6.14k|#ifdef JANET_EV
39738|  6.14k|    janet_ev_deinit();
39739|  6.14k|#endif
39740|  6.14k|#ifdef JANET_NET
39741|  6.14k|    janet_net_deinit();
39742|  6.14k|#endif
39743|  6.14k|}
janet_memalloc_empty:
39911|  8.17M|void *janet_memalloc_empty(int32_t count) {
39912|  8.17M|    int32_t i;
39913|  8.17M|    void *mem = array_allocate(sizeof(JanetKV), count);
39914|  8.17M|    janet_vm.next_collection += (size_t) count * sizeof(JanetKV);
39915|  8.17M|    if (NULL == mem) {
  ------------------
  |  Branch (39915:9): [True: 0, False: 8.17M]
  ------------------
39916|      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]
  |  |  ------------------
  ------------------
39917|      0|    }
39918|  8.17M|    JanetKV *mmem = (JanetKV *)mem;
39919|   128M|    for (i = 0; i < count; i++) {
  ------------------
  |  Branch (39919:17): [True: 120M, False: 8.17M]
  ------------------
39920|   120M|        JanetKV *kv = mmem + i;
39921|   120M|        kv->key = janet_wrap_nil();
  ------------------
  |  |  831|   120M|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|   120M|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|   120M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|   120M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
39922|   120M|        kv->value = janet_wrap_nil();
  ------------------
  |  |  831|   120M|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|   120M|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|   120M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|   120M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
39923|   120M|    }
39924|  8.17M|    return mem;
39925|  8.17M|}
janet_memempty:
39927|  47.4k|void janet_memempty(JanetKV *mem, int32_t count) {
39928|  47.4k|    int32_t i;
39929|   812k|    for (i = 0; i < count; i++) {
  ------------------
  |  Branch (39929:17): [True: 765k, False: 47.4k]
  ------------------
39930|   765k|        mem[i].key = janet_wrap_nil();
  ------------------
  |  |  831|   765k|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|   765k|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|   765k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|   765k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
39931|   765k|        mem[i].value = janet_wrap_nil();
  ------------------
  |  |  831|   765k|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|   765k|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|   765k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|   765k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
39932|   765k|    }
39933|  47.4k|}
janet_wrap_number_safe:
39937|  42.9k|Janet janet_wrap_number_safe(double d) {
39938|  42.9k|    Janet ret;
39939|  42.9k|    ret.number = isnan(d) ? NAN : d;
  ------------------
  |  Branch (39939:18): [True: 6.14k, False: 36.8k]
  ------------------
39940|  42.9k|    return ret;
39941|  42.9k|}
janet_nanbox_to_pointer:
39943|   306M|void *janet_nanbox_to_pointer(Janet x) {
39944|   306M|    x.i64 &= JANET_NANBOX_PAYLOADBITS;
  ------------------
  |  |  791|   306M|#define JANET_NANBOX_PAYLOADBITS 0x00007FFFFFFFFFFFllu
  ------------------
39945|   306M|    x.u64 <<= JANET_NANBOX_64_POINTER_SHIFT; /* Alignment, usually 0 */
  ------------------
  |  |  341|   306M|#define JANET_NANBOX_64_POINTER_SHIFT 0
  ------------------
39946|   306M|    return x.pointer;
39947|   306M|}
janet_nanbox_from_pointer:
39949|  9.14M|Janet janet_nanbox_from_pointer(void *p, uint64_t tagmask) {
39950|  9.14M|    Janet ret;
39951|  9.14M|    ret.pointer = p;
39952|       |    /* Should be noop when pointer shift is 0 */
39953|       |    /*
39954|       |    janet_assert(!(ret.u64 & (uint64_t) ((1 << JANET_NANBOX_64_POINTER_SHIFT) - 1)), "unaligned pointer wrap");
39955|       |    */
39956|  9.14M|    ret.u64 >>= JANET_NANBOX_64_POINTER_SHIFT; /* Alignment, usually 0 */
  ------------------
  |  |  341|  9.14M|#define JANET_NANBOX_64_POINTER_SHIFT 0
  ------------------
39957|  9.14M|    ret.u64 |= tagmask;
39958|  9.14M|    return ret;
39959|  9.14M|}
janet_nanbox_from_cpointer:
39961|  44.2M|Janet janet_nanbox_from_cpointer(const void *p, uint64_t tagmask) {
39962|  44.2M|    Janet ret;
39963|  44.2M|    ret.pointer = (void *)p;
39964|       |    /* Should be noop when pointer shift is 0 */
39965|       |    /*
39966|       |    janet_assert(!(ret.u64 & (uint64_t) ((1 << JANET_NANBOX_64_POINTER_SHIFT) - 1)), "unaligned pointer wrap");
39967|       |    */
39968|  44.2M|    ret.u64 >>= JANET_NANBOX_64_POINTER_SHIFT; /* Alignment, usually 0 */
  ------------------
  |  |  341|  44.2M|#define JANET_NANBOX_64_POINTER_SHIFT 0
  ------------------
39969|  44.2M|    ret.u64 |= tagmask;
39970|  44.2M|    return ret;
39971|  44.2M|}
janet_nanbox_from_double:
39973|  40.3M|Janet janet_nanbox_from_double(double d) {
39974|  40.3M|    Janet ret;
39975|  40.3M|    ret.number = d;
39976|  40.3M|    return ret;
39977|  40.3M|}
janet_nanbox_from_bits:
39979|   993M|Janet janet_nanbox_from_bits(uint64_t bits) {
39980|   993M|    Janet ret;
39981|   993M|    ret.u64 = bits;
39982|   993M|    return ret;
39983|   993M|}
janet.c:janet_array_impl:
 1606|  22.4k|static void janet_array_impl(JanetArray *array, int32_t capacity) {
 1607|  22.4k|    Janet *data = NULL;
 1608|  22.4k|    if (capacity > 0) {
  ------------------
  |  Branch (1608:9): [True: 18.5k, False: 3.87k]
  ------------------
 1609|  18.5k|        janet_vm.next_collection += capacity * sizeof(Janet);
 1610|  18.5k|        data = (Janet *) array_allocate(sizeof(Janet), capacity);
 1611|  18.5k|        if (NULL == data) {
  ------------------
  |  Branch (1611:13): [True: 0, False: 18.5k]
  ------------------
 1612|      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]
  |  |  ------------------
  ------------------
 1613|      0|        }
 1614|  18.5k|    }
 1615|  22.4k|    array->count = 0;
 1616|  22.4k|    array->capacity = capacity;
 1617|  22.4k|    array->data = data;
 1618|  22.4k|}
janet.c:janet_buffer_init_impl:
 3196|  18.8M|static JanetBuffer *janet_buffer_init_impl(JanetBuffer *buffer, int32_t capacity) {
 3197|  18.8M|    uint8_t *data = NULL;
 3198|  18.8M|    if (capacity < 4) capacity = 4;
  ------------------
  |  Branch (3198:9): [True: 6.66k, False: 18.8M]
  ------------------
 3199|  18.8M|    janet_gcpressure(capacity);
 3200|  18.8M|    data = array_allocate(sizeof(uint8_t), capacity);
 3201|  18.8M|    if (NULL == data) {
  ------------------
  |  Branch (3201:9): [True: 0, False: 18.8M]
  ------------------
 3202|      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]
  |  |  ------------------
  ------------------
 3203|      0|    }
 3204|  18.8M|    buffer->count = 0;
 3205|  18.8M|    buffer->capacity = capacity;
 3206|  18.8M|    buffer->data = data;
 3207|  18.8M|    return buffer;
 3208|  18.8M|}
janet.c:janet_buffer_can_realloc:
 3189|  13.5M|static void janet_buffer_can_realloc(JanetBuffer *buffer) {
 3190|  13.5M|    if (buffer->gc.flags & JANET_BUFFER_FLAG_NO_REALLOC) {
  ------------------
  |  | 1780|  13.5M|#define JANET_BUFFER_FLAG_NO_REALLOC 0x10000
  ------------------
  |  Branch (3190:9): [True: 0, False: 13.5M]
  ------------------
 3191|      0|        janet_panic("buffer cannot reallocate foreign memory");
 3192|      0|    }
 3193|  13.5M|}
janet.c:janet_load_libs:
 9378|  6.14k|static void janet_load_libs(JanetTable *env) {
 9379|  6.14k|    JanetRegExt corelib_cfuns[] = {
 9380|  6.14k|        JANET_CORE_REG("native", janet_core_native),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9381|  6.14k|        JANET_CORE_REG("describe", janet_core_describe),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9382|  6.14k|        JANET_CORE_REG("string", janet_core_string),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9383|  6.14k|        JANET_CORE_REG("symbol", janet_core_symbol),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9384|  6.14k|        JANET_CORE_REG("keyword", janet_core_keyword),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9385|  6.14k|        JANET_CORE_REG("buffer", janet_core_buffer),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9386|  6.14k|        JANET_CORE_REG("abstract?", janet_core_is_abstract),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9387|  6.14k|        JANET_CORE_REG("table", janet_core_table),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9388|  6.14k|        JANET_CORE_REG("array", janet_core_array),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9389|  6.14k|        JANET_CORE_REG("scan-number", janet_core_scannumber),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9390|  6.14k|        JANET_CORE_REG("tuple", janet_core_tuple),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9391|  6.14k|        JANET_CORE_REG("struct", janet_core_struct),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9392|  6.14k|        JANET_CORE_REG("gensym", janet_core_gensym),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9393|  6.14k|        JANET_CORE_REG("gccollect", janet_core_gccollect),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9394|  6.14k|        JANET_CORE_REG("gcsetinterval", janet_core_gcsetinterval),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9395|  6.14k|        JANET_CORE_REG("gcinterval", janet_core_gcinterval),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9396|  6.14k|        JANET_CORE_REG("type", janet_core_type),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9397|  6.14k|        JANET_CORE_REG("hash", janet_core_hash),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9398|  6.14k|        JANET_CORE_REG("getline", janet_core_getline),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9399|  6.14k|        JANET_CORE_REG("dyn", janet_core_dyn),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9400|  6.14k|        JANET_CORE_REG("setdyn", janet_core_setdyn),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9401|  6.14k|        JANET_CORE_REG("trace", janet_core_trace),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9402|  6.14k|        JANET_CORE_REG("untrace", janet_core_untrace),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9403|  6.14k|        JANET_CORE_REG("module/expand-path", janet_core_expand_path),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9404|  6.14k|        JANET_CORE_REG("int?", janet_core_check_int),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9405|  6.14k|        JANET_CORE_REG("nat?", janet_core_check_nat),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9406|  6.14k|        JANET_CORE_REG("bytes?", janet_core_is_bytes),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9407|  6.14k|        JANET_CORE_REG("indexed?", janet_core_is_indexed),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9408|  6.14k|        JANET_CORE_REG("dictionary?", janet_core_is_dictionary),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9409|  6.14k|        JANET_CORE_REG("lengthable?", janet_core_is_lengthable),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9410|  6.14k|        JANET_CORE_REG("slice", janet_core_slice),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9411|  6.14k|        JANET_CORE_REG("range", janet_core_range),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9412|  6.14k|        JANET_CORE_REG("signal", janet_core_signal),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9413|  6.14k|        JANET_CORE_REG("memcmp", janet_core_memcmp),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9414|  6.14k|        JANET_CORE_REG("getproto", janet_core_getproto),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9415|  6.14k|        JANET_CORE_REG("sandbox", janet_core_sandbox),
  ------------------
  |  |  518|  6.14k|#define JANET_CORE_REG JANET_REG_S
  |  |  ------------------
  |  |  |  | 2120|  6.14k|#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
  |  |  ------------------
  ------------------
 9416|  6.14k|        JANET_REG_END
  ------------------
  |  | 2110|  6.14k|#define JANET_REG_END {NULL, NULL, NULL, NULL, 0}
  ------------------
 9417|  6.14k|    };
 9418|       |    janet_core_cfuns_ext(env, NULL, corelib_cfuns);
 9419|  6.14k|    janet_lib_io(env);
 9420|  6.14k|    janet_lib_math(env);
 9421|  6.14k|    janet_lib_array(env);
 9422|  6.14k|    janet_lib_tuple(env);
 9423|  6.14k|    janet_lib_buffer(env);
 9424|  6.14k|    janet_lib_table(env);
 9425|  6.14k|    janet_lib_struct(env);
 9426|  6.14k|    janet_lib_fiber(env);
 9427|  6.14k|    janet_lib_os(env);
 9428|  6.14k|    janet_lib_parse(env);
 9429|  6.14k|    janet_lib_compile(env);
 9430|  6.14k|    janet_lib_debug(env);
 9431|  6.14k|    janet_lib_string(env);
 9432|  6.14k|    janet_lib_marsh(env);
 9433|  6.14k|#ifdef JANET_PEG
 9434|  6.14k|    janet_lib_peg(env);
 9435|  6.14k|#endif
 9436|  6.14k|#ifdef JANET_ASSEMBLER
 9437|  6.14k|    janet_lib_asm(env);
 9438|  6.14k|#endif
 9439|  6.14k|#ifdef JANET_INT_TYPES
 9440|  6.14k|    janet_lib_inttypes(env);
 9441|  6.14k|#endif
 9442|  6.14k|#ifdef JANET_EV
 9443|  6.14k|    janet_lib_ev(env);
 9444|  6.14k|#ifdef JANET_FILEWATCH
 9445|  6.14k|    janet_lib_filewatch(env);
 9446|  6.14k|#endif
 9447|  6.14k|#endif
 9448|  6.14k|#ifdef JANET_NET
 9449|  6.14k|    janet_lib_net(env);
 9450|  6.14k|#endif
 9451|  6.14k|#ifdef JANET_FFI
 9452|  6.14k|    janet_lib_ffi(env);
 9453|  6.14k|#endif
 9454|  6.14k|}
janet.c:janet_q_init:
10696|  6.14k|static void janet_q_init(JanetQueue *q) {
10697|       |    q->data = NULL;
10698|  6.14k|    q->head = 0;
10699|  6.14k|    q->tail = 0;
10700|  6.14k|    q->capacity = 0;
10701|  6.14k|}
janet.c:peek_timeout:
10778|  6.14k|static int peek_timeout(JanetTimeout *out) {
10779|  6.14k|    if (janet_vm.tq_count == 0) return 0;
  ------------------
  |  Branch (10779:9): [True: 6.14k, False: 0]
  ------------------
10780|      0|    *out = janet_vm.tq[0];
10781|      0|    return 1;
10782|  6.14k|}
janet.c:janet_q_deinit:
10703|  6.14k|static void janet_q_deinit(JanetQueue *q) {
10704|  6.14k|    janet_free(q->data);
  ------------------
  |  | 2415|  6.14k|#define janet_free(X) free((X))
  ------------------
10705|  6.14k|}
janet.c:janet_ev_setup_selfpipe:
12265|  6.14k|static void janet_ev_setup_selfpipe(void) {
12266|  6.14k|    if (janet_make_pipe(janet_vm.selfpipe, 1)) {
  ------------------
  |  Branch (12266:9): [True: 0, False: 6.14k]
  ------------------
12267|       |        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]
  |  |  ------------------
  ------------------
12268|      0|    }
12269|  6.14k|}
janet.c:janet_ev_cleanup_selfpipe:
12288|  6.14k|static void janet_ev_cleanup_selfpipe(void) {
12289|  6.14k|    close(janet_vm.selfpipe[0]);
12290|  6.14k|    close(janet_vm.selfpipe[1]);
12291|  6.14k|}
janet.c:janet_deinit_block:
18295|  49.4M|static void janet_deinit_block(JanetGCObject *mem) {
18296|  49.4M|    switch (mem->flags & JANET_MEM_TYPEBITS) {
  ------------------
  |  |  675|  49.4M|#define JANET_MEM_TYPEBITS 0xFF
  ------------------
18297|  26.8M|        default:
  ------------------
  |  Branch (18297:9): [True: 26.8M, False: 22.5M]
  ------------------
18298|  29.2M|        case JANET_MEMORY_FUNCTION:
  ------------------
  |  Branch (18298:9): [True: 2.35M, False: 47.0M]
  ------------------
18299|  29.2M|            break; /* Do nothing for non gc types */
18300|  12.2M|        case JANET_MEMORY_SYMBOL:
  ------------------
  |  Branch (18300:9): [True: 12.2M, False: 37.1M]
  ------------------
18301|  12.2M|            janet_symbol_deinit(((JanetStringHead *) mem)->data);
18302|  12.2M|            break;
18303|  22.4k|        case JANET_MEMORY_ARRAY:
  ------------------
  |  Branch (18303:9): [True: 22.4k, False: 49.3M]
  ------------------
18304|  22.4k|        case JANET_MEMORY_ARRAY_WEAK:
  ------------------
  |  Branch (18304:9): [True: 0, False: 49.4M]
  ------------------
18305|  22.4k|            janet_free(((JanetArray *) mem)->data);
  ------------------
  |  | 2415|  22.4k|#define janet_free(X) free((X))
  ------------------
18306|  22.4k|            break;
18307|  4.51M|        case JANET_MEMORY_TABLE:
  ------------------
  |  Branch (18307:9): [True: 4.51M, False: 44.9M]
  ------------------
18308|  4.51M|        case JANET_MEMORY_TABLE_WEAKK:
  ------------------
  |  Branch (18308:9): [True: 0, False: 49.4M]
  ------------------
18309|  4.51M|        case JANET_MEMORY_TABLE_WEAKV:
  ------------------
  |  Branch (18309:9): [True: 0, False: 49.4M]
  ------------------
18310|  4.51M|        case JANET_MEMORY_TABLE_WEAKKV:
  ------------------
  |  Branch (18310:9): [True: 0, False: 49.4M]
  ------------------
18311|  4.51M|            janet_free(((JanetTable *) mem)->data);
  ------------------
  |  | 2415|  4.51M|#define janet_free(X) free((X))
  ------------------
18312|  4.51M|            break;
18313|      0|        case JANET_MEMORY_FIBER: {
  ------------------
  |  Branch (18313:9): [True: 0, False: 49.4M]
  ------------------
18314|      0|            JanetFiber *f = (JanetFiber *)mem;
18315|      0|#ifdef JANET_EV
18316|      0|            if (f->ev_state && !(f->flags & JANET_FIBER_EV_FLAG_IN_FLIGHT)) {
  ------------------
  |  |  847|      0|#define JANET_FIBER_EV_FLAG_IN_FLIGHT 0x1
  ------------------
  |  Branch (18316:17): [True: 0, False: 0]
  |  Branch (18316:32): [True: 0, False: 0]
  ------------------
18317|      0|                janet_ev_dec_refcount();
18318|      0|                janet_free(f->ev_state);
  ------------------
  |  | 2415|      0|#define janet_free(X) free((X))
  ------------------
18319|      0|            } else if (f->gc.flags & JANET_FIBER_EV_GCFLAG_SUSPENDED) {
  ------------------
  |  |  843|      0|#define JANET_FIBER_EV_GCFLAG_SUSPENDED 0x2000000
  ------------------
  |  Branch (18319:24): [True: 0, False: 0]
  ------------------
18320|      0|                janet_ev_dec_refcount();
18321|      0|            }
18322|      0|#endif
18323|      0|            janet_free(f->data);
  ------------------
  |  | 2415|      0|#define janet_free(X) free((X))
  ------------------
18324|      0|        }
18325|      0|        break;
18326|  11.8k|        case JANET_MEMORY_BUFFER:
  ------------------
  |  Branch (18326:9): [True: 11.8k, False: 49.4M]
  ------------------
18327|  11.8k|            janet_buffer_deinit((JanetBuffer *) mem);
18328|  11.8k|            break;
18329|  47.5k|        case JANET_MEMORY_ABSTRACT: {
  ------------------
  |  Branch (18329:9): [True: 47.5k, False: 49.3M]
  ------------------
18330|  47.5k|            JanetAbstractHead *head = (JanetAbstractHead *)mem;
18331|  47.5k|            if (head->type->gcperthread) {
  ------------------
  |  Branch (18331:17): [True: 0, False: 47.5k]
  ------------------
18332|      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]
  |  |  ------------------
  ------------------
18333|      0|            }
18334|  47.5k|            if (head->type->gc) {
  ------------------
  |  Branch (18334:17): [True: 18.4k, False: 29.0k]
  ------------------
18335|  18.4k|                janet_assert(!head->type->gc(head->data, head->size), "finalizer failed");
  ------------------
  |  |  389|  18.4k|#define janet_assert(c, m) do { \
  |  |  390|  18.4k|    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: 18.4k]
  |  |  ------------------
  |  |  391|  18.4k|} while (0)
  |  |  ------------------
  |  |  |  Branch (391:10): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
18336|  18.4k|            }
18337|  47.5k|        }
18338|  47.5k|        break;
18339|  49.1k|        case JANET_MEMORY_FUNCENV: {
  ------------------
  |  Branch (18339:9): [True: 49.1k, False: 49.3M]
  ------------------
18340|  49.1k|            JanetFuncEnv *env = (JanetFuncEnv *)mem;
18341|  49.1k|            if (0 == env->offset)
  ------------------
  |  Branch (18341:17): [True: 49.1k, False: 0]
  ------------------
18342|  49.1k|                janet_free(env->as.values);
  ------------------
  |  | 2415|  49.1k|#define janet_free(X) free((X))
  ------------------
18343|  49.1k|        }
18344|  49.1k|        break;
18345|  3.28M|        case JANET_MEMORY_FUNCDEF: {
  ------------------
  |  Branch (18345:9): [True: 3.28M, False: 46.1M]
  ------------------
18346|  3.28M|            JanetFuncDef *def = (JanetFuncDef *)mem;
18347|       |            /* TODO - get this all with one alloc and one free */
18348|  3.28M|            janet_free(def->defs);
  ------------------
  |  | 2415|  3.28M|#define janet_free(X) free((X))
  ------------------
18349|  3.28M|            janet_free(def->environments);
  ------------------
  |  | 2415|  3.28M|#define janet_free(X) free((X))
  ------------------
18350|  3.28M|            janet_free(def->constants);
  ------------------
  |  | 2415|  3.28M|#define janet_free(X) free((X))
  ------------------
18351|  3.28M|            janet_free(def->bytecode);
  ------------------
  |  | 2415|  3.28M|#define janet_free(X) free((X))
  ------------------
18352|  3.28M|            janet_free(def->sourcemap);
  ------------------
  |  | 2415|  3.28M|#define janet_free(X) free((X))
  ------------------
18353|  3.28M|            janet_free(def->closure_bitset);
  ------------------
  |  | 2415|  3.28M|#define janet_free(X) free((X))
  ------------------
18354|  3.28M|            janet_free(def->symbolmap);
  ------------------
  |  | 2415|  3.28M|#define janet_free(X) free((X))
  ------------------
18355|  3.28M|        }
18356|  3.28M|        break;
18357|  49.4M|    }
18358|  49.4M|}
janet.c:janet_free_all_scratch:
18545|  6.14k|static void janet_free_all_scratch(void) {
18546|  2.17M|    for (size_t i = 0; i < janet_vm.scratch_len; i++) {
  ------------------
  |  Branch (18546:24): [True: 2.17M, False: 6.14k]
  ------------------
18547|  2.17M|        free_one_scratch(janet_vm.scratch_mem[i]);
18548|  2.17M|    }
18549|  6.14k|    janet_vm.scratch_len = 0;
18550|  6.14k|}
janet.c:janet_mem2scratch:
18552|  19.5M|static JanetScratch *janet_mem2scratch(void *mem) {
18553|  19.5M|    JanetScratch *s = (JanetScratch *)mem;
18554|  19.5M|    return s - 1;
18555|  19.5M|}
janet.c:free_one_scratch:
18537|  21.4M|static void free_one_scratch(JanetScratch *s) {
18538|  21.4M|    if (NULL != s->finalize) {
  ------------------
  |  Branch (18538:9): [True: 0, False: 21.4M]
  ------------------
18539|      0|        s->finalize((char *) s->mem);
18540|      0|    }
18541|  21.4M|    janet_free(s);
  ------------------
  |  | 2415|  21.4M|#define janet_free(X) free((X))
  ------------------
18542|  21.4M|}
janet.c:it_s64_tostring:
18838|    710|static void it_s64_tostring(void *p, JanetBuffer *buffer) {
18839|    710|    char str[32];
18840|       |    snprintf(str, sizeof(str), "%" PRId64, *((int64_t *)p));
18841|    710|    janet_buffer_push_cstring(buffer, str);
18842|    710|}
janet.c:janet_int64_compare:
18815|    343|static int janet_int64_compare(void *p1, void *p2) {
18816|    343|    int64_t x = *((int64_t *)p1);
18817|    343|    int64_t y = *((int64_t *)p2);
18818|    343|    return x == y ? 0 : x < y ? -1 : 1;
  ------------------
  |  Branch (18818:12): [True: 50, False: 293]
  |  Branch (18818:25): [True: 135, False: 158]
  ------------------
18819|    343|}
janet.c:janet_int64_hash:
18809|  1.21M|static int32_t janet_int64_hash(void *p1, size_t size) {
18810|  1.21M|    (void) size;
18811|  1.21M|    int32_t *words = p1;
18812|  1.21M|    return words[0] ^ words[1];
18813|  1.21M|}
janet.c:it_u64_tostring:
18844|   404k|static void it_u64_tostring(void *p, JanetBuffer *buffer) {
18845|   404k|    char str[32];
18846|       |    snprintf(str, sizeof(str), "%" PRIu64, *((uint64_t *)p));
18847|   404k|    janet_buffer_push_cstring(buffer, str);
18848|   404k|}
janet.c:janet_uint64_compare:
18821|    492|static int janet_uint64_compare(void *p1, void *p2) {
18822|    492|    uint64_t x = *((uint64_t *)p1);
18823|    492|    uint64_t y = *((uint64_t *)p2);
18824|    492|    return x == y ? 0 : x < y ? -1 : 1;
  ------------------
  |  Branch (18824:12): [True: 91, False: 401]
  |  Branch (18824:25): [True: 224, False: 177]
  ------------------
18825|    492|}
janet.c:makef:
19567|  18.4k|static void *makef(FILE *f, int32_t flags, size_t bufsize) {
19568|  18.4k|    JanetFile *iof = (JanetFile *) janet_abstract(&janet_file_type, sizeof(JanetFile));
19569|  18.4k|    iof->file = f;
19570|  18.4k|    iof->flags = flags;
19571|  18.4k|    iof->vbufsize = bufsize;
19572|  18.4k|#if !(defined(JANET_WINDOWS) || defined(JANET_PLAN9))
19573|       |    /* While we would like fopen to set cloexec by default (like O_CLOEXEC) with the e flag, that is
19574|       |     * not standard. */
19575|  18.4k|    if (!(flags & JANET_FILE_NOT_CLOSEABLE))
  ------------------
  |  | 2278|  18.4k|#define JANET_FILE_NOT_CLOSEABLE 16
  ------------------
  |  Branch (19575:9): [True: 0, False: 18.4k]
  ------------------
19576|      0|        fcntl(fileno(f), F_SETFD, FD_CLOEXEC);
19577|  18.4k|#endif
19578|  18.4k|    return iof;
19579|  18.4k|}
janet.c:cfun_io_gc:
19775|  18.4k|static int cfun_io_gc(void *p, size_t len) {
19776|  18.4k|    (void) len;
19777|  18.4k|    JanetFile *iof = (JanetFile *)p;
19778|  18.4k|    janet_file_close(iof);
19779|  18.4k|    return 0;
19780|  18.4k|}
janet.c:readint:
21059|   416M|static int32_t readint(UnmarshalState *st, const uint8_t **atdata) {
21060|   416M|    const uint8_t *data = *atdata;
21061|   416M|    int32_t ret;
21062|   416M|    MARSH_EOS(st, data);
  ------------------
  |  |21054|   416M|#define MARSH_EOS(st, data) do { \
  |  |21055|   416M|    if ((data) >= (st)->end) janet_panic("unexpected end of source");\
  |  |  ------------------
  |  |  |  Branch (21055:9): [True: 0, False: 416M]
  |  |  ------------------
  |  |21056|   416M|} while (0)
  |  |  ------------------
  |  |  |  Branch (21056:10): [Folded, False: 416M]
  |  |  ------------------
  ------------------
21063|   416M|    if (*data < 128) {
  ------------------
  |  Branch (21063:9): [True: 339M, False: 77.2M]
  ------------------
21064|   339M|        ret = *data++;
21065|   339M|    } else if (*data < 192) {
  ------------------
  |  Branch (21065:16): [True: 72.9M, False: 4.33M]
  ------------------
21066|  72.9M|        MARSH_EOS(st, data + 1);
  ------------------
  |  |21054|  72.9M|#define MARSH_EOS(st, data) do { \
  |  |21055|  72.9M|    if ((data) >= (st)->end) janet_panic("unexpected end of source");\
  |  |  ------------------
  |  |  |  Branch (21055:9): [True: 0, False: 72.9M]
  |  |  ------------------
  |  |21056|  72.9M|} while (0)
  |  |  ------------------
  |  |  |  Branch (21056:10): [Folded, False: 72.9M]
  |  |  ------------------
  ------------------
21067|  72.9M|        uint32_t uret = ((data[0] & 0x3F) << 8) + data[1];
21068|       |        /* Sign extend 18 MSBs */
21069|  72.9M|        uret |= (uret >> 13) ? 0xFFFFC000 : 0;
  ------------------
  |  Branch (21069:17): [True: 20.4M, False: 52.5M]
  ------------------
21070|  72.9M|        ret = (int32_t)uret;
21071|  72.9M|        data += 2;
21072|  72.9M|    } else if (*data == LB_INTEGER) {
  ------------------
  |  Branch (21072:16): [True: 4.33M, False: 0]
  ------------------
21073|  4.33M|        MARSH_EOS(st, data + 4);
  ------------------
  |  |21054|  4.33M|#define MARSH_EOS(st, data) do { \
  |  |21055|  4.33M|    if ((data) >= (st)->end) janet_panic("unexpected end of source");\
  |  |  ------------------
  |  |  |  Branch (21055:9): [True: 0, False: 4.33M]
  |  |  ------------------
  |  |21056|  4.33M|} while (0)
  |  |  ------------------
  |  |  |  Branch (21056:10): [Folded, False: 4.33M]
  |  |  ------------------
  ------------------
21074|  4.33M|        uint32_t ui = ((uint32_t)(data[1]) << 24) |
21075|  4.33M|                      ((uint32_t)(data[2]) << 16) |
21076|  4.33M|                      ((uint32_t)(data[3]) << 8) |
21077|  4.33M|                      (uint32_t)(data[4]);
21078|  4.33M|        ret = (int32_t)ui;
21079|  4.33M|        data += 5;
21080|  4.33M|    } else {
21081|      0|        janet_panicf("expected integer, got byte %x at index %d",
21082|      0|                     *data,
21083|      0|                     data - st->start);
21084|      0|        ret = 0;
21085|      0|    }
21086|   416M|    *atdata = data;
21087|   416M|    return ret;
21088|   416M|}
janet.c:unmarshal_one:
21668|   111M|    int flags) {
21669|   111M|    uint8_t lead;
21670|   111M|    MARSH_STACKCHECK;
  ------------------
  |  |20526|   111M|#define MARSH_STACKCHECK if ((flags & 0xFFFF) > JANET_RECURSION_GUARD) janet_panic("stack overflow")
  |  |  ------------------
  |  |  |  |  296|   111M|#define JANET_RECURSION_GUARD 1024
  |  |  ------------------
  |  |  |  Branch (20526:30): [True: 0, False: 111M]
  |  |  ------------------
  ------------------
21671|   111M|    MARSH_EOS(st, data);
  ------------------
  |  |21054|   111M|#define MARSH_EOS(st, data) do { \
  |  |21055|   111M|    if ((data) >= (st)->end) janet_panic("unexpected end of source");\
  |  |  ------------------
  |  |  |  Branch (21055:9): [True: 0, False: 111M]
  |  |  ------------------
  |  |21056|   111M|} while (0)
  |  |  ------------------
  |  |  |  Branch (21056:10): [Folded, False: 111M]
  |  |  ------------------
  ------------------
21672|   111M|    lead = data[0];
21673|   111M|    if (lead < LB_REAL) {
  ------------------
  |  Branch (21673:9): [True: 8.48M, False: 103M]
  ------------------
21674|  8.48M|        *out = janet_wrap_integer(readint(st, &data));
  ------------------
  |  |  967|  8.48M|#define janet_wrap_integer(x) janet_wrap_number((int32_t)(x))
  |  |  ------------------
  |  |  |  |  835|  8.48M|#define janet_wrap_number(r) janet_nanbox_from_double(r)
  |  |  ------------------
  ------------------
21675|  8.48M|        return data;
21676|  8.48M|    }
21677|   103M|    switch (lead) {
21678|   337k|        case LB_NIL:
  ------------------
  |  Branch (21678:9): [True: 337k, False: 102M]
  ------------------
21679|   337k|            *out = janet_wrap_nil();
  ------------------
  |  |  831|   337k|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|   337k|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|   337k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|   337k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21680|   337k|            return data + 1;
21681|      0|        case LB_FALSE:
  ------------------
  |  Branch (21681:9): [True: 0, False: 103M]
  ------------------
21682|      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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21683|      0|            return data + 1;
21684|   816k|        case LB_TRUE:
  ------------------
  |  Branch (21684:9): [True: 816k, False: 102M]
  ------------------
21685|   816k|            *out = janet_wrap_true();
  ------------------
  |  |  832|   816k|#define janet_wrap_true() janet_nanbox_from_payload(JANET_BOOLEAN, 1)
  |  |  ------------------
  |  |  |  |  822|   816k|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|   816k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|   816k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21686|   816k|            return data + 1;
21687|  18.4k|        case LB_INTEGER:
  ------------------
  |  Branch (21687:9): [True: 18.4k, False: 103M]
  ------------------
21688|       |            /* Long integer */
21689|  18.4k|            MARSH_EOS(st, data + 4);
  ------------------
  |  |21054|  18.4k|#define MARSH_EOS(st, data) do { \
  |  |21055|  18.4k|    if ((data) >= (st)->end) janet_panic("unexpected end of source");\
  |  |  ------------------
  |  |  |  Branch (21055:9): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |21056|  18.4k|} while (0)
  |  |  ------------------
  |  |  |  Branch (21056:10): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
21690|  18.4k|            uint32_t ui = ((uint32_t)(data[4])) |
21691|  18.4k|                          ((uint32_t)(data[3]) << 8) |
21692|  18.4k|                          ((uint32_t)(data[2]) << 16) |
21693|  18.4k|                          ((uint32_t)(data[1]) << 24);
21694|  18.4k|            int32_t si = (int32_t)ui;
21695|  18.4k|            *out = janet_wrap_integer(si);
  ------------------
  |  |  967|  18.4k|#define janet_wrap_integer(x) janet_wrap_number((int32_t)(x))
  |  |  ------------------
  |  |  |  |  835|  18.4k|#define janet_wrap_number(r) janet_nanbox_from_double(r)
  |  |  ------------------
  ------------------
21696|  18.4k|            return data + 5;
21697|  42.9k|        case LB_REAL:
  ------------------
  |  Branch (21697:9): [True: 42.9k, False: 103M]
  ------------------
21698|       |            /* Real */
21699|  42.9k|        {
21700|  42.9k|            union {
21701|  42.9k|                double d;
21702|  42.9k|                uint8_t bytes[8];
21703|  42.9k|            } u;
21704|  42.9k|            MARSH_EOS(st, data + 8);
  ------------------
  |  |21054|  42.9k|#define MARSH_EOS(st, data) do { \
  |  |21055|  42.9k|    if ((data) >= (st)->end) janet_panic("unexpected end of source");\
  |  |  ------------------
  |  |  |  Branch (21055:9): [True: 0, False: 42.9k]
  |  |  ------------------
  |  |21056|  42.9k|} while (0)
  |  |  ------------------
  |  |  |  Branch (21056:10): [Folded, False: 42.9k]
  |  |  ------------------
  ------------------
21705|       |#ifdef JANET_BIG_ENDIAN
21706|       |            u.bytes[0] = data[8];
21707|       |            u.bytes[1] = data[7];
21708|       |            u.bytes[2] = data[6];
21709|       |            u.bytes[3] = data[5];
21710|       |            u.bytes[4] = data[4];
21711|       |            u.bytes[5] = data[3];
21712|       |            u.bytes[6] = data[2];
21713|       |            u.bytes[7] = data[1];
21714|       |#else
21715|  42.9k|            memcpy(&u.bytes, data + 1, sizeof(double));
21716|  42.9k|#endif
21717|  42.9k|            *out = janet_wrap_number_safe(u.d);
21718|  42.9k|            janet_v_push(st->lookup, *out);
  ------------------
  |  |  757|  42.9k|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  769|  42.9k|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  768|  42.9k|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  766|  42.9k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|  42.9k|#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))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  765|  42.9k|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|  42.9k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (768:35): [True: 0, False: 42.9k]
  |  |  |  |  |  |  |  Branch (768:50): [True: 0, False: 42.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  770|      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))
  |  |  ------------------
  |  |  |  |  766|  42.9k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  764|  42.9k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21719|  42.9k|            return data + 9;
21720|  42.9k|        }
21721|  9.08M|        case LB_STRING:
  ------------------
  |  Branch (21721:9): [True: 9.08M, False: 93.9M]
  ------------------
21722|  20.5M|        case LB_SYMBOL:
  ------------------
  |  Branch (21722:9): [True: 11.4M, False: 91.6M]
  ------------------
21723|  20.5M|        case LB_BUFFER:
  ------------------
  |  Branch (21723:9): [True: 6.14k, False: 103M]
  ------------------
21724|  22.0M|        case LB_KEYWORD:
  ------------------
  |  Branch (21724:9): [True: 1.46M, False: 101M]
  ------------------
21725|  24.1M|        case LB_REGISTRY: {
  ------------------
  |  Branch (21725:9): [True: 2.18M, False: 100M]
  ------------------
21726|  24.1M|            data++;
21727|  24.1M|            int32_t len = readnat(st, &data);
21728|  24.1M|            MARSH_EOS(st, data - 1 + len);
  ------------------
  |  |21054|  24.1M|#define MARSH_EOS(st, data) do { \
  |  |21055|  24.1M|    if ((data) >= (st)->end) janet_panic("unexpected end of source");\
  |  |  ------------------
  |  |  |  Branch (21055:9): [True: 0, False: 24.1M]
  |  |  ------------------
  |  |21056|  24.1M|} while (0)
  |  |  ------------------
  |  |  |  Branch (21056:10): [Folded, False: 24.1M]
  |  |  ------------------
  ------------------
21729|  24.1M|            if (lead == LB_STRING) {
  ------------------
  |  Branch (21729:17): [True: 9.08M, False: 15.1M]
  ------------------
21730|  9.08M|                const uint8_t *str = janet_string(data, len);
21731|  9.08M|                *out = janet_wrap_string(str);
  ------------------
  |  |  848|  9.08M|#define janet_wrap_string(s) janet_nanbox_wrap_c((s), JANET_STRING)
  |  |  ------------------
  |  |  |  |  828|  9.08M|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  9.08M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  9.08M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21732|  15.1M|            } else if (lead == LB_SYMBOL) {
  ------------------
  |  Branch (21732:24): [True: 11.4M, False: 3.64M]
  ------------------
21733|  11.4M|                const uint8_t *str = janet_symbol(data, len);
21734|  11.4M|                *out = janet_wrap_symbol(str);
  ------------------
  |  |  849|  11.4M|#define janet_wrap_symbol(s) janet_nanbox_wrap_c((s), JANET_SYMBOL)
  |  |  ------------------
  |  |  |  |  828|  11.4M|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  11.4M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  11.4M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21735|  11.4M|            } else if (lead == LB_KEYWORD) {
  ------------------
  |  Branch (21735:24): [True: 1.46M, False: 2.18M]
  ------------------
21736|  1.46M|                const uint8_t *str = janet_keyword(data, len);
  ------------------
  |  | 1840|  1.46M|#define janet_keyword janet_symbol
  ------------------
21737|  1.46M|                *out = janet_wrap_keyword(str);
  ------------------
  |  |  850|  1.46M|#define janet_wrap_keyword(s) janet_nanbox_wrap_c((s), JANET_KEYWORD)
  |  |  ------------------
  |  |  |  |  828|  1.46M|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  1.46M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  1.46M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21738|  2.18M|            } else if (lead == LB_REGISTRY) {
  ------------------
  |  Branch (21738:24): [True: 2.18M, False: 6.14k]
  ------------------
21739|  2.18M|                if (st->reg) {
  ------------------
  |  Branch (21739:21): [True: 2.18M, False: 0]
  ------------------
21740|  2.18M|                    Janet regkey = janet_symbolv(data, len);
  ------------------
  |  | 1836|  2.18M|#define janet_symbolv(str, len) janet_wrap_symbol(janet_symbol((str), (len)))
  |  |  ------------------
  |  |  |  |  849|  2.18M|#define janet_wrap_symbol(s) janet_nanbox_wrap_c((s), JANET_SYMBOL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  828|  2.18M|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  793|  2.18M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  792|  2.18M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21741|  2.18M|                    *out = janet_table_get(st->reg, regkey);
21742|  2.18M|                } else {
21743|      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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21744|      0|                }
21745|  2.18M|            } else { /* (lead == LB_BUFFER) */
21746|  6.14k|                JanetBuffer *buffer = janet_buffer(len);
21747|  6.14k|                buffer->count = len;
21748|  6.14k|                safe_memcpy(buffer->data, data, len);
21749|  6.14k|                *out = janet_wrap_buffer(buffer);
  ------------------
  |  |  847|  6.14k|#define janet_wrap_buffer(s) janet_nanbox_wrap_((s), JANET_BUFFER)
  |  |  ------------------
  |  |  |  |  825|  6.14k|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  6.14k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  6.14k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21750|  6.14k|            }
21751|  24.1M|            janet_v_push(st->lookup, *out);
  ------------------
  |  |  757|  24.1M|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  769|  24.1M|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  768|  24.1M|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  766|  24.1M|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|  24.1M|#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))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  765|  24.1M|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|  24.1M|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (768:35): [True: 0, False: 24.1M]
  |  |  |  |  |  |  |  Branch (768:50): [True: 73.7k, False: 24.1M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  770|  73.7k|#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))
  |  |  ------------------
  |  |  |  |  766|  24.1M|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  764|  24.1M|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21752|  24.1M|            return data + len;
21753|  24.1M|        }
21754|      0|        case LB_FIBER: {
  ------------------
  |  Branch (21754:9): [True: 0, False: 103M]
  ------------------
21755|      0|            JanetFiber *fiber;
21756|      0|            data = unmarshal_one_fiber(st, data + 1, &fiber, flags + 1);
21757|      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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21758|      0|            return data;
21759|  24.1M|        }
21760|  2.35M|        case LB_FUNCTION: {
  ------------------
  |  Branch (21760:9): [True: 2.35M, False: 100M]
  ------------------
21761|  2.35M|            JanetFunction *func;
21762|  2.35M|            JanetFuncDef *def;
21763|  2.35M|            data++;
21764|  2.35M|            int32_t len = readnat(st, &data);
21765|  2.35M|            if (len > 255) {
  ------------------
  |  Branch (21765:17): [True: 0, False: 2.35M]
  ------------------
21766|      0|                janet_panicf("invalid function - too many environments (%d)", len);
21767|      0|            }
21768|  2.35M|            func = janet_gcalloc(JANET_MEMORY_FUNCTION, sizeof(JanetFunction) +
21769|  2.35M|                                 len * sizeof(JanetFuncEnv));
21770|  2.35M|            func->def = NULL;
21771|  2.61M|            for (int32_t i = 0; i < len; i++) {
  ------------------
  |  Branch (21771:33): [True: 264k, False: 2.35M]
  ------------------
21772|   264k|                func->envs[i] = NULL;
21773|   264k|            }
21774|  2.35M|            *out = janet_wrap_function(func);
  ------------------
  |  |  852|  2.35M|#define janet_wrap_function(s) janet_nanbox_wrap_((s), JANET_FUNCTION)
  |  |  ------------------
  |  |  |  |  825|  2.35M|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  2.35M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  2.35M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21775|  2.35M|            janet_v_push(st->lookup, *out);
  ------------------
  |  |  757|  2.35M|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  769|  2.35M|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  768|  2.35M|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  766|  2.35M|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|  2.35M|#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))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  765|  2.35M|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|  2.35M|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (768:35): [True: 0, False: 2.35M]
  |  |  |  |  |  |  |  Branch (768:50): [True: 0, False: 2.35M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  770|      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))
  |  |  ------------------
  |  |  |  |  766|  2.35M|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  764|  2.35M|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21776|  2.35M|            data = unmarshal_one_def(st, data, &def, flags + 1);
21777|  2.35M|            if (def->environments_length != len) {
  ------------------
  |  Branch (21777:17): [True: 0, False: 2.35M]
  ------------------
21778|      0|                janet_panicf("invalid function - env count %d does not match funcdef (%d)",
21779|      0|                             len, def->environments_length);
21780|      0|            }
21781|  2.35M|            func->def = def;
21782|  2.61M|            for (int32_t i = 0; i < len; i++) {
  ------------------
  |  Branch (21782:33): [True: 264k, False: 2.35M]
  ------------------
21783|   264k|                data = unmarshal_one_env(st, data, &(func->envs[i]), flags + 1);
21784|   264k|            }
21785|  2.35M|            return data;
21786|  2.35M|        }
21787|      0|        case LB_ABSTRACT: {
  ------------------
  |  Branch (21787:9): [True: 0, False: 103M]
  ------------------
21788|      0|            data++;
21789|      0|            return unmarshal_one_abstract(st, data, out, flags);
21790|  2.35M|        }
21791|  66.1M|        case LB_REFERENCE:
  ------------------
  |  Branch (21791:9): [True: 66.1M, False: 36.9M]
  ------------------
21792|  66.1M|        case LB_ARRAY:
  ------------------
  |  Branch (21792:9): [True: 18.4k, False: 103M]
  ------------------
21793|  66.1M|        case LB_ARRAY_WEAK:
  ------------------
  |  Branch (21793:9): [True: 0, False: 103M]
  ------------------
21794|  70.7M|        case LB_TUPLE:
  ------------------
  |  Branch (21794:9): [True: 4.61M, False: 98.4M]
  ------------------
21795|  70.8M|        case LB_STRUCT:
  ------------------
  |  Branch (21795:9): [True: 42.9k, False: 103M]
  ------------------
21796|  70.8M|        case LB_STRUCT_PROTO:
  ------------------
  |  Branch (21796:9): [True: 0, False: 103M]
  ------------------
21797|  75.3M|        case LB_TABLE:
  ------------------
  |  Branch (21797:9): [True: 4.48M, False: 98.5M]
  ------------------
21798|  75.3M|        case LB_TABLE_PROTO:
  ------------------
  |  Branch (21798:9): [True: 0, False: 103M]
  ------------------
21799|  75.3M|        case LB_TABLE_WEAKK:
  ------------------
  |  Branch (21799:9): [True: 0, False: 103M]
  ------------------
21800|  75.3M|        case LB_TABLE_WEAKV:
  ------------------
  |  Branch (21800:9): [True: 0, False: 103M]
  ------------------
21801|  75.3M|        case LB_TABLE_WEAKKV:
  ------------------
  |  Branch (21801:9): [True: 0, False: 103M]
  ------------------
21802|  75.3M|        case LB_TABLE_WEAKK_PROTO:
  ------------------
  |  Branch (21802:9): [True: 0, False: 103M]
  ------------------
21803|  75.3M|        case LB_TABLE_WEAKV_PROTO:
  ------------------
  |  Branch (21803:9): [True: 0, False: 103M]
  ------------------
21804|  75.3M|        case LB_TABLE_WEAKKV_PROTO:
  ------------------
  |  Branch (21804:9): [True: 0, False: 103M]
  ------------------
21805|       |            /* Things that open with integers */
21806|  75.3M|        {
21807|  75.3M|            data++;
21808|  75.3M|            int32_t len = readnat(st, &data);
21809|       |            /* DOS check */
21810|  75.3M|            if (lead != LB_REFERENCE) {
  ------------------
  |  Branch (21810:17): [True: 9.17M, False: 66.1M]
  ------------------
21811|  9.17M|                MARSH_EOS(st, data - 1 + len);
  ------------------
  |  |21054|  9.17M|#define MARSH_EOS(st, data) do { \
  |  |21055|  9.17M|    if ((data) >= (st)->end) janet_panic("unexpected end of source");\
  |  |  ------------------
  |  |  |  Branch (21055:9): [True: 0, False: 9.17M]
  |  |  ------------------
  |  |21056|  9.17M|} while (0)
  |  |  ------------------
  |  |  |  Branch (21056:10): [Folded, False: 9.17M]
  |  |  ------------------
  ------------------
21812|  9.17M|            }
21813|  75.3M|            if (lead == LB_ARRAY || lead == LB_ARRAY_WEAK) {
  ------------------
  |  Branch (21813:17): [True: 18.4k, False: 75.2M]
  |  Branch (21813:37): [True: 0, False: 75.2M]
  ------------------
21814|       |                /* Array */
21815|  18.4k|                JanetArray *array = (lead == LB_ARRAY_WEAK) ? janet_array_weak(len) : janet_array(len);
  ------------------
  |  Branch (21815:37): [True: 0, False: 18.4k]
  ------------------
21816|  18.4k|                array->count = len;
21817|  18.4k|                *out = janet_wrap_array(array);
  ------------------
  |  |  845|  18.4k|#define janet_wrap_array(s) janet_nanbox_wrap_((s), JANET_ARRAY)
  |  |  ------------------
  |  |  |  |  825|  18.4k|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21818|  18.4k|                janet_v_push(st->lookup, *out);
  ------------------
  |  |  757|  18.4k|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  769|  18.4k|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  768|  18.4k|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  766|  18.4k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|  18.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))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  765|  18.4k|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|  18.4k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (768:35): [True: 0, False: 18.4k]
  |  |  |  |  |  |  |  Branch (768:50): [True: 0, False: 18.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  770|      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))
  |  |  ------------------
  |  |  |  |  766|  18.4k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  764|  18.4k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21819|   159k|                for (int32_t i = 0; i < len; i++) {
  ------------------
  |  Branch (21819:37): [True: 141k, False: 18.4k]
  ------------------
21820|   141k|                    data = unmarshal_one(st, data, array->data + i, flags + 1);
21821|   141k|                }
21822|  75.2M|            } else if (lead == LB_TUPLE) {
  ------------------
  |  Branch (21822:24): [True: 4.61M, False: 70.6M]
  ------------------
21823|       |                /* Tuple */
21824|  4.61M|                Janet *tup = janet_tuple_begin(len);
21825|  4.61M|                int32_t flag = readint(st, &data);
21826|  4.61M|                janet_tuple_flag(tup) |= (int32_t)(((uint32_t) flag) << 16);  /* Avoid left shift of negative value */
  ------------------
  |  | 1806|  4.61M|#define janet_tuple_flag(t) (janet_tuple_head(t)->gc.flags)
  |  |  ------------------
  |  |  |  | 1800|  4.61M|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
21827|  18.2M|                for (int32_t i = 0; i < len; i++) {
  ------------------
  |  Branch (21827:37): [True: 13.6M, False: 4.61M]
  ------------------
21828|  13.6M|                    data = unmarshal_one(st, data, tup + i, flags + 1);
21829|  13.6M|                }
21830|  4.61M|                *out = janet_wrap_tuple(janet_tuple_end(tup));
  ------------------
  |  |  843|  4.61M|#define janet_wrap_tuple(s) janet_nanbox_wrap_c((s), JANET_TUPLE)
  |  |  ------------------
  |  |  |  |  828|  4.61M|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  4.61M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  4.61M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21831|  4.61M|                janet_v_push(st->lookup, *out);
  ------------------
  |  |  757|  4.61M|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  769|  4.61M|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  768|  4.61M|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  766|  4.61M|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|  4.61M|#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))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  765|  4.61M|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|  4.61M|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (768:35): [True: 0, False: 4.61M]
  |  |  |  |  |  |  |  Branch (768:50): [True: 0, False: 4.61M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  770|      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))
  |  |  ------------------
  |  |  |  |  766|  4.61M|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  764|  4.61M|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21832|  70.6M|            } else if (lead == LB_STRUCT || lead == LB_STRUCT_PROTO) {
  ------------------
  |  Branch (21832:24): [True: 42.9k, False: 70.6M]
  |  Branch (21832:45): [True: 0, False: 70.6M]
  ------------------
21833|       |                /* Struct */
21834|  42.9k|                JanetKV *struct_ = janet_struct_begin(len);
21835|  42.9k|                if (lead == LB_STRUCT_PROTO) {
  ------------------
  |  Branch (21835:21): [True: 0, False: 42.9k]
  ------------------
21836|      0|                    Janet proto;
21837|      0|                    data = unmarshal_one(st, data, &proto, flags + 1);
21838|      0|                    janet_asserttype(proto, JANET_STRUCT, st);
21839|      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))
  ------------------
21840|      0|                }
21841|   331k|                for (int32_t i = 0; i < len; i++) {
  ------------------
  |  Branch (21841:37): [True: 288k, False: 42.9k]
  ------------------
21842|   288k|                    Janet key, value;
21843|   288k|                    data = unmarshal_one(st, data, &key, flags + 1);
21844|   288k|                    data = unmarshal_one(st, data, &value, flags + 1);
21845|   288k|                    janet_struct_put(struct_, key, value);
21846|   288k|                }
21847|  42.9k|                *out = janet_wrap_struct(janet_struct_end(struct_));
  ------------------
  |  |  842|  42.9k|#define janet_wrap_struct(s) janet_nanbox_wrap_c((s), JANET_STRUCT)
  |  |  ------------------
  |  |  |  |  828|  42.9k|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  42.9k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  42.9k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21848|  42.9k|                janet_v_push(st->lookup, *out);
  ------------------
  |  |  757|  42.9k|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  769|  42.9k|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  768|  42.9k|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  766|  42.9k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|  42.9k|#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))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  765|  42.9k|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|  42.9k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (768:35): [True: 0, False: 42.9k]
  |  |  |  |  |  |  |  Branch (768:50): [True: 0, False: 42.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  770|      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))
  |  |  ------------------
  |  |  |  |  766|  42.9k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  764|  42.9k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21849|  70.6M|            } else if (lead == LB_REFERENCE) {
  ------------------
  |  Branch (21849:24): [True: 66.1M, False: 4.48M]
  ------------------
21850|  66.1M|                if (len >= janet_v_count(st->lookup))
  ------------------
  |  |  759|  66.1M|#define janet_v_count(v)        (((v) != NULL) ? janet_v__cnt(v) : 0)
  |  |  ------------------
  |  |  |  |  766|  66.1M|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  764|  66.1M|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (759:34): [True: 66.1M, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (21850:21): [True: 0, False: 66.1M]
  ------------------
21851|      0|                    janet_panicf("invalid reference %d", len);
21852|  66.1M|                *out = st->lookup[len];
21853|  66.1M|            } else {
21854|       |                /* Table */
21855|  4.48M|                JanetTable *t;
21856|  4.48M|                if (lead == LB_TABLE_WEAKK_PROTO || lead == LB_TABLE_WEAKK) {
  ------------------
  |  Branch (21856:21): [True: 0, False: 4.48M]
  |  Branch (21856:53): [True: 0, False: 4.48M]
  ------------------
21857|      0|                    t = janet_table_weakk(len);
21858|  4.48M|                } else if (lead == LB_TABLE_WEAKV_PROTO || lead == LB_TABLE_WEAKV) {
  ------------------
  |  Branch (21858:28): [True: 0, False: 4.48M]
  |  Branch (21858:60): [True: 0, False: 4.48M]
  ------------------
21859|      0|                    t = janet_table_weakv(len);
21860|  4.48M|                } else if (lead == LB_TABLE_WEAKKV_PROTO || lead == LB_TABLE_WEAKKV) {
  ------------------
  |  Branch (21860:28): [True: 0, False: 4.48M]
  |  Branch (21860:61): [True: 0, False: 4.48M]
  ------------------
21861|      0|                    t = janet_table_weakkv(len);
21862|  4.48M|                } else {
21863|  4.48M|                    t = janet_table(len);
21864|  4.48M|                }
21865|  4.48M|                *out = janet_wrap_table(t);
  ------------------
  |  |  846|  4.48M|#define janet_wrap_table(s) janet_nanbox_wrap_((s), JANET_TABLE)
  |  |  ------------------
  |  |  |  |  825|  4.48M|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  4.48M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  4.48M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21866|  4.48M|                janet_v_push(st->lookup, *out);
  ------------------
  |  |  757|  4.48M|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  769|  4.48M|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  768|  4.48M|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  766|  4.48M|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|  4.48M|#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))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  765|  4.48M|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|  4.48M|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (768:35): [True: 6.14k, False: 4.48M]
  |  |  |  |  |  |  |  Branch (768:50): [True: 6.14k, False: 4.47M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  770|  12.2k|#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))
  |  |  ------------------
  |  |  |  |  766|  4.48M|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  764|  4.48M|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21867|  4.48M|                if (lead == LB_TABLE_PROTO || lead == LB_TABLE_WEAKK_PROTO || lead == LB_TABLE_WEAKV_PROTO || lead == LB_TABLE_WEAKKV_PROTO) {
  ------------------
  |  Branch (21867:21): [True: 0, False: 4.48M]
  |  Branch (21867:47): [True: 0, False: 4.48M]
  |  Branch (21867:79): [True: 0, False: 4.48M]
  |  Branch (21867:111): [True: 0, False: 4.48M]
  ------------------
21868|      0|                    Janet proto;
21869|      0|                    data = unmarshal_one(st, data, &proto, flags + 1);
21870|      0|                    janet_asserttype(proto, JANET_TABLE, st);
21871|      0|                    t->proto = janet_unwrap_table(proto);
  ------------------
  |  |  861|      0|#define janet_unwrap_table(x) ((JanetTable *)janet_nanbox_to_pointer(x))
  ------------------
21872|      0|                }
21873|  27.1M|                for (int32_t i = 0; i < len; i++) {
  ------------------
  |  Branch (21873:37): [True: 22.6M, False: 4.48M]
  ------------------
21874|  22.6M|                    Janet key, value;
21875|  22.6M|                    data = unmarshal_one(st, data, &key, flags + 1);
21876|  22.6M|                    data = unmarshal_one(st, data, &value, flags + 1);
21877|  22.6M|                    janet_table_put(t, key, value);
21878|  22.6M|                }
21879|  4.48M|            }
21880|  75.3M|            return data;
21881|  75.3M|        }
21882|      0|        case LB_UNSAFE_POINTER: {
  ------------------
  |  Branch (21882:9): [True: 0, False: 103M]
  ------------------
21883|      0|            MARSH_EOS(st, data + sizeof(void *));
  ------------------
  |  |21054|      0|#define MARSH_EOS(st, data) do { \
  |  |21055|      0|    if ((data) >= (st)->end) janet_panic("unexpected end of source");\
  |  |  ------------------
  |  |  |  Branch (21055:9): [True: 0, False: 0]
  |  |  ------------------
  |  |21056|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (21056:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
21884|      0|            data++;
21885|      0|            if (!(flags & JANET_MARSHAL_UNSAFE)) {
  ------------------
  |  | 1911|      0|#define JANET_MARSHAL_UNSAFE 0x20000
  ------------------
  |  Branch (21885:17): [True: 0, False: 0]
  ------------------
21886|      0|                janet_panicf("unsafe flag not given, "
21887|      0|                             "will not unmarshal raw pointer at index %d",
21888|      0|                             (int)(data - st->start));
21889|      0|            }
21890|      0|            union {
21891|      0|                void *ptr;
21892|      0|                uint8_t bytes[sizeof(void *)];
21893|      0|            } u;
21894|      0|            memcpy(u.bytes, data, sizeof(void *));
21895|      0|            data += sizeof(void *);
21896|      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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21897|      0|            janet_v_push(st->lookup, *out);
  ------------------
  |  |  757|      0|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  769|      0|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  768|      0|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  766|      0|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|      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))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  765|      0|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|      0|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (768:35): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (768:50): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  770|      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))
  |  |  ------------------
  |  |  |  |  766|      0|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  764|      0|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21898|      0|            return data;
21899|      0|        }
21900|      0|#ifdef JANET_EV
21901|      0|        case LB_POINTER_BUFFER: {
  ------------------
  |  Branch (21901:9): [True: 0, False: 103M]
  ------------------
21902|      0|            data++;
21903|      0|            int32_t count = readnat(st, &data);
21904|      0|            int32_t capacity = readnat(st, &data);
21905|      0|            MARSH_EOS(st, data + sizeof(void *));
  ------------------
  |  |21054|      0|#define MARSH_EOS(st, data) do { \
  |  |21055|      0|    if ((data) >= (st)->end) janet_panic("unexpected end of source");\
  |  |  ------------------
  |  |  |  Branch (21055:9): [True: 0, False: 0]
  |  |  ------------------
  |  |21056|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (21056:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
21906|      0|            union {
21907|      0|                void *ptr;
21908|      0|                uint8_t bytes[sizeof(void *)];
21909|      0|            } u;
21910|      0|            if (!(flags & JANET_MARSHAL_UNSAFE)) {
  ------------------
  |  | 1911|      0|#define JANET_MARSHAL_UNSAFE 0x20000
  ------------------
  |  Branch (21910:17): [True: 0, False: 0]
  ------------------
21911|      0|                janet_panicf("unsafe flag not given, "
21912|      0|                             "will not unmarshal raw pointer at index %d",
21913|      0|                             (int)(data - st->start));
21914|      0|            }
21915|      0|            memcpy(u.bytes, data, sizeof(void *));
21916|      0|            data += sizeof(void *);
21917|      0|            JanetBuffer *buffer = janet_pointer_buffer_unsafe(u.ptr, capacity, count);
21918|      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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21919|      0|            janet_v_push(st->lookup, *out);
  ------------------
  |  |  757|      0|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  769|      0|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  768|      0|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  766|      0|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|      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))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  765|      0|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|      0|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (768:35): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (768:50): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  770|      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))
  |  |  ------------------
  |  |  |  |  766|      0|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  764|      0|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21920|      0|            return data;
21921|      0|        }
21922|      0|#endif
21923|      0|        case LB_UNSAFE_CFUNCTION: {
  ------------------
  |  Branch (21923:9): [True: 0, False: 103M]
  ------------------
21924|      0|            MARSH_EOS(st, data + sizeof(JanetCFunction));
  ------------------
  |  |21054|      0|#define MARSH_EOS(st, data) do { \
  |  |21055|      0|    if ((data) >= (st)->end) janet_panic("unexpected end of source");\
  |  |  ------------------
  |  |  |  Branch (21055:9): [True: 0, False: 0]
  |  |  ------------------
  |  |21056|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (21056:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
21925|      0|            data++;
21926|      0|            if (!(flags & JANET_MARSHAL_UNSAFE)) {
  ------------------
  |  | 1911|      0|#define JANET_MARSHAL_UNSAFE 0x20000
  ------------------
  |  Branch (21926:17): [True: 0, False: 0]
  ------------------
21927|      0|                janet_panicf("unsafe flag not given, "
21928|      0|                             "will not unmarshal function pointer at index %d",
21929|      0|                             (int)(data - st->start));
21930|      0|            }
21931|      0|            union {
21932|      0|                JanetCFunction ptr;
21933|      0|                uint8_t bytes[sizeof(JanetCFunction)];
21934|      0|            } u;
21935|      0|            memcpy(u.bytes, data, sizeof(JanetCFunction));
21936|      0|            data += sizeof(JanetCFunction);
21937|      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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21938|      0|            janet_v_push(st->lookup, *out);
  ------------------
  |  |  757|      0|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  769|      0|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  768|      0|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  766|      0|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|      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))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  765|      0|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|      0|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (768:35): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (768:50): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  770|      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))
  |  |  ------------------
  |  |  |  |  766|      0|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  764|      0|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21939|      0|            return data;
21940|      0|        }
21941|      0|#ifdef JANET_EV
21942|      0|        case LB_THREADED_ABSTRACT: {
  ------------------
  |  Branch (21942:9): [True: 0, False: 103M]
  ------------------
21943|      0|            MARSH_EOS(st, data + sizeof(void *));
  ------------------
  |  |21054|      0|#define MARSH_EOS(st, data) do { \
  |  |21055|      0|    if ((data) >= (st)->end) janet_panic("unexpected end of source");\
  |  |  ------------------
  |  |  |  Branch (21055:9): [True: 0, False: 0]
  |  |  ------------------
  |  |21056|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (21056:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
21944|      0|            data++;
21945|      0|            if (!(flags & JANET_MARSHAL_UNSAFE)) {
  ------------------
  |  | 1911|      0|#define JANET_MARSHAL_UNSAFE 0x20000
  ------------------
  |  Branch (21945:17): [True: 0, False: 0]
  ------------------
21946|      0|                janet_panicf("unsafe flag not given, "
21947|      0|                             "will not unmarshal threaded abstract pointer at index %d",
21948|      0|                             (int)(data - st->start));
21949|      0|            }
21950|      0|            union {
21951|      0|                void *ptr;
21952|      0|                uint8_t bytes[sizeof(void *)];
21953|      0|            } u;
21954|      0|            memcpy(u.bytes, data, sizeof(void *));
21955|      0|            data += sizeof(void *);
21956|       |
21957|      0|            if (flags & JANET_MARSHAL_DECREF) {
  ------------------
  |  |  387|      0|#define JANET_MARSHAL_DECREF 0x40000
  ------------------
  |  Branch (21957:17): [True: 0, False: 0]
  ------------------
21958|       |                /* Decrement immediately and don't bother putting into heap */
21959|      0|                janet_abstract_decref(u.ptr);
21960|      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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21961|      0|            } else {
21962|      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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21963|      0|                Janet check = janet_table_get(&janet_vm.threaded_abstracts, *out);
21964|      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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21965|       |                    /* Transfers reference from threaded channel buffer to current heap */
21966|      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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21967|      0|                } else {
21968|       |                    /* Heap reference already accounted for, remove threaded channel reference. */
21969|      0|                    janet_abstract_decref(u.ptr);
21970|      0|                }
21971|      0|            }
21972|       |
21973|      0|            janet_v_push(st->lookup, *out);
  ------------------
  |  |  757|      0|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  769|      0|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  768|      0|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  766|      0|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|      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))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  765|      0|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|      0|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (768:35): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (768:50): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  770|      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))
  |  |  ------------------
  |  |  |  |  766|      0|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  764|      0|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21974|      0|            return data;
21975|      0|        }
21976|      0|#endif
21977|      0|        default: {
  ------------------
  |  Branch (21977:9): [True: 0, False: 103M]
  ------------------
21978|      0|            janet_panicf("unknown byte %x at index %d",
21979|      0|                         *data,
21980|      0|                         (int)(data - st->start));
21981|      0|            return NULL;
21982|      0|        }
21983|   103M|    }
21984|   103M|}
janet.c:readnat:
21091|   128M|static int32_t readnat(UnmarshalState *st, const uint8_t **atdata) {
21092|   128M|    int32_t ret = readint(st, atdata);
21093|   128M|    if (ret < 0) {
  ------------------
  |  Branch (21093:9): [True: 0, False: 128M]
  ------------------
21094|      0|        janet_panicf("expected integer >= 0, got %d", ret);
21095|      0|    }
21096|   128M|    return ret;
21097|   128M|}
janet.c:unmarshal_one_def:
21230|  3.31M|    int flags) {
21231|  3.31M|    MARSH_EOS(st, data);
  ------------------
  |  |21054|  3.31M|#define MARSH_EOS(st, data) do { \
  |  |21055|  3.31M|    if ((data) >= (st)->end) janet_panic("unexpected end of source");\
  |  |  ------------------
  |  |  |  Branch (21055:9): [True: 0, False: 3.31M]
  |  |  ------------------
  |  |21056|  3.31M|} while (0)
  |  |  ------------------
  |  |  |  Branch (21056:10): [Folded, False: 3.31M]
  |  |  ------------------
  ------------------
21232|  3.31M|    if (*data == LB_FUNCDEF_REF) {
  ------------------
  |  Branch (21232:9): [True: 24.5k, False: 3.28M]
  ------------------
21233|  24.5k|        data++;
21234|  24.5k|        int32_t index = readint(st, &data);
21235|  24.5k|        if (index < 0 || index >= janet_v_count(st->lookup_defs))
  ------------------
  |  |  759|  24.5k|#define janet_v_count(v)        (((v) != NULL) ? janet_v__cnt(v) : 0)
  |  |  ------------------
  |  |  |  |  766|  24.5k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  764|  24.5k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (759:34): [True: 24.5k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (21235:13): [True: 0, False: 24.5k]
  |  Branch (21235:26): [True: 0, False: 24.5k]
  ------------------
21236|      0|            janet_panicf("invalid funcdef reference %d", index);
21237|  24.5k|        *out = st->lookup_defs[index];
21238|  3.28M|    } else {
21239|       |        /* Initialize with values that will not break garbage collection
21240|       |         * if unmarshalling fails. */
21241|  3.28M|        JanetFuncDef *def = janet_gcalloc(JANET_MEMORY_FUNCDEF, sizeof(JanetFuncDef));
21242|  3.28M|        def->environments_length = 0;
21243|  3.28M|        def->defs_length = 0;
21244|  3.28M|        def->constants_length = 0;
21245|  3.28M|        def->bytecode_length = 0;
21246|  3.28M|        def->name = NULL;
21247|  3.28M|        def->source = NULL;
21248|  3.28M|        def->closure_bitset = NULL;
21249|  3.28M|        def->defs = NULL;
21250|  3.28M|        def->environments = NULL;
21251|  3.28M|        def->constants = NULL;
21252|  3.28M|        def->bytecode = NULL;
21253|  3.28M|        def->sourcemap = NULL;
21254|  3.28M|        def->symbolmap = NULL;
21255|  3.28M|        def->symbolmap_length = 0;
21256|  3.28M|        def->named_args_count = 0;
21257|  3.28M|        janet_v_push(st->lookup_defs, def);
  ------------------
  |  |  757|  3.28M|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  769|  3.28M|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  768|  3.28M|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  766|  3.27M|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|  3.27M|#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))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  765|  3.27M|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|  3.27M|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (768:35): [True: 6.14k, False: 3.27M]
  |  |  |  |  |  |  |  Branch (768:50): [True: 61.4k, False: 3.21M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  770|  67.5k|#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))
  |  |  ------------------
  |  |  |  |  766|  3.28M|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  764|  3.28M|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21258|       |
21259|       |        /* Set default lengths to zero */
21260|  3.28M|        int32_t bytecode_length = 0;
21261|  3.28M|        int32_t constants_length = 0;
21262|  3.28M|        int32_t environments_length = 0;
21263|  3.28M|        int32_t defs_length = 0;
21264|  3.28M|        int32_t symbolmap_length = 0;
21265|       |
21266|       |        /* Read flags and other fixed values */
21267|  3.28M|        def->flags = readint(st, &data);
21268|  3.28M|        def->slotcount = readnat(st, &data);
21269|  3.28M|        def->arity = readnat(st, &data);
21270|  3.28M|        def->min_arity = readnat(st, &data);
21271|  3.28M|        def->max_arity = readnat(st, &data);
21272|       |
21273|       |        /* Read some lengths */
21274|  3.28M|        constants_length = readnat(st, &data);
21275|  3.28M|        bytecode_length = readnat(st, &data);
21276|  3.28M|        if (def->flags & JANET_FUNCDEF_FLAG_NAMEDARGS)
  ------------------
  |  | 1107|  3.28M|#define JANET_FUNCDEF_FLAG_NAMEDARGS 0x4000000
  ------------------
  |  Branch (21276:13): [True: 12.2k, False: 3.27M]
  ------------------
21277|  12.2k|            def->named_args_count = readnat(st, &data);
21278|  3.28M|        if (def->flags & JANET_FUNCDEF_FLAG_HASENVS)
  ------------------
  |  | 1103|  3.28M|#define JANET_FUNCDEF_FLAG_HASENVS 0x400000
  ------------------
  |  Branch (21278:13): [True: 3.08M, False: 202k]
  ------------------
21279|  3.08M|            environments_length = readnat(st, &data);
21280|  3.28M|        if (def->flags & JANET_FUNCDEF_FLAG_HASDEFS)
  ------------------
  |  | 1102|  3.28M|#define JANET_FUNCDEF_FLAG_HASDEFS 0x200000
  ------------------
  |  Branch (21280:13): [True: 429k, False: 2.85M]
  ------------------
21281|   429k|            defs_length = readnat(st, &data);
21282|  3.28M|        if (def->flags & JANET_FUNCDEF_FLAG_HASSYMBOLMAP)
  ------------------
  |  | 1099|  3.28M|#define JANET_FUNCDEF_FLAG_HASSYMBOLMAP 0x40000
  ------------------
  |  Branch (21282:13): [True: 3.04M, False: 245k]
  ------------------
21283|  3.04M|            symbolmap_length = readnat(st, &data);
21284|       |
21285|       |        /* Check name and source (optional) */
21286|  3.28M|        if (def->flags & JANET_FUNCDEF_FLAG_HASNAME) {
  ------------------
  |  | 1100|  3.28M|#define JANET_FUNCDEF_FLAG_HASNAME 0x80000
  ------------------
  |  Branch (21286:13): [True: 3.07M, False: 208k]
  ------------------
21287|  3.07M|            Janet x;
21288|  3.07M|            data = unmarshal_one(st, data, &x, flags + 1);
21289|  3.07M|            janet_asserttype(x, JANET_STRING, st);
21290|  3.07M|            def->name = janet_unwrap_string(x);
  ------------------
  |  |  863|  3.07M|#define janet_unwrap_string(x) ((JanetString)janet_nanbox_to_pointer(x))
  ------------------
21291|  3.07M|        }
21292|  3.28M|        if (def->flags & JANET_FUNCDEF_FLAG_HASSOURCE) {
  ------------------
  |  | 1101|  3.28M|#define JANET_FUNCDEF_FLAG_HASSOURCE 0x100000
  ------------------
  |  Branch (21292:13): [True: 3.08M, False: 202k]
  ------------------
21293|  3.08M|            Janet x;
21294|  3.08M|            data = unmarshal_one(st, data, &x, flags + 1);
21295|  3.08M|            janet_asserttype(x, JANET_STRING, st);
21296|  3.08M|            def->source = janet_unwrap_string(x);
  ------------------
  |  |  863|  3.08M|#define janet_unwrap_string(x) ((JanetString)janet_nanbox_to_pointer(x))
  ------------------
21297|  3.08M|        }
21298|       |
21299|       |        /* Unmarshal constants */
21300|  3.28M|        if (constants_length) {
  ------------------
  |  Branch (21300:13): [True: 2.50M, False: 780k]
  ------------------
21301|  2.50M|            def->constants = array_allocate(sizeof(Janet), constants_length);
21302|  2.50M|            if (!def->constants) {
  ------------------
  |  Branch (21302:17): [True: 0, False: 2.50M]
  ------------------
21303|      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]
  |  |  ------------------
  ------------------
21304|      0|            }
21305|  16.4M|            for (int32_t i = 0; i < constants_length; i++)
  ------------------
  |  Branch (21305:33): [True: 13.9M, False: 2.50M]
  ------------------
21306|  13.9M|                data = unmarshal_one(st, data, def->constants + i, flags + 1);
21307|  2.50M|        } else {
21308|   780k|            def->constants = NULL;
21309|   780k|        }
21310|  3.28M|        def->constants_length = constants_length;
21311|       |
21312|       |        /* Unmarshal symbol map, if needed */
21313|  3.28M|        if (def->flags & JANET_FUNCDEF_FLAG_HASSYMBOLMAP) {
  ------------------
  |  | 1099|  3.28M|#define JANET_FUNCDEF_FLAG_HASSYMBOLMAP 0x40000
  ------------------
  |  Branch (21313:13): [True: 3.04M, False: 245k]
  ------------------
21314|  3.04M|            def->symbolmap = array_allocate(sizeof(JanetSymbolMap), symbolmap_length);
21315|  3.04M|            if (def->symbolmap == NULL) {
  ------------------
  |  Branch (21315:17): [True: 0, False: 3.04M]
  ------------------
21316|      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]
  |  |  ------------------
  ------------------
21317|      0|            }
21318|  34.2M|            for (int32_t i = 0; i < symbolmap_length; i++) {
  ------------------
  |  Branch (21318:33): [True: 31.2M, False: 3.04M]
  ------------------
21319|  31.2M|                def->symbolmap[i].birth_pc = (uint32_t) readint(st, &data);
21320|  31.2M|                def->symbolmap[i].death_pc = (uint32_t) readint(st, &data);
21321|  31.2M|                def->symbolmap[i].slot_index = (uint32_t) readint(st, &data);
21322|  31.2M|                Janet value;
21323|  31.2M|                data = unmarshal_one(st, data, &value, flags + 1);
21324|  31.2M|                if (!janet_checktype(value, JANET_SYMBOL)) {
  ------------------
  |  |  806|  31.2M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 31.2M]
  |  |  ------------------
  |  |  807|  31.2M|        ? 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|  31.2M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  31.2M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  31.2M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  31.2M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  31.2M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (21324:21): [True: 0, False: 31.2M]
  ------------------
21325|      0|                    janet_panicf("corrupted symbolmap when unmarshalling debug info, got %v", value);
21326|      0|                }
21327|  31.2M|                def->symbolmap[i].symbol = janet_unwrap_symbol(value);
  ------------------
  |  |  864|  31.2M|#define janet_unwrap_symbol(x) ((JanetSymbol)janet_nanbox_to_pointer(x))
  ------------------
21328|  31.2M|            }
21329|  3.04M|            def->symbolmap_length = (uint32_t) symbolmap_length;
21330|  3.04M|        }
21331|       |
21332|       |        /* Unmarshal bytecode */
21333|  3.28M|        def->bytecode = array_allocate(sizeof(uint32_t), bytecode_length);
21334|  3.28M|        if (!def->bytecode) {
  ------------------
  |  Branch (21334:13): [True: 0, False: 3.28M]
  ------------------
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|  3.28M|        data = janet_unmarshal_u32s(st, data, def->bytecode, bytecode_length);
21338|  3.28M|        def->bytecode_length = bytecode_length;
21339|       |
21340|       |        /* Unmarshal environments */
21341|  3.28M|        if (def->flags & JANET_FUNCDEF_FLAG_HASENVS) {
  ------------------
  |  | 1103|  3.28M|#define JANET_FUNCDEF_FLAG_HASENVS 0x400000
  ------------------
  |  Branch (21341:13): [True: 3.08M, False: 202k]
  ------------------
21342|  3.08M|            def->environments = janet_calloc(1, sizeof(int32_t) * (size_t) environments_length);
  ------------------
  |  | 2412|  3.08M|#define janet_calloc(X, Y) calloc((X), (Y))
  ------------------
21343|  3.08M|            if (!def->environments) {
  ------------------
  |  Branch (21343:17): [True: 0, False: 3.08M]
  ------------------
21344|      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]
  |  |  ------------------
  ------------------
21345|      0|            }
21346|  4.29M|            for (int32_t i = 0; i < environments_length; i++) {
  ------------------
  |  Branch (21346:33): [True: 1.20M, False: 3.08M]
  ------------------
21347|  1.20M|                def->environments[i] = readint(st, &data);
21348|  1.20M|            }
21349|  3.08M|        } else {
21350|   202k|            def->environments = NULL;
21351|   202k|        }
21352|  3.28M|        def->environments_length = environments_length;
21353|       |
21354|       |        /* Unmarshal sub funcdefs */
21355|  3.28M|        if (def->flags & JANET_FUNCDEF_FLAG_HASDEFS) {
  ------------------
  |  | 1102|  3.28M|#define JANET_FUNCDEF_FLAG_HASDEFS 0x200000
  ------------------
  |  Branch (21355:13): [True: 429k, False: 2.85M]
  ------------------
21356|   429k|            def->defs = janet_calloc(1, sizeof(JanetFuncDef *) * (size_t) defs_length);
  ------------------
  |  | 2412|   429k|#define janet_calloc(X, Y) calloc((X), (Y))
  ------------------
21357|   429k|            if (!def->defs) {
  ------------------
  |  Branch (21357:17): [True: 0, False: 429k]
  ------------------
21358|      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]
  |  |  ------------------
  ------------------
21359|      0|            }
21360|  1.38M|            for (int32_t i = 0; i < defs_length; i++) {
  ------------------
  |  Branch (21360:33): [True: 958k, False: 429k]
  ------------------
21361|   958k|                data = unmarshal_one_def(st, data, def->defs + i, flags + 1);
21362|   958k|            }
21363|  2.85M|        } else {
21364|  2.85M|            def->defs = NULL;
21365|  2.85M|        }
21366|  3.28M|        def->defs_length = defs_length;
21367|       |
21368|       |        /* Unmarshal source maps if needed */
21369|  3.28M|        if (def->flags & JANET_FUNCDEF_FLAG_HASSOURCEMAP) {
  ------------------
  |  | 1104|  3.28M|#define JANET_FUNCDEF_FLAG_HASSOURCEMAP 0x800000
  ------------------
  |  Branch (21369:13): [True: 3.08M, False: 202k]
  ------------------
21370|  3.08M|            int32_t current = 0;
21371|  3.08M|            def->sourcemap = array_allocate(sizeof(JanetSourceMapping), bytecode_length);
21372|  3.08M|            if (!def->sourcemap) {
  ------------------
  |  Branch (21372:17): [True: 0, False: 3.08M]
  ------------------
21373|      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]
  |  |  ------------------
  ------------------
21374|      0|            }
21375|  91.4M|            for (int32_t i = 0; i < bytecode_length; i++) {
  ------------------
  |  Branch (21375:33): [True: 88.4M, False: 3.08M]
  ------------------
21376|  88.4M|                current += readint(st, &data);
21377|  88.4M|                def->sourcemap[i].line = current;
21378|  88.4M|                def->sourcemap[i].column = readint(st, &data);
21379|  88.4M|            }
21380|  3.08M|        } else {
21381|   202k|            def->sourcemap = NULL;
21382|   202k|        }
21383|       |
21384|       |        /* Unmarshal closure bitset if needed */
21385|  3.28M|        if (def->flags & JANET_FUNCDEF_FLAG_HASCLOBITSET) {
  ------------------
  |  | 1106|  3.28M|#define JANET_FUNCDEF_FLAG_HASCLOBITSET 0x2000000
  ------------------
  |  Branch (21385:13): [True: 362k, False: 2.92M]
  ------------------
21386|   362k|            int32_t n = ((def->slotcount - 1) >> 5) + 1;
21387|   362k|            def->closure_bitset = array_allocate(sizeof(uint32_t), n);
21388|   362k|            if (NULL == def->closure_bitset) {
  ------------------
  |  Branch (21388:17): [True: 0, False: 362k]
  ------------------
21389|      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]
  |  |  ------------------
  ------------------
21390|      0|            }
21391|   362k|            data = janet_unmarshal_u32s(st, data, def->closure_bitset, n);
21392|   362k|        }
21393|       |
21394|       |        /* Validate */
21395|  3.28M|        int status;
21396|  3.28M|        if ((status = janet_verify(def))) {
  ------------------
  |  Branch (21396:13): [True: 0, False: 3.28M]
  ------------------
21397|      0|            janet_panicf("funcdef has invalid bytecode: %d", status);
21398|      0|        }
21399|       |
21400|       |        /* Set def */
21401|  3.28M|        *out = def;
21402|  3.28M|    }
21403|  3.31M|    return data;
21404|  3.31M|}
janet.c:janet_unmarshal_u32s:
21212|  3.64M|static const uint8_t *janet_unmarshal_u32s(UnmarshalState *st, const uint8_t *data, uint32_t *into, int32_t n) {
21213|  94.8M|    for (int32_t i = 0; i < n; i++) {
  ------------------
  |  Branch (21213:25): [True: 91.2M, False: 3.64M]
  ------------------
21214|  91.2M|        MARSH_EOS(st, data + 3);
  ------------------
  |  |21054|  91.2M|#define MARSH_EOS(st, data) do { \
  |  |21055|  91.2M|    if ((data) >= (st)->end) janet_panic("unexpected end of source");\
  |  |  ------------------
  |  |  |  Branch (21055:9): [True: 0, False: 91.2M]
  |  |  ------------------
  |  |21056|  91.2M|} while (0)
  |  |  ------------------
  |  |  |  Branch (21056:10): [Folded, False: 91.2M]
  |  |  ------------------
  ------------------
21215|  91.2M|        into[i] =
21216|  91.2M|            (uint32_t)(data[0]) |
21217|  91.2M|            ((uint32_t)(data[1]) << 8) |
21218|  91.2M|            ((uint32_t)(data[2]) << 16) |
21219|  91.2M|            ((uint32_t)(data[3]) << 24);
21220|  91.2M|        data += 4;
21221|  91.2M|    }
21222|  3.64M|    return data;
21223|  3.64M|}
janet.c:unmarshal_one_env:
21168|   264k|    int flags) {
21169|   264k|    MARSH_EOS(st, data);
  ------------------
  |  |21054|   264k|#define MARSH_EOS(st, data) do { \
  |  |21055|   264k|    if ((data) >= (st)->end) janet_panic("unexpected end of source");\
  |  |  ------------------
  |  |  |  Branch (21055:9): [True: 0, False: 264k]
  |  |  ------------------
  |  |21056|   264k|} while (0)
  |  |  ------------------
  |  |  |  Branch (21056:10): [Folded, False: 264k]
  |  |  ------------------
  ------------------
21170|   264k|    if (*data == LB_FUNCENV_REF) {
  ------------------
  |  Branch (21170:9): [True: 214k, False: 49.1k]
  ------------------
21171|   214k|        data++;
21172|   214k|        int32_t index = readint(st, &data);
21173|   214k|        if (index < 0 || index >= janet_v_count(st->lookup_envs))
  ------------------
  |  |  759|   214k|#define janet_v_count(v)        (((v) != NULL) ? janet_v__cnt(v) : 0)
  |  |  ------------------
  |  |  |  |  766|   214k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  764|   214k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (759:34): [True: 214k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (21173:13): [True: 0, False: 214k]
  |  Branch (21173:26): [True: 0, False: 214k]
  ------------------
21174|      0|            janet_panicf("invalid funcenv reference %d", index);
21175|   214k|        *out = st->lookup_envs[index];
21176|   214k|    } else {
21177|  49.1k|        JanetFuncEnv *env = janet_gcalloc(JANET_MEMORY_FUNCENV, sizeof(JanetFuncEnv));
21178|  49.1k|        env->length = 0;
21179|  49.1k|        env->offset = 0;
21180|  49.1k|        env->as.values = NULL;
21181|  49.1k|        janet_v_push(st->lookup_envs, env);
  ------------------
  |  |  757|  49.1k|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  769|  49.1k|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  768|  49.1k|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  766|  42.9k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|  42.9k|#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))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  765|  42.9k|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|  42.9k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (768:35): [True: 6.14k, False: 42.9k]
  |  |  |  |  |  |  |  Branch (768:50): [True: 24.5k, False: 18.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  770|  30.7k|#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))
  |  |  ------------------
  |  |  |  |  766|  49.1k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  764|  49.1k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21182|  49.1k|        int32_t offset = readnat(st, &data);
21183|  49.1k|        int32_t length = readnat(st, &data);
21184|  49.1k|        if (offset > 0) {
  ------------------
  |  Branch (21184:13): [True: 0, False: 49.1k]
  ------------------
21185|      0|            Janet fiberv;
21186|       |            /* On stack variant */
21187|      0|            data = unmarshal_one(st, data, &fiberv, flags);
21188|      0|            janet_asserttype(fiberv, JANET_FIBER, st);
21189|      0|            env->as.fiber = janet_unwrap_fiber(fiberv);
  ------------------
  |  |  859|      0|#define janet_unwrap_fiber(x) ((JanetFiber *)janet_nanbox_to_pointer(x))
  ------------------
21190|       |            /* Negative offset indicates untrusted input */
21191|      0|            env->offset = -offset;
21192|  49.1k|        } else {
21193|       |            /* Off stack variant */
21194|  49.1k|            if (length == 0) {
  ------------------
  |  Branch (21194:17): [True: 0, False: 49.1k]
  ------------------
21195|      0|                janet_panic("invalid funcenv length");
21196|      0|            }
21197|  49.1k|            env->as.values = array_allocate(sizeof(Janet), length);
21198|  49.1k|            if (!env->as.values) {
  ------------------
  |  Branch (21198:17): [True: 0, False: 49.1k]
  ------------------
21199|      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]
  |  |  ------------------
  ------------------
21200|      0|            }
21201|  49.1k|            env->offset = 0;
21202|   608k|            for (int32_t i = 0; i < length; i++)
  ------------------
  |  Branch (21202:33): [True: 558k, False: 49.1k]
  ------------------
21203|   558k|                data = unmarshal_one(st, data, env->as.values + i, flags);
21204|  49.1k|        }
21205|  49.1k|        env->length = length;
21206|  49.1k|        *out = env;
21207|  49.1k|    }
21208|   264k|    return data;
21209|   264k|}
janet.c:janet_asserttype:
21130|  6.16M|static void janet_asserttype(Janet x, JanetType t, UnmarshalState *st) {
21131|  6.16M|    if (!janet_checktype(x, t)) {
  ------------------
  |  |  806|  6.16M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [True: 0, False: 6.16M]
  |  |  ------------------
  |  |  807|  6.16M|        ? 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|  6.16M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  6.16M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  6.16M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  6.16M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  6.16M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (21131:9): [True: 0, False: 6.16M]
  ------------------
21132|       |#ifdef JANET_MARSHAL_DEBUG
21133|       |        dump_reference_table(st);
21134|       |#else
21135|      0|        (void) st;
21136|      0|#endif
21137|      0|        janet_panicf("expected type %T, got %v", 1 << t, x);
21138|      0|    }
21139|  6.16M|}
janet.c:janet_parser_checkdead:
27652|   245k|static void janet_parser_checkdead(JanetParser *parser) {
27653|   245k|    if (parser->flag) janet_panic("parser is dead, cannot consume");
  ------------------
  |  Branch (27653:9): [True: 0, False: 245k]
  ------------------
27654|   245k|    if (parser->error) janet_panic("parser has unchecked error, cannot consume");
  ------------------
  |  Branch (27654:9): [True: 0, False: 245k]
  ------------------
27655|   245k|}
janet.c:delim_error:
27162|  1.37k|static void delim_error(JanetParser *parser, size_t stack_index, char c, const char *msg) {
27163|  1.37k|    JanetParseState *s = parser->states + stack_index;
27164|  1.37k|    JanetBuffer *buffer = janet_buffer(40);
27165|  1.37k|    if (msg) {
  ------------------
  |  Branch (27165:9): [True: 1.37k, False: 0]
  ------------------
27166|  1.37k|        janet_buffer_push_cstring(buffer, msg);
27167|  1.37k|    }
27168|  1.37k|    if (c) {
  ------------------
  |  Branch (27168:9): [True: 98, False: 1.27k]
  ------------------
27169|     98|        janet_buffer_push_u8(buffer, c);
27170|     98|    }
27171|  1.37k|    if (stack_index > 0) {
  ------------------
  |  Branch (27171:9): [True: 1.30k, False: 69]
  ------------------
27172|  1.30k|        janet_buffer_push_cstring(buffer, ", ");
27173|  1.30k|        if (s->flags & PFLAG_PARENS) {
  ------------------
  |  |27098|  1.30k|#define PFLAG_PARENS 0x400
  ------------------
  |  Branch (27173:13): [True: 83, False: 1.22k]
  ------------------
27174|     83|            janet_buffer_push_u8(buffer, '(');
27175|  1.22k|        } else if (s->flags & PFLAG_SQRBRACKETS) {
  ------------------
  |  |27099|  1.22k|#define PFLAG_SQRBRACKETS 0x800
  ------------------
  |  Branch (27175:20): [True: 80, False: 1.14k]
  ------------------
27176|     80|            janet_buffer_push_u8(buffer, '[');
27177|  1.14k|        } else if (s->flags & PFLAG_CURLYBRACKETS) {
  ------------------
  |  |27100|  1.14k|#define PFLAG_CURLYBRACKETS 0x1000
  ------------------
  |  Branch (27177:20): [True: 117, False: 1.02k]
  ------------------
27178|    117|            janet_buffer_push_u8(buffer, '{');
27179|  1.02k|        } else if (s->flags & PFLAG_STRING) {
  ------------------
  |  |27101|  1.02k|#define PFLAG_STRING 0x2000
  ------------------
  |  Branch (27179:20): [True: 330, False: 693]
  ------------------
27180|    330|            janet_buffer_push_u8(buffer, '"');
27181|    693|        } else if (s->flags & PFLAG_LONGSTRING) {
  ------------------
  |  |27102|    693|#define PFLAG_LONGSTRING 0x4000
  ------------------
  |  Branch (27181:20): [True: 136, False: 557]
  ------------------
27182|    136|            int32_t i;
27183|  2.10k|            for (i = 0; i < s->argn; i++) {
  ------------------
  |  Branch (27183:25): [True: 1.96k, False: 136]
  ------------------
27184|  1.96k|                janet_buffer_push_u8(buffer, '`');
27185|  1.96k|            }
27186|    136|        }
27187|  1.30k|        janet_formatb(buffer, " opened at line %d, column %d", (int32_t) s->line, (int32_t) s->column);
27188|  1.30k|    }
27189|  1.37k|    parser->error = (const char *) janet_string(buffer->data, buffer->count);
27190|  1.37k|    parser->flag |= JANET_PARSER_GENERATED_ERROR;
  ------------------
  |  |26992|  1.37k|#define JANET_PARSER_GENERATED_ERROR 0x2
  ------------------
27191|  1.37k|}
janet.c:pushstate:
27108|  94.5k|static void pushstate(JanetParser *p, Consumer consumer, int flags) {
27109|  94.5k|    JanetParseState s;
27110|  94.5k|    s.counter = 0;
27111|  94.5k|    s.argn = 0;
27112|  94.5k|    s.flags = flags;
27113|  94.5k|    s.consumer = consumer;
27114|  94.5k|    s.line = p->line;
27115|  94.5k|    s.column = p->column;
27116|  94.5k|    _pushstate(p, s);
27117|  94.5k|}
janet.c:root:
27579|   122k|static int root(JanetParser *p, JanetParseState *state, uint8_t c) {
27580|   122k|    switch (c) {
27581|  55.8k|        default:
  ------------------
  |  Branch (27581:9): [True: 55.8k, False: 66.5k]
  ------------------
27582|  55.8k|            if (is_whitespace(c)) return 1;
  ------------------
  |  Branch (27582:17): [True: 25.6k, False: 30.1k]
  ------------------
27583|  30.1k|            if (!janet_is_symbol_char(c)) {
  ------------------
  |  Branch (27583:17): [True: 130, False: 30.0k]
  ------------------
27584|    130|                p->error = "unexpected character";
27585|    130|                return 1;
27586|    130|            }
27587|  30.0k|            pushstate(p, tokenchar, PFLAG_TOKEN);
  ------------------
  |  |27106|  30.0k|#define PFLAG_TOKEN 0x40000
  ------------------
27588|  30.0k|            return 0;
27589|  15.4k|        case '\'':
  ------------------
  |  Branch (27589:9): [True: 15.4k, False: 106k]
  ------------------
27590|  21.2k|        case ',':
  ------------------
  |  Branch (27590:9): [True: 5.80k, False: 116k]
  ------------------
27591|  26.8k|        case ';':
  ------------------
  |  Branch (27591:9): [True: 5.63k, False: 116k]
  ------------------
27592|  30.3k|        case '~':
  ------------------
  |  Branch (27592:9): [True: 3.44k, False: 118k]
  ------------------
27593|  34.0k|        case '|':
  ------------------
  |  Branch (27593:9): [True: 3.71k, False: 118k]
  ------------------
27594|  34.0k|            pushstate(p, root, PFLAG_READERMAC | c);
  ------------------
  |  |27103|  34.0k|#define PFLAG_READERMAC 0x8000
  ------------------
27595|  34.0k|            return 1;
27596|  3.79k|        case '"':
  ------------------
  |  Branch (27596:9): [True: 3.79k, False: 118k]
  ------------------
27597|  3.79k|            pushstate(p, stringchar, PFLAG_STRING);
  ------------------
  |  |27101|  3.79k|#define PFLAG_STRING 0x2000
  ------------------
27598|  3.79k|            return 1;
27599|    536|        case '#':
  ------------------
  |  Branch (27599:9): [True: 536, False: 121k]
  ------------------
27600|    536|            pushstate(p, comment, PFLAG_COMMENT);
  ------------------
  |  |27105|    536|#define PFLAG_COMMENT 0x20000
  ------------------
27601|    536|            return 1;
27602|  2.88k|        case '@':
  ------------------
  |  Branch (27602:9): [True: 2.88k, False: 119k]
  ------------------
27603|  2.88k|            pushstate(p, atsign, PFLAG_ATSYM);
  ------------------
  |  |27104|  2.88k|#define PFLAG_ATSYM 0x10000
  ------------------
27604|  2.88k|            return 1;
27605|  1.24k|        case '`':
  ------------------
  |  Branch (27605:9): [True: 1.24k, False: 121k]
  ------------------
27606|  1.24k|            pushstate(p, longstring, PFLAG_LONGSTRING);
  ------------------
  |  |27102|  1.24k|#define PFLAG_LONGSTRING 0x4000
  ------------------
27607|  1.24k|            return 1;
27608|  2.44k|        case ')':
  ------------------
  |  Branch (27608:9): [True: 2.44k, False: 119k]
  ------------------
27609|  5.68k|        case ']':
  ------------------
  |  Branch (27609:9): [True: 3.23k, False: 119k]
  ------------------
27610|  11.0k|        case '}': {
  ------------------
  |  Branch (27610:9): [True: 5.40k, False: 116k]
  ------------------
27611|  11.0k|            Janet ds;
27612|  11.0k|            if (p->statecount == 1) {
  ------------------
  |  Branch (27612:17): [True: 69, False: 11.0k]
  ------------------
27613|     69|                delim_error(p, 0, c, "unexpected closing delimiter ");
27614|     69|                return 1;
27615|     69|            }
27616|  11.0k|            if ((c == ')' && (state->flags & PFLAG_PARENS)) ||
  ------------------
  |  |27098|  2.43k|#define PFLAG_PARENS 0x400
  ------------------
  |  Branch (27616:18): [True: 2.43k, False: 8.58k]
  |  Branch (27616:30): [True: 2.42k, False: 6]
  ------------------
27617|  8.59k|                    (c == ']' && (state->flags & PFLAG_SQRBRACKETS))) {
  ------------------
  |  |27099|  3.22k|#define PFLAG_SQRBRACKETS 0x800
  ------------------
  |  Branch (27617:22): [True: 3.22k, False: 5.37k]
  |  Branch (27617:34): [True: 3.21k, False: 8]
  ------------------
27618|  5.64k|                if (state->flags & PFLAG_ATSYM) {
  ------------------
  |  |27104|  5.64k|#define PFLAG_ATSYM 0x10000
  ------------------
  |  Branch (27618:21): [True: 218, False: 5.42k]
  ------------------
27619|    218|                    ds = close_array(p, state);
27620|  5.42k|                } else {
27621|  5.42k|                    ds = close_tuple(p, state, c == ']' ? JANET_TUPLE_FLAG_BRACKETCTOR : 0);
  ------------------
  |  | 1798|  3.00k|#define JANET_TUPLE_FLAG_BRACKETCTOR 0x10000
  ------------------
  |  Branch (27621:48): [True: 3.00k, False: 2.42k]
  ------------------
27622|  5.42k|                }
27623|  5.64k|            } else if (c == '}' && (state->flags & PFLAG_CURLYBRACKETS)) {
  ------------------
  |  |27100|  5.36k|#define PFLAG_CURLYBRACKETS 0x1000
  ------------------
  |  Branch (27623:24): [True: 5.36k, False: 14]
  |  Branch (27623:36): [True: 5.35k, False: 15]
  ------------------
27624|  5.35k|                if (state->argn & 1) {
  ------------------
  |  Branch (27624:21): [True: 19, False: 5.33k]
  ------------------
27625|     19|                    p->error = "struct and table literals expect even number of arguments";
27626|     19|                    return 1;
27627|     19|                }
27628|  5.33k|                if (state->flags & PFLAG_ATSYM) {
  ------------------
  |  |27104|  5.33k|#define PFLAG_ATSYM 0x10000
  ------------------
  |  Branch (27628:21): [True: 1.12k, False: 4.20k]
  ------------------
27629|  1.12k|                    ds = close_table(p, state);
27630|  4.20k|                } else {
27631|  4.20k|                    ds = close_struct(p, state);
27632|  4.20k|                }
27633|  5.33k|            } else {
27634|     29|                delim_error(p, p->statecount - 1, c, "mismatched delimiter ");
27635|     29|                return 1;
27636|     29|            }
27637|  10.9k|            popstate(p, ds);
27638|  10.9k|        }
27639|      0|        return 1;
27640|  3.18k|        case '(':
  ------------------
  |  Branch (27640:9): [True: 3.18k, False: 119k]
  ------------------
27641|  3.18k|            pushstate(p, root, PFLAG_CONTAINER | PFLAG_PARENS);
  ------------------
  |  |27096|  3.18k|#define PFLAG_CONTAINER 0x100
  ------------------
                          pushstate(p, root, PFLAG_CONTAINER | PFLAG_PARENS);
  ------------------
  |  |27098|  3.18k|#define PFLAG_PARENS 0x400
  ------------------
27642|  3.18k|            return 1;
27643|  3.81k|        case '[':
  ------------------
  |  Branch (27643:9): [True: 3.81k, False: 118k]
  ------------------
27644|  3.81k|            pushstate(p, root, PFLAG_CONTAINER | PFLAG_SQRBRACKETS);
  ------------------
  |  |27096|  3.81k|#define PFLAG_CONTAINER 0x100
  ------------------
                          pushstate(p, root, PFLAG_CONTAINER | PFLAG_SQRBRACKETS);
  ------------------
  |  |27099|  3.81k|#define PFLAG_SQRBRACKETS 0x800
  ------------------
27645|  3.81k|            return 1;
27646|  5.97k|        case '{':
  ------------------
  |  Branch (27646:9): [True: 5.97k, False: 116k]
  ------------------
27647|  5.97k|            pushstate(p, root, PFLAG_CONTAINER | PFLAG_CURLYBRACKETS);
  ------------------
  |  |27096|  5.97k|#define PFLAG_CONTAINER 0x100
  ------------------
                          pushstate(p, root, PFLAG_CONTAINER | PFLAG_CURLYBRACKETS);
  ------------------
  |  |27100|  5.97k|#define PFLAG_CURLYBRACKETS 0x1000
  ------------------
27648|  5.97k|            return 1;
27649|   122k|    }
27650|   122k|}
janet.c:is_whitespace:
26995|  55.8k|static int is_whitespace(uint8_t c) {
26996|  55.8k|    return c == ' '
  ------------------
  |  Branch (26996:12): [True: 1.83k, False: 54.0k]
  ------------------
26997|  54.0k|           || c == '\t'
  ------------------
  |  Branch (26997:15): [True: 1.08k, False: 52.9k]
  ------------------
26998|  52.9k|           || c == '\n'
  ------------------
  |  Branch (26998:15): [True: 6.41k, False: 46.5k]
  ------------------
26999|  46.5k|           || c == '\r'
  ------------------
  |  Branch (26999:15): [True: 1.02k, False: 45.4k]
  ------------------
27000|  45.4k|           || c == '\0'
  ------------------
  |  Branch (27000:15): [True: 13.0k, False: 32.4k]
  ------------------
27001|  32.4k|           || c == '\v'
  ------------------
  |  Branch (27001:15): [True: 1.81k, False: 30.5k]
  ------------------
27002|  30.5k|           || c == '\f';
  ------------------
  |  Branch (27002:15): [True: 412, False: 30.1k]
  ------------------
27003|  55.8k|}
janet.c:stringchar:
27374|  15.7k|static int stringchar(JanetParser *p, JanetParseState *state, uint8_t c) {
27375|       |    /* Enter escape */
27376|  15.7k|    if (c == '\\') {
  ------------------
  |  Branch (27376:9): [True: 2.15k, False: 13.6k]
  ------------------
27377|  2.15k|        state->consumer = escape1;
27378|  2.15k|        return 1;
27379|  2.15k|    }
27380|       |    /* String end */
27381|  13.6k|    if (c == '"') {
  ------------------
  |  Branch (27381:9): [True: 3.73k, False: 9.87k]
  ------------------
27382|  3.73k|        return stringend(p, state);
27383|  3.73k|    }
27384|       |    /* normal char */
27385|  9.87k|    if (c != '\n' && c != '\r')
  ------------------
  |  Branch (27385:9): [True: 9.39k, False: 476]
  |  Branch (27385:22): [True: 9.17k, False: 217]
  ------------------
27386|  9.17k|        push_buf(p, c);
27387|  9.87k|    return 1;
27388|  13.6k|}
janet.c:escape1:
27289|  2.15k|static int escape1(JanetParser *p, JanetParseState *state, uint8_t c) {
27290|  2.15k|    int e = checkescape(c);
27291|  2.15k|    if (e < 0) {
  ------------------
  |  Branch (27291:9): [True: 33, False: 2.11k]
  ------------------
27292|     33|        p->error = "invalid string escape sequence";
27293|     33|        return 1;
27294|     33|    }
27295|  2.11k|    if (c == 'x') {
  ------------------
  |  Branch (27295:9): [True: 296, False: 1.82k]
  ------------------
27296|    296|        state->counter = 2;
27297|    296|        state->argn = 0;
27298|    296|        state->consumer = escapeh;
27299|  1.82k|    } else if (c == 'u' || c == 'U') {
  ------------------
  |  Branch (27299:16): [True: 337, False: 1.48k]
  |  Branch (27299:28): [True: 283, False: 1.20k]
  ------------------
27300|    620|        state->counter = c == 'u' ? 4 : 6;
  ------------------
  |  Branch (27300:26): [True: 337, False: 283]
  ------------------
27301|    620|        state->argn = 0;
27302|    620|        state->consumer = escapeu;
27303|  1.20k|    } else {
27304|  1.20k|        push_buf(p, (uint8_t) e);
27305|  1.20k|        state->consumer = stringchar;
27306|  1.20k|    }
27307|  2.11k|    return 1;
27308|  2.15k|}
janet.c:checkescape:
27193|  2.15k|static int checkescape(uint8_t c) {
27194|  2.15k|    switch (c) {
27195|     33|        default:
  ------------------
  |  Branch (27195:9): [True: 33, False: 2.11k]
  ------------------
27196|     33|            return -1;
27197|    296|        case 'x':
  ------------------
  |  Branch (27197:9): [True: 296, False: 1.85k]
  ------------------
27198|    633|        case 'u':
  ------------------
  |  Branch (27198:9): [True: 337, False: 1.81k]
  ------------------
27199|    916|        case 'U':
  ------------------
  |  Branch (27199:9): [True: 283, False: 1.86k]
  ------------------
27200|    916|            return 1;
27201|     81|        case 'n':
  ------------------
  |  Branch (27201:9): [True: 81, False: 2.07k]
  ------------------
27202|     81|            return '\n';
27203|     83|        case 't':
  ------------------
  |  Branch (27203:9): [True: 83, False: 2.06k]
  ------------------
27204|     83|            return '\t';
27205|     84|        case 'r':
  ------------------
  |  Branch (27205:9): [True: 84, False: 2.06k]
  ------------------
27206|     84|            return '\r';
27207|     77|        case '0':
  ------------------
  |  Branch (27207:9): [True: 77, False: 2.07k]
  ------------------
27208|     77|            return '\0';
27209|     70|        case 'z':
  ------------------
  |  Branch (27209:9): [True: 70, False: 2.08k]
  ------------------
27210|     70|            return '\0';
27211|     35|        case 'f':
  ------------------
  |  Branch (27211:9): [True: 35, False: 2.11k]
  ------------------
27212|     35|            return '\f';
27213|     71|        case 'v':
  ------------------
  |  Branch (27213:9): [True: 71, False: 2.08k]
  ------------------
27214|     71|            return '\v';
27215|     38|        case 'a':
  ------------------
  |  Branch (27215:9): [True: 38, False: 2.11k]
  ------------------
27216|     38|            return '\a';
27217|     89|        case 'b':
  ------------------
  |  Branch (27217:9): [True: 89, False: 2.06k]
  ------------------
27218|     89|            return '\b';
27219|     74|        case '\'':
  ------------------
  |  Branch (27219:9): [True: 74, False: 2.07k]
  ------------------
27220|     74|            return '\'';
27221|     74|        case '?':
  ------------------
  |  Branch (27221:9): [True: 74, False: 2.07k]
  ------------------
27222|     74|            return '?';
27223|     74|        case 'e':
  ------------------
  |  Branch (27223:9): [True: 74, False: 2.07k]
  ------------------
27224|     74|            return 27;
27225|    115|        case '"':
  ------------------
  |  Branch (27225:9): [True: 115, False: 2.03k]
  ------------------
27226|    115|            return '"';
27227|    238|        case '\\':
  ------------------
  |  Branch (27227:9): [True: 238, False: 1.91k]
  ------------------
27228|    238|            return '\\';
27229|  2.15k|    }
27230|  2.15k|}
janet.c:escapeh:
27253|    572|static int escapeh(JanetParser *p, JanetParseState *state, uint8_t c) {
27254|    572|    int digit = to_hex(c);
27255|    572|    if (digit < 0) {
  ------------------
  |  Branch (27255:9): [True: 38, False: 534]
  ------------------
27256|     38|        p->error = "invalid hex digit in hex escape";
27257|     38|        return 1;
27258|     38|    }
27259|    534|    state->argn = (state->argn << 4) + digit;
27260|    534|    state->counter--;
27261|    534|    if (!state->counter) {
  ------------------
  |  Branch (27261:9): [True: 258, False: 276]
  ------------------
27262|    258|        push_buf(p, (uint8_t)(state->argn & 0xFF));
27263|    258|        state->argn = 0;
27264|    258|        state->consumer = stringchar;
27265|    258|    }
27266|    534|    return 1;
27267|    572|}
janet.c:to_hex:
27058|  3.42k|static int to_hex(uint8_t c) {
27059|  3.42k|    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (27059:9): [True: 3.37k, False: 52]
  |  Branch (27059:21): [True: 1.75k, False: 1.62k]
  ------------------
27060|  1.75k|        return c - '0';
27061|  1.75k|    } else if (c >= 'A' && c <= 'F') {
  ------------------
  |  Branch (27061:16): [True: 1.61k, False: 59]
  |  Branch (27061:28): [True: 1.26k, False: 344]
  ------------------
27062|  1.26k|        return 10 + c - 'A';
27063|  1.26k|    } else if (c >= 'a' && c <= 'f') {
  ------------------
  |  Branch (27063:16): [True: 328, False: 75]
  |  Branch (27063:28): [True: 297, False: 31]
  ------------------
27064|    297|        return 10 + c - 'a';
27065|    297|    } else {
27066|    106|        return -1;
27067|    106|    }
27068|  3.42k|}
janet.c:escapeu:
27269|  2.85k|static int escapeu(JanetParser *p, JanetParseState *state, uint8_t c) {
27270|  2.85k|    int digit = to_hex(c);
27271|  2.85k|    if (digit < 0) {
  ------------------
  |  Branch (27271:9): [True: 68, False: 2.78k]
  ------------------
27272|     68|        p->error = "invalid hex digit in unicode escape";
27273|     68|        return 1;
27274|     68|    }
27275|  2.78k|    state->argn = (state->argn << 4) + digit;
27276|  2.78k|    state->counter--;
27277|  2.78k|    if (!state->counter) {
  ------------------
  |  Branch (27277:9): [True: 552, False: 2.23k]
  ------------------
27278|    552|        if (state->argn > 0x10FFFF) {
  ------------------
  |  Branch (27278:13): [True: 6, False: 546]
  ------------------
27279|      6|            p->error = "invalid unicode codepoint";
27280|      6|            return 1;
27281|      6|        }
27282|    546|        write_codepoint(p, state->argn);
27283|    546|        state->argn = 0;
27284|    546|        state->consumer = stringchar;
27285|    546|    }
27286|  2.78k|    return 1;
27287|  2.78k|}
janet.c:write_codepoint:
27235|    546|static void write_codepoint(JanetParser *p, int32_t codepoint) {
27236|    546|    if (codepoint <= 0x7F) {
  ------------------
  |  Branch (27236:9): [True: 34, False: 512]
  ------------------
27237|     34|        push_buf(p, (uint8_t) codepoint);
27238|    512|    } else if (codepoint <= 0x7FF) {
  ------------------
  |  Branch (27238:16): [True: 99, False: 413]
  ------------------
27239|     99|        push_buf(p, (uint8_t)((codepoint >>  6) & 0x1F) | 0xC0);
27240|     99|        push_buf(p, (uint8_t)((codepoint >>  0) & 0x3F) | 0x80);
27241|    413|    } else if (codepoint <= 0xFFFF) {
  ------------------
  |  Branch (27241:16): [True: 175, False: 238]
  ------------------
27242|    175|        push_buf(p, (uint8_t)((codepoint >> 12) & 0x0F) | 0xE0);
27243|    175|        push_buf(p, (uint8_t)((codepoint >>  6) & 0x3F) | 0x80);
27244|    175|        push_buf(p, (uint8_t)((codepoint >>  0) & 0x3F) | 0x80);
27245|    238|    } else {
27246|    238|        push_buf(p, (uint8_t)((codepoint >> 18) & 0x07) | 0xF0);
27247|    238|        push_buf(p, (uint8_t)((codepoint >> 12) & 0x3F) | 0x80);
27248|    238|        push_buf(p, (uint8_t)((codepoint >>  6) & 0x3F) | 0x80);
27249|    238|        push_buf(p, (uint8_t)((codepoint >>  0) & 0x3F) | 0x80);
27250|    238|    }
27251|    546|}
janet.c:stringend:
27310|  5.08k|static int stringend(JanetParser *p, JanetParseState *state) {
27311|  5.08k|    Janet ret;
27312|  5.08k|    uint8_t *bufstart = p->buf;
27313|  5.08k|    int32_t buflen = (int32_t) p->bufcount;
27314|  5.08k|    if (state->flags & PFLAG_LONGSTRING) {
  ------------------
  |  |27102|  5.08k|#define PFLAG_LONGSTRING 0x4000
  ------------------
  |  Branch (27314:9): [True: 1.34k, False: 3.73k]
  ------------------
27315|       |        /* Post process to remove leading whitespace */
27316|  1.34k|        JanetParseState top = p->states[p->statecount - 1];
27317|  1.34k|        int32_t indent_col = (int32_t) top.column - 1;
27318|  1.34k|        uint8_t *r = bufstart, *end = r + buflen;
27319|       |        /* Unless there are only spaces before EOLs, disable reindenting */
27320|  1.34k|        int reindent = 1;
27321|  7.28k|        while (reindent && (r < end)) {
  ------------------
  |  Branch (27321:16): [True: 7.14k, False: 137]
  |  Branch (27321:28): [True: 5.94k, False: 1.20k]
  ------------------
27322|  5.94k|            if (*r++ == '\n') {
  ------------------
  |  Branch (27322:17): [True: 1.23k, False: 4.70k]
  ------------------
27323|  1.36k|                for (int32_t j = 0; (r < end) && (*r != '\n') && (j < indent_col); j++, r++) {
  ------------------
  |  Branch (27323:37): [True: 918, False: 442]
  |  Branch (27323:50): [True: 609, False: 309]
  |  Branch (27323:66): [True: 292, False: 317]
  ------------------
27324|    292|                    if (*r != ' ') {
  ------------------
  |  Branch (27324:25): [True: 171, False: 121]
  ------------------
27325|    171|                        reindent = 0;
27326|    171|                        break;
27327|    171|                    }
27328|    292|                }
27329|  1.23k|                if ((r + 1) < end && *r == '\r' && *(r + 1) == '\n') reindent = 1;
  ------------------
  |  Branch (27329:21): [True: 661, False: 578]
  |  Branch (27329:38): [True: 243, False: 418]
  |  Branch (27329:52): [True: 157, False: 86]
  ------------------
27330|  1.23k|            }
27331|  5.94k|        }
27332|       |        /* Now reindent if able */
27333|  1.34k|        if (reindent) {
  ------------------
  |  Branch (27333:13): [True: 1.20k, False: 137]
  ------------------
27334|  1.20k|            uint8_t *w = bufstart;
27335|  1.20k|            r = bufstart;
27336|  6.66k|            while (r < end) {
  ------------------
  |  Branch (27336:20): [True: 5.46k, False: 1.20k]
  ------------------
27337|  5.46k|                if (*r == '\n') {
  ------------------
  |  Branch (27337:21): [True: 1.06k, False: 4.39k]
  ------------------
27338|  1.06k|                    *w++ = *r++;
27339|  1.18k|                    for (int32_t j = 0; (r < end) && (*r != '\n') && (j < indent_col); j++, r++);
  ------------------
  |  Branch (27339:41): [True: 738, False: 442]
  |  Branch (27339:54): [True: 434, False: 304]
  |  Branch (27339:70): [True: 117, False: 317]
  ------------------
27340|  1.06k|                    if ((r + 1) < end && *r == '\r' && *(r + 1) == '\n') *w++ = *r++;
  ------------------
  |  Branch (27340:25): [True: 564, False: 499]
  |  Branch (27340:42): [True: 207, False: 357]
  |  Branch (27340:56): [True: 123, False: 84]
  ------------------
27341|  4.39k|                } else {
27342|  4.39k|                    *w++ = *r++;
27343|  4.39k|                }
27344|  5.46k|            }
27345|  1.20k|            buflen = (int32_t)(w - bufstart);
27346|  1.20k|        }
27347|       |        /* Check for leading EOL so we can remove it */
27348|  1.34k|        if (buflen > 1 && bufstart[0] == '\r' && bufstart[1] == '\n') { /* Windows EOL */
  ------------------
  |  Branch (27348:13): [True: 905, False: 437]
  |  Branch (27348:27): [True: 255, False: 650]
  |  Branch (27348:50): [True: 123, False: 132]
  ------------------
27349|    123|            buflen = buflen - 2;
27350|    123|            bufstart = bufstart + 2;
27351|  1.21k|        } else if (buflen > 0 && bufstart[0] == '\n') { /* Unix EOL */
  ------------------
  |  Branch (27351:20): [True: 1.21k, False: 0]
  |  Branch (27351:34): [True: 375, False: 844]
  ------------------
27352|    375|            buflen--;
27353|    375|            bufstart++;
27354|    375|        }
27355|       |        /* Check for trailing EOL so we can remove it */
27356|  1.34k|        if (buflen > 1 && bufstart[buflen - 2] == '\r' && bufstart[buflen - 1] == '\n') { /* Windows EOL */
  ------------------
  |  Branch (27356:13): [True: 724, False: 618]
  |  Branch (27356:27): [True: 169, False: 555]
  |  Branch (27356:59): [True: 39, False: 130]
  ------------------
27357|     39|            buflen = buflen - 2;
27358|  1.30k|        } else if (buflen > 0 && bufstart[buflen - 1] == '\n') { /* Unix EOL */
  ------------------
  |  Branch (27358:20): [True: 1.01k, False: 289]
  |  Branch (27358:34): [True: 117, False: 897]
  ------------------
27359|    117|            buflen--;
27360|    117|        }
27361|  1.34k|    }
27362|  5.08k|    if (state->flags & PFLAG_BUFFER) {
  ------------------
  |  |27097|  5.08k|#define PFLAG_BUFFER 0x200
  ------------------
  |  Branch (27362:9): [True: 585, False: 4.49k]
  ------------------
27363|    585|        JanetBuffer *b = janet_buffer(buflen);
27364|    585|        janet_buffer_push_bytes(b, bufstart, buflen);
27365|    585|        ret = janet_wrap_buffer(b);
  ------------------
  |  |  847|    585|#define janet_wrap_buffer(s) janet_nanbox_wrap_((s), JANET_BUFFER)
  |  |  ------------------
  |  |  |  |  825|    585|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|    585|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|    585|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
27366|  4.49k|    } else {
27367|  4.49k|        ret = janet_wrap_string(janet_string(bufstart, buflen));
  ------------------
  |  |  848|  4.49k|#define janet_wrap_string(s) janet_nanbox_wrap_c((s), JANET_STRING)
  |  |  ------------------
  |  |  |  |  828|  4.49k|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  4.49k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  4.49k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
27368|  4.49k|    }
27369|  5.08k|    p->bufcount = 0;
27370|  5.08k|    popstate(p, ret);
27371|  5.08k|    return 1;
27372|  5.08k|}
janet.c:comment:
27456|  7.41k|static int comment(JanetParser *p, JanetParseState *state, uint8_t c) {
27457|  7.41k|    (void) state;
27458|  7.41k|    if (c == '\n') {
  ------------------
  |  Branch (27458:9): [True: 536, False: 6.88k]
  ------------------
27459|    536|        p->statecount--;
27460|    536|        p->bufcount = 0;
27461|  6.88k|    } else {
27462|  6.88k|        push_buf(p, c);
27463|  6.88k|    }
27464|  7.41k|    return 1;
27465|  7.41k|}
janet.c:atsign:
27551|  2.88k|static int atsign(JanetParser *p, JanetParseState *state, uint8_t c) {
27552|  2.88k|    (void) state;
27553|  2.88k|    p->statecount--;
27554|  2.88k|    switch (c) {
27555|  1.27k|        case '{':
  ------------------
  |  Branch (27555:9): [True: 1.27k, False: 1.61k]
  ------------------
27556|  1.27k|            pushstate(p, root, PFLAG_CONTAINER | PFLAG_CURLYBRACKETS | PFLAG_ATSYM);
  ------------------
  |  |27096|  1.27k|#define PFLAG_CONTAINER 0x100
  ------------------
                          pushstate(p, root, PFLAG_CONTAINER | PFLAG_CURLYBRACKETS | PFLAG_ATSYM);
  ------------------
  |  |27100|  1.27k|#define PFLAG_CURLYBRACKETS 0x1000
  ------------------
                          pushstate(p, root, PFLAG_CONTAINER | PFLAG_CURLYBRACKETS | PFLAG_ATSYM);
  ------------------
  |  |27104|  1.27k|#define PFLAG_ATSYM 0x10000
  ------------------
27557|  1.27k|            return 1;
27558|    363|        case '"':
  ------------------
  |  Branch (27558:9): [True: 363, False: 2.52k]
  ------------------
27559|    363|            pushstate(p, stringchar, PFLAG_BUFFER | PFLAG_STRING);
  ------------------
  |  |27097|    363|#define PFLAG_BUFFER 0x200
  ------------------
                          pushstate(p, stringchar, PFLAG_BUFFER | PFLAG_STRING);
  ------------------
  |  |27101|    363|#define PFLAG_STRING 0x2000
  ------------------
27560|    363|            return 1;
27561|    234|        case '`':
  ------------------
  |  Branch (27561:9): [True: 234, False: 2.65k]
  ------------------
27562|    234|            pushstate(p, longstring, PFLAG_BUFFER | PFLAG_LONGSTRING);
  ------------------
  |  |27097|    234|#define PFLAG_BUFFER 0x200
  ------------------
                          pushstate(p, longstring, PFLAG_BUFFER | PFLAG_LONGSTRING);
  ------------------
  |  |27102|    234|#define PFLAG_LONGSTRING 0x4000
  ------------------
27563|    234|            return 1;
27564|    297|        case '[':
  ------------------
  |  Branch (27564:9): [True: 297, False: 2.59k]
  ------------------
27565|    297|            pushstate(p, root, PFLAG_CONTAINER | PFLAG_SQRBRACKETS | PFLAG_ATSYM);
  ------------------
  |  |27096|    297|#define PFLAG_CONTAINER 0x100
  ------------------
                          pushstate(p, root, PFLAG_CONTAINER | PFLAG_SQRBRACKETS | PFLAG_ATSYM);
  ------------------
  |  |27099|    297|#define PFLAG_SQRBRACKETS 0x800
  ------------------
                          pushstate(p, root, PFLAG_CONTAINER | PFLAG_SQRBRACKETS | PFLAG_ATSYM);
  ------------------
  |  |27104|    297|#define PFLAG_ATSYM 0x10000
  ------------------
27566|    297|            return 1;
27567|     92|        case '(':
  ------------------
  |  Branch (27567:9): [True: 92, False: 2.79k]
  ------------------
27568|     92|            pushstate(p, root, PFLAG_CONTAINER | PFLAG_PARENS | PFLAG_ATSYM);
  ------------------
  |  |27096|     92|#define PFLAG_CONTAINER 0x100
  ------------------
                          pushstate(p, root, PFLAG_CONTAINER | PFLAG_PARENS | PFLAG_ATSYM);
  ------------------
  |  |27098|     92|#define PFLAG_PARENS 0x400
  ------------------
                          pushstate(p, root, PFLAG_CONTAINER | PFLAG_PARENS | PFLAG_ATSYM);
  ------------------
  |  |27104|     92|#define PFLAG_ATSYM 0x10000
  ------------------
27569|     92|            return 1;
27570|    632|        default:
  ------------------
  |  Branch (27570:9): [True: 632, False: 2.25k]
  ------------------
27571|    632|            break;
27572|  2.88k|    }
27573|    632|    pushstate(p, tokenchar, PFLAG_TOKEN);
  ------------------
  |  |27106|    632|#define PFLAG_TOKEN 0x40000
  ------------------
27574|    632|    push_buf(p, '@'); /* Push the leading at-sign that was dropped */
27575|    632|    return 0;
27576|  2.88k|}
janet.c:longstring:
27507|  12.9k|static int longstring(JanetParser *p, JanetParseState *state, uint8_t c) {
27508|  12.9k|    if (state->flags & PFLAG_INSTRING) {
  ------------------
  |  |27505|  12.9k|#define PFLAG_INSTRING 0x100000
  ------------------
  |  Branch (27508:9): [True: 7.53k, False: 5.45k]
  ------------------
27509|       |        /* We are inside the long string */
27510|  7.53k|        if (c == '`') {
  ------------------
  |  Branch (27510:13): [True: 1.57k, False: 5.95k]
  ------------------
27511|  1.57k|            state->flags |= PFLAG_END_CANDIDATE;
  ------------------
  |  |27506|  1.57k|#define PFLAG_END_CANDIDATE 0x200000
  ------------------
27512|  1.57k|            state->flags &= ~PFLAG_INSTRING;
  ------------------
  |  |27505|  1.57k|#define PFLAG_INSTRING 0x100000
  ------------------
27513|  1.57k|            state->counter = 1; /* Use counter to keep track of number of '=' seen */
27514|  1.57k|            return 1;
27515|  1.57k|        }
27516|  5.95k|        push_buf(p, c);
27517|  5.95k|        return 1;
27518|  7.53k|    } else if (state->flags & PFLAG_END_CANDIDATE) {
  ------------------
  |  |27506|  5.45k|#define PFLAG_END_CANDIDATE 0x200000
  ------------------
  |  Branch (27518:16): [True: 2.06k, False: 3.39k]
  ------------------
27519|  2.06k|        int i;
27520|       |        /* We are checking a potential end of the string */
27521|  2.06k|        if (state->counter == state->argn) {
  ------------------
  |  Branch (27521:13): [True: 1.34k, False: 719]
  ------------------
27522|  1.34k|            stringend(p, state);
27523|  1.34k|            return 0;
27524|  1.34k|        }
27525|    719|        if (c == '`' && state->counter < state->argn) {
  ------------------
  |  Branch (27525:13): [True: 488, False: 231]
  |  Branch (27525:25): [True: 488, False: 0]
  ------------------
27526|    488|            state->counter++;
27527|    488|            return 1;
27528|    488|        }
27529|       |        /* Failed end candidate */
27530|    862|        for (i = 0; i < state->counter; i++) {
  ------------------
  |  Branch (27530:21): [True: 631, False: 231]
  ------------------
27531|    631|            push_buf(p, '`');
27532|    631|        }
27533|    231|        push_buf(p, c);
27534|    231|        state->counter = 0;
27535|    231|        state->flags &= ~PFLAG_END_CANDIDATE;
  ------------------
  |  |27506|    231|#define PFLAG_END_CANDIDATE 0x200000
  ------------------
27536|    231|        state->flags |= PFLAG_INSTRING;
  ------------------
  |  |27505|    231|#define PFLAG_INSTRING 0x100000
  ------------------
27537|    231|        return 1;
27538|  3.39k|    } else {
27539|       |        /* We are at beginning of string */
27540|  3.39k|        state->argn++;
27541|  3.39k|        if (c != '`') {
  ------------------
  |  Branch (27541:13): [True: 1.47k, False: 1.92k]
  ------------------
27542|  1.47k|            state->flags |= PFLAG_INSTRING;
  ------------------
  |  |27505|  1.47k|#define PFLAG_INSTRING 0x100000
  ------------------
27543|  1.47k|            push_buf(p, c);
27544|  1.47k|        }
27545|  3.39k|        return 1;
27546|  3.39k|    }
27547|  12.9k|}
janet.c:close_array:
27475|    218|static Janet close_array(JanetParser *p, JanetParseState *state) {
27476|    218|    JanetArray *array = janet_array(state->argn);
27477|    671|    for (int32_t i = state->argn - 1; i >= 0; i--)
  ------------------
  |  Branch (27477:39): [True: 453, False: 218]
  ------------------
27478|    453|        array->data[i] = p->args[--p->argcount];
27479|    218|    array->count = state->argn;
27480|    218|    return janet_wrap_array(array);
  ------------------
  |  |  845|    218|#define janet_wrap_array(s) janet_nanbox_wrap_((s), JANET_ARRAY)
  |  |  ------------------
  |  |  |  |  825|    218|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|    218|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|    218|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
27481|    218|}
janet.c:close_tuple:
27467|  5.42k|static Janet close_tuple(JanetParser *p, JanetParseState *state, int32_t flag) {
27468|  5.42k|    Janet *ret = janet_tuple_begin(state->argn);
27469|  5.42k|    janet_tuple_flag(ret) |= flag;
  ------------------
  |  | 1806|  5.42k|#define janet_tuple_flag(t) (janet_tuple_head(t)->gc.flags)
  |  |  ------------------
  |  |  |  | 1800|  5.42k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
27470|  19.9k|    for (int32_t i = state->argn - 1; i >= 0; i--)
  ------------------
  |  Branch (27470:39): [True: 14.5k, False: 5.42k]
  ------------------
27471|  14.5k|        ret[i] = p->args[--p->argcount];
27472|  5.42k|    return janet_wrap_tuple(janet_tuple_end(ret));
  ------------------
  |  |  843|  5.42k|#define janet_wrap_tuple(s) janet_nanbox_wrap_c((s), JANET_TUPLE)
  |  |  ------------------
  |  |  |  |  828|  5.42k|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  5.42k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  5.42k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
27473|  5.42k|}
janet.c:close_table:
27494|  1.12k|static Janet close_table(JanetParser *p, JanetParseState *state) {
27495|  1.12k|    JanetTable *table = janet_table(state->argn >> 1);
27496|  3.32k|    for (size_t i = p->argcount - state->argn; i < p->argcount; i += 2) {
  ------------------
  |  Branch (27496:48): [True: 2.19k, False: 1.12k]
  ------------------
27497|  2.19k|        Janet key = p->args[i];
27498|  2.19k|        Janet value = p->args[i + 1];
27499|  2.19k|        janet_table_put(table, key, value);
27500|  2.19k|    }
27501|  1.12k|    p->argcount -= state->argn;
27502|  1.12k|    return janet_wrap_table(table);
  ------------------
  |  |  846|  1.12k|#define janet_wrap_table(s) janet_nanbox_wrap_((s), JANET_TABLE)
  |  |  ------------------
  |  |  |  |  825|  1.12k|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  1.12k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  1.12k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
27503|  1.12k|}
janet.c:close_struct:
27483|  4.20k|static Janet close_struct(JanetParser *p, JanetParseState *state) {
27484|  4.20k|    JanetKV *st = janet_struct_begin(state->argn >> 1);
27485|  8.69k|    for (size_t i = p->argcount - state->argn; i < p->argcount; i += 2) {
  ------------------
  |  Branch (27485:48): [True: 4.48k, False: 4.20k]
  ------------------
27486|  4.48k|        Janet key = p->args[i];
27487|  4.48k|        Janet value = p->args[i + 1];
27488|  4.48k|        janet_struct_put(st, key, value);
27489|  4.48k|    }
27490|  4.20k|    p->argcount -= state->argn;
27491|  4.20k|    return janet_wrap_struct(janet_struct_end(st));
  ------------------
  |  |  842|  4.20k|#define janet_wrap_struct(s) janet_nanbox_wrap_c((s), JANET_STRUCT)
  |  |  ------------------
  |  |  |  |  828|  4.20k|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  4.20k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  4.20k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
27492|  4.20k|}
janet.c:popstate:
27119|  46.0k|static void popstate(JanetParser *p, Janet val) {
27120|  78.6k|    for (;;) {
27121|  78.6k|        JanetParseState top = p->states[--p->statecount];
27122|  78.6k|        JanetParseState *newtop = p->states + p->statecount - 1;
27123|       |        /* Source mapping info */
27124|  78.6k|        if (janet_checktype(val, JANET_TUPLE)) {
  ------------------
  |  |  806|  78.6k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 38.0k, False: 40.6k]
  |  |  |  Branch (806:6): [Folded, False: 78.6k]
  |  |  ------------------
  |  |  807|  78.6k|        ? 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|  78.6k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  78.6k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  78.6k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  78.6k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  78.6k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
27125|  38.0k|            janet_tuple_sm_line(janet_unwrap_tuple(val)) = (int32_t) top.line;
  ------------------
  |  | 1804|  38.0k|#define janet_tuple_sm_line(t) (janet_tuple_head(t)->sm_line)
  |  |  ------------------
  |  |  |  | 1800|  38.0k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
27126|  38.0k|            janet_tuple_sm_column(janet_unwrap_tuple(val)) = (int32_t) top.column;
  ------------------
  |  | 1805|  38.0k|#define janet_tuple_sm_column(t) (janet_tuple_head(t)->sm_column)
  |  |  ------------------
  |  |  |  | 1800|  38.0k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
27127|  38.0k|        }
27128|  78.6k|        if (newtop->flags & PFLAG_CONTAINER) {
  ------------------
  |  |27096|  78.6k|#define PFLAG_CONTAINER 0x100
  ------------------
  |  Branch (27128:13): [True: 46.0k, False: 32.6k]
  ------------------
27129|  46.0k|            newtop->argn++;
27130|       |            /* Keep track of number of values in the root state */
27131|  46.0k|            if (p->statecount == 1) {
  ------------------
  |  Branch (27131:17): [True: 12.6k, False: 33.3k]
  ------------------
27132|  12.6k|                p->pending++;
27133|       |                /* Root items are always wrapped in a tuple for source map info. */
27134|  12.6k|                const Janet *tup = janet_tuple_n(&val, 1);
27135|  12.6k|                janet_tuple_sm_line(tup) = (int32_t) top.line;
  ------------------
  |  | 1804|  12.6k|#define janet_tuple_sm_line(t) (janet_tuple_head(t)->sm_line)
  |  |  ------------------
  |  |  |  | 1800|  12.6k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
27136|  12.6k|                janet_tuple_sm_column(tup) = (int32_t) top.column;
  ------------------
  |  | 1805|  12.6k|#define janet_tuple_sm_column(t) (janet_tuple_head(t)->sm_column)
  |  |  ------------------
  |  |  |  | 1800|  12.6k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
27137|  12.6k|                val = janet_wrap_tuple(tup);
  ------------------
  |  |  843|  12.6k|#define janet_wrap_tuple(s) janet_nanbox_wrap_c((s), JANET_TUPLE)
  |  |  ------------------
  |  |  |  |  828|  12.6k|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  12.6k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  12.6k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
27138|  12.6k|            }
27139|  46.0k|            push_arg(p, val);
27140|  46.0k|            return;
27141|  46.0k|        } else if (newtop->flags & PFLAG_READERMAC) {
  ------------------
  |  |27103|  32.6k|#define PFLAG_READERMAC 0x8000
  ------------------
  |  Branch (27141:20): [True: 32.6k, False: 0]
  ------------------
27142|  32.6k|            Janet *t = janet_tuple_begin(2);
27143|  32.6k|            int c = newtop->flags & 0xFF;
27144|  32.6k|            const char *which =
27145|  32.6k|                (c == '\'') ? "quote" :
  ------------------
  |  Branch (27145:17): [True: 14.9k, False: 17.6k]
  ------------------
27146|  32.6k|                (c == ',') ? "unquote" :
  ------------------
  |  Branch (27146:17): [True: 5.65k, False: 11.9k]
  ------------------
27147|  17.6k|                (c == ';') ? "splice" :
  ------------------
  |  Branch (27147:17): [True: 5.37k, False: 6.62k]
  ------------------
27148|  11.9k|                (c == '|') ? "short-fn" :
  ------------------
  |  Branch (27148:17): [True: 3.32k, False: 3.29k]
  ------------------
27149|  6.62k|                (c == '~') ? "quasiquote" : "<unknown>";
  ------------------
  |  Branch (27149:17): [True: 3.29k, False: 0]
  ------------------
27150|  32.6k|            t[0] = janet_csymbolv(which);
  ------------------
  |  | 1837|  32.6k|#define janet_csymbolv(cstr) janet_wrap_symbol(janet_csymbol(cstr))
  |  |  ------------------
  |  |  |  |  849|  32.6k|#define janet_wrap_symbol(s) janet_nanbox_wrap_c((s), JANET_SYMBOL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  828|  32.6k|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  793|  32.6k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  792|  32.6k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
27151|  32.6k|            t[1] = val;
27152|       |            /* Quote source mapping info */
27153|  32.6k|            janet_tuple_sm_line(t) = (int32_t) newtop->line;
  ------------------
  |  | 1804|  32.6k|#define janet_tuple_sm_line(t) (janet_tuple_head(t)->sm_line)
  |  |  ------------------
  |  |  |  | 1800|  32.6k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
27154|  32.6k|            janet_tuple_sm_column(t) = (int32_t) newtop->column;
  ------------------
  |  | 1805|  32.6k|#define janet_tuple_sm_column(t) (janet_tuple_head(t)->sm_column)
  |  |  ------------------
  |  |  |  | 1800|  32.6k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
27155|  32.6k|            val = janet_wrap_tuple(janet_tuple_end(t));
  ------------------
  |  |  843|  32.6k|#define janet_wrap_tuple(s) janet_nanbox_wrap_c((s), JANET_TUPLE)
  |  |  ------------------
  |  |  |  |  828|  32.6k|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  32.6k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  32.6k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
27156|  32.6k|        } else {
27157|      0|            return;
27158|      0|        }
27159|  78.6k|    }
27160|  46.0k|}
janet.c:tokenchar:
27403|   134k|static int tokenchar(JanetParser *p, JanetParseState *state, uint8_t c) {
27404|   134k|    Janet ret;
27405|   134k|    double numval;
27406|   134k|    int32_t blen;
27407|   134k|    if (janet_is_symbol_char(c)) {
  ------------------
  |  Branch (27407:9): [True: 103k, False: 30.6k]
  ------------------
27408|   103k|        push_buf(p, (uint8_t) c);
27409|   103k|        if (c > 127) state->argn = 1; /* Use to indicate non ascii */
  ------------------
  |  Branch (27409:13): [True: 4.27k, False: 99.5k]
  ------------------
27410|   103k|        return 1;
27411|   103k|    }
27412|       |    /* Token finished */
27413|  30.6k|    blen = (int32_t) p->bufcount;
27414|  30.6k|    int start_dig = p->buf[0] >= '0' && p->buf[0] <= '9';
  ------------------
  |  Branch (27414:21): [True: 21.9k, False: 8.70k]
  |  Branch (27414:41): [True: 10.8k, False: 11.1k]
  ------------------
27415|  30.6k|    int start_num = start_dig || p->buf[0] == '-' || p->buf[0] == '+' || p->buf[0] == '.';
  ------------------
  |  Branch (27415:21): [True: 10.8k, False: 19.8k]
  |  Branch (27415:34): [True: 2.46k, False: 17.3k]
  |  Branch (27415:54): [True: 1.40k, False: 15.9k]
  |  Branch (27415:74): [True: 2.51k, False: 13.4k]
  ------------------
27416|  30.6k|    if (p->buf[0] == ':') {
  ------------------
  |  Branch (27416:9): [True: 1.74k, False: 28.9k]
  ------------------
27417|       |        /* Don't do full utf-8 check unless we have seen non ascii characters. */
27418|  1.74k|        int valid = (!state->argn) || janet_valid_utf8(p->buf + 1, blen - 1);
  ------------------
  |  Branch (27418:21): [True: 1.50k, False: 233]
  |  Branch (27418:39): [True: 182, False: 51]
  ------------------
27419|  1.74k|        if (!valid) {
  ------------------
  |  Branch (27419:13): [True: 51, False: 1.68k]
  ------------------
27420|     51|            p->error = "invalid utf-8 in keyword";
27421|     51|            return 0;
27422|     51|        }
27423|  1.68k|        ret = janet_keywordv(p->buf + 1, blen - 1);
  ------------------
  |  | 1842|  1.68k|#define janet_keywordv(str, len) janet_wrap_keyword(janet_keyword((str), (len)))
  |  |  ------------------
  |  |  |  |  850|  1.68k|#define janet_wrap_keyword(s) janet_nanbox_wrap_c((s), JANET_KEYWORD)
  |  |  |  |  ------------------
  |  |  |  |  |  |  828|  1.68k|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  793|  1.68k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  792|  1.68k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
27424|  1.68k|#ifdef JANET_INT_TYPES
27425|  28.9k|    } else if (start_num && !janet_scan_numeric(p->buf, blen, &ret)) {
  ------------------
  |  Branch (27425:16): [True: 17.2k, False: 11.7k]
  |  Branch (27425:29): [True: 12.3k, False: 4.83k]
  ------------------
27426|  12.3k|        (void) numval;
27427|       |#else
27428|       |    } else if (start_num && !janet_scan_number(p->buf, blen, &numval)) {
27429|       |        ret = janet_wrap_number(numval);
27430|       |#endif
27431|  16.5k|    } else if (!check_str_const("nil", p->buf, blen)) {
  ------------------
  |  Branch (27431:16): [True: 238, False: 16.3k]
  ------------------
27432|    238|        ret = janet_wrap_nil();
  ------------------
  |  |  831|    238|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|    238|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|    238|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|    238|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
27433|  16.3k|    } else if (!check_str_const("false", p->buf, blen)) {
  ------------------
  |  Branch (27433:16): [True: 85, False: 16.2k]
  ------------------
27434|     85|        ret = janet_wrap_false();
  ------------------
  |  |  833|     85|#define janet_wrap_false() janet_nanbox_from_payload(JANET_BOOLEAN, 0)
  |  |  ------------------
  |  |  |  |  822|     85|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|     85|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|     85|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
27435|  16.2k|    } else if (!check_str_const("true", p->buf, blen)) {
  ------------------
  |  Branch (27435:16): [True: 73, False: 16.1k]
  ------------------
27436|     73|        ret = janet_wrap_true();
  ------------------
  |  |  832|     73|#define janet_wrap_true() janet_nanbox_from_payload(JANET_BOOLEAN, 1)
  |  |  ------------------
  |  |  |  |  822|     73|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|     73|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|     73|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
27437|  16.1k|    } else {
27438|  16.1k|        if (start_dig) {
  ------------------
  |  Branch (27438:13): [True: 385, False: 15.7k]
  ------------------
27439|    385|            p->error = "symbol literal cannot start with a digit";
27440|    385|            return 0;
27441|  15.7k|        } else {
27442|       |            /* Don't do full utf-8 check unless we have seen non ascii characters. */
27443|  15.7k|            int valid = (!state->argn) || janet_valid_utf8(p->buf, blen);
  ------------------
  |  Branch (27443:25): [True: 15.1k, False: 621]
  |  Branch (27443:43): [True: 358, False: 263]
  ------------------
27444|  15.7k|            if (!valid) {
  ------------------
  |  Branch (27444:17): [True: 263, False: 15.5k]
  ------------------
27445|    263|                p->error = "invalid utf-8 in symbol";
27446|    263|                return 0;
27447|    263|            }
27448|  15.5k|            ret = janet_symbolv(p->buf, blen);
  ------------------
  |  | 1836|  15.5k|#define janet_symbolv(str, len) janet_wrap_symbol(janet_symbol((str), (len)))
  |  |  ------------------
  |  |  |  |  849|  15.5k|#define janet_wrap_symbol(s) janet_nanbox_wrap_c((s), JANET_SYMBOL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  828|  15.5k|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  793|  15.5k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  792|  15.5k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
27449|  15.5k|        }
27450|  16.1k|    }
27451|  29.9k|    p->bufcount = 0;
27452|  29.9k|    popstate(p, ret);
27453|  29.9k|    return 0;
27454|  30.6k|}
janet.c:check_str_const:
27391|  49.1k|static int check_str_const(const char *cstr, const uint8_t *str, int32_t len) {
27392|  49.1k|    int32_t index;
27393|  52.6k|    for (index = 0; index < len; index++) {
  ------------------
  |  Branch (27393:21): [True: 51.5k, False: 1.07k]
  ------------------
27394|  51.5k|        uint8_t c = str[index];
27395|  51.5k|        uint8_t k = ((const uint8_t *)cstr)[index];
27396|  51.5k|        if (c < k) return -1;
  ------------------
  |  Branch (27396:13): [True: 40.9k, False: 10.6k]
  ------------------
27397|  10.6k|        if (c > k) return 1;
  ------------------
  |  Branch (27397:13): [True: 7.14k, False: 3.49k]
  ------------------
27398|  3.49k|        if (k == '\0') break;
  ------------------
  |  Branch (27398:13): [True: 0, False: 3.49k]
  ------------------
27399|  3.49k|    }
27400|  1.07k|    return (cstr[index] == '\0') ? 0 : -1;
  ------------------
  |  Branch (27400:12): [True: 396, False: 676]
  ------------------
27401|  49.1k|}
janet.c:size_padded:
29929|  3.78k|static size_t size_padded(size_t offset, size_t size) {
29930|  3.78k|    size_t x = size + offset - 1;
29931|  3.78k|    return x - (x % size);
29932|  3.78k|}
janet.c:compile_peg:
30206|  4.20k|static JanetPeg *compile_peg(Janet x) {
30207|  4.20k|    Builder builder;
30208|  4.20k|    builder.grammar = janet_table(0);
30209|  4.20k|    builder.default_grammar = NULL;
30210|  4.20k|    {
30211|  4.20k|        Janet default_grammarv = janet_dyn("peg-grammar");
30212|  4.20k|        if (janet_checktype(default_grammarv, JANET_TABLE)) {
  ------------------
  |  |  806|  4.20k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 0, False: 4.20k]
  |  |  |  Branch (806:6): [Folded, False: 4.20k]
  |  |  ------------------
  |  |  807|  4.20k|        ? 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|  4.20k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  4.20k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  4.20k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  4.20k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  4.20k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
30213|      0|            builder.default_grammar = janet_unwrap_table(default_grammarv);
  ------------------
  |  |  861|      0|#define janet_unwrap_table(x) ((JanetTable *)janet_nanbox_to_pointer(x))
  ------------------
30214|      0|        }
30215|  4.20k|    }
30216|  4.20k|    builder.tags = janet_table(0);
30217|  4.20k|    builder.constants = NULL;
30218|  4.20k|    builder.bytecode = NULL;
30219|  4.20k|    builder.nexttag = 1;
30220|  4.20k|    builder.form = x;
30221|  4.20k|    builder.depth = JANET_RECURSION_GUARD;
  ------------------
  |  |  296|  4.20k|#define JANET_RECURSION_GUARD 1024
  ------------------
30222|  4.20k|    builder.has_backref = 0;
30223|  4.20k|    peg_compile1(&builder, x);
30224|  4.20k|    JanetPeg *peg = make_peg(&builder);
30225|  4.20k|    builder_cleanup(&builder);
30226|  4.20k|    return peg;
30227|  4.20k|}
janet.c:peg_compile1:
29740|  20.0k|static uint32_t peg_compile1(Builder *b, Janet peg) {
29741|       |
29742|       |    /* Keep track of the form being compiled for error purposes */
29743|  20.0k|    Janet old_form = b->form;
29744|  20.0k|    JanetTable *old_grammar = b->grammar;
29745|  20.0k|    b->form = peg;
29746|       |
29747|       |    /* Resolve keyword references */
29748|  20.0k|    int i = JANET_RECURSION_GUARD;
  ------------------
  |  |  296|  20.0k|#define JANET_RECURSION_GUARD 1024
  ------------------
29749|  20.0k|    JanetTable *grammar = old_grammar;
29750|  20.0k|    for (; i > 0 && janet_checktype(peg, JANET_KEYWORD); --i) {
  ------------------
  |  |  806|  20.0k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 40, False: 19.9k]
  |  |  |  Branch (806:6): [Folded, False: 20.0k]
  |  |  ------------------
  |  |  807|  20.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|  20.0k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  20.0k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  20.0k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  20.0k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  20.0k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (29750:12): [True: 20.0k, False: 0]
  ------------------
29751|     40|        Janet nextPeg = janet_table_get_ex(grammar, peg, &grammar);
29752|     40|        if (!grammar || janet_checktype(nextPeg, JANET_NIL)) {
  ------------------
  |  |  806|     40|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 40, False: 0]
  |  |  |  Branch (806:6): [Folded, False: 40]
  |  |  ------------------
  |  |  807|     40|        ? 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|     40|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|     40|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|     40|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|     40|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|     40|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (29752:13): [True: 0, False: 40]
  ------------------
29753|     40|            nextPeg = (b->default_grammar == NULL)
  ------------------
  |  Branch (29753:23): [True: 40, False: 0]
  ------------------
29754|     40|                      ? janet_wrap_nil()
  ------------------
  |  |  831|     40|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|     40|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|     40|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|     40|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29755|     40|                      : janet_table_get(b->default_grammar, peg);
29756|     40|            if (janet_checktype(nextPeg, JANET_NIL)) {
  ------------------
  |  |  806|     40|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 40, False: 0]
  |  |  |  Branch (806:6): [Folded, False: 40]
  |  |  ------------------
  |  |  807|     40|        ? 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|     40|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|     40|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|     40|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|     40|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|     40|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29757|     40|                peg_panic(b, "unknown rule");
29758|     40|            }
29759|     40|        }
29760|      0|        peg = nextPeg;
29761|      0|        b->form = peg;
29762|      0|        b->grammar = grammar;
29763|      0|    }
29764|  19.9k|    if (i == 0)
  ------------------
  |  Branch (29764:9): [True: 0, False: 19.9k]
  ------------------
29765|      0|        peg_panic(b, "reference chain too deep");
29766|       |
29767|       |    /* Check cache - for tuples we check only the local cache, as
29768|       |     * in a different grammar, the same tuple can compile to a different
29769|       |     * rule - for example, (+ :a :b) depends on whatever :a and :b are bound to. */
29770|  19.9k|    Janet check = janet_checktype(peg, JANET_TUPLE)
  ------------------
  |  |  806|  19.9k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 14.4k, False: 5.56k]
  |  |  |  Branch (806:6): [Folded, False: 19.9k]
  |  |  ------------------
  |  |  807|  19.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|  19.9k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  19.9k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  19.9k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  19.9k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  19.9k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29771|  19.9k|                  ? janet_table_rawget(grammar, peg)
29772|  19.9k|                  : janet_table_get(grammar, peg);
29773|  19.9k|    if (!janet_checktype(check, JANET_NIL)) {
  ------------------
  |  |  806|  19.9k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 19.9k]
  |  |  ------------------
  |  |  807|  19.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|  19.9k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  19.9k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  19.9k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  19.9k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  19.9k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (29773:9): [True: 1.24k, False: 18.7k]
  ------------------
29774|  1.24k|        b->form = old_form;
29775|  1.24k|        b->grammar = old_grammar;
29776|  1.24k|        return (uint32_t) janet_unwrap_number(check);
  ------------------
  |  |  839|  1.24k|#define janet_unwrap_number(x) ((x).number)
  ------------------
29777|  1.24k|    }
29778|       |
29779|       |    /* Check depth */
29780|  18.7k|    if (b->depth-- == 0)
  ------------------
  |  Branch (29780:9): [True: 0, False: 18.7k]
  ------------------
29781|      0|        peg_panic(b, "peg grammar recursed too deeply");
29782|       |
29783|       |    /* The final rule to return */
29784|  18.7k|    uint32_t rule = janet_v_count(b->bytecode);
  ------------------
  |  |  759|  18.7k|#define janet_v_count(v)        (((v) != NULL) ? janet_v__cnt(v) : 0)
  |  |  ------------------
  |  |  |  |  766|  14.5k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  764|  14.5k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (759:34): [True: 14.5k, False: 4.18k]
  |  |  ------------------
  ------------------
29785|       |
29786|       |    /* Add to cache. Do not cache structs, as we don't yet know
29787|       |     * what rule they will return! We can just as effectively cache
29788|       |     * the structs main rule. */
29789|  18.7k|    if (!janet_checktype(peg, JANET_STRUCT)) {
  ------------------
  |  |  806|  18.7k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 18.7k]
  |  |  ------------------
  |  |  807|  18.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|  18.7k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  18.7k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  18.7k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  18.7k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  18.7k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (29789:9): [True: 18.4k, False: 288]
  ------------------
29790|  18.4k|        JanetTable *which_grammar = grammar;
29791|       |        /* If we are a primitive pattern, add to the global cache (root grammar table) */
29792|  18.4k|        if (!janet_checktype(peg, JANET_TUPLE)) {
  ------------------
  |  |  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 (29792:13): [True: 4.36k, False: 14.0k]
  ------------------
29793|  4.36k|            while (which_grammar->proto)
  ------------------
  |  Branch (29793:20): [True: 0, False: 4.36k]
  ------------------
29794|      0|                which_grammar = which_grammar->proto;
29795|  4.36k|        }
29796|  18.4k|        janet_table_put(which_grammar, peg, janet_wrap_number(rule));
  ------------------
  |  |  835|  18.4k|#define janet_wrap_number(r) janet_nanbox_from_double(r)
  ------------------
29797|  18.4k|    }
29798|       |
29799|  18.7k|    switch (janet_type(peg)) {
  ------------------
  |  |  795|  18.7k|    (isnan((x).number) \
  |  |  796|  18.7k|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|  18.7k|        : JANET_NUMBER)
  ------------------
  |  Branch (29799:13): [True: 16.1k, False: 2.61k]
  ------------------
29800|    484|        default:
  ------------------
  |  Branch (29800:9): [True: 484, False: 18.2k]
  ------------------
29801|    484|            peg_panic(b, "unexpected peg source");
29802|      0|            return 0;
29803|       |
29804|     17|        case JANET_BOOLEAN: {
  ------------------
  |  Branch (29804:9): [True: 17, False: 18.7k]
  ------------------
29805|     17|            int n = janet_unwrap_boolean(peg);
  ------------------
  |  |  838|     17|#define janet_unwrap_boolean(x) ((x).u64 & 0x1)
  ------------------
29806|     17|            Reserve r = reserve(b, 2);
29807|     17|            emit_1(r, n ? RULE_NCHAR : RULE_NOTNCHAR, 0);
  ------------------
  |  Branch (29807:23): [True: 13, False: 4]
  ------------------
29808|     17|            break;
29809|      0|        }
29810|  2.61k|        case JANET_NUMBER: {
  ------------------
  |  Branch (29810:9): [True: 2.61k, False: 16.1k]
  ------------------
29811|  2.61k|            int32_t n = peg_getinteger(b, peg);
29812|  2.61k|            Reserve r = reserve(b, 2);
29813|  2.61k|            if (n < 0) {
  ------------------
  |  Branch (29813:17): [True: 138, False: 2.47k]
  ------------------
29814|    138|                if (n == INT32_MIN) {
  ------------------
  |  Branch (29814:21): [True: 2, False: 136]
  ------------------
29815|       |                    /* Since buffers can't hold this many characters, will
29816|       |                     * always match. Avoid undefined behavior negating INT32_MIN. */
29817|      2|                    emit_1(r, RULE_NCHAR, 0);
29818|    136|                } else {
29819|    136|                    emit_1(r, RULE_NOTNCHAR, -n);
29820|    136|                }
29821|  2.47k|            } else {
29822|  2.47k|                emit_1(r, RULE_NCHAR, n);
29823|  2.47k|            }
29824|  2.61k|            break;
29825|      0|        }
29826|    853|        case JANET_STRING: {
  ------------------
  |  Branch (29826:9): [True: 853, False: 17.8k]
  ------------------
29827|    853|            const uint8_t *str = janet_unwrap_string(peg);
  ------------------
  |  |  863|    853|#define janet_unwrap_string(x) ((JanetString)janet_nanbox_to_pointer(x))
  ------------------
29828|    853|            int32_t len = janet_string_length(str);
  ------------------
  |  | 1813|    853|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  ------------------
  |  |  |  | 1812|    853|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
29829|    853|            emit_bytes(b, RULE_LITERAL, len, str);
29830|    853|            break;
29831|      0|        }
29832|    186|        case JANET_BUFFER: {
  ------------------
  |  Branch (29832:9): [True: 186, False: 18.5k]
  ------------------
29833|    186|            const JanetBuffer *buf = janet_unwrap_buffer(peg);
  ------------------
  |  |  862|    186|#define janet_unwrap_buffer(x) ((JanetBuffer *)janet_nanbox_to_pointer(x))
  ------------------
29834|    186|            emit_bytes(b, RULE_LITERAL, buf->count, buf->data);
29835|    186|            break;
29836|      0|        }
29837|    210|        case JANET_TABLE: {
  ------------------
  |  Branch (29837:9): [True: 210, False: 18.5k]
  ------------------
29838|       |            /* Build grammar table */
29839|    210|            JanetTable *new_grammar = janet_table_clone(janet_unwrap_table(peg));
  ------------------
  |  |  861|    210|#define janet_unwrap_table(x) ((JanetTable *)janet_nanbox_to_pointer(x))
  ------------------
29840|    210|            new_grammar->proto = grammar;
29841|    210|            b->grammar = grammar = new_grammar;
29842|       |            /* Run the main rule */
29843|    210|            Janet main_rule = janet_table_rawget(grammar, janet_ckeywordv("main"));
  ------------------
  |  | 1843|    210|#define janet_ckeywordv(cstr) janet_wrap_keyword(janet_ckeyword(cstr))
  |  |  ------------------
  |  |  |  |  850|    210|#define janet_wrap_keyword(s) janet_nanbox_wrap_c((s), JANET_KEYWORD)
  |  |  |  |  ------------------
  |  |  |  |  |  |  828|    210|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  793|    210|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  792|    210|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29844|    210|            if (janet_checktype(main_rule, JANET_NIL))
  ------------------
  |  |  806|    210|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 210, False: 0]
  |  |  |  Branch (806:6): [Folded, False: 210]
  |  |  ------------------
  |  |  807|    210|        ? 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|    210|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|    210|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|    210|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|    210|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|    210|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29845|    210|                peg_panic(b, "grammar requires :main rule");
29846|      0|            rule = peg_compile1(b, main_rule);
29847|      0|            break;
29848|    210|        }
29849|    288|        case JANET_STRUCT: {
  ------------------
  |  Branch (29849:9): [True: 288, False: 18.4k]
  ------------------
29850|       |            /* Build grammar table */
29851|    288|            const JanetKV *st = janet_unwrap_struct(peg);
  ------------------
  |  |  857|    288|#define janet_unwrap_struct(x) ((JanetStruct)janet_nanbox_to_pointer(x))
  ------------------
29852|    288|            JanetTable *new_grammar = janet_table(2 * janet_struct_capacity(st));
  ------------------
  |  | 1849|    288|#define janet_struct_capacity(t) (janet_struct_head(t)->capacity)
  |  |  ------------------
  |  |  |  | 1846|    288|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
29853|  3.24k|            for (int32_t i = 0; i < janet_struct_capacity(st); i++) {
  ------------------
  |  | 1849|  3.24k|#define janet_struct_capacity(t) (janet_struct_head(t)->capacity)
  |  |  ------------------
  |  |  |  | 1846|  3.24k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (29853:33): [True: 2.95k, False: 288]
  ------------------
29854|  2.95k|                if (janet_checktype(st[i].key, JANET_KEYWORD)) {
  ------------------
  |  |  806|  2.95k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 46, False: 2.91k]
  |  |  |  Branch (806:6): [Folded, False: 2.95k]
  |  |  ------------------
  |  |  807|  2.95k|        ? 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|  2.95k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  2.95k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  2.95k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  2.95k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  2.95k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29855|     46|                    janet_table_put(new_grammar, st[i].key, st[i].value);
29856|     46|                }
29857|  2.95k|            }
29858|    288|            new_grammar->proto = grammar;
29859|    288|            b->grammar = grammar = new_grammar;
29860|       |            /* Run the main rule */
29861|    288|            Janet main_rule = janet_table_rawget(grammar, janet_ckeywordv("main"));
  ------------------
  |  | 1843|    288|#define janet_ckeywordv(cstr) janet_wrap_keyword(janet_ckeyword(cstr))
  |  |  ------------------
  |  |  |  |  850|    288|#define janet_wrap_keyword(s) janet_nanbox_wrap_c((s), JANET_KEYWORD)
  |  |  |  |  ------------------
  |  |  |  |  |  |  828|    288|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  793|    288|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  792|    288|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29862|    288|            if (janet_checktype(main_rule, JANET_NIL))
  ------------------
  |  |  806|    288|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 288, False: 0]
  |  |  |  Branch (806:6): [Folded, False: 288]
  |  |  ------------------
  |  |  807|    288|        ? 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|    288|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|    288|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|    288|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|    288|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|    288|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29863|    288|                peg_panic(b, "grammar requires :main rule");
29864|      0|            rule = peg_compile1(b, main_rule);
29865|      0|            break;
29866|    288|        }
29867|  14.0k|        case JANET_TUPLE: {
  ------------------
  |  Branch (29867:9): [True: 14.0k, False: 4.64k]
  ------------------
29868|  14.0k|            const Janet *tup = janet_unwrap_tuple(peg);
  ------------------
  |  |  858|  14.0k|#define janet_unwrap_tuple(x) ((JanetTuple)janet_nanbox_to_pointer(x))
  ------------------
29869|  14.0k|            int32_t len = janet_tuple_length(tup);
  ------------------
  |  | 1802|  14.0k|#define janet_tuple_length(t) (janet_tuple_head(t)->length)
  |  |  ------------------
  |  |  |  | 1800|  14.0k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
29870|  14.0k|            if (len == 0) peg_panic(b, "tuple in grammar must have non-zero length");
  ------------------
  |  Branch (29870:17): [True: 10, False: 14.0k]
  ------------------
29871|  14.0k|            if (janet_checkint(tup[0])) {
  ------------------
  |  Branch (29871:17): [True: 1.19k, False: 12.8k]
  ------------------
29872|  1.19k|                int32_t n = janet_unwrap_integer(tup[0]);
  ------------------
  |  |  966|  1.19k|#define janet_unwrap_integer(x) ((int32_t) janet_unwrap_number(x))
  |  |  ------------------
  |  |  |  |  839|  1.19k|#define janet_unwrap_number(x) ((x).number)
  |  |  ------------------
  ------------------
29873|  1.19k|                if (n < 0) {
  ------------------
  |  Branch (29873:21): [True: 33, False: 1.16k]
  ------------------
29874|     33|                    peg_panicf(b, "expected non-negative integer, got %d", n);
  ------------------
  |  |29181|     33|#define peg_panicf(b,...) peg_panic((b), (const char *) janet_formatc(__VA_ARGS__))
  ------------------
29875|     33|                }
29876|  1.16k|                spec_repeat(b, len, tup);
29877|  1.16k|                break;
29878|  1.19k|            }
29879|  12.8k|            if (!janet_checktype(tup[0], JANET_SYMBOL))
  ------------------
  |  |  806|  12.8k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 12.8k]
  |  |  ------------------
  |  |  807|  12.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|  12.8k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  12.8k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  12.8k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  12.8k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  12.8k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (29879:17): [True: 121, False: 12.7k]
  ------------------
29880|    121|                peg_panicf(b, "expected grammar command, found %v", tup[0]);
  ------------------
  |  |29181|    121|#define peg_panicf(b,...) peg_panic((b), (const char *) janet_formatc(__VA_ARGS__))
  ------------------
29881|  12.7k|            const uint8_t *sym = janet_unwrap_symbol(tup[0]);
  ------------------
  |  |  864|  12.7k|#define janet_unwrap_symbol(x) ((JanetSymbol)janet_nanbox_to_pointer(x))
  ------------------
29882|  12.7k|            const SpecialPair *sp = janet_strbinsearch(
29883|  12.7k|                                        &peg_specials,
29884|  12.7k|                                        sizeof(peg_specials) / sizeof(SpecialPair),
29885|  12.7k|                                        sizeof(SpecialPair),
29886|  12.7k|                                        sym);
29887|  12.7k|            if (sp) {
  ------------------
  |  Branch (29887:17): [True: 12.3k, False: 416]
  ------------------
29888|  12.3k|                sp->special(b, len - 1, tup + 1);
29889|  12.3k|            } else {
29890|    416|                peg_panicf(b, "unknown special %S", sym);
  ------------------
  |  |29181|    416|#define peg_panicf(b,...) peg_panic((b), (const char *) janet_formatc(__VA_ARGS__))
  ------------------
29891|    416|            }
29892|  12.3k|            break;
29893|  12.7k|        }
29894|  18.7k|    }
29895|       |
29896|       |    /* Increase depth again */
29897|  14.5k|    b->depth++;
29898|  14.5k|    b->form = old_form;
29899|  14.5k|    b->grammar = old_grammar;
29900|  14.5k|    return rule;
29901|  18.7k|}
janet.c:peg_panic:
29176|  2.31k|JANET_NO_RETURN static void peg_panic(Builder *b, const char *msg) {
29177|  2.31k|    builder_cleanup(b);
29178|  2.31k|    janet_panicf("grammar error in %p, %s", b->form, msg);
29179|  2.31k|}
janet.c:reserve:
29267|  14.8k|static Reserve reserve(Builder *b, int32_t size) {
29268|  14.8k|    Reserve r;
29269|  14.8k|    r.index = janet_v_count(b->bytecode);
  ------------------
  |  |  759|  14.8k|#define janet_v_count(v)        (((v) != NULL) ? janet_v__cnt(v) : 0)
  |  |  ------------------
  |  |  |  |  766|  12.8k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  764|  12.8k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (759:34): [True: 12.8k, False: 1.98k]
  |  |  ------------------
  ------------------
29270|  14.8k|    r.builder = b;
29271|  14.8k|    r.size = size;
29272|  57.8k|    for (int32_t i = 0; i < size; i++)
  ------------------
  |  Branch (29272:25): [True: 43.0k, False: 14.8k]
  ------------------
29273|       |        janet_v_push(b->bytecode, 0);
  ------------------
  |  |  757|  43.0k|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  769|  43.0k|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  768|  43.0k|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  766|  41.0k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|  41.0k|#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))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  765|  41.0k|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|  41.0k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (768:35): [True: 1.98k, False: 41.0k]
  |  |  |  |  |  |  |  Branch (768:50): [True: 7.28k, False: 33.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  770|  9.27k|#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))
  |  |  ------------------
  |  |  |  |  766|  43.0k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  764|  43.0k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29274|  14.8k|    return r;
29275|  14.8k|}
janet.c:emit_1:
29296|  2.55k|static void emit_1(Reserve r, uint32_t op, uint32_t arg) {
29297|  2.55k|    emit_rule(r, op, 1, &arg);
29298|  2.55k|}
janet.c:emit_rule:
29278|  12.8k|static void emit_rule(Reserve r, int32_t op, int32_t n, const uint32_t *body) {
29279|  12.8k|    janet_assert(r.size == n + 1, "bad reserve");
  ------------------
  |  |  389|  12.8k|#define janet_assert(c, m) do { \
  |  |  390|  12.8k|    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: 12.8k]
  |  |  ------------------
  |  |  391|  12.8k|} while (0)
  |  |  ------------------
  |  |  |  Branch (391:10): [Folded, False: 12.8k]
  |  |  ------------------
  ------------------
29280|  12.8k|    r.builder->bytecode[r.index] = op;
29281|  12.8k|    memcpy(r.builder->bytecode + r.index + 1, body, n * sizeof(uint32_t));
29282|  12.8k|}
janet.c:peg_getinteger:
29217|  3.97k|static int32_t peg_getinteger(Builder *b, Janet x) {
29218|  3.97k|    if (!janet_checkint(x))
  ------------------
  |  Branch (29218:9): [True: 438, False: 3.53k]
  ------------------
29219|    438|        peg_panicf(b, "expected integer, got %v", x);
  ------------------
  |  |29181|    438|#define peg_panicf(b,...) peg_panic((b), (const char *) janet_formatc(__VA_ARGS__))
  ------------------
29220|  3.53k|    return janet_unwrap_integer(x);
  ------------------
  |  |  966|  3.53k|#define janet_unwrap_integer(x) ((int32_t) janet_unwrap_number(x))
  |  |  ------------------
  |  |  |  |  839|  3.53k|#define janet_unwrap_number(x) ((x).number)
  |  |  ------------------
  ------------------
29221|  3.97k|}
janet.c:emit_bytes:
29285|  1.03k|static void emit_bytes(Builder *b, uint32_t op, int32_t len, const uint8_t *bytes) {
29286|  1.03k|    uint32_t next_rule = janet_v_count(b->bytecode);
  ------------------
  |  |  759|  1.03k|#define janet_v_count(v)        (((v) != NULL) ? janet_v__cnt(v) : 0)
  |  |  ------------------
  |  |  |  |  766|    859|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  764|    859|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (759:34): [True: 859, False: 180]
  |  |  ------------------
  ------------------
29287|  1.03k|    janet_v_push(b->bytecode, op);
  ------------------
  |  |  757|  1.03k|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  769|  1.03k|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  768|  1.03k|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  766|    859|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|    859|#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))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  765|    859|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|    859|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (768:35): [True: 180, False: 859]
  |  |  |  |  |  |  |  Branch (768:50): [True: 90, False: 769]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  770|    270|#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))
  |  |  ------------------
  |  |  |  |  766|  1.03k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  764|  1.03k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29288|  1.03k|    janet_v_push(b->bytecode, len);
  ------------------
  |  |  757|  1.03k|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  769|  1.03k|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  768|  1.03k|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  766|  1.03k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|  1.03k|#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))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  765|  1.03k|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|  1.03k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (768:35): [True: 0, False: 1.03k]
  |  |  |  |  |  |  |  Branch (768:50): [True: 246, False: 793]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  770|    246|#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))
  |  |  ------------------
  |  |  |  |  766|  1.03k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  764|  1.03k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29289|  1.03k|    int32_t words = ((len + 3) >> 2);
29290|  2.42k|    for (int32_t i = 0; i < words; i++)
  ------------------
  |  Branch (29290:25): [True: 1.38k, False: 1.03k]
  ------------------
29291|       |        janet_v_push(b->bytecode, 0);
  ------------------
  |  |  757|  1.38k|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  769|  1.38k|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  768|  1.38k|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  766|  1.38k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|  1.38k|#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))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  765|  1.38k|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|  1.38k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (768:35): [True: 0, False: 1.38k]
  |  |  |  |  |  |  |  Branch (768:50): [True: 281, False: 1.10k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  770|    281|#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))
  |  |  ------------------
  |  |  |  |  766|  1.38k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  764|  1.38k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29292|  1.03k|    memcpy(b->bytecode + next_rule + 2, bytes, len);
29293|  1.03k|}
janet.c:spec_repeat:
29440|  1.21k|static void spec_repeat(Builder *b, int32_t argc, const Janet *argv) {
29441|  1.21k|    peg_fixarity(b, argc, 2);
29442|  1.21k|    Reserve r = reserve(b, 4);
29443|  1.21k|    int32_t n = peg_getnat(b, argv[0]);
29444|  1.21k|    uint32_t subrule = peg_compile1(b, argv[1]);
29445|  1.21k|    emit_3(r, RULE_BETWEEN, n, n, subrule);
29446|  1.21k|}
janet.c:peg_fixarity:
29183|  1.77k|static void peg_fixarity(Builder *b, int32_t argc, int32_t arity) {
29184|  1.77k|    if (argc != arity) {
  ------------------
  |  Branch (29184:9): [True: 52, False: 1.72k]
  ------------------
29185|     52|        peg_panicf(b, "expected %d argument%s, got %d",
  ------------------
  |  |29181|    104|#define peg_panicf(b,...) peg_panic((b), (const char *) janet_formatc(__VA_ARGS__))
  |  |  ------------------
  |  |  |  Branch (29181:71): [True: 20, False: 32]
  |  |  ------------------
  ------------------
29186|     52|                   arity,
29187|     52|                   arity == 1 ? "" : "s",
29188|     52|                   argc);
29189|     52|    }
29190|  1.77k|}
janet.c:peg_getnat:
29223|  1.31k|static int32_t peg_getnat(Builder *b, Janet x) {
29224|  1.31k|    int32_t i = peg_getinteger(b, x);
29225|  1.31k|    if (i < 0)
  ------------------
  |  Branch (29225:9): [True: 65, False: 1.25k]
  ------------------
29226|     65|        peg_panicf(b, "expected non-negative integer, got %v", x);
  ------------------
  |  |29181|     65|#define peg_panicf(b,...) peg_panic((b), (const char *) janet_formatc(__VA_ARGS__))
  ------------------
29227|  1.25k|    return i;
29228|  1.31k|}
janet.c:emit_3:
29303|  1.54k|static void emit_3(Reserve r, uint32_t op, uint32_t arg1, uint32_t arg2, uint32_t arg3) {
29304|  1.54k|    uint32_t arr[3] = {arg1, arg2, arg3};
29305|  1.54k|    emit_rule(r, op, 3, arr);
29306|  1.54k|}
janet.c:spec_not:
29456|     67|static void spec_not(Builder *b, int32_t argc, const Janet *argv) {
29457|     67|    spec_onerule(b, argc, argv, RULE_NOT);
29458|     67|}
janet.c:spec_onerule:
29449|    149|static void spec_onerule(Builder *b, int32_t argc, const Janet *argv, uint32_t op) {
29450|    149|    peg_fixarity(b, argc, 1);
29451|    149|    Reserve r = reserve(b, 2);
29452|    149|    uint32_t rule = peg_compile1(b, argv[0]);
29453|    149|    emit_1(r, op, rule);
29454|    149|}
janet.c:spec_position:
29548|     56|static void spec_position(Builder *b, int32_t argc, const Janet *argv) {
29549|     56|    spec_tag1(b, argc, argv, RULE_POSITION);
29550|     56|}
janet.c:spec_tag1:
29540|    158|static void spec_tag1(Builder *b, int32_t argc, const Janet *argv, uint32_t op) {
29541|    158|    peg_arity(b, argc, 0, 1);
29542|    158|    Reserve r = reserve(b, 2);
29543|    158|    uint32_t tag = (argc) ? emit_tag(b, argv[0]) : 0;
  ------------------
  |  Branch (29543:20): [True: 13, False: 145]
  ------------------
29544|    158|    (void) argv;
29545|    158|    emit_1(r, op, tag);
29546|    158|}
janet.c:peg_arity:
29192|  10.8k|static void peg_arity(Builder *b, int32_t arity, int32_t min, int32_t max) {
29193|  10.8k|    if (min >= 0 && arity < min)
  ------------------
  |  Branch (29193:9): [True: 10.8k, False: 0]
  |  Branch (29193:21): [True: 24, False: 10.8k]
  ------------------
29194|     24|        peg_panicf(b, "arity mismatch, expected at least %d, got %d", min, arity);
  ------------------
  |  |29181|     24|#define peg_panicf(b,...) peg_panic((b), (const char *) janet_formatc(__VA_ARGS__))
  ------------------
29195|  10.8k|    if (max >= 0 && arity > max)
  ------------------
  |  Branch (29195:9): [True: 10.7k, False: 73]
  |  Branch (29195:21): [True: 22, False: 10.7k]
  ------------------
29196|     22|        peg_panicf(b, "arity mismatch, expected at most %d, got %d", max, arity);
  ------------------
  |  |29181|     22|#define peg_panicf(b,...) peg_panic((b), (const char *) janet_formatc(__VA_ARGS__))
  ------------------
29197|  10.8k|}
janet.c:emit_tag:
29240|    240|static uint32_t emit_tag(Builder *b, Janet t) {
29241|    240|    if (!janet_checktype(t, JANET_KEYWORD))
  ------------------
  |  |  806|    240|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 240]
  |  |  ------------------
  |  |  807|    240|        ? 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|    240|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|    240|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|    240|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|    240|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|    240|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (29241:9): [True: 28, False: 212]
  ------------------
29242|     28|        peg_panicf(b, "expected keyword for capture tag, got %v", t);
  ------------------
  |  |29181|     28|#define peg_panicf(b,...) peg_panic((b), (const char *) janet_formatc(__VA_ARGS__))
  ------------------
29243|    212|    Janet check = janet_table_get(b->tags, t);
29244|    212|    if (janet_checktype(check, JANET_NIL)) {
  ------------------
  |  |  806|    212|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 155, False: 57]
  |  |  |  Branch (806:6): [Folded, False: 212]
  |  |  ------------------
  |  |  807|    212|        ? 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|    212|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|    212|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|    212|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|    212|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|    212|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29245|    155|        uint32_t tag = b->nexttag++;
29246|    155|        if (tag > 255) {
  ------------------
  |  Branch (29246:13): [True: 0, False: 155]
  ------------------
29247|      0|            peg_panic(b, "too many tags - up to 255 tags are supported per peg");
29248|      0|        }
29249|    155|        Janet val = janet_wrap_number(tag);
  ------------------
  |  |  835|    155|#define janet_wrap_number(r) janet_nanbox_from_double(r)
  ------------------
29250|    155|        janet_table_put(b->tags, t, val);
29251|    155|        return tag;
29252|    155|    } else {
29253|     57|        return (uint32_t) janet_unwrap_number(check);
  ------------------
  |  |  839|     57|#define janet_unwrap_number(x) ((x).number)
  ------------------
29254|     57|    }
29255|    212|}
janet.c:spec_accumulate:
29493|    182|static void spec_accumulate(Builder *b, int32_t argc, const Janet *argv) {
29494|    182|    spec_cap1(b, argc, argv, RULE_ACCUMULATE);
29495|    182|}
janet.c:spec_cap1:
29482|  9.48k|static void spec_cap1(Builder *b, int32_t argc, const Janet *argv, uint32_t op) {
29483|  9.48k|    peg_arity(b, argc, 1, 2);
29484|  9.48k|    Reserve r = reserve(b, 3);
29485|  9.48k|    uint32_t tag = (argc == 2) ? emit_tag(b, argv[1]) : 0;
  ------------------
  |  Branch (29485:20): [True: 37, False: 9.45k]
  ------------------
29486|  9.48k|    uint32_t rule = peg_compile1(b, argv[0]);
29487|  9.48k|    emit_2(r, op, rule, tag);
29488|  9.48k|}
janet.c:emit_2:
29299|  8.26k|static void emit_2(Reserve r, uint32_t op, uint32_t arg1, uint32_t arg2) {
29300|  8.26k|    uint32_t arr[2] = {arg1, arg2};
29301|  8.26k|    emit_rule(r, op, 2, arr);
29302|  8.26k|}
janet.c:spec_sequence:
29371|    474|static void spec_sequence(Builder *b, int32_t argc, const Janet *argv) {
29372|    474|    spec_variadic(b, argc, argv, RULE_SEQUENCE);
29373|    474|}
janet.c:spec_variadic:
29356|    785|static void spec_variadic(Builder *b, int32_t argc, const Janet *argv, uint32_t op) {
29357|    785|    uint32_t rule = janet_v_count(b->bytecode);
  ------------------
  |  |  759|    785|#define janet_v_count(v)        (((v) != NULL) ? janet_v__cnt(v) : 0)
  |  |  ------------------
  |  |  |  |  766|    653|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  764|    653|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (759:34): [True: 653, False: 132]
  |  |  ------------------
  ------------------
29358|    785|    janet_v_push(b->bytecode, op);
  ------------------
  |  |  757|    785|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  769|    785|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  768|    785|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  766|    653|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|    653|#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))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  765|    653|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|    653|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (768:35): [True: 132, False: 653]
  |  |  |  |  |  |  |  Branch (768:50): [True: 155, False: 498]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  770|    287|#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))
  |  |  ------------------
  |  |  |  |  766|    785|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  764|    785|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29359|    785|    janet_v_push(b->bytecode, argc);
  ------------------
  |  |  757|    785|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  769|    785|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  768|    785|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  766|    785|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|    785|#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))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  765|    785|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|    785|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (768:35): [True: 0, False: 785]
  |  |  |  |  |  |  |  Branch (768:50): [True: 173, False: 612]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  770|    173|#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))
  |  |  ------------------
  |  |  |  |  766|    785|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  764|    785|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29360|  4.76k|    for (int32_t i = 0; i < argc; i++)
  ------------------
  |  Branch (29360:25): [True: 3.98k, False: 785]
  ------------------
29361|  3.98k|        janet_v_push(b->bytecode, 0);
  ------------------
  |  |  757|  3.98k|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  769|  3.98k|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  768|  3.98k|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  766|  3.98k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|  3.98k|#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))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  765|  3.98k|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|  3.98k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (768:35): [True: 0, False: 3.98k]
  |  |  |  |  |  |  |  Branch (768:50): [True: 625, False: 3.35k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  770|    625|#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))
  |  |  ------------------
  |  |  |  |  766|  3.98k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  764|  3.98k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29362|  4.65k|    for (int32_t i = 0; i < argc; i++) {
  ------------------
  |  Branch (29362:25): [True: 3.87k, False: 785]
  ------------------
29363|  3.87k|        uint32_t rulei = peg_compile1(b, argv[i]);
29364|  3.87k|        b->bytecode[rule + 2 + i] = rulei;
29365|  3.87k|    }
29366|    785|}
janet.c:spec_choice:
29368|    311|static void spec_choice(Builder *b, int32_t argc, const Janet *argv) {
29369|    311|    spec_variadic(b, argc, argv, RULE_CHOICE);
29370|    311|}
janet.c:spec_reference:
29531|     91|static void spec_reference(Builder *b, int32_t argc, const Janet *argv) {
29532|     91|    peg_arity(b, argc, 1, 2);
29533|     91|    Reserve r = reserve(b, 3);
29534|     91|    uint32_t search = emit_tag(b, argv[0]);
29535|     91|    uint32_t tag = (argc == 2) ? emit_tag(b, argv[1]) : 0;
  ------------------
  |  Branch (29535:20): [True: 63, False: 28]
  ------------------
29536|     91|    b->has_backref = 1;
29537|     91|    emit_2(r, RULE_GETTAG, search, tag);
29538|     91|}
janet.c:spec_replace:
29586|    383|static void spec_replace(Builder *b, int32_t argc, const Janet *argv) {
29587|    383|    peg_arity(b, argc, 2, 3);
29588|    383|    Reserve r = reserve(b, 4);
29589|    383|    uint32_t subrule = peg_compile1(b, argv[0]);
29590|    383|    uint32_t constant = emit_constant(b, argv[1]);
29591|    383|    uint32_t tag = (argc == 3) ? emit_tag(b, argv[2]) : 0;
  ------------------
  |  Branch (29591:20): [True: 36, False: 347]
  ------------------
29592|    383|    emit_3(r, RULE_REPLACE, subrule, constant, tag);
29593|    383|}
janet.c:emit_constant:
29234|    363|static uint32_t emit_constant(Builder *b, Janet c) {
29235|    363|    uint32_t cindex = (uint32_t) janet_v_count(b->constants);
  ------------------
  |  |  759|    363|#define janet_v_count(v)        (((v) != NULL) ? janet_v__cnt(v) : 0)
  |  |  ------------------
  |  |  |  |  766|     28|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  764|     28|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (759:34): [True: 28, False: 335]
  |  |  ------------------
  ------------------
29236|       |    janet_v_push(b->constants, c);
  ------------------
  |  |  757|    363|#define janet_v_push(v, x)      (janet_v__maybegrow(v, 1), (v)[janet_v__cnt(v)++] = (x))
  |  |  ------------------
  |  |  |  |  769|    363|#define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  768|    363|#define janet_v__needgrow(v, n)  ((v) == NULL || janet_v__cnt(v) + (n) >= janet_v__cap(v))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  766|     28|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|     28|#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))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  765|     28|#define janet_v__cap(v) janet_v__raw(v)[0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  764|     28|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (768:35): [True: 335, False: 28]
  |  |  |  |  |  |  |  Branch (768:50): [True: 26, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define janet_v__maybegrow(v, n) (janet_v__needgrow((v), (n)) ? janet_v__grow((v), (n)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  770|    361|#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))
  |  |  ------------------
  |  |  |  |  766|    363|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  764|    363|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29237|    363|    return cindex;
29238|    363|}
janet.c:spec_capture:
29490|  9.30k|static void spec_capture(Builder *b, int32_t argc, const Janet *argv) {
29491|  9.30k|    spec_cap1(b, argc, argv, RULE_CAPTURE);
29492|  9.30k|}
janet.c:spec_look:
29346|    108|static void spec_look(Builder *b, int32_t argc, const Janet *argv) {
29347|    108|    peg_arity(b, argc, 1, 2);
29348|    108|    Reserve r = reserve(b, 3);
29349|    108|    int32_t rulearg = argc == 2 ? 1 : 0;
  ------------------
  |  Branch (29349:23): [True: 45, False: 63]
  ------------------
29350|    108|    int32_t offset = argc == 2 ? peg_getinteger(b, argv[0]) : 0;
  ------------------
  |  Branch (29350:22): [True: 45, False: 63]
  ------------------
29351|    108|    uint32_t subrule = peg_compile1(b, argv[rulearg]);
29352|    108|    emit_2(r, RULE_LOOK, (uint32_t) offset, subrule);
29353|    108|}
janet.c:spec_opt:
29433|     98|static void spec_opt(Builder *b, int32_t argc, const Janet *argv) {
29434|     98|    peg_fixarity(b, argc, 1);
29435|     98|    Reserve r = reserve(b, 4);
29436|     98|    uint32_t subrule = peg_compile1(b, argv[0]);
29437|     98|    emit_3(r, RULE_BETWEEN, 0, 1, subrule);
29438|     98|}
janet.c:spec_debug:
29578|    430|static void spec_debug(Builder *b, int32_t argc, const Janet *argv) {
29579|    430|    peg_arity(b, argc, 0, 0);
29580|    430|    Reserve r = reserve(b, 1);
29581|    430|    uint32_t empty = 0;
29582|    430|    (void) argv;
29583|    430|    emit_rule(r, RULE_DEBUG, 0, &empty);
29584|    430|}
janet.c:spec_matchtime_splice:
29613|      6|static void spec_matchtime_splice(Builder *b, int32_t argc, const Janet *argv) {
29614|      6|    spec_matchtime_impl(b, argc, argv, RULE_MATCHSPLICE);
29615|      6|}
janet.c:spec_matchtime_impl:
29595|     28|static void spec_matchtime_impl(Builder *b, int32_t argc, const Janet *argv, uint32_t op) {
29596|     28|    peg_arity(b, argc, 2, 3);
29597|     28|    Reserve r = reserve(b, 4);
29598|     28|    uint32_t subrule = peg_compile1(b, argv[0]);
29599|     28|    Janet fun = argv[1];
29600|     28|    if (!janet_checktype(fun, JANET_FUNCTION) &&
  ------------------
  |  |  806|     56|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 28]
  |  |  ------------------
  |  |  807|     56|        ? 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|     56|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|     28|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|     28|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|     28|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|     28|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (29600:9): [True: 2, False: 26]
  ------------------
29601|      2|            !janet_checktype(fun, JANET_CFUNCTION)) {
  ------------------
  |  |  806|      2|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 2]
  |  |  ------------------
  |  |  807|      2|        ? 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|      2|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|      2|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|      2|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|      2|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|      2|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (29601:13): [True: 2, False: 0]
  ------------------
29602|      2|        peg_panicf(b, "expected function or cfunction, got %v", fun);
  ------------------
  |  |29181|      2|#define peg_panicf(b,...) peg_panic((b), (const char *) janet_formatc(__VA_ARGS__))
  ------------------
29603|      2|    }
29604|     26|    uint32_t tag = (argc == 3) ? emit_tag(b, argv[2]) : 0;
  ------------------
  |  Branch (29604:20): [True: 0, False: 26]
  ------------------
29605|     26|    uint32_t cindex = emit_constant(b, fun);
29606|     26|    emit_3(r, op, subrule, cindex, tag);
29607|     26|}
janet.c:spec_matchtime:
29609|     22|static void spec_matchtime(Builder *b, int32_t argc, const Janet *argv) {
29610|     22|    spec_matchtime_impl(b, argc, argv, RULE_MATCHTIME);
29611|     22|}
janet.c:spec_column:
29554|      3|static void spec_column(Builder *b, int32_t argc, const Janet *argv) {
29555|      3|    spec_tag1(b, argc, argv, RULE_COLUMN);
29556|      3|}
janet.c:spec_error:
29459|     72|static void spec_error(Builder *b, int32_t argc, const Janet *argv) {
29460|     72|    if (argc == 0) {
  ------------------
  |  Branch (29460:9): [True: 55, False: 17]
  ------------------
29461|     55|        Reserve r = reserve(b, 2);
29462|     55|        uint32_t rule = peg_compile1(b, janet_wrap_number(0));
  ------------------
  |  |  835|     55|#define janet_wrap_number(r) janet_nanbox_from_double(r)
  ------------------
29463|     55|        emit_1(r, RULE_ERROR, rule);
29464|     55|    } else {
29465|     17|        spec_onerule(b, argc, argv, RULE_ERROR);
29466|     17|    }
29467|     72|}
janet.c:spec_if:
29384|     39|static void spec_if(Builder *b, int32_t argc, const Janet *argv) {
29385|     39|    spec_branch(b, argc, argv, RULE_IF);
29386|     39|}
janet.c:spec_branch:
29376|     39|static void spec_branch(Builder *b, int32_t argc, const Janet *argv, uint32_t rule) {
29377|     39|    peg_fixarity(b, argc, 2);
29378|     39|    Reserve r = reserve(b, 3);
29379|     39|    uint32_t rule_a = peg_compile1(b, argv[0]);
29380|     39|    uint32_t rule_b = peg_compile1(b, argv[1]);
29381|     39|    emit_2(r, rule, rule_a, rule_b);
29382|     39|}
janet.c:spec_int_le:
29661|     75|static void spec_int_le(Builder *b, int32_t argc, const Janet *argv) {
29662|     75|    spec_readint(b, argc, argv, 0x10u);
29663|     75|}
janet.c:spec_readint:
29647|    135|static void spec_readint(Builder *b, int32_t argc, const Janet *argv, uint32_t mask) {
29648|    135|    peg_arity(b, argc, 1, 2);
29649|    135|    Reserve r = reserve(b, 3);
29650|    135|    uint32_t tag = (argc == 2) ? emit_tag(b, argv[1]) : 0;
  ------------------
  |  Branch (29650:20): [True: 3, False: 132]
  ------------------
29651|    135|    int32_t width = peg_getnat(b, argv[0]);
29652|    135|    if ((width < 0) || (width > JANET_MAX_READINT_WIDTH)) {
  ------------------
  |  |29642|     92|#define JANET_MAX_READINT_WIDTH 8
  ------------------
  |  Branch (29652:9): [True: 43, False: 92]
  |  Branch (29652:24): [True: 25, False: 67]
  ------------------
29653|     25|        peg_panicf(b, "width must be between 0 and %d, got %d", JANET_MAX_READINT_WIDTH, width);
  ------------------
  |  |29181|     25|#define peg_panicf(b,...) peg_panic((b), (const char *) janet_formatc(__VA_ARGS__))
  ------------------
29654|     25|    }
29655|    110|    emit_2(r, RULE_READINT, mask | ((uint32_t) width), tag);
29656|    110|}
janet.c:spec_line:
29551|     99|static void spec_line(Builder *b, int32_t argc, const Janet *argv) {
29552|     99|    spec_tag1(b, argc, argv, RULE_LINE);
29553|     99|}
janet.c:spec_range:
29316|     74|static void spec_range(Builder *b, int32_t argc, const Janet *argv) {
29317|     74|    peg_arity(b, argc, 1, -1);
29318|     74|    if (argc == 1) {
  ------------------
  |  Branch (29318:9): [True: 46, False: 28]
  ------------------
29319|     46|        Reserve r = reserve(b, 2);
29320|     46|        const uint8_t *str = peg_getrange(b, argv[0]);
29321|     46|        uint32_t arg = str[0] | (str[1] << 16);
29322|     46|        emit_1(r, RULE_RANGE, arg);
29323|     46|    } else {
29324|       |        /* Compile as a set */
29325|     28|        Reserve r = reserve(b, 9);
29326|     28|        uint32_t bitmap[8] = {0};
29327|     82|        for (int32_t i = 0; i < argc; i++) {
  ------------------
  |  Branch (29327:29): [True: 54, False: 28]
  ------------------
29328|     54|            const uint8_t *str = peg_getrange(b, argv[i]);
29329|  2.26k|            for (uint32_t c = str[0]; c <= str[1]; c++)
  ------------------
  |  Branch (29329:39): [True: 2.20k, False: 54]
  ------------------
29330|  2.20k|                bitmap_set(bitmap, c);
29331|     54|        }
29332|     28|        emit_rule(r, RULE_SET, 8, bitmap);
29333|     28|    }
29334|     74|}
janet.c:peg_getrange:
29206|    100|static const uint8_t *peg_getrange(Builder *b, Janet x) {
29207|    100|    if (!janet_checktype(x, JANET_STRING))
  ------------------
  |  |  806|    100|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 100]
  |  |  ------------------
  |  |  807|    100|        ? 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|    100|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|    100|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|    100|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|    100|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|    100|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (29207:9): [True: 32, False: 68]
  ------------------
29208|     32|        peg_panic(b, "expected string for character range");
29209|     68|    const uint8_t *str = janet_unwrap_string(x);
  ------------------
  |  |  863|     68|#define janet_unwrap_string(x) ((JanetString)janet_nanbox_to_pointer(x))
  ------------------
29210|     68|    if (janet_string_length(str) != 2)
  ------------------
  |  | 1813|     68|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  ------------------
  |  |  |  | 1812|     68|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (29210:9): [True: 14, False: 54]
  ------------------
29211|     14|        peg_panicf(b, "expected string to have length 2, got %v", x);
  ------------------
  |  |29181|     14|#define peg_panicf(b,...) peg_panic((b), (const char *) janet_formatc(__VA_ARGS__))
  ------------------
29212|     54|    if (str[1] < str[0])
  ------------------
  |  Branch (29212:9): [True: 3, False: 51]
  ------------------
29213|      3|        peg_panicf(b, "range %v is empty", x);
  ------------------
  |  |29181|      3|#define peg_panicf(b,...) peg_panic((b), (const char *) janet_formatc(__VA_ARGS__))
  ------------------
29214|     51|    return str;
29215|     54|}
janet.c:bitmap_set:
29312|  2.47k|static void bitmap_set(uint32_t *bitmap, uint8_t c) {
29313|  2.47k|    bitmap[c >> 5] |= ((uint32_t)1) << (c & 0x1F);
29314|  2.47k|}
janet.c:spec_set:
29336|     21|static void spec_set(Builder *b, int32_t argc, const Janet *argv) {
29337|     21|    peg_fixarity(b, argc, 1);
29338|     21|    Reserve r = reserve(b, 9);
29339|     21|    const uint8_t *str = peg_getset(b, argv[0]);
29340|     21|    uint32_t bitmap[8] = {0};
29341|    289|    for (int32_t i = 0; i < janet_string_length(str); i++)
  ------------------
  |  | 1813|    289|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  ------------------
  |  |  |  | 1812|    289|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (29341:25): [True: 268, False: 21]
  ------------------
29342|    268|        bitmap_set(bitmap, str[i]);
29343|     21|    emit_rule(r, RULE_SET, 8, bitmap);
29344|     21|}
janet.c:peg_getset:
29199|     20|static const uint8_t *peg_getset(Builder *b, Janet x) {
29200|     20|    if (!janet_checktype(x, JANET_STRING))
  ------------------
  |  |  806|     20|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 20]
  |  |  ------------------
  |  |  807|     20|        ? 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|     20|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|     20|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|     20|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|     20|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|     20|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (29200:9): [True: 7, False: 13]
  ------------------
29201|      7|        peg_panic(b, "expected string for character set");
29202|     13|    const uint8_t *str = janet_unwrap_string(x);
  ------------------
  |  |  863|     13|#define janet_unwrap_string(x) ((JanetString)janet_nanbox_to_pointer(x))
  ------------------
29203|     13|    return str;
29204|     20|}
janet.c:spec_til:
29625|    254|static void spec_til(Builder *b, int32_t argc, const Janet *argv) {
29626|    254|    peg_fixarity(b, argc, 2);
29627|    254|    Reserve r = reserve(b, 3);
29628|    254|    uint32_t subrule1 = peg_compile1(b, argv[0]);
29629|    254|    uint32_t subrule2 = peg_compile1(b, argv[1]);
29630|    254|    emit_2(r, RULE_TIL, subrule1, subrule2);
29631|    254|}
janet.c:spec_to:
29468|     65|static void spec_to(Builder *b, int32_t argc, const Janet *argv) {
29469|     65|    spec_onerule(b, argc, argv, RULE_TO);
29470|     65|}
janet.c:spec_uint_le:
29658|     60|static void spec_uint_le(Builder *b, int32_t argc, const Janet *argv) {
29659|     60|    spec_readint(b, argc, argv, 0x0u);
29660|     60|}
janet.c:make_peg:
30187|  1.89k|static JanetPeg *make_peg(Builder *b) {
30188|  1.89k|    size_t bytecode_start = size_padded(sizeof(JanetPeg), sizeof(uint32_t));
30189|  1.89k|    size_t bytecode_size = janet_v_count(b->bytecode) * sizeof(uint32_t);
  ------------------
  |  |  759|  1.89k|#define janet_v_count(v)        (((v) != NULL) ? janet_v__cnt(v) : 0)
  |  |  ------------------
  |  |  |  |  766|  1.89k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  764|  1.89k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (759:34): [True: 1.89k, False: 0]
  |  |  ------------------
  ------------------
30190|  1.89k|    size_t constants_start = size_padded(bytecode_start + bytecode_size, sizeof(Janet));
30191|  1.89k|    size_t constants_size = janet_v_count(b->constants) * sizeof(Janet);
  ------------------
  |  |  759|  1.89k|#define janet_v_count(v)        (((v) != NULL) ? janet_v__cnt(v) : 0)
  |  |  ------------------
  |  |  |  |  766|    329|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  764|    329|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (759:34): [True: 329, False: 1.56k]
  |  |  ------------------
  ------------------
30192|  1.89k|    size_t total_size = constants_start + constants_size;
30193|  1.89k|    char *mem = janet_abstract(&janet_peg_type, total_size);
30194|  1.89k|    JanetPeg *peg = (JanetPeg *)mem;
30195|  1.89k|    peg->bytecode = (uint32_t *)(mem + bytecode_start);
30196|  1.89k|    peg->constants = (Janet *)(mem + constants_start);
30197|  1.89k|    peg->num_constants = janet_v_count(b->constants);
  ------------------
  |  |  759|  1.89k|#define janet_v_count(v)        (((v) != NULL) ? janet_v__cnt(v) : 0)
  |  |  ------------------
  |  |  |  |  766|    329|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  764|    329|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (759:34): [True: 329, False: 1.56k]
  |  |  ------------------
  ------------------
30198|  1.89k|    safe_memcpy(peg->bytecode, b->bytecode, bytecode_size);
30199|  1.89k|    safe_memcpy(peg->constants, b->constants, constants_size);
30200|       |    peg->bytecode_len = janet_v_count(b->bytecode);
  ------------------
  |  |  759|  1.89k|#define janet_v_count(v)        (((v) != NULL) ? janet_v__cnt(v) : 0)
  |  |  ------------------
  |  |  |  |  766|  1.89k|#define janet_v__cnt(v) janet_v__raw(v)[1]
  |  |  |  |  ------------------
  |  |  |  |  |  |  764|  1.89k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (759:34): [True: 1.89k, False: 0]
  |  |  ------------------
  ------------------
30201|  1.89k|    peg->has_backref = b->has_backref;
30202|  1.89k|    return peg;
30203|  1.89k|}
janet.c:builder_cleanup:
29171|  4.20k|static void builder_cleanup(Builder *b) {
29172|  4.20k|    janet_v_free(b->constants);
  ------------------
  |  |  756|  4.20k|#define janet_v_free(v)         (((v) != NULL) ? (janet_sfree(janet_v__raw(v)), 0) : 0)
  |  |  ------------------
  |  |  |  |  764|    335|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  ------------------
  |  |  |  Branch (756:34): [True: 335, False: 3.87k]
  |  |  ------------------
  ------------------
29173|       |    janet_v_free(b->bytecode);
  ------------------
  |  |  756|  4.20k|#define janet_v_free(v)         (((v) != NULL) ? (janet_sfree(janet_v__raw(v)), 0) : 0)
  |  |  ------------------
  |  |  |  |  764|  2.30k|#define janet_v__raw(v) ((int32_t *)(v) - 2)
  |  |  ------------------
  |  |  |  Branch (756:34): [True: 2.30k, False: 1.90k]
  |  |  ------------------
  ------------------
29174|  4.20k|}
janet.c:peg_cfun_init:
30253|  4.20k|static PegCall peg_cfun_init(int32_t argc, Janet *argv, int get_replace) {
30254|  4.20k|    PegCall ret;
30255|  4.20k|    int32_t min = get_replace ? 3 : 2;
  ------------------
  |  Branch (30255:19): [True: 0, False: 4.20k]
  ------------------
30256|  4.20k|    janet_arity(argc, min, -1);
30257|  4.20k|    if (janet_checktype(argv[0], JANET_ABSTRACT) &&
  ------------------
  |  |  806|  8.41k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 130, False: 4.07k]
  |  |  |  Branch (806:6): [Folded, False: 4.20k]
  |  |  ------------------
  |  |  807|  8.41k|        ? 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.41k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  4.20k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  4.20k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  4.20k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  4.20k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
30258|    130|            janet_abstract_type(janet_unwrap_abstract(argv[0])) == &janet_peg_type) {
  ------------------
  |  | 1899|    130|#define janet_abstract_type(u) (janet_abstract_head(u)->type)
  |  |  ------------------
  |  |  |  | 1897|    130|#define janet_abstract_head(u) ((JanetAbstractHead *)((char *)u - offsetof(JanetAbstractHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (30258:13): [True: 0, False: 130]
  ------------------
30259|      0|        ret.peg = janet_unwrap_abstract(argv[0]);
  ------------------
  |  |  866|      0|#define janet_unwrap_abstract(x) (janet_nanbox_to_pointer(x))
  ------------------
30260|  4.20k|    } else {
30261|  4.20k|        ret.peg = compile_peg(argv[0]);
30262|  4.20k|    }
30263|  4.20k|    if (get_replace) {
  ------------------
  |  Branch (30263:9): [True: 0, False: 4.20k]
  ------------------
30264|      0|        ret.subst = argv[1];
30265|      0|        ret.bytes = janet_getbytes(argv, 2);
30266|  4.20k|    } else {
30267|  4.20k|        ret.bytes = janet_getbytes(argv, 1);
30268|  4.20k|    }
30269|  4.20k|    if (argc > min) {
  ------------------
  |  Branch (30269:9): [True: 0, False: 4.20k]
  ------------------
30270|      0|        ret.start = janet_gethalfrange(argv, min, ret.bytes.len, "offset");
30271|      0|        ret.s.extrac = argc - min - 1;
30272|      0|        ret.s.extrav = janet_tuple_n(argv + min + 1, argc - min - 1);
30273|  4.20k|    } else {
30274|  4.20k|        ret.start = 0;
30275|  4.20k|        ret.s.extrac = 0;
30276|  4.20k|        ret.s.extrav = NULL;
30277|  4.20k|    }
30278|  4.20k|    ret.s.mode = PEG_MODE_NORMAL;
30279|  4.20k|    ret.s.text_start = ret.bytes.bytes;
30280|  4.20k|    ret.s.text_end = ret.bytes.bytes + ret.bytes.len;
30281|  4.20k|    ret.s.outer_text_end = ret.s.text_end;
30282|  4.20k|    ret.s.depth = JANET_RECURSION_GUARD;
  ------------------
  |  |  296|  4.20k|#define JANET_RECURSION_GUARD 1024
  ------------------
30283|  4.20k|    ret.s.captures = janet_array(0);
30284|  4.20k|    ret.s.tagged_captures = janet_array(0);
30285|  4.20k|    ret.s.scratch = janet_buffer(10);
30286|  4.20k|    ret.s.tags = janet_buffer(10);
30287|  4.20k|    ret.s.constants = ret.peg->constants;
30288|  4.20k|    ret.s.bytecode = ret.peg->bytecode;
30289|       |    ret.s.linemap = NULL;
30290|  4.20k|    ret.s.linemaplen = -1;
30291|  4.20k|    ret.s.has_backref = ret.peg->has_backref;
30292|  4.20k|    return ret;
30293|  4.20k|}
janet.c:peg_rule:
28479|   294M|    const uint8_t *text) {
28480|   295M|tail:
28481|   295M|    switch (*rule) {
28482|      0|        default:
  ------------------
  |  Branch (28482:9): [True: 0, False: 295M]
  ------------------
28483|      0|            janet_panic("unexpected opcode");
28484|      0|            return NULL;
28485|       |
28486|  10.6M|        case RULE_LITERAL: {
  ------------------
  |  Branch (28486:9): [True: 10.6M, False: 285M]
  ------------------
28487|  10.6M|            uint32_t len = rule[1];
28488|  10.6M|            if (text + len > s->text_end) return NULL;
  ------------------
  |  Branch (28488:17): [True: 11.3k, False: 10.6M]
  ------------------
28489|  10.6M|            return memcmp(text, rule + 2, len) ? NULL : text + len;
  ------------------
  |  Branch (28489:20): [True: 506k, False: 10.1M]
  ------------------
28490|  10.6M|        }
28491|       |
28492|   205k|        case RULE_DEBUG: {
  ------------------
  |  Branch (28492:9): [True: 205k, False: 295M]
  ------------------
28493|   205k|            char buffer[32] = {0};
28494|   205k|            size_t len = (size_t)(s->outer_text_end - text);
28495|   205k|            memcpy(buffer, text, (len > 31 ? 31 : len));
  ------------------
  |  Branch (28495:35): [True: 12.6k, False: 193k]
  ------------------
28496|   205k|            janet_eprintf("?? at [%s] (index %d)\n", buffer, (int32_t)(text - s->text_start));
  ------------------
  |  | 2195|   205k|#define janet_eprintf(...) janet_dynprintf("err", stderr, __VA_ARGS__)
  ------------------
28497|   205k|            int has_color = janet_truthy(janet_dyn("err-color"));
  ------------------
  |  |  818|   205k|    (!janet_checktype((x), JANET_NIL) && \
  |  |  ------------------
  |  |  |  |  806|   411k|    (((t) == JANET_NUMBER) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (806:6): [Folded, False: 205k]
  |  |  |  |  ------------------
  |  |  |  |  807|   411k|        ? 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|   411k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  800|   205k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  790|   205k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  793|   205k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  792|   205k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 0, False: 205k]
  |  |  ------------------
  |  |  819|   205k|     (!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]
  |  |  ------------------
  ------------------
28498|       |            /* Accumulate buffer */
28499|   205k|            if (s->scratch->count) {
  ------------------
  |  Branch (28499:17): [True: 8.21k, False: 197k]
  ------------------
28500|  8.21k|                janet_eprintf("accumulate buffer: %v\n", janet_wrap_buffer(s->scratch));
  ------------------
  |  | 2195|  8.21k|#define janet_eprintf(...) janet_dynprintf("err", stderr, __VA_ARGS__)
  ------------------
28501|  8.21k|            }
28502|       |            /* Normal captures */
28503|   205k|            if (s->captures->count) {
  ------------------
  |  Branch (28503:17): [True: 184k, False: 20.9k]
  ------------------
28504|   184k|                janet_eprintf("stack [%d]:\n", s->captures->count);
  ------------------
  |  | 2195|   184k|#define janet_eprintf(...) janet_dynprintf("err", stderr, __VA_ARGS__)
  ------------------
28505|  17.1M|                for (int32_t i = 0; i < s->captures->count; i++) {
  ------------------
  |  Branch (28505:37): [True: 16.9M, False: 184k]
  ------------------
28506|  16.9M|                    if (has_color) {
  ------------------
  |  Branch (28506:25): [True: 0, False: 16.9M]
  ------------------
28507|      0|                        janet_eprintf("  [%d]: %M\n", i, s->captures->data[i]);
  ------------------
  |  | 2195|      0|#define janet_eprintf(...) janet_dynprintf("err", stderr, __VA_ARGS__)
  ------------------
28508|  16.9M|                    } else {
28509|  16.9M|                        janet_eprintf("  [%d]: %m\n", i, s->captures->data[i]);
  ------------------
  |  | 2195|  16.9M|#define janet_eprintf(...) janet_dynprintf("err", stderr, __VA_ARGS__)
  ------------------
28510|  16.9M|                    }
28511|  16.9M|                }
28512|   184k|            }
28513|       |            /* Tagged captures */
28514|   205k|            if (s->tagged_captures->count) {
  ------------------
  |  Branch (28514:17): [True: 4.05k, False: 201k]
  ------------------
28515|  4.05k|                janet_eprintf("tag stack [%d]:\n", s->tagged_captures->count);
  ------------------
  |  | 2195|  4.05k|#define janet_eprintf(...) janet_dynprintf("err", stderr, __VA_ARGS__)
  ------------------
28516|  1.54M|                for (int32_t i = 0; i < s->tagged_captures->count; i++) {
  ------------------
  |  Branch (28516:37): [True: 1.54M, False: 4.05k]
  ------------------
28517|  1.54M|                    if (has_color) {
  ------------------
  |  Branch (28517:25): [True: 0, False: 1.54M]
  ------------------
28518|      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__)
  ------------------
28519|  1.54M|                    } else {
28520|  1.54M|                        janet_eprintf("  [%d] tag=%d: %m\n", i, (int32_t) s->tags->data[i], s->tagged_captures->data[i]);
  ------------------
  |  | 2195|  1.54M|#define janet_eprintf(...) janet_dynprintf("err", stderr, __VA_ARGS__)
  ------------------
28521|  1.54M|                    }
28522|  1.54M|                }
28523|  4.05k|            }
28524|   205k|            return text;
28525|  10.6M|        }
28526|       |
28527|   265M|        case RULE_NCHAR: {
  ------------------
  |  Branch (28527:9): [True: 265M, False: 30.6M]
  ------------------
28528|   265M|            uint32_t n = rule[1];
28529|   265M|            return (text + n > s->text_end) ? NULL : text + n;
  ------------------
  |  Branch (28529:20): [True: 1.51M, False: 263M]
  ------------------
28530|  10.6M|        }
28531|       |
28532|  46.5k|        case RULE_NOTNCHAR: {
  ------------------
  |  Branch (28532:9): [True: 46.5k, False: 295M]
  ------------------
28533|  46.5k|            uint32_t n = rule[1];
28534|  46.5k|            return (text + n > s->text_end) ? text : NULL;
  ------------------
  |  Branch (28534:20): [True: 40.0k, False: 6.42k]
  ------------------
28535|  10.6M|        }
28536|       |
28537|     23|        case RULE_RANGE: {
  ------------------
  |  Branch (28537:9): [True: 23, False: 295M]
  ------------------
28538|     23|            uint8_t lo = rule[1] & 0xFF;
28539|     23|            uint8_t hi = (rule[1] >> 16) & 0xFF;
28540|     23|            return (text < s->text_end &&
  ------------------
  |  Branch (28540:21): [True: 23, False: 0]
  ------------------
28541|     23|                    text[0] >= lo &&
  ------------------
  |  Branch (28541:21): [True: 15, False: 8]
  ------------------
28542|     15|                    text[0] <= hi)
  ------------------
  |  Branch (28542:21): [True: 12, False: 3]
  ------------------
28543|     23|                   ? text + 1
28544|     23|                   : NULL;
28545|  10.6M|        }
28546|       |
28547|     13|        case RULE_SET: {
  ------------------
  |  Branch (28547:9): [True: 13, False: 295M]
  ------------------
28548|     13|            if (text >= s->text_end) return NULL;
  ------------------
  |  Branch (28548:17): [True: 0, False: 13]
  ------------------
28549|     13|            uint32_t word = rule[1 + (text[0] >> 5)];
28550|     13|            uint32_t mask = (uint32_t)1 << (text[0] & 0x1F);
28551|     13|            return (word & mask)
  ------------------
  |  Branch (28551:20): [True: 1, False: 12]
  ------------------
28552|     13|                   ? text + 1
28553|     13|                   : NULL;
28554|     13|        }
28555|       |
28556|  15.0k|        case RULE_LOOK: {
  ------------------
  |  Branch (28556:9): [True: 15.0k, False: 295M]
  ------------------
28557|  15.0k|            text += ((int32_t *)rule)[1];
28558|  15.0k|            if (text < s->text_start || text > s->text_end) return NULL;
  ------------------
  |  Branch (28558:17): [True: 354, False: 14.6k]
  |  Branch (28558:41): [True: 544, False: 14.1k]
  ------------------
28559|  14.1k|            down1(s);
  ------------------
  |  |28464|  14.1k|#define down1(s) do { \
  |  |28465|  14.1k|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28465:9): [True: 0, False: 14.1k]
  |  |  ------------------
  |  |28466|  14.1k|} while (0)
  |  |  ------------------
  |  |  |  Branch (28466:10): [Folded, False: 14.1k]
  |  |  ------------------
  ------------------
28560|  14.1k|            const uint8_t *result = peg_rule(s, s->bytecode + rule[2], text);
28561|  14.1k|            up1(s);
  ------------------
  |  |28467|  14.1k|#define up1(s) ((s)->depth++)
  ------------------
28562|  14.1k|            text -= ((int32_t *)rule)[1];
28563|  14.1k|            return result ? text : NULL;
  ------------------
  |  Branch (28563:20): [True: 13.5k, False: 569]
  ------------------
28564|  14.1k|        }
28565|       |
28566|  93.4k|        case RULE_CHOICE: {
  ------------------
  |  Branch (28566:9): [True: 93.4k, False: 295M]
  ------------------
28567|  93.4k|            uint32_t len = rule[1];
28568|  93.4k|            const uint32_t *args = rule + 2;
28569|  93.4k|            if (len == 0) return NULL;
  ------------------
  |  Branch (28569:17): [True: 2.41k, False: 91.0k]
  ------------------
28570|  91.0k|            down1(s);
  ------------------
  |  |28464|  91.0k|#define down1(s) do { \
  |  |28465|  91.0k|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28465:9): [True: 0, False: 91.0k]
  |  |  ------------------
  |  |28466|  91.0k|} while (0)
  |  |  ------------------
  |  |  |  Branch (28466:10): [Folded, False: 91.0k]
  |  |  ------------------
  ------------------
28571|  91.0k|            CapState cs = cap_save(s);
28572|   191k|            for (uint32_t i = 0; i < len - 1; i++) {
  ------------------
  |  Branch (28572:34): [True: 169k, False: 22.0k]
  ------------------
28573|   169k|                const uint8_t *result = peg_rule(s, s->bytecode + args[i], text);
28574|   169k|                if (result) {
  ------------------
  |  Branch (28574:21): [True: 69.0k, False: 100k]
  ------------------
28575|  69.0k|                    up1(s);
  ------------------
  |  |28467|  69.0k|#define up1(s) ((s)->depth++)
  ------------------
28576|  69.0k|                    return result;
28577|  69.0k|                }
28578|   100k|                cap_load(s, cs);
28579|   100k|            }
28580|  22.0k|            up1(s);
  ------------------
  |  |28467|  22.0k|#define up1(s) ((s)->depth++)
  ------------------
28581|  22.0k|            rule = s->bytecode + args[len - 1];
28582|  22.0k|            goto tail;
28583|  91.0k|        }
28584|       |
28585|  1.66M|        case RULE_SEQUENCE: {
  ------------------
  |  Branch (28585:9): [True: 1.66M, False: 294M]
  ------------------
28586|  1.66M|            uint32_t len = rule[1];
28587|  1.66M|            const uint32_t *args = rule + 2;
28588|  1.66M|            if (len == 0) return text;
  ------------------
  |  Branch (28588:17): [True: 381, False: 1.66M]
  ------------------
28589|  1.66M|            down1(s);
  ------------------
  |  |28464|  1.66M|#define down1(s) do { \
  |  |28465|  1.66M|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28465:9): [True: 0, False: 1.66M]
  |  |  ------------------
  |  |28466|  1.66M|} while (0)
  |  |  ------------------
  |  |  |  Branch (28466:10): [Folded, False: 1.66M]
  |  |  ------------------
  ------------------
28590|  5.89M|            for (uint32_t i = 0; text && i < len - 1; i++)
  ------------------
  |  Branch (28590:34): [True: 5.70M, False: 187k]
  |  Branch (28590:42): [True: 4.22M, False: 1.47M]
  ------------------
28591|  4.22M|                text = peg_rule(s, s->bytecode + args[i], text);
28592|  1.66M|            up1(s);
  ------------------
  |  |28467|  1.66M|#define up1(s) ((s)->depth++)
  ------------------
28593|  1.66M|            if (!text) return NULL;
  ------------------
  |  Branch (28593:17): [True: 187k, False: 1.47M]
  ------------------
28594|  1.47M|            rule = s->bytecode + args[len - 1];
28595|  1.47M|            goto tail;
28596|  1.66M|        }
28597|       |
28598|    462|        case RULE_IF: {
  ------------------
  |  Branch (28598:9): [True: 462, False: 295M]
  ------------------
28599|    462|            const uint32_t *rule_a = s->bytecode + rule[1];
28600|    462|            const uint32_t *rule_b = s->bytecode + rule[2];
28601|    462|            down1(s);
  ------------------
  |  |28464|    462|#define down1(s) do { \
  |  |28465|    462|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28465:9): [True: 0, False: 462]
  |  |  ------------------
  |  |28466|    462|} while (0)
  |  |  ------------------
  |  |  |  Branch (28466:10): [Folded, False: 462]
  |  |  ------------------
  ------------------
28602|    462|            const uint8_t *result = peg_rule(s, rule_a, text);
28603|    462|            up1(s);
  ------------------
  |  |28467|    462|#define up1(s) ((s)->depth++)
  ------------------
28604|    462|            if (!result) return NULL;
  ------------------
  |  Branch (28604:17): [True: 247, False: 215]
  ------------------
28605|    215|            rule = rule_b;
28606|    215|            goto tail;
28607|    462|        }
28608|      0|        case RULE_IFNOT: {
  ------------------
  |  Branch (28608:9): [True: 0, False: 295M]
  ------------------
28609|      0|            const uint32_t *rule_a = s->bytecode + rule[1];
28610|      0|            const uint32_t *rule_b = s->bytecode + rule[2];
28611|      0|            down1(s);
  ------------------
  |  |28464|      0|#define down1(s) do { \
  |  |28465|      0|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28465:9): [True: 0, False: 0]
  |  |  ------------------
  |  |28466|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (28466:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
28612|      0|            CapState cs = cap_save(s);
28613|      0|            const uint8_t *result = peg_rule(s, rule_a, text);
28614|      0|            if (!!result) {
  ------------------
  |  Branch (28614:17): [True: 0, False: 0]
  ------------------
28615|      0|                up1(s);
  ------------------
  |  |28467|      0|#define up1(s) ((s)->depth++)
  ------------------
28616|      0|                return NULL;
28617|      0|            } else {
28618|      0|                cap_load(s, cs);
28619|      0|                up1(s);
  ------------------
  |  |28467|      0|#define up1(s) ((s)->depth++)
  ------------------
28620|      0|                rule = rule_b;
28621|      0|                goto tail;
28622|      0|            }
28623|      0|        }
28624|       |
28625|   601k|        case RULE_NOT: {
  ------------------
  |  Branch (28625:9): [True: 601k, False: 295M]
  ------------------
28626|   601k|            const uint32_t *rule_a = s->bytecode + rule[1];
28627|   601k|            down1(s);
  ------------------
  |  |28464|   601k|#define down1(s) do { \
  |  |28465|   601k|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28465:9): [True: 0, False: 601k]
  |  |  ------------------
  |  |28466|   601k|} while (0)
  |  |  ------------------
  |  |  |  Branch (28466:10): [Folded, False: 601k]
  |  |  ------------------
  ------------------
28628|   601k|            CapState cs = cap_save(s);
28629|   601k|            const uint8_t *result = peg_rule(s, rule_a, text);
28630|   601k|            if (result) {
  ------------------
  |  Branch (28630:17): [True: 495, False: 600k]
  ------------------
28631|    495|                up1(s);
  ------------------
  |  |28467|    495|#define up1(s) ((s)->depth++)
  ------------------
28632|    495|                return NULL;
28633|   600k|            } else {
28634|   600k|                cap_load(s, cs);
28635|   600k|                up1(s);
  ------------------
  |  |28467|   600k|#define up1(s) ((s)->depth++)
  ------------------
28636|   600k|                return text;
28637|   600k|            }
28638|   601k|        }
28639|       |
28640|      0|        case RULE_THRU:
  ------------------
  |  Branch (28640:9): [True: 0, False: 295M]
  ------------------
28641|  10.4k|        case RULE_TO: {
  ------------------
  |  Branch (28641:9): [True: 10.4k, False: 295M]
  ------------------
28642|  10.4k|            const uint32_t *rule_a = s->bytecode + rule[1];
28643|  10.4k|            const uint8_t *next_text = NULL;
28644|  10.4k|            CapState cs = cap_save(s);
28645|  10.4k|            down1(s);
  ------------------
  |  |28464|  10.4k|#define down1(s) do { \
  |  |28465|  10.4k|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28465:9): [True: 0, False: 10.4k]
  |  |  ------------------
  |  |28466|  10.4k|} while (0)
  |  |  ------------------
  |  |  |  Branch (28466:10): [Folded, False: 10.4k]
  |  |  ------------------
  ------------------
28646|   470k|            while (text <= s->text_end) {
  ------------------
  |  Branch (28646:20): [True: 460k, False: 10.0k]
  ------------------
28647|   460k|                CapState cs2 = cap_save(s);
28648|   460k|                next_text = peg_rule(s, rule_a, text);
28649|   460k|                if (next_text) {
  ------------------
  |  Branch (28649:21): [True: 379, False: 459k]
  ------------------
28650|    379|                    if (rule[0] == RULE_TO) cap_load(s, cs2);
  ------------------
  |  Branch (28650:25): [True: 379, False: 0]
  ------------------
28651|    379|                    break;
28652|    379|                }
28653|   459k|                cap_load(s, cs2);
28654|   459k|                text++;
28655|   459k|            }
28656|  10.4k|            up1(s);
  ------------------
  |  |28467|  10.4k|#define up1(s) ((s)->depth++)
  ------------------
28657|  10.4k|            if (text > s->text_end) {
  ------------------
  |  Branch (28657:17): [True: 10.0k, False: 379]
  ------------------
28658|  10.0k|                cap_load(s, cs);
28659|  10.0k|                return NULL;
28660|  10.0k|            }
28661|    379|            return rule[0] == RULE_TO ? text : next_text;
  ------------------
  |  Branch (28661:20): [True: 379, False: 0]
  ------------------
28662|  10.4k|        }
28663|       |
28664|  89.6k|        case RULE_BETWEEN: {
  ------------------
  |  Branch (28664:9): [True: 89.6k, False: 295M]
  ------------------
28665|  89.6k|            uint32_t lo = rule[1];
28666|  89.6k|            uint32_t hi = rule[2];
28667|  89.6k|            const uint32_t *rule_a = s->bytecode + rule[3];
28668|  89.6k|            uint32_t captured = 0;
28669|  89.6k|            const uint8_t *next_text;
28670|  89.6k|            CapState cs = cap_save(s);
28671|  89.6k|            down1(s);
  ------------------
  |  |28464|  89.6k|#define down1(s) do { \
  |  |28465|  89.6k|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28465:9): [True: 0, False: 89.6k]
  |  |  ------------------
  |  |28466|  89.6k|} while (0)
  |  |  ------------------
  |  |  |  Branch (28466:10): [Folded, False: 89.6k]
  |  |  ------------------
  ------------------
28672|   272M|            while (captured < hi) {
  ------------------
  |  Branch (28672:20): [True: 272M, False: 14.6k]
  ------------------
28673|   272M|                CapState cs2 = cap_save(s);
28674|   272M|                next_text = peg_rule(s, rule_a, text);
28675|   272M|                if (!next_text || ((next_text == text) && (hi == UINT32_MAX))) {
  ------------------
  |  Branch (28675:21): [True: 74.9k, False: 271M]
  |  Branch (28675:36): [True: 271M, False: 3.52k]
  |  Branch (28675:59): [True: 0, False: 271M]
  ------------------
28676|  74.9k|                    cap_load(s, cs2);
28677|  74.9k|                    break;
28678|  74.9k|                }
28679|   271M|                captured++;
28680|   271M|                text = next_text;
28681|   271M|            }
28682|  89.6k|            up1(s);
  ------------------
  |  |28467|  89.6k|#define up1(s) ((s)->depth++)
  ------------------
28683|  89.6k|            if (captured < lo) {
  ------------------
  |  Branch (28683:17): [True: 1.62k, False: 88.0k]
  ------------------
28684|  1.62k|                cap_load(s, cs);
28685|  1.62k|                return NULL;
28686|  1.62k|            }
28687|  88.0k|            return text;
28688|  89.6k|        }
28689|       |
28690|       |        /* Capturing rules */
28691|       |
28692|  44.9k|        case RULE_GETTAG: {
  ------------------
  |  Branch (28692:9): [True: 44.9k, False: 295M]
  ------------------
28693|  44.9k|            uint32_t search = rule[1];
28694|  44.9k|            uint32_t tag = rule[2];
28695|   578M|            for (int32_t i = s->tags->count - 1; i >= 0; i--) {
  ------------------
  |  Branch (28695:50): [True: 578M, False: 44.9k]
  ------------------
28696|   578M|                if (s->tags->data[i] == search) {
  ------------------
  |  Branch (28696:21): [True: 0, False: 578M]
  ------------------
28697|      0|                    pushcap(s, s->tagged_captures->data[i], tag);
28698|      0|                    return text;
28699|      0|                }
28700|   578M|            }
28701|  44.9k|            return NULL;
28702|  44.9k|        }
28703|       |
28704|   578k|        case RULE_POSITION: {
  ------------------
  |  Branch (28704:9): [True: 578k, False: 295M]
  ------------------
28705|   578k|            pushcap(s, janet_wrap_number((double)(text - s->text_start)), rule[1]);
  ------------------
  |  |  835|   578k|#define janet_wrap_number(r) janet_nanbox_from_double(r)
  ------------------
28706|   578k|            return text;
28707|  44.9k|        }
28708|       |
28709|   836k|        case RULE_LINE: {
  ------------------
  |  Branch (28709:9): [True: 836k, False: 294M]
  ------------------
28710|   836k|            LineCol lc = get_linecol_from_position(s, (int32_t)(text - s->text_start));
28711|   836k|            pushcap(s, janet_wrap_number((double)(lc.line)), rule[1]);
  ------------------
  |  |  835|   836k|#define janet_wrap_number(r) janet_nanbox_from_double(r)
  ------------------
28712|   836k|            return text;
28713|  44.9k|        }
28714|       |
28715|      3|        case RULE_COLUMN: {
  ------------------
  |  Branch (28715:9): [True: 3, False: 295M]
  ------------------
28716|      3|            LineCol lc = get_linecol_from_position(s, (int32_t)(text - s->text_start));
28717|      3|            pushcap(s, janet_wrap_number((double)(lc.col)), rule[1]);
  ------------------
  |  |  835|      3|#define janet_wrap_number(r) janet_nanbox_from_double(r)
  ------------------
28718|      3|            return text;
28719|  44.9k|        }
28720|       |
28721|      0|        case RULE_ARGUMENT: {
  ------------------
  |  Branch (28721:9): [True: 0, False: 295M]
  ------------------
28722|      0|            int32_t index = ((int32_t *)rule)[1];
28723|      0|            Janet capture = (index >= s->extrac) ? 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 (28723:29): [True: 0, False: 0]
  ------------------
28724|      0|            pushcap(s, capture, rule[2]);
28725|      0|            return text;
28726|  44.9k|        }
28727|       |
28728|      0|        case RULE_CONSTANT: {
  ------------------
  |  Branch (28728:9): [True: 0, False: 295M]
  ------------------
28729|      0|            pushcap(s, s->constants[rule[1]], rule[2]);
28730|      0|            return text;
28731|  44.9k|        }
28732|       |
28733|  15.6M|        case RULE_CAPTURE: {
  ------------------
  |  Branch (28733:9): [True: 15.6M, False: 280M]
  ------------------
28734|  15.6M|            down1(s);
  ------------------
  |  |28464|  15.6M|#define down1(s) do { \
  |  |28465|  15.6M|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28465:9): [True: 0, False: 15.6M]
  |  |  ------------------
  |  |28466|  15.6M|} while (0)
  |  |  ------------------
  |  |  |  Branch (28466:10): [Folded, False: 15.6M]
  |  |  ------------------
  ------------------
28735|  15.6M|            const uint8_t *result = peg_rule(s, s->bytecode + rule[1], text);
28736|  15.6M|            up1(s);
  ------------------
  |  |28467|  15.6M|#define up1(s) ((s)->depth++)
  ------------------
28737|  15.6M|            if (!result) return NULL;
  ------------------
  |  Branch (28737:17): [True: 2.66M, False: 12.9M]
  ------------------
28738|       |            /* Specialized pushcap - avoid intermediate string creation */
28739|  12.9M|            if (!s->has_backref && s->mode == PEG_MODE_ACCUMULATE) {
  ------------------
  |  Branch (28739:17): [True: 12.9M, False: 51.9k]
  |  Branch (28739:36): [True: 7.29k, False: 12.9M]
  ------------------
28740|  7.29k|                janet_buffer_push_bytes(s->scratch, text, (int32_t)(result - text));
28741|  12.9M|            } else {
28742|  12.9M|                uint32_t tag = rule[2];
28743|  12.9M|                pushcap(s, janet_stringv(text, (int32_t)(result - text)), tag);
  ------------------
  |  | 1827|  12.9M|#define janet_stringv(str, len) janet_wrap_string(janet_string((str), (len)))
  |  |  ------------------
  |  |  |  |  848|  12.9M|#define janet_wrap_string(s) janet_nanbox_wrap_c((s), JANET_STRING)
  |  |  |  |  ------------------
  |  |  |  |  |  |  828|  12.9M|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  793|  12.9M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  792|  12.9M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
28744|  12.9M|            }
28745|  12.9M|            return result;
28746|  15.6M|        }
28747|       |
28748|      0|        case RULE_CAPTURE_NUM: {
  ------------------
  |  Branch (28748:9): [True: 0, False: 295M]
  ------------------
28749|      0|            down1(s);
  ------------------
  |  |28464|      0|#define down1(s) do { \
  |  |28465|      0|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28465:9): [True: 0, False: 0]
  |  |  ------------------
  |  |28466|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (28466:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
28750|      0|            const uint8_t *result = peg_rule(s, s->bytecode + rule[1], text);
28751|      0|            up1(s);
  ------------------
  |  |28467|      0|#define up1(s) ((s)->depth++)
  ------------------
28752|      0|            if (!result) return NULL;
  ------------------
  |  Branch (28752:17): [True: 0, False: 0]
  ------------------
28753|       |            /* check number parsing */
28754|      0|            double x = 0.0;
28755|      0|            int32_t base = (int32_t) rule[2];
28756|      0|            if (janet_scan_number_base(text, (int32_t)(result - text), base, &x)) return NULL;
  ------------------
  |  Branch (28756:17): [True: 0, False: 0]
  ------------------
28757|       |            /* Specialized pushcap - avoid intermediate string creation */
28758|      0|            if (!s->has_backref && s->mode == PEG_MODE_ACCUMULATE) {
  ------------------
  |  Branch (28758:17): [True: 0, False: 0]
  |  Branch (28758:36): [True: 0, False: 0]
  ------------------
28759|      0|                janet_buffer_push_bytes(s->scratch, text, (int32_t)(result - text));
28760|      0|            } else {
28761|      0|                uint32_t tag = rule[3];
28762|      0|                pushcap(s, janet_wrap_number(x), tag);
  ------------------
  |  |  835|      0|#define janet_wrap_number(r) janet_nanbox_from_double(r)
  ------------------
28763|      0|            }
28764|      0|            return result;
28765|      0|        }
28766|       |
28767|  83.7k|        case RULE_ACCUMULATE: {
  ------------------
  |  Branch (28767:9): [True: 83.7k, False: 295M]
  ------------------
28768|  83.7k|            uint32_t tag = rule[2];
28769|  83.7k|            int oldmode = s->mode;
28770|  83.7k|            if (!tag && oldmode == PEG_MODE_ACCUMULATE) {
  ------------------
  |  Branch (28770:17): [True: 80.5k, False: 3.15k]
  |  Branch (28770:25): [True: 1.59k, False: 79.0k]
  ------------------
28771|  1.59k|                rule = s->bytecode + rule[1];
28772|  1.59k|                goto tail;
28773|  1.59k|            }
28774|  82.1k|            CapState cs = cap_save(s);
28775|  82.1k|            s->mode = PEG_MODE_ACCUMULATE;
28776|  82.1k|            down1(s);
  ------------------
  |  |28464|  82.1k|#define down1(s) do { \
  |  |28465|  82.1k|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28465:9): [True: 0, False: 82.1k]
  |  |  ------------------
  |  |28466|  82.1k|} while (0)
  |  |  ------------------
  |  |  |  Branch (28466:10): [Folded, False: 82.1k]
  |  |  ------------------
  ------------------
28777|  82.1k|            const uint8_t *result = peg_rule(s, s->bytecode + rule[1], text);
28778|  82.1k|            up1(s);
  ------------------
  |  |28467|  82.1k|#define up1(s) ((s)->depth++)
  ------------------
28779|  82.1k|            s->mode = oldmode;
28780|  82.1k|            if (!result) return NULL;
  ------------------
  |  Branch (28780:17): [True: 847, False: 81.3k]
  ------------------
28781|  81.3k|            Janet cap = janet_stringv(s->scratch->data + cs.scratch,
  ------------------
  |  | 1827|  81.3k|#define janet_stringv(str, len) janet_wrap_string(janet_string((str), (len)))
  |  |  ------------------
  |  |  |  |  848|  81.3k|#define janet_wrap_string(s) janet_nanbox_wrap_c((s), JANET_STRING)
  |  |  |  |  ------------------
  |  |  |  |  |  |  828|  81.3k|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  793|  81.3k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  792|  81.3k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
28782|  81.3k|                                      s->scratch->count - cs.scratch);
28783|  81.3k|            cap_load_keept(s, cs);
28784|  81.3k|            pushcap(s, cap, tag);
28785|  81.3k|            return result;
28786|  82.1k|        }
28787|       |
28788|      0|        case RULE_DROP: {
  ------------------
  |  Branch (28788:9): [True: 0, False: 295M]
  ------------------
28789|      0|            CapState cs = cap_save(s);
28790|      0|            down1(s);
  ------------------
  |  |28464|      0|#define down1(s) do { \
  |  |28465|      0|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28465:9): [True: 0, False: 0]
  |  |  ------------------
  |  |28466|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (28466:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
28791|      0|            const uint8_t *result = peg_rule(s, s->bytecode + rule[1], text);
28792|      0|            up1(s);
  ------------------
  |  |28467|      0|#define up1(s) ((s)->depth++)
  ------------------
28793|      0|            if (!result) return NULL;
  ------------------
  |  Branch (28793:17): [True: 0, False: 0]
  ------------------
28794|      0|            cap_load(s, cs);
28795|      0|            return result;
28796|      0|        }
28797|       |
28798|      0|        case RULE_ONLY_TAGS: {
  ------------------
  |  Branch (28798:9): [True: 0, False: 295M]
  ------------------
28799|      0|            CapState cs = cap_save(s);
28800|      0|            down1(s);
  ------------------
  |  |28464|      0|#define down1(s) do { \
  |  |28465|      0|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28465:9): [True: 0, False: 0]
  |  |  ------------------
  |  |28466|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (28466:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
28801|      0|            const uint8_t *result = peg_rule(s, s->bytecode + rule[1], text);
28802|      0|            up1(s);
  ------------------
  |  |28467|      0|#define up1(s) ((s)->depth++)
  ------------------
28803|      0|            if (!result) return NULL;
  ------------------
  |  Branch (28803:17): [True: 0, False: 0]
  ------------------
28804|      0|            cap_load_keept(s, cs);
28805|      0|            return result;
28806|      0|        }
28807|       |
28808|      0|        case RULE_GROUP: {
  ------------------
  |  Branch (28808:9): [True: 0, False: 295M]
  ------------------
28809|      0|            uint32_t tag = rule[2];
28810|      0|            int oldmode = s->mode;
28811|      0|            CapState cs = cap_save(s);
28812|      0|            s->mode = PEG_MODE_NORMAL;
28813|      0|            down1(s);
  ------------------
  |  |28464|      0|#define down1(s) do { \
  |  |28465|      0|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28465:9): [True: 0, False: 0]
  |  |  ------------------
  |  |28466|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (28466:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
28814|      0|            const uint8_t *result = peg_rule(s, s->bytecode + rule[1], text);
28815|      0|            up1(s);
  ------------------
  |  |28467|      0|#define up1(s) ((s)->depth++)
  ------------------
28816|      0|            s->mode = oldmode;
28817|      0|            if (!result) return NULL;
  ------------------
  |  Branch (28817:17): [True: 0, False: 0]
  ------------------
28818|      0|            int32_t num_sub_captures = s->captures->count - cs.cap;
28819|      0|            JanetArray *sub_captures = janet_array(num_sub_captures);
28820|      0|            safe_memcpy(sub_captures->data,
28821|      0|                        s->captures->data + cs.cap,
28822|      0|                        sizeof(Janet) * num_sub_captures);
28823|      0|            sub_captures->count = num_sub_captures;
28824|      0|            cap_load_keept(s, cs);
28825|      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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
28826|      0|            return result;
28827|      0|        }
28828|       |
28829|      0|        case RULE_NTH: {
  ------------------
  |  Branch (28829:9): [True: 0, False: 295M]
  ------------------
28830|      0|            uint32_t nth = rule[1];
28831|      0|            if (nth > INT32_MAX) nth = INT32_MAX;
  ------------------
  |  Branch (28831:17): [True: 0, False: 0]
  ------------------
28832|      0|            uint32_t tag = rule[3];
28833|      0|            int oldmode = s->mode;
28834|      0|            CapState cs = cap_save(s);
28835|      0|            s->mode = PEG_MODE_NORMAL;
28836|      0|            down1(s);
  ------------------
  |  |28464|      0|#define down1(s) do { \
  |  |28465|      0|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28465:9): [True: 0, False: 0]
  |  |  ------------------
  |  |28466|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (28466:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
28837|      0|            const uint8_t *result = peg_rule(s, s->bytecode + rule[2], text);
28838|      0|            up1(s);
  ------------------
  |  |28467|      0|#define up1(s) ((s)->depth++)
  ------------------
28839|      0|            s->mode = oldmode;
28840|      0|            if (!result) return NULL;
  ------------------
  |  Branch (28840:17): [True: 0, False: 0]
  ------------------
28841|      0|            int32_t num_sub_captures = s->captures->count - cs.cap;
28842|      0|            Janet cap;
28843|      0|            if (num_sub_captures > (int32_t) nth) {
  ------------------
  |  Branch (28843:17): [True: 0, False: 0]
  ------------------
28844|      0|                cap = s->captures->data[cs.cap + nth];
28845|      0|            } else {
28846|      0|                return NULL;
28847|      0|            }
28848|      0|            cap_load_keept(s, cs);
28849|      0|            pushcap(s, cap, tag);
28850|      0|            return result;
28851|      0|        }
28852|       |
28853|      0|        case RULE_SUB: {
  ------------------
  |  Branch (28853:9): [True: 0, False: 295M]
  ------------------
28854|      0|            const uint8_t *text_start = text;
28855|      0|            const uint32_t *rule_window = s->bytecode + rule[1];
28856|      0|            const uint32_t *rule_subpattern = s->bytecode + rule[2];
28857|      0|            down1(s);
  ------------------
  |  |28464|      0|#define down1(s) do { \
  |  |28465|      0|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28465:9): [True: 0, False: 0]
  |  |  ------------------
  |  |28466|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (28466:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
28858|      0|            const uint8_t *window_end = peg_rule(s, rule_window, text);
28859|      0|            up1(s);
  ------------------
  |  |28467|      0|#define up1(s) ((s)->depth++)
  ------------------
28860|      0|            if (!window_end) {
  ------------------
  |  Branch (28860:17): [True: 0, False: 0]
  ------------------
28861|      0|                return NULL;
28862|      0|            }
28863|      0|            const uint8_t *saved_end = s->text_end;
28864|      0|            s->text_end = window_end;
28865|      0|            down1(s);
  ------------------
  |  |28464|      0|#define down1(s) do { \
  |  |28465|      0|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28465:9): [True: 0, False: 0]
  |  |  ------------------
  |  |28466|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (28466:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
28866|      0|            const uint8_t *next_text = peg_rule(s, rule_subpattern, text_start);
28867|      0|            up1(s);
  ------------------
  |  |28467|      0|#define up1(s) ((s)->depth++)
  ------------------
28868|      0|            s->text_end = saved_end;
28869|       |
28870|      0|            if (!next_text) {
  ------------------
  |  Branch (28870:17): [True: 0, False: 0]
  ------------------
28871|      0|                return NULL;
28872|      0|            }
28873|       |
28874|      0|            return window_end;
28875|      0|        }
28876|       |
28877|  1.49k|        case RULE_TIL: {
  ------------------
  |  Branch (28877:9): [True: 1.49k, False: 295M]
  ------------------
28878|  1.49k|            const uint32_t *rule_terminus = s->bytecode + rule[1];
28879|  1.49k|            const uint32_t *rule_subpattern = s->bytecode + rule[2];
28880|       |
28881|  1.49k|            const uint8_t *terminus_start = text;
28882|  1.49k|            const uint8_t *terminus_end = NULL;
28883|  1.49k|            down1(s);
  ------------------
  |  |28464|  1.49k|#define down1(s) do { \
  |  |28465|  1.49k|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28465:9): [True: 0, False: 1.49k]
  |  |  ------------------
  |  |28466|  1.49k|} while (0)
  |  |  ------------------
  |  |  |  Branch (28466:10): [Folded, False: 1.49k]
  |  |  ------------------
  ------------------
28884|   870k|            while (terminus_start <= s->text_end) {
  ------------------
  |  Branch (28884:20): [True: 869k, False: 1.12k]
  ------------------
28885|   869k|                CapState cs2 = cap_save(s);
28886|   869k|                terminus_end = peg_rule(s, rule_terminus, terminus_start);
28887|   869k|                cap_load(s, cs2);
28888|   869k|                if (terminus_end) {
  ------------------
  |  Branch (28888:21): [True: 367, False: 869k]
  ------------------
28889|    367|                    break;
28890|    367|                }
28891|   869k|                terminus_start++;
28892|   869k|            }
28893|  1.49k|            up1(s);
  ------------------
  |  |28467|  1.49k|#define up1(s) ((s)->depth++)
  ------------------
28894|       |
28895|  1.49k|            if (!terminus_end) {
  ------------------
  |  Branch (28895:17): [True: 1.12k, False: 367]
  ------------------
28896|  1.12k|                return NULL;
28897|  1.12k|            }
28898|       |
28899|    367|            const uint8_t *saved_end = s->text_end;
28900|    367|            s->text_end = terminus_start;
28901|    367|            down1(s);
  ------------------
  |  |28464|    367|#define down1(s) do { \
  |  |28465|    367|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28465:9): [True: 0, False: 367]
  |  |  ------------------
  |  |28466|    367|} while (0)
  |  |  ------------------
  |  |  |  Branch (28466:10): [Folded, False: 367]
  |  |  ------------------
  ------------------
28902|    367|            const uint8_t *matched = peg_rule(s, rule_subpattern, text);
28903|    367|            up1(s);
  ------------------
  |  |28467|    367|#define up1(s) ((s)->depth++)
  ------------------
28904|    367|            s->text_end = saved_end;
28905|       |
28906|    367|            if (!matched) {
  ------------------
  |  Branch (28906:17): [True: 354, False: 13]
  ------------------
28907|    354|                return NULL;
28908|    354|            }
28909|       |
28910|     13|            return terminus_end;
28911|    367|        }
28912|       |
28913|      0|        case RULE_SPLIT: {
  ------------------
  |  Branch (28913:9): [True: 0, False: 295M]
  ------------------
28914|      0|            const uint8_t *saved_end = s->text_end;
28915|      0|            const uint32_t *rule_separator = s->bytecode + rule[1];
28916|      0|            const uint32_t *rule_subpattern = s->bytecode + rule[2];
28917|       |
28918|      0|            const uint8_t *chunk_start = text;
28919|      0|            const uint8_t *chunk_end = NULL;
28920|       |
28921|      0|            while (text <= saved_end) {
  ------------------
  |  Branch (28921:20): [True: 0, False: 0]
  ------------------
28922|       |                /* Find next split (or end of text) */
28923|      0|                CapState cs = cap_save(s);
28924|      0|                down1(s);
  ------------------
  |  |28464|      0|#define down1(s) do { \
  |  |28465|      0|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28465:9): [True: 0, False: 0]
  |  |  ------------------
  |  |28466|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (28466:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
28925|      0|                while (text <= saved_end) {
  ------------------
  |  Branch (28925:24): [True: 0, False: 0]
  ------------------
28926|      0|                    chunk_end = text;
28927|      0|                    const uint8_t *check = peg_rule(s, rule_separator, text);
28928|      0|                    cap_load(s, cs);
28929|      0|                    if (check) {
  ------------------
  |  Branch (28929:25): [True: 0, False: 0]
  ------------------
28930|      0|                        text = check;
28931|      0|                        break;
28932|      0|                    }
28933|      0|                    text++;
28934|      0|                }
28935|      0|                up1(s);
  ------------------
  |  |28467|      0|#define up1(s) ((s)->depth++)
  ------------------
28936|       |
28937|       |                /* Match between splits */
28938|      0|                s->text_end = chunk_end;
28939|      0|                down1(s);
  ------------------
  |  |28464|      0|#define down1(s) do { \
  |  |28465|      0|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28465:9): [True: 0, False: 0]
  |  |  ------------------
  |  |28466|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (28466:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
28940|      0|                const uint8_t *subpattern_end = peg_rule(s, rule_subpattern, chunk_start);
28941|      0|                up1(s);
  ------------------
  |  |28467|      0|#define up1(s) ((s)->depth++)
  ------------------
28942|      0|                s->text_end = saved_end;
28943|      0|                if (!subpattern_end) return NULL; /* Don't match anything */
  ------------------
  |  Branch (28943:21): [True: 0, False: 0]
  ------------------
28944|       |
28945|       |                /* Ensure forward progress */
28946|      0|                if (text == chunk_start) return NULL;
  ------------------
  |  Branch (28946:21): [True: 0, False: 0]
  ------------------
28947|      0|                chunk_start = text;
28948|      0|            }
28949|       |
28950|      0|            s->text_end = saved_end;
28951|      0|            return s->text_end;
28952|      0|        }
28953|       |
28954|   108k|        case RULE_REPLACE:
  ------------------
  |  Branch (28954:9): [True: 108k, False: 295M]
  ------------------
28955|   108k|        case RULE_MATCHSPLICE:
  ------------------
  |  Branch (28955:9): [True: 0, False: 295M]
  ------------------
28956|   108k|        case RULE_MATCHTIME: {
  ------------------
  |  Branch (28956:9): [True: 0, False: 295M]
  ------------------
28957|   108k|            uint32_t tag = rule[3];
28958|   108k|            int oldmode = s->mode;
28959|   108k|            CapState cs = cap_save(s);
28960|   108k|            s->mode = PEG_MODE_NORMAL;
28961|   108k|            down1(s);
  ------------------
  |  |28464|   108k|#define down1(s) do { \
  |  |28465|   108k|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28465:9): [True: 0, False: 108k]
  |  |  ------------------
  |  |28466|   108k|} while (0)
  |  |  ------------------
  |  |  |  Branch (28466:10): [Folded, False: 108k]
  |  |  ------------------
  ------------------
28962|   108k|            const uint8_t *result = peg_rule(s, s->bytecode + rule[1], text);
28963|   108k|            up1(s);
  ------------------
  |  |28467|   108k|#define up1(s) ((s)->depth++)
  ------------------
28964|   108k|            s->mode = oldmode;
28965|   108k|            if (!result) return NULL;
  ------------------
  |  Branch (28965:17): [True: 393, False: 107k]
  ------------------
28966|       |
28967|   107k|            Janet cap = janet_wrap_nil();
  ------------------
  |  |  831|   107k|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|   107k|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|   107k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|   107k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
28968|   107k|            Janet constant = s->constants[rule[2]];
28969|   107k|            switch (janet_type(constant)) {
  ------------------
  |  |  795|   107k|    (isnan((x).number) \
  |  |  796|   107k|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|   107k|        : JANET_NUMBER)
  ------------------
  |  Branch (28969:21): [True: 98.6k, False: 8.97k]
  ------------------
28970|  52.2k|                default:
  ------------------
  |  Branch (28970:17): [True: 52.2k, False: 55.3k]
  ------------------
28971|  52.2k|                    cap = constant;
28972|  52.2k|                    break;
28973|  54.8k|                case JANET_STRUCT:
  ------------------
  |  Branch (28973:17): [True: 54.8k, False: 52.7k]
  ------------------
28974|  54.8k|                    if (s->captures->count) {
  ------------------
  |  Branch (28974:25): [True: 1.08k, False: 53.8k]
  ------------------
28975|  1.08k|                        cap = janet_struct_get(janet_unwrap_struct(constant),
  ------------------
  |  |  857|  1.08k|#define janet_unwrap_struct(x) ((JanetStruct)janet_nanbox_to_pointer(x))
  ------------------
28976|  1.08k|                                               s->captures->data[s->captures->count - 1]);
28977|  1.08k|                    }
28978|  54.8k|                    break;
28979|    505|                case JANET_TABLE:
  ------------------
  |  Branch (28979:17): [True: 505, False: 107k]
  ------------------
28980|    505|                    if (s->captures->count) {
  ------------------
  |  Branch (28980:25): [True: 504, False: 1]
  ------------------
28981|    504|                        cap = janet_table_get(janet_unwrap_table(constant),
  ------------------
  |  |  861|    504|#define janet_unwrap_table(x) ((JanetTable *)janet_nanbox_to_pointer(x))
  ------------------
28982|    504|                                              s->captures->data[s->captures->count - 1]);
28983|    504|                    }
28984|    505|                    break;
28985|      0|                case JANET_CFUNCTION:
  ------------------
  |  Branch (28985:17): [True: 0, False: 107k]
  ------------------
28986|      0|                    cap = janet_unwrap_cfunction(constant)(s->captures->count - cs.cap,
  ------------------
  |  |  869|      0|#define janet_unwrap_cfunction(x) ((JanetCFunction)janet_nanbox_to_pointer(x))
  ------------------
28987|      0|                                                           s->captures->data + cs.cap);
28988|      0|                    break;
28989|      0|                case JANET_FUNCTION:
  ------------------
  |  Branch (28989:17): [True: 0, False: 107k]
  ------------------
28990|      0|                    cap = janet_call(janet_unwrap_function(constant),
  ------------------
  |  |  868|      0|#define janet_unwrap_function(x) ((JanetFunction *)janet_nanbox_to_pointer(x))
  ------------------
28991|      0|                                     s->captures->count - cs.cap,
28992|      0|                                     s->captures->data + cs.cap);
28993|      0|                    break;
28994|   107k|            }
28995|   107k|            cap_load_keept(s, cs);
28996|   107k|            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 (28996:17): [True: 0, False: 107k]
  ------------------
28997|   107k|            const Janet *elements = NULL;
28998|   107k|            int32_t len = 0;
28999|   107k|            if ((rule[0] == RULE_MATCHSPLICE) && janet_indexed_view(cap, &elements, &len)) {
  ------------------
  |  Branch (28999:17): [True: 0, False: 107k]
  |  Branch (28999:50): [True: 0, False: 0]
  ------------------
29000|       |                /* unpack and flatten capture */
29001|      0|                for (int32_t i = 0; i < len; i++) {
  ------------------
  |  Branch (29001:37): [True: 0, False: 0]
  ------------------
29002|      0|                    pushcap(s, elements[i], tag);
29003|      0|                }
29004|   107k|            } else {
29005|   107k|                pushcap(s, cap, tag);
29006|   107k|            }
29007|   107k|            return result;
29008|   107k|        }
29009|       |
29010|     69|        case RULE_ERROR: {
  ------------------
  |  Branch (29010:9): [True: 69, False: 295M]
  ------------------
29011|     69|            int oldmode = s->mode;
29012|     69|            s->mode = PEG_MODE_NORMAL;
29013|     69|            int32_t old_cap = s->captures->count;
29014|     69|            down1(s);
  ------------------
  |  |28464|     69|#define down1(s) do { \
  |  |28465|     69|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28465:9): [True: 0, False: 69]
  |  |  ------------------
  |  |28466|     69|} while (0)
  |  |  ------------------
  |  |  |  Branch (28466:10): [Folded, False: 69]
  |  |  ------------------
  ------------------
29015|     69|            const uint8_t *result = peg_rule(s, s->bytecode + rule[1], text);
29016|     69|            up1(s);
  ------------------
  |  |28467|     69|#define up1(s) ((s)->depth++)
  ------------------
29017|     69|            s->mode = oldmode;
29018|     69|            if (!result) return NULL;
  ------------------
  |  Branch (29018:17): [True: 3, False: 66]
  ------------------
29019|     66|            if (s->captures->count > old_cap) {
  ------------------
  |  Branch (29019:17): [True: 2, False: 64]
  ------------------
29020|       |                /* Throw last capture */
29021|      2|                janet_panicv(s->captures->data[s->captures->count - 1]);
29022|     64|            } else {
29023|       |                /* Throw generic error */
29024|     64|                int32_t start = (int32_t)(text - s->text_start);
29025|     64|                LineCol lc = get_linecol_from_position(s, start);
29026|     64|                janet_panicf("match error at line %d, column %d", lc.line, lc.col);
29027|     64|            }
29028|      0|            return NULL;
29029|     66|        }
29030|       |
29031|      0|        case RULE_BACKMATCH: {
  ------------------
  |  Branch (29031:9): [True: 0, False: 295M]
  ------------------
29032|      0|            uint32_t search = rule[1];
29033|      0|            for (int32_t i = s->tags->count - 1; i >= 0; i--) {
  ------------------
  |  Branch (29033:50): [True: 0, False: 0]
  ------------------
29034|      0|                if (s->tags->data[i] == search) {
  ------------------
  |  Branch (29034:21): [True: 0, False: 0]
  ------------------
29035|      0|                    Janet capture = s->tagged_captures->data[i];
29036|      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 (29036:25): [True: 0, False: 0]
  ------------------
29037|      0|                        return NULL;
29038|      0|                    const uint8_t *bytes = janet_unwrap_string(capture);
  ------------------
  |  |  863|      0|#define janet_unwrap_string(x) ((JanetString)janet_nanbox_to_pointer(x))
  ------------------
29039|      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)))
  |  |  ------------------
  ------------------
29040|      0|                    if (text + len > s->text_end)
  ------------------
  |  Branch (29040:25): [True: 0, False: 0]
  ------------------
29041|      0|                        return NULL;
29042|      0|                    return memcmp(text, bytes, len) ? NULL : text + len;
  ------------------
  |  Branch (29042:28): [True: 0, False: 0]
  ------------------
29043|      0|                }
29044|      0|            }
29045|      0|            return NULL;
29046|      0|        }
29047|       |
29048|      0|        case RULE_LENPREFIX: {
  ------------------
  |  Branch (29048:9): [True: 0, False: 295M]
  ------------------
29049|      0|            int oldmode = s->mode;
29050|      0|            s->mode = PEG_MODE_NORMAL;
29051|      0|            const uint8_t *next_text;
29052|      0|            CapState cs = cap_save(s);
29053|      0|            down1(s);
  ------------------
  |  |28464|      0|#define down1(s) do { \
  |  |28465|      0|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28465:9): [True: 0, False: 0]
  |  |  ------------------
  |  |28466|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (28466:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
29054|      0|            next_text = peg_rule(s, s->bytecode + rule[1], text);
29055|      0|            up1(s);
  ------------------
  |  |28467|      0|#define up1(s) ((s)->depth++)
  ------------------
29056|      0|            if (NULL == next_text) return NULL;
  ------------------
  |  Branch (29056:17): [True: 0, False: 0]
  ------------------
29057|      0|            s->mode = oldmode;
29058|      0|            int32_t num_sub_captures = s->captures->count - cs.cap;
29059|      0|            Janet lencap;
29060|      0|            if (num_sub_captures <= 0 ||
  ------------------
  |  Branch (29060:17): [True: 0, False: 0]
  ------------------
29061|      0|                    (lencap = s->captures->data[cs.cap], !janet_checkint(lencap))) {
  ------------------
  |  Branch (29061:21): [True: 0, False: 0]
  ------------------
29062|      0|                cap_load(s, cs);
29063|      0|                return NULL;
29064|      0|            }
29065|      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)
  |  |  ------------------
  ------------------
29066|       |            /* drop captures from len pattern */
29067|      0|            cap_load(s, cs);
29068|      0|            for (int32_t i = 0; i < nrep; i++) {
  ------------------
  |  Branch (29068:33): [True: 0, False: 0]
  ------------------
29069|      0|                down1(s);
  ------------------
  |  |28464|      0|#define down1(s) do { \
  |  |28465|      0|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28465:9): [True: 0, False: 0]
  |  |  ------------------
  |  |28466|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (28466:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
29070|      0|                next_text = peg_rule(s, s->bytecode + rule[2], next_text);
29071|      0|                up1(s);
  ------------------
  |  |28467|      0|#define up1(s) ((s)->depth++)
  ------------------
29072|      0|                if (NULL == next_text) {
  ------------------
  |  Branch (29072:21): [True: 0, False: 0]
  ------------------
29073|      0|                    cap_load(s, cs);
29074|      0|                    return NULL;
29075|      0|                }
29076|      0|            }
29077|      0|            return next_text;
29078|      0|        }
29079|       |
29080|  30.0k|        case RULE_READINT: {
  ------------------
  |  Branch (29080:9): [True: 30.0k, False: 295M]
  ------------------
29081|  30.0k|            uint32_t tag = rule[2];
29082|  30.0k|            uint32_t signedness = rule[1] & 0x10;
29083|  30.0k|            uint32_t endianness = rule[1] & 0x20;
29084|  30.0k|            int width = (int)(rule[1] & 0xF);
29085|  30.0k|            if (text + width > s->text_end) return NULL;
  ------------------
  |  Branch (29085:17): [True: 4.88k, False: 25.1k]
  ------------------
29086|  25.1k|            uint64_t accum = 0;
29087|  25.1k|            if (endianness) {
  ------------------
  |  Branch (29087:17): [True: 0, False: 25.1k]
  ------------------
29088|       |                /* BE */
29089|      0|                for (int i = 0; i < width; i++) accum = (accum << 8) | text[i];
  ------------------
  |  Branch (29089:33): [True: 0, False: 0]
  ------------------
29090|  25.1k|            } else {
29091|       |                /* LE */
29092|   203k|                for (int i = width - 1; i >= 0; i--) accum = (accum << 8) | text[i];
  ------------------
  |  Branch (29092:41): [True: 178k, False: 25.1k]
  ------------------
29093|  25.1k|            }
29094|       |
29095|  25.1k|            Janet capture_value;
29096|       |            /* We can only parse integeres of greater than 6 bytes reliable if int-types are enabled.
29097|       |             * Otherwise, we may lose precision, so 6 is the maximum size when int-types are disabled. */
29098|  25.1k|#ifdef JANET_INT_TYPES
29099|  25.1k|            if (width > 6) {
  ------------------
  |  Branch (29099:17): [True: 24.2k, False: 933]
  ------------------
29100|  24.2k|                if (signedness) {
  ------------------
  |  Branch (29100:21): [True: 7.25k, False: 16.9k]
  ------------------
29101|  7.25k|                    capture_value = janet_wrap_s64(peg_convert_u64_s64(accum, width));
29102|  16.9k|                } else {
29103|  16.9k|                    capture_value = janet_wrap_u64(accum);
29104|  16.9k|                }
29105|  24.2k|            } else
29106|    933|#endif
29107|    933|            {
29108|    933|                double double_value;
29109|    933|                if (signedness) {
  ------------------
  |  Branch (29109:21): [True: 678, False: 255]
  ------------------
29110|    678|                    double_value = (double)(peg_convert_u64_s64(accum, width));
29111|    678|                } else {
29112|    255|                    double_value = (double)accum;
29113|    255|                }
29114|    933|                capture_value = janet_wrap_number(double_value);
  ------------------
  |  |  835|    933|#define janet_wrap_number(r) janet_nanbox_from_double(r)
  ------------------
29115|    933|            }
29116|       |
29117|  25.1k|            pushcap(s, capture_value, tag);
29118|  25.1k|            return text + width;
29119|  30.0k|        }
29120|       |
29121|      0|        case RULE_UNREF: {
  ------------------
  |  Branch (29121:9): [True: 0, False: 295M]
  ------------------
29122|      0|            int32_t tcap = s->tags->count;
29123|      0|            down1(s);
  ------------------
  |  |28464|      0|#define down1(s) do { \
  |  |28465|      0|    if (0 == --((s)->depth)) janet_panic("peg/match recursed too deeply"); \
  |  |  ------------------
  |  |  |  Branch (28465:9): [True: 0, False: 0]
  |  |  ------------------
  |  |28466|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (28466:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
29124|      0|            const uint8_t *result = peg_rule(s, s->bytecode + rule[1], text);
29125|      0|            up1(s);
  ------------------
  |  |28467|      0|#define up1(s) ((s)->depth++)
  ------------------
29126|      0|            if (!result) return NULL;
  ------------------
  |  Branch (29126:17): [True: 0, False: 0]
  ------------------
29127|      0|            int32_t final_tcap = s->tags->count;
29128|       |            /* Truncate tagged captures to not include items of the given tag */
29129|      0|            int32_t w = tcap;
29130|       |            /* If no tag is given, drop ALL tagged captures */
29131|      0|            if (rule[2]) {
  ------------------
  |  Branch (29131:17): [True: 0, False: 0]
  ------------------
29132|      0|                for (int32_t i = tcap; i < final_tcap; i++) {
  ------------------
  |  Branch (29132:40): [True: 0, False: 0]
  ------------------
29133|      0|                    if (s->tags->data[i] != (0xFF & rule[2])) {
  ------------------
  |  Branch (29133:25): [True: 0, False: 0]
  ------------------
29134|      0|                        s->tags->data[w] = s->tags->data[i];
29135|      0|                        s->tagged_captures->data[w] = s->tagged_captures->data[i];
29136|      0|                        w++;
29137|      0|                    }
29138|      0|                }
29139|      0|            }
29140|      0|            s->tags->count = w;
29141|      0|            s->tagged_captures->count = w;
29142|      0|            return result;
29143|      0|        }
29144|       |
29145|   295M|    }
29146|   295M|}
janet.c:cap_save:
28368|   274M|static CapState cap_save(PegState *s) {
28369|   274M|    CapState cs;
28370|   274M|    cs.scratch = s->scratch->count;
28371|   274M|    cs.cap = s->captures->count;
28372|   274M|    cs.tcap = s->tagged_captures->count;
28373|   274M|    return cs;
28374|   274M|}
janet.c:cap_load:
28377|  2.11M|static void cap_load(PegState *s, CapState cs) {
28378|  2.11M|    s->scratch->count = cs.scratch;
28379|  2.11M|    s->captures->count = cs.cap;
28380|  2.11M|    s->tags->count = cs.tcap;
28381|  2.11M|    s->tagged_captures->count = cs.tcap;
28382|  2.11M|}
janet.c:pushcap:
28392|  14.5M|static void pushcap(PegState *s, Janet capture, uint32_t tag) {
28393|  14.5M|    if (s->mode == PEG_MODE_ACCUMULATE) {
  ------------------
  |  Branch (28393:9): [True: 126k, False: 14.4M]
  ------------------
28394|   126k|        janet_to_string_b(s->scratch, capture);
28395|   126k|    }
28396|  14.5M|    if (s->mode == PEG_MODE_NORMAL) {
  ------------------
  |  Branch (28396:9): [True: 14.4M, False: 126k]
  ------------------
28397|  14.4M|        janet_array_push(s->captures, capture);
28398|  14.4M|    }
28399|  14.5M|    if (s->has_backref) {
  ------------------
  |  Branch (28399:9): [True: 90.8k, False: 14.4M]
  ------------------
28400|  90.8k|        janet_array_push(s->tagged_captures, capture);
28401|  90.8k|        janet_buffer_push_u8(s->tags, tag);
28402|  90.8k|    }
28403|  14.5M|}
janet.c:get_linecol_from_position:
28411|   836k|static LineCol get_linecol_from_position(PegState *s, int32_t position) {
28412|       |    /* Generate if not made yet */
28413|   836k|    if (s->linemaplen < 0) {
  ------------------
  |  Branch (28413:9): [True: 157, False: 836k]
  ------------------
28414|    157|        int32_t newline_count = 0;
28415|  3.19M|        for (const uint8_t *c = s->text_start; c < s->outer_text_end; c++) {
  ------------------
  |  Branch (28415:48): [True: 3.19M, False: 157]
  ------------------
28416|  3.19M|            if (*c == '\n') newline_count++;
  ------------------
  |  Branch (28416:17): [True: 1.21M, False: 1.98M]
  ------------------
28417|  3.19M|        }
28418|    157|        int32_t *mem = janet_smalloc(sizeof(int32_t) * newline_count);
28419|    157|        size_t index = 0;
28420|  3.19M|        for (const uint8_t *c = s->text_start; c < s->outer_text_end; c++) {
  ------------------
  |  Branch (28420:48): [True: 3.19M, False: 157]
  ------------------
28421|  3.19M|            if (*c == '\n') mem[index++] = (int32_t)(c - s->text_start);
  ------------------
  |  Branch (28421:17): [True: 1.21M, False: 1.98M]
  ------------------
28422|  3.19M|        }
28423|    157|        s->linemaplen = newline_count;
28424|    157|        s->linemap = mem;
28425|    157|    }
28426|       |    /* Do binary search for line. Slightly modified from classic binary search:
28427|       |     * - if we find that our current character is a line break, just return immediately.
28428|       |     *   a newline character is consider to be on the same line as the character before
28429|       |     *   (\n is line terminator, not line separator).
28430|       |     * - in the not-found case, we still want to find the greatest-indexed newline that
28431|       |     *   is before position. we use that to calculate the line and column.
28432|       |     * - in the case that lo = 0 and s->linemap[0] is still greater than position, we
28433|       |     *   are on the first line and our column is position + 1. */
28434|   836k|    int32_t hi = s->linemaplen; /* hi is greater than the actual line */
28435|   836k|    int32_t lo = 0; /* lo is less than or equal to the actual line */
28436|   836k|    LineCol ret;
28437|  8.70M|    while (lo + 1 < hi) {
  ------------------
  |  Branch (28437:12): [True: 7.86M, False: 836k]
  ------------------
28438|  7.86M|        int32_t mid = lo + (hi - lo) / 2;
28439|  7.86M|        if (s->linemap[mid] >= position) {
  ------------------
  |  Branch (28439:13): [True: 4.04M, False: 3.82M]
  ------------------
28440|  4.04M|            hi = mid;
28441|  4.04M|        } else {
28442|  3.82M|            lo = mid;
28443|  3.82M|        }
28444|  7.86M|    }
28445|       |    /* first line case */
28446|   836k|    if (s->linemaplen == 0 || (lo == 0 && s->linemap[0] >= position)) {
  ------------------
  |  Branch (28446:9): [True: 291, False: 836k]
  |  Branch (28446:32): [True: 339k, False: 496k]
  |  Branch (28446:43): [True: 320k, False: 19.6k]
  ------------------
28447|   320k|        ret.line = 1;
28448|   320k|        ret.col = position + 1;
28449|   516k|    } else {
28450|   516k|        ret.line = lo + 2;
28451|   516k|        ret.col = position - s->linemap[lo];
28452|   516k|    }
28453|   836k|    return ret;
28454|   836k|}
janet.c:cap_load_keept:
28386|   188k|static void cap_load_keept(PegState *s, CapState cs) {
28387|   188k|    s->scratch->count = cs.scratch;
28388|   188k|    s->captures->count = cs.cap;
28389|   188k|}
janet.c:peg_convert_u64_s64:
28457|  7.92k|static int64_t peg_convert_u64_s64(uint64_t from, int width) {
28458|  7.92k|    if (width == 0) return 0; /* Avoid undefined shift */
  ------------------
  |  Branch (28458:9): [True: 238, False: 7.69k]
  ------------------
28459|  7.69k|    int shift = 8 * (8 - width);
28460|  7.69k|    return ((int64_t)(from << shift)) >> shift;
28461|  7.92k|}
janet.c:number_to_string_b:
30472|  10.0M|static void number_to_string_b(JanetBuffer *buffer, double x) {
30473|  10.0M|    janet_buffer_extra(buffer, BUFSIZE);
  ------------------
  |  |30466|  10.0M|#define BUFSIZE 64
  ------------------
30474|  10.0M|    const char *fmt = (x == floor(x) &&
  ------------------
  |  Branch (30474:24): [True: 8.60M, False: 1.40M]
  ------------------
30475|  8.60M|                       x <= JANET_INTMAX_DOUBLE &&
  ------------------
  |  |  165|  18.6M|#define JANET_INTMAX_DOUBLE 9007199254740992.0
  ------------------
  |  Branch (30475:24): [True: 8.36M, False: 241k]
  ------------------
30476|  8.36M|                       x >= JANET_INTMIN_DOUBLE) ? "%.0f" : ("%." STR(DBL_DIG) "g");
  ------------------
  |  |  166|  8.36M|#define JANET_INTMIN_DOUBLE (-9007199254740992.0)
  ------------------
  |  Branch (30476:24): [True: 8.36M, False: 215]
  ------------------
30477|  10.0M|    int count;
30478|  10.0M|    if (x == 0.0) {
  ------------------
  |  Branch (30478:9): [True: 162k, False: 9.84M]
  ------------------
30479|       |        /* Prevent printing of '-0' */
30480|   162k|        count = 1;
30481|   162k|        buffer->data[buffer->count] = '0';
30482|  9.84M|    } else {
30483|  9.84M|        count = snprintf((char *) buffer->data + buffer->count, BUFSIZE, fmt, x);
  ------------------
  |  |30466|  9.84M|#define BUFSIZE 64
  ------------------
30484|  9.84M|    }
30485|  10.0M|    buffer->count += count;
30486|  10.0M|}
janet.c:string_description_b:
30532|  3.09k|static void string_description_b(JanetBuffer *buffer, const char *title, void *pointer) {
30533|  3.09k|    janet_buffer_extra(buffer, BUFSIZE);
  ------------------
  |  |30466|  3.09k|#define BUFSIZE 64
  ------------------
30534|  3.09k|    uint8_t *c = buffer->data + buffer->count;
30535|  3.09k|    int32_t i;
30536|  3.09k|    union {
30537|  3.09k|        uint8_t bytes[sizeof(void *)];
30538|  3.09k|        void *p;
30539|  3.09k|    } pbuf;
30540|       |
30541|  3.09k|    pbuf.p = pointer;
30542|  3.09k|    *c++ = '<';
30543|       |    /* Maximum of 32 bytes for abstract type name */
30544|  18.5k|    for (i = 0; i < 32 && title[i]; ++i)
  ------------------
  |  Branch (30544:17): [True: 18.5k, False: 0]
  |  Branch (30544:27): [True: 15.4k, False: 3.09k]
  ------------------
30545|  15.4k|        *c++ = ((uint8_t *)title) [i];
30546|  3.09k|    *c++ = ' ';
30547|  3.09k|    *c++ = '0';
30548|  3.09k|    *c++ = 'x';
30549|  3.09k|#if defined(JANET_NANBOX_64)
30550|  3.09k|#define POINTSIZE 6
30551|       |#else
30552|       |#define POINTSIZE (sizeof(void *))
30553|       |#endif
30554|  21.6k|    for (i = POINTSIZE; i > 0; --i) {
  ------------------
  |  |30550|  3.09k|#define POINTSIZE 6
  ------------------
  |  Branch (30554:25): [True: 18.5k, False: 3.09k]
  ------------------
30555|  18.5k|        uint8_t byte = pbuf.bytes[i - 1];
30556|  18.5k|        *c++ = HEX(byte >> 4);
  ------------------
  |  |30528|  18.5k|#define HEX(i) (((uint8_t *) janet_base64)[(i)])
  ------------------
30557|  18.5k|        *c++ = HEX(byte & 0xF);
  ------------------
  |  |30528|  18.5k|#define HEX(i) (((uint8_t *) janet_base64)[(i)])
  ------------------
30558|  18.5k|    }
30559|  3.09k|    *c++ = '>';
30560|  3.09k|    buffer->count = (int32_t)(c - buffer->data);
30561|  3.09k|#undef POINTSIZE
30562|  3.09k|}
janet.c:janet_escape_string_b:
30634|  13.0M|static void janet_escape_string_b(JanetBuffer *buffer, const uint8_t *str) {
30635|       |    janet_escape_string_impl(buffer, str, janet_string_length(str));
  ------------------
  |  | 1813|  13.0M|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  ------------------
  |  |  |  | 1812|  13.0M|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
30636|  13.0M|}
janet.c:janet_escape_string_impl:
30564|  13.0M|static int janet_escape_string_impl(JanetBuffer *buffer, const uint8_t *str, int32_t len) {
30565|  13.0M|    janet_buffer_push_u8(buffer, '"');
30566|  13.0M|    int align = 1;
30567|  97.2M|    for (int32_t i = 0; i < len; ++i) {
  ------------------
  |  Branch (30567:25): [True: 84.2M, False: 13.0M]
  ------------------
30568|  84.2M|        uint8_t c = str[i];
30569|  84.2M|        switch (c) {
30570|  77.4k|            case '"':
  ------------------
  |  Branch (30570:13): [True: 77.4k, False: 84.1M]
  ------------------
30571|  77.4k|                janet_buffer_push_bytes(buffer, (const uint8_t *)"\\\"", 2);
30572|  77.4k|                align += 2;
30573|  77.4k|                break;
30574|  14.1M|            case '\n':
  ------------------
  |  Branch (30574:13): [True: 14.1M, False: 70.0M]
  ------------------
30575|  14.1M|                janet_buffer_push_bytes(buffer, (const uint8_t *)"\\n", 2);
30576|  14.1M|                align += 2;
30577|  14.1M|                break;
30578|   618k|            case '\r':
  ------------------
  |  Branch (30578:13): [True: 618k, False: 83.6M]
  ------------------
30579|   618k|                janet_buffer_push_bytes(buffer, (const uint8_t *)"\\r", 2);
30580|   618k|                align += 2;
30581|   618k|                break;
30582|  9.40M|            case '\0':
  ------------------
  |  Branch (30582:13): [True: 9.40M, False: 74.8M]
  ------------------
30583|  9.40M|                janet_buffer_push_bytes(buffer, (const uint8_t *)"\\0", 2);
30584|  9.40M|                align += 2;
30585|  9.40M|                break;
30586|   716k|            case '\f':
  ------------------
  |  Branch (30586:13): [True: 716k, False: 83.5M]
  ------------------
30587|   716k|                janet_buffer_push_bytes(buffer, (const uint8_t *)"\\f", 2);
30588|   716k|                align += 2;
30589|   716k|                break;
30590|   103k|            case '\v':
  ------------------
  |  Branch (30590:13): [True: 103k, False: 84.1M]
  ------------------
30591|   103k|                janet_buffer_push_bytes(buffer, (const uint8_t *)"\\v", 2);
30592|   103k|                align += 2;
30593|   103k|                break;
30594|  15.5k|            case '\a':
  ------------------
  |  Branch (30594:13): [True: 15.5k, False: 84.2M]
  ------------------
30595|  15.5k|                janet_buffer_push_bytes(buffer, (const uint8_t *)"\\a", 2);
30596|  15.5k|                align += 2;
30597|  15.5k|                break;
30598|   553k|            case '\b':
  ------------------
  |  Branch (30598:13): [True: 553k, False: 83.6M]
  ------------------
30599|   553k|                janet_buffer_push_bytes(buffer, (const uint8_t *)"\\b", 2);
30600|   553k|                align += 2;
30601|   553k|                break;
30602|  42.6k|            case 27:
  ------------------
  |  Branch (30602:13): [True: 42.6k, False: 84.1M]
  ------------------
30603|  42.6k|                janet_buffer_push_bytes(buffer, (const uint8_t *)"\\e", 2);
30604|  42.6k|                align += 2;
30605|  42.6k|                break;
30606|  26.1k|            case '\\':
  ------------------
  |  Branch (30606:13): [True: 26.1k, False: 84.2M]
  ------------------
30607|  26.1k|                janet_buffer_push_bytes(buffer, (const uint8_t *)"\\\\", 2);
30608|  26.1k|                align += 2;
30609|  26.1k|                break;
30610|  29.9k|            case '\t':
  ------------------
  |  Branch (30610:13): [True: 29.9k, False: 84.2M]
  ------------------
30611|  29.9k|                janet_buffer_push_bytes(buffer, (const uint8_t *)"\\t", 2);
30612|  29.9k|                align += 2;
30613|  29.9k|                break;
30614|  58.4M|            default:
  ------------------
  |  Branch (30614:13): [True: 58.4M, False: 25.7M]
  ------------------
30615|  58.4M|                if (c < 32 || c > 126) {
  ------------------
  |  Branch (30615:21): [True: 3.25M, False: 55.2M]
  |  Branch (30615:31): [True: 4.59M, False: 50.6M]
  ------------------
30616|  7.85M|                    uint8_t buf[4];
30617|  7.85M|                    buf[0] = '\\';
30618|  7.85M|                    buf[1] = 'x';
30619|  7.85M|                    buf[2] = janet_base64[(c >> 4) & 0xF];
30620|  7.85M|                    buf[3] = janet_base64[c & 0xF];
30621|  7.85M|                    janet_buffer_push_bytes(buffer, buf, 4);
30622|  7.85M|                    align += 4;
30623|  50.6M|                } else {
30624|  50.6M|                    janet_buffer_push_u8(buffer, c);
30625|  50.6M|                    align++;
30626|  50.6M|                }
30627|  58.4M|                break;
30628|  84.2M|        }
30629|  84.2M|    }
30630|  13.0M|    janet_buffer_push_u8(buffer, '"');
30631|  13.0M|    return align + 1;
30632|  13.0M|}
janet.c:janet_escape_buffer_b:
30638|  14.6k|static void janet_escape_buffer_b(JanetBuffer *buffer, JanetBuffer *bx) {
30639|  14.6k|    if (bx == buffer) {
  ------------------
  |  Branch (30639:9): [True: 0, False: 14.6k]
  ------------------
30640|       |        /* Ensures buffer won't resize while escaping */
30641|      0|        int64_t new_size = 6 * (int64_t) bx->count + 3;
30642|      0|        if (new_size > INT32_MAX) janet_panic("buffer overflow");
  ------------------
  |  Branch (30642:13): [True: 0, False: 0]
  ------------------
30643|      0|        janet_buffer_ensure(bx, (int32_t) new_size, 1);
30644|      0|    }
30645|  14.6k|    janet_buffer_push_u8(buffer, '@');
30646|  14.6k|    janet_escape_string_impl(buffer, bx->data, bx->count);
30647|  14.6k|}
janet.c:janet_pretty_:
31261|  18.4M|                                  int flags, Janet x, int32_t startlen, int32_t lookback_barrier) {
31262|  18.4M|    struct pretty S;
31263|  18.4M|    if (NULL == buffer) {
  ------------------
  |  Branch (31263:9): [True: 0, False: 18.4M]
  ------------------
31264|      0|        buffer = janet_buffer(0);
31265|      0|    }
31266|  18.4M|    S.buffer = buffer;
31267|  18.4M|    S.depth = depth;
31268|  18.4M|    S.width = width;
31269|  18.4M|    S.align = 0;
31270|  18.4M|    S.flags = flags;
31271|  18.4M|    S.bufstartlen = startlen;
31272|  18.4M|    S.lookback_barrier = lookback_barrier;
31273|  18.4M|    S.keysort_capacity = 0;
31274|       |    S.keysort_buffer = NULL;
31275|  18.4M|    S.keysort_start = 0;
31276|  18.4M|    janet_table_init(&S.seen, 10);
31277|  18.4M|    janet_pretty_one(&S, x);
31278|  18.4M|    backtrack_newlines(&S);
31279|  18.4M|    janet_table_deinit(&S.seen);
31280|  18.4M|    return S.buffer;
31281|  18.4M|}
janet.c:janet_pretty_one:
31028|  51.8M|static void janet_pretty_one(struct pretty *S, Janet x) {
31029|       |    /* Add to seen */
31030|  51.8M|    switch (janet_type(x)) {
  ------------------
  |  |  795|  51.8M|    (isnan((x).number) \
  |  |  796|  51.8M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|  51.8M|        : JANET_NUMBER)
  ------------------
  |  Branch (31030:13): [True: 41.8M, False: 9.93M]
  ------------------
31031|   964k|        case JANET_NIL:
  ------------------
  |  Branch (31031:9): [True: 964k, False: 50.8M]
  ------------------
31032|  10.9M|        case JANET_NUMBER:
  ------------------
  |  Branch (31032:9): [True: 9.93M, False: 41.8M]
  ------------------
31033|  21.3M|        case JANET_SYMBOL:
  ------------------
  |  Branch (31033:9): [True: 10.4M, False: 41.3M]
  ------------------
31034|  21.3M|        case JANET_BOOLEAN:
  ------------------
  |  Branch (31034:9): [True: 5.47k, False: 51.8M]
  ------------------
31035|  21.3M|            break;
31036|  30.4M|        default: {
  ------------------
  |  Branch (31036:9): [True: 30.4M, False: 21.3M]
  ------------------
31037|  30.4M|            Janet seenid = janet_table_get(&S->seen, x);
31038|  30.4M|            if (janet_checktype(seenid, JANET_NUMBER)) {
  ------------------
  |  |  806|  30.4M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 0, False: 30.4M]
  |  |  |  Branch (806:6): [True: 30.4M, Folded]
  |  |  ------------------
  |  |  807|  30.4M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|  30.4M|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 0, False: 30.4M]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 30.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  30.4M|        : 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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
31039|      0|                if (S->flags & JANET_PRETTY_COLOR) {
  ------------------
  |  | 1967|      0|#define JANET_PRETTY_COLOR 1
  ------------------
  |  Branch (31039:21): [True: 0, False: 0]
  ------------------
31040|      0|                    janet_buffer_push_cstring(S->buffer, janet_cycle_color);
31041|      0|                }
31042|      0|                janet_buffer_push_cstring(S->buffer, "<cycle ");
31043|      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)
  |  |  ------------------
  ------------------
31044|      0|                janet_buffer_push_u8(S->buffer, '>');
31045|      0|                if (S->flags & JANET_PRETTY_COLOR) {
  ------------------
  |  | 1967|      0|#define JANET_PRETTY_COLOR 1
  ------------------
  |  Branch (31045:21): [True: 0, False: 0]
  ------------------
31046|      0|                    janet_buffer_push_cstring(S->buffer, "\x1B[0m");
31047|      0|                }
31048|      0|                return;
31049|  30.4M|            } else {
31050|  30.4M|                janet_table_put(&S->seen, x, janet_wrap_integer(S->seen.count));
  ------------------
  |  |  967|  30.4M|#define janet_wrap_integer(x) janet_wrap_number((int32_t)(x))
  |  |  ------------------
  |  |  |  |  835|  30.4M|#define janet_wrap_number(r) janet_nanbox_from_double(r)
  |  |  ------------------
  ------------------
31051|  30.4M|                break;
31052|  30.4M|            }
31053|  30.4M|        }
31054|  51.8M|    }
31055|       |
31056|  51.8M|    switch (janet_type(x)) {
  ------------------
  |  |  795|  51.8M|    (isnan((x).number) \
  |  |  796|  51.8M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|  51.8M|        : JANET_NUMBER)
  ------------------
  |  Branch (31056:13): [True: 41.8M, False: 9.93M]
  ------------------
31057|  36.0M|        default: {
  ------------------
  |  Branch (31057:9): [True: 36.0M, False: 15.7M]
  ------------------
31058|  36.0M|            const char *color = janet_pretty_colors[janet_type(x)];
  ------------------
  |  |  795|  36.0M|    (isnan((x).number) \
  |  |  796|  36.0M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|  36.0M|        : JANET_NUMBER)
  ------------------
  |  Branch (31058:53): [True: 26.1M, False: 9.93M]
  ------------------
31059|  36.0M|            if (color && (S->flags & JANET_PRETTY_COLOR)) {
  ------------------
  |  | 1967|  36.0M|#define JANET_PRETTY_COLOR 1
  ------------------
  |  Branch (31059:17): [True: 36.0M, False: 0]
  |  Branch (31059:26): [True: 0, False: 36.0M]
  ------------------
31060|      0|                janet_buffer_push_cstring(S->buffer, color);
31061|      0|            }
31062|  36.0M|            if (janet_checktype(x, JANET_BUFFER) && janet_unwrap_buffer(x) == S->buffer) {
  ------------------
  |  |  806|  72.1M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 6.39k, False: 36.0M]
  |  |  |  Branch (806:6): [Folded, False: 36.0M]
  |  |  ------------------
  |  |  807|  72.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|  72.1M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  36.0M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  36.0M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  36.0M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  36.0M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          if (janet_checktype(x, JANET_BUFFER) && janet_unwrap_buffer(x) == S->buffer) {
  ------------------
  |  |  862|  6.39k|#define janet_unwrap_buffer(x) ((JanetBuffer *)janet_nanbox_to_pointer(x))
  ------------------
  |  Branch (31062:53): [True: 0, False: 6.39k]
  ------------------
31063|      0|                int64_t new_size = (int64_t) S->buffer->count + S->bufstartlen * 4 + 3;
31064|      0|                if (new_size > INT32_MAX) janet_panic("buffer overflow");
  ------------------
  |  Branch (31064:21): [True: 0, False: 0]
  ------------------
31065|      0|                janet_buffer_ensure(S->buffer, (int32_t) new_size, 1);
31066|      0|                janet_buffer_push_u8(S->buffer, '@');
31067|       |                /* Use start len to print to self better */
31068|      0|                S->align += 1 + janet_escape_string_impl(S->buffer, S->buffer->data, S->bufstartlen);
31069|  36.0M|            } else {
31070|  36.0M|                S->align -= S->buffer->count;
31071|  36.0M|                janet_description_b(S->buffer, x);
31072|  36.0M|                S->align += S->buffer->count;
31073|  36.0M|            }
31074|  36.0M|            if (color && (S->flags & JANET_PRETTY_COLOR)) {
  ------------------
  |  | 1967|  36.0M|#define JANET_PRETTY_COLOR 1
  ------------------
  |  Branch (31074:17): [True: 36.0M, False: 0]
  |  Branch (31074:26): [True: 0, False: 36.0M]
  ------------------
31075|      0|                janet_buffer_push_cstring(S->buffer, "\x1B[0m");
31076|      0|            }
31077|  36.0M|            break;
31078|  36.0M|        }
31079|  1.63M|        case JANET_ARRAY:
  ------------------
  |  Branch (31079:9): [True: 1.63M, False: 50.1M]
  ------------------
31080|  9.69M|        case JANET_TUPLE: {
  ------------------
  |  Branch (31080:9): [True: 8.06M, False: 43.7M]
  ------------------
31081|  9.69M|            int32_t i = 0, len = 0;
31082|  9.69M|            const Janet *arr = NULL;
31083|  9.69M|            int isarray = janet_checktype(x, JANET_ARRAY);
  ------------------
  |  |  806|  9.69M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 9.69M]
  |  |  ------------------
  |  |  807|  9.69M|        ? 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.69M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  9.69M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  9.69M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  9.69M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  9.69M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
31084|  9.69M|            janet_indexed_view(x, &arr, &len);
31085|  9.69M|            int hasbrackets = !isarray && (janet_tuple_flag(arr) & JANET_TUPLE_FLAG_BRACKETCTOR);
  ------------------
  |  | 1806|  8.06M|#define janet_tuple_flag(t) (janet_tuple_head(t)->gc.flags)
  |  |  ------------------
  |  |  |  | 1800|  8.06M|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
                          int hasbrackets = !isarray && (janet_tuple_flag(arr) & JANET_TUPLE_FLAG_BRACKETCTOR);
  ------------------
  |  | 1798|  8.06M|#define JANET_TUPLE_FLAG_BRACKETCTOR 0x10000
  ------------------
  |  Branch (31085:31): [True: 8.06M, False: 1.63M]
  |  Branch (31085:43): [True: 3.25M, False: 4.80M]
  ------------------
31086|  9.69M|            const char *startstr = isarray ? "@[" : hasbrackets ? "[" : "(";
  ------------------
  |  Branch (31086:36): [True: 1.63M, False: 8.06M]
  |  Branch (31086:53): [True: 3.25M, False: 4.80M]
  ------------------
31087|  9.69M|            const char endchar = isarray ? ']' : hasbrackets ? ']' : ')';
  ------------------
  |  Branch (31087:34): [True: 1.63M, False: 8.06M]
  |  Branch (31087:50): [True: 3.25M, False: 4.80M]
  ------------------
31088|  9.69M|            janet_buffer_push_cstring(S->buffer, startstr);
31089|  9.69M|            S->align += (int32_t) strlen(startstr);
31090|  9.69M|            const int align = S->leaf_align = S->align;
31091|  9.69M|            S->depth--;
31092|  9.69M|            if (S->depth == 0) {
  ------------------
  |  Branch (31092:17): [True: 0, False: 9.69M]
  ------------------
31093|      0|                janet_buffer_push_cstring(S->buffer, "...");
31094|      0|                S->align += 3;
31095|  9.69M|            } else {
31096|  9.69M|                if (len > JANET_PRETTY_ARRAY_LIMIT && !(S->flags & JANET_PRETTY_NOTRUNC)) {
  ------------------
  |  |31025|  19.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 (31096:21): [True: 0, False: 9.69M]
  |  Branch (31096:55): [True: 0, False: 0]
  ------------------
31097|      0|                    for (i = 0; i < 3; i++) {
  ------------------
  |  Branch (31097:33): [True: 0, False: 0]
  ------------------
31098|      0|                        if (i) print_newline(S, align);
  ------------------
  |  Branch (31098:29): [True: 0, False: 0]
  ------------------
31099|      0|                        janet_pretty_one(S, arr[i]);
31100|      0|                    }
31101|      0|                    print_newline(S, align);
31102|      0|                    janet_buffer_push_cstring(S->buffer, "...");
31103|      0|                    S->align += 3;
31104|      0|                    for (i = len - 3; i < len; i++) {
  ------------------
  |  Branch (31104:39): [True: 0, False: 0]
  ------------------
31105|      0|                        print_newline(S, align);
31106|      0|                        janet_pretty_one(S, arr[i]);
31107|      0|                    }
31108|  9.69M|                } else {
31109|  29.2M|                    for (i = 0; i < len; i++) {
  ------------------
  |  Branch (31109:33): [True: 19.6M, False: 9.69M]
  ------------------
31110|  19.6M|                        if (i) print_newline(S, align);
  ------------------
  |  Branch (31110:29): [True: 11.4M, False: 8.14M]
  ------------------
31111|  19.6M|                        janet_pretty_one(S, arr[i]);
31112|  19.6M|                    }
31113|  9.69M|                }
31114|  9.69M|            }
31115|  9.69M|            S->depth++;
31116|  9.69M|            janet_buffer_push_u8(S->buffer, endchar);
31117|  9.69M|            S->align++;
31118|  9.69M|            break;
31119|  1.63M|        }
31120|  5.49M|        case JANET_STRUCT:
  ------------------
  |  Branch (31120:9): [True: 5.49M, False: 46.3M]
  ------------------
31121|  6.06M|        case JANET_TABLE: {
  ------------------
  |  Branch (31121:9): [True: 571k, False: 51.2M]
  ------------------
31122|  6.06M|            int istable = janet_checktype(x, JANET_TABLE);
  ------------------
  |  |  806|  6.06M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 6.06M]
  |  |  ------------------
  |  |  807|  6.06M|        ? 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|  6.06M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  6.06M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  6.06M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  6.06M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  6.06M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
31123|       |
31124|       |            /* For object-like tables, print class name */
31125|  6.06M|            if (istable) {
  ------------------
  |  Branch (31125:17): [True: 571k, False: 5.49M]
  ------------------
31126|   571k|                JanetTable *t = janet_unwrap_table(x);
  ------------------
  |  |  861|   571k|#define janet_unwrap_table(x) ((JanetTable *)janet_nanbox_to_pointer(x))
  ------------------
31127|   571k|                JanetTable *proto = t->proto;
31128|   571k|                S->align++;
31129|   571k|                janet_buffer_push_cstring(S->buffer, "@");
31130|   571k|                if (NULL != proto) {
  ------------------
  |  Branch (31130:21): [True: 0, False: 571k]
  ------------------
31131|      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)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
31132|      0|                    const uint8_t *n;
31133|      0|                    int32_t len;
31134|      0|                    if (janet_bytes_view(name, &n, &len)) {
  ------------------
  |  Branch (31134:25): [True: 0, False: 0]
  ------------------
31135|      0|                        if (S->flags & JANET_PRETTY_COLOR) {
  ------------------
  |  | 1967|      0|#define JANET_PRETTY_COLOR 1
  ------------------
  |  Branch (31135:29): [True: 0, False: 0]
  ------------------
31136|      0|                            janet_buffer_push_cstring(S->buffer, janet_class_color);
31137|      0|                        }
31138|      0|                        janet_buffer_push_bytes(S->buffer, n, len);
31139|      0|                        S->align += len;
31140|      0|                        if (S->flags & JANET_PRETTY_COLOR) {
  ------------------
  |  | 1967|      0|#define JANET_PRETTY_COLOR 1
  ------------------
  |  Branch (31140:29): [True: 0, False: 0]
  ------------------
31141|      0|                            janet_buffer_push_cstring(S->buffer, "\x1B[0m");
31142|      0|                        }
31143|      0|                    }
31144|      0|                }
31145|  5.49M|            } else {
31146|  5.49M|                JanetStruct st = janet_unwrap_struct(x);
  ------------------
  |  |  857|  5.49M|#define janet_unwrap_struct(x) ((JanetStruct)janet_nanbox_to_pointer(x))
  ------------------
31147|  5.49M|                JanetStruct proto = janet_struct_proto(st);
  ------------------
  |  | 1851|  5.49M|#define janet_struct_proto(t) (janet_struct_head(t)->proto)
  |  |  ------------------
  |  |  |  | 1846|  5.49M|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
31148|  5.49M|                if (NULL != proto) {
  ------------------
  |  Branch (31148:21): [True: 0, False: 5.49M]
  ------------------
31149|      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)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
31150|      0|                    const uint8_t *n;
31151|      0|                    int32_t len;
31152|      0|                    if (janet_bytes_view(name, &n, &len)) {
  ------------------
  |  Branch (31152:25): [True: 0, False: 0]
  ------------------
31153|      0|                        if (S->flags & JANET_PRETTY_COLOR) {
  ------------------
  |  | 1967|      0|#define JANET_PRETTY_COLOR 1
  ------------------
  |  Branch (31153:29): [True: 0, False: 0]
  ------------------
31154|      0|                            janet_buffer_push_cstring(S->buffer, janet_class_color);
31155|      0|                        }
31156|      0|                        janet_buffer_push_bytes(S->buffer, n, len);
31157|      0|                        S->align += len;
31158|      0|                        if (S->flags & JANET_PRETTY_COLOR) {
  ------------------
  |  | 1967|      0|#define JANET_PRETTY_COLOR 1
  ------------------
  |  Branch (31158:29): [True: 0, False: 0]
  ------------------
31159|      0|                            janet_buffer_push_cstring(S->buffer, "\x1B[0m");
31160|      0|                        }
31161|      0|                    }
31162|      0|                }
31163|  5.49M|            }
31164|  6.06M|            janet_buffer_push_u8(S->buffer, '{');
31165|  6.06M|            const int align = S->leaf_align = ++S->align;
31166|       |
31167|  6.06M|            S->depth--;
31168|  6.06M|            if (S->depth == 0) {
  ------------------
  |  Branch (31168:17): [True: 0, False: 6.06M]
  ------------------
31169|      0|                janet_buffer_push_cstring(S->buffer, "...");
31170|      0|                S->align += 3;
31171|  6.06M|            } else {
31172|  6.06M|                int32_t len = 0, cap = 0;
31173|  6.06M|                const JanetKV *kvs = NULL;
31174|  6.06M|                janet_dictionary_view(x, &kvs, &len, &cap);
31175|  6.06M|                int32_t ks_start = S->keysort_start;
31176|  6.06M|                int truncated = 0;
31177|       |
31178|       |                /* Shortcut for huge dictionaries, don't bother sorting keys */
31179|  6.06M|                if (len > JANET_PRETTY_DICT_KEYSORT_LIMIT) {
  ------------------
  |  |31024|  6.06M|#define JANET_PRETTY_DICT_KEYSORT_LIMIT 2000
  ------------------
  |  Branch (31179:21): [True: 0, False: 6.06M]
  ------------------
31180|      0|                    if (!(S->flags & JANET_PRETTY_NOTRUNC)) {
  ------------------
  |  | 1969|      0|#define JANET_PRETTY_NOTRUNC 4
  ------------------
  |  Branch (31180:25): [True: 0, False: 0]
  ------------------
31181|      0|                        len = JANET_PRETTY_DICT_LIMIT;
  ------------------
  |  |31023|      0|#define JANET_PRETTY_DICT_LIMIT 30
  ------------------
31182|      0|                        truncated = 1;
31183|      0|                    }
31184|      0|                    int32_t j = 0;
31185|      0|                    for (int32_t i = 0; i < len; i++) {
  ------------------
  |  Branch (31185:41): [True: 0, False: 0]
  ------------------
31186|      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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
31187|      0|                        if (i) print_newline(S, align);
  ------------------
  |  Branch (31187:29): [True: 0, False: 0]
  ------------------
31188|      0|                        janet_pretty_one(S, kvs[j].key);
31189|      0|                        janet_buffer_push_u8(S->buffer, ' ');
31190|      0|                        S->align++;
31191|      0|                        janet_pretty_one(S, kvs[j].value);
31192|      0|                        j++;
31193|      0|                    }
31194|      0|                    if (truncated) {
  ------------------
  |  Branch (31194:25): [True: 0, False: 0]
  ------------------
31195|      0|                        print_newline(S, align);
31196|      0|                        janet_buffer_push_cstring(S->buffer, "...");
31197|      0|                        S->align += 3;
31198|      0|                    }
31199|  6.06M|                } else {
31200|       |                    /* Sorted keys dictionaries */
31201|       |
31202|       |                    /* Ensure buffer is large enough to sort keys. */
31203|  6.06M|                    int64_t mincap = (int64_t) len + (int64_t) ks_start;
31204|  6.06M|                    if (mincap > INT32_MAX) {
  ------------------
  |  Branch (31204:25): [True: 0, False: 6.06M]
  ------------------
31205|      0|                        truncated = 1;
31206|      0|                        len = 0;
31207|      0|                        mincap = ks_start;
31208|      0|                    }
31209|       |
31210|  6.06M|                    if (S->keysort_capacity < mincap) {
  ------------------
  |  Branch (31210:25): [True: 2.28M, False: 3.78M]
  ------------------
31211|  2.28M|                        if (mincap >= INT32_MAX / 2) {
  ------------------
  |  Branch (31211:29): [True: 0, False: 2.28M]
  ------------------
31212|      0|                            S->keysort_capacity = INT32_MAX;
31213|  2.28M|                        } else {
31214|  2.28M|                            S->keysort_capacity = (int32_t)(mincap * 2);
31215|  2.28M|                        }
31216|  2.28M|                        S->keysort_buffer = janet_srealloc(S->keysort_buffer, sizeof(int32_t) * S->keysort_capacity);
31217|  2.28M|                        if (NULL == S->keysort_buffer) {
  ------------------
  |  Branch (31217:29): [True: 0, False: 2.28M]
  ------------------
31218|      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]
  |  |  ------------------
  ------------------
31219|      0|                        }
31220|  2.28M|                    }
31221|       |
31222|  6.06M|                    janet_sorted_keys(kvs, cap, S->keysort_buffer == NULL ? NULL : S->keysort_buffer + ks_start);
  ------------------
  |  Branch (31222:49): [True: 275k, False: 5.78M]
  ------------------
31223|  6.06M|                    S->keysort_start += len;
31224|  6.06M|                    if (!(S->flags & JANET_PRETTY_NOTRUNC) && (len > JANET_PRETTY_DICT_LIMIT)) {
  ------------------
  |  | 1969|  6.06M|#define JANET_PRETTY_NOTRUNC 4
  ------------------
                                  if (!(S->flags & JANET_PRETTY_NOTRUNC) && (len > JANET_PRETTY_DICT_LIMIT)) {
  ------------------
  |  |31023|  2.04k|#define JANET_PRETTY_DICT_LIMIT 30
  ------------------
  |  Branch (31224:25): [True: 2.04k, False: 6.06M]
  |  Branch (31224:63): [True: 7, False: 2.04k]
  ------------------
31225|      7|                        len = JANET_PRETTY_DICT_LIMIT;
  ------------------
  |  |31023|      7|#define JANET_PRETTY_DICT_LIMIT 30
  ------------------
31226|      7|                        truncated = 1;
31227|      7|                    }
31228|       |
31229|  12.9M|                    for (int32_t i = 0; i < len; i++) {
  ------------------
  |  Branch (31229:41): [True: 6.88M, False: 6.06M]
  ------------------
31230|  6.88M|                        if (i) print_newline(S, align);
  ------------------
  |  Branch (31230:29): [True: 3.47M, False: 3.40M]
  ------------------
31231|  6.88M|                        int32_t j = S->keysort_buffer[i + ks_start];
31232|  6.88M|                        janet_pretty_one(S, kvs[j].key);
31233|  6.88M|                        janet_buffer_push_u8(S->buffer, ' ');
31234|  6.88M|                        S->align++;
31235|  6.88M|                        janet_pretty_one(S, kvs[j].value);
31236|  6.88M|                    }
31237|       |
31238|  6.06M|                    if (truncated) {
  ------------------
  |  Branch (31238:25): [True: 7, False: 6.06M]
  ------------------
31239|      7|                        print_newline(S, align);
31240|      7|                        janet_buffer_push_cstring(S->buffer, "...");
31241|      7|                        S->align += 3;
31242|      7|                    }
31243|       |
31244|  6.06M|                }
31245|  6.06M|                S->keysort_start = ks_start;
31246|  6.06M|            }
31247|  6.06M|            S->depth++;
31248|  6.06M|            janet_buffer_push_u8(S->buffer, '}');
31249|  6.06M|            S->align++;
31250|  6.06M|            break;
31251|  6.06M|        }
31252|  51.8M|    }
31253|       |    /* Remove from seen */
31254|  51.8M|    janet_table_remove(&S->seen, x);
31255|  51.8M|    return;
31256|  51.8M|}
janet.c:print_newline:
30987|  14.9M|static void print_newline(struct pretty *S, int align) {
30988|  14.9M|    int i;
30989|  14.9M|    if (S->flags & JANET_PRETTY_ONELINE) {
  ------------------
  |  | 1968|  14.9M|#define JANET_PRETTY_ONELINE 2
  ------------------
  |  Branch (30989:9): [True: 0, False: 14.9M]
  ------------------
30990|      0|        janet_buffer_push_u8(S->buffer, ' ');
30991|      0|        return;
30992|      0|    }
30993|  14.9M|    backtrack_newlines(S);
30994|  14.9M|    janet_buffer_push_u8(S->buffer, '\n');
30995|  14.9M|    S->leaf_align = S->align = align;
30996|  73.2M|    for (i = 0; i < S->align; i++) {
  ------------------
  |  Branch (30996:17): [True: 58.2M, False: 14.9M]
  ------------------
30997|  58.2M|        janet_buffer_push_u8(S->buffer, ' ');
30998|  58.2M|    }
30999|  14.9M|}
janet.c:backtrack_newlines:
30927|  33.3M|static void backtrack_newlines(const struct pretty *S) {
30928|  33.3M|    if (S->flags & JANET_PRETTY_ONELINE || S->buffer->count <= 0)
  ------------------
  |  | 1968|  66.7M|#define JANET_PRETTY_ONELINE 2
  ------------------
  |  Branch (30928:9): [True: 0, False: 33.3M]
  |  Branch (30928:44): [True: 0, False: 33.3M]
  ------------------
30929|      0|        return;
30930|  33.3M|    switch (S->buffer->data[S->buffer->count - 1]) {
30931|  2.17M|        case ')':
  ------------------
  |  Branch (30931:9): [True: 2.17M, False: 31.2M]
  ------------------
30932|  5.17M|        case '}':
  ------------------
  |  Branch (30932:9): [True: 2.99M, False: 30.3M]
  ------------------
30933|  7.21M|        case ']':
  ------------------
  |  Branch (30933:9): [True: 2.03M, False: 31.3M]
  ------------------
30934|  7.21M|            break;
30935|  26.1M|        default:
  ------------------
  |  Branch (30935:9): [True: 26.1M, False: 7.21M]
  ------------------
30936|  26.1M|            return;
30937|  33.3M|    }
30938|  7.21M|    int32_t removed = 0;
30939|  7.21M|    int32_t old_count = S->buffer->count;
30940|  7.21M|    int32_t offset = old_count;
30941|  7.21M|    int32_t b0 = S->lookback_barrier;
30942|  7.21M|    int32_t columns = S->width;
30943|  7.21M|    int32_t align = 0;
30944|   157M|    while (--offset >= b0) {
  ------------------
  |  Branch (30944:12): [True: 156M, False: 181k]
  ------------------
30945|   156M|        const char *s = (const char *)S->buffer->data + offset;
30946|   156M|        if (*s == '\n') {
  ------------------
  |  Branch (30946:13): [True: 13.7M, False: 143M]
  ------------------
30947|  13.7M|            if (align < S->leaf_align) {
  ------------------
  |  Branch (30947:17): [True: 7.02M, False: 6.76M]
  ------------------
30948|  7.02M|                break;
30949|  7.02M|            }
30950|  6.76M|            columns += align;
30951|  6.76M|            removed += align;
30952|  6.76M|            align = 0;
30953|   143M|        } else if (*s == ' ') {
  ------------------
  |  Branch (30953:20): [True: 63.1M, False: 80.0M]
  ------------------
30954|  63.1M|            align++;
30955|  80.0M|        } else {
30956|  80.0M|            align = 0;
30957|       |            /* Don't count color sequences: \x1B(0|3\d)m */
30958|  80.0M|            if (S->flags & JANET_PRETTY_COLOR && *s == 'm') {
  ------------------
  |  | 1967|   160M|#define JANET_PRETTY_COLOR 1
  ------------------
  |  Branch (30958:17): [True: 0, False: 80.0M]
  |  Branch (30958:50): [True: 0, False: 0]
  ------------------
30959|      0|                if (offset >= (3 + b0) && strncmp("\x1B[0m", s - 3, 4) == 0) {
  ------------------
  |  Branch (30959:21): [True: 0, False: 0]
  |  Branch (30959:43): [True: 0, False: 0]
  ------------------
30960|      0|                    offset -= 3;
30961|      0|                    columns++;
30962|      0|                } else if (offset >= (4 + b0) && strncmp("\x1B[3", s - 4, 3) == 0) {
  ------------------
  |  Branch (30962:28): [True: 0, False: 0]
  |  Branch (30962:50): [True: 0, False: 0]
  ------------------
30963|      0|                    offset -= 4;
30964|      0|                    columns++;
30965|      0|                }
30966|      0|            }
30967|  80.0M|        }
30968|   149M|        if (--columns <= 0) {
  ------------------
  |  Branch (30968:13): [True: 3.55k, False: 149M]
  ------------------
30969|  3.55k|            return;
30970|  3.55k|        }
30971|   149M|    }
30972|  7.20M|    offset++; /* Don't mess with the last newline we found */
30973|  7.20M|    janet_assert(offset >= b0, "bad buffer index");
  ------------------
  |  |  389|  7.20M|#define janet_assert(c, m) do { \
  |  |  390|  7.20M|    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: 7.20M]
  |  |  ------------------
  |  |  391|  7.20M|} while (0)
  |  |  ------------------
  |  |  |  Branch (391:10): [Folded, False: 7.20M]
  |  |  ------------------
  ------------------
30974|  7.20M|    S->buffer->count -= removed;
30975|   127M|    for (int32_t i = offset; i < S->buffer->count; i++) {
  ------------------
  |  Branch (30975:30): [True: 120M, False: 7.20M]
  ------------------
30976|   120M|        if (S->buffer->data[offset] == '\n') {
  ------------------
  |  Branch (30976:13): [True: 6.73M, False: 113M]
  ------------------
30977|  6.73M|            S->buffer->data[i] = ' ';
30978|  35.6M|            while (S->buffer->data[++offset] == ' ') {
  ------------------
  |  Branch (30978:20): [True: 28.9M, False: 6.73M]
  ------------------
30979|  28.9M|                janet_assert(offset < old_count, "bad replacement of newline");
  ------------------
  |  |  389|  28.9M|#define janet_assert(c, m) do { \
  |  |  390|  28.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: 28.9M]
  |  |  ------------------
  |  |  391|  28.9M|} while (0)
  |  |  ------------------
  |  |  |  Branch (391:10): [Folded, False: 28.9M]
  |  |  ------------------
  ------------------
30980|  28.9M|            }
30981|   113M|        } else {
30982|   113M|            S->buffer->data[i] = S->buffer->data[offset++];
30983|   113M|        }
30984|   120M|    }
30985|  7.20M|}
janet.c:scanformat:
31380|  39.0M|    char precision[3]) {
31381|  39.0M|    const char *p = strfrmt;
31382|       |
31383|       |    /* Parse strfrmt */
31384|  39.0M|    memset(width, '\0', 3);
31385|  39.0M|    memset(precision, '\0', 3);
31386|  39.0M|    while (*p != '\0' && strchr(FMT_FLAGS, *p) != NULL)
  ------------------
  |  |31346|  39.0M|#define FMT_FLAGS "-+ #0"
  ------------------
  |  Branch (31386:12): [True: 39.0M, False: 0]
  |  Branch (31386:26): [True: 0, False: 39.0M]
  ------------------
31387|      0|        p++; /* skip flags */
31388|  39.0M|    if ((size_t)(p - strfrmt) >= sizeof(FMT_FLAGS)) janet_panic("invalid format (repeated flags)");
  ------------------
  |  |31346|  39.0M|#define FMT_FLAGS "-+ #0"
  ------------------
  |  Branch (31388:9): [True: 0, False: 39.0M]
  ------------------
31389|  39.0M|    if (isdigit((int)(*p)))
  ------------------
  |  Branch (31389:9): [True: 0, False: 39.0M]
  ------------------
31390|      0|        width[0] = *p++; /* skip width */
31391|  39.0M|    if (isdigit((int)(*p)))
  ------------------
  |  Branch (31391:9): [True: 0, False: 39.0M]
  ------------------
31392|      0|        width[1] = *p++; /* (2 digits at most) */
31393|  39.0M|    if (*p == '.') {
  ------------------
  |  Branch (31393:9): [True: 0, False: 39.0M]
  ------------------
31394|      0|        p++;
31395|      0|        if (isdigit((int)(*p)))
  ------------------
  |  Branch (31395:13): [True: 0, False: 0]
  ------------------
31396|      0|            precision[0] = *p++; /* skip precision */
31397|      0|        if (isdigit((int)(*p)))
  ------------------
  |  Branch (31397:13): [True: 0, False: 0]
  ------------------
31398|      0|            precision[1] = *p++; /* (2 digits at most) */
31399|      0|    }
31400|  39.0M|    if (isdigit((int)(*p)))
  ------------------
  |  Branch (31400:9): [True: 0, False: 39.0M]
  ------------------
31401|      0|        janet_panic("invalid format (width or precision too long)");
31402|       |
31403|       |    /* Write to form - replace characters with fixed size stuff */
31404|  39.0M|    *(form++) = '%';
31405|  39.0M|    const char *p2 = strfrmt;
31406|  78.1M|    while (p2 <= p) {
  ------------------
  |  Branch (31406:12): [True: 39.0M, False: 39.0M]
  ------------------
31407|  39.0M|        char *loc = strchr(FMT_REPLACE_INTTYPES, *p2);
  ------------------
  |  |31347|  39.0M|#define FMT_REPLACE_INTTYPES "diouxX"
  ------------------
31408|  39.0M|        if (loc != NULL && *loc != '\0') {
  ------------------
  |  Branch (31408:13): [True: 20.4M, False: 18.6M]
  |  Branch (31408:28): [True: 20.4M, False: 0]
  ------------------
31409|  20.4M|            const char *mapping = get_fmt_mapping(*p2++);
31410|  20.4M|            size_t len = strlen(mapping);
31411|  20.4M|            memcpy(form, mapping, len);
31412|  20.4M|            form += len;
31413|  20.4M|        } else {
31414|  18.6M|            *(form++) = *(p2++);
31415|  18.6M|        }
31416|  39.0M|    }
31417|  39.0M|    *form = '\0';
31418|       |
31419|  39.0M|    return p;
31420|  39.0M|}
janet.c:get_fmt_mapping:
31368|  20.4M|static const char *get_fmt_mapping(char c) {
31369|  61.2M|    for (size_t i = 0; i < (sizeof(format_mappings) / sizeof(struct FmtMapping)); i++) {
  ------------------
  |  Branch (31369:24): [True: 61.2M, False: 0]
  ------------------
31370|  61.2M|        if (format_mappings[i].c == c)
  ------------------
  |  Branch (31370:13): [True: 20.4M, False: 40.8M]
  ------------------
31371|  20.4M|            return format_mappings[i].mapping;
31372|  61.2M|    }
31373|      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]
  |  |  ------------------
  ------------------
31374|      0|}
janet.c:bignat_zero:
34217|  14.2k|static void bignat_zero(struct BigNat *x) {
34218|  14.2k|    x->first_digit = 0;
34219|  14.2k|    x->n = 0;
34220|  14.2k|    x->cap = 0;
34221|       |    x->digits = NULL;
34222|  14.2k|}
janet.c:bignat_muladd:
34249|  45.2k|static void bignat_muladd(struct BigNat *mant, uint32_t factor, uint32_t term) {
34250|  45.2k|    int32_t i;
34251|  45.2k|    uint64_t carry = ((uint64_t) mant->first_digit) * factor + term;
34252|  45.2k|    mant->first_digit = carry % BIGNAT_BASE;
  ------------------
  |  |34206|  45.2k|#define BIGNAT_BASE 0x80000000U
  ------------------
34253|  45.2k|    carry /= BIGNAT_BASE;
  ------------------
  |  |34206|  45.2k|#define BIGNAT_BASE 0x80000000U
  ------------------
34254|   320k|    for (i = 0; i < mant->n; i++) {
  ------------------
  |  Branch (34254:17): [True: 275k, False: 45.2k]
  ------------------
34255|   275k|        carry += ((uint64_t) mant->digits[i]) * factor;
34256|   275k|        mant->digits[i] = carry % BIGNAT_BASE;
  ------------------
  |  |34206|   275k|#define BIGNAT_BASE 0x80000000U
  ------------------
34257|   275k|        carry /= BIGNAT_BASE;
  ------------------
  |  |34206|   275k|#define BIGNAT_BASE 0x80000000U
  ------------------
34258|   275k|    }
34259|  45.2k|    if (carry) bignat_append(mant, (uint32_t) carry);
  ------------------
  |  Branch (34259:9): [True: 9.31k, False: 35.9k]
  ------------------
34260|  45.2k|}
janet.c:bignat_append:
34242|  9.31k|static void bignat_append(struct BigNat *mant, uint32_t dig) {
34243|  9.31k|    bignat_extra(mant, 1)[0] = dig;
34244|  9.31k|}
janet.c:bignat_extra:
34225|  10.3k|static uint32_t *bignat_extra(struct BigNat *mant, int32_t n) {
34226|  10.3k|    int32_t oldn = mant->n;
34227|  10.3k|    int32_t newn = oldn + n;
34228|  10.3k|    if (mant->cap < newn) {
  ------------------
  |  Branch (34228:9): [True: 3.32k, False: 7.07k]
  ------------------
34229|  3.32k|        int32_t newcap = 2 * newn;
34230|  3.32k|        uint32_t *mem = janet_realloc(mant->digits, (size_t) newcap * sizeof(uint32_t));
  ------------------
  |  | 2409|  3.32k|#define janet_realloc(X, Y) realloc((X), (Y))
  ------------------
34231|  3.32k|        if (NULL == mem) {
  ------------------
  |  Branch (34231:13): [True: 0, False: 3.32k]
  ------------------
34232|      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]
  |  |  ------------------
  ------------------
34233|      0|        }
34234|  3.32k|        mant->cap = newcap;
34235|  3.32k|        mant->digits = mem;
34236|  3.32k|    }
34237|  10.3k|    mant->n = newn;
34238|  10.3k|    return mant->digits + oldn;
34239|  10.3k|}
janet.c:convert:
34345|  10.2k|    int32_t exponent) {
34346|       |
34347|  10.2k|    int32_t exponent2 = 0;
34348|       |
34349|       |    /* Approximate exponent in base 2 of mant and exponent. This should get us a good estimate of the final size of the
34350|       |     * number, within * 2^32 or so. */
34351|  10.2k|    int64_t mant_exp2_approx = mant->n * 32 + 16;
34352|  10.2k|    int64_t exp_exp2_approx = (int64_t)(floor(log2(base) * exponent));
34353|  10.2k|    int64_t exp2_approx = mant_exp2_approx + exp_exp2_approx;
34354|       |
34355|       |    /* Short circuit zero, huge, and small numbers. We use the exponent range of valid IEEE754 doubles (-1022, 1023)
34356|       |     * with a healthy buffer to allow for inaccuracies in the approximation and denormailzed numbers. */
34357|  10.2k|    if (mant->n == 0 && mant->first_digit == 0)
  ------------------
  |  Branch (34357:9): [True: 9.90k, False: 301]
  |  Branch (34357:25): [True: 1.29k, False: 8.61k]
  ------------------
34358|  1.29k|        return negative ? -0.0 : 0.0;
  ------------------
  |  Branch (34358:16): [True: 63, False: 1.23k]
  ------------------
34359|  8.91k|    if (exp2_approx > 1176)
  ------------------
  |  Branch (34359:9): [True: 100, False: 8.81k]
  ------------------
34360|    100|        return negative ? -INFINITY : INFINITY;
  ------------------
  |  Branch (34360:16): [True: 19, False: 81]
  ------------------
34361|  8.81k|    if (exp2_approx < -1175)
  ------------------
  |  Branch (34361:9): [True: 83, False: 8.73k]
  ------------------
34362|     83|        return negative ? -0.0 : 0.0;
  ------------------
  |  Branch (34362:16): [True: 4, False: 79]
  ------------------
34363|       |
34364|       |    /* Final value is X = mant * base ^ exponent * 2 ^ exponent2
34365|       |     * Get exponent to zero while holding X constant. */
34366|       |
34367|       |    /* Positive exponents are simple */
34368|  28.6k|    for (; exponent > 3; exponent -= 4) bignat_muladd(mant, base * base * base * base, 0);
  ------------------
  |  Branch (34368:12): [True: 19.9k, False: 8.73k]
  ------------------
34369|  9.33k|    for (; exponent > 1; exponent -= 2) bignat_muladd(mant, base * base, 0);
  ------------------
  |  Branch (34369:12): [True: 602, False: 8.73k]
  ------------------
34370|  9.44k|    for (; exponent > 0; exponent -= 1) bignat_muladd(mant, base, 0);
  ------------------
  |  Branch (34370:12): [True: 710, False: 8.73k]
  ------------------
34371|       |
34372|       |    /* Negative exponents are tricky - we don't want to loose bits
34373|       |     * from integer division, so we need to premultiply. */
34374|  8.73k|    if (exponent < 0) {
  ------------------
  |  Branch (34374:9): [True: 1.07k, False: 7.65k]
  ------------------
34375|  1.07k|        int32_t shamt = 5 - exponent / 4;
34376|  1.07k|        bignat_lshift_n(mant, shamt);
34377|  1.07k|        exponent2 -= shamt * BIGNAT_NBIT;
  ------------------
  |  |34205|  1.07k|#define BIGNAT_NBIT 31
  ------------------
34378|  9.34k|        for (; exponent < -3; exponent += 4) bignat_div(mant, base * base * base * base);
  ------------------
  |  Branch (34378:16): [True: 8.26k, False: 1.07k]
  ------------------
34379|  1.52k|        for (; exponent < -1; exponent += 2) bignat_div(mant, base * base);
  ------------------
  |  Branch (34379:16): [True: 446, False: 1.07k]
  ------------------
34380|  1.76k|        for (; exponent <  0; exponent += 1) bignat_div(mant, base);
  ------------------
  |  Branch (34380:16): [True: 688, False: 1.07k]
  ------------------
34381|  1.07k|    }
34382|       |
34383|  8.73k|    return negative
  ------------------
  |  Branch (34383:12): [True: 872, False: 7.85k]
  ------------------
34384|  8.73k|           ? -bignat_extract(mant, exponent2)
34385|  8.73k|           : bignat_extract(mant, exponent2);
34386|  8.81k|}
janet.c:bignat_lshift_n:
34281|  1.07k|static void bignat_lshift_n(struct BigNat *mant, int n) {
34282|  1.07k|    if (!n) return;
  ------------------
  |  Branch (34282:9): [True: 0, False: 1.07k]
  ------------------
34283|  1.07k|    int32_t oldn = mant->n;
34284|  1.07k|    bignat_extra(mant, n);
34285|  1.07k|    memmove(mant->digits + n, mant->digits, sizeof(uint32_t) * oldn);
34286|  1.07k|    memset(mant->digits, 0, sizeof(uint32_t) * (n - 1));
34287|  1.07k|    mant->digits[n - 1] = mant->first_digit;
34288|  1.07k|    mant->first_digit = 0;
34289|  1.07k|}
janet.c:bignat_div:
34263|  9.39k|static void bignat_div(struct BigNat *mant, uint32_t divisor) {
34264|  9.39k|    int32_t i;
34265|  9.39k|    uint32_t quotient, remainder;
34266|  9.39k|    uint64_t dividend;
34267|  9.39k|    remainder = 0, quotient = 0;
34268|  1.16M|    for (i = mant->n - 1; i >= 0; i--) {
  ------------------
  |  Branch (34268:27): [True: 1.15M, False: 9.39k]
  ------------------
34269|  1.15M|        dividend = ((uint64_t)remainder * BIGNAT_BASE) + mant->digits[i];
  ------------------
  |  |34206|  1.15M|#define BIGNAT_BASE 0x80000000U
  ------------------
34270|  1.15M|        if (i < mant->n - 1) mant->digits[i + 1] = quotient;
  ------------------
  |  Branch (34270:13): [True: 1.14M, False: 9.39k]
  ------------------
34271|  1.15M|        quotient = (uint32_t)(dividend / divisor);
34272|  1.15M|        remainder = (uint32_t)(dividend % divisor);
34273|  1.15M|        mant->digits[i] = remainder;
34274|  1.15M|    }
34275|  9.39k|    dividend = ((uint64_t)remainder * BIGNAT_BASE) + mant->first_digit;
  ------------------
  |  |34206|  9.39k|#define BIGNAT_BASE 0x80000000U
  ------------------
34276|  9.39k|    if (mant->n && mant->digits[mant->n - 1] == 0) mant->n--;
  ------------------
  |  Branch (34276:9): [True: 9.39k, False: 0]
  |  Branch (34276:20): [True: 2.98k, False: 6.41k]
  ------------------
34277|  9.39k|    mant->first_digit = (uint32_t)(dividend / divisor);
34278|  9.39k|}
janet.c:bignat_extract:
34306|  8.73k|static double bignat_extract(struct BigNat *mant, int32_t exponent2) {
34307|  8.73k|    uint64_t top53;
34308|  8.73k|    int32_t n = mant->n;
34309|       |    /* Get most significant 53 bits from mant. Bit 52 (0 indexed) should
34310|       |     * always be 1. This is essentially a large right shift on mant.*/
34311|  8.73k|    if (n) {
  ------------------
  |  Branch (34311:9): [True: 2.02k, False: 6.70k]
  ------------------
34312|       |        /* Two or more digits */
34313|  2.02k|        uint64_t d1 = mant->digits[n - 1]; /* MSD (non-zero) */
34314|  2.02k|        uint64_t d2 = (n == 1) ? mant->first_digit : mant->digits[n - 2];
  ------------------
  |  Branch (34314:23): [True: 345, False: 1.67k]
  ------------------
34315|  2.02k|        uint64_t d3 = (n > 2) ? mant->digits[n - 3] : (n == 2) ? mant->first_digit : 0;
  ------------------
  |  Branch (34315:23): [True: 1.48k, False: 536]
  |  Branch (34315:55): [True: 191, False: 345]
  ------------------
34316|  2.02k|        int lz = clz((uint32_t) d1);
  ------------------
  |  |34292|  2.02k|#define clz(x) __builtin_clz(x)
  ------------------
34317|  2.02k|        int nbits = 32 - lz;
34318|       |        /* First get 54 bits */
34319|  2.02k|        top53 = (d2 << (54 - BIGNAT_NBIT)) + (d3 >> (2 * BIGNAT_NBIT - 54));
  ------------------
  |  |34205|  2.02k|#define BIGNAT_NBIT 31
  ------------------
                      top53 = (d2 << (54 - BIGNAT_NBIT)) + (d3 >> (2 * BIGNAT_NBIT - 54));
  ------------------
  |  |34205|  2.02k|#define BIGNAT_NBIT 31
  ------------------
34320|  2.02k|        top53 >>= nbits;
34321|  2.02k|        top53 |= (d1 << (54 - nbits));
34322|       |        /* Rounding based on lowest bit of 54 */
34323|  2.02k|        if (top53 & 1) top53++;
  ------------------
  |  Branch (34323:13): [True: 707, False: 1.31k]
  ------------------
34324|  2.02k|        top53 >>= 1;
34325|  2.02k|        if (top53 > 0x1FffffFFFFffffUL) {
  ------------------
  |  Branch (34325:13): [True: 40, False: 1.98k]
  ------------------
34326|     40|            top53 >>= 1;
34327|     40|            exponent2++;
34328|     40|        }
34329|       |        /* Correct exponent - to correct for large right shift to mantissa. */
34330|  2.02k|        exponent2 += (nbits - 53) + BIGNAT_NBIT * n;
  ------------------
  |  |34205|  2.02k|#define BIGNAT_NBIT 31
  ------------------
34331|  6.70k|    } else {
34332|       |        /* One digit */
34333|  6.70k|        top53 = mant->first_digit;
34334|  6.70k|    }
34335|  8.73k|    return ldexp((double)top53, exponent2);
34336|  8.73k|}
janet.c:scan_uint64:
34546|  2.93k|    int *neg) {
34547|  2.93k|    const uint8_t *end = str + len;
34548|  2.93k|    int seenadigit = 0;
34549|  2.93k|    int base = 10;
34550|  2.93k|    *neg = 0;
34551|  2.93k|    *out = 0;
34552|  2.93k|    uint64_t accum = 0;
34553|  2.93k|    if (len > JANET_NUMBER_LENGTH_RIDICULOUS) return 0;
  ------------------
  |  |34190|  2.93k|#define JANET_NUMBER_LENGTH_RIDICULOUS 0xFFFF
  ------------------
  |  Branch (34553:9): [True: 0, False: 2.93k]
  ------------------
34554|       |    /* Get sign */
34555|  2.93k|    if (str >= end) return 0;
  ------------------
  |  Branch (34555:9): [True: 0, False: 2.93k]
  ------------------
34556|  2.93k|    if (*str == '-') {
  ------------------
  |  Branch (34556:9): [True: 565, False: 2.37k]
  ------------------
34557|    565|        *neg = 1;
34558|    565|        str++;
34559|  2.37k|    } else if (*str == '+') {
  ------------------
  |  Branch (34559:16): [True: 128, False: 2.24k]
  ------------------
34560|    128|        str++;
34561|    128|    }
34562|       |    /* Check for leading 0x or digit digit r */
34563|  2.93k|    if (str + 1 < end && str[0] == '0' && str[1] == 'x') {
  ------------------
  |  Branch (34563:9): [True: 2.05k, False: 888]
  |  Branch (34563:26): [True: 384, False: 1.66k]
  |  Branch (34563:43): [True: 49, False: 335]
  ------------------
34564|     49|        base = 16;
34565|     49|        str += 2;
34566|  2.88k|    } else if (str + 1 < end  &&
  ------------------
  |  Branch (34566:16): [True: 2.00k, False: 888]
  ------------------
34567|  2.00k|               str[0] >= '0' && str[0] <= '9' &&
  ------------------
  |  Branch (34567:16): [True: 1.93k, False: 63]
  |  Branch (34567:33): [True: 1.84k, False: 95]
  ------------------
34568|  1.84k|               str[1] == 'r') {
  ------------------
  |  Branch (34568:16): [True: 41, False: 1.80k]
  ------------------
34569|     41|        base = str[0] - '0';
34570|     41|        str += 2;
34571|  2.84k|    } else if (str + 2 < end  &&
  ------------------
  |  Branch (34571:16): [True: 1.32k, False: 1.52k]
  ------------------
34572|  1.32k|               str[0] >= '0' && str[0] <= '9' &&
  ------------------
  |  Branch (34572:16): [True: 1.27k, False: 53]
  |  Branch (34572:33): [True: 1.19k, False: 77]
  ------------------
34573|  1.19k|               str[1] >= '0' && str[1] <= '9' &&
  ------------------
  |  Branch (34573:16): [True: 1.14k, False: 53]
  |  Branch (34573:33): [True: 998, False: 147]
  ------------------
34574|    998|               str[2] == 'r') {
  ------------------
  |  Branch (34574:16): [True: 83, False: 915]
  ------------------
34575|     83|        base = 10 * (str[0] - '0') + (str[1] - '0');
34576|     83|        if (base < 2 || base > 36) return 0;
  ------------------
  |  Branch (34576:13): [True: 10, False: 73]
  |  Branch (34576:25): [True: 25, False: 48]
  ------------------
34577|     48|        str += 3;
34578|     48|    }
34579|       |
34580|       |    /* Skip leading zeros */
34581|  3.65k|    while (str < end && *str == '0') {
  ------------------
  |  Branch (34581:12): [True: 3.31k, False: 339]
  |  Branch (34581:25): [True: 752, False: 2.56k]
  ------------------
34582|    752|        seenadigit = 1;
34583|    752|        str++;
34584|    752|    }
34585|       |    /* Parse significant digits */
34586|  14.6k|    while (str < end) {
  ------------------
  |  Branch (34586:12): [True: 12.2k, False: 2.40k]
  ------------------
34587|  12.2k|        if (*str == '_') {
  ------------------
  |  Branch (34587:13): [True: 1.01k, False: 11.2k]
  ------------------
34588|  1.01k|            if (!seenadigit) return 0;
  ------------------
  |  Branch (34588:17): [True: 99, False: 912]
  ------------------
34589|  11.2k|        } else {
34590|  11.2k|            int digit = digit_lookup[*str & 0x7F];
34591|  11.2k|            if (*str > 127 || digit >= base) return 0;
  ------------------
  |  Branch (34591:17): [True: 51, False: 11.1k]
  |  Branch (34591:31): [True: 281, False: 10.9k]
  ------------------
34592|  10.9k|            if (accum > (UINT64_MAX - digit) / base) return 0;
  ------------------
  |  Branch (34592:17): [True: 64, False: 10.8k]
  ------------------
34593|  10.8k|            accum = accum * base + digit;
34594|  10.8k|            seenadigit = 1;
34595|  10.8k|        }
34596|  11.7k|        str++;
34597|  11.7k|    }
34598|       |
34599|  2.40k|    if (!seenadigit) return 0;
  ------------------
  |  Branch (34599:9): [True: 129, False: 2.27k]
  ------------------
34600|  2.27k|    *out = accum;
34601|  2.27k|    return 1;
34602|  2.40k|}
janet.c:janet_dict_find:
  433|   171M|static inline const JanetKV *janet_dict_find(const JanetKV *buckets, int32_t cap, Janet key) {
  434|   171M|    int32_t hash;
  435|   171M|    if (janet_checktype(key, JANET_KEYWORD) || janet_checktype(key, JANET_SYMBOL)) {
  ------------------
  |  |  806|   342M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 28.6M, False: 142M]
  |  |  |  Branch (806:6): [Folded, False: 171M]
  |  |  ------------------
  |  |  807|   342M|        ? 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|   342M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|   171M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|   171M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|   171M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|   171M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if (janet_checktype(key, JANET_KEYWORD) || janet_checktype(key, JANET_SYMBOL)) {
  ------------------
  |  |  806|   142M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 29.9M, False: 112M]
  |  |  |  Branch (806:6): [Folded, False: 142M]
  |  |  ------------------
  |  |  807|   142M|        ? 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|   142M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|   142M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|   142M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|   142M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|   142M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  436|  58.6M|        hash = janet_string_hash(janet_unwrap_string(key));
  ------------------
  |  | 1814|  58.6M|#define janet_string_hash(s) (janet_string_head(s)->hash)
  |  |  ------------------
  |  |  |  | 1812|  58.6M|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
  437|   112M|    } else if (janet_checktypes(key, JANET_TFLAG_NIL | JANET_TFLAG_STRING | JANET_TFLAG_TUPLE | JANET_TFLAG_STRUCT | JANET_TFLAG_ABSTRACT) ||
  ------------------
  |  |  969|   224M|#define janet_checktypes(x, tps) ((1 << janet_type(x)) & (tps))
  |  |  ------------------
  |  |  |  |  795|   112M|    (isnan((x).number) \
  |  |  |  |  796|   112M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  |  |  797|   112M|        : JANET_NUMBER)
  |  |  ------------------
  |  |  |  Branch (969:34): [True: 84.8M, False: 27.5M]
  |  |  ------------------
  ------------------
  |  Branch (437:16): [True: 102M, False: 9.94M]
  ------------------
  438|  84.9M|               (janet_checktype(key, JANET_NUMBER) && janet_unwrap_number(key) == 0)) {
  ------------------
  |  |  806|  55.0M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 9.94M, False: 17.5M]
  |  |  |  Branch (806:6): [True: 27.5M, Folded]
  |  |  ------------------
  |  |  807|  55.0M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  803|  27.5M|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (803:6): [True: 9.94M, False: 17.5M]
  |  |  |  |  |  Branch (803:28): [True: 0, False: 17.5M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  808|  55.0M|        : 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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                             (janet_checktype(key, JANET_NUMBER) && janet_unwrap_number(key) == 0)) {
  ------------------
  |  |  839|  9.94M|#define janet_unwrap_number(x) ((x).number)
  ------------------
  |  Branch (438:55): [True: 98.1k, False: 9.84M]
  ------------------
  439|  84.9M|        return janet_dict_find_deep(buckets, cap, key);
  440|  84.9M|    } else {
  441|  27.4M|        hash = janet_hash(key);
  442|  27.4M|    }
  443|  86.1M|    uint32_t mask = (uint32_t) cap - 1;
  444|  86.1M|    uint32_t i = (uint32_t) hash & mask;
  445|  86.1M|    const JanetKV *first_bucket = NULL;
  446|   113M|    for (int32_t n = 0; n < cap; n++, i = (i + 1) & mask) {
  ------------------
  |  Branch (446:25): [True: 113M, False: 0]
  ------------------
  447|   113M|        const JanetKV *kv = buckets + i;
  448|   113M|        if (janet_bitwise_same(kv->key, key)) return kv;
  ------------------
  |  |  401|   113M|#define janet_bitwise_same(x, y) (janet_u64(x) == janet_u64(y))
  |  |  ------------------
  |  |  |  |  788|   113M|#define janet_u64(x) ((x).u64)
  |  |  ------------------
  |  |               #define janet_bitwise_same(x, y) (janet_u64(x) == janet_u64(y))
  |  |  ------------------
  |  |  |  |  788|   113M|#define janet_u64(x) ((x).u64)
  |  |  ------------------
  |  |  |  Branch (401:34): [True: 5.64M, False: 107M]
  |  |  ------------------
  ------------------
  449|   107M|        if (janet_checktype(kv->key, JANET_NIL)) {
  ------------------
  |  |  806|   107M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 82.6M, False: 25.2M]
  |  |  |  Branch (806:6): [Folded, False: 107M]
  |  |  ------------------
  |  |  807|   107M|        ? 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|   107M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|   107M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|   107M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|   107M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|   107M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  450|  82.6M|            if (janet_checktype(kv->value, JANET_NIL)) return kv;
  ------------------
  |  |  806|  82.6M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:5): [True: 80.4M, False: 2.18M]
  |  |  |  Branch (806:6): [Folded, False: 82.6M]
  |  |  ------------------
  |  |  807|  82.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|  82.6M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  82.6M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  82.6M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|  82.6M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|  82.6M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  451|  2.18M|            if (NULL == first_bucket) first_bucket = kv;
  ------------------
  |  Branch (451:17): [True: 1.52M, False: 657k]
  ------------------
  452|  2.18M|        }
  453|   107M|    }
  454|      0|    return first_bucket;
  455|  86.1M|}
janet.c:janet_symcache_findmem:
35074|  39.1M|    int *success) {
35075|  39.1M|    uint32_t bounds[4];
35076|  39.1M|    uint32_t i, j, index;
35077|  39.1M|    const uint8_t **firstEmpty = NULL;
35078|       |
35079|       |    /* We will search two ranges - index to the end,
35080|       |     * and 0 to the index. */
35081|  39.1M|    index = (uint32_t)hash & (janet_vm.cache_capacity - 1);
35082|  39.1M|    bounds[0] = index;
35083|  39.1M|    bounds[1] = janet_vm.cache_capacity;
35084|  39.1M|    bounds[2] = 0;
35085|  39.1M|    bounds[3] = index;
35086|  39.1M|    for (j = 0; j < 4; j += 2)
  ------------------
  |  Branch (35086:17): [True: 39.1M, False: 0]
  ------------------
35087|  60.9M|        for (i = bounds[j]; i < bounds[j + 1]; ++i) {
  ------------------
  |  Branch (35087:29): [True: 60.9M, False: 12.4k]
  ------------------
35088|  60.9M|            const uint8_t *test = janet_vm.cache[i];
35089|       |            /* Check empty spots */
35090|  60.9M|            if (NULL == test) {
  ------------------
  |  Branch (35090:17): [True: 21.7M, False: 39.1M]
  ------------------
35091|  21.7M|                if (NULL == firstEmpty)
  ------------------
  |  Branch (35091:21): [True: 21.7M, False: 0]
  ------------------
35092|  21.7M|                    firstEmpty = janet_vm.cache + i;
35093|  21.7M|                goto notfound;
35094|  21.7M|            }
35095|       |            /* Check for marked deleted */
35096|  39.1M|            if (JANET_SYMCACHE_DELETED == test) {
  ------------------
  |  Branch (35096:17): [True: 6.16k, False: 39.1M]
  ------------------
35097|  6.16k|                if (firstEmpty == NULL)
  ------------------
  |  Branch (35097:21): [True: 6.14k, False: 18]
  ------------------
35098|  6.14k|                    firstEmpty = janet_vm.cache + i;
35099|  6.16k|                continue;
35100|  6.16k|            }
35101|  39.1M|            if (janet_string_equalconst(test, str, len, hash)) {
  ------------------
  |  Branch (35101:17): [True: 17.4M, False: 21.7M]
  ------------------
35102|       |                /* Replace first deleted */
35103|  17.4M|                *success = 1;
35104|  17.4M|                if (firstEmpty != NULL) {
  ------------------
  |  Branch (35104:21): [True: 6.14k, False: 17.4M]
  ------------------
35105|  6.14k|                    *firstEmpty = test;
35106|  6.14k|                    janet_vm.cache[i] = JANET_SYMCACHE_DELETED;
35107|  6.14k|                    return firstEmpty;
35108|  6.14k|                }
35109|  17.4M|                return janet_vm.cache + i;
35110|  17.4M|            }
35111|  39.1M|        }
35112|  21.7M|notfound:
35113|  21.7M|    *success = 0;
35114|  21.7M|    janet_assert(firstEmpty != NULL, "symcache failed to get memory");
  ------------------
  |  |  389|  21.7M|#define janet_assert(c, m) do { \
  |  |  390|  21.7M|    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.7M]
  |  |  ------------------
  |  |  391|  21.7M|} while (0)
  |  |  ------------------
  |  |  |  Branch (391:10): [Folded, False: 21.7M]
  |  |  ------------------
  ------------------
35115|  21.7M|    return firstEmpty;
35116|  21.7M|}
janet.c:janet_symcache_put:
35152|  12.2M|static void janet_symcache_put(const uint8_t *x, const uint8_t **bucket) {
35153|  12.2M|    if ((janet_vm.cache_count + janet_vm.cache_deleted) * 2 > janet_vm.cache_capacity) {
  ------------------
  |  Branch (35153:9): [True: 12.2k, False: 12.2M]
  ------------------
35154|  12.2k|        int status;
35155|  12.2k|        janet_cache_resize(janet_tablen((2 * janet_vm.cache_count + 1)));
35156|  12.2k|        bucket = janet_symcache_find(x, &status);
  ------------------
  |  |35119|  12.2k|    janet_symcache_findmem((str), janet_string_length(str), janet_string_hash(str), (success))
  |  |  ------------------
  |  |  |  | 1813|  12.2k|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1812|  12.2k|#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|  12.2k|#define janet_string_hash(s) (janet_string_head(s)->hash)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1812|  12.2k|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
35157|  12.2k|    }
35158|       |    /* Add x to the cache */
35159|  12.2M|    janet_vm.cache_count++;
35160|  12.2M|    *bucket = x;
35161|  12.2M|}
janet.c:janet_cache_resize:
35122|  12.2k|static void janet_cache_resize(uint32_t newCapacity) {
35123|  12.2k|    uint32_t i, oldCapacity;
35124|  12.2k|    const uint8_t **oldCache = janet_vm.cache;
35125|  12.2k|    const uint8_t **newCache = janet_calloc(1, (size_t) newCapacity * sizeof(const uint8_t *));
  ------------------
  |  | 2412|  12.2k|#define janet_calloc(X, Y) calloc((X), (Y))
  ------------------
35126|  12.2k|    if (newCache == NULL) {
  ------------------
  |  Branch (35126:9): [True: 0, False: 12.2k]
  ------------------
35127|      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]
  |  |  ------------------
  ------------------
35128|      0|    }
35129|  12.2k|    oldCapacity = janet_vm.cache_capacity;
35130|  12.2k|    janet_vm.cache = newCache;
35131|  12.2k|    janet_vm.cache_capacity = newCapacity;
35132|  12.2k|    janet_vm.cache_deleted = 0;
35133|       |    /* Add all of the old cache entries back */
35134|  18.9M|    for (i = 0; i < oldCapacity; ++i) {
  ------------------
  |  Branch (35134:17): [True: 18.9M, False: 12.2k]
  ------------------
35135|  18.9M|        int status;
35136|  18.9M|        const uint8_t **bucket;
35137|  18.9M|        const uint8_t *x = oldCache[i];
35138|  18.9M|        if (x != NULL && x != JANET_SYMCACHE_DELETED) {
  ------------------
  |  Branch (35138:13): [True: 9.47M, False: 9.44M]
  |  Branch (35138:26): [True: 9.47M, False: 0]
  ------------------
35139|  9.47M|            bucket = janet_symcache_find(x, &status);
  ------------------
  |  |35119|  9.47M|    janet_symcache_findmem((str), janet_string_length(str), janet_string_hash(str), (success))
  |  |  ------------------
  |  |  |  | 1813|  9.47M|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1812|  9.47M|#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|  9.47M|#define janet_string_hash(s) (janet_string_head(s)->hash)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1812|  9.47M|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
35140|  9.47M|            if (status || bucket == NULL) {
  ------------------
  |  Branch (35140:17): [True: 0, False: 9.47M]
  |  Branch (35140:27): [True: 0, False: 9.47M]
  ------------------
35141|       |                /* there was a problem with the algorithm. */
35142|      0|                break;
35143|      0|            }
35144|  9.47M|            *bucket = x;
35145|  9.47M|        }
35146|  18.9M|    }
35147|       |    /* Free the old cache */
35148|  12.2k|    janet_free((void *)oldCache);
  ------------------
  |  | 2415|  12.2k|#define janet_free(X) free((X))
  ------------------
35149|  12.2k|}
janet.c:janet_table_init_impl:
35293|  22.9M|static JanetTable *janet_table_init_impl(JanetTable *table, int32_t capacity, int stackalloc) {
35294|  22.9M|    JanetKV *data;
35295|  22.9M|    capacity = janet_tablen(capacity);
35296|  22.9M|    if (stackalloc) table->gc.flags = JANET_TABLE_FLAG_STACK;
  ------------------
  |  |35279|  18.4M|#define JANET_TABLE_FLAG_STACK 0x10000
  ------------------
  |  Branch (35296:9): [True: 18.4M, False: 4.53M]
  ------------------
35297|  22.9M|    if (capacity) {
  ------------------
  |  Branch (35297:9): [True: 22.9M, False: 0]
  ------------------
35298|  22.9M|        if (stackalloc) {
  ------------------
  |  Branch (35298:13): [True: 18.4M, False: 4.53M]
  ------------------
35299|  18.4M|            data = janet_memalloc_empty_local(capacity);
35300|  18.4M|        } else {
35301|  4.53M|            data = (JanetKV *) janet_memalloc_empty(capacity);
35302|  4.53M|            if (NULL == data) {
  ------------------
  |  Branch (35302:17): [True: 0, False: 4.53M]
  ------------------
35303|      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]
  |  |  ------------------
  ------------------
35304|      0|            }
35305|  4.53M|        }
35306|  22.9M|        table->data = data;
35307|  22.9M|        table->capacity = capacity;
35308|  22.9M|    } else {
35309|      0|        table->data = NULL;
35310|      0|        table->capacity = 0;
35311|      0|    }
35312|  22.9M|    table->count = 0;
35313|  22.9M|    table->deleted = 0;
35314|       |    table->proto = NULL;
35315|  22.9M|    return table;
35316|  22.9M|}
janet.c:janet_memalloc_empty_local:
35281|  19.2M|static void *janet_memalloc_empty_local(int32_t count) {
35282|  19.2M|    int32_t i;
35283|  19.2M|    void *mem = janet_smalloc((size_t) count * sizeof(JanetKV));
35284|  19.2M|    JanetKV *mmem = (JanetKV *)mem;
35285|   327M|    for (i = 0; i < count; i++) {
  ------------------
  |  Branch (35285:17): [True: 308M, False: 19.2M]
  ------------------
35286|   308M|        JanetKV *kv = mmem + i;
35287|   308M|        kv->key = janet_wrap_nil();
  ------------------
  |  |  831|   308M|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|   308M|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|   308M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|   308M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
35288|   308M|        kv->value = janet_wrap_nil();
  ------------------
  |  |  831|   308M|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  822|   308M|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  793|   308M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  792|   308M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
35289|   308M|    }
35290|  19.2M|    return mem;
35291|  19.2M|}
janet.c:janet_table_rehash:
35366|  4.42M|static void janet_table_rehash(JanetTable *t, int32_t size) {
35367|  4.42M|    JanetKV *olddata = t->data;
35368|  4.42M|    JanetKV *newdata;
35369|  4.42M|    int islocal = t->gc.flags & JANET_TABLE_FLAG_STACK;
  ------------------
  |  |35279|  4.42M|#define JANET_TABLE_FLAG_STACK 0x10000
  ------------------
35370|  4.42M|    if (islocal) {
  ------------------
  |  Branch (35370:9): [True: 773k, False: 3.64M]
  ------------------
35371|   773k|        newdata = (JanetKV *) janet_memalloc_empty_local(size);
35372|  3.64M|    } else {
35373|  3.64M|        newdata = (JanetKV *) janet_memalloc_empty(size);
35374|  3.64M|        if (NULL == newdata) {
  ------------------
  |  Branch (35374:13): [True: 0, False: 3.64M]
  ------------------
35375|      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]
  |  |  ------------------
  ------------------
35376|      0|        }
35377|  3.64M|    }
35378|  4.42M|    int32_t oldcapacity = t->capacity;
35379|  4.42M|    t->data = newdata;
35380|  4.42M|    t->capacity = size;
35381|  4.42M|    t->deleted = 0;
35382|  56.9M|    for (int32_t i = 0; i < oldcapacity; i++) {
  ------------------
  |  Branch (35382:25): [True: 52.4M, False: 4.42M]
  ------------------
35383|  52.4M|        JanetKV *kv = olddata + i;
35384|  52.4M|        if (!janet_checktype(kv->key, JANET_NIL)) {
  ------------------
  |  |  806|  52.4M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (806:6): [Folded, False: 52.4M]
  |  |  ------------------
  |  |  807|  52.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|  52.4M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  800|  52.4M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  790|  52.4M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (35384:13): [True: 22.7M, False: 29.7M]
  ------------------
35385|  22.7M|            JanetKV *newkv = janet_table_find(t, kv->key);
35386|  22.7M|            *newkv = *kv;
35387|  22.7M|        }
35388|  52.4M|    }
35389|  4.42M|    if (islocal) {
  ------------------
  |  Branch (35389:9): [True: 773k, False: 3.64M]
  ------------------
35390|   773k|        janet_sfree(olddata);
35391|  3.64M|    } else {
35392|  3.64M|        janet_free(olddata);
  ------------------
  |  | 2415|  3.64M|#define janet_free(X) free((X))
  ------------------
35393|  3.64M|    }
35394|  4.42M|}
janet.c:janet_check_pointer_align:
36455|  2.21M|static void janet_check_pointer_align(void *p) {
36456|  2.21M|    (void) p;
36457|       |#if defined(JANET_NANBOX_64) && JANET_NANBOX_64_POINTER_SHIFT != 0
36458|       |    union {
36459|       |        void *p;
36460|       |        uintptr_t u;
36461|       |    } un;
36462|       |    un.p = p;
36463|       |    janet_assert(!(un.u & (uintptr_t)((1 << JANET_NANBOX_64_POINTER_SHIFT) - 1)),
36464|       |                 "unaligned pointer wrap - cfunction pointers and abstract types must be aligned with this nanboxing configuration.");
36465|       |#endif
36466|  2.21M|}
janet.c:janet_equals_containers:
37366|  6.02M|static int janet_equals_containers(Janet x, Janet y) {
37367|  6.02M|    janet_vm.traversal = janet_vm.traversal_base;
37368|  6.02M|    do {
37369|  6.02M|        if (janet_type(x) != janet_type(y)) return 0;
  ------------------
  |  |  795|  6.02M|    (isnan((x).number) \
  |  |  796|  6.02M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|  6.02M|        : JANET_NUMBER)
  ------------------
                      if (janet_type(x) != janet_type(y)) return 0;
  ------------------
  |  |  795|  6.02M|    (isnan((x).number) \
  |  |  796|  6.02M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|  6.02M|        : JANET_NUMBER)
  ------------------
  |  Branch (37369:13): [True: 6.02M, False: 185]
  |  Branch (37369:13): [True: 62, False: 6.02M]
  |  Branch (37369:30): [True: 6.02M, False: 179]
  ------------------
37370|  6.02M|        switch (janet_type(x)) {
  ------------------
  |  |  795|  6.02M|    (isnan((x).number) \
  |  |  796|  6.02M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|  6.02M|        : JANET_NUMBER)
  ------------------
  |  Branch (37370:17): [True: 6.02M, False: 176]
  ------------------
37371|  1.61k|            default:
  ------------------
  |  Branch (37371:13): [True: 1.61k, False: 6.02M]
  ------------------
37372|  1.61k|                if (!janet_equals_leaf(x, y)) return 0;
  ------------------
  |  Branch (37372:21): [True: 39, False: 1.57k]
  ------------------
37373|  1.57k|                break;
37374|  4.92M|            case JANET_TUPLE: {
  ------------------
  |  Branch (37374:13): [True: 4.92M, False: 1.09M]
  ------------------
37375|  4.92M|                const Janet *t1 = janet_unwrap_tuple(x);
  ------------------
  |  |  858|  4.92M|#define janet_unwrap_tuple(x) ((JanetTuple)janet_nanbox_to_pointer(x))
  ------------------
37376|  4.92M|                const Janet *t2 = janet_unwrap_tuple(y);
  ------------------
  |  |  858|  4.92M|#define janet_unwrap_tuple(x) ((JanetTuple)janet_nanbox_to_pointer(x))
  ------------------
37377|  4.92M|                if (t1 == t2) break;
  ------------------
  |  Branch (37377:21): [True: 0, False: 4.92M]
  ------------------
37378|  4.92M|                if (JANET_TUPLE_FLAG_BRACKETCTOR & (janet_tuple_flag(t1) ^ janet_tuple_flag(t2))) return 0;
  ------------------
  |  | 1798|  4.92M|#define JANET_TUPLE_FLAG_BRACKETCTOR 0x10000
  ------------------
                              if (JANET_TUPLE_FLAG_BRACKETCTOR & (janet_tuple_flag(t1) ^ janet_tuple_flag(t2))) return 0;
  ------------------
  |  | 1806|  4.92M|#define janet_tuple_flag(t) (janet_tuple_head(t)->gc.flags)
  |  |  ------------------
  |  |  |  | 1800|  4.92M|#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|  4.92M|#define janet_tuple_flag(t) (janet_tuple_head(t)->gc.flags)
  |  |  ------------------
  |  |  |  | 1800|  4.92M|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (37378:21): [True: 1.93M, False: 2.99M]
  ------------------
37379|  2.99M|                if (janet_tuple_hash(t1) != janet_tuple_hash(t2)) return 0;
  ------------------
  |  | 1803|  2.99M|#define janet_tuple_hash(t) (janet_tuple_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1800|  2.99M|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
                              if (janet_tuple_hash(t1) != janet_tuple_hash(t2)) return 0;
  ------------------
  |  | 1803|  2.99M|#define janet_tuple_hash(t) (janet_tuple_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1800|  2.99M|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (37379:21): [True: 2.99M, False: 786]
  ------------------
37380|    786|                if (janet_tuple_length(t1) != janet_tuple_length(t2)) return 0;
  ------------------
  |  | 1802|    786|#define janet_tuple_length(t) (janet_tuple_head(t)->length)
  |  |  ------------------
  |  |  |  | 1800|    786|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
                              if (janet_tuple_length(t1) != janet_tuple_length(t2)) return 0;
  ------------------
  |  | 1802|    786|#define janet_tuple_length(t) (janet_tuple_head(t)->length)
  |  |  ------------------
  |  |  |  | 1800|    786|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (37380:21): [True: 0, False: 786]
  ------------------
37381|    786|                push_traversal_node(janet_tuple_head(t1), janet_tuple_head(t2), 0);
  ------------------
  |  | 1800|    786|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  ------------------
                              push_traversal_node(janet_tuple_head(t1), janet_tuple_head(t2), 0);
  ------------------
  |  | 1800|    786|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  ------------------
37382|    786|                break;
37383|    786|            }
37384|  1.09M|            case JANET_STRUCT: {
  ------------------
  |  Branch (37384:13): [True: 1.09M, False: 4.92M]
  ------------------
37385|  1.09M|                const JanetKV *s1 = janet_unwrap_struct(x);
  ------------------
  |  |  857|  1.09M|#define janet_unwrap_struct(x) ((JanetStruct)janet_nanbox_to_pointer(x))
  ------------------
37386|  1.09M|                const JanetKV *s2 = janet_unwrap_struct(y);
  ------------------
  |  |  857|  1.09M|#define janet_unwrap_struct(x) ((JanetStruct)janet_nanbox_to_pointer(x))
  ------------------
37387|  1.09M|                if (s1 == s2) break;
  ------------------
  |  Branch (37387:21): [True: 0, False: 1.09M]
  ------------------
37388|  1.09M|                if (janet_struct_hash(s1) != janet_struct_hash(s2)) return 0;
  ------------------
  |  | 1850|  1.09M|#define janet_struct_hash(t) (janet_struct_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1846|  1.09M|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
                              if (janet_struct_hash(s1) != janet_struct_hash(s2)) return 0;
  ------------------
  |  | 1850|  1.09M|#define janet_struct_hash(t) (janet_struct_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1846|  1.09M|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (37388:21): [True: 1.09M, False: 225]
  ------------------
37389|    225|                if (janet_struct_length(s1) != janet_struct_length(s2)) return 0;
  ------------------
  |  | 1848|    225|#define janet_struct_length(t) (janet_struct_head(t)->length)
  |  |  ------------------
  |  |  |  | 1846|    225|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
                              if (janet_struct_length(s1) != janet_struct_length(s2)) return 0;
  ------------------
  |  | 1848|    225|#define janet_struct_length(t) (janet_struct_head(t)->length)
  |  |  ------------------
  |  |  |  | 1846|    225|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (37389:21): [True: 0, False: 225]
  ------------------
37390|    225|                if (janet_struct_proto(s1) && !janet_struct_proto(s2)) return 0;
  ------------------
  |  | 1851|    450|#define janet_struct_proto(t) (janet_struct_head(t)->proto)
  |  |  ------------------
  |  |  |  | 1846|    225|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  |  |  |  Branch (1851:31): [True: 0, False: 225]
  |  |  ------------------
  ------------------
                              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 (37390:47): [True: 0, False: 0]
  ------------------
37391|    225|                if (!janet_struct_proto(s1) && janet_struct_proto(s2)) return 0;
  ------------------
  |  | 1851|    450|#define janet_struct_proto(t) (janet_struct_head(t)->proto)
  |  |  ------------------
  |  |  |  | 1846|    225|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
                              if (!janet_struct_proto(s1) && janet_struct_proto(s2)) return 0;
  ------------------
  |  | 1851|    225|#define janet_struct_proto(t) (janet_struct_head(t)->proto)
  |  |  ------------------
  |  |  |  | 1846|    225|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  |  |  |  Branch (1851:31): [True: 0, False: 225]
  |  |  ------------------
  ------------------
  |  Branch (37391:21): [True: 225, False: 0]
  ------------------
37392|    225|                push_traversal_node(janet_struct_head(s1), janet_struct_head(s2), 0);
  ------------------
  |  | 1846|    225|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  ------------------
                              push_traversal_node(janet_struct_head(s1), janet_struct_head(s2), 0);
  ------------------
  |  | 1846|    225|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  ------------------
37393|    225|                break;
37394|    225|            }
37395|  6.02M|        }
37396|  6.02M|    } while (!traversal_next(&x, &y));
  ------------------
  |  Branch (37396:14): [True: 1.96k, False: 627]
  ------------------
37397|    627|    return 1;
37398|  6.02M|}
janet.c:janet_equals_leaf:
37353|  3.39k|static int janet_equals_leaf(Janet x, Janet y) {
37354|  3.39k|    switch (janet_type(x)) {
  ------------------
  |  |  795|  3.39k|    (isnan((x).number) \
  |  |  796|  3.39k|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  797|  3.39k|        : JANET_NUMBER)
  ------------------
  |  Branch (37354:13): [True: 3.03k, False: 356]
  ------------------
37355|    356|        case JANET_NUMBER:
  ------------------
  |  Branch (37355:9): [True: 356, False: 3.03k]
  ------------------
37356|    356|            return janet_unwrap_number(x) == janet_unwrap_number(y);
  ------------------
  |  |  839|    356|#define janet_unwrap_number(x) ((x).number)
  ------------------
                          return janet_unwrap_number(x) == janet_unwrap_number(y);
  ------------------
  |  |  839|    356|#define janet_unwrap_number(x) ((x).number)
  ------------------
37357|  1.44k|        case JANET_STRING:
  ------------------
  |  Branch (37357:9): [True: 1.44k, False: 1.94k]
  ------------------
37358|  1.44k|            return janet_string_equal(janet_unwrap_string(x), janet_unwrap_string(y));
  ------------------
  |  |  863|  1.44k|#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.44k|#define janet_unwrap_string(x) ((JanetString)janet_nanbox_to_pointer(x))
  ------------------
37359|    357|        case JANET_ABSTRACT:
  ------------------
  |  Branch (37359:9): [True: 357, False: 3.03k]
  ------------------
37360|    357|            return !janet_compare_abstract(janet_unwrap_abstract(x), janet_unwrap_abstract(y));
  ------------------
  |  |  866|    357|#define janet_unwrap_abstract(x) (janet_nanbox_to_pointer(x))
  ------------------
                          return !janet_compare_abstract(janet_unwrap_abstract(x), janet_unwrap_abstract(y));
  ------------------
  |  |  866|    357|#define janet_unwrap_abstract(x) (janet_nanbox_to_pointer(x))
  ------------------
37361|  1.23k|        default:
  ------------------
  |  Branch (37361:9): [True: 1.23k, False: 2.15k]
  ------------------
37362|  1.23k|            return janet_bitwise_same(x, y);
  ------------------
  |  |  401|  1.23k|#define janet_bitwise_same(x, y) (janet_u64(x) == janet_u64(y))
  |  |  ------------------
  |  |  |  |  788|  1.23k|#define janet_u64(x) ((x).u64)
  |  |  ------------------
  |  |               #define janet_bitwise_same(x, y) (janet_u64(x) == janet_u64(y))
  |  |  ------------------
  |  |  |  |  788|  1.23k|#define janet_u64(x) ((x).u64)
  |  |  ------------------
  ------------------
37363|  3.39k|    }
37364|  3.39k|}
janet.c:murmur64:
37406|  36.2M|static uint64_t murmur64(uint64_t h) {
37407|  36.2M|    h ^= h >> 33;
37408|  36.2M|    h *= 0xff51afd7ed558ccdUL;
37409|  36.2M|    h ^= h >> 33;
37410|  36.2M|    h *= 0xc4ceb9fe1a85ec53UL;
37411|  36.2M|    h ^= h >> 33;
37412|  36.2M|    return h;
37413|  36.2M|}
janet.c:janet_compare_abstract:
37339|  1.02k|static int janet_compare_abstract(JanetAbstract xx, JanetAbstract yy) {
37340|  1.02k|    if (xx == yy) return 0;
  ------------------
  |  Branch (37340:9): [True: 0, False: 1.02k]
  ------------------
37341|  1.02k|    const JanetAbstractType *xt = janet_abstract_type(xx);
  ------------------
  |  | 1899|  1.02k|#define janet_abstract_type(u) (janet_abstract_head(u)->type)
  |  |  ------------------
  |  |  |  | 1897|  1.02k|#define janet_abstract_head(u) ((JanetAbstractHead *)((char *)u - offsetof(JanetAbstractHead, data)))
  |  |  ------------------
  ------------------
37342|  1.02k|    const JanetAbstractType *yt = janet_abstract_type(yy);
  ------------------
  |  | 1899|  1.02k|#define janet_abstract_type(u) (janet_abstract_head(u)->type)
  |  |  ------------------
  |  |  |  | 1897|  1.02k|#define janet_abstract_head(u) ((JanetAbstractHead *)((char *)u - offsetof(JanetAbstractHead, data)))
  |  |  ------------------
  ------------------
37343|  1.02k|    if (xt != yt) {
  ------------------
  |  Branch (37343:9): [True: 131, False: 898]
  ------------------
37344|    131|        return xt > yt ? 1 : -1;
  ------------------
  |  Branch (37344:16): [True: 39, False: 92]
  ------------------
37345|    131|    }
37346|    898|    if (xt->compare == NULL) {
  ------------------
  |  Branch (37346:9): [True: 63, False: 835]
  ------------------
37347|     63|        return xx > yy ? 1 : -1;
  ------------------
  |  Branch (37347:16): [True: 6, False: 57]
  ------------------
37348|     63|    }
37349|    835|    return xt->compare(xx, yy);
37350|    898|}
janet.c:push_traversal_node:
37137|  5.47k|static void push_traversal_node(void *lhs, void *rhs, int32_t index2) {
37138|  5.47k|    JanetTraversalNode node;
37139|  5.47k|    node.self = (JanetGCObject *) lhs;
37140|  5.47k|    node.other = (JanetGCObject *) rhs;
37141|  5.47k|    node.index = 0;
37142|  5.47k|    node.index2 = index2;
37143|  5.47k|    int is_new = janet_vm.traversal_base == NULL;
37144|  5.47k|    if (is_new || (janet_vm.traversal + 1 >= janet_vm.traversal_top)) {
  ------------------
  |  Branch (37144:9): [True: 479, False: 4.99k]
  |  Branch (37144:19): [True: 0, False: 4.99k]
  ------------------
37145|    479|        size_t oldsize = is_new ? 0 : (janet_vm.traversal - janet_vm.traversal_base);
  ------------------
  |  Branch (37145:26): [True: 479, False: 0]
  ------------------
37146|    479|        size_t newsize = 2 * oldsize + 1;
37147|    479|        if (newsize < 128) {
  ------------------
  |  Branch (37147:13): [True: 479, False: 0]
  ------------------
37148|    479|            newsize = 128;
37149|    479|        }
37150|    479|        JanetTraversalNode *tn = janet_realloc(janet_vm.traversal_base, newsize * sizeof(JanetTraversalNode));
  ------------------
  |  | 2409|    479|#define janet_realloc(X, Y) realloc((X), (Y))
  ------------------
37151|    479|        if (tn == NULL) {
  ------------------
  |  Branch (37151:13): [True: 0, False: 479]
  ------------------
37152|      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]
  |  |  ------------------
  ------------------
37153|      0|        }
37154|    479|        janet_vm.traversal_base = tn;
37155|    479|        janet_vm.traversal_top = janet_vm.traversal_base + newsize;
37156|    479|        janet_vm.traversal = janet_vm.traversal_base + oldsize;
37157|    479|    }
37158|  5.47k|    *(++janet_vm.traversal) = node;
37159|  5.47k|}
janet.c:traversal_next:
37169|  11.5k|static int traversal_next(Janet *x, Janet *y) {
37170|  11.5k|    JanetTraversalNode *t = janet_vm.traversal;
37171|  13.0k|    while (t && t > janet_vm.traversal_base) {
  ------------------
  |  Branch (37171:12): [True: 12.8k, False: 234]
  |  Branch (37171:17): [True: 11.6k, False: 1.19k]
  ------------------
37172|  11.6k|        JanetGCObject *self = t->self;
37173|  11.6k|        JanetTupleHead *tself = (JanetTupleHead *)self;
37174|  11.6k|        JanetStructHead *sself = (JanetStructHead *)self;
37175|  11.6k|        JanetGCObject *other = t->other;
37176|  11.6k|        JanetTupleHead *tother = (JanetTupleHead *)other;
37177|  11.6k|        JanetStructHead *sother = (JanetStructHead *)other;
37178|  11.6k|        if ((self->flags & JANET_MEM_TYPEBITS) == JANET_MEMORY_TUPLE) {
  ------------------
  |  |  675|  11.6k|#define JANET_MEM_TYPEBITS 0xFF
  ------------------
  |  Branch (37178:13): [True: 9.81k, False: 1.80k]
  ------------------
37179|       |            /* Node is a tuple at index t->index */
37180|  9.81k|            if (t->index < tself->length && t->index < tother->length) {
  ------------------
  |  Branch (37180:17): [True: 8.82k, False: 992]
  |  Branch (37180:45): [True: 8.78k, False: 38]
  ------------------
37181|  8.78k|                int32_t index = t->index++;
37182|  8.78k|                *x = tself->data[index];
37183|  8.78k|                *y = tother->data[index];
37184|  8.78k|                janet_vm.traversal = t;
37185|  8.78k|                return 0;
37186|  8.78k|            }
37187|  1.03k|            if (t->index2 && tself->length != tother->length) {
  ------------------
  |  Branch (37187:17): [True: 404, False: 626]
  |  Branch (37187:30): [True: 65, False: 339]
  ------------------
37188|     65|                return tself->length > tother->length ? 3 : 1;
  ------------------
  |  Branch (37188:24): [True: 38, False: 27]
  ------------------
37189|     65|            }
37190|  1.80k|        } else {
37191|       |            /* Node is a struct at index t->index: if t->index2 is true, we should return the values. */
37192|  1.80k|            if (t->index2) {
  ------------------
  |  Branch (37192:17): [True: 624, False: 1.17k]
  ------------------
37193|    624|                t->index2 = 0;
37194|    624|                int32_t index = t->index++;
37195|    624|                *x = sself->data[index].value;
37196|    624|                *y = sother->data[index].value;
37197|    624|                janet_vm.traversal = t;
37198|    624|                return 0;
37199|    624|            }
37200|  1.17k|            for (int32_t i = t->index; i < sself->capacity; i++) {
  ------------------
  |  Branch (37200:40): [True: 624, False: 554]
  ------------------
37201|    624|                t->index2 = 1;
37202|    624|                *x = sself->data[t->index].key;
37203|    624|                *y = sother->data[t->index].key;
37204|    624|                janet_vm.traversal = t;
37205|    624|                return 0;
37206|    624|            }
37207|       |            /* Traverse prototype */
37208|    554|            JanetStruct sproto = sself->proto;
37209|    554|            JanetStruct oproto = sother->proto;
37210|    554|            if (sproto && !oproto) return 3;
  ------------------
  |  Branch (37210:17): [True: 0, False: 554]
  |  Branch (37210:27): [True: 0, False: 0]
  ------------------
37211|    554|            if (!sproto && oproto) return 1;
  ------------------
  |  Branch (37211:17): [True: 554, False: 0]
  |  Branch (37211:28): [True: 0, False: 554]
  ------------------
37212|    554|            if (oproto && sproto) {
  ------------------
  |  Branch (37212:17): [True: 0, False: 554]
  |  Branch (37212:27): [True: 0, False: 0]
  ------------------
37213|      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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
37214|      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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
37215|      0|                janet_vm.traversal = t - 1;
37216|      0|                return 0;
37217|      0|            }
37218|    554|        }
37219|  1.51k|        t--;
37220|  1.51k|    }
37221|  1.42k|    janet_vm.traversal = t;
37222|  1.42k|    return 2;
37223|  11.5k|}

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

