if (KjcOptions.decoupled) {
if (KjcOptions.decoupled || RawWorkEstimator.SIMULATING_WORK) {
    private static void joinerCode(FlatNode joiner) {        try {            FileWriter fw = new FileWriter("tile"                                           + layout.getTile(joiner).getTileNumber() + ".c");            fw.write("/* " + joiner.contents.getName() + "*/\n");            fw.write("#include <raw.h>\n");            fw.write("#include <math.h>\n\n");//            if (KjcOptions.altcodegen) {                fw.write(FlatIRToC.getNetRegsDecls());//            }            if (SpaceDynamicBackend.FILTER_DEBUG_MODE) {                fw.write("void static_send_print(");                fw.write(Util.getJoinerType(joiner) + " f) {\n");                if (Util.getJoinerType(joiner).isFloatingPoint())                    fw.write("print_float(f);\n");                else                    fw.write("print_int(f);\n");                fw.write("static_send(f);\n");                fw.write("}\n\n");            }            // if there are structures in the code, include            // the structure definition header files            // this must be included after the above declarations            // (of CSTO*, CSTI*)            fw.write("#include \"structs.h\"\n");            if (KjcOptions.decoupled) {                fw.write("float " + Util.CSTOFPVAR + ";\n");                fw.write("float " + Util.CSTIFPVAR + ";\n");                fw.write("int " + Util.CSTOINTVAR + ";\n");                fw.write("int " + Util.CSTIINTVAR + ";\n");            }            // write the extern for the function to init the            // switch, but there is no switch for the magic network            if (!KjcOptions.magic_net && !KjcOptions.decoupled) {                fw.write("void raw_init();\n\n");                fw.write("void " + SwitchCode.SW_SS_TRIPS + "();\n\n");            }            if (joiner.contents.getParent() instanceof SIRFeedbackLoop)                fw.write(createInitPath(joiner) + "\n");            fw.write(createJoinerWork(joiner));            fw.write("void begin(void) {\n");            if (!KjcOptions.magic_net) {                fw.write("  raw_init();\n");            } else                fw.write("  __asm__ volatile (\"magc $0, $0, 1\");\n");            // initialize the dummy network receive value            if (KjcOptions.decoupled) {                if (Util.getJoinerType(joiner).isFloatingPoint())                    fw.write("  " + Util.CSTIFPVAR + " = 1.0;\n");                else                    fw.write("  " + Util.CSTIINTVAR + " = 1;\n");            }            fw.write("  work();\n");            fw.write("}\n");            fw.close();            System.out.println("Code for " + joiner.contents.getName()                               + " written to tile"                               + layout.getTile(joiner).getTileNumber() + ".c");        } catch (Exception e) {            e.printStackTrace();            Utils.fail("Error writing switch code for tile "                       + layout.getTile(joiner).getTileNumber());        }    }