<commit_before>fun memcpy(dst : Void*, src : Void*, n : USize) : Void*
    dst_sig = dst
    dst = dst.to_byte_ptr
    src = src.to_byte_ptr
    i = 0
    while i < n
        dst[i] = src[i]
        i += 1
    end
    dst_sig
end

fun memmove(dst : Void*, src : Void*, n : USize) : Void*
    dst_sig = dst
    dst = dst.to_byte_ptr
    src = src.to_byte_ptr
    if src < dst
        i = n
        while i != 0
            i -= 1
            dst[i] = src[i]
        end
    else
        i = 0
        while i < n
            dst[i] = src[i]
            i += 1
        end
    end
    dst_sig
end

fun memset(dst : Void*, c : UInt8, n : USize) : Void*
    ptr = dst.to_byte_ptr
    i = 0
    while i < n
        ptr[i] = c
    end
    dst
end

fun memcmp(ptr_a : Void*, ptr_b : Void*, n : USize)
    ptr_a = ptr_a.to_byte_ptr
    ptr_b = ptr_b.to_byte_ptr
    i = 0
    while i < n
        a = ptr_a[i]
        b = ptr_b[i]
        i += 1
        return a.to_i32 - b.to_i32 if a != b
    end
    0
end<commit_msg>Fix memset (fix #2)<commit_after>fun memcpy(dst : Void*, src : Void*, n : USize) : Void*
    dst_sig = dst
    dst = dst.to_byte_ptr
    src = src.to_byte_ptr
    i = 0
    while i < n
        dst[i] = src[i]
        i += 1
    end
    dst_sig
end

fun memmove(dst : Void*, src : Void*, n : USize) : Void*
    dst_sig = dst
    dst = dst.to_byte_ptr
    src = src.to_byte_ptr
    if src < dst
        i = n
        while i != 0
            i -= 1
            dst[i] = src[i]
        end
    else
        i = 0
        while i < n
            dst[i] = src[i]
            i += 1
        end
    end
    dst_sig
end

fun memset(dst : Void*, c : UInt8, n : USize) : Void*
    ptr = dst.to_byte_ptr
    i = 0
    while i < n
        ptr[i] = c
        i += 1
    end
    dst
end

fun memcmp(ptr_a : Void*, ptr_b : Void*, n : USize)
    ptr_a = ptr_a.to_byte_ptr
    ptr_b = ptr_b.to_byte_ptr
    i = 0
    while i < n
        a = ptr_a[i]
        b = ptr_b[i]
        i += 1
        return a.to_i32 - b.to_i32 if a != b
    end
    0
end
{'fraction_non_alphanumeric': 0.10915320606950563, 'fraction_numerical': 0.01566324033284386, 'mean_word_length': 1.336, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 3, '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': '628332', 'n_tokens_mistral': 860, 'n_tokens_neox': 817, 'n_words': 240}