231
|
1 #include "stdio.h"
|
|
2
|
|
3 #define __environment _CbC_environment
|
|
4 #define __return _CbC_return
|
|
5
|
|
6
|
|
7 struct arg {
|
|
8 int a0;int a1;int a2;int a3;int a4;
|
|
9 };
|
|
10
|
|
11 extern void exit(int);
|
|
12
|
|
13 void *exit_env;
|
|
14 __code (*exit___code)();
|
|
15
|
|
16 // #ifndef __llvm__
|
|
17 __code carg2(int arg0,int arg1,int arg2,int arg3,int arg4,__code(*exit1)(int, void*),void *env);
|
|
18 __code cargs(struct arg args0,__code exit1(int, void*),void *env);
|
|
19 __code carg4(struct arg args0,struct arg args1,int i, int j,int k,int l);
|
|
20 __code carg5(struct arg args0,struct arg args1,int i, int j,int k,int l);
|
|
21 __code carg6(int i, int j,int k,int l,struct arg args0);
|
|
22 // #endif
|
|
23
|
|
24 __code carg1(int arg0,int arg1,int arg2,int arg3,int arg4,__code(*exit1)(int, void*),void *env)
|
|
25 {
|
|
26 printf("#0017:arg1: %d %d %d %d %d : %x %x\n",arg0,arg1,arg2,arg3,arg4,exit1==exit___code,env==exit_env);
|
|
27 goto carg2(arg1,arg2,arg3,arg4,arg0,exit1,env);
|
|
28 }
|
|
29
|
|
30 __code carg2(int arg0,int arg1,int arg2,int arg3,int arg4,__code(*exit1)(int, void*),void *env)
|
|
31 {
|
|
32 struct arg args0;
|
|
33 printf("#0024:arg1: %d %d %d %d %d : %x %x\n",arg0,arg1,arg2,arg3,arg4,exit1==exit___code,env==exit_env );
|
|
34 args0.a0 = arg0;
|
|
35 args0.a1 = arg1;
|
|
36 args0.a2 = arg2;
|
|
37 args0.a3 = arg3;
|
|
38 args0.a4 = arg4;
|
|
39 goto cargs(args0,exit1,env);
|
|
40 }
|
|
41
|
|
42 __code cargs(struct arg args0,__code exit1(int, void*),void *env)
|
|
43 {
|
|
44 printf("#0035:args: %d %d %d %d %d : %x %x\n",
|
|
45 args0.a0,args0.a1,args0.a2,args0.a3,args0.a4,
|
|
46 exit1==exit___code,env==exit_env);
|
|
47 // goto exit1(321),env;
|
|
48 goto (*exit1)(0,env);
|
|
49 }
|
|
50
|
|
51
|
|
52 __code carg3(struct arg args0,struct arg args1,int i, int j,int k,int l)
|
|
53 {
|
|
54 printf("#0045:args3: %d %d %d %d %d : %x %x %x %x\n",
|
|
55 args0.a0,args0.a1,args0.a2,args0.a3,args0.a4,i,j,k,l);
|
|
56 printf("#0047:args3: args0 %d %d %d %d %d : args1 %d %d %d %d %d : %x %x %x %x\n",
|
|
57 args0.a0,args0.a1,args0.a2,args0.a3,args0.a4,
|
|
58 args1.a0,args1.a1,args1.a2,args1.a3,args1.a4,
|
|
59 i,j,k,l);
|
|
60 if (args0.a0==args1.a0) exit(0);
|
|
61 goto carg4(args0,args1,j,k,l,i);
|
|
62 }
|
|
63
|
|
64 __code carg4(struct arg args0,struct arg args1,int i, int j,int k,int l)
|
|
65 {
|
|
66 printf("#0057:args4: %d %d %d %d %d : %x %x %x %x\n",
|
|
67 args0.a0,args0.a1,args0.a2,args0.a3,args0.a4,i,j,k,l);
|
|
68 goto carg5(args1,args0,j,k,l,i);
|
|
69 }
|
|
70
|
|
71 __code carg5(struct arg args0,struct arg args1,int i, int j,int k,int l)
|
|
72 {
|
|
73 printf("#0064:args5: %d %d %d %d %d : %x %x %x %x\n",
|
|
74 args0.a0,args0.a1,args0.a2,args0.a3,args0.a4,i,j,k,l);
|
|
75 goto carg6(i,j,k,l,args0);
|
|
76 }
|
|
77
|
|
78 __code carg6(int i, int j,int k,int l,struct arg args0)
|
|
79 {
|
|
80 printf("#0071:args6: %d %d %d %d %d : %x %x %x %x\n",
|
|
81 args0.a0,args0.a1,args0.a2,args0.a3,args0.a4,i,j,k,l);
|
|
82 goto carg3(args0,args0,i,j,k,l);
|
|
83 }
|
|
84
|
|
85 int main1(int n)
|
|
86 {
|
|
87 goto carg1(0,1,2,3,4,exit___code=__return,exit_env=__environment);
|
|
88 return n;
|
|
89 }
|
|
90
|
|
91 struct arg a00;
|
|
92 struct arg a01;
|
|
93
|
|
94 int main( int ac, char *av[])
|
|
95 {
|
|
96 int n;
|
|
97 n = main1(123);
|
|
98 printf("#0089:321=%d\n",n);
|
|
99
|
|
100 a00.a0 = 11;
|
|
101 a00.a1 = 22;
|
|
102 a00.a2 = 33;
|
|
103 a00.a3 = 44;
|
|
104 a00.a4 = 55;
|
|
105 a01.a0 = 66;
|
|
106 a01.a1 = 77;
|
|
107 a01.a2 = 88;
|
|
108 a01.a3 = 99;
|
|
109 a01.a4 = 10;
|
|
110 goto carg3(a00,a01,1,2,3,4);
|
|
111 }
|
|
112
|