<commit_before>/*
 * Copyright (c) 2012-2016 <NAME>
 * See LICENSE for details.
 *
 * <NAME> <<EMAIL>>
 * <NAME> <<EMAIL>>
 */

#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>

#include <sys/cdefs.h>

#include <dbgio/dbgio.h>

#include <mm/slob.h>

#include <sys/dma-queue.h>

#include <cpu.h>
#include <scu.h>
#include <vdp.h>

#if HAVE_DEV_CARTRIDGE == 1 /* USB flash cartridge */
#include <usb-cart.h>
#elif HAVE_DEV_CARTRIDGE == 2 /* Datel Action Replay cartridge */
#include <arp.h>
#endif /* HAVE_DEV_CARTRIDGE */

void __attribute__ ((weak))
user_init(void)
{
        slob_init();
}

static void __used
_call_global_ctors(void)
{
        extern void (*__CTOR_LIST__[])(void);

        /* Constructors are called in reverse order of the list */
        int32_t i;
        for (i = (int32_t)__CTOR_LIST__[0]; i >= 1; i--) {
                /* Each function handles one or more destructor (within
                 * file scope) */
                __CTOR_LIST__[i]();
        }
}

/* Do all destructors */
static void __used
_call_global_dtors(void)
{
        extern void (*__DTOR_LIST__[])(void);

        /* Destructors in forward order */
        int32_t i;
        for (i = 0; i < (int32_t)__DTOR_LIST__[0]; i++) {
                /* Each function handles one or more destructor (within
                 * file scope) */
                __DTOR_LIST__[i + 1]();
        }
}

static void __used __section(".init")
_init(void)
{
        _call_global_ctors();

        cpu_init();
        scu_init();

#if HAVE_DEV_CARTRIDGE == 1 /* USB flash cartridge */
        usb_cart_init();
#endif /* HAVE_DEV_CARTRIDGE */<commit_msg>Call to initialize DRAM cartridge<commit_after>/*
 * Copyright (c) 2012-2016 <NAME>
 * See LICENSE for details.
 *
 * <NAME> <<EMAIL>>
 * <NAME> <<EMAIL>>
 */

#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>

#include <sys/cdefs.h>

#include <dbgio/dbgio.h>

#include <mm/slob.h>

#include <sys/dma-queue.h>

#include <cpu.h>
#include <scu.h>
#include <vdp.h>

#if HAVE_DEV_CARTRIDGE == 1 /* USB flash cartridge */
#include <usb-cart.h>
#elif HAVE_DEV_CARTRIDGE == 2 /* Datel Action Replay cartridge */
#include <arp.h>
#endif /* HAVE_DEV_CARTRIDGE */

#include <dram-cart.h>

void __attribute__ ((weak))
user_init(void)
{
        slob_init();
}

static void __used
_call_global_ctors(void)
{
        extern void (*__CTOR_LIST__[])(void);

        /* Constructors are called in reverse order of the list */
        int32_t i;
        for (i = (int32_t)__CTOR_LIST__[0]; i >= 1; i--) {
                /* Each function handles one or more destructor (within
                 * file scope) */
                __CTOR_LIST__[i]();
        }
}

/* Do all destructors */
static void __used
_call_global_dtors(void)
{
        extern void (*__DTOR_LIST__[])(void);

        /* Destructors in forward order */
        int32_t i;
        for (i = 0; i < (int32_t)__DTOR_LIST__[0]; i++) {
                /* Each function handles one or more destructor (within
                 * file scope) */
                __DTOR_LIST__[i + 1]();
        }
}

static void __used __section(".init")
_init(void)
{
        _call_global_ctors();

        cpu_init();
        scu_init();

#if HAVE_DEV_CARTRIDGE == 1 /* USB flash cartridge */
        usb_cart_init();
#else
        dram_cart_init();
#endif /* HAVE_DEV_CARTRIDGE */
{'fraction_non_alphanumeric': 0.1452563347083088, 'fraction_numerical': 0.014142604596346494, 'mean_word_length': 2.492798353909465, 'pattern_counts': {'":': 0, '<': 46, '<?xml version=': 0, '>': 46, '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': '740939', 'n_tokens_mistral': 1281, 'n_tokens_neox': 1202, 'n_words': 298}