/*
 * C code generated by Aldor from file "simple2.as".
 */

#include "foam_c.h"

typedef struct Fmt5  *PFmt5;
struct Fmt5 {
        FiWord X0_BinaryWriter;
        FiWord X1_BinaryReader;
        FiWord X2_TextWriter;
        FiWord X3_TextReader;
        FiWord X4_Character;
        FiWord X5_WriterManipulator;
        FiWord X6_Boolean;
        FiWord X7_AldorInteger;
        FiWord X8_String;
        FiWord X9_File;
        FiWord X10_1;
        FiWord X11_dom;
        FiWord X12;
        FiBool X13;
};
static FiProg C0_simple2;
static void CF0_simple2(FiEnv e1);
static FiProg C1_sal__int_MINUS_init;
static FiWord CF1_sal__int_MINUS_init(FiEnv e1, FiSInt P0_idx);
extern FiClos G_KZID3_simple2;
static FiClos *pG_NQYQM_noOperation;
static FiClos *pG_XIPRL_runtime;
static FiWord *pG_LZ4RQ_sal__int__AldorIntege;
static FiClos *pG_KK8CX_rtLazyDomFrInit;
static FiClos *pG_LD0B5_domainHash_BANG_;
static FiClos *pG_4NZQI_lazyGetExport_BANG_;
static FiClos *pG_R3D1K_lazyForceImport;
static FiClos *pG_OT1PA_sal__int;



static void
CF0_simple2(FiEnv e1)
{
        FiSInt T1;
        FiClos T0;
        PFmt5 l0;
        FiEnv e0;
        l0 = fi0New(struct Fmt5 , CENSUS_EnvLevel);
        e0 = fiEnvPush(l0, e1);
        fiCCall0(void, (*pG_XIPRL_runtime));
        G_KZID3_simple2 = (FiClos) (*pG_NQYQM_noOperation);
        T0 = fiClosMake(e0, C1_sal__int_MINUS_init);
        l0->X13 = 0L;
        l0->X7_AldorInteger = fiCCall2(FiWord, (*
                pG_KK8CX_rtLazyDomFrInit), T0, 0L);
        l0->X11_dom = l0->X7_AldorInteger;
        T1 = fiCCall1(FiSInt, (*pG_LD0B5_domainHash_BANG_), l0->
                X7_AldorInteger);
        l0->X10_1 = fiCCall3(FiWord, (*pG_4NZQI_lazyGetExport_BANG_),
                l0->X11_dom, 200090L, T1);
        (FiWord) fiCCall1(FiWord, (*pG_R3D1K_lazyForceImport), l0->X10_1);
        return ;
}

static struct _FiProg  tmp0_simple2 = {
        (FiFun) CF0_simple2,
        0L,
        0L,
        0L
};


static FiWord
CF1_sal__int_MINUS_init(FiEnv e1, FiSInt P0_idx)
{
        PFmt5 l1;
        l1 = (PFmt5) fiEnvLevel(e1);
        if (l1->X13) goto L0;
        l1->X13 = 1L;
        fiCCall0(void, (*pG_OT1PA_sal__int));
L0:     return (FiWord) (*pG_LZ4RQ_sal__int__AldorIntege);
}

static struct _FiProg  tmp1_sal__int_MINUS_init = {
        (FiFun) CF1_sal__int_MINUS_init,
        0L,
        0L,
        0L
};

extern int
INIT__0_simple2()
{

        extern int INIT__0_rtexns();
        extern int INIT__0_sal__int();
        extern int INIT__0_runtime();
        static int initialized = 0;
        if (initialized)
                return 0L;
        else
                initialized = 1;
        C1_sal__int_MINUS_init = &tmp1_sal__int_MINUS_init;
        C0_simple2 = &tmp0_simple2;
        fiExportGlobal("G_KZID3_simple2", G_KZID3_simple2);
        fiImportGlobal("G_NQYQM_noOperation", pG_NQYQM_noOperation);
        fiImportGlobal("G_XIPRL_runtime", pG_XIPRL_runtime);
        fiImportGlobal("G_LZ4RQ_sal__int__AldorInteger",
                pG_LZ4RQ_sal__int__AldorIntege);
        fiImportGlobal("G_KK8CX_rtLazyDomFrInit", pG_KK8CX_rtLazyDomFrInit);
        fiImportGlobal("G_LD0B5_domainHash_BANG_", pG_LD0B5_domainHash_BANG_);
        fiImportGlobal("G_4NZQI_lazyGetExport_BANG_",
                pG_4NZQI_lazyGetExport_BANG_);
        fiImportGlobal("G_R3D1K_lazyForceImport", pG_R3D1K_lazyForceImport);
        fiImportGlobal("G_OT1PA_sal__int", pG_OT1PA_sal__int);
        if (fiFileInitializer) {
                fiFileInitializer("rtexns");
                fiFileInitializer("sal_int");
                fiFileInitializer("runtime");
        }
        else {
                INIT__0_rtexns();
                INIT__0_sal__int();
                INIT__0_runtime();
        }
        /* "---------------------------" */
        return 0L;
}


static struct _FiClos  tmpClos0_simple2 = {
        0L,
        (FiProg) &tmp0_simple2
};
FiClos G_KZID3_simple2 = &tmpClos0_simple2;