summaryrefslogtreecommitdiff
path: root/out.c
diff options
context:
space:
mode:
Diffstat (limited to 'out.c')
-rw-r--r--out.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/out.c b/out.c
index 9994c0d..e733d42 100644
--- a/out.c
+++ b/out.c
@@ -12,6 +12,7 @@ typedef float f32;
typedef double f64;
typedef unsigned char bool;
typedef struct { void *data; u64 n; } slice_;
+static slice_ mkslice_(void *data, u64 n) { slice_ ret; ret.data = data; ret.n = n; return ret; }
#define false ((bool)0)
#define true ((bool)1)
@@ -39,17 +40,17 @@ i64 foo(void) {
i64 N; {
i64 expr__; expr__ = 10;N = expr__;}
slice_ numbers; {
- slice_ expr__; slice_ a0_; a0_.data = calloc(N, sizeof(i64)); a0_.n = N;expr__ = a0_;numbers = expr__;}
+ slice_ expr__; expr__ = mkslice_(calloc(N, sizeof(i64)), N);numbers = expr__;}
i64 i; {
i64 expr__; expr__ = 0;i = expr__;}
while ((i<N)) {
(((i64(*))(numbers.data))[i]) = i;;
i = (i+1);;
};
- slice_ a2_; { slice_ of__ = numbers; u64 a3_ = 5; a2_.data = (i64(*))(of__.data) + a3_; a2_.n = 7 - a3_; }
- slice_ a4_; { slice_ of__ = numbers; u64 a5_ = 2; a4_.data = (i64(*))(of__.data) + a5_; a4_.n = of__.n - 1 - a5_; }
- slice_ a6_; { slice_ of__ = numbers; u64 a7_ = 0; a6_.data = (i64(*))(of__.data) + a7_; a6_.n = 6 - a7_; }
- return (((((i64(*))(a2_.data))[1])+(((i64(*))(a4_.data))[0]))+(((i64(*))(a6_.data))[3]));
+ slice_ a1_; { slice_ of__ = numbers; u64 a2_ = 5; a1_.data = (i64(*))(of__.data) + a2_; a1_.n = 7 - a2_; }
+ slice_ a3_; { slice_ of__ = numbers; u64 a4_ = 2; a3_.data = (i64(*))(of__.data) + a4_; a3_.n = of__.n - 1 - a4_; }
+ slice_ a5_; { slice_ of__ = numbers; u64 a6_ = 0; a5_.data = (i64(*))(of__.data) + a6_; a5_.n = 6 - a6_; }
+ return (((((i64(*))(a1_.data))[1])+(((i64(*))(a3_.data))[0]))+(((i64(*))(a5_.data))[3]));
}