program main
  fn base() -> i64
    i64 2147483648 : i64
  fn adjust(value: i64, delta: i64) -> i64
    binary + : i64
      var value : i64
      var delta : i64
  fn doubled(value: i64) -> i64
    binary * : i64
      var value : i64
      i64 2 : i64
  fn local_total() -> i64
    local let offset : unit
      i64 -7 : i64
    call adjust : i64
      binary - : i64
        call doubled : i64
          call base : i64
        i64 0 : i64
      var offset : i64
  fn high_enough(value: i64) -> bool
    if : bool
      binary > : bool
        var value : i64
        i64 4294967280 : i64
      binary < : bool
        var value : i64
        i64 4294967300 : i64
      bool false : bool
  fn exact_i64() -> bool
    binary = : bool
      call local_total : i64
      i64 4294967289 : i64
  fn main() -> i32
    call std.io.print_i64 : unit
      call local_total : i64
    if : i32
      call high_enough : bool
        call local_total : i64
      int 0 : i32
      int 1 : i32
  test "i64 arithmetic returns exact fixture value"
    call exact_i64 : bool
  test "i64 comparison works in predicates"
    call high_enough : bool
      call local_total : i64
  test "i64 division and ordering"
    if : bool
      binary >= : bool
        binary / : i64
          call local_total : i64
          i64 3 : i64
        i64 1431655763 : i64
      binary <= : bool
        binary / : i64
          call local_total : i64
          i64 3 : i64
        i64 1431655763 : i64
      bool false : bool
