janet_array:
 1446|  1.06k|JanetArray *janet_array(int32_t capacity) {
 1447|  1.06k|    JanetArray *array = janet_gcalloc(JANET_MEMORY_ARRAY, sizeof(JanetArray));
 1448|  1.06k|    Janet *data = NULL;
 1449|  1.06k|    if (capacity > 0) {
  ------------------
  |  Branch (1449:9): [True: 861, False: 201]
  ------------------
 1450|    861|        janet_vm.next_collection += capacity * sizeof(Janet);
 1451|    861|        data = (Janet *) janet_malloc(sizeof(Janet) * (size_t) capacity);
  ------------------
  |  | 2150|    861|#define janet_malloc(X) malloc((X))
  ------------------
 1452|    861|        if (NULL == data) {
  ------------------
  |  Branch (1452:13): [True: 0, False: 861]
  ------------------
 1453|      0|            JANET_OUT_OF_MEMORY;
  ------------------
  |  |  360|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (360:122): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1454|      0|        }
 1455|    861|    }
 1456|  1.06k|    array->count = 0;
 1457|  1.06k|    array->capacity = capacity;
 1458|  1.06k|    array->data = data;
 1459|  1.06k|    return array;
 1460|  1.06k|}
janet_buffer_deinit:
 2973|  1.12M|void janet_buffer_deinit(JanetBuffer *buffer) {
 2974|  1.12M|    if (!(buffer->gc.flags & JANET_BUFFER_FLAG_NO_REALLOC)) {
  ------------------
  |  | 1590|  1.12M|#define JANET_BUFFER_FLAG_NO_REALLOC 0x10000
  ------------------
  |  Branch (2974:9): [True: 1.12M, False: 0]
  ------------------
 2975|  1.12M|        janet_free(buffer->data);
  ------------------
  |  | 2159|  1.12M|#define janet_free(X) free((X))
  ------------------
 2976|  1.12M|    }
 2977|  1.12M|}
janet_buffer:
 2980|  1.12M|JanetBuffer *janet_buffer(int32_t capacity) {
 2981|  1.12M|    JanetBuffer *buffer = janet_gcalloc(JANET_MEMORY_BUFFER, sizeof(JanetBuffer));
 2982|  1.12M|    return janet_buffer_init_impl(buffer, capacity);
 2983|  1.12M|}
janet_buffer_extra:
 3016|  22.0k|void janet_buffer_extra(JanetBuffer *buffer, int32_t n) {
 3017|       |    /* Check for buffer overflow */
 3018|  22.0k|    if ((int64_t)n + buffer->count > INT32_MAX) {
  ------------------
  |  Branch (3018:9): [True: 0, False: 22.0k]
  ------------------
 3019|      0|        janet_panic("buffer overflow");
 3020|      0|    }
 3021|  22.0k|    int32_t new_size = buffer->count + n;
 3022|  22.0k|    if (new_size > buffer->capacity) {
  ------------------
  |  Branch (3022:9): [True: 58, False: 22.0k]
  ------------------
 3023|     58|        janet_buffer_can_realloc(buffer);
 3024|     58|        int32_t new_capacity = (new_size > (INT32_MAX / 2)) ? INT32_MAX : (new_size * 2);
  ------------------
  |  Branch (3024:32): [True: 0, False: 58]
  ------------------
 3025|     58|        uint8_t *new_data = janet_realloc(buffer->data, new_capacity * sizeof(uint8_t));
  ------------------
  |  | 2153|     58|#define janet_realloc(X, Y) realloc((X), (Y))
  ------------------
 3026|     58|        janet_gcpressure(new_capacity - buffer->capacity);
 3027|     58|        if (NULL == new_data) {
  ------------------
  |  Branch (3027:13): [True: 0, False: 58]
  ------------------
 3028|      0|            JANET_OUT_OF_MEMORY;
  ------------------
  |  |  360|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (360:122): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3029|      0|        }
 3030|     58|        buffer->data = new_data;
 3031|     58|        buffer->capacity = new_capacity;
 3032|     58|    }
 3033|  22.0k|}
janet_buffer_push_cstring:
 3036|    284|void janet_buffer_push_cstring(JanetBuffer *buffer, const char *cstring) {
 3037|    284|    int32_t len = 0;
 3038|  6.49k|    while (cstring[len]) ++len;
  ------------------
  |  Branch (3038:12): [True: 6.20k, False: 284]
  ------------------
 3039|    284|    janet_buffer_push_bytes(buffer, (const uint8_t *) cstring, len);
 3040|    284|}
janet_buffer_push_bytes:
 3043|  1.12M|void janet_buffer_push_bytes(JanetBuffer *buffer, const uint8_t *string, int32_t length) {
 3044|  1.12M|    if (0 == length) return;
  ------------------
  |  Branch (3044:9): [True: 1.10M, False: 20.3k]
  ------------------
 3045|  20.3k|    janet_buffer_extra(buffer, length);
 3046|  20.3k|    memcpy(buffer->data + buffer->count, string, length);
 3047|  20.3k|    buffer->count += length;
 3048|  20.3k|}
janet_buffer_push_u8:
 3055|  1.72k|void janet_buffer_push_u8(JanetBuffer *buffer, uint8_t byte) {
 3056|  1.72k|    janet_buffer_extra(buffer, 1);
 3057|  1.72k|    buffer->data[buffer->count] = byte;
 3058|  1.72k|    buffer->count++;
 3059|  1.72k|}
janet_ev_init_common:
 8648|  5.24k|void janet_ev_init_common(void) {
 8649|  5.24k|    janet_q_init(&janet_vm.spawn);
 8650|  5.24k|    janet_vm.listener_count = 0;
 8651|  5.24k|    janet_vm.listener_cap = 0;
 8652|  5.24k|    janet_vm.listeners = NULL;
 8653|  5.24k|    janet_vm.tq = NULL;
 8654|  5.24k|    janet_vm.tq_count = 0;
 8655|  5.24k|    janet_vm.tq_capacity = 0;
 8656|  5.24k|    janet_table_init_raw(&janet_vm.threaded_abstracts, 0);
 8657|  5.24k|    janet_table_init_raw(&janet_vm.active_tasks, 0);
 8658|  5.24k|    janet_rng_seed(&janet_vm.ev_rng, 0);
 8659|  5.24k|#ifndef JANET_WINDOWS
 8660|  5.24k|    pthread_attr_init(&janet_vm.new_thread_attr);
 8661|  5.24k|    pthread_attr_setdetachstate(&janet_vm.new_thread_attr, PTHREAD_CREATE_DETACHED);
 8662|  5.24k|#endif
 8663|  5.24k|}
janet_ev_deinit_common:
 8666|  5.24k|void janet_ev_deinit_common(void) {
 8667|  5.24k|    janet_q_deinit(&janet_vm.spawn);
 8668|  5.24k|    janet_free(janet_vm.tq);
  ------------------
  |  | 2159|  5.24k|#define janet_free(X) free((X))
  ------------------
 8669|  5.24k|    janet_free(janet_vm.listeners);
  ------------------
  |  | 2159|  5.24k|#define janet_free(X) free((X))
  ------------------
 8670|  5.24k|    janet_vm.listeners = NULL;
 8671|  5.24k|    janet_table_deinit(&janet_vm.threaded_abstracts);
 8672|  5.24k|    janet_table_deinit(&janet_vm.active_tasks);
 8673|  5.24k|#ifndef JANET_WINDOWS
 8674|  5.24k|    pthread_attr_destroy(&janet_vm.new_thread_attr);
 8675|  5.24k|#endif
 8676|  5.24k|}
janet_ev_init:
 9762|  5.24k|void janet_ev_init(void) {
 9763|  5.24k|    janet_ev_init_common();
 9764|  5.24k|    janet_ev_setup_selfpipe();
 9765|  5.24k|    janet_vm.epoll = epoll_create1(EPOLL_CLOEXEC);
 9766|  5.24k|    janet_vm.timerfd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC | TFD_NONBLOCK);
 9767|  5.24k|    janet_vm.timer_enabled = 0;
 9768|  5.24k|    if (janet_vm.epoll == -1 || janet_vm.timerfd == -1) goto error;
  ------------------
  |  Branch (9768:9): [True: 0, False: 5.24k]
  |  Branch (9768:33): [True: 0, False: 5.24k]
  ------------------
 9769|  5.24k|    struct epoll_event ev;
 9770|  5.24k|    ev.events = EPOLLIN | EPOLLET;
 9771|  5.24k|    ev.data.ptr = &janet_vm.timerfd;
 9772|  5.24k|    if (-1 == epoll_ctl(janet_vm.epoll, EPOLL_CTL_ADD, janet_vm.timerfd, &ev)) goto error;
  ------------------
  |  Branch (9772:9): [True: 0, False: 5.24k]
  ------------------
 9773|  5.24k|    ev.events = EPOLLIN | EPOLLET;
 9774|  5.24k|    ev.data.ptr = janet_vm.selfpipe;
 9775|  5.24k|    if (-1 == epoll_ctl(janet_vm.epoll, EPOLL_CTL_ADD, janet_vm.selfpipe[0], &ev)) goto error;
  ------------------
  |  Branch (9775:9): [True: 0, False: 5.24k]
  ------------------
 9776|  5.24k|    return;
 9777|  5.24k|error:
 9778|      0|    JANET_EXIT("failed to initialize event loop");
  ------------------
  |  |  347|      0|#define JANET_EXIT(m) do { \
  |  |  348|      0|    fprintf(stderr, "C runtime error at line %d in file %s: %s\n",\
  |  |  349|      0|        __LINE__,\
  |  |  350|      0|        __FILE__,\
  |  |  351|      0|        (m));\
  |  |  352|      0|    exit(1);\
  |  |  353|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (353:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
 9779|      0|}
janet_ev_deinit:
 9781|  5.24k|void janet_ev_deinit(void) {
 9782|  5.24k|    janet_ev_deinit_common();
 9783|  5.24k|    close(janet_vm.epoll);
 9784|  5.24k|    close(janet_vm.timerfd);
 9785|  5.24k|    janet_ev_cleanup_selfpipe();
 9786|  5.24k|    janet_vm.epoll = 0;
 9787|  5.24k|}
janet_make_pipe:
10838|  5.24k|int janet_make_pipe(JanetHandle handles[2], int mode) {
10839|       |#ifdef JANET_WINDOWS
10840|       |    /*
10841|       |     * On windows, the built in CreatePipe function doesn't support overlapped IO
10842|       |     * so we lift from the windows source code and modify for our own version.
10843|       |     */
10844|       |    JanetHandle shandle, chandle;
10845|       |    CHAR PipeNameBuffer[MAX_PATH];
10846|       |    SECURITY_ATTRIBUTES saAttr;
10847|       |    memset(&saAttr, 0, sizeof(saAttr));
10848|       |    saAttr.nLength = sizeof(saAttr);
10849|       |    saAttr.bInheritHandle = TRUE;
10850|       |    sprintf(PipeNameBuffer,
10851|       |            "\\\\.\\Pipe\\JanetPipeFile.%08x.%08x",
10852|       |            (unsigned int) GetCurrentProcessId(),
10853|       |            (unsigned int) InterlockedIncrement(&PipeSerialNumber));
10854|       |
10855|       |    /* server handle goes to subprocess */
10856|       |    shandle = CreateNamedPipeA(
10857|       |                  PipeNameBuffer,
10858|       |                  (mode == 2 ? PIPE_ACCESS_INBOUND : PIPE_ACCESS_OUTBOUND) | FILE_FLAG_OVERLAPPED,
10859|       |                  PIPE_TYPE_BYTE | PIPE_WAIT,
10860|       |                  255,           /* Max number of pipes for duplication. */
10861|       |                  4096,          /* Out buffer size */
10862|       |                  4096,          /* In buffer size */
10863|       |                  120 * 1000,    /* Timeout in ms */
10864|       |                  &saAttr);
10865|       |    if (shandle == INVALID_HANDLE_VALUE) {
10866|       |        return -1;
10867|       |    }
10868|       |
10869|       |    /* we keep client handle */
10870|       |    chandle = CreateFileA(
10871|       |                  PipeNameBuffer,
10872|       |                  (mode == 2 ? GENERIC_WRITE : GENERIC_READ),
10873|       |                  0,
10874|       |                  &saAttr,
10875|       |                  OPEN_EXISTING,
10876|       |                  FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED,
10877|       |                  NULL);
10878|       |
10879|       |    if (chandle == INVALID_HANDLE_VALUE) {
10880|       |        CloseHandle(shandle);
10881|       |        return -1;
10882|       |    }
10883|       |    if (mode == 2) {
10884|       |        handles[0] = shandle;
10885|       |        handles[1] = chandle;
10886|       |    } else {
10887|       |        handles[0] = chandle;
10888|       |        handles[1] = shandle;
10889|       |    }
10890|       |    return 0;
10891|       |#else
10892|  5.24k|    if (pipe(handles)) return -1;
  ------------------
  |  Branch (10892:9): [True: 0, False: 5.24k]
  ------------------
10893|  5.24k|    if (mode != 2 && fcntl(handles[0], F_SETFD, FD_CLOEXEC)) goto error;
  ------------------
  |  Branch (10893:9): [True: 5.24k, False: 0]
  |  Branch (10893:22): [True: 0, False: 5.24k]
  ------------------
10894|  5.24k|    if (mode != 1 && fcntl(handles[1], F_SETFD, FD_CLOEXEC)) goto error;
  ------------------
  |  Branch (10894:9): [True: 5.24k, False: 0]
  |  Branch (10894:22): [True: 0, False: 5.24k]
  ------------------
10895|  5.24k|    if (mode != 2 && fcntl(handles[0], F_SETFL, O_NONBLOCK)) goto error;
  ------------------
  |  Branch (10895:9): [True: 5.24k, False: 0]
  |  Branch (10895:22): [True: 0, False: 5.24k]
  ------------------
10896|  5.24k|    if (mode != 1 && fcntl(handles[1], F_SETFL, O_NONBLOCK)) goto error;
  ------------------
  |  Branch (10896:9): [True: 5.24k, False: 0]
  |  Branch (10896:22): [True: 0, False: 5.24k]
  ------------------
10897|  5.24k|    return 0;
10898|      0|error:
10899|      0|    close(handles[0]);
10900|      0|    close(handles[1]);
10901|      0|    return -1;
10902|  5.24k|#endif
10903|  5.24k|}
janet_gcpressure:
13715|  1.12M|void janet_gcpressure(size_t s) {
13716|  1.12M|    janet_vm.next_collection += s;
13717|  1.12M|}
janet_gcalloc:
14054|  6.27M|void *janet_gcalloc(enum JanetMemoryType type, size_t size) {
14055|  6.27M|    JanetGCObject *mem;
14056|       |
14057|       |    /* Make sure everything is inited */
14058|  6.27M|    janet_assert(NULL != janet_vm.cache, "please initialize janet before use");
  ------------------
  |  |  358|  6.27M|#define janet_assert(c, m) do { \
  |  |  359|  6.27M|    if (!(c)) JANET_EXIT((m)); \
  |  |  ------------------
  |  |  |  |  347|      0|#define JANET_EXIT(m) do { \
  |  |  |  |  348|      0|    fprintf(stderr, "C runtime error at line %d in file %s: %s\n",\
  |  |  |  |  349|      0|        __LINE__,\
  |  |  |  |  350|      0|        __FILE__,\
  |  |  |  |  351|      0|        (m));\
  |  |  |  |  352|      0|    exit(1);\
  |  |  |  |  353|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (353:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (359:9): [True: 0, False: 6.27M]
  |  |  ------------------
  |  |  360|  6.27M|} while (0)
  |  |  ------------------
  |  |  |  Branch (360:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
14059|  6.27M|    mem = janet_malloc(size);
  ------------------
  |  | 2150|  6.27M|#define janet_malloc(X) malloc((X))
  ------------------
14060|       |
14061|       |    /* Check for bad malloc */
14062|  6.27M|    if (NULL == mem) {
  ------------------
  |  Branch (14062:9): [True: 0, False: 6.27M]
  ------------------
14063|      0|        JANET_OUT_OF_MEMORY;
  ------------------
  |  |  360|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (360:122): [Folded - Ignored]
  |  |  ------------------
  ------------------
14064|      0|    }
14065|       |
14066|       |    /* Configure block */
14067|  6.27M|    mem->flags = type;
14068|       |
14069|       |    /* Prepend block to heap list */
14070|  6.27M|    janet_vm.next_collection += size;
14071|  6.27M|    mem->data.next = janet_vm.blocks;
14072|  6.27M|    janet_vm.blocks = mem;
14073|  6.27M|    janet_vm.block_count++;
14074|       |
14075|  6.27M|    return (void *)mem;
14076|  6.27M|}
janet_gcroot:
14130|  5.24k|void janet_gcroot(Janet root) {
14131|  5.24k|    size_t newcount = janet_vm.root_count + 1;
14132|  5.24k|    if (newcount > janet_vm.root_capacity) {
  ------------------
  |  Branch (14132:9): [True: 5.24k, False: 0]
  ------------------
14133|  5.24k|        size_t newcap = 2 * newcount;
14134|  5.24k|        janet_vm.roots = janet_realloc(janet_vm.roots, sizeof(Janet) * newcap);
  ------------------
  |  | 2153|  5.24k|#define janet_realloc(X, Y) realloc((X), (Y))
  ------------------
14135|  5.24k|        if (NULL == janet_vm.roots) {
  ------------------
  |  Branch (14135:13): [True: 0, False: 5.24k]
  ------------------
14136|      0|            JANET_OUT_OF_MEMORY;
  ------------------
  |  |  360|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (360:122): [Folded - Ignored]
  |  |  ------------------
  ------------------
14137|      0|        }
14138|  5.24k|        janet_vm.root_capacity = newcap;
14139|  5.24k|    }
14140|  5.24k|    janet_vm.roots[janet_vm.root_count] = root;
14141|  5.24k|    janet_vm.root_count = newcount;
14142|  5.24k|}
janet_clear_memory:
14189|  5.24k|void janet_clear_memory(void) {
14190|  5.24k|#ifdef JANET_EV
14191|  5.24k|    JanetKV *items = janet_vm.threaded_abstracts.data;
14192|  10.4k|    for (int32_t i = 0; i < janet_vm.threaded_abstracts.capacity; i++) {
  ------------------
  |  Branch (14192:25): [True: 5.24k, False: 5.24k]
  ------------------
14193|  5.24k|        if (janet_checktype(items[i].key, JANET_ABSTRACT)) {
  ------------------
  |  |  730|  5.24k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (730:5): [True: 0, False: 5.24k]
  |  |  |  Branch (730:6): [Folded - Ignored]
  |  |  ------------------
  |  |  731|  5.24k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  727|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (727:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (727:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  732|  5.24k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  724|  5.24k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  714|  5.24k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|  5.24k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|  5.24k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
14194|      0|            void *abst = janet_unwrap_abstract(items[i].key);
  ------------------
  |  |  789|      0|#define janet_unwrap_abstract(x) (janet_nanbox_to_pointer(x))
  ------------------
14195|      0|            if (0 == janet_abstract_decref(abst)) {
  ------------------
  |  Branch (14195:17): [True: 0, False: 0]
  ------------------
14196|      0|                JanetAbstractHead *head = janet_abstract_head(abst);
  ------------------
  |  | 1704|      0|#define janet_abstract_head(u) ((JanetAbstractHead *)((char *)u - offsetof(JanetAbstractHead, data)))
  ------------------
14197|      0|                if (head->type->gc) {
  ------------------
  |  Branch (14197:21): [True: 0, False: 0]
  ------------------
14198|      0|                    janet_assert(!head->type->gc(head->data, head->size), "finalizer failed");
  ------------------
  |  |  358|      0|#define janet_assert(c, m) do { \
  |  |  359|      0|    if (!(c)) JANET_EXIT((m)); \
  |  |  ------------------
  |  |  |  |  347|      0|#define JANET_EXIT(m) do { \
  |  |  |  |  348|      0|    fprintf(stderr, "C runtime error at line %d in file %s: %s\n",\
  |  |  |  |  349|      0|        __LINE__,\
  |  |  |  |  350|      0|        __FILE__,\
  |  |  |  |  351|      0|        (m));\
  |  |  |  |  352|      0|    exit(1);\
  |  |  |  |  353|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (353:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (359:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  360|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (360:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
14199|      0|                }
14200|      0|                janet_free(janet_abstract_head(abst));
  ------------------
  |  | 2159|      0|#define janet_free(X) free((X))
  ------------------
14201|      0|            }
14202|      0|        }
14203|  5.24k|    }
14204|  5.24k|#endif
14205|  5.24k|    JanetGCObject *current = janet_vm.blocks;
14206|  6.28M|    while (NULL != current) {
  ------------------
  |  Branch (14206:12): [True: 6.27M, False: 5.24k]
  ------------------
14207|  6.27M|        janet_deinit_block(current);
14208|  6.27M|        JanetGCObject *next = current->data.next;
14209|  6.27M|        janet_free(current);
  ------------------
  |  | 2159|  6.27M|#define janet_free(X) free((X))
  ------------------
14210|  6.27M|        current = next;
14211|  6.27M|    }
14212|  5.24k|    janet_vm.blocks = NULL;
14213|  5.24k|    janet_free_all_scratch();
14214|  5.24k|    janet_free(janet_vm.scratch_mem);
  ------------------
  |  | 2159|  5.24k|#define janet_free(X) free((X))
  ------------------
14215|  5.24k|}
janet_default_rng:
17441|  5.24k|JanetRNG *janet_default_rng(void) {
17442|  5.24k|    return &janet_vm.rng;
17443|  5.24k|}
janet_rng_seed:
17445|  10.4k|void janet_rng_seed(JanetRNG *rng, uint32_t seed) {
17446|  10.4k|    rng->a = seed;
17447|  10.4k|    rng->b = 0x97654321u;
17448|  10.4k|    rng->c = 123871873u;
17449|  10.4k|    rng->d = 0xf23f56c8u;
17450|  10.4k|    rng->counter = 0u;
17451|       |    /* First several numbers aren't that random. */
17452|   178k|    for (int i = 0; i < 16; i++) janet_rng_u32(rng);
  ------------------
  |  Branch (17452:21): [True: 167k, False: 10.4k]
  ------------------
17453|  10.4k|}
janet_rng_u32:
17469|   167k|uint32_t janet_rng_u32(JanetRNG *rng) {
17470|       |    /* Algorithm "xorwow" from p. 5 of Marsaglia, "Xorshift RNGs" */
17471|   167k|    uint32_t t = rng->d;
17472|   167k|    uint32_t const s = rng->a;
17473|   167k|    rng->d = rng->c;
17474|   167k|    rng->c = rng->b;
17475|   167k|    rng->b = s;
17476|   167k|    t ^= t >> 2;
17477|   167k|    t ^= t << 1;
17478|   167k|    t ^= s ^ (s << 4);
17479|   167k|    rng->a = t;
17480|   167k|    rng->counter += 362437;
17481|   167k|    return t + rng->counter;
17482|   167k|}
janet_net_init:
18824|  5.24k|void janet_net_init(void) {
18825|       |#ifdef JANET_WINDOWS
18826|       |    WSADATA wsaData;
18827|       |    janet_assert(!WSAStartup(MAKEWORD(2, 2), &wsaData), "could not start winsock");
18828|       |#endif
18829|  5.24k|}
janet_net_deinit:
18831|  5.24k|void janet_net_deinit(void) {
18832|       |#ifdef JANET_WINDOWS
18833|       |    WSACleanup();
18834|       |#endif
18835|  5.24k|}
janet_is_symbol_char:
21446|  34.6M|int janet_is_symbol_char(uint8_t c) {
21447|  34.6M|    return symchars[c >> 5] & ((uint32_t)1 << (c & 0x1F));
21448|  34.6M|}
janet_valid_utf8:
21453|  2.38k|int janet_valid_utf8(const uint8_t *str, int32_t len) {
21454|  2.38k|    int32_t i = 0;
21455|  2.38k|    int32_t j;
21456|  12.1M|    while (i < len) {
  ------------------
  |  Branch (21456:12): [True: 12.1M, False: 2.17k]
  ------------------
21457|  12.1M|        int32_t nexti;
21458|  12.1M|        uint8_t c = str[i];
21459|       |
21460|       |        /* Check the number of bytes in code point */
21461|  12.1M|        if (c < 0x80) nexti = i + 1;
  ------------------
  |  Branch (21461:13): [True: 12.0M, False: 56.4k]
  ------------------
21462|  56.4k|        else if ((c >> 5) == 0x06) nexti = i + 2;
  ------------------
  |  Branch (21462:18): [True: 3.51k, False: 52.9k]
  ------------------
21463|  52.9k|        else if ((c >> 4) == 0x0E) nexti = i + 3;
  ------------------
  |  Branch (21463:18): [True: 1.43k, False: 51.5k]
  ------------------
21464|  51.5k|        else if ((c >> 3) == 0x1E) nexti = i + 4;
  ------------------
  |  Branch (21464:18): [True: 51.4k, False: 63]
  ------------------
21465|       |        /* Don't allow 5 or 6 byte code points */
21466|     63|        else return 0;
21467|       |
21468|       |        /* No overflow */
21469|  12.1M|        if (nexti > len) return 0;
  ------------------
  |  Branch (21469:13): [True: 93, False: 12.1M]
  ------------------
21470|       |
21471|       |        /* Ensure trailing bytes are well formed (10XX XXXX) */
21472|  12.2M|        for (j = i + 1; j < nexti; j++) {
  ------------------
  |  Branch (21472:25): [True: 160k, False: 12.1M]
  ------------------
21473|   160k|            if ((str[j] >> 6) != 2) return 0;
  ------------------
  |  Branch (21473:17): [True: 27, False: 160k]
  ------------------
21474|   160k|        }
21475|       |
21476|       |        /* Check for overlong encoding */
21477|  12.1M|        if ((nexti == i + 2) && str[i] < 0xC2) return 0;
  ------------------
  |  Branch (21477:13): [True: 3.44k, False: 12.1M]
  |  Branch (21477:33): [True: 8, False: 3.43k]
  ------------------
21478|  12.1M|        if ((str[i] == 0xE0) && str[i + 1] < 0xA0) return 0;
  ------------------
  |  Branch (21478:13): [True: 565, False: 12.1M]
  |  Branch (21478:33): [True: 14, False: 551]
  ------------------
21479|  12.1M|        if ((str[i] == 0xF0) && str[i + 1] < 0x90) return 0;
  ------------------
  |  Branch (21479:13): [True: 1.52k, False: 12.1M]
  |  Branch (21479:33): [True: 11, False: 1.51k]
  ------------------
21480|       |
21481|  12.1M|        i = nexti;
21482|  12.1M|    }
21483|  2.17k|    return 1;
21484|  2.38k|}
janet_parser_consume:
22083|  65.2M|void janet_parser_consume(JanetParser *parser, uint8_t c) {
22084|  65.2M|    int consumed = 0;
22085|  65.2M|    janet_parser_checkdead(parser);
22086|  65.2M|    if (c == '\r') {
  ------------------
  |  Branch (22086:9): [True: 16.2k, False: 65.2M]
  ------------------
22087|  16.2k|        parser->line++;
22088|  16.2k|        parser->column = 0;
22089|  65.2M|    } else if (c == '\n') {
  ------------------
  |  Branch (22089:16): [True: 1.01M, False: 64.1M]
  ------------------
22090|  1.01M|        parser->column = 0;
22091|  1.01M|        if (parser->lookback != '\r')
  ------------------
  |  Branch (22091:13): [True: 1.01M, False: 223]
  ------------------
22092|  1.01M|            parser->line++;
22093|  64.1M|    } else {
22094|  64.1M|        parser->column++;
22095|  64.1M|    }
22096|   138M|    while (!consumed && !parser->error) {
  ------------------
  |  Branch (22096:12): [True: 72.7M, False: 65.2M]
  |  Branch (22096:25): [True: 72.7M, False: 413]
  ------------------
22097|  72.7M|        JanetParseState *state = parser->states + parser->statecount - 1;
22098|  72.7M|        consumed = state->consumer(parser, state, c);
22099|  72.7M|    }
22100|  65.2M|    parser->lookback = c;
22101|  65.2M|}
janet_parser_status:
22116|  65.2M|enum JanetParserStatus janet_parser_status(JanetParser *parser) {
22117|  65.2M|    if (parser->error) return JANET_PARSE_ERROR;
  ------------------
  |  Branch (22117:9): [True: 108, False: 65.2M]
  ------------------
22118|  65.2M|    if (parser->flag) return JANET_PARSE_DEAD;
  ------------------
  |  Branch (22118:9): [True: 0, False: 65.2M]
  ------------------
22119|  65.2M|    if (parser->statecount > 1) return JANET_PARSE_PENDING;
  ------------------
  |  Branch (22119:9): [True: 65.1M, False: 40.1k]
  ------------------
22120|  40.1k|    return JANET_PARSE_ROOT;
22121|  65.2M|}
janet_parser_init:
22170|  5.24k|void janet_parser_init(JanetParser *parser) {
22171|  5.24k|    parser->args = NULL;
22172|  5.24k|    parser->states = NULL;
22173|  5.24k|    parser->buf = NULL;
22174|  5.24k|    parser->argcount = 0;
22175|  5.24k|    parser->argcap = 0;
22176|  5.24k|    parser->bufcount = 0;
22177|  5.24k|    parser->bufcap = 0;
22178|  5.24k|    parser->statecount = 0;
22179|  5.24k|    parser->statecap = 0;
22180|  5.24k|    parser->error = NULL;
22181|  5.24k|    parser->lookback = -1;
22182|  5.24k|    parser->line = 1;
22183|  5.24k|    parser->column = 0;
22184|  5.24k|    parser->pending = 0;
22185|  5.24k|    parser->flag = 0;
22186|       |
22187|  5.24k|    pushstate(parser, root, PFLAG_CONTAINER);
  ------------------
  |  |21534|  5.24k|#define PFLAG_CONTAINER 0x100
  ------------------
22188|  5.24k|}
janet_parser_deinit:
22190|  5.24k|void janet_parser_deinit(JanetParser *parser) {
22191|  5.24k|    janet_free(parser->args);
  ------------------
  |  | 2159|  5.24k|#define janet_free(X) free((X))
  ------------------
22192|  5.24k|    janet_free(parser->buf);
  ------------------
  |  | 2159|  5.24k|#define janet_free(X) free((X))
  ------------------
22193|  5.24k|    janet_free(parser->states);
  ------------------
  |  | 2159|  5.24k|#define janet_free(X) free((X))
  ------------------
22194|  5.24k|}
janet_formatbv:
25362|     58|void janet_formatbv(JanetBuffer *b, const char *format, va_list args) {
25363|     58|    const char *format_end = format + strlen(format);
25364|     58|    const char *c = format;
25365|     58|    int32_t startlen = b->count;
25366|  1.62k|    while (c < format_end) {
  ------------------
  |  Branch (25366:12): [True: 1.56k, False: 58]
  ------------------
25367|  1.56k|        if (*c != '%') {
  ------------------
  |  Branch (25367:13): [True: 1.45k, False: 116]
  ------------------
25368|  1.45k|            janet_buffer_push_u8(b, (uint8_t) *c++);
25369|  1.45k|        } else if (*++c == '%') {
  ------------------
  |  Branch (25369:20): [True: 0, False: 116]
  ------------------
25370|      0|            janet_buffer_push_u8(b, (uint8_t) *c++);
25371|    116|        } else {
25372|    116|            char form[MAX_FORMAT], item[MAX_ITEM];
25373|    116|            char width[3], precision[3];
25374|    116|            int nb = 0; /* number of bytes in added item */
25375|    116|            c = scanformat(c, form, width, precision);
25376|    116|            switch (*c++) {
25377|      0|                case 'c': {
  ------------------
  |  Branch (25377:17): [True: 0, False: 116]
  ------------------
25378|      0|                    int n = va_arg(args, long);
25379|      0|                    nb = snprintf(item, MAX_ITEM, form, n);
  ------------------
  |  |25287|      0|#define MAX_ITEM  256
  ------------------
25380|      0|                    break;
25381|      0|                }
25382|    116|                case 'd':
  ------------------
  |  Branch (25382:17): [True: 116, False: 0]
  ------------------
25383|    116|                case 'i': {
  ------------------
  |  Branch (25383:17): [True: 0, False: 116]
  ------------------
25384|    116|                    int64_t n = va_arg(args, int);
25385|    116|                    nb = snprintf(item, MAX_ITEM, form, n);
  ------------------
  |  |25287|    116|#define MAX_ITEM  256
  ------------------
25386|    116|                    break;
25387|    116|                }
25388|      0|                case 'x':
  ------------------
  |  Branch (25388:17): [True: 0, False: 116]
  ------------------
25389|      0|                case 'X':
  ------------------
  |  Branch (25389:17): [True: 0, False: 116]
  ------------------
25390|      0|                case 'o':
  ------------------
  |  Branch (25390:17): [True: 0, False: 116]
  ------------------
25391|      0|                case 'u': {
  ------------------
  |  Branch (25391:17): [True: 0, False: 116]
  ------------------
25392|      0|                    uint64_t n = va_arg(args, unsigned int);
25393|      0|                    nb = snprintf(item, MAX_ITEM, form, n);
  ------------------
  |  |25287|      0|#define MAX_ITEM  256
  ------------------
25394|      0|                    break;
25395|      0|                }
25396|      0|                case 'a':
  ------------------
  |  Branch (25396:17): [True: 0, False: 116]
  ------------------
25397|      0|                case 'A':
  ------------------
  |  Branch (25397:17): [True: 0, False: 116]
  ------------------
25398|      0|                case 'e':
  ------------------
  |  Branch (25398:17): [True: 0, False: 116]
  ------------------
25399|      0|                case 'E':
  ------------------
  |  Branch (25399:17): [True: 0, False: 116]
  ------------------
25400|      0|                case 'f':
  ------------------
  |  Branch (25400:17): [True: 0, False: 116]
  ------------------
25401|      0|                case 'g':
  ------------------
  |  Branch (25401:17): [True: 0, False: 116]
  ------------------
25402|      0|                case 'G': {
  ------------------
  |  Branch (25402:17): [True: 0, False: 116]
  ------------------
25403|      0|                    double d = va_arg(args, double);
25404|      0|                    nb = snprintf(item, MAX_ITEM, form, d);
  ------------------
  |  |25287|      0|#define MAX_ITEM  256
  ------------------
25405|      0|                    break;
25406|      0|                }
25407|      0|                case 's':
  ------------------
  |  Branch (25407:17): [True: 0, False: 116]
  ------------------
25408|      0|                case 'S': {
  ------------------
  |  Branch (25408:17): [True: 0, False: 116]
  ------------------
25409|      0|                    const char *str = va_arg(args, const char *);
25410|      0|                    int32_t len = c[-1] == 's'
  ------------------
  |  Branch (25410:35): [True: 0, False: 0]
  ------------------
25411|      0|                                  ? (int32_t) strlen(str)
25412|      0|                                  : janet_string_length((JanetString) str);
  ------------------
  |  | 1623|      0|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  ------------------
  |  |  |  | 1622|      0|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
25413|      0|                    if (form[2] == '\0')
  ------------------
  |  Branch (25413:25): [True: 0, False: 0]
  ------------------
25414|      0|                        janet_buffer_push_bytes(b, (const uint8_t *) str, len);
25415|      0|                    else {
25416|      0|                        if (len != (int32_t) strlen((const char *) str))
  ------------------
  |  Branch (25416:29): [True: 0, False: 0]
  ------------------
25417|      0|                            janet_panic("string contains zeros");
25418|      0|                        if (!strchr(form, '.') && len >= 100) {
  ------------------
  |  Branch (25418:29): [True: 0, False: 0]
  |  Branch (25418:51): [True: 0, False: 0]
  ------------------
25419|      0|                            janet_panic("no precision and string is too long to be formatted");
25420|      0|                        } else {
25421|      0|                            nb = snprintf(item, MAX_ITEM, form, str);
  ------------------
  |  |25287|      0|#define MAX_ITEM  256
  ------------------
25422|      0|                        }
25423|      0|                    }
25424|      0|                    break;
25425|      0|                }
25426|      0|                case 'V':
  ------------------
  |  Branch (25426:17): [True: 0, False: 116]
  ------------------
25427|      0|                    janet_to_string_b(b, va_arg(args, Janet));
25428|      0|                    break;
25429|      0|                case 'v':
  ------------------
  |  Branch (25429:17): [True: 0, False: 116]
  ------------------
25430|      0|                    janet_description_b(b, va_arg(args, Janet));
25431|      0|                    break;
25432|      0|                case 't':
  ------------------
  |  Branch (25432:17): [True: 0, False: 116]
  ------------------
25433|      0|                    janet_buffer_push_cstring(b, typestr(va_arg(args, Janet)));
25434|      0|                    break;
25435|      0|                case 'T': {
  ------------------
  |  Branch (25435:17): [True: 0, False: 116]
  ------------------
25436|      0|                    int types = va_arg(args, long);
25437|      0|                    pushtypes(b, types);
25438|      0|                    break;
25439|      0|                }
25440|      0|                case 'M':
  ------------------
  |  Branch (25440:17): [True: 0, False: 116]
  ------------------
25441|      0|                case 'm':
  ------------------
  |  Branch (25441:17): [True: 0, False: 116]
  ------------------
25442|      0|                case 'N':
  ------------------
  |  Branch (25442:17): [True: 0, False: 116]
  ------------------
25443|      0|                case 'n':
  ------------------
  |  Branch (25443:17): [True: 0, False: 116]
  ------------------
25444|      0|                case 'Q':
  ------------------
  |  Branch (25444:17): [True: 0, False: 116]
  ------------------
25445|      0|                case 'q':
  ------------------
  |  Branch (25445:17): [True: 0, False: 116]
  ------------------
25446|      0|                case 'P':
  ------------------
  |  Branch (25446:17): [True: 0, False: 116]
  ------------------
25447|      0|                case 'p': { /* janet pretty , precision = depth */
  ------------------
  |  Branch (25447:17): [True: 0, False: 116]
  ------------------
25448|      0|                    int depth = atoi(precision);
25449|      0|                    if (depth < 1) depth = JANET_RECURSION_GUARD;
  ------------------
  |  |  257|      0|#define JANET_RECURSION_GUARD 1024
  ------------------
  |  Branch (25449:25): [True: 0, False: 0]
  ------------------
25450|      0|                    char d = c[-1];
25451|      0|                    int has_color = (d == 'P') || (d == 'Q') || (d == 'M') || (d == 'N');
  ------------------
  |  Branch (25451:37): [True: 0, False: 0]
  |  Branch (25451:51): [True: 0, False: 0]
  |  Branch (25451:65): [True: 0, False: 0]
  |  Branch (25451:79): [True: 0, False: 0]
  ------------------
25452|      0|                    int has_oneline = (d == 'Q') || (d == 'q') || (d == 'N') || (d == 'n');
  ------------------
  |  Branch (25452:39): [True: 0, False: 0]
  |  Branch (25452:53): [True: 0, False: 0]
  |  Branch (25452:67): [True: 0, False: 0]
  |  Branch (25452:81): [True: 0, False: 0]
  ------------------
25453|      0|                    int has_notrunc = (d == 'M') || (d == 'm') || (d == 'N') || (d == 'n');
  ------------------
  |  Branch (25453:39): [True: 0, False: 0]
  |  Branch (25453:53): [True: 0, False: 0]
  |  Branch (25453:67): [True: 0, False: 0]
  |  Branch (25453:81): [True: 0, False: 0]
  ------------------
25454|      0|                    int flags = 0;
25455|      0|                    flags |= has_color ? JANET_PRETTY_COLOR : 0;
  ------------------
  |  | 1753|      0|#define JANET_PRETTY_COLOR 1
  ------------------
  |  Branch (25455:30): [True: 0, False: 0]
  ------------------
25456|      0|                    flags |= has_oneline ? JANET_PRETTY_ONELINE : 0;
  ------------------
  |  | 1754|      0|#define JANET_PRETTY_ONELINE 2
  ------------------
  |  Branch (25456:30): [True: 0, False: 0]
  ------------------
25457|      0|                    flags |= has_notrunc ? JANET_PRETTY_NOTRUNC : 0;
  ------------------
  |  | 1755|      0|#define JANET_PRETTY_NOTRUNC 4
  ------------------
  |  Branch (25457:30): [True: 0, False: 0]
  ------------------
25458|      0|                    janet_pretty_(b, depth, flags, va_arg(args, Janet), startlen);
25459|      0|                    break;
25460|      0|                }
25461|      0|                case 'j': {
  ------------------
  |  Branch (25461:17): [True: 0, False: 116]
  ------------------
25462|      0|                    int depth = atoi(precision);
25463|      0|                    if (depth < 1)
  ------------------
  |  Branch (25463:25): [True: 0, False: 0]
  ------------------
25464|      0|                        depth = JANET_RECURSION_GUARD;
  ------------------
  |  |  257|      0|#define JANET_RECURSION_GUARD 1024
  ------------------
25465|      0|                    janet_jdn_(b, depth, va_arg(args, Janet), startlen);
25466|      0|                    break;
25467|      0|                }
25468|      0|                default: {
  ------------------
  |  Branch (25468:17): [True: 0, False: 116]
  ------------------
25469|       |                    /* also treat cases 'nLlh' */
25470|      0|                    janet_panicf("invalid conversion '%s' to 'format'",
25471|      0|                                 form);
25472|      0|                }
25473|    116|            }
25474|    116|            if (nb >= MAX_ITEM)
  ------------------
  |  |25287|    116|#define MAX_ITEM  256
  ------------------
  |  Branch (25474:17): [True: 0, False: 116]
  ------------------
25475|      0|                janet_panic("format buffer overflow");
25476|    116|            if (nb > 0)
  ------------------
  |  Branch (25476:17): [True: 116, False: 0]
  ------------------
25477|    116|                janet_buffer_push_bytes(b, (uint8_t *) item, nb);
25478|    116|        }
25479|       |
25480|  1.56k|    }
25481|     58|}
janet_formatb:
25507|     58|JanetBuffer *janet_formatb(JanetBuffer *buffer, const char *format, ...) {
25508|     58|    va_list args;
25509|     58|    va_start(args, format);
25510|     58|    janet_formatbv(buffer, format, args);
25511|     58|    va_end(args);
25512|     58|    return buffer;
25513|     58|}
janet_string:
27213|  1.26M|const uint8_t *janet_string(const uint8_t *buf, int32_t len) {
27214|  1.26M|    JanetStringHead *head = janet_gcalloc(JANET_MEMORY_STRING, sizeof(JanetStringHead) + (size_t) len + 1);
27215|  1.26M|    head->length = len;
27216|  1.26M|    head->hash = janet_string_calchash(buf, len);
27217|  1.26M|    uint8_t *data = (uint8_t *)head->data;
27218|  1.26M|    safe_memcpy(data, buf, len);
27219|  1.26M|    data[len] = 0;
27220|  1.26M|    return data;
27221|  1.26M|}
janet_string_compare:
27224|   991k|int janet_string_compare(const uint8_t *lhs, const uint8_t *rhs) {
27225|   991k|    int32_t xlen = janet_string_length(lhs);
  ------------------
  |  | 1623|   991k|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  ------------------
  |  |  |  | 1622|   991k|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
27226|   991k|    int32_t ylen = janet_string_length(rhs);
  ------------------
  |  | 1623|   991k|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  ------------------
  |  |  |  | 1622|   991k|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
27227|   991k|    int32_t len = xlen > ylen ? ylen : xlen;
  ------------------
  |  Branch (27227:19): [True: 639, False: 991k]
  ------------------
27228|   991k|    int res = memcmp(lhs, rhs, len);
27229|   991k|    if (res) return res > 0 ? 1 : -1;
  ------------------
  |  Branch (27229:9): [True: 1.08k, False: 990k]
  |  Branch (27229:21): [True: 215, False: 866]
  ------------------
27230|   990k|    if (xlen == ylen) return 0;
  ------------------
  |  Branch (27230:9): [True: 843k, False: 147k]
  ------------------
27231|   147k|    return xlen < ylen ? -1 : 1;
  ------------------
  |  Branch (27231:12): [True: 147k, False: 437]
  ------------------
27232|   990k|}
janet_string_equalconst:
27235|  4.16M|int janet_string_equalconst(const uint8_t *lhs, const uint8_t *rhs, int32_t rlen, int32_t rhash) {
27236|  4.16M|    int32_t lhash = janet_string_hash(lhs);
  ------------------
  |  | 1624|  4.16M|#define janet_string_hash(s) (janet_string_head(s)->hash)
  |  |  ------------------
  |  |  |  | 1622|  4.16M|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
27237|  4.16M|    int32_t llen = janet_string_length(lhs);
  ------------------
  |  | 1623|  4.16M|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  ------------------
  |  |  |  | 1622|  4.16M|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
27238|  4.16M|    if (lhs == rhs)
  ------------------
  |  Branch (27238:9): [True: 27.5k, False: 4.13M]
  ------------------
27239|  27.5k|        return 1;
27240|  4.13M|    if (lhash != rhash || llen != rlen)
  ------------------
  |  Branch (27240:9): [True: 205k, False: 3.92M]
  |  Branch (27240:27): [True: 4.25k, False: 3.92M]
  ------------------
27241|   210k|        return 0;
27242|  3.92M|    return !memcmp(lhs, rhs, rlen);
27243|  4.13M|}
janet_string_equal:
27246|  16.3k|int janet_string_equal(const uint8_t *lhs, const uint8_t *rhs) {
27247|  16.3k|    return janet_string_equalconst(lhs, rhs,
27248|  16.3k|                                   janet_string_length(rhs), janet_string_hash(rhs));
  ------------------
  |  | 1623|  16.3k|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  ------------------
  |  |  |  | 1622|  16.3k|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
                                                 janet_string_length(rhs), janet_string_hash(rhs));
  ------------------
  |  | 1624|  16.3k|#define janet_string_hash(s) (janet_string_head(s)->hash)
  |  |  ------------------
  |  |  |  | 1622|  16.3k|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
27249|  16.3k|}
janet_scan_number_base:
28085|   129k|    double *out) {
28086|   129k|    const uint8_t *end = str + len;
28087|   129k|    int seenadigit = 0;
28088|   129k|    int ex = 0;
28089|   129k|    int seenpoint = 0;
28090|   129k|    int foundexp = 0;
28091|   129k|    int neg = 0;
28092|   129k|    struct BigNat mant;
28093|   129k|    bignat_zero(&mant);
28094|       |
28095|       |    /* Prevent some kinds of overflow bugs relating to the exponent
28096|       |     * overflowing.  For example, if a string was passed 2GB worth of 0s after
28097|       |     * the decimal point, exponent could wrap around and become positive. It's
28098|       |     * easier to reject ridiculously large inputs than to check for overflows.
28099|       |     * */
28100|   129k|    if (len > INT32_MAX / 40) goto error;
  ------------------
  |  Branch (28100:9): [True: 0, False: 129k]
  ------------------
28101|       |
28102|       |    /* Get sign */
28103|   129k|    if (str >= end) goto error;
  ------------------
  |  Branch (28103:9): [True: 0, False: 129k]
  ------------------
28104|   129k|    if (*str == '-') {
  ------------------
  |  Branch (28104:9): [True: 96.9k, False: 32.8k]
  ------------------
28105|  96.9k|        neg = 1;
28106|  96.9k|        str++;
28107|  96.9k|    } else if (*str == '+') {
  ------------------
  |  Branch (28107:16): [True: 3.19k, False: 29.6k]
  ------------------
28108|  3.19k|        str++;
28109|  3.19k|    }
28110|       |
28111|       |    /* Check for leading 0x or digit digit r */
28112|   129k|    if (base == 0) {
  ------------------
  |  Branch (28112:9): [True: 129k, False: 0]
  ------------------
28113|   129k|        if (str + 1 < end && str[0] == '0' && str[1] == 'x') {
  ------------------
  |  Branch (28113:13): [True: 20.4k, False: 109k]
  |  Branch (28113:30): [True: 1.84k, False: 18.5k]
  |  Branch (28113:47): [True: 199, False: 1.64k]
  ------------------
28114|    199|            base = 16;
28115|    199|            str += 2;
28116|   129k|        } else if (str + 1 < end  &&
  ------------------
  |  Branch (28116:20): [True: 20.2k, False: 109k]
  ------------------
28117|   129k|                   str[0] >= '0' && str[0] <= '9' &&
  ------------------
  |  Branch (28117:20): [True: 14.4k, False: 5.72k]
  |  Branch (28117:37): [True: 13.8k, False: 677]
  ------------------
28118|   129k|                   str[1] == 'r') {
  ------------------
  |  Branch (28118:20): [True: 387, False: 13.4k]
  ------------------
28119|    387|            base = str[0] - '0';
28120|    387|            str += 2;
28121|   129k|        } else if (str + 2 < end  &&
  ------------------
  |  Branch (28121:20): [True: 13.8k, False: 115k]
  ------------------
28122|   129k|                   str[0] >= '0' && str[0] <= '9' &&
  ------------------
  |  Branch (28122:20): [True: 11.0k, False: 2.84k]
  |  Branch (28122:37): [True: 10.7k, False: 300]
  ------------------
28123|   129k|                   str[1] >= '0' && str[1] <= '9' &&
  ------------------
  |  Branch (28123:20): [True: 6.28k, False: 4.44k]
  |  Branch (28123:37): [True: 3.90k, False: 2.37k]
  ------------------
28124|   129k|                   str[2] == 'r') {
  ------------------
  |  Branch (28124:20): [True: 1.76k, False: 2.14k]
  ------------------
28125|  1.76k|            base = 10 * (str[0] - '0') + (str[1] - '0');
28126|  1.76k|            if (base < 2 || base > 36) goto error;
  ------------------
  |  Branch (28126:17): [True: 194, False: 1.57k]
  |  Branch (28126:29): [True: 198, False: 1.37k]
  ------------------
28127|  1.37k|            str += 3;
28128|  1.37k|        }
28129|   129k|    }
28130|       |
28131|       |    /* If still base is 0, set to default (10) */
28132|   129k|    if (base == 0) {
  ------------------
  |  Branch (28132:9): [True: 127k, False: 1.94k]
  ------------------
28133|   127k|        base = 10;
28134|   127k|    }
28135|       |
28136|       |    /* Skip leading zeros */
28137|   159k|    while (str < end && (*str == '0' || *str == '.')) {
  ------------------
  |  Branch (28137:12): [True: 66.4k, False: 93.2k]
  |  Branch (28137:26): [True: 23.7k, False: 42.7k]
  |  Branch (28137:41): [True: 6.88k, False: 35.8k]
  ------------------
28138|  30.6k|        if (seenpoint) ex--;
  ------------------
  |  Branch (28138:13): [True: 6.61k, False: 23.9k]
  ------------------
28139|  30.6k|        if (*str == '.') {
  ------------------
  |  Branch (28139:13): [True: 6.88k, False: 23.7k]
  ------------------
28140|  6.88k|            if (seenpoint) goto error;
  ------------------
  |  Branch (28140:17): [True: 361, False: 6.52k]
  ------------------
28141|  6.52k|            seenpoint = 1;
28142|  23.7k|        } else {
28143|  23.7k|            seenadigit = 1;
28144|  23.7k|        }
28145|  30.2k|        str++;
28146|  30.2k|    }
28147|       |
28148|       |    /* Parse significant digits */
28149|  2.22M|    while (str < end) {
  ------------------
  |  Branch (28149:12): [True: 2.11M, False: 112k]
  ------------------
28150|  2.11M|        if (*str == '.') {
  ------------------
  |  Branch (28150:13): [True: 961, False: 2.11M]
  ------------------
28151|    961|            if (seenpoint) goto error;
  ------------------
  |  Branch (28151:17): [True: 201, False: 760]
  ------------------
28152|    760|            seenpoint = 1;
28153|  2.11M|        } else if (*str == '&') {
  ------------------
  |  Branch (28153:20): [True: 6.39k, False: 2.10M]
  ------------------
28154|  6.39k|            foundexp = 1;
28155|  6.39k|            break;
28156|  2.10M|        } else if (base == 10 && (*str == 'E' || *str == 'e')) {
  ------------------
  |  Branch (28156:20): [True: 140k, False: 1.96M]
  |  Branch (28156:35): [True: 3.67k, False: 136k]
  |  Branch (28156:50): [True: 1.43k, False: 135k]
  ------------------
28157|  5.11k|            foundexp = 1;
28158|  5.11k|            break;
28159|  2.09M|        } else if (*str == '_') {
  ------------------
  |  Branch (28159:20): [True: 764, False: 2.09M]
  ------------------
28160|    764|            if (!seenadigit) goto error;
  ------------------
  |  Branch (28160:17): [True: 435, False: 329]
  ------------------
28161|  2.09M|        } else {
28162|  2.09M|            int digit = digit_lookup[*str & 0x7F];
28163|  2.09M|            if (*str > 127 || digit >= base) goto error;
  ------------------
  |  Branch (28163:17): [True: 352, False: 2.09M]
  |  Branch (28163:31): [True: 3.93k, False: 2.09M]
  ------------------
28164|  2.09M|            if (seenpoint) ex--;
  ------------------
  |  Branch (28164:17): [True: 1.70M, False: 388k]
  ------------------
28165|  2.09M|            bignat_muladd(&mant, base, digit);
28166|  2.09M|            seenadigit = 1;
28167|  2.09M|        }
28168|  2.09M|        str++;
28169|  2.09M|    }
28170|       |
28171|   124k|    if (!seenadigit)
  ------------------
  |  Branch (28171:9): [True: 89.3k, False: 34.8k]
  ------------------
28172|  89.3k|        goto error;
28173|       |
28174|       |    /* Read exponent */
28175|  34.8k|    if (str < end && foundexp) {
  ------------------
  |  Branch (28175:9): [True: 9.17k, False: 25.6k]
  |  Branch (28175:22): [True: 9.17k, False: 0]
  ------------------
28176|  9.17k|        int eneg = 0;
28177|  9.17k|        int32_t ee = 0;
28178|  9.17k|        seenadigit = 0;
28179|  9.17k|        str++;
28180|  9.17k|        if (str >= end) goto error;
  ------------------
  |  Branch (28180:13): [True: 984, False: 8.19k]
  ------------------
28181|  8.19k|        if (*str == '-') {
  ------------------
  |  Branch (28181:13): [True: 733, False: 7.45k]
  ------------------
28182|    733|            eneg = 1;
28183|    733|            str++;
28184|  7.45k|        } else if (*str == '+') {
  ------------------
  |  Branch (28184:20): [True: 1.92k, False: 5.53k]
  ------------------
28185|  1.92k|            str++;
28186|  1.92k|        }
28187|       |        /* Skip leading 0s in exponent */
28188|  9.01k|        while (str < end && *str == '0') {
  ------------------
  |  Branch (28188:16): [True: 6.71k, False: 2.30k]
  |  Branch (28188:29): [True: 821, False: 5.88k]
  ------------------
28189|    821|            str++;
28190|    821|            seenadigit = 1;
28191|    821|        }
28192|  20.2k|        while (str < end) {
  ------------------
  |  Branch (28192:16): [True: 12.8k, False: 7.41k]
  ------------------
28193|  12.8k|            int digit = digit_lookup[*str & 0x7F];
28194|  12.8k|            if (*str > 127 || digit >= base) goto error;
  ------------------
  |  Branch (28194:17): [True: 203, False: 12.6k]
  |  Branch (28194:31): [True: 568, False: 12.0k]
  ------------------
28195|  12.0k|            if (ee < (INT32_MAX / 40)) {
  ------------------
  |  Branch (28195:17): [True: 11.6k, False: 439]
  ------------------
28196|  11.6k|                ee = base * ee + digit;
28197|  11.6k|            }
28198|  12.0k|            str++;
28199|  12.0k|            seenadigit = 1;
28200|  12.0k|        }
28201|  7.41k|        if (eneg) ex -= ee;
  ------------------
  |  Branch (28201:13): [True: 732, False: 6.68k]
  ------------------
28202|  6.68k|        else ex += ee;
28203|  7.41k|    }
28204|       |
28205|  33.0k|    if (!seenadigit)
  ------------------
  |  Branch (28205:9): [True: 1.94k, False: 31.1k]
  ------------------
28206|  1.94k|        goto error;
28207|       |
28208|  31.1k|    *out = convert(neg, &mant, base, ex);
28209|  31.1k|    janet_free(mant.digits);
  ------------------
  |  | 2159|  31.1k|#define janet_free(X) free((X))
  ------------------
28210|  31.1k|    return 0;
28211|       |
28212|  98.7k|error:
28213|  98.7k|    janet_free(mant.digits);
  ------------------
  |  | 2159|  98.7k|#define janet_free(X) free((X))
  ------------------
28214|  98.7k|    return 1;
28215|  33.0k|}
janet_scan_number:
28220|   129k|    double *out) {
28221|   129k|    return janet_scan_number_base(str, len, 0, out);
28222|   129k|}
janet_struct_begin:
28360|  3.57M|JanetKV *janet_struct_begin(int32_t count) {
28361|       |    /* Calculate capacity as power of 2 after 2 * count. */
28362|  3.57M|    int32_t capacity = janet_tablen(2 * count);
28363|  3.57M|    if (capacity < 0) capacity = janet_tablen(count + 1);
  ------------------
  |  Branch (28363:9): [True: 0, False: 3.57M]
  ------------------
28364|       |
28365|  3.57M|    size_t size = sizeof(JanetStructHead) + (size_t) capacity * sizeof(JanetKV);
28366|  3.57M|    JanetStructHead *head = janet_gcalloc(JANET_MEMORY_STRUCT, size);
28367|  3.57M|    head->length = count;
28368|  3.57M|    head->capacity = capacity;
28369|  3.57M|    head->hash = 0;
28370|  3.57M|    head->proto = NULL;
28371|       |
28372|  3.57M|    JanetKV *st = (JanetKV *)(head->data);
28373|  3.57M|    janet_memempty(st, capacity);
28374|  3.57M|    return st;
28375|  3.57M|}
janet_struct_put_ext:
28400|  2.98M|void janet_struct_put_ext(JanetKV *st, Janet key, Janet value, int replace) {
28401|  2.98M|    int32_t cap = janet_struct_capacity(st);
  ------------------
  |  | 1659|  2.98M|#define janet_struct_capacity(t) (janet_struct_head(t)->capacity)
  |  |  ------------------
  |  |  |  | 1656|  2.98M|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
28402|  2.98M|    int32_t hash = janet_hash(key);
28403|  2.98M|    int32_t index = janet_maphash(cap, hash);
  ------------------
  |  |  364|  2.98M|#define janet_maphash(cap, hash) ((uint32_t)(hash) & (cap - 1))
  ------------------
28404|  2.98M|    int32_t i, j, dist;
28405|  2.98M|    int32_t bounds[4] = {index, cap, 0, index};
28406|  2.98M|    if (janet_checktype(key, JANET_NIL) || janet_checktype(value, JANET_NIL)) return;
  ------------------
  |  |  730|  5.97M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (730:5): [True: 204, False: 2.98M]
  |  |  |  Branch (730:6): [Folded - Ignored]
  |  |  ------------------
  |  |  731|  5.97M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  727|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (727:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (727:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  732|  5.97M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  724|  2.98M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  714|  2.98M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|  2.98M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|  2.98M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if (janet_checktype(key, JANET_NIL) || janet_checktype(value, JANET_NIL)) return;
  ------------------
  |  |  730|  2.98M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (730:5): [True: 272, False: 2.98M]
  |  |  |  Branch (730:6): [Folded - Ignored]
  |  |  ------------------
  |  |  731|  2.98M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  727|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (727:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (727:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  732|  2.98M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  724|  2.98M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  714|  2.98M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|  2.98M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|  2.98M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
28407|  2.98M|    if (janet_checktype(key, JANET_NUMBER) && isnan(janet_unwrap_number(key))) return;
  ------------------
  |  |  730|  5.97M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (730:5): [True: 3.54k, False: 2.98M]
  |  |  |  Branch (730:6): [Folded - Ignored]
  |  |  ------------------
  |  |  731|  5.97M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  727|  2.98M|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (727:6): [True: 3.54k, False: 2.98M]
  |  |  |  |  |  Branch (727:28): [True: 0, False: 2.98M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  732|  5.97M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  724|      0|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  714|      0|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
28408|       |    /* Avoid extra items */
28409|  2.98M|    if (janet_struct_hash(st) == janet_struct_length(st)) return;
  ------------------
  |  | 1660|  2.98M|#define janet_struct_hash(t) (janet_struct_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1656|  2.98M|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
                  if (janet_struct_hash(st) == janet_struct_length(st)) return;
  ------------------
  |  | 1658|  2.98M|#define janet_struct_length(t) (janet_struct_head(t)->length)
  |  |  ------------------
  |  |  |  | 1656|  2.98M|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (28409:9): [True: 0, False: 2.98M]
  ------------------
28410|  2.98M|    for (dist = 0, j = 0; j < 4; j += 2)
  ------------------
  |  Branch (28410:27): [True: 2.98M, False: 0]
  ------------------
28411|  3.57M|        for (i = bounds[j]; i < bounds[j + 1]; i++, dist++) {
  ------------------
  |  Branch (28411:29): [True: 3.57M, False: 954]
  ------------------
28412|  3.57M|            int status;
28413|  3.57M|            int32_t otherhash;
28414|  3.57M|            int32_t otherindex, otherdist;
28415|  3.57M|            JanetKV *kv = st + i;
28416|       |            /* We found an empty slot, so just add key and value */
28417|  3.57M|            if (janet_checktype(kv->key, JANET_NIL)) {
  ------------------
  |  |  730|  3.57M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (730:5): [True: 1.40M, False: 2.16M]
  |  |  |  Branch (730:6): [Folded - Ignored]
  |  |  ------------------
  |  |  731|  3.57M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  727|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (727:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (727:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  732|  3.57M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  724|  3.57M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  714|  3.57M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|  3.57M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|  3.57M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
28418|  1.40M|                kv->key = key;
28419|  1.40M|                kv->value = value;
28420|       |                /* Update the temporary count */
28421|  1.40M|                janet_struct_hash(st)++;
  ------------------
  |  | 1660|  1.40M|#define janet_struct_hash(t) (janet_struct_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1656|  1.40M|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
28422|  1.40M|                return;
28423|  1.40M|            }
28424|       |            /* Robinhood hashing - check if colliding kv pair
28425|       |             * is closer to their source than current. We use robinhood
28426|       |             * hashing to ensure that equivalent structs that are constructed
28427|       |             * with different order have the same internal layout, and therefor
28428|       |             * will compare properly - i.e., {1 2 3 4} should equal {3 4 1 2}.
28429|       |             * Collisions are resolved via an insertion sort insertion. */
28430|  2.16M|            otherhash = janet_hash(kv->key);
28431|  2.16M|            otherindex = janet_maphash(cap, otherhash);
  ------------------
  |  |  364|  2.16M|#define janet_maphash(cap, hash) ((uint32_t)(hash) & (cap - 1))
  ------------------
28432|  2.16M|            otherdist = (i + cap - otherindex) & (cap - 1);
28433|  2.16M|            if (dist < otherdist)
  ------------------
  |  Branch (28433:17): [True: 98.8k, False: 2.06M]
  ------------------
28434|  98.8k|                status = -1;
28435|  2.06M|            else if (otherdist < dist)
  ------------------
  |  Branch (28435:22): [True: 66.6k, False: 1.99M]
  ------------------
28436|  66.6k|                status = 1;
28437|  1.99M|            else if (hash < otherhash)
  ------------------
  |  Branch (28437:22): [True: 176k, False: 1.82M]
  ------------------
28438|   176k|                status = -1;
28439|  1.82M|            else if (otherhash < hash)
  ------------------
  |  Branch (28439:22): [True: 87.7k, False: 1.73M]
  ------------------
28440|  87.7k|                status = 1;
28441|  1.73M|            else
28442|  1.73M|                status = janet_compare(key, kv->key);
28443|       |            /* If other is closer to their ideal slot */
28444|  2.16M|            if (status == 1) {
  ------------------
  |  Branch (28444:17): [True: 155k, False: 2.00M]
  ------------------
28445|       |                /* Swap current kv pair with pair in slot */
28446|   155k|                JanetKV temp = *kv;
28447|   155k|                kv->key = key;
28448|   155k|                kv->value = value;
28449|   155k|                key = temp.key;
28450|   155k|                value = temp.value;
28451|       |                /* Save dist and hash of new kv pair */
28452|   155k|                dist = otherdist;
28453|   155k|                hash = otherhash;
28454|  2.00M|            } else if (status == 0) {
  ------------------
  |  Branch (28454:24): [True: 1.58M, False: 426k]
  ------------------
28455|  1.58M|                if (replace) {
  ------------------
  |  Branch (28455:21): [True: 1.58M, False: 0]
  ------------------
28456|       |                    /* A key was added to the struct more than once - replace old value */
28457|  1.58M|                    kv->value = value;
28458|  1.58M|                }
28459|  1.58M|                return;
28460|  1.58M|            }
28461|  2.16M|        }
28462|  2.98M|}
janet_struct_put:
28464|  2.98M|void janet_struct_put(JanetKV *st, Janet key, Janet value) {
28465|  2.98M|    janet_struct_put_ext(st, key, value, 1);
28466|  2.98M|}
janet_struct_end:
28469|  3.57M|const JanetKV *janet_struct_end(JanetKV *st) {
28470|  3.57M|    if (janet_struct_hash(st) != janet_struct_length(st)) {
  ------------------
  |  | 1660|  3.57M|#define janet_struct_hash(t) (janet_struct_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1656|  3.57M|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
                  if (janet_struct_hash(st) != janet_struct_length(st)) {
  ------------------
  |  | 1658|  3.57M|#define janet_struct_length(t) (janet_struct_head(t)->length)
  |  |  ------------------
  |  |  |  | 1656|  3.57M|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (28470:9): [True: 984, False: 3.57M]
  ------------------
28471|       |        /* Error building struct, probably duplicate values. We need to rebuild
28472|       |         * the struct using only the values that went in. The second creation should always
28473|       |         * succeed. */
28474|    984|        JanetKV *newst = janet_struct_begin(janet_struct_hash(st));
  ------------------
  |  | 1660|    984|#define janet_struct_hash(t) (janet_struct_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1656|    984|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
28475|  6.82M|        for (int32_t i = 0; i < janet_struct_capacity(st); i++) {
  ------------------
  |  | 1659|  6.82M|#define janet_struct_capacity(t) (janet_struct_head(t)->capacity)
  |  |  ------------------
  |  |  |  | 1656|  6.82M|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (28475:29): [True: 6.82M, False: 984]
  ------------------
28476|  6.82M|            JanetKV *kv = st + i;
28477|  6.82M|            if (!janet_checktype(kv->key, JANET_NIL)) {
  ------------------
  |  |  730|  6.82M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (730:6): [Folded - Ignored]
  |  |  ------------------
  |  |  731|  6.82M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  727|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (727:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (727:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  732|  6.82M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  724|  6.82M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  714|  6.82M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|  6.82M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|  6.82M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (28477:17): [True: 698k, False: 6.12M]
  ------------------
28478|   698k|                janet_struct_put(newst, kv->key, kv->value);
28479|   698k|            }
28480|  6.82M|        }
28481|    984|        janet_struct_proto(newst) = janet_struct_proto(st);
  ------------------
  |  | 1661|    984|#define janet_struct_proto(t) (janet_struct_head(t)->proto)
  |  |  ------------------
  |  |  |  | 1656|    984|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
                      janet_struct_proto(newst) = janet_struct_proto(st);
  ------------------
  |  | 1661|    984|#define janet_struct_proto(t) (janet_struct_head(t)->proto)
  |  |  ------------------
  |  |  |  | 1656|    984|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
28482|    984|        st = newst;
28483|    984|    }
28484|  3.57M|    janet_struct_hash(st) = janet_kv_calchash(st, janet_struct_capacity(st));
  ------------------
  |  | 1660|  3.57M|#define janet_struct_hash(t) (janet_struct_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1656|  3.57M|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
                  janet_struct_hash(st) = janet_kv_calchash(st, janet_struct_capacity(st));
  ------------------
  |  | 1659|  3.57M|#define janet_struct_capacity(t) (janet_struct_head(t)->capacity)
  |  |  ------------------
  |  |  |  | 1656|  3.57M|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
28485|  3.57M|    if (janet_struct_proto(st)) {
  ------------------
  |  | 1661|  3.57M|#define janet_struct_proto(t) (janet_struct_head(t)->proto)
  |  |  ------------------
  |  |  |  | 1656|  3.57M|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  |  |  |  Branch (1661:31): [True: 0, False: 3.57M]
  |  |  ------------------
  ------------------
28486|      0|        janet_struct_hash(st) += 2654435761u * janet_struct_hash(janet_struct_proto(st));
  ------------------
  |  | 1660|      0|#define janet_struct_hash(t) (janet_struct_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1656|      0|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
                      janet_struct_hash(st) += 2654435761u * janet_struct_hash(janet_struct_proto(st));
  ------------------
  |  | 1660|      0|#define janet_struct_hash(t) (janet_struct_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1656|      0|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
28487|      0|    }
28488|  3.57M|    return (const JanetKV *)st;
28489|  3.57M|}
janet_symcache_init:
28680|  5.24k|void janet_symcache_init() {
28681|  5.24k|    janet_vm.cache_capacity = 1024;
28682|  5.24k|    janet_vm.cache = janet_calloc(1, (size_t) janet_vm.cache_capacity * sizeof(const uint8_t *));
  ------------------
  |  | 2156|  5.24k|#define janet_calloc(X, Y) calloc((X), (Y))
  ------------------
28683|  5.24k|    if (NULL == janet_vm.cache) {
  ------------------
  |  Branch (28683:9): [True: 0, False: 5.24k]
  ------------------
28684|      0|        JANET_OUT_OF_MEMORY;
  ------------------
  |  |  360|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (360:122): [Folded - Ignored]
  |  |  ------------------
  ------------------
28685|      0|    }
28686|  5.24k|    memset(&janet_vm.gensym_counter, '0', sizeof(janet_vm.gensym_counter));
28687|  5.24k|    janet_vm.gensym_counter[0] = '_';
28688|  5.24k|    janet_vm.cache_count = 0;
28689|  5.24k|    janet_vm.cache_deleted = 0;
28690|  5.24k|}
janet_symcache_deinit:
28693|  5.24k|void janet_symcache_deinit() {
28694|  5.24k|    janet_free((void *)janet_vm.cache);
  ------------------
  |  | 2159|  5.24k|#define janet_free(X) free((X))
  ------------------
28695|  5.24k|    janet_vm.cache = NULL;
28696|  5.24k|    janet_vm.cache_capacity = 0;
28697|  5.24k|    janet_vm.cache_count = 0;
28698|  5.24k|    janet_vm.cache_deleted = 0;
28699|  5.24k|}
janet_symbol_deinit:
28801|  27.5k|void janet_symbol_deinit(const uint8_t *sym) {
28802|  27.5k|    int status = 0;
28803|  27.5k|    const uint8_t **bucket = janet_symcache_find(sym, &status);
  ------------------
  |  |28756|  27.5k|    janet_symcache_findmem((str), janet_string_length(str), janet_string_hash(str), (success))
  |  |  ------------------
  |  |  |  | 1623|  27.5k|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1622|  27.5k|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   janet_symcache_findmem((str), janet_string_length(str), janet_string_hash(str), (success))
  |  |  ------------------
  |  |  |  | 1624|  27.5k|#define janet_string_hash(s) (janet_string_head(s)->hash)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1622|  27.5k|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
28804|  27.5k|    if (status) {
  ------------------
  |  Branch (28804:9): [True: 27.5k, False: 0]
  ------------------
28805|  27.5k|        janet_vm.cache_count--;
28806|  27.5k|        janet_vm.cache_deleted++;
28807|  27.5k|        *bucket = JANET_SYMCACHE_DELETED;
28808|  27.5k|    }
28809|  27.5k|}
janet_symbol:
28812|  3.92M|const uint8_t *janet_symbol(const uint8_t *str, int32_t len) {
28813|  3.92M|    int32_t hash = janet_string_calchash(str, len);
28814|  3.92M|    uint8_t *newstr;
28815|  3.92M|    int success = 0;
28816|  3.92M|    const uint8_t **bucket = janet_symcache_findmem(str, len, hash, &success);
28817|  3.92M|    if (success)
  ------------------
  |  Branch (28817:9): [True: 3.90M, False: 27.5k]
  ------------------
28818|  3.90M|        return *bucket;
28819|  27.5k|    JanetStringHead *head = janet_gcalloc(JANET_MEMORY_SYMBOL, sizeof(JanetStringHead) + (size_t) len + 1);
28820|  27.5k|    head->hash = hash;
28821|  27.5k|    head->length = len;
28822|  27.5k|    newstr = (uint8_t *)(head->data);
28823|  27.5k|    safe_memcpy(newstr, str, len);
28824|  27.5k|    newstr[len] = 0;
28825|  27.5k|    janet_symcache_put((const uint8_t *)newstr, bucket);
28826|  27.5k|    return newstr;
28827|  3.92M|}
janet_csymbol:
28830|   175k|const uint8_t *janet_csymbol(const char *cstr) {
28831|   175k|    return janet_symbol((const uint8_t *)cstr, (int32_t) strlen(cstr));
28832|   175k|}
janet_table_init_raw:
28960|  10.4k|JanetTable *janet_table_init_raw(JanetTable *table, int32_t capacity) {
28961|  10.4k|    return janet_table_init_impl(table, capacity, 0);
28962|  10.4k|}
janet_table_deinit:
28965|  10.4k|void janet_table_deinit(JanetTable *table) {
28966|  10.4k|    if (table->gc.flags & JANET_TABLE_FLAG_STACK) {
  ------------------
  |  |28915|  10.4k|#define JANET_TABLE_FLAG_STACK 0x10000
  ------------------
  |  Branch (28966:9): [True: 0, False: 10.4k]
  ------------------
28967|      0|        janet_sfree(table->data);
28968|  10.4k|    } else {
28969|  10.4k|        janet_free(table->data);
  ------------------
  |  | 2159|  10.4k|#define janet_free(X) free((X))
  ------------------
28970|  10.4k|    }
28971|  10.4k|}
janet_table:
28974|  56.2k|JanetTable *janet_table(int32_t capacity) {
28975|  56.2k|    JanetTable *table = janet_gcalloc(JANET_MEMORY_TABLE, sizeof(JanetTable));
28976|  56.2k|    return janet_table_init_impl(table, capacity, 0);
28977|  56.2k|}
janet_table_find:
28981|  1.33M|JanetKV *janet_table_find(JanetTable *t, Janet key) {
28982|  1.33M|    return (JanetKV *) janet_dict_find(t->data, t->capacity, key);
28983|  1.33M|}
janet_table_remove:
29050|    776|Janet janet_table_remove(JanetTable *t, Janet key) {
29051|    776|    JanetKV *bucket = janet_table_find(t, key);
29052|    776|    if (NULL != bucket && !janet_checktype(bucket->key, JANET_NIL)) {
  ------------------
  |  |  730|    776|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (730:6): [Folded - Ignored]
  |  |  ------------------
  |  |  731|    776|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  727|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (727:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (727:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  732|    776|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  724|    776|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  714|    776|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|    776|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|    776|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (29052:9): [True: 776, False: 0]
  |  Branch (29052:27): [True: 552, False: 224]
  ------------------
29053|    552|        Janet ret = bucket->value;
29054|    552|        t->count--;
29055|    552|        t->deleted++;
29056|    552|        bucket->key = janet_wrap_nil();
  ------------------
  |  |  754|    552|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  745|    552|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|    552|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|    552|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29057|    552|        bucket->value = janet_wrap_false();
  ------------------
  |  |  756|    552|#define janet_wrap_false() janet_nanbox_from_payload(JANET_BOOLEAN, 0)
  |  |  ------------------
  |  |  |  |  745|    552|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|    552|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|    552|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29058|    552|        return ret;
29059|    552|    } else {
29060|    224|        return janet_wrap_nil();
  ------------------
  |  |  754|    224|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  745|    224|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|    224|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|    224|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29061|    224|    }
29062|    776|}
janet_table_put:
29065|   584k|void janet_table_put(JanetTable *t, Janet key, Janet value) {
29066|   584k|    if (janet_checktype(key, JANET_NIL)) return;
  ------------------
  |  |  730|   584k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (730:5): [True: 198, False: 583k]
  |  |  |  Branch (730:6): [Folded - Ignored]
  |  |  ------------------
  |  |  731|   584k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  727|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (727:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (727:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  732|   584k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  724|   584k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  714|   584k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|   584k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|   584k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29067|   583k|    if (janet_checktype(key, JANET_NUMBER) && isnan(janet_unwrap_number(key))) return;
  ------------------
  |  |  730|  1.16M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (730:5): [True: 1.67k, False: 582k]
  |  |  |  Branch (730:6): [Folded - Ignored]
  |  |  ------------------
  |  |  731|  1.16M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  727|   583k|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (727:6): [True: 1.67k, False: 582k]
  |  |  |  |  |  Branch (727:28): [True: 0, False: 582k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  732|  1.16M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  724|      0|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  714|      0|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29068|   583k|    if (janet_checktype(value, JANET_NIL)) {
  ------------------
  |  |  730|   583k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (730:5): [True: 776, False: 583k]
  |  |  |  Branch (730:6): [Folded - Ignored]
  |  |  ------------------
  |  |  731|   583k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  727|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (727:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (727:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  732|   583k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  724|   583k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  714|   583k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|   583k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|   583k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29069|    776|        janet_table_remove(t, key);
29070|   583k|    } else {
29071|   583k|        JanetKV *bucket = janet_table_find(t, key);
29072|   583k|        if (NULL != bucket && !janet_checktype(bucket->key, JANET_NIL)) {
  ------------------
  |  |  730|   583k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (730:6): [Folded - Ignored]
  |  |  ------------------
  |  |  731|   583k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  727|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (727:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (727:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  732|   583k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  724|   583k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  714|   583k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|   583k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|   583k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (29072:13): [True: 583k, False: 0]
  |  Branch (29072:31): [True: 275k, False: 307k]
  ------------------
29073|   275k|            bucket->value = value;
29074|   307k|        } else {
29075|   307k|            if (NULL == bucket || 2 * (t->count + t->deleted + 1) > t->capacity) {
  ------------------
  |  Branch (29075:17): [True: 0, False: 307k]
  |  Branch (29075:35): [True: 1.39k, False: 306k]
  ------------------
29076|  1.39k|                janet_table_rehash(t, janet_tablen(2 * t->count + 2));
29077|  1.39k|            }
29078|   307k|            bucket = janet_table_find(t, key);
29079|   307k|            if (janet_checktype(bucket->value, JANET_BOOLEAN))
  ------------------
  |  |  730|   307k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (730:5): [True: 0, False: 307k]
  |  |  |  Branch (730:6): [Folded - Ignored]
  |  |  ------------------
  |  |  731|   307k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  727|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (727:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (727:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  732|   307k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  724|   307k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  714|   307k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|   307k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|   307k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29080|      0|                --t->deleted;
29081|   307k|            bucket->key = key;
29082|   307k|            bucket->value = value;
29083|   307k|            ++t->count;
29084|   307k|        }
29085|   583k|    }
29086|   583k|}
janet_tuple_begin:
29313|   222k|Janet *janet_tuple_begin(int32_t length) {
29314|   222k|    size_t size = sizeof(JanetTupleHead) + ((size_t) length * sizeof(Janet));
29315|   222k|    JanetTupleHead *head = janet_gcalloc(JANET_MEMORY_TUPLE, size);
29316|   222k|    head->sm_line = -1;
29317|   222k|    head->sm_column = -1;
29318|   222k|    head->length = length;
29319|   222k|    return (Janet *)(head->data);
29320|   222k|}
janet_tuple_end:
29323|   222k|const Janet *janet_tuple_end(Janet *tuple) {
29324|   222k|    janet_tuple_hash(tuple) = janet_array_calchash(tuple, janet_tuple_length(tuple));
  ------------------
  |  | 1613|   222k|#define janet_tuple_hash(t) (janet_tuple_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1610|   222k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
                  janet_tuple_hash(tuple) = janet_array_calchash(tuple, janet_tuple_length(tuple));
  ------------------
  |  | 1612|   222k|#define janet_tuple_length(t) (janet_tuple_head(t)->length)
  |  |  ------------------
  |  |  |  | 1610|   222k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
29325|   222k|    return (const Janet *)tuple;
29326|   222k|}
janet_tuple_n:
29329|  44.2k|const Janet *janet_tuple_n(const Janet *values, int32_t n) {
29330|  44.2k|    Janet *t = janet_tuple_begin(n);
29331|  44.2k|    safe_memcpy(t, values, sizeof(Janet) * n);
29332|  44.2k|    return janet_tuple_end(t);
29333|  44.2k|}
janet_string_calchash:
29534|  5.19M|int32_t janet_string_calchash(const uint8_t *str, int32_t len) {
29535|  5.19M|    if (NULL == str) return 5381;
  ------------------
  |  Branch (29535:9): [True: 477, False: 5.19M]
  ------------------
29536|  5.19M|    const uint8_t *end = str + len;
29537|  5.19M|    uint32_t hash = 5381;
29538|  40.6M|    while (str < end)
  ------------------
  |  Branch (29538:12): [True: 35.4M, False: 5.19M]
  ------------------
29539|  35.4M|        hash = (hash << 5) + hash + *str++;
29540|  5.19M|    return (int32_t) hash;
29541|  5.19M|}
janet_hash_mix:
29655|  12.8M|uint32_t janet_hash_mix(uint32_t input, uint32_t more) {
29656|  12.8M|    uint32_t mix1 = (more + 0x9e3779b9 + (input << 6) + (input >> 2));
29657|  12.8M|    return input ^ (0x9e3779b9 + (mix1 << 6) + (mix1 >> 2));
29658|  12.8M|}
janet_array_calchash:
29661|   222k|int32_t janet_array_calchash(const Janet *array, int32_t len) {
29662|   222k|    const Janet *end = array + len;
29663|   222k|    uint32_t hash = 33;
29664|  2.58M|    while (array < end) {
  ------------------
  |  Branch (29664:12): [True: 2.36M, False: 222k]
  ------------------
29665|  2.36M|        hash = janet_hash_mix(hash, janet_hash(*array++));
29666|  2.36M|    }
29667|   222k|    return (int32_t) hash;
29668|   222k|}
janet_kv_calchash:
29671|  3.57M|int32_t janet_kv_calchash(const JanetKV *kvs, int32_t len) {
29672|  3.57M|    const JanetKV *end = kvs + len;
29673|  3.57M|    uint32_t hash = 33;
29674|  8.79M|    while (kvs < end) {
  ------------------
  |  Branch (29674:12): [True: 5.22M, False: 3.57M]
  ------------------
29675|  5.22M|        hash = janet_hash_mix(hash, janet_hash(kvs->key));
29676|  5.22M|        hash = janet_hash_mix(hash, janet_hash(kvs->value));
29677|  5.22M|        kvs++;
29678|  5.22M|    }
29679|  3.57M|    return (int32_t) hash;
29680|  3.57M|}
janet_tablen:
29684|  3.64M|int32_t janet_tablen(int32_t n) {
29685|  3.64M|    if (n < 0) return 0;
  ------------------
  |  Branch (29685:9): [True: 0, False: 3.64M]
  ------------------
29686|  3.64M|    n |= n >> 1;
29687|  3.64M|    n |= n >> 2;
29688|  3.64M|    n |= n >> 4;
29689|  3.64M|    n |= n >> 8;
29690|  3.64M|    n |= n >> 16;
29691|  3.64M|    return n + 1;
29692|  3.64M|}
safe_memcpy:
29695|  1.34M|void safe_memcpy(void *dest, const void *src, size_t len) {
29696|  1.34M|    if (!len) return;
  ------------------
  |  Branch (29696:9): [True: 1.22M, False: 114k]
  ------------------
29697|   114k|    memcpy(dest, src, len);
29698|   114k|}
janet_dict_find:
29702|  1.33M|const JanetKV *janet_dict_find(const JanetKV *buckets, int32_t cap, Janet key) {
29703|  1.33M|    int32_t index = janet_maphash(cap, janet_hash(key));
  ------------------
  |  |  364|  1.33M|#define janet_maphash(cap, hash) ((uint32_t)(hash) & (cap - 1))
  ------------------
29704|  1.33M|    int32_t i;
29705|  1.33M|    const JanetKV *first_bucket = NULL;
29706|       |    /* Higher half */
29707|  1.80M|    for (i = index; i < cap; i++) {
  ------------------
  |  Branch (29707:21): [True: 1.80M, False: 2.84k]
  ------------------
29708|  1.80M|        const JanetKV *kv = buckets + i;
29709|  1.80M|        if (janet_checktype(kv->key, JANET_NIL)) {
  ------------------
  |  |  730|  1.80M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (730:5): [True: 1.08M, False: 714k]
  |  |  |  Branch (730:6): [Folded - Ignored]
  |  |  ------------------
  |  |  731|  1.80M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  727|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (727:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (727:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  732|  1.80M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  724|  1.80M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  714|  1.80M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|  1.80M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|  1.80M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29710|  1.08M|            if (janet_checktype(kv->value, JANET_NIL)) {
  ------------------
  |  |  730|  1.08M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (730:5): [True: 1.05M, False: 30.4k]
  |  |  |  Branch (730:6): [Folded - Ignored]
  |  |  ------------------
  |  |  731|  1.08M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  727|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (727:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (727:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  732|  1.08M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  724|  1.08M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  714|  1.08M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|  1.08M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|  1.08M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29711|  1.05M|                return kv;
29712|  1.05M|            } else if (NULL == first_bucket) {
  ------------------
  |  Branch (29712:24): [True: 1.49k, False: 28.9k]
  ------------------
29713|  1.49k|                first_bucket = kv;
29714|  1.49k|            }
29715|  1.08M|        } else if (janet_equals(kv->key, key)) {
  ------------------
  |  Branch (29715:20): [True: 275k, False: 439k]
  ------------------
29716|   275k|            return buckets + i;
29717|   275k|        }
29718|  1.80M|    }
29719|       |    /* Lower half */
29720|  5.36k|    for (i = 0; i < index; i++) {
  ------------------
  |  Branch (29720:17): [True: 5.36k, False: 0]
  ------------------
29721|  5.36k|        const JanetKV *kv = buckets + i;
29722|  5.36k|        if (janet_checktype(kv->key, JANET_NIL)) {
  ------------------
  |  |  730|  5.36k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (730:5): [True: 3.00k, False: 2.36k]
  |  |  |  Branch (730:6): [Folded - Ignored]
  |  |  ------------------
  |  |  731|  5.36k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  727|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (727:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (727:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  732|  5.36k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  724|  5.36k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  714|  5.36k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|  5.36k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|  5.36k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29723|  3.00k|            if (janet_checktype(kv->value, JANET_NIL)) {
  ------------------
  |  |  730|  3.00k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (730:5): [True: 2.50k, False: 499]
  |  |  |  Branch (730:6): [Folded - Ignored]
  |  |  ------------------
  |  |  731|  3.00k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  727|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (727:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (727:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  732|  3.00k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  724|  3.00k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  714|  3.00k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|  3.00k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|  3.00k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
29724|  2.50k|                return kv;
29725|  2.50k|            } else if (NULL == first_bucket) {
  ------------------
  |  Branch (29725:24): [True: 259, False: 240]
  ------------------
29726|    259|                first_bucket = kv;
29727|    259|            }
29728|  3.00k|        } else if (janet_equals(kv->key, key)) {
  ------------------
  |  Branch (29728:20): [True: 338, False: 2.03k]
  ------------------
29729|    338|            return buckets + i;
29730|    338|        }
29731|  5.36k|    }
29732|      0|    return first_bucket;
29733|  2.84k|}
janet_equals:
30758|   717k|int janet_equals(Janet x, Janet y) {
30759|   717k|    janet_vm.traversal = janet_vm.traversal_base;
30760|  1.02M|    do {
30761|  1.02M|        if (janet_type(x) != janet_type(y)) return 0;
  ------------------
  |  |  719|  1.02M|    (isnan((x).number) \
  |  |  720|  1.02M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  721|  1.02M|        : JANET_NUMBER)
  ------------------
                      if (janet_type(x) != janet_type(y)) return 0;
  ------------------
  |  |  719|  1.02M|    (isnan((x).number) \
  |  |  720|  1.02M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  721|  1.02M|        : JANET_NUMBER)
  ------------------
  |  Branch (30761:13): [True: 40.9k, False: 981k]
  ------------------
30762|   981k|        switch (janet_type(x)) {
  ------------------
  |  |  719|   981k|    (isnan((x).number) \
  |  |  720|   981k|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  721|   981k|        : JANET_NUMBER)
  ------------------
30763|   287k|            case JANET_NIL:
  ------------------
  |  Branch (30763:13): [True: 287k, False: 694k]
  ------------------
30764|   287k|                break;
30765|    573|            case JANET_BOOLEAN:
  ------------------
  |  Branch (30765:13): [True: 573, False: 980k]
  ------------------
30766|    573|                if (janet_unwrap_boolean(x) != janet_unwrap_boolean(y)) return 0;
  ------------------
  |  |  761|    573|#define janet_unwrap_boolean(x) ((x).u64 & 0x1)
  ------------------
                              if (janet_unwrap_boolean(x) != janet_unwrap_boolean(y)) return 0;
  ------------------
  |  |  761|    573|#define janet_unwrap_boolean(x) ((x).u64 & 0x1)
  ------------------
  |  Branch (30766:21): [True: 194, False: 379]
  ------------------
30767|    379|                break;
30768|  1.84k|            case JANET_NUMBER:
  ------------------
  |  Branch (30768:13): [True: 1.84k, False: 979k]
  ------------------
30769|  1.84k|                if (janet_unwrap_number(x) != janet_unwrap_number(y)) return 0;
  ------------------
  |  |  762|  1.84k|#define janet_unwrap_number(x) ((x).number)
  ------------------
                              if (janet_unwrap_number(x) != janet_unwrap_number(y)) return 0;
  ------------------
  |  |  762|  1.84k|#define janet_unwrap_number(x) ((x).number)
  ------------------
  |  Branch (30769:21): [True: 820, False: 1.02k]
  ------------------
30770|  1.02k|                break;
30771|  16.3k|            case JANET_STRING:
  ------------------
  |  Branch (30771:13): [True: 16.3k, False: 965k]
  ------------------
30772|  16.3k|                if (!janet_string_equal(janet_unwrap_string(x), janet_unwrap_string(y))) return 0;
  ------------------
  |  |  786|  16.3k|#define janet_unwrap_string(x) ((const uint8_t *)janet_nanbox_to_pointer(x))
  ------------------
                              if (!janet_string_equal(janet_unwrap_string(x), janet_unwrap_string(y))) return 0;
  ------------------
  |  |  786|  16.3k|#define janet_unwrap_string(x) ((const uint8_t *)janet_nanbox_to_pointer(x))
  ------------------
  |  Branch (30772:21): [True: 1.02k, False: 15.3k]
  ------------------
30773|  15.3k|                break;
30774|  15.3k|            case JANET_ABSTRACT:
  ------------------
  |  Branch (30774:13): [True: 0, False: 981k]
  ------------------
30775|      0|                if (janet_compare_abstract(janet_unwrap_abstract(x), janet_unwrap_abstract(y))) return 0;
  ------------------
  |  |  789|      0|#define janet_unwrap_abstract(x) (janet_nanbox_to_pointer(x))
  ------------------
                              if (janet_compare_abstract(janet_unwrap_abstract(x), janet_unwrap_abstract(y))) return 0;
  ------------------
  |  |  789|      0|#define janet_unwrap_abstract(x) (janet_nanbox_to_pointer(x))
  ------------------
  |  Branch (30775:21): [True: 0, False: 0]
  ------------------
30776|      0|                break;
30777|   531k|            default:
  ------------------
  |  Branch (30777:13): [True: 531k, False: 449k]
  ------------------
30778|   531k|                if (janet_unwrap_pointer(x) != janet_unwrap_pointer(y)) return 0;
  ------------------
  |  |  790|   531k|#define janet_unwrap_pointer(x) (janet_nanbox_to_pointer(x))
  ------------------
                              if (janet_unwrap_pointer(x) != janet_unwrap_pointer(y)) return 0;
  ------------------
  |  |  790|   531k|#define janet_unwrap_pointer(x) (janet_nanbox_to_pointer(x))
  ------------------
  |  Branch (30778:21): [True: 394k, False: 137k]
  ------------------
30779|   137k|                break;
30780|   137k|            case JANET_TUPLE: {
  ------------------
  |  Branch (30780:13): [True: 2.53k, False: 978k]
  ------------------
30781|  2.53k|                const Janet *t1 = janet_unwrap_tuple(x);
  ------------------
  |  |  781|  2.53k|#define janet_unwrap_tuple(x) ((const Janet *)janet_nanbox_to_pointer(x))
  ------------------
30782|  2.53k|                const Janet *t2 = janet_unwrap_tuple(y);
  ------------------
  |  |  781|  2.53k|#define janet_unwrap_tuple(x) ((const Janet *)janet_nanbox_to_pointer(x))
  ------------------
30783|  2.53k|                if (t1 == t2) break;
  ------------------
  |  Branch (30783:21): [True: 0, False: 2.53k]
  ------------------
30784|  2.53k|                if (JANET_TUPLE_FLAG_BRACKETCTOR & (janet_tuple_flag(t1) ^ janet_tuple_flag(t2))) return 0;
  ------------------
  |  | 1608|  2.53k|#define JANET_TUPLE_FLAG_BRACKETCTOR 0x10000
  ------------------
                              if (JANET_TUPLE_FLAG_BRACKETCTOR & (janet_tuple_flag(t1) ^ janet_tuple_flag(t2))) return 0;
  ------------------
  |  | 1616|  2.53k|#define janet_tuple_flag(t) (janet_tuple_head(t)->gc.flags)
  |  |  ------------------
  |  |  |  | 1610|  2.53k|#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;
  ------------------
  |  | 1616|  2.53k|#define janet_tuple_flag(t) (janet_tuple_head(t)->gc.flags)
  |  |  ------------------
  |  |  |  | 1610|  2.53k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (30784:21): [True: 196, False: 2.33k]
  ------------------
30785|  2.33k|                if (janet_tuple_hash(t1) != janet_tuple_hash(t2)) return 0;
  ------------------
  |  | 1613|  2.33k|#define janet_tuple_hash(t) (janet_tuple_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1610|  2.33k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
                              if (janet_tuple_hash(t1) != janet_tuple_hash(t2)) return 0;
  ------------------
  |  | 1613|  2.33k|#define janet_tuple_hash(t) (janet_tuple_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1610|  2.33k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (30785:21): [True: 826, False: 1.51k]
  ------------------
30786|  1.51k|                if (janet_tuple_length(t1) != janet_tuple_length(t2)) return 0;
  ------------------
  |  | 1612|  1.51k|#define janet_tuple_length(t) (janet_tuple_head(t)->length)
  |  |  ------------------
  |  |  |  | 1610|  1.51k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
                              if (janet_tuple_length(t1) != janet_tuple_length(t2)) return 0;
  ------------------
  |  | 1612|  1.51k|#define janet_tuple_length(t) (janet_tuple_head(t)->length)
  |  |  ------------------
  |  |  |  | 1610|  1.51k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (30786:21): [True: 204, False: 1.30k]
  ------------------
30787|  1.30k|                push_traversal_node(janet_tuple_head(t1), janet_tuple_head(t2), 0);
  ------------------
  |  | 1610|  1.30k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  ------------------
                              push_traversal_node(janet_tuple_head(t1), janet_tuple_head(t2), 0);
  ------------------
  |  | 1610|  1.30k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  ------------------
30788|  1.30k|                break;
30789|  1.51k|            }
30790|      0|            break;
30791|   141k|            case JANET_STRUCT: {
  ------------------
  |  Branch (30791:13): [True: 141k, False: 840k]
  ------------------
30792|   141k|                const JanetKV *s1 = janet_unwrap_struct(x);
  ------------------
  |  |  780|   141k|#define janet_unwrap_struct(x) ((const JanetKV *)janet_nanbox_to_pointer(x))
  ------------------
30793|   141k|                const JanetKV *s2 = janet_unwrap_struct(y);
  ------------------
  |  |  780|   141k|#define janet_unwrap_struct(x) ((const JanetKV *)janet_nanbox_to_pointer(x))
  ------------------
30794|   141k|                if (s1 == s2) break;
  ------------------
  |  Branch (30794:21): [True: 0, False: 141k]
  ------------------
30795|   141k|                if (janet_struct_hash(s1) != janet_struct_hash(s2)) return 0;
  ------------------
  |  | 1660|   141k|#define janet_struct_hash(t) (janet_struct_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1656|   141k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
                              if (janet_struct_hash(s1) != janet_struct_hash(s2)) return 0;
  ------------------
  |  | 1660|   141k|#define janet_struct_hash(t) (janet_struct_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1656|   141k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (30795:21): [True: 2.43k, False: 138k]
  ------------------
30796|   138k|                if (janet_struct_length(s1) != janet_struct_length(s2)) return 0;
  ------------------
  |  | 1658|   138k|#define janet_struct_length(t) (janet_struct_head(t)->length)
  |  |  ------------------
  |  |  |  | 1656|   138k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
                              if (janet_struct_length(s1) != janet_struct_length(s2)) return 0;
  ------------------
  |  | 1658|   138k|#define janet_struct_length(t) (janet_struct_head(t)->length)
  |  |  ------------------
  |  |  |  | 1656|   138k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (30796:21): [True: 199, False: 138k]
  ------------------
30797|   138k|                if (janet_struct_proto(s1) && !janet_struct_proto(s2)) return 0;
  ------------------
  |  | 1661|   277k|#define janet_struct_proto(t) (janet_struct_head(t)->proto)
  |  |  ------------------
  |  |  |  | 1656|   138k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  |  |  |  Branch (1661:31): [True: 0, False: 138k]
  |  |  ------------------
  ------------------
                              if (janet_struct_proto(s1) && !janet_struct_proto(s2)) return 0;
  ------------------
  |  | 1661|      0|#define janet_struct_proto(t) (janet_struct_head(t)->proto)
  |  |  ------------------
  |  |  |  | 1656|      0|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (30797:47): [True: 0, False: 0]
  ------------------
30798|   138k|                if (!janet_struct_proto(s1) && janet_struct_proto(s2)) return 0;
  ------------------
  |  | 1661|   277k|#define janet_struct_proto(t) (janet_struct_head(t)->proto)
  |  |  ------------------
  |  |  |  | 1656|   138k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
                              if (!janet_struct_proto(s1) && janet_struct_proto(s2)) return 0;
  ------------------
  |  | 1661|   138k|#define janet_struct_proto(t) (janet_struct_head(t)->proto)
  |  |  ------------------
  |  |  |  | 1656|   138k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  |  |  |  Branch (1661:31): [True: 0, False: 138k]
  |  |  ------------------
  ------------------
  |  Branch (30798:21): [True: 138k, False: 0]
  ------------------
30799|   138k|                push_traversal_node(janet_struct_head(s1), janet_struct_head(s2), 0);
  ------------------
  |  | 1656|   138k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  ------------------
                              push_traversal_node(janet_struct_head(s1), janet_struct_head(s2), 0);
  ------------------
  |  | 1656|   138k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  ------------------
30800|   138k|                break;
30801|   138k|            }
30802|      0|            break;
30803|   981k|        }
30804|   981k|    } while (!traversal_next(&x, &y));
  ------------------
  |  Branch (30804:14): [True: 305k, False: 276k]
  ------------------
30805|   276k|    return 1;
30806|   717k|}
janet_hash:
30818|  19.3M|int32_t janet_hash(Janet x) {
30819|  19.3M|    int32_t hash = 0;
30820|  19.3M|    switch (janet_type(x)) {
  ------------------
  |  |  719|  19.3M|    (isnan((x).number) \
  |  |  720|  19.3M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  721|  19.3M|        : JANET_NUMBER)
  ------------------
30821|  9.02M|        case JANET_NIL:
  ------------------
  |  Branch (30821:9): [True: 9.02M, False: 10.2M]
  ------------------
30822|  9.02M|            hash = 0;
30823|  9.02M|            break;
30824|    916|        case JANET_BOOLEAN:
  ------------------
  |  Branch (30824:9): [True: 916, False: 19.2M]
  ------------------
30825|    916|            hash = janet_unwrap_boolean(x);
  ------------------
  |  |  761|    916|#define janet_unwrap_boolean(x) ((x).u64 & 0x1)
  ------------------
30826|    916|            break;
30827|   942k|        case JANET_STRING:
  ------------------
  |  Branch (30827:9): [True: 942k, False: 18.3M]
  ------------------
30828|  3.90M|        case JANET_SYMBOL:
  ------------------
  |  Branch (30828:9): [True: 2.95M, False: 16.3M]
  ------------------
30829|  3.91M|        case JANET_KEYWORD:
  ------------------
  |  Branch (30829:9): [True: 8.80k, False: 19.2M]
  ------------------
30830|  3.91M|            hash = janet_string_hash(janet_unwrap_string(x));
  ------------------
  |  | 1624|  3.91M|#define janet_string_hash(s) (janet_string_head(s)->hash)
  |  |  ------------------
  |  |  |  | 1622|  3.91M|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  ------------------
  ------------------
30831|  3.91M|            break;
30832|   163k|        case JANET_TUPLE:
  ------------------
  |  Branch (30832:9): [True: 163k, False: 19.1M]
  ------------------
30833|   163k|            hash = janet_tuple_hash(janet_unwrap_tuple(x));
  ------------------
  |  | 1613|   163k|#define janet_tuple_hash(t) (janet_tuple_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1610|   163k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
30834|   163k|            hash += (janet_tuple_flag(janet_unwrap_tuple(x)) & JANET_TUPLE_FLAG_BRACKETCTOR) ? 1 : 0;
  ------------------
  |  | 1616|   163k|#define janet_tuple_flag(t) (janet_tuple_head(t)->gc.flags)
  |  |  ------------------
  |  |  |  | 1610|   163k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
                          hash += (janet_tuple_flag(janet_unwrap_tuple(x)) & JANET_TUPLE_FLAG_BRACKETCTOR) ? 1 : 0;
  ------------------
  |  | 1608|   163k|#define JANET_TUPLE_FLAG_BRACKETCTOR 0x10000
  ------------------
  |  Branch (30834:21): [True: 2.10k, False: 161k]
  ------------------
30835|   163k|            break;
30836|  2.48M|        case JANET_STRUCT:
  ------------------
  |  Branch (30836:9): [True: 2.48M, False: 16.8M]
  ------------------
30837|  2.48M|            hash = janet_struct_hash(janet_unwrap_struct(x));
  ------------------
  |  | 1660|  2.48M|#define janet_struct_hash(t) (janet_struct_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1656|  2.48M|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
30838|  2.48M|            break;
30839|  30.8k|        case JANET_NUMBER: {
  ------------------
  |  Branch (30839:9): [True: 30.8k, False: 19.2M]
  ------------------
30840|  30.8k|            union {
30841|  30.8k|                double d;
30842|  30.8k|                uint64_t u;
30843|  30.8k|            } as;
30844|  30.8k|            as.d = janet_unwrap_number(x);
  ------------------
  |  |  762|  30.8k|#define janet_unwrap_number(x) ((x).number)
  ------------------
30845|  30.8k|            as.d += 0.0; /* normalize negative 0 */
30846|  30.8k|            uint32_t lo = (uint32_t)(as.u & 0xFFFFFFFF);
30847|  30.8k|            uint32_t hi = (uint32_t)(as.u >> 32);
30848|  30.8k|            uint32_t hilo = (hi ^ lo) * 2654435769u;
30849|  30.8k|            hash = (int32_t)((hilo << 16) | (hilo >> 16));
30850|  30.8k|            break;
30851|  3.90M|        }
30852|      0|        case JANET_ABSTRACT: {
  ------------------
  |  Branch (30852:9): [True: 0, False: 19.3M]
  ------------------
30853|      0|            JanetAbstract xx = janet_unwrap_abstract(x);
  ------------------
  |  |  789|      0|#define janet_unwrap_abstract(x) (janet_nanbox_to_pointer(x))
  ------------------
30854|      0|            const JanetAbstractType *at = janet_abstract_type(xx);
  ------------------
  |  | 1706|      0|#define janet_abstract_type(u) (janet_abstract_head(u)->type)
  |  |  ------------------
  |  |  |  | 1704|      0|#define janet_abstract_head(u) ((JanetAbstractHead *)((char *)u - offsetof(JanetAbstractHead, data)))
  |  |  ------------------
  ------------------
30855|      0|            if (at->hash != NULL) {
  ------------------
  |  Branch (30855:17): [True: 0, False: 0]
  ------------------
30856|      0|                hash = at->hash(xx, janet_abstract_size(xx));
  ------------------
  |  | 1707|      0|#define janet_abstract_size(u) (janet_abstract_head(u)->size)
  |  |  ------------------
  |  |  |  | 1704|      0|#define janet_abstract_head(u) ((JanetAbstractHead *)((char *)u - offsetof(JanetAbstractHead, data)))
  |  |  ------------------
  ------------------
30857|      0|                break;
30858|      0|            }
30859|      0|        }
30860|       |        /* fallthrough */
30861|  3.68M|        default:
  ------------------
  |  Branch (30861:9): [True: 3.68M, False: 15.6M]
  ------------------
30862|  3.68M|            if (sizeof(double) == sizeof(void *)) {
  ------------------
  |  Branch (30862:17): [Folded - Ignored]
  ------------------
30863|       |                /* Assuming 8 byte pointer (8 byte aligned) */
30864|  3.68M|                uint64_t i = murmur64(janet_u64(x));
  ------------------
  |  |  712|  3.68M|#define janet_u64(x) ((x).u64)
  ------------------
30865|  3.68M|                hash = (int32_t)(i >> 32);
30866|  3.68M|            } else {
30867|       |                /* Assuming 4 byte pointer (or smaller) */
30868|      0|                uintptr_t diff = (uintptr_t) janet_unwrap_pointer(x);
  ------------------
  |  |  790|      0|#define janet_unwrap_pointer(x) (janet_nanbox_to_pointer(x))
  ------------------
30869|      0|                uint32_t hilo = (uint32_t) diff * 2654435769u;
30870|      0|                hash = (int32_t)((hilo << 16) | (hilo >> 16));
30871|      0|            }
30872|  3.68M|            break;
30873|  19.3M|    }
30874|  19.3M|    return hash;
30875|  19.3M|}
janet_compare:
30880|  1.73M|int janet_compare(Janet x, Janet y) {
30881|  1.73M|    janet_vm.traversal = janet_vm.traversal_base;
30882|  1.73M|    int status;
30883|  3.32M|    do {
30884|  3.32M|        JanetType tx = janet_type(x);
  ------------------
  |  |  719|  3.32M|    (isnan((x).number) \
  |  |  720|  3.32M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  721|  3.32M|        : JANET_NUMBER)
  ------------------
30885|  3.32M|        JanetType ty = janet_type(y);
  ------------------
  |  |  719|  3.32M|    (isnan((x).number) \
  |  |  720|  3.32M|        ? (JanetType) (((x).u64 >> 47) & 0xF) \
  |  |  721|  3.32M|        : JANET_NUMBER)
  ------------------
30886|  3.32M|        if (tx != ty) return tx < ty ? -1 : 1;
  ------------------
  |  Branch (30886:13): [True: 3.27k, False: 3.32M]
  |  Branch (30886:30): [True: 3.05k, False: 218]
  ------------------
30887|  3.32M|        switch (tx) {
30888|  1.53M|            case JANET_NIL:
  ------------------
  |  Branch (30888:13): [True: 1.53M, False: 1.78M]
  ------------------
30889|  1.53M|                break;
30890|    196|            case JANET_BOOLEAN: {
  ------------------
  |  Branch (30890:13): [True: 196, False: 3.32M]
  ------------------
30891|    196|                int diff = janet_unwrap_boolean(x) - janet_unwrap_boolean(y);
  ------------------
  |  |  761|    196|#define janet_unwrap_boolean(x) ((x).u64 & 0x1)
  ------------------
                              int diff = janet_unwrap_boolean(x) - janet_unwrap_boolean(y);
  ------------------
  |  |  761|    196|#define janet_unwrap_boolean(x) ((x).u64 & 0x1)
  ------------------
30892|    196|                if (diff) return diff;
  ------------------
  |  Branch (30892:21): [True: 0, False: 196]
  ------------------
30893|    196|                break;
30894|    196|            }
30895|  1.12k|            case JANET_NUMBER: {
  ------------------
  |  Branch (30895:13): [True: 1.12k, False: 3.32M]
  ------------------
30896|  1.12k|                double xx = janet_unwrap_number(x);
  ------------------
  |  |  762|  1.12k|#define janet_unwrap_number(x) ((x).number)
  ------------------
30897|  1.12k|                double yy = janet_unwrap_number(y);
  ------------------
  |  |  762|  1.12k|#define janet_unwrap_number(x) ((x).number)
  ------------------
30898|  1.12k|                if (xx == yy) {
  ------------------
  |  Branch (30898:21): [True: 895, False: 232]
  ------------------
30899|    895|                    break;
30900|    895|                } else {
30901|    232|                    return (xx < yy) ? -1 : 1;
  ------------------
  |  Branch (30901:28): [True: 211, False: 21]
  ------------------
30902|    232|                }
30903|  1.12k|            }
30904|  43.7k|            case JANET_STRING:
  ------------------
  |  Branch (30904:13): [True: 43.7k, False: 3.28M]
  ------------------
30905|   991k|            case JANET_SYMBOL:
  ------------------
  |  Branch (30905:13): [True: 947k, False: 2.37M]
  ------------------
30906|   991k|            case JANET_KEYWORD: {
  ------------------
  |  Branch (30906:13): [True: 362, False: 3.32M]
  ------------------
30907|   991k|                int diff = janet_string_compare(janet_unwrap_string(x), janet_unwrap_string(y));
  ------------------
  |  |  786|   991k|#define janet_unwrap_string(x) ((const uint8_t *)janet_nanbox_to_pointer(x))
  ------------------
                              int diff = janet_string_compare(janet_unwrap_string(x), janet_unwrap_string(y));
  ------------------
  |  |  786|   991k|#define janet_unwrap_string(x) ((const uint8_t *)janet_nanbox_to_pointer(x))
  ------------------
30908|   991k|                if (diff) return diff;
  ------------------
  |  Branch (30908:21): [True: 148k, False: 843k]
  ------------------
30909|   843k|                break;
30910|   991k|            }
30911|   843k|            case JANET_ABSTRACT: {
  ------------------
  |  Branch (30911:13): [True: 0, False: 3.32M]
  ------------------
30912|      0|                int diff = janet_compare_abstract(janet_unwrap_abstract(x), janet_unwrap_abstract(y));
  ------------------
  |  |  789|      0|#define janet_unwrap_abstract(x) (janet_nanbox_to_pointer(x))
  ------------------
                              int diff = janet_compare_abstract(janet_unwrap_abstract(x), janet_unwrap_abstract(y));
  ------------------
  |  |  789|      0|#define janet_unwrap_abstract(x) (janet_nanbox_to_pointer(x))
  ------------------
30913|      0|                if (diff) return diff;
  ------------------
  |  Branch (30913:21): [True: 0, False: 0]
  ------------------
30914|      0|                break;
30915|      0|            }
30916|     16|            default: {
  ------------------
  |  Branch (30916:13): [True: 16, False: 3.32M]
  ------------------
30917|     16|                if (janet_unwrap_pointer(x) == janet_unwrap_pointer(y)) {
  ------------------
  |  |  790|     16|#define janet_unwrap_pointer(x) (janet_nanbox_to_pointer(x))
  ------------------
                              if (janet_unwrap_pointer(x) == janet_unwrap_pointer(y)) {
  ------------------
  |  |  790|     16|#define janet_unwrap_pointer(x) (janet_nanbox_to_pointer(x))
  ------------------
  |  Branch (30917:21): [True: 0, False: 16]
  ------------------
30918|      0|                    break;
30919|     16|                } else {
30920|     16|                    return janet_unwrap_pointer(x) > janet_unwrap_pointer(y) ? 1 : -1;
  ------------------
  |  |  790|     16|#define janet_unwrap_pointer(x) (janet_nanbox_to_pointer(x))
  ------------------
                                  return janet_unwrap_pointer(x) > janet_unwrap_pointer(y) ? 1 : -1;
  ------------------
  |  |  790|     16|#define janet_unwrap_pointer(x) (janet_nanbox_to_pointer(x))
  ------------------
  |  Branch (30920:28): [True: 7, False: 9]
  ------------------
30921|     16|                }
30922|     16|            }
30923|  27.5k|            case JANET_TUPLE: {
  ------------------
  |  Branch (30923:13): [True: 27.5k, False: 3.29M]
  ------------------
30924|  27.5k|                const Janet *lhs = janet_unwrap_tuple(x);
  ------------------
  |  |  781|  27.5k|#define janet_unwrap_tuple(x) ((const Janet *)janet_nanbox_to_pointer(x))
  ------------------
30925|  27.5k|                const Janet *rhs = janet_unwrap_tuple(y);
  ------------------
  |  |  781|  27.5k|#define janet_unwrap_tuple(x) ((const Janet *)janet_nanbox_to_pointer(x))
  ------------------
30926|  27.5k|                if (JANET_TUPLE_FLAG_BRACKETCTOR & (janet_tuple_flag(lhs) ^ janet_tuple_flag(rhs))) {
  ------------------
  |  | 1608|  27.5k|#define JANET_TUPLE_FLAG_BRACKETCTOR 0x10000
  ------------------
                              if (JANET_TUPLE_FLAG_BRACKETCTOR & (janet_tuple_flag(lhs) ^ janet_tuple_flag(rhs))) {
  ------------------
  |  | 1616|  27.5k|#define janet_tuple_flag(t) (janet_tuple_head(t)->gc.flags)
  |  |  ------------------
  |  |  |  | 1610|  27.5k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
                              if (JANET_TUPLE_FLAG_BRACKETCTOR & (janet_tuple_flag(lhs) ^ janet_tuple_flag(rhs))) {
  ------------------
  |  | 1616|  27.5k|#define janet_tuple_flag(t) (janet_tuple_head(t)->gc.flags)
  |  |  ------------------
  |  |  |  | 1610|  27.5k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
  |  Branch (30926:21): [True: 0, False: 27.5k]
  ------------------
30927|      0|                    return (janet_tuple_flag(lhs) & JANET_TUPLE_FLAG_BRACKETCTOR) ? 1 : -1;
  ------------------
  |  | 1616|      0|#define janet_tuple_flag(t) (janet_tuple_head(t)->gc.flags)
  |  |  ------------------
  |  |  |  | 1610|      0|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
                                  return (janet_tuple_flag(lhs) & JANET_TUPLE_FLAG_BRACKETCTOR) ? 1 : -1;
  ------------------
  |  | 1608|      0|#define JANET_TUPLE_FLAG_BRACKETCTOR 0x10000
  ------------------
  |  Branch (30927:28): [True: 0, False: 0]
  ------------------
30928|      0|                }
30929|  27.5k|                push_traversal_node(janet_tuple_head(lhs), janet_tuple_head(rhs), 1);
  ------------------
  |  | 1610|  27.5k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  ------------------
                              push_traversal_node(janet_tuple_head(lhs), janet_tuple_head(rhs), 1);
  ------------------
  |  | 1610|  27.5k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  ------------------
30930|  27.5k|                break;
30931|  27.5k|            }
30932|   767k|            case JANET_STRUCT: {
  ------------------
  |  Branch (30932:13): [True: 767k, False: 2.55M]
  ------------------
30933|   767k|                const JanetKV *lhs = janet_unwrap_struct(x);
  ------------------
  |  |  780|   767k|#define janet_unwrap_struct(x) ((const JanetKV *)janet_nanbox_to_pointer(x))
  ------------------
30934|   767k|                const JanetKV *rhs = janet_unwrap_struct(y);
  ------------------
  |  |  780|   767k|#define janet_unwrap_struct(x) ((const JanetKV *)janet_nanbox_to_pointer(x))
  ------------------
30935|   767k|                int32_t llen = janet_struct_capacity(lhs);
  ------------------
  |  | 1659|   767k|#define janet_struct_capacity(t) (janet_struct_head(t)->capacity)
  |  |  ------------------
  |  |  |  | 1656|   767k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
30936|   767k|                int32_t rlen = janet_struct_capacity(rhs);
  ------------------
  |  | 1659|   767k|#define janet_struct_capacity(t) (janet_struct_head(t)->capacity)
  |  |  ------------------
  |  |  |  | 1656|   767k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
30937|   767k|                int32_t lhash = janet_struct_hash(lhs);
  ------------------
  |  | 1660|   767k|#define janet_struct_hash(t) (janet_struct_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1656|   767k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
30938|   767k|                int32_t rhash = janet_struct_hash(rhs);
  ------------------
  |  | 1660|   767k|#define janet_struct_hash(t) (janet_struct_head(t)->hash)
  |  |  ------------------
  |  |  |  | 1656|   767k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  |  |  ------------------
  ------------------
30939|   767k|                if (llen < rlen) return -1;
  ------------------
  |  Branch (30939:21): [True: 328, False: 767k]
  ------------------
30940|   767k|                if (llen > rlen) return 1;
  ------------------
  |  Branch (30940:21): [True: 196, False: 767k]
  ------------------
30941|   767k|                if (lhash < rhash) return -1;
  ------------------
  |  Branch (30941:21): [True: 0, False: 767k]
  ------------------
30942|   767k|                if (lhash > rhash) return 1;
  ------------------
  |  Branch (30942:21): [True: 0, False: 767k]
  ------------------
30943|   767k|                push_traversal_node(janet_struct_head(lhs), janet_struct_head(rhs), 0);
  ------------------
  |  | 1656|   767k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  ------------------
                              push_traversal_node(janet_struct_head(lhs), janet_struct_head(rhs), 0);
  ------------------
  |  | 1656|   767k|#define janet_struct_head(t) ((JanetStructHead *)((char *)t - offsetof(JanetStructHead, data)))
  ------------------
30944|   767k|                break;
30945|   767k|            }
30946|  3.32M|        }
30947|  3.32M|    } while (!(status = traversal_next(&x, &y)));
  ------------------
  |  Branch (30947:14): [True: 1.59M, False: 1.58M]
  ------------------
30948|  1.58M|    return status - 2;
30949|  1.73M|}
janet_init:
32909|  5.24k|int janet_init(void) {
32910|       |
32911|       |    /* Garbage collection */
32912|  5.24k|    janet_vm.blocks = NULL;
32913|  5.24k|    janet_vm.next_collection = 0;
32914|  5.24k|    janet_vm.gc_interval = 0x400000;
32915|  5.24k|    janet_vm.block_count = 0;
32916|       |
32917|  5.24k|    janet_symcache_init();
32918|       |
32919|       |    /* Initialize gc roots */
32920|  5.24k|    janet_vm.roots = NULL;
32921|  5.24k|    janet_vm.root_count = 0;
32922|  5.24k|    janet_vm.root_capacity = 0;
32923|       |
32924|       |    /* Scratch memory */
32925|  5.24k|    janet_vm.user = NULL;
32926|  5.24k|    janet_vm.scratch_mem = NULL;
32927|  5.24k|    janet_vm.scratch_len = 0;
32928|  5.24k|    janet_vm.scratch_cap = 0;
32929|       |
32930|       |    /* Sandbox flags */
32931|  5.24k|    janet_vm.sandbox_flags = 0;
32932|       |
32933|       |    /* Initialize registry */
32934|  5.24k|    janet_vm.registry = NULL;
32935|  5.24k|    janet_vm.registry_cap = 0;
32936|  5.24k|    janet_vm.registry_count = 0;
32937|  5.24k|    janet_vm.registry_dirty = 0;
32938|       |
32939|       |    /* Intialize abstract registry */
32940|  5.24k|    janet_vm.abstract_registry = janet_table(0);
32941|  5.24k|    janet_gcroot(janet_wrap_table(janet_vm.abstract_registry));
  ------------------
  |  |  769|  5.24k|#define janet_wrap_table(s) janet_nanbox_wrap_((s), JANET_TABLE)
  |  |  ------------------
  |  |  |  |  748|  5.24k|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|  5.24k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|  5.24k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
32942|       |
32943|       |    /* Traversal */
32944|  5.24k|    janet_vm.traversal = NULL;
32945|  5.24k|    janet_vm.traversal_base = NULL;
32946|  5.24k|    janet_vm.traversal_top = NULL;
32947|       |
32948|       |    /* Core env */
32949|  5.24k|    janet_vm.core_env = NULL;
32950|       |
32951|       |    /* Auto suspension */
32952|  5.24k|    janet_vm.auto_suspend = 0;
32953|       |
32954|       |    /* Dynamic bindings */
32955|  5.24k|    janet_vm.top_dyns = NULL;
32956|       |
32957|       |    /* Seed RNG */
32958|  5.24k|    janet_rng_seed(janet_default_rng(), 0);
32959|       |
32960|       |    /* Fibers */
32961|  5.24k|    janet_vm.fiber = NULL;
32962|  5.24k|    janet_vm.root_fiber = NULL;
32963|  5.24k|    janet_vm.stackn = 0;
32964|       |
32965|  5.24k|#ifdef JANET_EV
32966|  5.24k|    janet_ev_init();
32967|  5.24k|#endif
32968|  5.24k|#ifdef JANET_NET
32969|  5.24k|    janet_net_init();
32970|  5.24k|#endif
32971|  5.24k|    return 0;
32972|  5.24k|}
janet_deinit:
32987|  5.24k|void janet_deinit(void) {
32988|  5.24k|    janet_clear_memory();
32989|  5.24k|    janet_symcache_deinit();
32990|  5.24k|    janet_free(janet_vm.roots);
  ------------------
  |  | 2159|  5.24k|#define janet_free(X) free((X))
  ------------------
32991|  5.24k|    janet_vm.roots = NULL;
32992|  5.24k|    janet_vm.root_count = 0;
32993|  5.24k|    janet_vm.root_capacity = 0;
32994|  5.24k|    janet_vm.abstract_registry = NULL;
32995|  5.24k|    janet_vm.core_env = NULL;
32996|  5.24k|    janet_vm.top_dyns = NULL;
32997|  5.24k|    janet_vm.user = NULL;
32998|  5.24k|    janet_free(janet_vm.traversal_base);
  ------------------
  |  | 2159|  5.24k|#define janet_free(X) free((X))
  ------------------
32999|  5.24k|    janet_vm.fiber = NULL;
33000|  5.24k|    janet_vm.root_fiber = NULL;
33001|  5.24k|    janet_free(janet_vm.registry);
  ------------------
  |  | 2159|  5.24k|#define janet_free(X) free((X))
  ------------------
33002|  5.24k|    janet_vm.registry = NULL;
33003|  5.24k|#ifdef JANET_EV
33004|  5.24k|    janet_ev_deinit();
33005|  5.24k|#endif
33006|  5.24k|#ifdef JANET_NET
33007|  5.24k|    janet_net_deinit();
33008|  5.24k|#endif
33009|  5.24k|}
janet_memalloc_empty:
33177|  68.1k|void *janet_memalloc_empty(int32_t count) {
33178|  68.1k|    int32_t i;
33179|  68.1k|    void *mem = janet_malloc((size_t) count * sizeof(JanetKV));
  ------------------
  |  | 2150|  68.1k|#define janet_malloc(X) malloc((X))
  ------------------
33180|  68.1k|    janet_vm.next_collection += (size_t) count * sizeof(JanetKV);
33181|  68.1k|    if (NULL == mem) {
  ------------------
  |  Branch (33181:9): [True: 0, False: 68.1k]
  ------------------
33182|      0|        JANET_OUT_OF_MEMORY;
  ------------------
  |  |  360|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (360:122): [Folded - Ignored]
  |  |  ------------------
  ------------------
33183|      0|    }
33184|  68.1k|    JanetKV *mmem = (JanetKV *)mem;
33185|  2.75M|    for (i = 0; i < count; i++) {
  ------------------
  |  Branch (33185:17): [True: 2.68M, False: 68.1k]
  ------------------
33186|  2.68M|        JanetKV *kv = mmem + i;
33187|  2.68M|        kv->key = janet_wrap_nil();
  ------------------
  |  |  754|  2.68M|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  745|  2.68M|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|  2.68M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|  2.68M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
33188|  2.68M|        kv->value = janet_wrap_nil();
  ------------------
  |  |  754|  2.68M|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  745|  2.68M|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|  2.68M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|  2.68M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
33189|  2.68M|    }
33190|  68.1k|    return mem;
33191|  68.1k|}
janet_memempty:
33193|  3.57M|void janet_memempty(JanetKV *mem, int32_t count) {
33194|  3.57M|    int32_t i;
33195|  15.6M|    for (i = 0; i < count; i++) {
  ------------------
  |  Branch (33195:17): [True: 12.0M, False: 3.57M]
  ------------------
33196|  12.0M|        mem[i].key = janet_wrap_nil();
  ------------------
  |  |  754|  12.0M|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  745|  12.0M|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|  12.0M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|  12.0M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
33197|  12.0M|        mem[i].value = janet_wrap_nil();
  ------------------
  |  |  754|  12.0M|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  745|  12.0M|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|  12.0M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|  12.0M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
33198|  12.0M|    }
33199|  3.57M|}
janet_nanbox_to_pointer:
33209|  12.0M|void *janet_nanbox_to_pointer(Janet x) {
33210|  12.0M|    x.i64 &= JANET_NANBOX_PAYLOADBITS;
  ------------------
  |  |  715|  12.0M|#define JANET_NANBOX_PAYLOADBITS 0x00007FFFFFFFFFFFllu
  ------------------
33211|  12.0M|    return x.pointer;
33212|  12.0M|}
janet_nanbox_from_pointer:
33214|  1.17M|Janet janet_nanbox_from_pointer(void *p, uint64_t tagmask) {
33215|  1.17M|    Janet ret;
33216|  1.17M|    ret.pointer = p;
33217|  1.17M|    ret.u64 |= tagmask;
33218|  1.17M|    return ret;
33219|  1.17M|}
janet_nanbox_from_cpointer:
33221|  8.99M|Janet janet_nanbox_from_cpointer(const void *p, uint64_t tagmask) {
33222|  8.99M|    Janet ret;
33223|  8.99M|    ret.pointer = (void *)p;
33224|  8.99M|    ret.u64 |= tagmask;
33225|  8.99M|    return ret;
33226|  8.99M|}
janet_nanbox_from_double:
33228|  31.1k|Janet janet_nanbox_from_double(double d) {
33229|  31.1k|    Janet ret;
33230|  31.1k|    ret.number = d;
33231|  31.1k|    return ret;
33232|  31.1k|}
janet_nanbox_from_bits:
33234|  29.4M|Janet janet_nanbox_from_bits(uint64_t bits) {
33235|  29.4M|    Janet ret;
33236|  29.4M|    ret.u64 = bits;
33237|  29.4M|    return ret;
33238|  29.4M|}
janet.c:janet_buffer_init_impl:
 2938|  1.12M|static JanetBuffer *janet_buffer_init_impl(JanetBuffer *buffer, int32_t capacity) {
 2939|  1.12M|    uint8_t *data = NULL;
 2940|  1.12M|    if (capacity < 4) capacity = 4;
  ------------------
  |  Branch (2940:9): [True: 1.12M, False: 531]
  ------------------
 2941|  1.12M|    janet_gcpressure(capacity);
 2942|  1.12M|    data = janet_malloc(sizeof(uint8_t) * (size_t) capacity);
  ------------------
  |  | 2150|  1.12M|#define janet_malloc(X) malloc((X))
  ------------------
 2943|  1.12M|    if (NULL == data) {
  ------------------
  |  Branch (2943:9): [True: 0, False: 1.12M]
  ------------------
 2944|      0|        JANET_OUT_OF_MEMORY;
  ------------------
  |  |  360|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (360:122): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2945|      0|    }
 2946|  1.12M|    buffer->count = 0;
 2947|  1.12M|    buffer->capacity = capacity;
 2948|  1.12M|    buffer->data = data;
 2949|  1.12M|    return buffer;
 2950|  1.12M|}
janet.c:janet_buffer_can_realloc:
 2931|     58|static void janet_buffer_can_realloc(JanetBuffer *buffer) {
 2932|     58|    if (buffer->gc.flags & JANET_BUFFER_FLAG_NO_REALLOC) {
  ------------------
  |  | 1590|     58|#define JANET_BUFFER_FLAG_NO_REALLOC 0x10000
  ------------------
  |  Branch (2932:9): [True: 0, False: 58]
  ------------------
 2933|      0|        janet_panic("buffer cannot reallocate foreign memory");
 2934|      0|    }
 2935|     58|}
janet.c:janet_q_init:
 8205|  5.24k|static void janet_q_init(JanetQueue *q) {
 8206|  5.24k|    q->data = NULL;
 8207|  5.24k|    q->head = 0;
 8208|  5.24k|    q->tail = 0;
 8209|  5.24k|    q->capacity = 0;
 8210|  5.24k|}
janet.c:janet_q_deinit:
 8212|  5.24k|static void janet_q_deinit(JanetQueue *q) {
 8213|  5.24k|    janet_free(q->data);
  ------------------
  |  | 2159|  5.24k|#define janet_free(X) free((X))
  ------------------
 8214|  5.24k|}
janet.c:janet_ev_setup_selfpipe:
 9495|  5.24k|static void janet_ev_setup_selfpipe(void) {
 9496|  5.24k|    if (janet_make_pipe(janet_vm.selfpipe, 0)) {
  ------------------
  |  Branch (9496:9): [True: 0, False: 5.24k]
  ------------------
 9497|      0|        JANET_EXIT("failed to initialize self pipe in event loop");
  ------------------
  |  |  347|      0|#define JANET_EXIT(m) do { \
  |  |  348|      0|    fprintf(stderr, "C runtime error at line %d in file %s: %s\n",\
  |  |  349|      0|        __LINE__,\
  |  |  350|      0|        __FILE__,\
  |  |  351|      0|        (m));\
  |  |  352|      0|    exit(1);\
  |  |  353|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (353:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
 9498|      0|    }
 9499|  5.24k|}
janet.c:janet_ev_cleanup_selfpipe:
 9511|  5.24k|static void janet_ev_cleanup_selfpipe(void) {
 9512|  5.24k|    close(janet_vm.selfpipe[0]);
 9513|  5.24k|    close(janet_vm.selfpipe[1]);
 9514|  5.24k|}
janet.c:janet_deinit_block:
13944|  6.27M|static void janet_deinit_block(JanetGCObject *mem) {
13945|  6.27M|    switch (mem->flags & JANET_MEM_TYPEBITS) {
  ------------------
  |  |  544|  6.27M|#define JANET_MEM_TYPEBITS 0xFF
  ------------------
13946|  5.06M|        default:
  ------------------
  |  Branch (13946:9): [True: 5.06M, False: 1.20M]
  ------------------
13947|  5.06M|        case JANET_MEMORY_FUNCTION:
  ------------------
  |  Branch (13947:9): [True: 0, False: 6.27M]
  ------------------
13948|  5.06M|            break; /* Do nothing for non gc types */
13949|  27.5k|        case JANET_MEMORY_SYMBOL:
  ------------------
  |  Branch (13949:9): [True: 27.5k, False: 6.24M]
  ------------------
13950|  27.5k|            janet_symbol_deinit(((JanetStringHead *) mem)->data);
13951|  27.5k|            break;
13952|  1.06k|        case JANET_MEMORY_ARRAY:
  ------------------
  |  Branch (13952:9): [True: 1.06k, False: 6.27M]
  ------------------
13953|  1.06k|            janet_free(((JanetArray *) mem)->data);
  ------------------
  |  | 2159|  1.06k|#define janet_free(X) free((X))
  ------------------
13954|  1.06k|            break;
13955|  56.2k|        case JANET_MEMORY_TABLE:
  ------------------
  |  Branch (13955:9): [True: 56.2k, False: 6.22M]
  ------------------
13956|  56.2k|            janet_free(((JanetTable *) mem)->data);
  ------------------
  |  | 2159|  56.2k|#define janet_free(X) free((X))
  ------------------
13957|  56.2k|            break;
13958|      0|        case JANET_MEMORY_FIBER:
  ------------------
  |  Branch (13958:9): [True: 0, False: 6.27M]
  ------------------
13959|      0|            janet_free(((JanetFiber *)mem)->data);
  ------------------
  |  | 2159|      0|#define janet_free(X) free((X))
  ------------------
13960|      0|            break;
13961|  1.12M|        case JANET_MEMORY_BUFFER:
  ------------------
  |  Branch (13961:9): [True: 1.12M, False: 5.15M]
  ------------------
13962|  1.12M|            janet_buffer_deinit((JanetBuffer *) mem);
13963|  1.12M|            break;
13964|      0|        case JANET_MEMORY_ABSTRACT: {
  ------------------
  |  Branch (13964:9): [True: 0, False: 6.27M]
  ------------------
13965|      0|            JanetAbstractHead *head = (JanetAbstractHead *)mem;
13966|      0|            if (head->type->gc) {
  ------------------
  |  Branch (13966:17): [True: 0, False: 0]
  ------------------
13967|      0|                janet_assert(!head->type->gc(head->data, head->size), "finalizer failed");
  ------------------
  |  |  358|      0|#define janet_assert(c, m) do { \
  |  |  359|      0|    if (!(c)) JANET_EXIT((m)); \
  |  |  ------------------
  |  |  |  |  347|      0|#define JANET_EXIT(m) do { \
  |  |  |  |  348|      0|    fprintf(stderr, "C runtime error at line %d in file %s: %s\n",\
  |  |  |  |  349|      0|        __LINE__,\
  |  |  |  |  350|      0|        __FILE__,\
  |  |  |  |  351|      0|        (m));\
  |  |  |  |  352|      0|    exit(1);\
  |  |  |  |  353|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (353:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (359:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  360|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (360:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
13968|      0|            }
13969|      0|        }
13970|      0|        break;
13971|      0|        case JANET_MEMORY_FUNCENV: {
  ------------------
  |  Branch (13971:9): [True: 0, False: 6.27M]
  ------------------
13972|      0|            JanetFuncEnv *env = (JanetFuncEnv *)mem;
13973|      0|            if (0 == env->offset)
  ------------------
  |  Branch (13973:17): [True: 0, False: 0]
  ------------------
13974|      0|                janet_free(env->as.values);
  ------------------
  |  | 2159|      0|#define janet_free(X) free((X))
  ------------------
13975|      0|        }
13976|      0|        break;
13977|      0|        case JANET_MEMORY_FUNCDEF: {
  ------------------
  |  Branch (13977:9): [True: 0, False: 6.27M]
  ------------------
13978|      0|            JanetFuncDef *def = (JanetFuncDef *)mem;
13979|       |            /* TODO - get this all with one alloc and one free */
13980|      0|            janet_free(def->defs);
  ------------------
  |  | 2159|      0|#define janet_free(X) free((X))
  ------------------
13981|      0|            janet_free(def->environments);
  ------------------
  |  | 2159|      0|#define janet_free(X) free((X))
  ------------------
13982|      0|            janet_free(def->constants);
  ------------------
  |  | 2159|      0|#define janet_free(X) free((X))
  ------------------
13983|      0|            janet_free(def->bytecode);
  ------------------
  |  | 2159|      0|#define janet_free(X) free((X))
  ------------------
13984|      0|            janet_free(def->sourcemap);
  ------------------
  |  | 2159|      0|#define janet_free(X) free((X))
  ------------------
13985|      0|            janet_free(def->closure_bitset);
  ------------------
  |  | 2159|      0|#define janet_free(X) free((X))
  ------------------
13986|      0|            janet_free(def->symbolmap);
  ------------------
  |  | 2159|      0|#define janet_free(X) free((X))
  ------------------
13987|      0|        }
13988|      0|        break;
13989|  6.27M|    }
13990|  6.27M|}
janet.c:janet_free_all_scratch:
14086|  5.24k|static void janet_free_all_scratch(void) {
14087|  5.24k|    for (size_t i = 0; i < janet_vm.scratch_len; i++) {
  ------------------
  |  Branch (14087:24): [True: 0, False: 5.24k]
  ------------------
14088|      0|        free_one_scratch(janet_vm.scratch_mem[i]);
14089|      0|    }
14090|  5.24k|    janet_vm.scratch_len = 0;
14091|  5.24k|}
janet.c:janet_parser_checkdead:
22076|  65.2M|static void janet_parser_checkdead(JanetParser *parser) {
22077|  65.2M|    if (parser->flag) janet_panic("parser is dead, cannot consume");
  ------------------
  |  Branch (22077:9): [True: 0, False: 65.2M]
  ------------------
22078|  65.2M|    if (parser->error) janet_panic("parser has unchecked error, cannot consume");
  ------------------
  |  Branch (22078:9): [True: 0, False: 65.2M]
  ------------------
22079|  65.2M|}
janet.c:delim_error:
21600|    226|static void delim_error(JanetParser *parser, size_t stack_index, char c, const char *msg) {
21601|    226|    JanetParseState *s = parser->states + stack_index;
21602|    226|    JanetBuffer *buffer = janet_buffer(40);
21603|    226|    if (msg) {
  ------------------
  |  Branch (21603:9): [True: 226, False: 0]
  ------------------
21604|    226|        janet_buffer_push_cstring(buffer, msg);
21605|    226|    }
21606|    226|    if (c) {
  ------------------
  |  Branch (21606:9): [True: 226, False: 0]
  ------------------
21607|    226|        janet_buffer_push_u8(buffer, c);
21608|    226|    }
21609|    226|    if (stack_index > 0) {
  ------------------
  |  Branch (21609:9): [True: 58, False: 168]
  ------------------
21610|     58|        janet_buffer_push_cstring(buffer, ", ");
21611|     58|        if (s->flags & PFLAG_PARENS) {
  ------------------
  |  |21536|     58|#define PFLAG_PARENS 0x400
  ------------------
  |  Branch (21611:13): [True: 8, False: 50]
  ------------------
21612|      8|            janet_buffer_push_u8(buffer, '(');
21613|     50|        } else if (s->flags & PFLAG_SQRBRACKETS) {
  ------------------
  |  |21537|     50|#define PFLAG_SQRBRACKETS 0x800
  ------------------
  |  Branch (21613:20): [True: 27, False: 23]
  ------------------
21614|     27|            janet_buffer_push_u8(buffer, '[');
21615|     27|        } else if (s->flags & PFLAG_CURLYBRACKETS) {
  ------------------
  |  |21538|     23|#define PFLAG_CURLYBRACKETS 0x1000
  ------------------
  |  Branch (21615:20): [True: 12, False: 11]
  ------------------
21616|     12|            janet_buffer_push_u8(buffer, '{');
21617|     12|        } else if (s->flags & PFLAG_STRING) {
  ------------------
  |  |21539|     11|#define PFLAG_STRING 0x2000
  ------------------
  |  Branch (21617:20): [True: 0, False: 11]
  ------------------
21618|      0|            janet_buffer_push_u8(buffer, '"');
21619|     11|        } else if (s->flags & PFLAG_LONGSTRING) {
  ------------------
  |  |21540|     11|#define PFLAG_LONGSTRING 0x4000
  ------------------
  |  Branch (21619:20): [True: 0, False: 11]
  ------------------
21620|      0|            int32_t i;
21621|      0|            for (i = 0; i < s->argn; i++) {
  ------------------
  |  Branch (21621:25): [True: 0, False: 0]
  ------------------
21622|      0|                janet_buffer_push_u8(buffer, '`');
21623|      0|            }
21624|      0|        }
21625|     58|        janet_formatb(buffer, " opened at line %d, column %d", s->line, s->column);
21626|     58|    }
21627|    226|    parser->error = (const char *) janet_string(buffer->data, buffer->count);
21628|    226|    parser->flag |= JANET_PARSER_GENERATED_ERROR;
  ------------------
  |  |21421|    226|#define JANET_PARSER_GENERATED_ERROR 0x2
  ------------------
21629|    226|}
janet.c:pushstate:
21546|  15.0M|static void pushstate(JanetParser *p, Consumer consumer, int flags) {
21547|  15.0M|    JanetParseState s;
21548|  15.0M|    s.counter = 0;
21549|  15.0M|    s.argn = 0;
21550|  15.0M|    s.flags = flags;
21551|  15.0M|    s.consumer = consumer;
21552|  15.0M|    s.line = p->line;
21553|  15.0M|    s.column = p->column;
21554|  15.0M|    _pushstate(p, s);
21555|  15.0M|}
janet.c:_pushstate:
21511|  15.0M|static void NAME(JanetParser *p, T x) { \
21512|  15.0M|    size_t oldcount = p->STACKCOUNT; \
21513|  15.0M|    size_t newcount = oldcount + 1; \
21514|  15.0M|    if (newcount > p->STACKCAP) { \
  ------------------
  |  Branch (21514:9): [True: 8.70k, False: 15.0M]
  ------------------
21515|  8.70k|        T *next; \
21516|  8.70k|        size_t newcap = 2 * newcount; \
21517|  8.70k|        next = janet_realloc(p->STACK, sizeof(T) * newcap); \
  ------------------
  |  | 2153|  8.70k|#define janet_realloc(X, Y) realloc((X), (Y))
  ------------------
21518|  8.70k|        if (NULL == next) { \
  ------------------
  |  Branch (21518:13): [True: 0, False: 8.70k]
  ------------------
21519|      0|            JANET_OUT_OF_MEMORY; \
  ------------------
  |  |  360|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (360:122): [Folded - Ignored]
  |  |  ------------------
  ------------------
21520|      0|        } \
21521|  8.70k|        p->STACK = next; \
21522|  8.70k|        p->STACKCAP = newcap; \
21523|  8.70k|    } \
21524|  15.0M|    p->STACK[oldcount] = x; \
21525|  15.0M|    p->STACKCOUNT = newcount; \
21526|  15.0M|}
janet.c:root:
22003|  17.6M|static int root(JanetParser *p, JanetParseState *state, uint8_t c) {
22004|  17.6M|    switch (c) {
22005|  3.89M|        default:
  ------------------
  |  Branch (22005:9): [True: 3.89M, False: 13.7M]
  ------------------
22006|  3.89M|            if (is_whitespace(c)) return 1;
  ------------------
  |  Branch (22006:17): [True: 112k, False: 3.78M]
  ------------------
22007|  3.78M|            if (!janet_is_symbol_char(c)) {
  ------------------
  |  Branch (22007:17): [True: 328, False: 3.78M]
  ------------------
22008|    328|                p->error = "unexpected character";
22009|    328|                return 1;
22010|    328|            }
22011|  3.78M|            pushstate(p, tokenchar, PFLAG_TOKEN);
  ------------------
  |  |21544|  3.78M|#define PFLAG_TOKEN 0x40000
  ------------------
22012|  3.78M|            return 0;
22013|  4.14k|        case '\'':
  ------------------
  |  Branch (22013:9): [True: 4.14k, False: 17.6M]
  ------------------
22014|   156k|        case ',':
  ------------------
  |  Branch (22014:9): [True: 151k, False: 17.5M]
  ------------------
22015|   159k|        case ';':
  ------------------
  |  Branch (22015:9): [True: 3.45k, False: 17.6M]
  ------------------
22016|   174k|        case '~':
  ------------------
  |  Branch (22016:9): [True: 14.5k, False: 17.6M]
  ------------------
22017|   322k|        case '|':
  ------------------
  |  Branch (22017:9): [True: 148k, False: 17.5M]
  ------------------
22018|   322k|            pushstate(p, root, PFLAG_READERMAC | c);
  ------------------
  |  |21541|   322k|#define PFLAG_READERMAC 0x8000
  ------------------
22019|   322k|            return 1;
22020|  1.26M|        case '"':
  ------------------
  |  Branch (22020:9): [True: 1.26M, False: 16.3M]
  ------------------
22021|  1.26M|            pushstate(p, stringchar, PFLAG_STRING);
  ------------------
  |  |21539|  1.26M|#define PFLAG_STRING 0x2000
  ------------------
22022|  1.26M|            return 1;
22023|    378|        case '#':
  ------------------
  |  Branch (22023:9): [True: 378, False: 17.6M]
  ------------------
22024|    378|            pushstate(p, comment, PFLAG_COMMENT);
  ------------------
  |  |21543|    378|#define PFLAG_COMMENT 0x20000
  ------------------
22025|    378|            return 1;
22026|  1.17M|        case '@':
  ------------------
  |  Branch (22026:9): [True: 1.17M, False: 16.4M]
  ------------------
22027|  1.17M|            pushstate(p, atsign, PFLAG_ATSYM);
  ------------------
  |  |21542|  1.17M|#define PFLAG_ATSYM 0x10000
  ------------------
22028|  1.17M|            return 1;
22029|  1.95k|        case '`':
  ------------------
  |  Branch (22029:9): [True: 1.95k, False: 17.6M]
  ------------------
22030|  1.95k|            pushstate(p, longstring, PFLAG_LONGSTRING);
  ------------------
  |  |21540|  1.95k|#define PFLAG_LONGSTRING 0x4000
  ------------------
22031|  1.95k|            return 1;
22032|    913|        case ')':
  ------------------
  |  Branch (22032:9): [True: 913, False: 17.6M]
  ------------------
22033|  4.08k|        case ']':
  ------------------
  |  Branch (22033:9): [True: 3.17k, False: 17.6M]
  ------------------
22034|  3.63M|        case '}': {
  ------------------
  |  Branch (22034:9): [True: 3.62M, False: 14.0M]
  ------------------
22035|  3.63M|            Janet ds;
22036|  3.63M|            if (p->statecount == 1) {
  ------------------
  |  Branch (22036:17): [True: 168, False: 3.63M]
  ------------------
22037|    168|                delim_error(p, 0, c, "unexpected closing delimiter ");
22038|    168|                return 1;
22039|    168|            }
22040|  3.63M|            if ((c == ')' && (state->flags & PFLAG_PARENS)) ||
  ------------------
  |  |21536|    876|#define PFLAG_PARENS 0x400
  ------------------
  |  Branch (22040:18): [True: 876, False: 3.63M]
  |  Branch (22040:30): [True: 861, False: 15]
  ------------------
22041|  3.63M|                    (c == ']' && (state->flags & PFLAG_SQRBRACKETS))) {
  ------------------
  |  |21537|  3.15k|#define PFLAG_SQRBRACKETS 0x800
  ------------------
  |  Branch (22041:22): [True: 3.15k, False: 3.62M]
  |  Branch (22041:34): [True: 3.14k, False: 15]
  ------------------
22042|  4.00k|                if (state->flags & PFLAG_ATSYM) {
  ------------------
  |  |21542|  4.00k|#define PFLAG_ATSYM 0x10000
  ------------------
  |  Branch (22042:21): [True: 1.06k, False: 2.94k]
  ------------------
22043|  1.06k|                    ds = close_array(p, state);
22044|  2.94k|                } else {
22045|  2.94k|                    ds = close_tuple(p, state, c == ']' ? JANET_TUPLE_FLAG_BRACKETCTOR : 0);
  ------------------
  |  | 1608|  2.14k|#define JANET_TUPLE_FLAG_BRACKETCTOR 0x10000
  ------------------
  |  Branch (22045:48): [True: 2.14k, False: 795]
  ------------------
22046|  2.94k|                }
22047|  3.62M|            } else if (c == '}' && (state->flags & PFLAG_CURLYBRACKETS)) {
  ------------------
  |  |21538|  3.62M|#define PFLAG_CURLYBRACKETS 0x1000
  ------------------
  |  Branch (22047:24): [True: 3.62M, False: 30]
  |  Branch (22047:36): [True: 3.62M, False: 28]
  ------------------
22048|  3.62M|                if (state->argn & 1) {
  ------------------
  |  Branch (22048:21): [True: 18, False: 3.62M]
  ------------------
22049|     18|                    p->error = "struct and table literals expect even number of arguments";
22050|     18|                    return 1;
22051|     18|                }
22052|  3.62M|                if (state->flags & PFLAG_ATSYM) {
  ------------------
  |  |21542|  3.62M|#define PFLAG_ATSYM 0x10000
  ------------------
  |  Branch (22052:21): [True: 50.9k, False: 3.57M]
  ------------------
22053|  50.9k|                    ds = close_table(p, state);
22054|  3.57M|                } else {
22055|  3.57M|                    ds = close_struct(p, state);
22056|  3.57M|                }
22057|  3.62M|            } else {
22058|     58|                delim_error(p, p->statecount - 1, c, "mismatched delimiter ");
22059|     58|                return 1;
22060|     58|            }
22061|  3.63M|            popstate(p, ds);
22062|  3.63M|        }
22063|      0|        return 1;
22064|  5.62k|        case '(':
  ------------------
  |  Branch (22064:9): [True: 5.62k, False: 17.6M]
  ------------------
22065|  5.62k|            pushstate(p, root, PFLAG_CONTAINER | PFLAG_PARENS);
  ------------------
  |  |21534|  5.62k|#define PFLAG_CONTAINER 0x100
  ------------------
                          pushstate(p, root, PFLAG_CONTAINER | PFLAG_PARENS);
  ------------------
  |  |21536|  5.62k|#define PFLAG_PARENS 0x400
  ------------------
22066|  5.62k|            return 1;
22067|  3.70M|        case '[':
  ------------------
  |  Branch (22067:9): [True: 3.70M, False: 13.9M]
  ------------------
22068|  3.70M|            pushstate(p, root, PFLAG_CONTAINER | PFLAG_SQRBRACKETS);
  ------------------
  |  |21534|  3.70M|#define PFLAG_CONTAINER 0x100
  ------------------
                          pushstate(p, root, PFLAG_CONTAINER | PFLAG_SQRBRACKETS);
  ------------------
  |  |21537|  3.70M|#define PFLAG_SQRBRACKETS 0x800
  ------------------
22069|  3.70M|            return 1;
22070|  3.63M|        case '{':
  ------------------
  |  Branch (22070:9): [True: 3.63M, False: 14.0M]
  ------------------
22071|  3.63M|            pushstate(p, root, PFLAG_CONTAINER | PFLAG_CURLYBRACKETS);
  ------------------
  |  |21534|  3.63M|#define PFLAG_CONTAINER 0x100
  ------------------
                          pushstate(p, root, PFLAG_CONTAINER | PFLAG_CURLYBRACKETS);
  ------------------
  |  |21538|  3.63M|#define PFLAG_CURLYBRACKETS 0x1000
  ------------------
22072|  3.63M|            return 1;
22073|  17.6M|    }
22074|  17.6M|}
janet.c:is_whitespace:
21424|  3.89M|static int is_whitespace(uint8_t c) {
21425|  3.89M|    return c == ' '
  ------------------
  |  Branch (21425:12): [True: 27.7k, False: 3.87M]
  ------------------
21426|  3.89M|           || c == '\t'
  ------------------
  |  Branch (21426:15): [True: 1.62k, False: 3.87M]
  ------------------
21427|  3.89M|           || c == '\n'
  ------------------
  |  Branch (21427:15): [True: 5.18k, False: 3.86M]
  ------------------
21428|  3.89M|           || c == '\r'
  ------------------
  |  Branch (21428:15): [True: 8.01k, False: 3.85M]
  ------------------
21429|  3.89M|           || c == '\0'
  ------------------
  |  Branch (21429:15): [True: 68.0k, False: 3.78M]
  ------------------
21430|  3.89M|           || c == '\v'
  ------------------
  |  Branch (21430:15): [True: 1.28k, False: 3.78M]
  ------------------
21431|  3.89M|           || c == '\f';
  ------------------
  |  Branch (21431:15): [True: 941, False: 3.78M]
  ------------------
21432|  3.89M|}
janet.c:stringchar:
21803|  12.4M|static int stringchar(JanetParser *p, JanetParseState *state, uint8_t c) {
21804|       |    /* Enter escape */
21805|  12.4M|    if (c == '\\') {
  ------------------
  |  Branch (21805:9): [True: 22.3k, False: 12.3M]
  ------------------
21806|  22.3k|        state->consumer = escape1;
21807|  22.3k|        return 1;
21808|  22.3k|    }
21809|       |    /* String end */
21810|  12.3M|    if (c == '"') {
  ------------------
  |  Branch (21810:9): [True: 2.38M, False: 9.99M]
  ------------------
21811|  2.38M|        return stringend(p, state);
21812|  2.38M|    }
21813|       |    /* normal char */
21814|  9.99M|    if (c != '\n' && c != '\r')
  ------------------
  |  Branch (21814:9): [True: 9.99M, False: 1.01k]
  |  Branch (21814:22): [True: 9.99M, False: 234]
  ------------------
21815|  9.99M|        push_buf(p, c);
21816|  9.99M|    return 1;
21817|  12.3M|}
janet.c:escape1:
21719|  22.3k|static int escape1(JanetParser *p, JanetParseState *state, uint8_t c) {
21720|  22.3k|    int e = checkescape(c);
21721|  22.3k|    if (e < 0) {
  ------------------
  |  Branch (21721:9): [True: 25, False: 22.3k]
  ------------------
21722|     25|        p->error = "invalid string escape sequence";
21723|     25|        return 1;
21724|     25|    }
21725|  22.3k|    if (c == 'x') {
  ------------------
  |  Branch (21725:9): [True: 12.1k, False: 10.1k]
  ------------------
21726|  12.1k|        state->counter = 2;
21727|  12.1k|        state->argn = 0;
21728|  12.1k|        state->consumer = escapeh;
21729|  12.1k|    } else if (c == 'u' || c == 'U') {
  ------------------
  |  Branch (21729:16): [True: 1.63k, False: 8.54k]
  |  Branch (21729:28): [True: 853, False: 7.69k]
  ------------------
21730|  2.49k|        state->counter = c == 'u' ? 4 : 6;
  ------------------
  |  Branch (21730:26): [True: 1.63k, False: 853]
  ------------------
21731|  2.49k|        state->argn = 0;
21732|  2.49k|        state->consumer = escapeu;
21733|  7.69k|    } else {
21734|  7.69k|        push_buf(p, (uint8_t) e);
21735|  7.69k|        state->consumer = stringchar;
21736|  7.69k|    }
21737|  22.3k|    return 1;
21738|  22.3k|}
janet.c:checkescape:
21631|  22.3k|static int checkescape(uint8_t c) {
21632|  22.3k|    switch (c) {
21633|     25|        default:
  ------------------
  |  Branch (21633:9): [True: 25, False: 22.3k]
  ------------------
21634|     25|            return -1;
21635|  12.1k|        case 'x':
  ------------------
  |  Branch (21635:9): [True: 12.1k, False: 10.2k]
  ------------------
21636|  13.7k|        case 'u':
  ------------------
  |  Branch (21636:9): [True: 1.63k, False: 20.7k]
  ------------------
21637|  14.6k|        case 'U':
  ------------------
  |  Branch (21637:9): [True: 853, False: 21.5k]
  ------------------
21638|  14.6k|            return 1;
21639|  5.37k|        case 'n':
  ------------------
  |  Branch (21639:9): [True: 5.37k, False: 16.9k]
  ------------------
21640|  5.37k|            return '\n';
21641|    199|        case 't':
  ------------------
  |  Branch (21641:9): [True: 199, False: 22.1k]
  ------------------
21642|    199|            return '\t';
21643|    218|        case 'r':
  ------------------
  |  Branch (21643:9): [True: 218, False: 22.1k]
  ------------------
21644|    218|            return '\r';
21645|    206|        case '0':
  ------------------
  |  Branch (21645:9): [True: 206, False: 22.1k]
  ------------------
21646|    206|            return '\0';
21647|    204|        case 'z':
  ------------------
  |  Branch (21647:9): [True: 204, False: 22.1k]
  ------------------
21648|    204|            return '\0';
21649|    290|        case 'f':
  ------------------
  |  Branch (21649:9): [True: 290, False: 22.0k]
  ------------------
21650|    290|            return '\f';
21651|    388|        case 'v':
  ------------------
  |  Branch (21651:9): [True: 388, False: 21.9k]
  ------------------
21652|    388|            return '\v';
21653|    204|        case 'e':
  ------------------
  |  Branch (21653:9): [True: 204, False: 22.1k]
  ------------------
21654|    204|            return 27;
21655|    266|        case '"':
  ------------------
  |  Branch (21655:9): [True: 266, False: 22.0k]
  ------------------
21656|    266|            return '"';
21657|    342|        case '\\':
  ------------------
  |  Branch (21657:9): [True: 342, False: 22.0k]
  ------------------
21658|    342|            return '\\';
21659|  22.3k|    }
21660|  22.3k|}
janet.c:escapeh:
21683|  24.2k|static int escapeh(JanetParser *p, JanetParseState *state, uint8_t c) {
21684|  24.2k|    int digit = to_hex(c);
21685|  24.2k|    if (digit < 0) {
  ------------------
  |  Branch (21685:9): [True: 12, False: 24.2k]
  ------------------
21686|     12|        p->error = "invalid hex digit in hex escape";
21687|     12|        return 1;
21688|     12|    }
21689|  24.2k|    state->argn = (state->argn << 4) + digit;
21690|  24.2k|    state->counter--;
21691|  24.2k|    if (!state->counter) {
  ------------------
  |  Branch (21691:9): [True: 12.1k, False: 12.1k]
  ------------------
21692|  12.1k|        push_buf(p, (uint8_t)(state->argn & 0xFF));
21693|  12.1k|        state->argn = 0;
21694|  12.1k|        state->consumer = stringchar;
21695|  12.1k|    }
21696|  24.2k|    return 1;
21697|  24.2k|}
janet.c:to_hex:
21487|  35.7k|static int to_hex(uint8_t c) {
21488|  35.7k|    if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (21488:9): [True: 35.7k, False: 10]
  |  Branch (21488:21): [True: 7.95k, False: 27.7k]
  ------------------
21489|  7.95k|        return c - '0';
21490|  27.7k|    } else if (c >= 'A' && c <= 'F') {
  ------------------
  |  Branch (21490:16): [True: 27.7k, False: 11]
  |  Branch (21490:28): [True: 3.55k, False: 24.2k]
  ------------------
21491|  3.55k|        return 10 + c - 'A';
21492|  24.2k|    } else if (c >= 'a' && c <= 'f') {
  ------------------
  |  Branch (21492:16): [True: 24.1k, False: 16]
  |  Branch (21492:28): [True: 24.1k, False: 17]
  ------------------
21493|  24.1k|        return 10 + c - 'a';
21494|  24.1k|    } else {
21495|     33|        return -1;
21496|     33|    }
21497|  35.7k|}
janet.c:escapeu:
21699|  11.4k|static int escapeu(JanetParser *p, JanetParseState *state, uint8_t c) {
21700|  11.4k|    int digit = to_hex(c);
21701|  11.4k|    if (digit < 0) {
  ------------------
  |  Branch (21701:9): [True: 21, False: 11.4k]
  ------------------
21702|     21|        p->error = "invalid hex digit in unicode escape";
21703|     21|        return 1;
21704|     21|    }
21705|  11.4k|    state->argn = (state->argn << 4) + digit;
21706|  11.4k|    state->counter--;
21707|  11.4k|    if (!state->counter) {
  ------------------
  |  Branch (21707:9): [True: 2.43k, False: 8.99k]
  ------------------
21708|  2.43k|        if (state->argn > 0x10FFFF) {
  ------------------
  |  Branch (21708:13): [True: 6, False: 2.42k]
  ------------------
21709|      6|            p->error = "invalid unicode codepoint";
21710|      6|            return 1;
21711|      6|        }
21712|  2.42k|        write_codepoint(p, state->argn);
21713|  2.42k|        state->argn = 0;
21714|  2.42k|        state->consumer = stringchar;
21715|  2.42k|    }
21716|  11.4k|    return 1;
21717|  11.4k|}
janet.c:write_codepoint:
21665|  2.42k|static void write_codepoint(JanetParser *p, int32_t codepoint) {
21666|  2.42k|    if (codepoint <= 0x7F) {
  ------------------
  |  Branch (21666:9): [True: 240, False: 2.18k]
  ------------------
21667|    240|        push_buf(p, (uint8_t) codepoint);
21668|  2.18k|    } else if (codepoint <= 0x7FF) {
  ------------------
  |  Branch (21668:16): [True: 584, False: 1.60k]
  ------------------
21669|    584|        push_buf(p, (uint8_t)((codepoint >>  6) & 0x1F) | 0xC0);
21670|    584|        push_buf(p, (uint8_t)((codepoint >>  0) & 0x3F) | 0x80);
21671|  1.60k|    } else if (codepoint <= 0xFFFF) {
  ------------------
  |  Branch (21671:16): [True: 805, False: 797]
  ------------------
21672|    805|        push_buf(p, (uint8_t)((codepoint >> 12) & 0x0F) | 0xE0);
21673|    805|        push_buf(p, (uint8_t)((codepoint >>  6) & 0x3F) | 0x80);
21674|    805|        push_buf(p, (uint8_t)((codepoint >>  0) & 0x3F) | 0x80);
21675|    805|    } else {
21676|    797|        push_buf(p, (uint8_t)((codepoint >> 18) & 0x07) | 0xF0);
21677|    797|        push_buf(p, (uint8_t)((codepoint >> 12) & 0x3F) | 0x80);
21678|    797|        push_buf(p, (uint8_t)((codepoint >>  6) & 0x3F) | 0x80);
21679|    797|        push_buf(p, (uint8_t)((codepoint >>  0) & 0x3F) | 0x80);
21680|    797|    }
21681|  2.42k|}
janet.c:stringend:
21740|  2.39M|static int stringend(JanetParser *p, JanetParseState *state) {
21741|  2.39M|    Janet ret;
21742|  2.39M|    uint8_t *bufstart = p->buf;
21743|  2.39M|    int32_t buflen = (int32_t) p->bufcount;
21744|  2.39M|    if (state->flags & PFLAG_LONGSTRING) {
  ------------------
  |  |21540|  2.39M|#define PFLAG_LONGSTRING 0x4000
  ------------------
  |  Branch (21744:9): [True: 2.42k, False: 2.38M]
  ------------------
21745|       |        /* Post process to remove leading whitespace */
21746|  2.42k|        JanetParseState top = p->states[p->statecount - 1];
21747|  2.42k|        int32_t indent_col = (int32_t) top.column - 1;
21748|  2.42k|        uint8_t *r = bufstart, *end = r + buflen;
21749|       |        /* Check if there are any characters before the start column -
21750|       |         * if so, do not reindent. */
21751|  2.42k|        int reindent = 1;
21752|  4.46M|        while (reindent && (r < end)) {
  ------------------
  |  Branch (21752:16): [True: 4.46M, False: 561]
  |  Branch (21752:28): [True: 4.46M, False: 1.86k]
  ------------------
21753|  4.46M|            if (*r++ == '\n') {
  ------------------
  |  Branch (21753:17): [True: 5.65k, False: 4.45M]
  ------------------
21754|  5.93k|                for (int32_t j = 0; (r < end) && (*r != '\n') && (j < indent_col); j++, r++) {
  ------------------
  |  Branch (21754:37): [True: 5.13k, False: 794]
  |  Branch (21754:50): [True: 2.85k, False: 2.28k]
  |  Branch (21754:66): [True: 840, False: 2.01k]
  ------------------
21755|    840|                    if (*r != ' ') {
  ------------------
  |  Branch (21755:25): [True: 561, False: 279]
  ------------------
21756|    561|                        reindent = 0;
21757|    561|                        break;
21758|    561|                    }
21759|    840|                }
21760|  5.65k|            }
21761|  4.46M|        }
21762|       |        /* Now reindent if able to, otherwise just drop leading newline. */
21763|  2.42k|        if (!reindent) {
  ------------------
  |  Branch (21763:13): [True: 561, False: 1.86k]
  ------------------
21764|    561|            if (buflen > 0 && bufstart[0] == '\n') {
  ------------------
  |  Branch (21764:17): [True: 561, False: 0]
  |  Branch (21764:31): [True: 336, False: 225]
  ------------------
21765|    336|                buflen--;
21766|    336|                bufstart++;
21767|    336|            }
21768|  1.86k|        } else {
21769|  1.86k|            uint8_t *w = bufstart;
21770|  1.86k|            r = bufstart;
21771|  4.45M|            while (r < end) {
  ------------------
  |  Branch (21771:20): [True: 4.45M, False: 1.86k]
  ------------------
21772|  4.45M|                if (*r == '\n') {
  ------------------
  |  Branch (21772:21): [True: 3.94k, False: 4.45M]
  ------------------
21773|  3.94k|                    if (r == bufstart) {
  ------------------
  |  Branch (21773:25): [True: 612, False: 3.33k]
  ------------------
21774|       |                        /* Skip leading newline */
21775|    612|                        r++;
21776|  3.33k|                    } else {
21777|  3.33k|                        *w++ = *r++;
21778|  3.33k|                    }
21779|  4.22k|                    for (int32_t j = 0; (r < end) && (*r != '\n') && (j < indent_col); j++, r++);
  ------------------
  |  Branch (21779:41): [True: 3.42k, False: 794]
  |  Branch (21779:54): [True: 2.28k, False: 1.14k]
  |  Branch (21779:70): [True: 274, False: 2.01k]
  ------------------
21780|  4.45M|                } else {
21781|  4.45M|                    *w++ = *r++;
21782|  4.45M|                }
21783|  4.45M|            }
21784|  1.86k|            buflen = (int32_t)(w - bufstart);
21785|  1.86k|        }
21786|       |        /* Check for trailing newline character so we can remove it */
21787|  2.42k|        if (buflen > 0 && bufstart[buflen - 1] == '\n') {
  ------------------
  |  Branch (21787:13): [True: 1.86k, False: 558]
  |  Branch (21787:27): [True: 246, False: 1.62k]
  ------------------
21788|    246|            buflen--;
21789|    246|        }
21790|  2.42k|    }
21791|  2.39M|    if (state->flags & PFLAG_BUFFER) {
  ------------------
  |  |21535|  2.39M|#define PFLAG_BUFFER 0x200
  ------------------
  |  Branch (21791:9): [True: 1.12M, False: 1.26M]
  ------------------
21792|  1.12M|        JanetBuffer *b = janet_buffer(buflen);
21793|  1.12M|        janet_buffer_push_bytes(b, bufstart, buflen);
21794|  1.12M|        ret = janet_wrap_buffer(b);
  ------------------
  |  |  770|  1.12M|#define janet_wrap_buffer(s) janet_nanbox_wrap_((s), JANET_BUFFER)
  |  |  ------------------
  |  |  |  |  748|  1.12M|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|  1.12M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|  1.12M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21795|  1.26M|    } else {
21796|  1.26M|        ret = janet_wrap_string(janet_string(bufstart, buflen));
  ------------------
  |  |  771|  1.26M|#define janet_wrap_string(s) janet_nanbox_wrap_c((s), JANET_STRING)
  |  |  ------------------
  |  |  |  |  751|  1.26M|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|  1.26M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|  1.26M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21797|  1.26M|    }
21798|  2.39M|    p->bufcount = 0;
21799|  2.39M|    popstate(p, ret);
21800|  2.39M|    return 1;
21801|  2.39M|}
janet.c:push_buf:
21511|  46.4M|static void NAME(JanetParser *p, T x) { \
21512|  46.4M|    size_t oldcount = p->STACKCOUNT; \
21513|  46.4M|    size_t newcount = oldcount + 1; \
21514|  46.4M|    if (newcount > p->STACKCAP) { \
  ------------------
  |  Branch (21514:9): [True: 16.6k, False: 46.4M]
  ------------------
21515|  16.6k|        T *next; \
21516|  16.6k|        size_t newcap = 2 * newcount; \
21517|  16.6k|        next = janet_realloc(p->STACK, sizeof(T) * newcap); \
  ------------------
  |  | 2153|  16.6k|#define janet_realloc(X, Y) realloc((X), (Y))
  ------------------
21518|  16.6k|        if (NULL == next) { \
  ------------------
  |  Branch (21518:13): [True: 0, False: 16.6k]
  ------------------
21519|      0|            JANET_OUT_OF_MEMORY; \
  ------------------
  |  |  360|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (360:122): [Folded - Ignored]
  |  |  ------------------
  ------------------
21520|      0|        } \
21521|  16.6k|        p->STACK = next; \
21522|  16.6k|        p->STACKCAP = newcap; \
21523|  16.6k|    } \
21524|  46.4M|    p->STACK[oldcount] = x; \
21525|  46.4M|    p->STACKCOUNT = newcount; \
21526|  46.4M|}
janet.c:comment:
21880|   132k|static int comment(JanetParser *p, JanetParseState *state, uint8_t c) {
21881|   132k|    (void) state;
21882|   132k|    if (c == '\n') {
  ------------------
  |  Branch (21882:9): [True: 307, False: 131k]
  ------------------
21883|    307|        p->statecount--;
21884|    307|        p->bufcount = 0;
21885|   131k|    } else {
21886|   131k|        push_buf(p, c);
21887|   131k|    }
21888|   132k|    return 1;
21889|   132k|}
janet.c:atsign:
21975|  1.17M|static int atsign(JanetParser *p, JanetParseState *state, uint8_t c) {
21976|  1.17M|    (void) state;
21977|  1.17M|    p->statecount--;
21978|  1.17M|    switch (c) {
21979|  52.3k|        case '{':
  ------------------
  |  Branch (21979:9): [True: 52.3k, False: 1.12M]
  ------------------
21980|  52.3k|            pushstate(p, root, PFLAG_CONTAINER | PFLAG_CURLYBRACKETS | PFLAG_ATSYM);
  ------------------
  |  |21534|  52.3k|#define PFLAG_CONTAINER 0x100
  ------------------
                          pushstate(p, root, PFLAG_CONTAINER | PFLAG_CURLYBRACKETS | PFLAG_ATSYM);
  ------------------
  |  |21538|  52.3k|#define PFLAG_CURLYBRACKETS 0x1000
  ------------------
                          pushstate(p, root, PFLAG_CONTAINER | PFLAG_CURLYBRACKETS | PFLAG_ATSYM);
  ------------------
  |  |21542|  52.3k|#define PFLAG_ATSYM 0x10000
  ------------------
21981|  52.3k|            return 1;
21982|  1.12M|        case '"':
  ------------------
  |  Branch (21982:9): [True: 1.12M, False: 57.3k]
  ------------------
21983|  1.12M|            pushstate(p, stringchar, PFLAG_BUFFER | PFLAG_STRING);
  ------------------
  |  |21535|  1.12M|#define PFLAG_BUFFER 0x200
  ------------------
                          pushstate(p, stringchar, PFLAG_BUFFER | PFLAG_STRING);
  ------------------
  |  |21539|  1.12M|#define PFLAG_STRING 0x2000
  ------------------
21984|  1.12M|            return 1;
21985|    733|        case '`':
  ------------------
  |  Branch (21985:9): [True: 733, False: 1.17M]
  ------------------
21986|    733|            pushstate(p, longstring, PFLAG_BUFFER | PFLAG_LONGSTRING);
  ------------------
  |  |21535|    733|#define PFLAG_BUFFER 0x200
  ------------------
                          pushstate(p, longstring, PFLAG_BUFFER | PFLAG_LONGSTRING);
  ------------------
  |  |21540|    733|#define PFLAG_LONGSTRING 0x4000
  ------------------
21987|    733|            return 1;
21988|  1.53k|        case '[':
  ------------------
  |  Branch (21988:9): [True: 1.53k, False: 1.17M]
  ------------------
21989|  1.53k|            pushstate(p, root, PFLAG_CONTAINER | PFLAG_SQRBRACKETS | PFLAG_ATSYM);
  ------------------
  |  |21534|  1.53k|#define PFLAG_CONTAINER 0x100
  ------------------
                          pushstate(p, root, PFLAG_CONTAINER | PFLAG_SQRBRACKETS | PFLAG_ATSYM);
  ------------------
  |  |21537|  1.53k|#define PFLAG_SQRBRACKETS 0x800
  ------------------
                          pushstate(p, root, PFLAG_CONTAINER | PFLAG_SQRBRACKETS | PFLAG_ATSYM);
  ------------------
  |  |21542|  1.53k|#define PFLAG_ATSYM 0x10000
  ------------------
21990|  1.53k|            return 1;
21991|    358|        case '(':
  ------------------
  |  Branch (21991:9): [True: 358, False: 1.17M]
  ------------------
21992|    358|            pushstate(p, root, PFLAG_CONTAINER | PFLAG_PARENS | PFLAG_ATSYM);
  ------------------
  |  |21534|    358|#define PFLAG_CONTAINER 0x100
  ------------------
                          pushstate(p, root, PFLAG_CONTAINER | PFLAG_PARENS | PFLAG_ATSYM);
  ------------------
  |  |21536|    358|#define PFLAG_PARENS 0x400
  ------------------
                          pushstate(p, root, PFLAG_CONTAINER | PFLAG_PARENS | PFLAG_ATSYM);
  ------------------
  |  |21542|    358|#define PFLAG_ATSYM 0x10000
  ------------------
21993|    358|            return 1;
21994|  2.39k|        default:
  ------------------
  |  Branch (21994:9): [True: 2.39k, False: 1.17M]
  ------------------
21995|  2.39k|            break;
21996|  1.17M|    }
21997|  2.39k|    pushstate(p, tokenchar, PFLAG_TOKEN);
  ------------------
  |  |21544|  2.39k|#define PFLAG_TOKEN 0x40000
  ------------------
21998|  2.39k|    push_buf(p, '@'); /* Push the leading at-sign that was dropped */
21999|  2.39k|    return 0;
22000|  1.17M|}
janet.c:longstring:
21931|  10.4M|static int longstring(JanetParser *p, JanetParseState *state, uint8_t c) {
21932|  10.4M|    if (state->flags & PFLAG_INSTRING) {
  ------------------
  |  |21929|  10.4M|#define PFLAG_INSTRING 0x100000
  ------------------
  |  Branch (21932:9): [True: 8.74M, False: 1.70M]
  ------------------
21933|       |        /* We are inside the long string */
21934|  8.74M|        if (c == '`') {
  ------------------
  |  Branch (21934:13): [True: 71.1k, False: 8.67M]
  ------------------
21935|  71.1k|            state->flags |= PFLAG_END_CANDIDATE;
  ------------------
  |  |21930|  71.1k|#define PFLAG_END_CANDIDATE 0x200000
  ------------------
21936|  71.1k|            state->flags &= ~PFLAG_INSTRING;
  ------------------
  |  |21929|  71.1k|#define PFLAG_INSTRING 0x100000
  ------------------
21937|  71.1k|            state->counter = 1; /* Use counter to keep track of number of '=' seen */
21938|  71.1k|            return 1;
21939|  71.1k|        }
21940|  8.67M|        push_buf(p, c);
21941|  8.67M|        return 1;
21942|  8.74M|    } else if (state->flags & PFLAG_END_CANDIDATE) {
  ------------------
  |  |21930|  1.70M|#define PFLAG_END_CANDIDATE 0x200000
  ------------------
  |  Branch (21942:16): [True: 715k, False: 990k]
  ------------------
21943|   715k|        int i;
21944|       |        /* We are checking a potential end of the string */
21945|   715k|        if (state->counter == state->argn) {
  ------------------
  |  Branch (21945:13): [True: 2.42k, False: 712k]
  ------------------
21946|  2.42k|            stringend(p, state);
21947|  2.42k|            return 0;
21948|  2.42k|        }
21949|   712k|        if (c == '`' && state->counter < state->argn) {
  ------------------
  |  Branch (21949:13): [True: 643k, False: 68.6k]
  |  Branch (21949:25): [True: 643k, False: 0]
  ------------------
21950|   643k|            state->counter++;
21951|   643k|            return 1;
21952|   643k|        }
21953|       |        /* Failed end candidate */
21954|   500k|        for (i = 0; i < state->counter; i++) {
  ------------------
  |  Branch (21954:21): [True: 431k, False: 68.6k]
  ------------------
21955|   431k|            push_buf(p, '`');
21956|   431k|        }
21957|  68.6k|        push_buf(p, c);
21958|  68.6k|        state->counter = 0;
21959|  68.6k|        state->flags &= ~PFLAG_END_CANDIDATE;
  ------------------
  |  |21930|  68.6k|#define PFLAG_END_CANDIDATE 0x200000
  ------------------
21960|  68.6k|        state->flags |= PFLAG_INSTRING;
  ------------------
  |  |21929|  68.6k|#define PFLAG_INSTRING 0x100000
  ------------------
21961|  68.6k|        return 1;
21962|   990k|    } else {
21963|       |        /* We are at beginning of string */
21964|   990k|        state->argn++;
21965|   990k|        if (c != '`') {
  ------------------
  |  Branch (21965:13): [True: 2.59k, False: 988k]
  ------------------
21966|  2.59k|            state->flags |= PFLAG_INSTRING;
  ------------------
  |  |21929|  2.59k|#define PFLAG_INSTRING 0x100000
  ------------------
21967|  2.59k|            push_buf(p, c);
21968|  2.59k|        }
21969|   990k|        return 1;
21970|   990k|    }
21971|  10.4M|}
janet.c:close_array:
21899|  1.06k|static Janet close_array(JanetParser *p, JanetParseState *state) {
21900|  1.06k|    JanetArray *array = janet_array(state->argn);
21901|   593k|    for (int32_t i = state->argn - 1; i >= 0; i--)
  ------------------
  |  Branch (21901:39): [True: 592k, False: 1.06k]
  ------------------
21902|   592k|        array->data[i] = p->args[--p->argcount];
21903|  1.06k|    array->count = state->argn;
21904|  1.06k|    return janet_wrap_array(array);
  ------------------
  |  |  768|  1.06k|#define janet_wrap_array(s) janet_nanbox_wrap_((s), JANET_ARRAY)
  |  |  ------------------
  |  |  |  |  748|  1.06k|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|  1.06k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|  1.06k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21905|  1.06k|}
janet.c:close_tuple:
21891|  2.94k|static Janet close_tuple(JanetParser *p, JanetParseState *state, int32_t flag) {
21892|  2.94k|    Janet *ret = janet_tuple_begin(state->argn);
21893|  2.94k|    janet_tuple_flag(ret) |= flag;
  ------------------
  |  | 1616|  2.94k|#define janet_tuple_flag(t) (janet_tuple_head(t)->gc.flags)
  |  |  ------------------
  |  |  |  | 1610|  2.94k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
21894|  1.97M|    for (int32_t i = state->argn - 1; i >= 0; i--)
  ------------------
  |  Branch (21894:39): [True: 1.97M, False: 2.94k]
  ------------------
21895|  1.97M|        ret[i] = p->args[--p->argcount];
21896|  2.94k|    return janet_wrap_tuple(janet_tuple_end(ret));
  ------------------
  |  |  766|  2.94k|#define janet_wrap_tuple(s) janet_nanbox_wrap_c((s), JANET_TUPLE)
  |  |  ------------------
  |  |  |  |  751|  2.94k|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|  2.94k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|  2.94k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21897|  2.94k|}
janet.c:close_table:
21918|  50.9k|static Janet close_table(JanetParser *p, JanetParseState *state) {
21919|  50.9k|    JanetTable *table = janet_table(state->argn >> 1);
21920|   635k|    for (size_t i = p->argcount - state->argn; i < p->argcount; i += 2) {
  ------------------
  |  Branch (21920:48): [True: 584k, False: 50.9k]
  ------------------
21921|   584k|        Janet key = p->args[i];
21922|   584k|        Janet value = p->args[i + 1];
21923|   584k|        janet_table_put(table, key, value);
21924|   584k|    }
21925|  50.9k|    p->argcount -= state->argn;
21926|  50.9k|    return janet_wrap_table(table);
  ------------------
  |  |  769|  50.9k|#define janet_wrap_table(s) janet_nanbox_wrap_((s), JANET_TABLE)
  |  |  ------------------
  |  |  |  |  748|  50.9k|    janet_nanbox_from_pointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|  50.9k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|  50.9k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21927|  50.9k|}
janet.c:close_struct:
21907|  3.57M|static Janet close_struct(JanetParser *p, JanetParseState *state) {
21908|  3.57M|    JanetKV *st = janet_struct_begin(state->argn >> 1);
21909|  5.86M|    for (size_t i = p->argcount - state->argn; i < p->argcount; i += 2) {
  ------------------
  |  Branch (21909:48): [True: 2.29M, False: 3.57M]
  ------------------
21910|  2.29M|        Janet key = p->args[i];
21911|  2.29M|        Janet value = p->args[i + 1];
21912|  2.29M|        janet_struct_put(st, key, value);
21913|  2.29M|    }
21914|  3.57M|    p->argcount -= state->argn;
21915|  3.57M|    return janet_wrap_struct(janet_struct_end(st));
  ------------------
  |  |  765|  3.57M|#define janet_wrap_struct(s) janet_nanbox_wrap_c((s), JANET_STRUCT)
  |  |  ------------------
  |  |  |  |  751|  3.57M|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|  3.57M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|  3.57M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21916|  3.57M|}
janet.c:popstate:
21557|  9.81M|static void popstate(JanetParser *p, Janet val) {
21558|  9.98M|    for (;;) {
21559|  9.98M|        JanetParseState top = p->states[--p->statecount];
21560|  9.98M|        JanetParseState *newtop = p->states + p->statecount - 1;
21561|       |        /* Source mapping info */
21562|  9.98M|        if (janet_checktype(val, JANET_TUPLE)) {
  ------------------
  |  |  730|  9.98M|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (730:5): [True: 178k, False: 9.80M]
  |  |  |  Branch (730:6): [Folded - Ignored]
  |  |  ------------------
  |  |  731|  9.98M|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  727|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (727:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (727:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  732|  9.98M|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  724|  9.98M|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  714|  9.98M|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|  9.98M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|  9.98M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21563|   178k|            janet_tuple_sm_line(janet_unwrap_tuple(val)) = (int32_t) top.line;
  ------------------
  |  | 1614|   178k|#define janet_tuple_sm_line(t) (janet_tuple_head(t)->sm_line)
  |  |  ------------------
  |  |  |  | 1610|   178k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
21564|   178k|            janet_tuple_sm_column(janet_unwrap_tuple(val)) = (int32_t) top.column;
  ------------------
  |  | 1615|   178k|#define janet_tuple_sm_column(t) (janet_tuple_head(t)->sm_column)
  |  |  ------------------
  |  |  |  | 1610|   178k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
21565|   178k|        }
21566|  9.98M|        if (newtop->flags & PFLAG_CONTAINER) {
  ------------------
  |  |21534|  9.98M|#define PFLAG_CONTAINER 0x100
  ------------------
  |  Branch (21566:13): [True: 9.81M, False: 175k]
  ------------------
21567|  9.81M|            newtop->argn++;
21568|       |            /* Keep track of number of values in the root state */
21569|  9.81M|            if (p->statecount == 1) {
  ------------------
  |  Branch (21569:17): [True: 44.2k, False: 9.76M]
  ------------------
21570|  44.2k|                p->pending++;
21571|       |                /* Root items are always wrapped in a tuple for source map info. */
21572|  44.2k|                const Janet *tup = janet_tuple_n(&val, 1);
21573|  44.2k|                janet_tuple_sm_line(tup) = (int32_t) top.line;
  ------------------
  |  | 1614|  44.2k|#define janet_tuple_sm_line(t) (janet_tuple_head(t)->sm_line)
  |  |  ------------------
  |  |  |  | 1610|  44.2k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
21574|  44.2k|                janet_tuple_sm_column(tup) = (int32_t) top.column;
  ------------------
  |  | 1615|  44.2k|#define janet_tuple_sm_column(t) (janet_tuple_head(t)->sm_column)
  |  |  ------------------
  |  |  |  | 1610|  44.2k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
21575|  44.2k|                val = janet_wrap_tuple(tup);
  ------------------
  |  |  766|  44.2k|#define janet_wrap_tuple(s) janet_nanbox_wrap_c((s), JANET_TUPLE)
  |  |  ------------------
  |  |  |  |  751|  44.2k|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|  44.2k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|  44.2k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21576|  44.2k|            }
21577|  9.81M|            push_arg(p, val);
21578|  9.81M|            return;
21579|  9.81M|        } else if (newtop->flags & PFLAG_READERMAC) {
  ------------------
  |  |21541|   175k|#define PFLAG_READERMAC 0x8000
  ------------------
  |  Branch (21579:20): [True: 175k, False: 0]
  ------------------
21580|   175k|            Janet *t = janet_tuple_begin(2);
21581|   175k|            int c = newtop->flags & 0xFF;
21582|   175k|            const char *which =
21583|   175k|                (c == '\'') ? "quote" :
  ------------------
  |  Branch (21583:17): [True: 3.66k, False: 171k]
  ------------------
21584|   175k|                (c == ',') ? "unquote" :
  ------------------
  |  Branch (21584:17): [True: 150k, False: 20.9k]
  ------------------
21585|   171k|                (c == ';') ? "splice" :
  ------------------
  |  Branch (21585:17): [True: 3.14k, False: 17.8k]
  ------------------
21586|  20.9k|                (c == '|') ? "short-fn" :
  ------------------
  |  Branch (21586:17): [True: 4.02k, False: 13.7k]
  ------------------
21587|  17.8k|                (c == '~') ? "quasiquote" : "<unknown>";
  ------------------
  |  Branch (21587:17): [True: 13.7k, False: 0]
  ------------------
21588|   175k|            t[0] = janet_csymbolv(which);
  ------------------
  |  | 1647|   175k|#define janet_csymbolv(cstr) janet_wrap_symbol(janet_csymbol(cstr))
  |  |  ------------------
  |  |  |  |  772|   175k|#define janet_wrap_symbol(s) janet_nanbox_wrap_c((s), JANET_SYMBOL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  751|   175k|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  717|   175k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  716|   175k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21589|   175k|            t[1] = val;
21590|       |            /* Quote source mapping info */
21591|   175k|            janet_tuple_sm_line(t) = (int32_t) newtop->line;
  ------------------
  |  | 1614|   175k|#define janet_tuple_sm_line(t) (janet_tuple_head(t)->sm_line)
  |  |  ------------------
  |  |  |  | 1610|   175k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
21592|   175k|            janet_tuple_sm_column(t) = (int32_t) newtop->column;
  ------------------
  |  | 1615|   175k|#define janet_tuple_sm_column(t) (janet_tuple_head(t)->sm_column)
  |  |  ------------------
  |  |  |  | 1610|   175k|#define janet_tuple_head(t) ((JanetTupleHead *)((char *)t - offsetof(JanetTupleHead, data)))
  |  |  ------------------
  ------------------
21593|   175k|            val = janet_wrap_tuple(janet_tuple_end(t));
  ------------------
  |  |  766|   175k|#define janet_wrap_tuple(s) janet_nanbox_wrap_c((s), JANET_TUPLE)
  |  |  ------------------
  |  |  |  |  751|   175k|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|   175k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|   175k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21594|   175k|        } else {
21595|      0|            return;
21596|      0|        }
21597|  9.98M|    }
21598|  9.81M|}
janet.c:tokenchar:
21832|  30.9M|static int tokenchar(JanetParser *p, JanetParseState *state, uint8_t c) {
21833|  30.9M|    Janet ret;
21834|  30.9M|    double numval;
21835|  30.9M|    int32_t blen;
21836|  30.9M|    if (janet_is_symbol_char(c)) {
  ------------------
  |  Branch (21836:9): [True: 27.1M, False: 3.78M]
  ------------------
21837|  27.1M|        push_buf(p, (uint8_t) c);
21838|  27.1M|        if (c > 127) state->argn = 1; /* Use to indicate non ascii */
  ------------------
  |  Branch (21838:13): [True: 230k, False: 26.8M]
  ------------------
21839|  27.1M|        return 1;
21840|  27.1M|    }
21841|       |    /* Token finished */
21842|  3.78M|    blen = (int32_t) p->bufcount;
21843|  3.78M|    int start_dig = p->buf[0] >= '0' && p->buf[0] <= '9';
  ------------------
  |  Branch (21843:21): [True: 3.67M, False: 111k]
  |  Branch (21843:41): [True: 24.2k, False: 3.65M]
  ------------------
21844|  3.78M|    int start_num = start_dig || p->buf[0] == '-' || p->buf[0] == '+' || p->buf[0] == '.';
  ------------------
  |  Branch (21844:21): [True: 24.2k, False: 3.76M]
  |  Branch (21844:34): [True: 96.9k, False: 3.66M]
  |  Branch (21844:54): [True: 3.19k, False: 3.66M]
  |  Branch (21844:74): [True: 5.41k, False: 3.65M]
  ------------------
21845|  3.78M|    if (p->buf[0] == ':') {
  ------------------
  |  Branch (21845:9): [True: 6.44k, False: 3.78M]
  ------------------
21846|       |        /* Don't do full utf-8 check unless we have seen non ascii characters. */
21847|  6.44k|        int valid = (!state->argn) || janet_valid_utf8(p->buf + 1, blen - 1);
  ------------------
  |  Branch (21847:21): [True: 5.93k, False: 505]
  |  Branch (21847:39): [True: 435, False: 70]
  ------------------
21848|  6.44k|        if (!valid) {
  ------------------
  |  Branch (21848:13): [True: 70, False: 6.37k]
  ------------------
21849|     70|            p->error = "invalid utf-8 in keyword";
21850|     70|            return 0;
21851|     70|        }
21852|  6.37k|        ret = janet_keywordv(p->buf + 1, blen - 1);
  ------------------
  |  | 1652|  6.37k|#define janet_keywordv(str, len) janet_wrap_keyword(janet_keyword((str), (len)))
  |  |  ------------------
  |  |  |  |  773|  6.37k|#define janet_wrap_keyword(s) janet_nanbox_wrap_c((s), JANET_KEYWORD)
  |  |  |  |  ------------------
  |  |  |  |  |  |  751|  6.37k|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  717|  6.37k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  716|  6.37k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21853|  3.78M|    } else if (start_num && !janet_scan_number(p->buf, blen, &numval)) {
  ------------------
  |  Branch (21853:16): [True: 129k, False: 3.65M]
  |  Branch (21853:29): [True: 31.1k, False: 98.7k]
  ------------------
21854|  31.1k|        ret = janet_wrap_number(numval);
  ------------------
  |  |  758|  31.1k|#define janet_wrap_number(r) janet_nanbox_from_double(r)
  ------------------
21855|  3.75M|    } else if (!check_str_const("nil", p->buf, blen)) {
  ------------------
  |  Branch (21855:16): [True: 3.53k, False: 3.74M]
  ------------------
21856|  3.53k|        ret = janet_wrap_nil();
  ------------------
  |  |  754|  3.53k|#define janet_wrap_nil() janet_nanbox_from_payload(JANET_NIL, 1)
  |  |  ------------------
  |  |  |  |  745|  3.53k|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|  3.53k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|  3.53k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21857|  3.74M|    } else if (!check_str_const("false", p->buf, blen)) {
  ------------------
  |  Branch (21857:16): [True: 291, False: 3.74M]
  ------------------
21858|    291|        ret = janet_wrap_false();
  ------------------
  |  |  756|    291|#define janet_wrap_false() janet_nanbox_from_payload(JANET_BOOLEAN, 0)
  |  |  ------------------
  |  |  |  |  745|    291|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|    291|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|    291|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21859|  3.74M|    } else if (!check_str_const("true", p->buf, blen)) {
  ------------------
  |  Branch (21859:16): [True: 552, False: 3.74M]
  ------------------
21860|    552|        ret = janet_wrap_true();
  ------------------
  |  |  755|    552|#define janet_wrap_true() janet_nanbox_from_payload(JANET_BOOLEAN, 1)
  |  |  ------------------
  |  |  |  |  745|    552|    janet_nanbox_from_bits(janet_nanbox_tag(t) | (p))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|    552|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|    552|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21861|  3.74M|    } else {
21862|  3.74M|        if (start_dig) {
  ------------------
  |  Branch (21862:13): [True: 197, False: 3.74M]
  ------------------
21863|    197|            p->error = "symbol literal cannot start with a digit";
21864|    197|            return 0;
21865|  3.74M|        } else {
21866|       |            /* Don't do full utf-8 check unless we have seen non ascii characters. */
21867|  3.74M|            int valid = (!state->argn) || janet_valid_utf8(p->buf, blen);
  ------------------
  |  Branch (21867:25): [True: 3.74M, False: 1.88k]
  |  Branch (21867:43): [True: 1.73k, False: 146]
  ------------------
21868|  3.74M|            if (!valid) {
  ------------------
  |  Branch (21868:17): [True: 146, False: 3.74M]
  ------------------
21869|    146|                p->error = "invalid utf-8 in symbol";
21870|    146|                return 0;
21871|    146|            }
21872|  3.74M|            ret = janet_symbolv(p->buf, blen);
  ------------------
  |  | 1646|  3.74M|#define janet_symbolv(str, len) janet_wrap_symbol(janet_symbol((str), (len)))
  |  |  ------------------
  |  |  |  |  772|  3.74M|#define janet_wrap_symbol(s) janet_nanbox_wrap_c((s), JANET_SYMBOL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  751|  3.74M|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  717|  3.74M|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  716|  3.74M|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
21873|  3.74M|        }
21874|  3.74M|    }
21875|  3.78M|    p->bufcount = 0;
21876|  3.78M|    popstate(p, ret);
21877|  3.78M|    return 0;
21878|  3.78M|}
janet.c:check_str_const:
21820|  11.2M|static int check_str_const(const char *cstr, const uint8_t *str, int32_t len) {
21821|  11.2M|    int32_t index;
21822|  11.2M|    for (index = 0; index < len; index++) {
  ------------------
  |  Branch (21822:21): [True: 11.2M, False: 6.02k]
  ------------------
21823|  11.2M|        uint8_t c = str[index];
21824|  11.2M|        uint8_t k = ((const uint8_t *)cstr)[index];
21825|  11.2M|        if (c < k) return -1;
  ------------------
  |  Branch (21825:13): [True: 10.3M, False: 898k]
  ------------------
21826|   898k|        if (c > k) return 1;
  ------------------
  |  Branch (21826:13): [True: 871k, False: 26.4k]
  ------------------
21827|  26.4k|        if (k == '\0') break;
  ------------------
  |  Branch (21827:13): [True: 0, False: 26.4k]
  ------------------
21828|  26.4k|    }
21829|  6.02k|    return (cstr[index] == '\0') ? 0 : -1;
  ------------------
  |  Branch (21829:12): [True: 4.37k, False: 1.64k]
  ------------------
21830|  11.2M|}
janet.c:push_arg:
21511|  9.81M|static void NAME(JanetParser *p, T x) { \
21512|  9.81M|    size_t oldcount = p->STACKCOUNT; \
21513|  9.81M|    size_t newcount = oldcount + 1; \
21514|  9.81M|    if (newcount > p->STACKCAP) { \
  ------------------
  |  Branch (21514:9): [True: 9.74k, False: 9.80M]
  ------------------
21515|  9.74k|        T *next; \
21516|  9.74k|        size_t newcap = 2 * newcount; \
21517|  9.74k|        next = janet_realloc(p->STACK, sizeof(T) * newcap); \
  ------------------
  |  | 2153|  9.74k|#define janet_realloc(X, Y) realloc((X), (Y))
  ------------------
21518|  9.74k|        if (NULL == next) { \
  ------------------
  |  Branch (21518:13): [True: 0, False: 9.74k]
  ------------------
21519|      0|            JANET_OUT_OF_MEMORY; \
  ------------------
  |  |  360|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (360:122): [Folded - Ignored]
  |  |  ------------------
  ------------------
21520|      0|        } \
21521|  9.74k|        p->STACK = next; \
21522|  9.74k|        p->STACKCAP = newcap; \
21523|  9.74k|    } \
21524|  9.81M|    p->STACK[oldcount] = x; \
21525|  9.81M|    p->STACKCOUNT = newcount; \
21526|  9.81M|}
janet.c:scanformat:
25320|    116|    char precision[3]) {
25321|    116|    const char *p = strfrmt;
25322|       |
25323|       |    /* Parse strfrmt */
25324|    116|    memset(width, '\0', 3);
25325|    116|    memset(precision, '\0', 3);
25326|    116|    while (*p != '\0' && strchr(FMT_FLAGS, *p) != NULL)
  ------------------
  |  |25288|    116|#define FMT_FLAGS "-+ #0"
  ------------------
  |  Branch (25326:12): [True: 116, False: 0]
  |  Branch (25326:26): [True: 0, False: 116]
  ------------------
25327|      0|        p++; /* skip flags */
25328|    116|    if ((size_t)(p - strfrmt) >= sizeof(FMT_FLAGS)) janet_panic("invalid format (repeated flags)");
  ------------------
  |  |25288|    116|#define FMT_FLAGS "-+ #0"
  ------------------
  |  Branch (25328:9): [True: 0, False: 116]
  ------------------
25329|    116|    if (isdigit((int)(*p)))
25330|      0|        width[0] = *p++; /* skip width */
25331|    116|    if (isdigit((int)(*p)))
25332|      0|        width[1] = *p++; /* (2 digits at most) */
25333|    116|    if (*p == '.') {
  ------------------
  |  Branch (25333:9): [True: 0, False: 116]
  ------------------
25334|      0|        p++;
25335|      0|        if (isdigit((int)(*p)))
25336|      0|            precision[0] = *p++; /* skip precision */
25337|      0|        if (isdigit((int)(*p)))
25338|      0|            precision[1] = *p++; /* (2 digits at most) */
25339|      0|    }
25340|    116|    if (isdigit((int)(*p)))
25341|      0|        janet_panic("invalid format (width or precision too long)");
25342|       |
25343|       |    /* Write to form - replace characters with fixed size stuff */
25344|    116|    *(form++) = '%';
25345|    116|    const char *p2 = strfrmt;
25346|    232|    while (p2 <= p) {
  ------------------
  |  Branch (25346:12): [True: 116, False: 116]
  ------------------
25347|    116|        char *loc = strchr(FMT_REPLACE_INTTYPES, *p2);
  ------------------
  |  |25289|    116|#define FMT_REPLACE_INTTYPES "diouxX"
  ------------------
25348|    116|        if (loc != NULL && *loc != '\0') {
  ------------------
  |  Branch (25348:13): [True: 116, False: 0]
  |  Branch (25348:28): [True: 116, False: 0]
  ------------------
25349|    116|            const char *mapping = get_fmt_mapping(*p2++);
25350|    116|            size_t len = strlen(mapping);
25351|    116|            strcpy(form, mapping);
25352|    116|            form += len;
25353|    116|        } else {
25354|      0|            *(form++) = *(p2++);
25355|      0|        }
25356|    116|    }
25357|    116|    *form = '\0';
25358|       |
25359|    116|    return p;
25360|    116|}
janet.c:get_fmt_mapping:
25308|    116|static const char *get_fmt_mapping(char c) {
25309|    116|    for (size_t i = 0; i < (sizeof(format_mappings) / sizeof(struct FmtMapping)); i++) {
  ------------------
  |  Branch (25309:24): [True: 116, False: 0]
  ------------------
25310|    116|        if (format_mappings[i].c == c)
  ------------------
  |  Branch (25310:13): [True: 116, False: 0]
  ------------------
25311|    116|            return format_mappings[i].mapping;
25312|    116|    }
25313|      0|    janet_assert(0, "bad format mapping");
  ------------------
  |  |  358|      0|#define janet_assert(c, m) do { \
  |  |  359|      0|    if (!(c)) JANET_EXIT((m)); \
  |  |  ------------------
  |  |  |  |  347|      0|#define JANET_EXIT(m) do { \
  |  |  |  |  348|      0|    fprintf(stderr, "C runtime error at line %d in file %s: %s\n",\
  |  |  |  |  349|      0|        __LINE__,\
  |  |  |  |  350|      0|        __FILE__,\
  |  |  |  |  351|      0|        (m));\
  |  |  |  |  352|      0|    exit(1);\
  |  |  |  |  353|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (353:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (359:9): [Folded - Ignored]
  |  |  ------------------
  |  |  360|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (360:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
25314|      0|}
janet.c:bignat_zero:
27908|   129k|static void bignat_zero(struct BigNat *x) {
27909|   129k|    x->first_digit = 0;
27910|   129k|    x->n = 0;
27911|   129k|    x->cap = 0;
27912|   129k|    x->digits = NULL;
27913|   129k|}
janet.c:bignat_muladd:
27940|  2.15M|static void bignat_muladd(struct BigNat *mant, uint32_t factor, uint32_t term) {
27941|  2.15M|    int32_t i;
27942|  2.15M|    uint64_t carry = ((uint64_t) mant->first_digit) * factor + term;
27943|  2.15M|    mant->first_digit = carry % BIGNAT_BASE;
  ------------------
  |  |27897|  2.15M|#define BIGNAT_BASE 0x80000000U
  ------------------
27944|  2.15M|    carry /= BIGNAT_BASE;
  ------------------
  |  |27897|  2.15M|#define BIGNAT_BASE 0x80000000U
  ------------------
27945|  3.52G|    for (i = 0; i < mant->n; i++) {
  ------------------
  |  Branch (27945:17): [True: 3.52G, False: 2.15M]
  ------------------
27946|  3.52G|        carry += ((uint64_t) mant->digits[i]) * factor;
27947|  3.52G|        mant->digits[i] = carry % BIGNAT_BASE;
  ------------------
  |  |27897|  3.52G|#define BIGNAT_BASE 0x80000000U
  ------------------
27948|  3.52G|        carry /= BIGNAT_BASE;
  ------------------
  |  |27897|  3.52G|#define BIGNAT_BASE 0x80000000U
  ------------------
27949|  3.52G|    }
27950|  2.15M|    if (carry) bignat_append(mant, (uint32_t) carry);
  ------------------
  |  Branch (27950:9): [True: 171k, False: 1.98M]
  ------------------
27951|  2.15M|}
janet.c:bignat_append:
27933|   171k|static void bignat_append(struct BigNat *mant, uint32_t dig) {
27934|   171k|    bignat_extra(mant, 1)[0] = dig;
27935|   171k|}
janet.c:bignat_extra:
27916|   173k|static uint32_t *bignat_extra(struct BigNat *mant, int32_t n) {
27917|   173k|    int32_t oldn = mant->n;
27918|   173k|    int32_t newn = oldn + n;
27919|   173k|    if (mant->cap < newn) {
  ------------------
  |  Branch (27919:9): [True: 11.3k, False: 162k]
  ------------------
27920|  11.3k|        int32_t newcap = 2 * newn;
27921|  11.3k|        uint32_t *mem = janet_realloc(mant->digits, (size_t) newcap * sizeof(uint32_t));
  ------------------
  |  | 2153|  11.3k|#define janet_realloc(X, Y) realloc((X), (Y))
  ------------------
27922|  11.3k|        if (NULL == mem) {
  ------------------
  |  Branch (27922:13): [True: 0, False: 11.3k]
  ------------------
27923|      0|            JANET_OUT_OF_MEMORY;
  ------------------
  |  |  360|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (360:122): [Folded - Ignored]
  |  |  ------------------
  ------------------
27924|      0|        }
27925|  11.3k|        mant->cap = newcap;
27926|  11.3k|        mant->digits = mem;
27927|  11.3k|    }
27928|   173k|    mant->n = newn;
27929|   173k|    return mant->digits + oldn;
27930|   173k|}
janet.c:convert:
28036|  31.1k|    int32_t exponent) {
28037|       |
28038|  31.1k|    int32_t exponent2 = 0;
28039|       |
28040|       |    /* Approximate exponent in base 2 of mant and exponent. This should get us a good estimate of the final size of the
28041|       |     * number, within * 2^32 or so. */
28042|  31.1k|    int64_t mant_exp2_approx = mant->n * 32 + 16;
28043|  31.1k|    int64_t exp_exp2_approx = (int64_t)(floor(log2(base) * exponent));
28044|  31.1k|    int64_t exp2_approx = mant_exp2_approx + exp_exp2_approx;
28045|       |
28046|       |    /* Short circuit zero, huge, and small numbers. We use the exponent range of valid IEEE754 doubles (-1022, 1023)
28047|       |     * with a healthy buffer to allow for inaccuracies in the approximation and denormailzed numbers. */
28048|  31.1k|    if (mant->n == 0 && mant->first_digit == 0)
  ------------------
  |  Branch (28048:9): [True: 29.5k, False: 1.59k]
  |  Branch (28048:25): [True: 6.46k, False: 23.0k]
  ------------------
28049|  6.46k|        return negative ? -0.0 : 0.0;
  ------------------
  |  Branch (28049:16): [True: 171, False: 6.29k]
  ------------------
28050|  24.6k|    if (exp2_approx > 1176)
  ------------------
  |  Branch (28050:9): [True: 369, False: 24.2k]
  ------------------
28051|    369|        return negative ? -INFINITY : INFINITY;
  ------------------
  |  Branch (28051:16): [True: 32, False: 337]
  ------------------
28052|  24.2k|    if (exp2_approx < -1175)
  ------------------
  |  Branch (28052:9): [True: 253, False: 24.0k]
  ------------------
28053|    253|        return negative ? -0.0 : 0.0;
  ------------------
  |  Branch (28053:16): [True: 0, False: 253]
  ------------------
28054|       |
28055|       |    /* Final value is X = mant * base ^ exponent * 2 ^ exponent2
28056|       |     * Get exponent to zero while holding X constant. */
28057|       |
28058|       |    /* Positive exponents are simple */
28059|  76.9k|    for (; exponent > 3; exponent -= 4) bignat_muladd(mant, base * base * base * base, 0);
  ------------------
  |  Branch (28059:12): [True: 52.9k, False: 24.0k]
  ------------------
28060|  26.8k|    for (; exponent > 1; exponent -= 2) bignat_muladd(mant, base * base, 0);
  ------------------
  |  Branch (28060:12): [True: 2.81k, False: 24.0k]
  ------------------
28061|  27.2k|    for (; exponent > 0; exponent -= 1) bignat_muladd(mant, base, 0);
  ------------------
  |  Branch (28061:12): [True: 3.23k, False: 24.0k]
  ------------------
28062|       |
28063|       |    /* Negative exponents are tricky - we don't want to loose bits
28064|       |     * from integer division, so we need to premultiply. */
28065|  24.0k|    if (exponent < 0) {
  ------------------
  |  Branch (28065:9): [True: 2.10k, False: 21.9k]
  ------------------
28066|  2.10k|        int32_t shamt = 5 - exponent / 4;
28067|  2.10k|        bignat_lshift_n(mant, shamt);
28068|  2.10k|        exponent2 -= shamt * BIGNAT_NBIT;
  ------------------
  |  |27896|  2.10k|#define BIGNAT_NBIT 31
  ------------------
28069|   422k|        for (; exponent < -3; exponent += 4) bignat_div(mant, base * base * base * base);
  ------------------
  |  Branch (28069:16): [True: 420k, False: 2.10k]
  ------------------
28070|  2.79k|        for (; exponent < -1; exponent += 2) bignat_div(mant, base * base);
  ------------------
  |  Branch (28070:16): [True: 690, False: 2.10k]
  ------------------
28071|  3.66k|        for (; exponent <  0; exponent += 1) bignat_div(mant, base);
  ------------------
  |  Branch (28071:16): [True: 1.55k, False: 2.10k]
  ------------------
28072|  2.10k|    }
28073|       |
28074|  24.0k|    return negative
  ------------------
  |  Branch (28074:12): [True: 6.12k, False: 17.8k]
  ------------------
28075|  24.0k|           ? -bignat_extract(mant, exponent2)
28076|  24.0k|           : bignat_extract(mant, exponent2);
28077|  24.2k|}
janet.c:bignat_lshift_n:
27972|  2.10k|static void bignat_lshift_n(struct BigNat *mant, int n) {
27973|  2.10k|    if (!n) return;
  ------------------
  |  Branch (27973:9): [True: 0, False: 2.10k]
  ------------------
27974|  2.10k|    int32_t oldn = mant->n;
27975|  2.10k|    bignat_extra(mant, n);
27976|  2.10k|    memmove(mant->digits + n, mant->digits, sizeof(uint32_t) * oldn);
27977|  2.10k|    memset(mant->digits, 0, sizeof(uint32_t) * (n - 1));
27978|  2.10k|    mant->digits[n - 1] = mant->first_digit;
27979|  2.10k|    mant->first_digit = 0;
27980|  2.10k|}
janet.c:bignat_div:
27954|   423k|static void bignat_div(struct BigNat *mant, uint32_t divisor) {
27955|   423k|    int32_t i;
27956|   423k|    uint32_t quotient, remainder;
27957|   423k|    uint64_t dividend;
27958|   423k|    remainder = 0, quotient = 0;
27959|  4.33G|    for (i = mant->n - 1; i >= 0; i--) {
  ------------------
  |  Branch (27959:27): [True: 4.33G, False: 423k]
  ------------------
27960|  4.33G|        dividend = ((uint64_t)remainder * BIGNAT_BASE) + mant->digits[i];
  ------------------
  |  |27897|  4.33G|#define BIGNAT_BASE 0x80000000U
  ------------------
27961|  4.33G|        if (i < mant->n - 1) mant->digits[i + 1] = quotient;
  ------------------
  |  Branch (27961:13): [True: 4.33G, False: 423k]
  ------------------
27962|  4.33G|        quotient = (uint32_t)(dividend / divisor);
27963|  4.33G|        remainder = (uint32_t)(dividend % divisor);
27964|  4.33G|        mant->digits[i] = remainder;
27965|  4.33G|    }
27966|   423k|    dividend = ((uint64_t)remainder * BIGNAT_BASE) + mant->first_digit;
  ------------------
  |  |27897|   423k|#define BIGNAT_BASE 0x80000000U
  ------------------
27967|   423k|    if (mant->n && mant->digits[mant->n - 1] == 0) mant->n--;
  ------------------
  |  Branch (27967:9): [True: 423k, False: 0]
  |  Branch (27967:20): [True: 75.2k, False: 347k]
  ------------------
27968|   423k|    mant->first_digit = (uint32_t)(dividend / divisor);
27969|   423k|}
janet.c:bignat_extract:
27997|  24.0k|static double bignat_extract(struct BigNat *mant, int32_t exponent2) {
27998|  24.0k|    uint64_t top53;
27999|  24.0k|    int32_t n = mant->n;
28000|       |    /* Get most significant 53 bits from mant. Bit 52 (0 indexed) should
28001|       |     * always be 1. This is essentially a large right shift on mant.*/
28002|  24.0k|    if (n) {
  ------------------
  |  Branch (28002:9): [True: 6.70k, False: 17.3k]
  ------------------
28003|       |        /* Two or more digits */
28004|  6.70k|        uint64_t d1 = mant->digits[n - 1]; /* MSD (non-zero) */
28005|  6.70k|        uint64_t d2 = (n == 1) ? mant->first_digit : mant->digits[n - 2];
  ------------------
  |  Branch (28005:23): [True: 1.62k, False: 5.08k]
  ------------------
28006|  6.70k|        uint64_t d3 = (n > 2) ? mant->digits[n - 3] : (n == 2) ? mant->first_digit : 0;
  ------------------
  |  Branch (28006:23): [True: 3.49k, False: 3.21k]
  |  Branch (28006:55): [True: 1.59k, False: 1.62k]
  ------------------
28007|  6.70k|        int lz = clz((uint32_t) d1);
  ------------------
  |  |27983|  6.70k|#define clz(x) __builtin_clz(x)
  ------------------
28008|  6.70k|        int nbits = 32 - lz;
28009|       |        /* First get 54 bits */
28010|  6.70k|        top53 = (d2 << (54 - BIGNAT_NBIT)) + (d3 >> (2 * BIGNAT_NBIT - 54));
  ------------------
  |  |27896|  6.70k|#define BIGNAT_NBIT 31
  ------------------
                      top53 = (d2 << (54 - BIGNAT_NBIT)) + (d3 >> (2 * BIGNAT_NBIT - 54));
  ------------------
  |  |27896|  6.70k|#define BIGNAT_NBIT 31
  ------------------
28011|  6.70k|        top53 >>= nbits;
28012|  6.70k|        top53 |= (d1 << (54 - nbits));
28013|       |        /* Rounding based on lowest bit of 54 */
28014|  6.70k|        if (top53 & 1) top53++;
  ------------------
  |  Branch (28014:13): [True: 3.27k, False: 3.42k]
  ------------------
28015|  6.70k|        top53 >>= 1;
28016|  6.70k|        if (top53 > 0x1FffffFFFFffffUL) {
  ------------------
  |  Branch (28016:13): [True: 537, False: 6.16k]
  ------------------
28017|    537|            top53 >>= 1;
28018|    537|            exponent2++;
28019|    537|        }
28020|       |        /* Correct exponent - to correct for large right shift to mantissa. */
28021|  6.70k|        exponent2 += (nbits - 53) + BIGNAT_NBIT * n;
  ------------------
  |  |27896|  6.70k|#define BIGNAT_NBIT 31
  ------------------
28022|  17.3k|    } else {
28023|       |        /* One digit */
28024|  17.3k|        top53 = mant->first_digit;
28025|  17.3k|    }
28026|  24.0k|    return ldexp((double)top53, exponent2);
28027|  24.0k|}
janet.c:janet_symcache_findmem:
28711|  3.96M|    int *success) {
28712|  3.96M|    uint32_t bounds[4];
28713|  3.96M|    uint32_t i, j, index;
28714|  3.96M|    const uint8_t **firstEmpty = NULL;
28715|       |
28716|       |    /* We will search two ranges - index to the end,
28717|       |     * and 0 to the index. */
28718|  3.96M|    index = (uint32_t)hash & (janet_vm.cache_capacity - 1);
28719|  3.96M|    bounds[0] = index;
28720|  3.96M|    bounds[1] = janet_vm.cache_capacity;
28721|  3.96M|    bounds[2] = 0;
28722|  3.96M|    bounds[3] = index;
28723|  3.97M|    for (j = 0; j < 4; j += 2)
  ------------------
  |  Branch (28723:17): [True: 3.97M, False: 0]
  ------------------
28724|  4.19M|        for (i = bounds[j]; i < bounds[j + 1]; ++i) {
  ------------------
  |  Branch (28724:29): [True: 4.18M, False: 3.01k]
  ------------------
28725|  4.18M|            const uint8_t *test = janet_vm.cache[i];
28726|       |            /* Check empty spots */
28727|  4.18M|            if (NULL == test) {
  ------------------
  |  Branch (28727:17): [True: 40.9k, False: 4.14M]
  ------------------
28728|  40.9k|                if (NULL == firstEmpty)
  ------------------
  |  Branch (28728:21): [True: 40.9k, False: 0]
  ------------------
28729|  40.9k|                    firstEmpty = janet_vm.cache + i;
28730|  40.9k|                goto notfound;
28731|  40.9k|            }
28732|       |            /* Check for marked deleted */
28733|  4.14M|            if (JANET_SYMCACHE_DELETED == test) {
  ------------------
  |  Branch (28733:17): [True: 2.91k, False: 4.14M]
  ------------------
28734|  2.91k|                if (firstEmpty == NULL)
  ------------------
  |  Branch (28734:21): [True: 623, False: 2.29k]
  ------------------
28735|    623|                    firstEmpty = janet_vm.cache + i;
28736|  2.91k|                continue;
28737|  2.91k|            }
28738|  4.14M|            if (janet_string_equalconst(test, str, len, hash)) {
  ------------------
  |  Branch (28738:17): [True: 3.92M, False: 215k]
  ------------------
28739|       |                /* Replace first deleted */
28740|  3.92M|                *success = 1;
28741|  3.92M|                if (firstEmpty != NULL) {
  ------------------
  |  Branch (28741:21): [True: 623, False: 3.92M]
  ------------------
28742|    623|                    *firstEmpty = test;
28743|    623|                    janet_vm.cache[i] = JANET_SYMCACHE_DELETED;
28744|    623|                    return firstEmpty;
28745|    623|                }
28746|  3.92M|                return janet_vm.cache + i;
28747|  3.92M|            }
28748|  4.14M|        }
28749|  40.9k|notfound:
28750|  40.9k|    *success = 0;
28751|  40.9k|    janet_assert(firstEmpty != NULL, "symcache failed to get memory");
  ------------------
  |  |  358|  40.9k|#define janet_assert(c, m) do { \
  |  |  359|  40.9k|    if (!(c)) JANET_EXIT((m)); \
  |  |  ------------------
  |  |  |  |  347|      0|#define JANET_EXIT(m) do { \
  |  |  |  |  348|      0|    fprintf(stderr, "C runtime error at line %d in file %s: %s\n",\
  |  |  |  |  349|      0|        __LINE__,\
  |  |  |  |  350|      0|        __FILE__,\
  |  |  |  |  351|      0|        (m));\
  |  |  |  |  352|      0|    exit(1);\
  |  |  |  |  353|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (353:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (359:9): [True: 0, False: 40.9k]
  |  |  ------------------
  |  |  360|  40.9k|} while (0)
  |  |  ------------------
  |  |  |  Branch (360:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
28752|  40.9k|    return firstEmpty;
28753|  40.9k|}
janet.c:janet_symcache_put:
28789|  27.5k|static void janet_symcache_put(const uint8_t *x, const uint8_t **bucket) {
28790|  27.5k|    if ((janet_vm.cache_count + janet_vm.cache_deleted) * 2 > janet_vm.cache_capacity) {
  ------------------
  |  Branch (28790:9): [True: 21, False: 27.5k]
  ------------------
28791|     21|        int status;
28792|     21|        janet_cache_resize(janet_tablen((2 * janet_vm.cache_count + 1)));
28793|     21|        bucket = janet_symcache_find(x, &status);
  ------------------
  |  |28756|     21|    janet_symcache_findmem((str), janet_string_length(str), janet_string_hash(str), (success))
  |  |  ------------------
  |  |  |  | 1623|     21|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1622|     21|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   janet_symcache_findmem((str), janet_string_length(str), janet_string_hash(str), (success))
  |  |  ------------------
  |  |  |  | 1624|     21|#define janet_string_hash(s) (janet_string_head(s)->hash)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1622|     21|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
28794|     21|    }
28795|       |    /* Add x to the cache */
28796|  27.5k|    janet_vm.cache_count++;
28797|  27.5k|    *bucket = x;
28798|  27.5k|}
janet.c:janet_cache_resize:
28759|     21|static void janet_cache_resize(uint32_t newCapacity) {
28760|     21|    uint32_t i, oldCapacity;
28761|     21|    const uint8_t **oldCache = janet_vm.cache;
28762|     21|    const uint8_t **newCache = janet_calloc(1, (size_t) newCapacity * sizeof(const uint8_t *));
  ------------------
  |  | 2156|     21|#define janet_calloc(X, Y) calloc((X), (Y))
  ------------------
28763|     21|    if (newCache == NULL) {
  ------------------
  |  Branch (28763:9): [True: 0, False: 21]
  ------------------
28764|      0|        JANET_OUT_OF_MEMORY;
  ------------------
  |  |  360|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (360:122): [Folded - Ignored]
  |  |  ------------------
  ------------------
28765|      0|    }
28766|     21|    oldCapacity = janet_vm.cache_capacity;
28767|     21|    janet_vm.cache = newCache;
28768|     21|    janet_vm.cache_capacity = newCapacity;
28769|     21|    janet_vm.cache_deleted = 0;
28770|       |    /* Add all of the old cache entries back */
28771|  26.6k|    for (i = 0; i < oldCapacity; ++i) {
  ------------------
  |  Branch (28771:17): [True: 26.6k, False: 21]
  ------------------
28772|  26.6k|        int status;
28773|  26.6k|        const uint8_t **bucket;
28774|  26.6k|        const uint8_t *x = oldCache[i];
28775|  26.6k|        if (x != NULL && x != JANET_SYMCACHE_DELETED) {
  ------------------
  |  Branch (28775:13): [True: 13.3k, False: 13.2k]
  |  Branch (28775:26): [True: 13.3k, False: 0]
  ------------------
28776|  13.3k|            bucket = janet_symcache_find(x, &status);
  ------------------
  |  |28756|  13.3k|    janet_symcache_findmem((str), janet_string_length(str), janet_string_hash(str), (success))
  |  |  ------------------
  |  |  |  | 1623|  13.3k|#define janet_string_length(s) (janet_string_head(s)->length)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1622|  13.3k|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   janet_symcache_findmem((str), janet_string_length(str), janet_string_hash(str), (success))
  |  |  ------------------
  |  |  |  | 1624|  13.3k|#define janet_string_hash(s) (janet_string_head(s)->hash)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1622|  13.3k|#define janet_string_head(s) ((JanetStringHead *)((char *)s - offsetof(JanetStringHead, data)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
28777|  13.3k|            if (status || bucket == NULL) {
  ------------------
  |  Branch (28777:17): [True: 0, False: 13.3k]
  |  Branch (28777:27): [True: 0, False: 13.3k]
  ------------------
28778|       |                /* there was a problem with the algorithm. */
28779|      0|                break;
28780|      0|            }
28781|  13.3k|            *bucket = x;
28782|  13.3k|        }
28783|  26.6k|    }
28784|       |    /* Free the old cache */
28785|     21|    janet_free((void *)oldCache);
  ------------------
  |  | 2159|     21|#define janet_free(X) free((X))
  ------------------
28786|     21|}
janet.c:janet_table_init_impl:
28929|  66.7k|static JanetTable *janet_table_init_impl(JanetTable *table, int32_t capacity, int stackalloc) {
28930|  66.7k|    JanetKV *data;
28931|  66.7k|    capacity = janet_tablen(capacity);
28932|  66.7k|    if (stackalloc) table->gc.flags = JANET_TABLE_FLAG_STACK;
  ------------------
  |  |28915|      0|#define JANET_TABLE_FLAG_STACK 0x10000
  ------------------
  |  Branch (28932:9): [True: 0, False: 66.7k]
  ------------------
28933|  66.7k|    if (capacity) {
  ------------------
  |  Branch (28933:9): [True: 66.7k, False: 0]
  ------------------
28934|  66.7k|        if (stackalloc) {
  ------------------
  |  Branch (28934:13): [True: 0, False: 66.7k]
  ------------------
28935|      0|            data = janet_memalloc_empty_local(capacity);
28936|  66.7k|        } else {
28937|  66.7k|            data = (JanetKV *) janet_memalloc_empty(capacity);
28938|  66.7k|            if (NULL == data) {
  ------------------
  |  Branch (28938:17): [True: 0, False: 66.7k]
  ------------------
28939|      0|                JANET_OUT_OF_MEMORY;
  ------------------
  |  |  360|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (360:122): [Folded - Ignored]
  |  |  ------------------
  ------------------
28940|      0|            }
28941|  66.7k|        }
28942|  66.7k|        table->data = data;
28943|  66.7k|        table->capacity = capacity;
28944|  66.7k|    } else {
28945|      0|        table->data = NULL;
28946|      0|        table->capacity = 0;
28947|      0|    }
28948|  66.7k|    table->count = 0;
28949|  66.7k|    table->deleted = 0;
28950|  66.7k|    table->proto = NULL;
28951|  66.7k|    return table;
28952|  66.7k|}
janet.c:janet_table_rehash:
28986|  1.39k|static void janet_table_rehash(JanetTable *t, int32_t size) {
28987|  1.39k|    JanetKV *olddata = t->data;
28988|  1.39k|    JanetKV *newdata;
28989|  1.39k|    int islocal = t->gc.flags & JANET_TABLE_FLAG_STACK;
  ------------------
  |  |28915|  1.39k|#define JANET_TABLE_FLAG_STACK 0x10000
  ------------------
28990|  1.39k|    if (islocal) {
  ------------------
  |  Branch (28990:9): [True: 0, False: 1.39k]
  ------------------
28991|      0|        newdata = (JanetKV *) janet_memalloc_empty_local(size);
28992|  1.39k|    } else {
28993|  1.39k|        newdata = (JanetKV *) janet_memalloc_empty(size);
28994|  1.39k|        if (NULL == newdata) {
  ------------------
  |  Branch (28994:13): [True: 0, False: 1.39k]
  ------------------
28995|      0|            JANET_OUT_OF_MEMORY;
  ------------------
  |  |  360|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (360:122): [Folded - Ignored]
  |  |  ------------------
  ------------------
28996|      0|        }
28997|  1.39k|    }
28998|  1.39k|    int32_t i, oldcapacity;
28999|  1.39k|    oldcapacity = t->capacity;
29000|  1.39k|    t->data = newdata;
29001|  1.39k|    t->capacity = size;
29002|  1.39k|    t->deleted = 0;
29003|   893k|    for (i = 0; i < oldcapacity; i++) {
  ------------------
  |  Branch (29003:17): [True: 892k, False: 1.39k]
  ------------------
29004|   892k|        JanetKV *kv = olddata + i;
29005|   892k|        if (!janet_checktype(kv->key, JANET_NIL)) {
  ------------------
  |  |  730|   892k|    (((t) == JANET_NUMBER) \
  |  |  ------------------
  |  |  |  Branch (730:6): [Folded - Ignored]
  |  |  ------------------
  |  |  731|   892k|        ? janet_nanbox_isnumber(x) \
  |  |  ------------------
  |  |  |  |  727|      0|    (!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (727:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (727:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  732|   892k|        : janet_nanbox_checkauxtype((x), (t)))
  |  |  ------------------
  |  |  |  |  724|   892k|    (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  714|   892k|#define JANET_NANBOX_TAGBITS     0xFFFF800000000000llu
  |  |  |  |  ------------------
  |  |  |  |                   (((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|   892k|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|   892k|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (29005:13): [True: 445k, False: 446k]
  ------------------
29006|   445k|            JanetKV *newkv = janet_table_find(t, kv->key);
29007|   445k|            *newkv = *kv;
29008|   445k|        }
29009|   892k|    }
29010|  1.39k|    if (islocal) {
  ------------------
  |  Branch (29010:9): [True: 0, False: 1.39k]
  ------------------
29011|      0|        janet_sfree(olddata);
29012|  1.39k|    } else {
29013|  1.39k|        janet_free(olddata);
  ------------------
  |  | 2159|  1.39k|#define janet_free(X) free((X))
  ------------------
29014|  1.39k|    }
29015|  1.39k|}
janet.c:push_traversal_node:
30543|   935k|static void push_traversal_node(void *lhs, void *rhs, int32_t index2) {
30544|   935k|    JanetTraversalNode node;
30545|   935k|    node.self = (JanetGCObject *) lhs;
30546|   935k|    node.other = (JanetGCObject *) rhs;
30547|   935k|    node.index = 0;
30548|   935k|    node.index2 = index2;
30549|   935k|    int is_new = janet_vm.traversal_base == NULL;
30550|   935k|    if (is_new || (janet_vm.traversal + 1 >= janet_vm.traversal_top)) {
  ------------------
  |  Branch (30550:9): [True: 230, False: 934k]
  |  Branch (30550:19): [True: 25, False: 934k]
  ------------------
30551|    255|        size_t oldsize = is_new ? 0 : (janet_vm.traversal - janet_vm.traversal_base);
  ------------------
  |  Branch (30551:26): [True: 230, False: 25]
  ------------------
30552|    255|        size_t newsize = 2 * oldsize + 1;
30553|    255|        if (newsize < 128) {
  ------------------
  |  Branch (30553:13): [True: 230, False: 25]
  ------------------
30554|    230|            newsize = 128;
30555|    230|        }
30556|    255|        JanetTraversalNode *tn = janet_realloc(janet_vm.traversal_base, newsize * sizeof(JanetTraversalNode));
  ------------------
  |  | 2153|    255|#define janet_realloc(X, Y) realloc((X), (Y))
  ------------------
30557|    255|        if (tn == NULL) {
  ------------------
  |  Branch (30557:13): [True: 0, False: 255]
  ------------------
30558|      0|            JANET_OUT_OF_MEMORY;
  ------------------
  |  |  360|      0|#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "%s:%d - janet out of memory\n", __FILE__, __LINE__); exit(1); } while (0)
  |  |  ------------------
  |  |  |  Branch (360:122): [Folded - Ignored]
  |  |  ------------------
  ------------------
30559|      0|        }
30560|    255|        janet_vm.traversal_base = tn;
30561|    255|        janet_vm.traversal_top = janet_vm.traversal_base + newsize;
30562|    255|        janet_vm.traversal = janet_vm.traversal_base + oldsize;
30563|    255|    }
30564|   935k|    *(++janet_vm.traversal) = node;
30565|   935k|}
janet.c:traversal_next:
30575|  3.75M|static int traversal_next(Janet *x, Janet *y) {
30576|  3.75M|    JanetTraversalNode *t = janet_vm.traversal;
30577|  4.68M|    while (t && t > janet_vm.traversal_base) {
  ------------------
  |  Branch (30577:12): [True: 4.60M, False: 78.6k]
  |  Branch (30577:17): [True: 2.82M, False: 1.78M]
  ------------------
30578|  2.82M|        JanetGCObject *self = t->self;
30579|  2.82M|        JanetTupleHead *tself = (JanetTupleHead *)self;
30580|  2.82M|        JanetStructHead *sself = (JanetStructHead *)self;
30581|  2.82M|        JanetGCObject *other = t->other;
30582|  2.82M|        JanetTupleHead *tother = (JanetTupleHead *)other;
30583|  2.82M|        JanetStructHead *sother = (JanetStructHead *)other;
30584|  2.82M|        if ((self->flags & JANET_MEM_TYPEBITS) == JANET_MEMORY_TUPLE) {
  ------------------
  |  |  544|  2.82M|#define JANET_MEM_TYPEBITS 0xFF
  ------------------
  |  Branch (30584:13): [True: 97.0k, False: 2.73M]
  ------------------
30585|       |            /* Node is a tuple at index t->index */
30586|  97.0k|            if (t->index < tself->length && t->index < tother->length) {
  ------------------
  |  Branch (30586:17): [True: 68.9k, False: 28.1k]
  |  Branch (30586:45): [True: 68.9k, False: 0]
  ------------------
30587|  68.9k|                int32_t index = t->index++;
30588|  68.9k|                *x = tself->data[index];
30589|  68.9k|                *y = tother->data[index];
30590|  68.9k|                janet_vm.traversal = t;
30591|  68.9k|                return 0;
30592|  68.9k|            }
30593|  28.1k|            if (t->index2 && tself->length != tother->length) {
  ------------------
  |  Branch (30593:17): [True: 27.2k, False: 846]
  |  Branch (30593:30): [True: 0, False: 27.2k]
  ------------------
30594|      0|                return tself->length > tother->length ? 3 : 1;
  ------------------
  |  Branch (30594:24): [True: 0, False: 0]
  ------------------
30595|      0|            }
30596|  2.73M|        } else {
30597|       |            /* Node is a struct at index t->index: if t->index2 is true, we should return the values. */
30598|  2.73M|            if (t->index2) {
  ------------------
  |  Branch (30598:17): [True: 914k, False: 1.81M]
  ------------------
30599|   914k|                t->index2 = 0;
30600|   914k|                int32_t index = t->index++;
30601|   914k|                *x = sself->data[index].value;
30602|   914k|                *y = sother->data[index].value;
30603|   914k|                janet_vm.traversal = t;
30604|   914k|                return 0;
30605|   914k|            }
30606|  1.81M|            for (int32_t i = t->index; i < sself->capacity; i++) {
  ------------------
  |  Branch (30606:40): [True: 914k, False: 903k]
  ------------------
30607|   914k|                t->index2 = 1;
30608|   914k|                *x = sself->data[t->index].key;
30609|   914k|                *y = sother->data[t->index].key;
30610|   914k|                janet_vm.traversal = t;
30611|   914k|                return 0;
30612|   914k|            }
30613|       |            /* Traverse prototype */
30614|   903k|            JanetStruct sproto = sself->proto;
30615|   903k|            JanetStruct oproto = sother->proto;
30616|   903k|            if (sproto && !oproto) return 3;
  ------------------
  |  Branch (30616:17): [True: 0, False: 903k]
  |  Branch (30616:27): [True: 0, False: 0]
  ------------------
30617|   903k|            if (!sproto && oproto) return 1;
  ------------------
  |  Branch (30617:17): [True: 903k, False: 0]
  |  Branch (30617:28): [True: 0, False: 903k]
  ------------------
30618|   903k|            if (oproto && sproto) {
  ------------------
  |  Branch (30618:17): [True: 0, False: 903k]
  |  Branch (30618:27): [True: 0, False: 0]
  ------------------
30619|      0|                *x = janet_wrap_struct(sproto);
  ------------------
  |  |  765|      0|#define janet_wrap_struct(s) janet_nanbox_wrap_c((s), JANET_STRUCT)
  |  |  ------------------
  |  |  |  |  751|      0|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
30620|      0|                *y = janet_wrap_struct(oproto);
  ------------------
  |  |  765|      0|#define janet_wrap_struct(s) janet_nanbox_wrap_c((s), JANET_STRUCT)
  |  |  ------------------
  |  |  |  |  751|      0|    janet_nanbox_from_cpointer((p), janet_nanbox_tag(t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  717|      0|#define janet_nanbox_tag(type) (janet_nanbox_lowtag(type) << 47)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  716|      0|#define janet_nanbox_lowtag(type) ((uint64_t)(type) | 0x1FFF0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
30621|      0|                janet_vm.traversal = t - 1;
30622|      0|                return 0;
30623|      0|            }
30624|   903k|        }
30625|   931k|        t--;
30626|   931k|    }
30627|  1.85M|    janet_vm.traversal = t;
30628|  1.85M|    return 2;
30629|  3.75M|}
janet.c:murmur64:
30808|  3.68M|static uint64_t murmur64(uint64_t h) {
30809|  3.68M|    h ^= h >> 33;
30810|  3.68M|    h *= 0xff51afd7ed558ccdUL;
30811|  3.68M|    h ^= h >> 33;
30812|  3.68M|    h *= 0xc4ceb9fe1a85ec53UL;
30813|  3.68M|    h ^= h >> 33;
30814|  3.68M|    return h;
30815|  3.68M|}

LLVMFuzzerTestOneInput:
    5|  5.24k|int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
    6|       |
    7|       |    /* init Janet */
    8|  5.24k|    janet_init();
    9|       |
   10|       |    /* fuzz the parser */
   11|  5.24k|    JanetParser parser;
   12|  5.24k|    janet_parser_init(&parser);
   13|  65.2M|    for (int i = 0, done = 0; i < size; i++) {
  ------------------
  |  Branch (13:31): [True: 65.2M, False: 5.14k]
  ------------------
   14|  65.2M|        switch (janet_parser_status(&parser)) {
  ------------------
  |  Branch (14:17): [True: 0, False: 65.2M]
  ------------------
   15|      0|            case JANET_PARSE_DEAD:
  ------------------
  |  Branch (15:13): [True: 0, False: 65.2M]
  ------------------
   16|    108|            case JANET_PARSE_ERROR:
  ------------------
  |  Branch (16:13): [True: 108, False: 65.2M]
  ------------------
   17|    108|                done = 1;
   18|    108|                break;
   19|  65.1M|            case JANET_PARSE_PENDING:
  ------------------
  |  Branch (19:13): [True: 65.1M, False: 40.2k]
  ------------------
   20|  65.1M|                if (i == size) {
  ------------------
  |  Branch (20:21): [True: 0, False: 65.1M]
  ------------------
   21|      0|                    janet_parser_eof(&parser);
   22|  65.1M|                } else {
   23|  65.1M|                    janet_parser_consume(&parser, data[i]);
   24|  65.1M|                }
   25|  65.1M|                break;
   26|  40.1k|            case JANET_PARSE_ROOT:
  ------------------
  |  Branch (26:13): [True: 40.1k, False: 65.1M]
  ------------------
   27|  40.1k|                if (i >= size) {
  ------------------
  |  Branch (27:21): [True: 0, False: 40.1k]
  ------------------
   28|      0|                    janet_parser_eof(&parser);
   29|  40.1k|                } else {
   30|  40.1k|                    janet_parser_consume(&parser, data[i]);
   31|  40.1k|                }
   32|  40.1k|                break;
   33|  65.2M|        }
   34|       |
   35|  65.2M|        if (done == 1)
  ------------------
  |  Branch (35:13): [True: 108, False: 65.2M]
  ------------------
   36|    108|            break;
   37|  65.2M|    }
   38|  5.24k|    janet_parser_deinit(&parser);
   39|       |
   40|       |    /* cleanup Janet */
   41|  5.24k|    janet_deinit();
   42|       |
   43|  5.24k|    return 0;
   44|  5.24k|}

