/* sscc : C CODE OF SORTED EQUATIONS LINK - SIMULATION MODE */

/* AUXILIARY DECLARATIONS */

#ifndef STRLEN
#define STRLEN 81
#endif
#define _COND(A,B,C) ((A)?(B):(C))
#ifdef TRACE_ACTION
#include <stdio.h>
#endif
#ifndef NULL
#define NULL ((char*)0)
#endif

#ifndef __EXEC_STATUS_H_LOADED
#define __EXEC_STATUS_H_LOADED

typedef struct {
unsigned int start:1;
unsigned int kill:1;
unsigned int active:1;
unsigned int suspended:1;
unsigned int prev_active:1;
unsigned int prev_suspended:1;
unsigned int exec_index;
unsigned int task_exec_index;
void (*pStart)();
int (*pRet)();
} __ExecStatus;

#endif
#define __ResetExecStatus(status) {\
   status.prev_active = status.active; \
   status.prev_suspended = status.suspended; \
   status.start = status.kill = status.active = status.suspended = 0; }
#define __DSZ(V) (--(V)<=0)
#define BASIC_TYPES_DEFINED
typedef int boolean;
typedef int integer;
typedef char* string;
#define CSIMUL_H_LOADED
typedef struct {char text[STRLEN];} symbolic;
extern void _boolean();
extern boolean _eq_boolean();
extern boolean _ne_boolean();
extern boolean _cond_boolean();
extern char* _boolean_to_text();
extern int _check_boolean();
extern void _text_to_boolean();
extern void _integer();
extern boolean _eq_integer();
extern boolean _ne_integer();
extern integer _cond_integer();
extern char* _integer_to_text();
extern int _check_integer();
extern void _text_to_integer();
extern void _string();
extern boolean _eq_string();
extern boolean _ne_string();
extern string _cond_string();
extern char* _string_to_text();
extern int _check_string();
extern void _text_to_string();
extern void _float();
extern boolean _eq_float();
extern boolean _ne_float();
extern float _cond_float();
extern char* _float_to_text();
extern int _check_float();
extern void _text_to_float();
extern void _double();
extern boolean _eq_double();
extern boolean _ne_double();
extern double _cond_double();
extern char* _double_to_text();
extern int _check_double();
extern void _text_to_double();
extern void _symbolic();
extern boolean _eq_symbolic();
extern boolean _ne_symbolic();
extern symbolic _cond_symbolic();
extern char* _symbolic_to_text();
extern int _check_symbolic();
extern void _text_to_symbolic();
extern char* __PredefinedTypeToText();
#define _true 1
#define _false 0
#define __LINK_GENERIC_TEST(TEST) return TEST;
typedef (*__LINK_APF)();
extern __LINK_APF *__LINK_PActionArray;
extern int **__LINK_PCheckArray;
struct __SourcePoint {
int linkback;
int line;
int column;
int instance_index;
};
struct __InstanceEntry {
char *module_name;
int father_index;
char *dir_name;
char *file_name;
struct __SourcePoint source_point;
struct __SourcePoint end_point;
struct __SourcePoint instance_point;
};
struct __TaskEntry {
char *name;
int   nb_args_ref;
int   nb_args_val;
int  *type_codes_array;
struct __SourcePoint source_point;
};
struct __SignalEntry {
char *name;
int code;
int variable_index;
int present;
struct __SourcePoint source_point;
};
struct __InputEntry {
char *name;
int hash;
char *type_name;
int is_a_sensor;
int type_code;
int multiple;
int signal_index;
int (*p_check_input)();
int (*p_input_function)();
int present;
struct __SourcePoint source_point;
};
struct __ReturnEntry {
char *name;
int hash;
char *type_name;
int type_code;
int signal_index;
int exec_index;
int (*p_check_input)();
int (*p_input_function)();
int present;
struct __SourcePoint source_point;
};
struct __ImplicationEntry {
int master;
int slave;
struct __SourcePoint source_point;
};
struct __ExclusionEntry {
int *exclusion_list;
struct __SourcePoint source_point;
};
struct __VariableEntry {
char *full_name;
char *short_name;
char *type_name;
int type_code;
int comment_kind;
int is_initialized;
char *p_variable;
char *source_name;
int written;
unsigned char written_in_transition;
unsigned char read_in_transition;
struct __SourcePoint source_point;
};
struct __ExecEntry {
int task_index;
int *var_indexes_array;
char **p_values_array;
struct __SourcePoint source_point;
};
struct __HaltEntry {
struct __SourcePoint source_point;
};
struct __NetEntry {
int known;
int value;
int number_of_source_points;
struct __SourcePoint* source_point_array;
};
struct __ModuleEntry {
char *version_id;
char *name;
int number_of_instances;
int number_of_tasks;
int number_of_signals;
int number_of_inputs;
int number_of_returns;
int number_of_sensors;
int number_of_outputs;
int number_of_locals;
int number_of_exceptions;
int number_of_implications;
int number_of_exclusions;
int number_of_variables;
int number_of_execs;
int number_of_halts;
int number_of_nets;
int number_of_states;
int state;
unsigned short *halt_list;
unsigned short *awaited_list;
unsigned short *emitted_list;
unsigned short *started_list;
unsigned short *killed_list;
unsigned short *suspended_list;
unsigned short *active_list;
int run_time_error_code;
int error_info;
int (*init)();
int (*run)();
int (*reset)();
char *(*show_variable)();
int (*set_variable)();
int (*check_value)();
int (*execute_action)();
struct __InstanceEntry* instance_table;
struct __TaskEntry* task_table;
struct __SignalEntry* signal_table;
struct __InputEntry* input_table;
struct __ReturnEntry* return_table;
struct __ImplicationEntry* implication_table;
struct __ExclusionEntry* exclusion_table;
struct __VariableEntry* variable_table;
struct __ExecEntry* exec_table;
struct __HaltEntry* halt_table;
struct __NetEntry* net_table;
};

                  
/* EXTERN DECLARATIONS */

extern int __CheckVariables();
extern __ResetInput();
extern __ResetExecs();
extern __ResetVariables();
extern __ResetVariableStatus();
extern __AppendToList();
extern __ListCopy();
#ifndef _NO_EXTERN_DEFINITIONS
#endif

/* INITIALIZED CONSTANTS */

/* MEMORY ALLOCATION */

static boolean __LINK_V0;
static boolean __LINK_V1;
static integer __LINK_V2;
static boolean __LINK_V3;
static integer __LINK_V4;
static integer __LINK_V5;
static integer __LINK_V6;
static integer __LINK_V7;
static integer __LINK_V8;
static integer __LINK_V9;
static integer __LINK_V10;

static unsigned short __LINK_HaltList[25];
static unsigned short __LINK_AwaitedList[20];
static unsigned short __LINK_EmittedList[20];
static unsigned short __LINK_StartedList[1];
static unsigned short __LINK_KilledList[1];
static unsigned short __LINK_SuspendedList[1];
static unsigned short __LINK_ActiveList[1];
static unsigned short __LINK_AllAwaitedList[20]={3,0,1,2};


/* INPUT FUNCTIONS */

LINK_I_TRIGGER_CH1 () {
__LINK_V0 = _true;
}
LINK_IS_TRIGGER_CH1 () {
__LINK_V0 = _true;
}
LINK_I_TRIGGER_CH2 () {
__LINK_V1 = _true;
}
LINK_IS_TRIGGER_CH2 () {
__LINK_V1 = _true;
}
LINK_I_user (__V) integer __V; {
__WriteVariable(2);
__LINK_V2 = __V;
__LINK_V3 = _true;
}
LINK_IS_user (__V) string __V; {
__WriteVariable(2);
_text_to_integer(&__LINK_V2,__V);
__LINK_V3 = _true;
}

/* FUNCTIONS RETURNING NUMBER OF EXEC */

int LINK_number_of_execs () {
return (0);
}


/* AUTOMATON (STATE ACTION-TREES) */

/* ACTIONS */

/* PREDEFINED ACTIONS */

/* PRESENT SIGNAL TESTS */

static int __LINK_A1 () {
__LINK_GENERIC_TEST(__LINK_V0);
}
static int __LINK_Check1 [] = {1,0,0};
static int __LINK_A2 () {
__LINK_GENERIC_TEST(__LINK_V1);
}
static int __LINK_Check2 [] = {1,0,0};
static int __LINK_A3 () {
__LINK_GENERIC_TEST(__LINK_V3);
}
static int __LINK_Check3 [] = {1,0,0};

/* OUTPUT ACTIONS */

static int __LINK_A4 () {
#ifdef __OUTPUT
LINK_O_PROC_CH1(__LINK_V4);
#endif
__AppendToList(__LINK_EmittedList,3);
return 0;
}
static int __LINK_Check4 [] = {1,0,0};
static int __LINK_A5 () {
#ifdef __OUTPUT
LINK_O_PROC_CH2(__LINK_V5);
#endif
__AppendToList(__LINK_EmittedList,4);
return 0;
}
static int __LINK_Check5 [] = {1,0,0};
static int __LINK_A6 () {
#ifdef __OUTPUT
LINK_O_out(__LINK_V6);
#endif
__AppendToList(__LINK_EmittedList,5);
return 0;
}
static int __LINK_Check6 [] = {1,0,0};

/* ASSIGNMENTS */

static int __LINK_A7 () {
__LINK_V9 = __LINK_V2;
return 0;
}
static int __LINK_Check7 [] = {1,1,2,1,9};
static int __LINK_A8 () {
__LINK_V7 = __LINK_V9;
return 0;
}
static int __LINK_Check8 [] = {1,1,9,1,7};
static int __LINK_A9 () {
__LINK_V6 = __LINK_V5;
return 0;
}
static int __LINK_Check9 [] = {1,1,5,1,6};
static int __LINK_A10 () {
__LINK_V10 = __LINK_V4;
return 0;
}
static int __LINK_Check10 [] = {1,1,4,1,10};
static int __LINK_A11 () {
__LINK_V8 = __LINK_V10;
return 0;
}
static int __LINK_Check11 [] = {1,1,10,1,8};
static int __LINK_A12 () {
__LINK_V4 = __LINK_V7;
return 0;
}
static int __LINK_Check12 [] = {1,1,7,1,4};
static int __LINK_A13 () {
__LINK_V5 = __LINK_V8;
return 0;
}
static int __LINK_Check13 [] = {1,1,8,1,5};

/* PROCEDURE CALLS */

/* CONDITIONS */

/* DECREMENTS */

/* START ACTIONS */

/* KILL ACTIONS */

/* SUSPEND ACTIONS */

/* ACTIVATE ACTIONS */

/* WRITE ARGS ACTIONS */

/* RESET ACTIONS */

static int __LINK_A14 () {
;
__ResetVariable(7);
return 0;
}
static int __LINK_Check14 [] = {1,0,0};
static int __LINK_A15 () {
;
__ResetVariable(8);
return 0;
}
static int __LINK_Check15 [] = {1,0,0};
static int __LINK_A16 () {
;
__ResetVariable(9);
return 0;
}
static int __LINK_Check16 [] = {1,0,0};
static int __LINK_A17 () {
;
__ResetVariable(10);
return 0;
}
static int __LINK_Check17 [] = {1,0,0};

/* ACTION SEQUENCES */


static int *__LINK_CheckArray[] = {
0,__LINK_Check1,__LINK_Check2,__LINK_Check3,__LINK_Check4,__LINK_Check5,__LINK_Check6,__LINK_Check7,__LINK_Check8,__LINK_Check9,__LINK_Check10,__LINK_Check11,__LINK_Check12,__LINK_Check13,__LINK_Check14,__LINK_Check15,__LINK_Check16,__LINK_Check17
};
static int **__LINK_PCheckArray =  __LINK_CheckArray;

/* INIT FUNCTION */

#ifndef NO_INIT
LINK_initialize () {
}
#endif

/* SHOW VARIABLE FUNCTION */

char* __LINK_show_variable (__V) int __V; {
extern struct __VariableEntry __LINK_VariableTable[];
struct __VariableEntry* p_var = &__LINK_VariableTable[__V];
if (p_var->type_code < 0) {return __PredefinedTypeToText(p_var->type_code, p_var->p_variable);
} else {
switch (p_var->type_code) {
default: return 0;
}
}
}

/* SET VARIABLE FUNCTION */

static __LINK_set_variable(__Type, __pVar, __Text)
int __Type; char* __pVar; char* __Text; {
}

/* CHECK VALUE FUNCTION */

static int __LINK_check_value (__Type,__Text) 
int __Type; char* __Text; {
}

/* SIMULATION TABLES */

struct __InstanceEntry __LINK_InstanceTable [] = {
{"LINK",0,"","prod-cons.strl",{1,64,1,0},{1,86,1,0},{0,0,0,0}},
{"Producer",0,"","prod-cons.strl",{1,1,1,1},{1,19,1,1},{1,77,6,0}},
{"Consumer",0,"","prod-cons.strl",{1,22,1,2},{1,33,1,2},{1,79,6,0}},
{"Buffer",0,"","prod-cons.strl",{1,36,1,3},{1,58,1,3},{1,81,6,0}},
{"Scheduler",0,"","sched.strl",{1,4,1,4},{1,35,1,4},{1,83,6,0}},
{"ONE_SCHEDULER",4,"","sched.strl",{1,42,1,5},{1,92,1,5},{1,23,6,4}},
{"ONE_SCHEDULER",4,"","sched.strl",{1,42,1,6},{1,92,1,6},{1,28,6,4}},
};

struct __SignalEntry __LINK_SignalTable [] = {
{"TRIGGER_CH1",33,0,0,{1,66,8,0}},
{"TRIGGER_CH2",33,0,0,{1,66,21,0}},
{"user",1,2,0,{1,66,34,0}},
{"PROC_CH1",2,4,0,{1,71,8,0}},
{"PROC_CH2",2,5,0,{1,71,33,0}},
{"out",2,6,0,{1,71,52,0}},
{"READY_CH1plus",8,7,0,{1,74,2,0}},
{"READY_CH1minus",40,0,0,{1,74,27,0}},
{"READY_CH2plus",8,8,0,{1,75,2,0}},
{"READY_CH2minus",40,0,0,{1,75,27,0}},
{"SEL1",40,0,0,{1,21,8,4}},
{"SEL2",40,0,0,{1,21,14,4}},
{"SEL3",40,0,0,{1,21,20,4}},
{"LREADYi",40,0,0,{1,49,8,5}},
{"LREADYj",40,0,0,{1,49,17,5}},
{"T",48,0,0,{1,51,11,5}},
{"LREADYi",40,0,0,{1,49,8,6}},
{"LREADYj",40,0,0,{1,49,17,6}},
{"T",48,0,0,{1,51,11,6}}};

struct __InputEntry __LINK_InputTable [] = {
{"TRIGGER_CH1",7,0,0,-1,0,0,0,LINK_IS_TRIGGER_CH1,0,{1,66,8,0}},
{"TRIGGER_CH2",8,0,0,-1,0,1,0,LINK_IS_TRIGGER_CH2,0,{1,66,21,0}},
{"user",43,"integer",0,-3,0,2,_check_integer,LINK_IS_user,0,{1,66,34,0}}};

struct __VariableEntry __LINK_VariableTable [] = {
{"__LINK_V0","V0","boolean",-2,2,0,(char*)&__LINK_V0,"TRIGGER_CH1",0,0,0,{1,66,8,0}},
{"__LINK_V1","V1","boolean",-2,2,0,(char*)&__LINK_V1,"TRIGGER_CH2",0,0,0,{1,66,21,0}},
{"__LINK_V2","V2","integer",-3,1,0,(char*)&__LINK_V2,"user",0,0,0,{1,66,34,0}},
{"__LINK_V3","V3","boolean",-2,2,0,(char*)&__LINK_V3,"user",0,0,0,{1,66,34,0}},
{"__LINK_V4","V4","integer",-3,1,0,(char*)&__LINK_V4,"PROC_CH1",0,0,0,{1,71,8,0}},
{"__LINK_V5","V5","integer",-3,1,0,(char*)&__LINK_V5,"PROC_CH2",0,0,0,{1,71,33,0}},
{"__LINK_V6","V6","integer",-3,1,0,(char*)&__LINK_V6,"out",0,0,0,{1,71,52,0}},
{"__LINK_V7","V7","integer",-3,1,0,(char*)&__LINK_V7,"READY_CH1plus",0,0,0,{1,74,2,0}},
{"__LINK_V8","V8","integer",-3,1,0,(char*)&__LINK_V8,"READY_CH2plus",0,0,0,{1,75,2,0}},
{"__LINK_V9","V9","integer",-3,0,0,(char*)&__LINK_V9,"X",0,0,0,{1,10,5,1}},
{"__LINK_V10","V10","integer",-3,0,0,(char*)&__LINK_V10,"X",0,0,0,{1,44,5,3}}
};

struct __HaltEntry __LINK_HaltTable [] = {
{{1,86,1,0}},
{{1,12,4,1}},
{{1,14,7,1}},
{{1,29,6,2}},
{{1,46,4,3}},
{{1,49,4,3}},
{{1,53,8,5}},
{{1,55,11,5}},
{{1,57,7,5}},
{{1,58,7,5}},
{{1,63,7,5}},
{{1,76,3,5}},
{{1,77,3,5}},
{{1,85,3,5}},
{{1,86,3,5}},
{{1,53,8,6}},
{{1,55,11,6}},
{{1,57,7,6}},
{{1,58,7,6}},
{{1,63,7,6}},
{{1,76,3,6}},
{{1,77,3,6}},
{{1,85,3,6}},
{{1,86,3,6}}
};


static __LINK__reset_input () {
__LINK_V0 = _false;
__LINK_V1 = _false;
__LINK_V3 = _false;
}


/* MODULE DATA FOR SIMULATION */

int LINK();
int LINK_reset();

static struct __ModuleEntry __LINK_ModuleData = {
"Simulation interface release 4","LINK",
7,0,19,3,0,0,3,11,2,0,0,11,0,24,0,0,0,
__LINK_HaltList,
__LINK_AwaitedList,
__LINK_EmittedList,
__LINK_StartedList,
__LINK_KilledList,
__LINK_SuspendedList,
__LINK_ActiveList,
0,0,
LINK_initialize,LINK,LINK_reset,
__LINK_show_variable,__LINK_set_variable,__LINK_check_value,0,
__LINK_InstanceTable,
0,
__LINK_SignalTable,__LINK_InputTable,0,
0,0,
__LINK_VariableTable,
0,
__LINK_HaltTable,
0};

/* REDEFINABLE BIT TYPE */

#ifndef __SSC_BIT_TYPE_DEFINED
typedef char __SSC_BIT_TYPE;
#endif

/* REGISTER VARIABLES */

static __SSC_BIT_TYPE __LINK_R[24] = {_true,_false,_false,_false,_false,_false,_false,_false,_false,_false,_false,_false,_false,_false,_false,_false,_false,_false,_false,_false,_false,_false,_false,_false};

/* AUTOMATON ENGINE */

int LINK () {
/* AUXILIARY VARIABLES */

static __SSC_BIT_TYPE E[70];

__LINK_ModuleData.awaited_list = __LINK_AwaitedList;
__ResetModuleEntryBeforeReaction();
E[0] = (__CheckVariables(__LINK_CheckArray[3]),
#ifdef TRACE_ACTION
fprintf(stderr, "test 3\n"),
#endif
__LINK_A3());
E[1] = (__CheckVariables(__LINK_CheckArray[2]),
#ifdef TRACE_ACTION
fprintf(stderr, "test 2\n"),
#endif
__LINK_A2());
E[2] = (__CheckVariables(__LINK_CheckArray[1]),
#ifdef TRACE_ACTION
fprintf(stderr, "test 1\n"),
#endif
__LINK_A1());
E[3] = (((__LINK_R[17]&&(__CheckVariables(__LINK_CheckArray[2]),
#ifdef TRACE_ACTION
fprintf(stderr, "test 2\n"),
#endif
__LINK_A2())))||(((__CheckVariables(__LINK_CheckArray[2]),
#ifdef TRACE_ACTION
fprintf(stderr, "test 2\n"),
#endif
__LINK_A2())&&__LINK_R[18])));
E[4] = E[3];
if (E[4]) {
__AppendToList(__LINK_EmittedList,12);
}
E[5] = (((__LINK_R[8]&&(__CheckVariables(__LINK_CheckArray[1]),
#ifdef TRACE_ACTION
fprintf(stderr, "test 1\n"),
#endif
__LINK_A1())))||(((__CheckVariables(__LINK_CheckArray[1]),
#ifdef TRACE_ACTION
fprintf(stderr, "test 1\n"),
#endif
__LINK_A1())&&__LINK_R[9])));
E[6] = (E[3]||E[5]);
E[7] = (__LINK_R[19]&&E[6]);
E[8] = (__LINK_R[19]&&!(E[6]));
E[9] = (E[8]&&E[3]);
E[10] = (E[7]||E[9]);
E[11] = E[10];
if (E[11]) {
__AppendToList(__LINK_EmittedList,18);
}
E[12] = E[6];
if (E[12]) {
__AppendToList(__LINK_EmittedList,11);
}
E[13] = (__LINK_R[10]&&E[5]);
E[14] = (__LINK_R[10]&&!(E[5]));
E[15] = (E[14]&&E[6]);
E[16] = (E[13]||E[15]);
E[17] = E[16];
if (E[17]) {
__AppendToList(__LINK_EmittedList,15);
}
E[18] = E[5];
if (E[18]) {
__AppendToList(__LINK_EmittedList,10);
}
if ((__LINK_R[0])) {
__CheckVariables(__LINK_CheckArray[14]);__LINK_A14();
#ifdef TRACE_ACTION
fprintf(stderr, "__abc_A14\n");
#endif
}
if ((__LINK_R[0])) {
__CheckVariables(__LINK_CheckArray[15]);__LINK_A15();
#ifdef TRACE_ACTION
fprintf(stderr, "__abc_A15\n");
#endif
}
E[19] = (((__LINK_R[5]&&E[3]))||__LINK_R[0]);
if ((E[19])) {
__CheckVariables(__LINK_CheckArray[17]);__LINK_A17();
#ifdef TRACE_ACTION
fprintf(stderr, "__abc_A17\n");
#endif
}
E[20] = (((((__LINK_R[4]&&!(E[5])))&&__LINK_R[4]))||E[19]);
E[21] = (__LINK_R[14]||__LINK_R[13]);
E[22] = (E[21]&&!(E[6]));
E[23] = (E[22]&&__LINK_R[13]);
E[24] = (((E[21]&&E[6]))||__LINK_R[0]);
E[22] = ((((E[22]&&__LINK_R[14]))||((E[24]&&E[20])))||((E[23]&&E[20])));
E[25] = E[22];
if (E[25]) {
__AppendToList(__LINK_EmittedList,14);
}
E[26] = E[20];
if (E[26]) {
__AppendToList(__LINK_EmittedList,7);
}
E[27] = (__LINK_R[1]&&(__CheckVariables(__LINK_CheckArray[3]),
#ifdef TRACE_ACTION
fprintf(stderr, "test 3\n"),
#endif
__LINK_A3()));
if ((E[27])) {
__CheckVariables(__LINK_CheckArray[7]);__LINK_A7();
#ifdef TRACE_ACTION
fprintf(stderr, "__abc_A7\n");
#endif
}
E[28] = (E[27]||((((__LINK_R[2]&&!(E[5])))&&__LINK_R[2])));
if ((E[28])) {
__CheckVariables(__LINK_CheckArray[8]);__LINK_A8();
#ifdef TRACE_ACTION
fprintf(stderr, "__abc_A8\n");
#endif
}
if ((E[5])) {
__CheckVariables(__LINK_CheckArray[12]);__LINK_A12();
#ifdef TRACE_ACTION
fprintf(stderr, "__abc_A12\n");
#endif
}
E[29] = E[5];
if (E[29]) {
__AppendToList(__LINK_EmittedList,3);
}
if ((E[5])) {
__CheckVariables(__LINK_CheckArray[4]);__LINK_A4();
#ifdef TRACE_ACTION
fprintf(stderr, "__abc_A4\n");
#endif
}
E[30] = (__LINK_R[4]&&E[5]);
if ((E[30])) {
__CheckVariables(__LINK_CheckArray[10]);__LINK_A10();
#ifdef TRACE_ACTION
fprintf(stderr, "__abc_A10\n");
#endif
}
E[31] = (((((__LINK_R[5]&&!(E[3])))&&__LINK_R[5]))||E[30]);
if ((E[31])) {
__CheckVariables(__LINK_CheckArray[11]);__LINK_A11();
#ifdef TRACE_ACTION
fprintf(stderr, "__abc_A11\n");
#endif
}
if ((E[3])) {
__CheckVariables(__LINK_CheckArray[13]);__LINK_A13();
#ifdef TRACE_ACTION
fprintf(stderr, "__abc_A13\n");
#endif
}
E[32] = E[3];
if (E[32]) {
__AppendToList(__LINK_EmittedList,4);
}
if ((E[3])) {
__CheckVariables(__LINK_CheckArray[5]);__LINK_A5();
#ifdef TRACE_ACTION
fprintf(stderr, "__abc_A5\n");
#endif
}
E[33] = (__LINK_R[3]&&E[3]);
if ((E[33])) {
__CheckVariables(__LINK_CheckArray[9]);__LINK_A9();
#ifdef TRACE_ACTION
fprintf(stderr, "__abc_A9\n");
#endif
}
E[34] = E[33];
if (E[34]) {
__AppendToList(__LINK_EmittedList,5);
}
if ((E[33])) {
__CheckVariables(__LINK_CheckArray[6]);__LINK_A6();
#ifdef TRACE_ACTION
fprintf(stderr, "__abc_A6\n");
#endif
}
E[35] = ((__LINK_R[0]||((((__LINK_R[3]&&!(E[3])))&&__LINK_R[3])))||E[33]);
E[36] = (__LINK_R[23]||__LINK_R[22]);
E[37] = (E[36]&&!(E[3]));
E[38] = (E[37]&&__LINK_R[22]);
E[39] = (((E[36]&&E[3]))||__LINK_R[0]);
E[37] = ((((E[37]&&__LINK_R[23]))||((E[39]&&E[35])))||((E[38]&&E[35])));
E[40] = E[37];
if (E[40]) {
__AppendToList(__LINK_EmittedList,17);
}
E[41] = E[35];
if (E[41]) {
__AppendToList(__LINK_EmittedList,9);
}
E[42] = (__LINK_R[21]||__LINK_R[20]);
E[43] = (E[42]&&!(E[6]));
E[44] = (E[43]&&__LINK_R[20]);
E[45] = (((E[42]&&E[6]))||__LINK_R[0]);
E[43] = ((((E[43]&&__LINK_R[21]))||((E[45]&&E[31])))||((E[44]&&E[31])));
E[46] = E[43];
if (E[46]) {
__AppendToList(__LINK_EmittedList,16);
}
E[47] = E[31];
if (E[47]) {
__AppendToList(__LINK_EmittedList,8);
}
E[48] = (__LINK_R[12]||__LINK_R[11]);
E[49] = (E[48]&&!(E[5]));
E[50] = (E[49]&&__LINK_R[11]);
E[51] = (((E[48]&&E[5]))||__LINK_R[0]);
E[49] = ((((E[49]&&__LINK_R[12]))||((E[51]&&E[28])))||((E[50]&&E[28])));
E[52] = E[49];
if (E[52]) {
__AppendToList(__LINK_EmittedList,13);
}
E[53] = E[28];
if (E[53]) {
__AppendToList(__LINK_EmittedList,6);
}
E[54] = _false;
if ((__LINK_R[0])) {
__CheckVariables(__LINK_CheckArray[16]);__LINK_A16();
#ifdef TRACE_ACTION
fprintf(stderr, "__abc_A16\n");
#endif
}
E[55] = (((__LINK_R[6]&&!(E[49])))&&__LINK_R[6]);
E[56] = (((__LINK_R[7]&&!(E[22])))&&__LINK_R[7]);
E[57] = (__LINK_R[6]||__LINK_R[7]);
E[58] = (__LINK_R[6]&&E[49]);
E[59] = (((E[57]&&!(__LINK_R[6])))||E[58]);
E[60] = (__LINK_R[7]&&E[22]);
E[61] = (((E[57]&&!(__LINK_R[7])))||E[60]);
E[62] = ((((E[59]||E[55]))&&((E[61]||E[56])))&&((E[55]||E[56])));
E[61] = ((((E[58]||E[60]))&&E[59])&&E[61]);
E[57] = ((E[57]||__LINK_R[8])||__LINK_R[9]);
E[59] = (__LINK_R[10]||E[57]);
E[60] = (((__LINK_R[8]&&!((__CheckVariables(__LINK_CheckArray[1]),
#ifdef TRACE_ACTION
fprintf(stderr, "test 1\n"),
#endif
__LINK_A1()))))||((((!((__CheckVariables(__LINK_CheckArray[1]),
#ifdef TRACE_ACTION
fprintf(stderr, "test 1\n"),
#endif
__LINK_A1()))&&__LINK_R[9]))&&__LINK_R[9])));
E[57] = (((E[60]||((((E[59]&&!(E[57])))||E[5])))||E[61])||E[62]);
E[6] = (((E[14]&&!(E[6])))&&__LINK_R[10]);
E[14] = (((E[59]&&!(__LINK_R[10])))||E[6]);
E[15] = ((E[16]&&(((E[13]||E[15])||E[14])))&&E[57]);
E[13] = (E[15]||__LINK_R[0]);
E[16] = (E[13]&&E[49]);
E[58] = (E[13]&&E[22]);
E[63] = ((((E[58]||E[16]))&&E[58])&&E[16]);
E[64] = (E[13]&&!(E[49]));
E[65] = (E[13]&&!(E[22]));
E[16] = ((((E[65]||E[58]))&&((E[64]||E[16])))&&((E[65]||E[64])));
E[16] = ((((E[16]||E[63]))&&(((E[16]||E[63])||E[13])))&&E[13]);
E[57] = ((((((E[6]||E[60])||E[61])||E[62]))&&E[14])&&E[57]);
E[23] = (((E[24]&&!(E[20])))||((((E[23]&&!(E[20])))&&__LINK_R[13])));
E[50] = (((E[51]&&!(E[28])))||((((E[50]&&!(E[28])))&&__LINK_R[11])));
E[51] = ((E[59]||E[48])||E[21]);
E[16] = ((((((((E[51]&&!(E[48])))||E[50])||E[49]))&&(((((E[51]&&!(E[21])))||E[23])||E[22])))&&(((((E[51]&&!(E[59])))||E[57])||E[16])))&&((((((E[50]||E[23])||E[57])||E[16])||E[49])||E[22])));
E[57] = (((__LINK_R[15]&&!(E[43])))&&__LINK_R[15]);
E[59] = (((__LINK_R[16]&&!(E[37])))&&__LINK_R[16]);
E[21] = (__LINK_R[15]||__LINK_R[16]);
E[48] = (__LINK_R[15]&&E[43]);
E[24] = (((E[21]&&!(__LINK_R[15])))||E[48]);
E[14] = (__LINK_R[16]&&E[37]);
E[62] = (((E[21]&&!(__LINK_R[16])))||E[14]);
E[58] = ((((E[24]||E[57]))&&((E[62]||E[59])))&&((E[57]||E[59])));
E[62] = ((((E[48]||E[14]))&&E[24])&&E[62]);
E[21] = ((E[21]||__LINK_R[17])||__LINK_R[18]);
E[24] = (__LINK_R[19]||E[21]);
E[14] = (((__LINK_R[17]&&!((__CheckVariables(__LINK_CheckArray[2]),
#ifdef TRACE_ACTION
fprintf(stderr, "test 2\n"),
#endif
__LINK_A2()))))||((((!((__CheckVariables(__LINK_CheckArray[2]),
#ifdef TRACE_ACTION
fprintf(stderr, "test 2\n"),
#endif
__LINK_A2()))&&__LINK_R[18]))&&__LINK_R[18])));
E[21] = (((E[14]||((((E[24]&&!(E[21])))||E[3])))||E[62])||E[58]);
E[8] = (((E[8]&&!(E[3])))&&__LINK_R[19]);
E[48] = (((E[24]&&!(__LINK_R[19])))||E[8]);
E[9] = ((E[10]&&(((E[7]||E[9])||E[48])))&&E[21]);
E[7] = (E[9]||__LINK_R[0]);
E[10] = (E[7]&&E[43]);
E[66] = (E[7]&&E[37]);
E[67] = ((((E[66]||E[10]))&&E[66])&&E[10]);
E[68] = (E[7]&&!(E[43]));
E[69] = (E[7]&&!(E[37]));
E[10] = ((((E[69]||E[66]))&&((E[68]||E[10])))&&((E[69]||E[68])));
E[10] = ((((E[10]||E[67]))&&(((E[10]||E[67])||E[7])))&&E[7]);
E[21] = ((((((E[8]||E[14])||E[62])||E[58]))&&E[48])&&E[21]);
E[38] = (((E[39]&&!(E[35])))||((((E[38]&&!(E[35])))&&__LINK_R[22])));
E[44] = (((E[45]&&!(E[31])))||((((E[44]&&!(E[31])))&&__LINK_R[20])));
E[45] = ((E[24]||E[42])||E[36]);
E[10] = ((((((((E[45]&&!(E[42])))||E[44])||E[43]))&&(((((E[45]&&!(E[36])))||E[38])||E[37])))&&(((((E[45]&&!(E[24])))||E[21])||E[10])))&&((((((E[44]||E[38])||E[21])||E[10])||E[43])||E[37])));
E[21] = (E[51]||E[45]);
E[10] = ((((((E[21]&&!(E[51])))||E[16]))&&((((E[21]&&!(E[45])))||E[10])))&&((E[16]||E[10])));
E[16] = ((((((__LINK_R[1]&&!((__CheckVariables(__LINK_CheckArray[3]),
#ifdef TRACE_ACTION
fprintf(stderr, "test 3\n"),
#endif
__LINK_A3()))))&&__LINK_R[1]))||((__LINK_R[2]&&E[5])))||__LINK_R[0]);
E[45] = (__LINK_R[1]||__LINK_R[2]);
E[51] = (__LINK_R[5]||__LINK_R[4]);
E[24] = (((E[51]||E[45])||E[21])||__LINK_R[3]);
E[10] = ((((((((((E[24]&&!(E[45])))||E[16])||E[28]))&&(((((E[24]&&!(E[51])))||E[20])||E[31])))&&((((E[24]&&!(__LINK_R[3])))||E[35])))&&((((E[24]&&!(E[21])))||E[10])))&&((((((E[16]||E[10])||E[20])||E[35])||E[31])||E[28]))));
E[21] = (_false);
__LINK_R[1] = (E[16]);
__LINK_R[2] = (E[28]);
__LINK_R[3] = (E[35]);
__LINK_R[4] = (E[20]);
__LINK_R[5] = (E[31]);
__LINK_R[6] = (((E[64]||((!(E[15])&&E[55])))));
__LINK_R[7] = (((E[65]||((!(E[15])&&E[56])))));
__LINK_R[8] = (((E[63]||((!(E[15])&&E[61])))));
__LINK_R[9] = (((!(E[15])&&E[60])));
__LINK_R[10] = (((E[13]||((!(E[15])&&E[6])))));
__LINK_R[11] = (E[50]);
__LINK_R[12] = (E[49]);
__LINK_R[13] = (E[23]);
__LINK_R[14] = (E[22]);
__LINK_R[15] = (((E[68]||((!(E[9])&&E[57])))));
__LINK_R[16] = (((E[69]||((!(E[9])&&E[59])))));
__LINK_R[17] = (((E[67]||((!(E[9])&&E[62])))));
__LINK_R[18] = (((!(E[9])&&E[14])));
__LINK_R[19] = (((E[7]||((!(E[9])&&E[8])))));
__LINK_R[20] = (E[44]);
__LINK_R[21] = (E[43]);
__LINK_R[22] = (E[38]);
__LINK_R[23] = (E[37]);
__LINK_R[0] = E[21];
if (__LINK_R[1]) { __AppendToList(__LINK_HaltList,1); }
if (__LINK_R[2]) { __AppendToList(__LINK_HaltList,2); }
if (__LINK_R[3]) { __AppendToList(__LINK_HaltList,3); }
if (__LINK_R[4]) { __AppendToList(__LINK_HaltList,4); }
if (__LINK_R[5]) { __AppendToList(__LINK_HaltList,5); }
if (__LINK_R[6]) { __AppendToList(__LINK_HaltList,6); }
if (__LINK_R[7]) { __AppendToList(__LINK_HaltList,7); }
if (__LINK_R[8]) { __AppendToList(__LINK_HaltList,8); }
if (__LINK_R[9]) { __AppendToList(__LINK_HaltList,9); }
if (__LINK_R[10]) { __AppendToList(__LINK_HaltList,10); }
if (__LINK_R[11]) { __AppendToList(__LINK_HaltList,11); }
if (__LINK_R[12]) { __AppendToList(__LINK_HaltList,12); }
if (__LINK_R[13]) { __AppendToList(__LINK_HaltList,13); }
if (__LINK_R[14]) { __AppendToList(__LINK_HaltList,14); }
if (__LINK_R[15]) { __AppendToList(__LINK_HaltList,15); }
if (__LINK_R[16]) { __AppendToList(__LINK_HaltList,16); }
if (__LINK_R[17]) { __AppendToList(__LINK_HaltList,17); }
if (__LINK_R[18]) { __AppendToList(__LINK_HaltList,18); }
if (__LINK_R[19]) { __AppendToList(__LINK_HaltList,19); }
if (__LINK_R[20]) { __AppendToList(__LINK_HaltList,20); }
if (__LINK_R[21]) { __AppendToList(__LINK_HaltList,21); }
if (__LINK_R[22]) { __AppendToList(__LINK_HaltList,22); }
if (__LINK_R[23]) { __AppendToList(__LINK_HaltList,23); }
if (!E[10]) { __AppendToList(__LINK_HaltList,0); }
__ResetModuleEntryAfterReaction();
__LINK_ModuleData.awaited_list = __LINK_AllAwaitedList;
__LINK__reset_input();
return E[10];
}

/* AUTOMATON RESET */

int LINK_reset () {
__LINK_ModuleData.awaited_list = __LINK_AwaitedList;
__ResetModuleEntry();
__LINK_ModuleData.awaited_list = __LINK_AllAwaitedList;
__LINK_ModuleData.state = 0;
__LINK_R[0] = _true;
__LINK_R[1] = _false;
__LINK_R[2] = _false;
__LINK_R[3] = _false;
__LINK_R[4] = _false;
__LINK_R[5] = _false;
__LINK_R[6] = _false;
__LINK_R[7] = _false;
__LINK_R[8] = _false;
__LINK_R[9] = _false;
__LINK_R[10] = _false;
__LINK_R[11] = _false;
__LINK_R[12] = _false;
__LINK_R[13] = _false;
__LINK_R[14] = _false;
__LINK_R[15] = _false;
__LINK_R[16] = _false;
__LINK_R[17] = _false;
__LINK_R[18] = _false;
__LINK_R[19] = _false;
__LINK_R[20] = _false;
__LINK_R[21] = _false;
__LINK_R[22] = _false;
__LINK_R[23] = _false;
__LINK__reset_input();
return 0;
}
char* CompilationType = "Compiled Sorted Equations";

int __NumberOfModules = 1;
struct __ModuleEntry* __ModuleTable[] = {
&__LINK_ModuleData
};
