137 lines
1.6 KiB
Plaintext
137 lines
1.6 KiB
Plaintext
fn while0(arg: s32) s32
|
|
{
|
|
>a: s32 = arg;
|
|
while (a < 10)
|
|
{
|
|
a = a + 1;
|
|
}
|
|
|
|
return a;
|
|
}
|
|
|
|
fn while1(arg: s32) s32
|
|
{
|
|
>a: s32 = 1;
|
|
if (arg)
|
|
{
|
|
}
|
|
else
|
|
{
|
|
while (a < 10)
|
|
{
|
|
a = a + 1;
|
|
}
|
|
}
|
|
|
|
return a;
|
|
}
|
|
|
|
fn while2(arg: s32) s32
|
|
{
|
|
>sum: s32 = 0;
|
|
>i: s32 = 0;
|
|
|
|
while (i < arg)
|
|
{
|
|
i = i + 1;
|
|
>j: s32 = 0;
|
|
while (j < arg)
|
|
{
|
|
sum = sum + j;
|
|
j = j + 1;
|
|
}
|
|
}
|
|
|
|
return sum;
|
|
}
|
|
|
|
fn while3(arg: s32) s32
|
|
{
|
|
>a: s32 = 1;
|
|
>b: s32 = 2;
|
|
|
|
while (a < 10)
|
|
{
|
|
if (a == 2)
|
|
{
|
|
a = 3;
|
|
}
|
|
else
|
|
{
|
|
b = 4;
|
|
}
|
|
}
|
|
|
|
return b;
|
|
}
|
|
|
|
fn while4(arg: s32) s32
|
|
{
|
|
>a: s32 = 1;
|
|
>b: s32 = 2;
|
|
|
|
while (a < 10)
|
|
{
|
|
if (a == 2)
|
|
{
|
|
a = 3;
|
|
}
|
|
else
|
|
{
|
|
b = 4;
|
|
}
|
|
|
|
b = b + 1;
|
|
a = a + 1;
|
|
}
|
|
|
|
return b;
|
|
}
|
|
|
|
fn while5(arg: s32) s32
|
|
{
|
|
>a: s32 = 1;
|
|
while (a < 10)
|
|
{
|
|
a = a + 1;
|
|
a = a + 2;
|
|
}
|
|
|
|
return a;
|
|
}
|
|
|
|
fn while6(arg: s32) s32
|
|
{
|
|
>a: s32 = 1;
|
|
while (arg)
|
|
{
|
|
a = 2;
|
|
}
|
|
|
|
return a;
|
|
}
|
|
|
|
fn while7(arg: s32) s32
|
|
{
|
|
>a: s32 = 1;
|
|
while (a < 10)
|
|
{
|
|
>b: s32 = a + 1;
|
|
a = b + 2;
|
|
}
|
|
|
|
return a;
|
|
}
|
|
|
|
fn[cc(.c)] main[export]() s32
|
|
{
|
|
return while0(0) +
|
|
while1(1) +
|
|
while2(2) +
|
|
while3(3) +
|
|
while4(4) +
|
|
while5(5) +
|
|
while6(6) +
|
|
while7(7);
|
|
}
|