export fn _start() noreturn { assert(add(3, 4) == 150); assert(add(20, 10) == 90); exit(); } fn add(a: u32, b: u32) u32 { const x = if (a < b) blk: { const c = a + b; // 7 const d = a + c; // 10 const e = d + b; // 14 const f = d + e; // 24 const g = e + f; // 38 const h = f + g; // 62 const i = g + h; // 100 const j = i + d; // 110 break :blk j; } else blk: { const c = a + b; // 30 const d = b + c; // 40 const e = b + d; // 50 break :blk e; }; const y = x + a; // 130 / 70 const z = y + a; // 150 / 90 return z; } pub fn assert(ok: bool) void { if (!ok) unreachable; // assertion failure } fn exit() noreturn { asm volatile ("syscall" : : [number] "{rax}" (231), [arg1] "{rdi}" (0) : "rcx", "r11", "memory" ); unreachable; }