<commit_before>#include <stdlib.h>
#include <assert.h>
#include <jni.h>
#include <ffi.h>

/*
 * Class:     kotlin_native_interop_CallbacksKt
 * Method:    ffiTypeVoid
 * Signature: ()J
 */
JNIEXPORT jlong JNICALL Java_kotlin_1native_interop_CallbacksKt_ffiTypeVoid(JNIEnv *env, jclass cls) {
    return (jlong) &ffi_type_void;
}

/*
 * Class:     kotlin_native_interop_CallbacksKt
 * Method:    ffiTypeUInt8
 * Signature: ()J
 */
JNIEXPORT jlong JNICALL Java_kotlin_1native_interop_CallbacksKt_ffiTypeUInt8(JNIEnv *env, jclass cls) {
    return (jlong) &ffi_type_uint8;
}

/*
 * Class:     kotlin_native_interop_CallbacksKt
 * Method:    ffiTypeSInt8
 * Signature: ()J
 */
JNIEXPORT jlong JNICALL Java_kotlin_1native_interop_CallbacksKt_ffiTypeSInt8(JNIEnv *env, jclass cls) {
    return (jlong) &ffi_type_sint8;
}

/*
 * Class:     kotlin_native_interop_CallbacksKt
 * Method:    ffiTypeUInt16
 * Signature: ()J
 */
JNIEXPORT jlong JNICALL Java_kotlin_1native_interop_CallbacksKt_ffiTypeUInt16(JNIEnv *env, jclass cls) {
    return (jlong) &ffi_type_uint16;
}

/*
 * Class:     kotlin_native_interop_CallbacksKt
 * Method:    ffiTypeSInt16
 * Signature: ()J
 */
JNIEXPORT jlong JNICALL Java_kotlin_1native_interop_CallbacksKt_ffiTypeSInt16(JNIEnv *env, jclass cls) {
    return (jlong) &ffi_type_sint16;
}

/*
 * Class:     kotlin_native_interop_CallbacksKt
 * Method:    ffiTypeUInt32
 * Signature: ()J
 */
JNIEXPORT jlong JNICALL Java_kotlin_1native_interop_CallbacksKt_ffiTypeUInt32(JNIEnv *env, jclass cls) {
    return (jlong) &ffi_type_uint32;
}

/*
 * Class:     kotlin_native_interop_CallbacksKt
 * Method:    ffiTypeSInt32
 * Signature: ()J
 */
JNIEXPORT jlong JNICALL Java_kotlin_1native_interop_CallbacksKt_ffiTypeSInt32(JNIEnv *env, jclass cls) {
    return (jlong) &ffi_type_sint32;
}

/*
 * Class:     kotlin_native_interop_CallbacksKt
 * Method:    ffiTypeUInt64
 * Signature: ()J
 */
JNIEXPORT jlong JNICALL Java_kotlin_1native_interop_CallbacksKt_ffiTypeUInt64(JNIEnv *env, jclass cls) {
    return (jlong) &ffi_type_uint64;
}

/*
 * Class:     kotlin_native_interop_CallbacksKt
 * Method:    ffiTypeSInt64
 * Signature: ()J
 */
JNIEXPORT jlong JNICALL Java_kotlin_1native_interop_CallbacksKt_ffiTypeSInt64(JNIEnv *env, jclass cls) {
    return (jlong) &ffi_type_sint64;
}

/*
 * Class:     kotlin_native_interop_CallbacksKt
 * Method:    ffiTypePointer
 * Signature: ()J
 */
JNIEXPORT jlong JNICALL Java_kotlin_1native_interop_CallbacksKt_ffiTypePointer(JNIEnv *env, jclass cls) {
    return (jlong) &ffi_type_pointer;
}

/*
 * Class:     kotlin_native_interop_CallbacksKt
 * Method:    ffiTypeStruct0
 * Signature: (J)J
 */
JNIEXPORT jlong JNICALL Java_kotlin_1native_interop_CallbacksKt_ffiTypeStruct0(JNIEnv *env, jclass cls, jlong elements) {
    ffi_type* res = malloc(sizeof(ffi_type));
    if (res != NULL) {
        res->elements = (ffi_type**) elements;
        res->type = FFI_TYPE_STRUCT;
    }
    return (jlong) res;
}

/*
 * Class:     kotlin_native_interop_CallbacksKt
 * Method:    ffiCreateCif0
 * Signature: (IJJ)J
 */
JNIEXPORT jlong JNICALL Java_kotlin_1native_interop_CallbacksKt_ffiCreateCif0(JNIEnv *env, jclass cls, jint nArgs, jlong rType, jlong argTypes) {
    ffi_cif* res = malloc(sizeof(ffi_cif));
    if (res != NULL) {
        ffi_status status = ffi_prep_cif(res, FFI_DEFAULT_ABI, nArgs, (ffi_type*)rType, (ffi_type**)argTypes);
        if (status != FFI_OK) {
            if (status == FFI_BAD_TYPEDEF) {
                return -(jlong)1;
            } else if (status == FFI_BAD_ABI) {
                return -(jlong)2;
            } else {
                return -(jlong)3;
            }
        }
    }
    return (jlong) res;
}

static JavaVM *vm = NULL;

// Returns the JNI env which can be used by the caller.<commit_msg>Interop/Runtime: properly initialize ffi_type for structs<commit_after>#include <stdlib.h>
#include <assert.h>
#include <jni.h>
#include <ffi.h>

/*
 * Class:     kotlin_native_interop_CallbacksKt
 * Method:    ffiTypeVoid
 * Signature: ()J
 */
JNIEXPORT jlong JNICALL Java_kotlin_1native_interop_CallbacksKt_ffiTypeVoid(JNIEnv *env, jclass cls) {
    return (jlong) &ffi_type_void;
}

/*
 * Class:     kotlin_native_interop_CallbacksKt
 * Method:    ffiTypeUInt8
 * Signature: ()J
 */
JNIEXPORT jlong JNICALL Java_kotlin_1native_interop_CallbacksKt_ffiTypeUInt8(JNIEnv *env, jclass cls) {
    return (jlong) &ffi_type_uint8;
}

/*
 * Class:     kotlin_native_interop_CallbacksKt
 * Method:    ffiTypeSInt8
 * Signature: ()J
 */
JNIEXPORT jlong JNICALL Java_kotlin_1native_interop_CallbacksKt_ffiTypeSInt8(JNIEnv *env, jclass cls) {
    return (jlong) &ffi_type_sint8;
}

/*
 * Class:     kotlin_native_interop_CallbacksKt
 * Method:    ffiTypeUInt16
 * Signature: ()J
 */
JNIEXPORT jlong JNICALL Java_kotlin_1native_interop_CallbacksKt_ffiTypeUInt16(JNIEnv *env, jclass cls) {
    return (jlong) &ffi_type_uint16;
}

/*
 * Class:     kotlin_native_interop_CallbacksKt
 * Method:    ffiTypeSInt16
 * Signature: ()J
 */
JNIEXPORT jlong JNICALL Java_kotlin_1native_interop_CallbacksKt_ffiTypeSInt16(JNIEnv *env, jclass cls) {
    return (jlong) &ffi_type_sint16;
}

/*
 * Class:     kotlin_native_interop_CallbacksKt
 * Method:    ffiTypeUInt32
 * Signature: ()J
 */
JNIEXPORT jlong JNICALL Java_kotlin_1native_interop_CallbacksKt_ffiTypeUInt32(JNIEnv *env, jclass cls) {
    return (jlong) &ffi_type_uint32;
}

/*
 * Class:     kotlin_native_interop_CallbacksKt
 * Method:    ffiTypeSInt32
 * Signature: ()J
 */
JNIEXPORT jlong JNICALL Java_kotlin_1native_interop_CallbacksKt_ffiTypeSInt32(JNIEnv *env, jclass cls) {
    return (jlong) &ffi_type_sint32;
}

/*
 * Class:     kotlin_native_interop_CallbacksKt
 * Method:    ffiTypeUInt64
 * Signature: ()J
 */
JNIEXPORT jlong JNICALL Java_kotlin_1native_interop_CallbacksKt_ffiTypeUInt64(JNIEnv *env, jclass cls) {
    return (jlong) &ffi_type_uint64;
}

/*
 * Class:     kotlin_native_interop_CallbacksKt
 * Method:    ffiTypeSInt64
 * Signature: ()J
 */
JNIEXPORT jlong JNICALL Java_kotlin_1native_interop_CallbacksKt_ffiTypeSInt64(JNIEnv *env, jclass cls) {
    return (jlong) &ffi_type_sint64;
}

/*
 * Class:     kotlin_native_interop_CallbacksKt
 * Method:    ffiTypePointer
 * Signature: ()J
 */
JNIEXPORT jlong JNICALL Java_kotlin_1native_interop_CallbacksKt_ffiTypePointer(JNIEnv *env, jclass cls) {
    return (jlong) &ffi_type_pointer;
}

/*
 * Class:     kotlin_native_interop_CallbacksKt
 * Method:    ffiTypeStruct0
 * Signature: (J)J
 */
JNIEXPORT jlong JNICALL Java_kotlin_1native_interop_CallbacksKt_ffiTypeStruct0(JNIEnv *env, jclass cls, jlong elements) {
    ffi_type* res = malloc(sizeof(ffi_type));
    if (res != NULL) {
        res->size = 0;
        res->alignment = 0;
        res->elements = (ffi_type**) elements;
        res->type = FFI_TYPE_STRUCT;
    }
    return (jlong) res;
}

/*
 * Class:     kotlin_native_interop_CallbacksKt
 * Method:    ffiCreateCif0
 * Signature: (IJJ)J
 */
JNIEXPORT jlong JNICALL Java_kotlin_1native_interop_CallbacksKt_ffiCreateCif0(JNIEnv *env, jclass cls, jint nArgs, jlong rType, jlong argTypes) {
    ffi_cif* res = malloc(sizeof(ffi_cif));
    if (res != NULL) {
        ffi_status status = ffi_prep_cif(res, FFI_DEFAULT_ABI, nArgs, (ffi_type*)rType, (ffi_type**)argTypes);
        if (status != FFI_OK) {
            if (status == FFI_BAD_TYPEDEF) {
                return -(jlong)1;
            } else if (status == FFI_BAD_ABI) {
                return -(jlong)2;
            } else {
                return -(jlong)3;
            }
        }
    }
    return (jlong) res;
}

static JavaVM *vm = NULL;

// Returns the JNI env which can be used by the caller.
{'fraction_non_alphanumeric': 0.0995687965503724, 'fraction_numerical': 0.01620279628903698, 'mean_word_length': 3.9285254346426273, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, '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': '7309566', 'n_tokens_mistral': 3168, 'n_tokens_neox': 3038, 'n_words': 536}