/* -*- mode:c; compile-command:"gcc permute.c -I/usr/local/include/ick-0.28 -I. -I./../include -L/usr/local/lib -L. -L./../lib -O2 -o permute -lickmt" -*- */ /* permute.c -- generated C-code file for INTERCAL program permute.i */ /* This code is explicitly *not* GPLed. Use, abuse, and redistribute freely */ #include #include #include #include #define MULTITHREAD 1 #define OPOVERUSED 0 #include "fiddle.h" #include "abcess.h" #include "lose.h" #define ICKABSTAINED(d) ick_abstained[d] #define ICKSTASH(a,b,c,d) ick_stash(a, b, c+b, d) #define ICKRETRIEVE(a,b,c,d,e) ick_retrieve(a+b, c, b, d[b], e) #define ICKIGNORE(a,b,c) a[b] extern int ick_printflow; int ick_lineno; jmp_buf ick_cjb; int ick_ccfc; unsigned ick_skipto=0; char* ick_globalargv0; int ick_oldabstain; int ick_abstained[60] = {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, }; int ick_Base = 2; int ick_Small_digits = 16; int ick_Large_digits = 32; unsigned int ick_Max_small = 0xffff; unsigned int ick_Max_large = 0xffffffff; type16* ick_onespots; bool* ick_oneforget; int onespotcount = 3; overop* ick_oo_onespots=0; type32* ick_twospots; bool* ick_twoforget; int twospotcount = 1; overop* ick_oo_twospots=0; array* ick_tails; bool* ick_tailforget; int tailcount = 1; array* ick_hybrids; bool* hyforget; int hybridcount = 1; /* ONESPOT 1 -> 0 */ /* ONESPOT 2 -> 1 */ /* ONESPOT 3 -> 2 */ int main(int argc, char *argv[]) { #ifndef YUK ick_parseargs(argc,argv); #endif ick_skipto = 0; ick_next = calloc(80, sizeof *ick_next); ick_onespots = calloc(3, sizeof *ick_onespots); ick_oneforget = calloc(3, sizeof *ick_oneforget); ick_twospots = calloc(1, sizeof *ick_twospots); ick_twoforget = calloc(1, sizeof *ick_twoforget); ick_tails = calloc(1, sizeof *ick_tails); ick_tailforget = calloc(1, sizeof *ick_tailforget); ick_hybrids = calloc(1, sizeof *ick_hybrids); hyforget = calloc(1, sizeof *hyforget); ick_globalargv0=argv[0]; #ifdef YUK yuklines = 63; yukcommands = 60; globalargv = argv; globalargc = argc; #endif /* set seed for random error generation */ #ifdef USG srand48(time(0) + getpid()); #else srand(time(0)); #endif /* UNIX */ #if MULTITHREAD == 1 ickmtinit(); #endif /* set up ick_stash storage */ ick_stashinit(); /* degenerated code */ ick_restart: top: switch(ick_skipto) { case 0: /* line 001 */ /* PLEASE NOTE THIS IS A BACKTRACKING PERMUTATION PROGRAM */ ick_lineno = 2; NEXTTHREAD; /* line 002 */ /* MAYBE DON'T GIVE UP */ ick_lineno = 3; gonebackto = setjmp(btjb); choicepoint(); if (gonebackto == !(!ICKABSTAINED(1))) { killthread(); return(0); } NEXTTHREAD; /* line 003 */ /* DO .1 <- #0 */ /* Expression is 0x0 */ ick_lineno = 4; { ick_onespots[0] = 0x0; } NEXTTHREAD; /* line 004 */ L3: /* (3) DO (24) NEXT */ ick_lineno = 25; { ick_pushnext(4); goto L24;} case 4:;{; } ick_ccfc = 0; /* line 004 is a suck point for the COME FROM at line 046 */ gonebackto = setjmp(btjb); choicepoint(); if (gonebackto == !(!ICKABSTAINED(43))) { ick_ccfc++; if(ick_ccfc==1||MULTICOME(25,ick_cjb)) if(setjmp(ick_cjb) == 1) goto C44; } ick_skipto = 3; if(ick_ccfc) goto CCF0; else if(setjmp(ick_cjb) == 0) goto CCF0; NEXTTHREAD; /* line 005 */ L4: /* (4) DO (24) NEXT */ ick_lineno = 25; { ick_pushnext(5); goto L24;} case 5:;{; } ick_ccfc = 0; /* line 005 is a suck point for the COME FROM at line 047 */ gonebackto = setjmp(btjb); choicepoint(); if (gonebackto == !(!ICKABSTAINED(44))) { ick_ccfc++; if(ick_ccfc==1||MULTICOME(25,ick_cjb)) if(setjmp(ick_cjb) == 1) goto C45; } ick_skipto = 4; if(ick_ccfc) goto CCF0; else if(setjmp(ick_cjb) == 0) goto CCF0; NEXTTHREAD; /* line 006 */ L5: /* (5) DO (24) NEXT */ ick_lineno = 25; { ick_pushnext(6); goto L24;} case 6:;{; } ick_ccfc = 0; /* line 006 is a suck point for the COME FROM at line 048 */ gonebackto = setjmp(btjb); choicepoint(); if (gonebackto == !(!ICKABSTAINED(45))) { ick_ccfc++; if(ick_ccfc==1||MULTICOME(25,ick_cjb)) if(setjmp(ick_cjb) == 1) goto C46; } ick_skipto = 5; if(ick_ccfc) goto CCF0; else if(setjmp(ick_cjb) == 0) goto CCF0; NEXTTHREAD; /* line 007 */ L6: /* (6) DO (24) NEXT */ ick_lineno = 25; { ick_pushnext(7); goto L24;} case 7:;{; } ick_ccfc = 0; /* line 007 is a suck point for the COME FROM at line 049 */ gonebackto = setjmp(btjb); choicepoint(); if (gonebackto == !(!ICKABSTAINED(46))) { ick_ccfc++; if(ick_ccfc==1||MULTICOME(25,ick_cjb)) if(setjmp(ick_cjb) == 1) goto C47; } ick_skipto = 6; if(ick_ccfc) goto CCF0; else if(setjmp(ick_cjb) == 0) goto CCF0; NEXTTHREAD; /* line 008 */ L7: /* (7) DO (24) NEXT */ ick_lineno = 25; { ick_pushnext(8); goto L24;} case 8:;{; } ick_ccfc = 0; /* line 008 is a suck point for the COME FROM at line 050 */ gonebackto = setjmp(btjb); choicepoint(); if (gonebackto == !(!ICKABSTAINED(47))) { ick_ccfc++; if(ick_ccfc==1||MULTICOME(25,ick_cjb)) if(setjmp(ick_cjb) == 1) goto C48; } ick_skipto = 7; if(ick_ccfc) goto CCF0; else if(setjmp(ick_cjb) == 0) goto CCF0; NEXTTHREAD; /* line 009 */ L8: /* (8) DO (24) NEXT */ ick_lineno = 25; { ick_pushnext(9); goto L24;} case 9:;{; } ick_ccfc = 0; /* line 009 is a suck point for the COME FROM at line 051 */ gonebackto = setjmp(btjb); choicepoint(); if (gonebackto == !(!ICKABSTAINED(48))) { ick_ccfc++; if(ick_ccfc==1||MULTICOME(25,ick_cjb)) if(setjmp(ick_cjb) == 1) goto C49; } ick_skipto = 8; if(ick_ccfc) goto CCF0; else if(setjmp(ick_cjb) == 0) goto CCF0; NEXTTHREAD; /* line 010 */ /* DO READ OUT .1 */ ick_lineno = 11; { ick_pout(ick_onespots[0]); } NEXTTHREAD; /* line 011 */ /* PLEASE RETRIEVE .1 */ ick_lineno = 12; { ICKRETRIEVE(ick_onespots, 0, ONESPOT, ick_oneforget, 00); } NEXTTHREAD; /* line 012 */ /* DO READ OUT .1 */ ick_lineno = 13; { ick_pout(ick_onespots[0]); } NEXTTHREAD; /* line 013 */ /* PLEASE RETRIEVE .1 */ ick_lineno = 14; { ICKRETRIEVE(ick_onespots, 0, ONESPOT, ick_oneforget, 00); } NEXTTHREAD; /* line 014 */ /* DO READ OUT .1 */ ick_lineno = 15; { ick_pout(ick_onespots[0]); } NEXTTHREAD; /* line 015 */ /* PLEASE RETRIEVE .1 */ ick_lineno = 16; { ICKRETRIEVE(ick_onespots, 0, ONESPOT, ick_oneforget, 00); } NEXTTHREAD; /* line 016 */ /* DO READ OUT .1 */ ick_lineno = 17; { ick_pout(ick_onespots[0]); } NEXTTHREAD; /* line 017 */ /* PLEASE RETRIEVE .1 */ ick_lineno = 18; { ICKRETRIEVE(ick_onespots, 0, ONESPOT, ick_oneforget, 00); } NEXTTHREAD; /* line 018 */ /* DO READ OUT .1 */ ick_lineno = 19; { ick_pout(ick_onespots[0]); } NEXTTHREAD; /* line 019 */ /* PLEASE RETRIEVE .1 */ ick_lineno = 20; { ICKRETRIEVE(ick_onespots, 0, ONESPOT, ick_oneforget, 00); } NEXTTHREAD; /* line 020 */ /* DO READ OUT .1 */ ick_lineno = 21; { ick_pout(ick_onespots[0]); } NEXTTHREAD; /* line 021 */ /* DO READ OUT #30 */ ick_lineno = 22; { ick_pout(0x1e); } NEXTTHREAD; /* line 022 */ /* DO COME FROM (22) */ ick_lineno = 23; if(0) {C22: ; NEXTTHREAD;} NEXTTHREAD; /* line 023 */ L22: /* (22) DO GO BACK */ ick_lineno = 22; { choiceback(); } ick_ccfc = 0; /* line 023 is a suck point for the COME FROM at line 022 */ { ick_ccfc++; if(ick_ccfc==1||MULTICOME(22,ick_cjb)) if(setjmp(ick_cjb) == 1) goto C22; } ick_skipto = 22; if(ick_ccfc) goto CCF0; else if(setjmp(ick_cjb) == 0) goto CCF0; NEXTTHREAD; /* line 025 */ L24: /* (24) PLEASE NOTE THIS RETURNS #1 TO #6 ON DIFFERENT BACKTRACKS */ ick_lineno = 26; ick_ccfc = 0; ick_skipto = 24; if(setjmp(ick_cjb) == 0) goto CCF0; NEXTTHREAD; /* line 026 */ /* DO STASH .1 */ ick_lineno = 27; { ICKSTASH(ONESPOT, 0, ick_onespots, 00); } NEXTTHREAD; /* line 027 */ L26: /* (26) DO .1 <- #1 */ /* Expression is 0x1 */ ick_lineno = 33; { ick_onespots[0] = 0x1; } ick_ccfc = 0; /* line 027 is a suck point for the COME FROM at line 034 */ gonebackto = setjmp(btjb); choicepoint(); if (gonebackto == !(!ICKABSTAINED(32))) { ick_ccfc++; if(ick_ccfc==1||MULTICOME(33,ick_cjb)) if(setjmp(ick_cjb) == 1) goto C33; } ick_skipto = 26; if(ick_ccfc) goto CCF0; else if(setjmp(ick_cjb) == 0) goto CCF0; NEXTTHREAD; /* line 028 */ L27: /* (27) DO .1 <- #2 */ /* Expression is 0x2 */ ick_lineno = 35; { ick_onespots[0] = 0x2; } ick_ccfc = 0; /* line 028 is a suck point for the COME FROM at line 036 */ gonebackto = setjmp(btjb); choicepoint(); if (gonebackto == !(!ICKABSTAINED(34))) { ick_ccfc++; if(ick_ccfc==1||MULTICOME(35,ick_cjb)) if(setjmp(ick_cjb) == 1) goto C35; } ick_skipto = 27; if(ick_ccfc) goto CCF0; else if(setjmp(ick_cjb) == 0) goto CCF0; NEXTTHREAD; /* line 029 */ L28: /* (28) DO .1 <- #3 */ /* Expression is 0x3 */ ick_lineno = 37; { ick_onespots[0] = 0x3; } ick_ccfc = 0; /* line 029 is a suck point for the COME FROM at line 038 */ gonebackto = setjmp(btjb); choicepoint(); if (gonebackto == !(!ICKABSTAINED(36))) { ick_ccfc++; if(ick_ccfc==1||MULTICOME(37,ick_cjb)) if(setjmp(ick_cjb) == 1) goto C37; } ick_skipto = 28; if(ick_ccfc) goto CCF0; else if(setjmp(ick_cjb) == 0) goto CCF0; NEXTTHREAD; /* line 030 */ L29: /* (29) DO .1 <- #4 */ /* Expression is 0x4 */ ick_lineno = 39; { ick_onespots[0] = 0x4; } ick_ccfc = 0; /* line 030 is a suck point for the COME FROM at line 040 */ gonebackto = setjmp(btjb); choicepoint(); if (gonebackto == !(!ICKABSTAINED(38))) { ick_ccfc++; if(ick_ccfc==1||MULTICOME(39,ick_cjb)) if(setjmp(ick_cjb) == 1) goto C39; } ick_skipto = 29; if(ick_ccfc) goto CCF0; else if(setjmp(ick_cjb) == 0) goto CCF0; NEXTTHREAD; /* line 031 */ L30: /* (30) DO .1 <- #5 */ /* Expression is 0x5 */ ick_lineno = 41; { ick_onespots[0] = 0x5; } ick_ccfc = 0; /* line 031 is a suck point for the COME FROM at line 042 */ gonebackto = setjmp(btjb); choicepoint(); if (gonebackto == !(!ICKABSTAINED(40))) { ick_ccfc++; if(ick_ccfc==1||MULTICOME(41,ick_cjb)) if(setjmp(ick_cjb) == 1) goto C41; } ick_skipto = 30; if(ick_ccfc) goto CCF0; else if(setjmp(ick_cjb) == 0) goto CCF0; NEXTTHREAD; /* line 032 */ /* DO .1 <- #6 */ /* Expression is 0x6 */ ick_lineno = 33; { ick_onespots[0] = 0x6; } NEXTTHREAD; /* line 033 */ /* DO RESUME #1 */ /* Expression is 0x1 */ ick_lineno = 34; { ick_skipto = ick_resume(0x1); goto top; } NEXTTHREAD; /* line 034 */ /* MAYBE COME FROM (26) */ ick_lineno = 35; if(0) {C33: ; NEXTTHREAD;} NEXTTHREAD; /* line 035 */ /* PLEASE RESUME #1 */ /* Expression is 0x1 */ ick_lineno = 36; { ick_skipto = ick_resume(0x1); goto top; } NEXTTHREAD; /* line 036 */ /* MAYBE COME FROM (27) */ ick_lineno = 37; if(0) {C35: ; NEXTTHREAD;} NEXTTHREAD; /* line 037 */ /* PLEASE RESUME #1 */ /* Expression is 0x1 */ ick_lineno = 38; { ick_skipto = ick_resume(0x1); goto top; } NEXTTHREAD; /* line 038 */ /* MAYBE COME FROM (28) */ ick_lineno = 39; if(0) {C37: ; NEXTTHREAD;} NEXTTHREAD; /* line 039 */ /* PLEASE RESUME #1 */ /* Expression is 0x1 */ ick_lineno = 40; { ick_skipto = ick_resume(0x1); goto top; } NEXTTHREAD; /* line 040 */ /* MAYBE COME FROM (29) */ ick_lineno = 41; if(0) {C39: ; NEXTTHREAD;} NEXTTHREAD; /* line 041 */ /* PLEASE RESUME #1 */ /* Expression is 0x1 */ ick_lineno = 42; { ick_skipto = ick_resume(0x1); goto top; } NEXTTHREAD; /* line 042 */ /* MAYBE COME FROM (30) */ ick_lineno = 43; if(0) {C41: ; NEXTTHREAD;} NEXTTHREAD; /* line 043 */ /* PLEASE RESUME #1 */ /* Expression is 0x1 */ ick_lineno = 45; { ick_skipto = ick_resume(0x1); goto top; } NEXTTHREAD; /* line 045 */ /* PLEASE NOTE THIS BACKTRACKS IF .1 IS NONUNIQUE IN ITS STASH */ ick_lineno = 46; NEXTTHREAD; /* line 046 */ /* MAYBE COME FROM (3) */ ick_lineno = 47; if(0) {C44: ; NEXTTHREAD;} NEXTTHREAD; /* line 047 */ /* MAYBE COME FROM (4) */ ick_lineno = 48; if(0) {C45: ; NEXTTHREAD;} NEXTTHREAD; /* line 048 */ /* MAYBE COME FROM (5) */ ick_lineno = 49; if(0) {C46: ; NEXTTHREAD;} NEXTTHREAD; /* line 049 */ /* MAYBE COME FROM (6) */ ick_lineno = 50; if(0) {C47: ; NEXTTHREAD;} NEXTTHREAD; /* line 050 */ /* MAYBE COME FROM (7) */ ick_lineno = 51; if(0) {C48: ; NEXTTHREAD;} NEXTTHREAD; /* line 051 */ /* MAYBE COME FROM (8) */ ick_lineno = 52; if(0) {C49: ; NEXTTHREAD;} NEXTTHREAD; /* line 052 */ /* PLEASE DO .2 <- .1 */ /* Expression is .1 */ ick_lineno = 53; { ick_onespots[1] = ick_onespots[0]; } NEXTTHREAD; /* line 053 */ /* DO .3 <- #1 */ /* Expression is 0x1 */ ick_lineno = 54; { ick_onespots[2] = 0x1; } NEXTTHREAD; /* line 054 */ /* DO COME FROM '"?"!3~.3'~#1"$#2"~#1'$#15 */ /* Expression is ((((! (! .3)) ^ 0x2) & 0x1) $ 0xf) */ ick_lineno = 55; if(0) { CCF0: if(ick_skipto&&ick_skipto==ick_mingle((((!(!ick_onespots[2])) ^ 0x2) & 0x1), 0xf)) { if(1) { NEXTTHREAD;} else goto CCF1; } else goto CCF1; ick_ccfc++; if(ick_ccfc==1||MULTICOME(55,ick_cjb)) if(setjmp(ick_cjb) == 0) goto CCF1; } NEXTTHREAD; /* line 055 */ /* PLEASE DO RETRIEVE .1 */ ick_lineno = 56; { ICKRETRIEVE(ick_onespots, 0, ONESPOT, ick_oneforget, 00); } NEXTTHREAD; /* line 056 */ /* DO ABSTAIN "?"!1~.1'~#1"$#1"~#3 FROM (55) */ /* Expression is (0x2 - (! .1)) */ ick_lineno = 57; { ICKABSTAINED(55)+=(0x2 - (!ick_onespots[0])); } NEXTTHREAD; /* line 057 */ /* DO REINSTATE (55) */ ick_lineno = 58; { if(ICKABSTAINED(55)) ICKABSTAINED(55)--; } NEXTTHREAD; /* line 058 */ L55: /* (55) DO GO BACK AGAIN */ ick_lineno = 59; ick_oldabstain = ICKABSTAINED(55); ICKABSTAINED(55) = 0; if (!ick_oldabstain) { choiceback(); } ick_ccfc = 0; ick_skipto = 55; if(setjmp(ick_cjb) == 0) goto CCF0; NEXTTHREAD; /* line 059 */ L87: /* (87) PLEASE DO .3 <- '?.1$.2'~#21845 */ /* Expression is ((.1 ^ .2) & 0xff) */ ick_lineno = 60; { ick_onespots[2] = ((ick_onespots[0] ^ ick_onespots[1]) & 0xff); } ick_ccfc = 0; ick_skipto = 87; if(setjmp(ick_cjb) == 0) goto CCF0; NEXTTHREAD; /* line 060 */ /* DO GO AHEAD */ ick_lineno = 61; { choiceahead(); } NEXTTHREAD; /* line 061 */ /* DO COME FROM (61) */ ick_lineno = 62; if(0) {C59: ; NEXTTHREAD;} NEXTTHREAD; /* line 062 */ L61: /* (61) PLEASE DO GO BACK */ ick_lineno = 59; { choiceback(); } ick_ccfc = 0; /* line 062 is a suck point for the COME FROM at line 061 */ { ick_ccfc++; if(ick_ccfc==1||MULTICOME(59,ick_cjb)) if(setjmp(ick_cjb) == 1) goto C59; } ick_skipto = 61; if(ick_ccfc) goto CCF0; else if(setjmp(ick_cjb) == 0) goto CCF0; NEXTTHREAD; } #ifdef YUK if(yukloop) goto ick_restart; #endif ick_lose(E633, 63, (char *)0); CCFL: ; CCF1: longjmp(ick_cjb,1); return 0; } /* Generated code for permute.i ends here */