<commit_before>
typedef void (*DumpFunc)(const char*);


static inline void dump_ctype(DumpFunc df, CType *ct)
{
    int len = 0;
    char buffer[0x100];
    memset(buffer, 0, sizeof(buffer));

    int btype = ct->t & VT_BTYPE;
    int type = ct->t & VT_TYPE;

    len += sprintf(buffer + len, "\t\tbtype ");

    switch (btype) {
    case VT_INT:
        len += sprintf(buffer + len, "VT_INT\0");
        break;
    case VT_BYTE:
        len += sprintf(buffer + len, "VT_BYTE\0");
        break;
    case VT_SHORT:
        len += sprintf(buffer + len, "VT_SHORT\0");
        break;
    case VT_VOID:
        len += sprintf(buffer + len, "VT_VOID\0");
        break;
    case VT_PTR:
        len += sprintf(buffer + len, "VT_PTR\0");
        break;
    case VT_ENUM:
        len += sprintf(buffer + len, "VT_ENUM\0");
        break;
    case VT_FUNC:
        len += sprintf(buffer + len, "VT_FUNC\0");
        break;
    case VT_STRUCT:
        len += sprintf(buffer + len, "VT_STRUCT\0");
        break;
    case VT_FLOAT:
        len += sprintf(buffer + len, "VT_FLOAT\0");
        break;
    case VT_DOUBLE:
        len += sprintf(buffer + len, "VT_DOUBLE\0");
        break;
    case VT_LDOUBLE:
        len += sprintf(buffer + len, "VT_LDOUBLE\0");
        break;
    case VT_BOOL:
        len += sprintf(buffer + len, "VT_BOOL\0");
        break;
    case VT_LLONG:
        len += sprintf(buffer + len, "VT_LLONG\0");
        break;
    case VT_LONG:
        len += sprintf(buffer + len, "VT_LONG\0");
        break;
    default:
        len += sprintf(buffer + len, "???UNKNOWN???\0");
        break;
    }

    df(buffer);
    len = 0;

    len += sprintf(buffer + len, "\t\tbtype ");
    if (btype & VT_UNSIGNED)
        len += sprintf(buffer + len, "VT_UNSIGNED ");
    if (btype & VT_ARRAY)
        len += sprintf(buffer + len, "VT_ARRAY ");
    if (btype & VT_VLA)
        len += sprintf(buffer + len, "VT_VLA ");
    if (btype & VT_BITFIELD)
        len += sprintf(buffer + len, "VT_BITFIELD ");
    if (btype & VT_CONSTANT)
        len += sprintf(buffer + len, "VT_CONSTANT ");
    if (btype & VT_VOLATILE)
        len += sprintf(buffer + len, "VT_VOLATILE ");
    if (btype & VT_SIGNED)
        len += sprintf(buffer + len, "VT_SIGNED ");

    buffer[len] = 0;
    df(buffer);
    len = 0;
}


static inline void dump_r(DumpFunc df, int r)
{
    char buffer[0x100];
    int len = 0;

    int val = r & VT_VALMASK;
    int lval_type = r & VT_LVAL_TYPE;

    len += sprintf(buffer + len, "\t\tr val ");

    switch (val) {
        break;
        len += sprintf(buffer + len, "VT_INT\0");
    case VT_CONST:
        len += sprintf(buffer + len, "VT_CONST\0");
        break;
    case VT_LLOCAL:
        len += sprintf(buffer + len, "VT_LLOCAL\0");
        break;
    case VT_LOCAL:
        len += sprintf(buffer + len, "VT_LOCAL\0");
        break;
    case VT_CMP:
        len += sprintf(buffer + len, "VT_CMP\0");
        break;
    case VT_JMP:
        len += sprintf(buffer + len, "VT_JMP\0");
        break;
    case VT_JMPI:
        len += sprintf(buffer + len, "VT_JMPI\0");
        break;
    default:
        if (val < VT_CONST)
            len += sprintf(buffer + len, "reg %u\0", val);
        else<commit_msg>Fix some bugs in dump helper<commit_after>
typedef void (*DumpFunc)(const char*);


static inline void dump_ctype(DumpFunc df, CType *ct)
{
    int len = 0;
    char buffer[0x100];
    memset(buffer, 0, sizeof(buffer));

    int btype = ct->t & VT_BTYPE;
    int type = ct->t & VT_TYPE;

    len += sprintf(buffer + len, "\t\tbtype ");

    switch (btype) {
    case VT_INT:
        len += sprintf(buffer + len, "VT_INT\0");
        break;
    case VT_BYTE:
        len += sprintf(buffer + len, "VT_BYTE\0");
        break;
    case VT_SHORT:
        len += sprintf(buffer + len, "VT_SHORT\0");
        break;
    case VT_VOID:
        len += sprintf(buffer + len, "VT_VOID\0");
        break;
    case VT_PTR:
        len += sprintf(buffer + len, "VT_PTR\0");
        break;
    case VT_ENUM:
        len += sprintf(buffer + len, "VT_ENUM\0");
        break;
    case VT_FUNC:
        len += sprintf(buffer + len, "VT_FUNC\0");
        break;
    case VT_STRUCT:
        len += sprintf(buffer + len, "VT_STRUCT\0");
        break;
    case VT_FLOAT:
        len += sprintf(buffer + len, "VT_FLOAT\0");
        break;
    case VT_DOUBLE:
        len += sprintf(buffer + len, "VT_DOUBLE\0");
        break;
    case VT_LDOUBLE:
        len += sprintf(buffer + len, "VT_LDOUBLE\0");
        break;
    case VT_BOOL:
        len += sprintf(buffer + len, "VT_BOOL\0");
        break;
    case VT_LLONG:
        len += sprintf(buffer + len, "VT_LLONG\0");
        break;
    case VT_LONG:
        len += sprintf(buffer + len, "VT_LONG\0");
        break;
    default:
        len += sprintf(buffer + len, "???UNKNOWN???\0");
        break;
    }

    df(buffer);
    len = 0;

    len += sprintf(buffer + len, "\t\ttype ");
    if (type & VT_UNSIGNED)
        len += sprintf(buffer + len, "VT_UNSIGNED ");
    if (type & VT_ARRAY)
        len += sprintf(buffer + len, "VT_ARRAY ");
    if (type & VT_VLA)
        len += sprintf(buffer + len, "VT_VLA ");
    if (type & VT_BITFIELD)
        len += sprintf(buffer + len, "VT_BITFIELD ");
    if (type & VT_CONSTANT)
        len += sprintf(buffer + len, "VT_CONSTANT ");
    if (type & VT_VOLATILE)
        len += sprintf(buffer + len, "VT_VOLATILE ");
    if (type & VT_SIGNED)
        len += sprintf(buffer + len, "VT_SIGNED ");

    buffer[len] = 0;
    df(buffer);
    len = 0;
}


static inline void dump_r(DumpFunc df, int r)
{
    char buffer[0x100];
    int len = 0;

    int val = r & VT_VALMASK;

    len += sprintf(buffer + len, "\t\tr val ");

    switch (val) {
        break;
        len += sprintf(buffer + len, "VT_INT\0");
    case VT_CONST:
        len += sprintf(buffer + len, "VT_CONST\0");
        break;
    case VT_LLOCAL:
        len += sprintf(buffer + len, "VT_LLOCAL\0");
        break;
    case VT_LOCAL:
        len += sprintf(buffer + len, "VT_LOCAL\0");
        break;
    case VT_CMP:
        len += sprintf(buffer + len, "VT_CMP\0");
        break;
    case VT_JMP:
        len += sprintf(buffer + len, "VT_JMP\0");
        break;
    case VT_JMPI:
        len += sprintf(buffer + len, "VT_JMPI\0");
        break;
    default:
        if (val < VT_CONST)
            len += sprintf(buffer + len, "reg %u\0", val);
        else
{'fraction_non_alphanumeric': 0.14747474747474748, 'fraction_numerical': 0.0114996114996115, 'mean_word_length': 2.0358490566037735, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6221460', 'n_tokens_mistral': 2280, 'n_tokens_neox': 2303, 'n_words': 568}