/* sscc : C CODE OF SORTED EQUATIONS Example3 - INLINE 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)();
void (*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 _true 1 
#define _false 0 
#define __Example3_GENERIC_TEST(TEST) return TEST; 
typedef void (*__Example3_APF)();
static __Example3_APF *__Example3_PActionArray;

#include "example3.h" 

/* EXTERN DECLARATIONS */

#ifndef _NO_EXTERN_DEFINITIONS 
#endif 

/* INITIALIZED CONSTANTS */

/* MEMORY ALLOCATION */

static boolean __Example3_V0;
static boolean __Example3_V1;
static boolean __Example3_V2;


/* INPUT FUNCTIONS */

void Example3_I_SW1_ASSERTED () {
__Example3_V0 = _true;
}
void Example3_I_SW2_ASSERTED () {
__Example3_V1 = _true;
}
void Example3_I_Second_Tick () {
__Example3_V2 = _true;
}

/* ACTIONS */

/* PREDEFINED ACTIONS */

/* PRESENT SIGNAL TESTS */

#define __Example3_A1 \ 
__Example3_V0
#define __Example3_A2 \ 
__Example3_V1
#define __Example3_A3 \ 
__Example3_V2

/* OUTPUT ACTIONS */

#define __Example3_A4 \ 
Example3_O_LED1_ASSERT()
#define __Example3_A5 \ 
Example3_O_LED2_TOGGLE()

/* ASSIGNMENTS */

#define __Example3_A6 \ 
__Example3_V0 = _false
#define __Example3_A7 \ 
__Example3_V1 = _false
#define __Example3_A8 \ 
__Example3_V2 = _false

/* PROCEDURE CALLS */

/* CONDITIONS */

/* DECREMENTS */

/* START ACTIONS */

/* KILL ACTIONS */

/* SUSPEND ACTIONS */

/* ACTIVATE ACTIONS */

/* WRITE ARGS ACTIONS */

/* RESET ACTIONS */

/* ACTION SEQUENCES */

/* FUNCTIONS RETURNING NUMBER OF EXEC */

int Example3_number_of_execs () {
return (0);
}


/* AUTOMATON (STATE ACTION-TREES) */



static void __Example3__reset_input () {
__Example3_V0 = _false;
__Example3_V1 = _false;
__Example3_V2 = _false;
}

/* REDEFINABLE BIT TYPE */

#ifndef __SSC_BIT_TYPE_DEFINED 
typedef char __SSC_BIT_TYPE;
#endif 

/* REGISTER VARIABLES */

static __SSC_BIT_TYPE __Example3_R[4] = {_true,
 _false,
 _false,
 _false};

/* AUTOMATON ENGINE */

int Example3 () {
/* AUXILIARY VARIABLES */

static __SSC_BIT_TYPE E[8];
E[0] = __Example3_R[2]&&!(__Example3_R[0]);
E[1] = E[0]&&(
#ifdef TRACE_ACTION 
fprintf(stderr, "test 2\n"),
#endif 
__Example3_A2);
if (E[1]) {
__Example3_A4;
#ifdef TRACE_ACTION 
fprintf(stderr, "__Example3_A4\n");
#endif 
}
E[2] = __Example3_R[3]&&!(__Example3_R[0]);
E[3] = E[2]&&(
#ifdef TRACE_ACTION 
fprintf(stderr, "test 3\n"),
#endif 
__Example3_A3);
if (E[3]) {
__Example3_A5;
#ifdef TRACE_ACTION 
fprintf(stderr, "__Example3_A5\n");
#endif 
}
E[4] = !(_true);
E[5] = __Example3_R[1]&&!(__Example3_R[0]);
E[6] = E[5]&&!((
#ifdef TRACE_ACTION 
fprintf(stderr, "test 1\n"),
#endif 
__Example3_A1));
E[6] = __Example3_R[0]||(__Example3_R[1]&&E[6]);
E[5] = E[5]&&(
#ifdef TRACE_ACTION 
fprintf(stderr, "test 1\n"),
#endif 
__Example3_A1);
E[0] = E[0]&&!((
#ifdef TRACE_ACTION 
fprintf(stderr, "test 2\n"),
#endif 
__Example3_A2));
E[0] = E[5]||(__Example3_R[2]&&E[0]);
E[2] = E[2]&&!((
#ifdef TRACE_ACTION 
fprintf(stderr, "test 3\n"),
#endif 
__Example3_A3));
E[2] = __Example3_R[0]||E[3]||(__Example3_R[3]&&E[2]);
E[5] = __Example3_R[1]||__Example3_R[2];
E[7] = E[5]||__Example3_R[3];
E[7] = (E[6]||E[0]||E[2])&&((E[7]&&!(E[5]))||E[1]||E[6]||E[0])&&((E[7]&&!(__Example3_R[3]))||E[2]);
__Example3_R[0] = !(_true);
__Example3_R[1] = E[6];
__Example3_R[2] = E[0];
__Example3_R[3] = E[2];
__Example3__reset_input();
return E[7];
}

/* AUTOMATON RESET */

int Example3_reset () {
__Example3_R[0] = _true;
__Example3_R[1] = _false;
__Example3_R[2] = _false;
__Example3_R[3] = _false;
__Example3__reset_input();
return 0;
}