# stage2: implement TZIR printing for \`block\` and \`condbr\` · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/3715ed7b54d4382a4495eb041ff3f9ad987bacfb)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 3715ed7b54d4382a4495eb041ff3f9ad987bacfb

Requested commit: 3715ed7b54d4382a4495eb041ff3f9ad987bacfb

Commit: 3715ed7b54d4382a4495eb041ff3f9ad987bacfb

Tree: 8dde2b6b018a97e2a943006225519d349371d2bb

Author: Timon Kruiper

Committer: Timon Kruiper

## Message

````
stage2: implement TZIR printing for `block` and `condbr`

Zig code:
```
fn assert(ok: bool) void {
    if (!ok) unreachable;
}
```

TZIR:
```
Module.Function(name=assert):
  @0: void = {};
  %0: bool = arg(ok)
  %1: void = dbg_stmt()
  %2: void = block(
    %3: bool = not(%0)
    %4: noreturn = condbr(%3,
    then:
      %5: void = breakpoint()
      %6: noreturn = unreach()
    else:
      %7: noreturn = br(%2, @0)
    )
  )
  %8: noreturn = retvoid()
```

````

## Parents

- [36950815a464c9226783fcdf1190af38950b7405](https://git.cafe/gitcafe/zig/commit/36950815a464c9226783fcdf1190af38950b7405?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/3715ed7b54d4382a4495eb041ff3f9ad987bacfb?format=markdown)
