[nix-shell:~/dev/zig/build-release]$ cat test.zig export fn _start() noreturn { add(3, 4); exit(); } fn add(a: u32, b: u32) void { 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 assert(j == 110); } 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; } [nix-shell:~/dev/zig/build-release]$ time ./zig-cache/bin/zig build-exe test.zig real 0m0.004s user 0m0.003s sys 0m0.001s [nix-shell:~/dev/zig/build-release]$ strace ./test execve("./test", ["./test"], 0x7ffc9dc8ae90 /* 128 vars */) = 0 exit_group(0) = ? +++ exited with 0 +++ [nix-shell:~/dev/zig/build-release]$ objdump -d ./test -M intel ./test: file format elf64-x86-64 Disassembly of section .text: 0000000008000000 <_start>: 8000000: 55 push rbp 8000001: 48 89 e5 mov rbp,rsp 8000004: bf 03 00 00 00 mov edi,0x3 8000009: be 04 00 00 00 mov esi,0x4 800000e: ff 14 25 08 00 00 04 call QWORD PTR ds:0x4000008 8000015: ff 14 25 10 00 00 04 call QWORD PTR ds:0x4000010 800001c: 5d pop rbp 800001d: c3 ret 800001e: 79 73 jns 8000093 8000020: 63 61 6c movsxd esp,DWORD PTR [rcx+0x6c] 8000023: 6c ins BYTE PTR es:[rdi],dx ... 0000000008000025 : 8000025: 55 push rbp 8000026: 48 89 e5 mov rbp,rsp 8000029: 48 8b c6 mov rax,rsi 800002c: 48 01 f8 add rax,rdi 800002f: 48 01 c7 add rdi,rax 8000032: 48 01 fe add rsi,rdi 8000035: 48 8b c6 mov rax,rsi 8000038: 48 01 f8 add rax,rdi 800003b: 48 01 c6 add rsi,rax 800003e: 48 01 f0 add rax,rsi 8000041: 48 01 c6 add rsi,rax 8000044: 48 01 fe add rsi,rdi 8000047: 48 83 fe 6e cmp rsi,0x6e 800004b: 48 0f 94 c7 rex.W sete dil 800004f: ff 14 25 18 00 00 04 call QWORD PTR ds:0x4000018 8000056: 5d pop rbp 8000057: c3 ret 8000058: 00 00 add BYTE PTR [rax],al 800005a: 31 ff xor edi,edi 800005c: 0f 05 syscall 800005e: cc int3 800005f: 55 push rbp 8000060: 48 55 rex.W push rbp 8000062: 48 89 e5 mov rbp,rsp 8000065: 55 push rbp 8000066: 48 89 e5 mov rbp,rsp 0000000008000069 : 8000069: 55 push rbp 800006a: 48 89 e5 mov rbp,rsp 800006d: b8 e7 00 00 00 mov eax,0xe7 8000072: 31 ff xor edi,edi 8000074: 0f 05 syscall 8000076: cc int3 8000077: 55 push rbp 8000078: 48 89 e5 mov rbp,rsp 000000000800007b : 800007b: 55 push rbp 800007c: 48 89 e5 mov rbp,rsp 800007f: 48 83 f7 01 xor rdi,0x1 8000083: 48 f6 c7 01 rex.W test dil,0x1 8000087: 0f 84 01 00 00 00 je 800008e 800008d: cc int3 800008e: e9 00 00 00 00 jmp 8000093 8000093: 5d pop rbp 8000094: c3 ret 8000095: 7b 72 jnp 8000109 8000097: 61 (bad) 8000098: 78 7b js 8000115 800009a: 72 61 jb 80000fd 800009c: 78 .byte 0x78 000000000800009d : 800009d: 7b 72 61 78 7d 00 64 69 {rax}.di 00000000080000a5 : 80000a5: 7b 72 64 69 7d 00 73 63 {rdi}.sc 00000000080000ad : 80000ad: 73 79 73 63 61 6c 6c 00 syscall.