code: def fibonacci_program():
      """More complicated, fibonacci program: computes fib(n): fib(0) = fib(1) = 1.
  
      Returns:
        program: Full-powered `instructions.Program` that computes fib(n).
      """
      entry = instructions.Block(name="entry")
      enter_fib = instructions.Block(name="enter_fib")
      recur1 = instructions.Block(name="recur1")
      recur2 = instructions.Block(name="recur2")
      recur3 = instructions.Block(name="recur3")
      finish = instructions.Block(name="finish")
      # pylint: disable=bad-whitespace
      entry.assign_instructions(
          [
              instructions.PushGotoOp(instructions.halt(), enter_fib),
          ]
      )
      # Definition of fibonacci function starts here
      enter_fib.assign_instructions(
          [
              instructions.prim_op(
                  ["n"], "cond", lambda n: n > 1
              ),  # cond = n > 1
              instructions.BranchOp("cond", recur1, finish),  # if cond
          ]
      )
      recur1.assign_instructions(
          [
              instructions.PopOp(["cond"]),  #   done with cond now
              instructions.prim_op(
                  ["n"], "nm1", lambda n: n - 1
              ),  #   nm1 = n - 1
              instructions.push_op(
                  ["nm1"], ["n"]
              ),  #   fibm1 = fibonacci(nm1)
              instructions.PopOp(["nm1"]),  #     done with nm1
              instructions.PushGotoOp(recur2, enter_fib),
          ]
      )
      recur2.assign_instructions(
          [
              instructions.push_op(["ans"], ["fibm1"]),  #     ...
              instructions.PopOp(["ans"]),  #     pop callee's "ans"
              instructions.prim_op(
                  ["n"], "nm2", lambda n: n - 2
              ),  #   nm2 = n - 2
              instructions.PopOp(["n"]),  #   done with n
              instructions.push_op(
                  ["nm2"], ["n"]
              ),  #   fibm2 = fibonacci(nm2)
              instructions.PopOp(["nm2"]),  #     done with nm2
              instructions.PushGotoOp(recur3, enter_fib),
          ]
      )
      recur3.assign_instructions(
          [
              instructions.push_op(["ans"], ["fibm2"]),  #     ...
              instructions.PopOp(["ans"]),  #     pop callee's "ans"
              instructions.prim_op(
                  ["fibm1", "fibm2"], "ans", lambda x, y: x + y
              ),  #   ans = fibm1 + fibm2
              instructions.PopOp(
                  ["fibm1", "fibm2"]
              ),  #   done with fibm1, fibm2
              instructions.IndirectGotoOp(),  #   return ans
          ]
      )
      finish.assign_instructions(
          [  # else:
              instructions.PopOp(["n", "cond"]),  #   done with n, cond
              instructions.prim_op([], "ans", lambda: 1),  #   ans = 1
              instructions.IndirectGotoOp(),  #   return ans
          ]
      )
  
      fibonacci_blocks = [
          entry,
          enter_fib,
          recur1,
          recur2,
          recur3,
          finish,
      ]
  
      # pylint: disable=bad-whitespace
      fibonacci_vars = {
          "n": instructions.single_type(np.int64, ()),
          "cond": instructions.single_type(np.bool_, ()),
          "nm1": instructions.single_type(np.int64, ()),
          "fibm1": instructions.single_type(np.int64, ()),
          "nm2": instructions.single_type(np.int64, ()),
          "fibm2": instructions.single_type(np.int64, ()),
          "ans": instructions.single_type(np.int64, ()),
      }
  
      return instructions.Program(
          instructions.ControlFlowGraph(fibonacci_blocks),
          [],
          fibonacci_vars,
          ["n"],
          "ans",
      )
  
file_path: probability/tensorflow_probability/python/experimental/auto_batching/test_programs.py
imports: import numpy
  from tensorflow_probability.python.experimental.auto_batching import instructions
label_desc: Use image node_id 6 for calling a global function with example usage: fibonacci_program() and returns: instructions