def extract_branches blocks

      branches = []
      blocks.each do |block|
        block.each do |stmt|
          case stmt
          when GotoStatement
            next if stmt.identifiers.length < 2
            unless stmt.identifiers.length == 2
              fail "Unexpected goto statement: #{stmt}"
            end

            if annotation = stmt.previous_sibling
              fail "Expected :branchcond annotation" unless
                annotation.has_attribute?(:branchcond)
            end

            branches.push(stmt)
          end
        end
      end
      return branches
    end
def extract_branches blocks

      branches = []
      blocks.each do |block|
        block.each do |stmt|
          case stmt
          when GotoStatement
            next if stmt.identifiers.length < 2
            unless stmt.identifiers.length == 2
              fail "Unexpected goto statement: #{stmt}"
            end

            if annotation = stmt.previous_sibling
              fail "Expected :branchcond annotation" unless
                annotation.has_attribute?(:branchcond)
            end

            branches.push(stmt)
          end
        end
      end
      return branches
    end
Given a set of blocks, returns 'GotoStatement's of branches